Communitygithub.com

Tekton — 与智能体共同设计架构的一致模型

Tekton 是一个共享的架构意图基础层,用于与智能体(Agent)共同设计系统。它使用一个类型化的 YAML 模型,覆盖六个层级(系统 / 旅程 / 数据 / 基础设施 / 决策 / 质量),并支持 Mermaid 和自定义 HTML 查看器渲染。

Tekton — 与智能体共同设计架构的一致模型 是什么?

Tekton 是一个面向人类与 AI 智能体(如 Claude Code、Cursor 等)协作进行架构设计的工具。它的核心思想是将架构设计存储在一个可读可写的 YAML 模型中,使得人类和智能体都能基于同一份上下文进行编辑、查询和推理。该模型覆盖六个层级:系统、用户旅程、数据、基础设施、决策和质量,并通过跨层级查询(`tekton query`)实现端到端的可追溯性。Tekton 支持多种导出方式,包括 Mermaid 图表(智能体可读且 GitHub 原生支持)和自包含的选项卡式 HTML 查看器(人类友好,基于 elkjs 布局引擎)。此外,它还内置了校验、lint(包含适应度函数)和几何审计功能,确保模型的质量。Tekton 特别适合需要与智能体深度协作进行架构设计的场景,但不适合一次性临时图表或仅包含文字描述的 ADR。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/broomva/skills/tree/HEAD/skills/design/tekton

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Tekton — 在一份共享模型上共同设计架构

简介

一个用于人类↔智能体架构协作的基础层。设计存在于一个 YAML 模型中,我们双方都能编辑;Git 是往返的载体。你看到它(HTML 查看器);我读写同一个模型。我们在相同的上下文中思考。

它解决的问题:手工编写的 HTML/SVG 文档是终端渲染——你无法遍历、查询或编辑它,并且其图表不携带任何含义。Tekton 将实时模型上移到渲染的上游。

引擎

scripts/tekton.py(Python 3,依赖 pyyaml)。本体定义在 references/ontology.md 中。

python3 scripts/tekton.py validate <model.arch.yaml>       # 完整性检查
python3 scripts/tekton.py lint     <model.arch.yaml>       # v0.2 — 适应度函数;违规时退出码为 1
python3 scripts/tekton.py stats    <model.arch.yaml>       # 节点/边/状态/规则计数
python3 scripts/tekton.py views                            # 列出 6 种视图
python3 scripts/tekton.py mermaid  <model.arch.yaml> <view># 原始 mermaid(可嵌入/智能体可读)
python3 scripts/tekton.py render   <model.arch.yaml> [-o out.html]  # 品牌 HTML 查看器
python3 scripts/tekton.py query    <model.arch.yaml> <from> <to>    # 跨层级路径

v0.2 本体升级(来自架构评审)

  • 包含关系 — 任何节点上的 parent: + boundary 类型;查看器渲染嵌套分组,双击可折叠/展开(C4 风格的向下钻取)。
  • 生命周期 — 节点上的 status:(current|target|deprecated;target 渲染为虚线 = 同一模型中的现状与未来状态)以及决策上的完整 Nygard ADR 字段(context、consequences、status、supersedes)。
  • 质量属性 — qualities: 块;NFR 通过 constrains 约束元素;在详情面板 + 专用视图中展示。
  • 适应度函数 — rules: 块(forbid-dep、no-cycle、layer-order);tekton lint 可作为 CI 门禁(退出码 1)。设计循环的独立验证器。

智能体在设计会话中的使用方式

  1. 定位/创建模型:<project>/docs/design/<name>.arch.yaml(临时使用 examples/ 目录)。
  2. 边思考边修改 — 随着对话揭示组件、流程、数据、基础设施和 ADR,直接向 YAML 中添加/调整节点、边和决策。
  3. 每次实质性编辑后执行 validate + lint(检查悬空引用、错误类型、适应度规则)。
  4. render,然后——在将查看器呈现为正确之前——运行几何审计:bash tests/visual-audit.sh <model.arch.yaml>。它会在无头模式下渲染每个视图,并在出现节点重叠或空捕获时失败。没有它就声称“图表正确”正是第一个内部试用(dogfood)所捕获的确切失败(组内边断开、节点重复——这些对 DOM 计数探测不可见,仅通过几何审计捕获)。在 URL 中使用 #<view> 深度链接到某个视图。
  5. query 以回答可追溯性问题(“这影响什么?”),而不是猜测。
  6. 引导 → 重复。 人类编辑 YAML 或查看器意图;git diff 是交接的凭证。

已知的装饰性残余(非审计失败):旅程中的自循环边会使 ELK 在任意步骤处中断循环(循环必须在某处断开);在密集分组中,相邻的平行边标签可能靠得很近。

约定

  • 模型文件:*.arch.yaml。渲染后的查看器:*.view.html(可选择加入 gitignore 或提交)。
  • 每个有界系统一个模型;通过 external 节点 + uses 边链接系统。
  • 决策(ADR)是一等公民节点——将它们钉在它们所govern的内容上。
  • Category-C HTML 报告成为模型的下游导出产物,而非真理来源。

渲染 — 为什么不是 Mermaid

主要查看器是自定义渲染器,而非 Mermaid。Mermaid 的主题化能力上限无法表达 Broomva 设计系统(OKLCH 蓝色轴、磨砂卡片、有资格获得的玻璃效果、彗星光晕),且其 dagre 布局在密集图上性能下降。替代方案:elkjs 在浏览器中计算布局(纯 JS → 输出仍为单个自包含的 HTML 文件),节点绘制为 Broomva 磨砂卡片(玻璃效果保留给浮动详情面板,遵循设计系统中“玻璃效果是赚来的”规则)。设计令牌(Design Tokens)从 Broomva 设计系统内联生成。tekton mermaid 仅保留为一次性嵌入/智能体可读的目标。

路线图(v0 → v2)

  • v0.2(当前): YAML 模型 · validate + lint(适应度函数) · 6 种视图 · 品牌 elkjs 查看器(包含关系折叠/展开,现状与未来状态,点击追踪,玻璃效果详情面板) · 跨层级查询 · Mermaid 回退嵌入。
  • v1: 双向往返(在查看器中拖拽/编辑 → 序列化回 YAML);MCP 服务器(已验证的突变,确保智能体无法发出无效模型);引入完整的 Broomva 设计系统以构建 React-Flow 交互式画布。
  • v2: CRDT(loro)实时人类↔智能体协同编辑;实时同步到 Prosopon 作为表现层。

状态

v0 内部试用 — 内部设计工具。在≥3 个真实系统上使用过一次设计循环后(三回原则),再技能化(已测试 + 注册)。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

broomva/skills

Local TTS, voice cloning, voice design, and video dubbing via the OmniVoice Studio MCP server (open-source ElevenLabs alternative; nothing leaves the machine, runs on MPS/CUDA/CPU). Use when: (1) generating speech from text in any of 646 languages, (2) cloning a voice from a 3-second reference clip, (3) designing a voice by gender/age/accent/pitch/style, (4) dubbing a video into another language, (5) listing voice profiles or personality presets, (6) producing narration where privacy, cost, or absent API keys matter, (7) non-English narration where Edge TTS/kokoro fall short, (8) batch audio for blog posts or content pipelines. Triggers: 'omnivoice', 'voice clone', 'clone this voice', 'tts', 'narrate', 'generate speech', 'voice synthesis', 'dub video', 'voice design', 'local tts', 'multilingual voice', 'narrate this post', 'elevenlabs alternative'.

broomva/skills

>- Speak an explanation out loud while working in any project — tiered text-to-speech with a pluggable backend (ElevenLabs by default and quota-guarded, macOS `say` via `--fast` for free instant local speech, local OmniVoice as an unlimited private tier). Markdown-aware, so code fences, URLs and deep paths collapse to short spoken placeholders instead of being dictated character by character, while snake_case identifiers survive intact so the listener can still search for them. Every utterance is saved to disk for later replay. Also carries a **talk mode** toggle: turn it on and the agent speaks a full readback of every turn, for as long as that session lasts — the whole response, not a summary of it, with `brief` and `marker` levels for when you want less. Talk mode is off by default and scoped to the single session that enabled it, so parallel agents in other worktrees stay silent. Use when the user asks to hear something rather than read it — an explanation of a change, a walkthrough of what just happen...

broomva/skills

Shop Tiendas D1 (Colombia, d1.com.co) from the command line — search the catalogue, resolve your nearest physical store, price a basket against that store's real stock, and quote delivery. D1 runs VTEX IO (account `d1tiendas`), so this drives its public storefront API with no admin key at all — catalogue and cart work fully anonymously, and a one-time emailed code unlocks order history. Handles the two traps that make naive D1 automation wrong — availability is regionalized (an unregioned query reports a national catalogue nobody can actually buy from) and prices arrive in two different units (search reports whole pesos, checkout reports hundredths, a silent 100x). Builds and prices baskets; it deliberately cannot pay, handing a checkout URL to a human instead. USE WHEN the user wants to find D1 products or prices, check whether D1 delivers somewhere, build or cost a D1 grocery basket, compare D1 items, or review their D1 orders. NOT FOR other Colombian retailers (Éxito, Jumbo, Ara, Alkosto), and not for c...

broomva/skills

Stateful, local-first household toxics inventory + swap engine. Identify the items in a home that carry endocrine disruptors and persistent chemicals (BPA/BPS, phthalates, PFAS/PTFE, parabens, flame retardants, VOCs, microplastics), score each by *real* exposure (severity x presence x how it's used x condition), and track the swap to a safer alternative from "flagged" -> "sourced" -> "swapped". Ships a grounded, cited knowledge graph of ~20 hazards, ~40 item-classes, and ~40 alternatives. Hands sourcing off to the `procurer` skill. The skill's state is the source of truth — the agent is the app.

broomva/skills

Generate a polished Remotion video and X thread showcasing the full agent skills inventory. Use when creating social media content about skills, rendering category-based skill visualizations, or producing animated showcases of agent capabilities. Triggers on "skills video", "showcase skills", "skills thread", "render skills", "social content for skills", or requests to visualize the skills inventory.

broomva/skills

OpenCaptions extension for Content Engine — adds intent-driven CWI (Caption With Intent) captions to the post-production pipeline. Hooks into the grade → caption → final stage. Generates captions that understand video intent (pitch, volume, emotion, emphasis) and style themselves accordingly with variable font weight, size, and color. Uses the OpenCaptions CLI or MCP server. Triggers on: 'add captions', 'opencaptions', 'CWI captions', 'intent captions'.

broomva/skills

Produce polished product launch videos using the Liquid Glass aesthetic — dark void backgrounds, 3D perspective floating UI panels, particle effects, spring animations, and cinematic pacing. Built on Remotion with Imagen 4.0 for frames and Veo 3.1 for B-roll. Use when: (1) creating a product demo or launch video, (2) showcasing a UI/app/tool with cinematic polish, (3) building a social-ready video from screenshots and renders, (4) applying the liquid glass floating panel style, (5) composing Remotion videos with 3D transforms and spring animations. Triggers on: 'launch video', 'product video', 'liquid glass video', 'demo video', 'showcase video', 'remotion video', 'floating panel', 'glass aesthetic'.

相关技能