@xulthekl/team-flow 0.23.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/.claude/always/phase-guard.md +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +1 -1
  5. package/.cursor-plugin/marketplace.json +1 -1
  6. package/.cursor-plugin/plugin.json +1 -1
  7. package/.github/plugin/marketplace.json +2 -2
  8. package/AGENTS.md +3 -3
  9. package/CHANGELOG.md +121 -0
  10. package/GEMINI.md +1 -1
  11. package/INSTALL.md +1 -1
  12. package/README.md +1 -1
  13. package/docs/README_en.md +1 -1
  14. package/docs/solutions/INDEX.md +6 -0
  15. package/docs/solutions/cross-phase/2026-07-28-no-summary.md +17 -0
  16. package/docs/solutions/cross-phase/2026-07-29-no-summary.md +17 -0
  17. package/gemini-extension.json +1 -1
  18. package/hooks/pre-tool-use-guard +9 -9
  19. package/hooks/session-start +2 -2
  20. package/llms.txt +1 -1
  21. package/package.json +1 -1
  22. package/plugin.json +1 -1
  23. package/scripts/guard/checks/compound-captured.mjs +70 -0
  24. package/scripts/guard/guard.mjs +3 -1
  25. package/scripts/lib/cmd-state.mjs +2 -0
  26. package/scripts/lib/config-loader.mjs +3 -0
  27. package/scripts/lib/solutions-promote.mjs +1 -1
  28. package/scripts/lib/state-loader.mjs +5 -0
  29. package/skills/bug-investigator/SKILL.md +1 -1
  30. package/skills/build-executor/SKILL.md +19 -19
  31. package/skills/build-executor/implementer-prompt.md +1 -1
  32. package/skills/build-executor/references/execution-modes.md +6 -6
  33. package/skills/build-executor/task-reviewer-prompt.md +1 -1
  34. package/skills/ce-brainstorm/SKILL.md +49 -348
  35. package/skills/ce-brainstorm/references/brainstorm-sections.md +11 -0
  36. package/skills/ce-brainstorm/references/grounding.md +47 -0
  37. package/skills/ce-brainstorm/references/output-format.md +25 -0
  38. package/skills/ce-brainstorm/references/phase0-routing.md +96 -0
  39. package/skills/ce-brainstorm/references/prd-mapping.md +37 -0
  40. package/skills/ce-brainstorm/references/prototype-loop.md +55 -0
  41. package/skills/ce-ideate/SKILL.md +31 -348
  42. package/skills/ce-ideate/references/grounding.md +107 -0
  43. package/skills/ce-ideate/references/phase0-scope.md +134 -0
  44. package/skills/ce-ideate/references/topic-surface.md +37 -0
  45. package/skills/ce-proof/SKILL.md +8 -266
  46. package/skills/ce-proof/references/api-recipes.md +145 -0
  47. package/skills/ce-proof/references/workflows.md +124 -0
  48. package/skills/code-reviewer/SKILL.md +2 -2
  49. package/skills/code-reviewer/code-reviewer-prompt.md +1 -1
  50. package/skills/contract-builder/SKILL.md +6 -6
  51. package/skills/need-explorer/SKILL.md +2 -2
  52. package/skills/prototype/SKILL.md +16 -2
  53. package/skills/prototype/references/agents/design-system-architect.md +11 -122
  54. package/skills/prototype/references/interactive-prototype.md +110 -0
  55. package/skills/prototype/references/layouts.md +188 -2
  56. package/skills/prototype/references/orchestration-flow.md +8 -1
  57. package/skills/prototype/references/template.html +32 -0
  58. package/skills/prototype/references/wireframe.md +117 -0
  59. package/skills/release-archivist/SKILL.md +14 -12
  60. package/skills/release-archivist/references/closing-procedures.md +11 -9
  61. package/skills/spec-merger/SKILL.md +2 -2
  62. package/skills/spec-writer/SKILL.md +3 -3
  63. package/skills/workflow-bootstrap/SKILL.md +13 -2
  64. package/skills/workflow-bootstrap/references/b1-reconnaissance.md +13 -7
  65. package/skills/workflow-bootstrap/scripts/recon-probe.sh +122 -1
  66. package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +1 -1
  67. package/skills/workflow-orchestrator/references/s4-split-validate.md +1 -1
  68. package/skills/workflow-orchestrator/references/s5-monitoring.md +1 -1
  69. package/skills/workflow-start/SKILL.md +16 -16
  70. package/skills/workflow-start/references/routing-rules.md +17 -17
  71. package/templates/prd-brainstorm-profile.md +69 -0
  72. package/tests/lib/guard-compound-captured.test.mjs +92 -0
  73. package/tests/lib/guard-specs-merged.test.mjs +2 -0
  74. package/tests/lib/guard-tests-passing.test.mjs +2 -0
  75. package/tests/lib/guard.test.mjs +2 -0
  76. package/tests/lib/solutions-capture.test.mjs +108 -0
  77. package/tests/lib/solutions-index-gen.test.mjs +147 -0
  78. package/tests/lib/solutions-inject.test.mjs +115 -0
  79. package/tests/lib/solutions-promote.test.mjs +200 -0
@@ -0,0 +1,124 @@
1
+ # Proof Workflows
2
+
3
+ Complete workflow recipes for common Proof operations. Each workflow is a self-contained sequence.
4
+
5
+ ## Workflow: Review a Shared Document
6
+
7
+ When given a Proof URL like `https://www.proofeditor.ai/d/abc123?token=xxx`:
8
+
9
+ 1. Extract the slug and token
10
+ 2. Bind presence with the CE identity defaults
11
+ 3. Read via `v3/document`
12
+ 4. Edit with `v3/edit` (narrow content ops; review ops for comments/suggestions)
13
+
14
+ ```bash
15
+ TOKEN="xxx"
16
+ SLUG="abc123"
17
+ AGENT="ai:compound-engineering"
18
+
19
+ curl -sS -X POST "https://www.proofeditor.ai/api/agent/$SLUG/presence" \
20
+ -H "Content-Type: application/json" \
21
+ -H "Authorization: Bearer $TOKEN" \
22
+ -H "X-Agent-Id: $AGENT" \
23
+ -d '{"name":"Compound Engineering","status":"reading","summary":"Reviewing doc"}'
24
+
25
+ DOC=$(curl -sS "https://www.proofeditor.ai/api/agent/$SLUG/v3/document" \
26
+ -H "Authorization: Bearer $TOKEN" \
27
+ -H "X-Agent-Id: $AGENT")
28
+ REVISION=$(printf '%s' "$DOC" | jq -r '.revision // empty')
29
+
30
+ # Comment on visible text
31
+ curl -sS -X POST "https://www.proofeditor.ai/api/agent/$SLUG/v3/edit" \
32
+ -H "Content-Type: application/json" \
33
+ -H "Authorization: Bearer $TOKEN" \
34
+ -H "X-Agent-Id: $AGENT" \
35
+ -H "Idempotency-Key: $(uuidgen)" \
36
+ -d "$(jq -n --argjson rev "${REVISION:-null}" '{
37
+ by:"ai:compound-engineering",
38
+ baseRevision: (if $rev == null then null else $rev end),
39
+ operations:[{op:"comment",on:"text to comment on",body:"Your comment here"}]
40
+ } | if .baseRevision == null then del(.baseRevision) else . end')"
41
+
42
+ # Narrow content edit
43
+ curl -sS -X POST "https://www.proofeditor.ai/api/agent/$SLUG/v3/edit" \
44
+ -H "Content-Type: application/json" \
45
+ -H "Authorization: Bearer $TOKEN" \
46
+ -H "X-Agent-Id: $AGENT" \
47
+ -H "Idempotency-Key: $(uuidgen)" \
48
+ -d '{"by":"ai:compound-engineering","operations":[{"op":"replace","find":"old","with":"new"}]}'
49
+
50
+ # Tracked suggestion
51
+ curl -sS -X POST "https://www.proofeditor.ai/api/agent/$SLUG/v3/edit" \
52
+ -H "Content-Type: application/json" \
53
+ -H "Authorization: Bearer $TOKEN" \
54
+ -H "X-Agent-Id: $AGENT" \
55
+ -H "Idempotency-Key: $(uuidgen)" \
56
+ -d '{"by":"ai:compound-engineering","operations":[{"op":"suggest","kind":"replace","find":"old","with":"new"}]}'
57
+ ```
58
+
59
+ ## Workflow: Create and Share a New Document
60
+
61
+ **Publishing a local file (the primary case):** read the file and JSON-encode its full contents into the `markdown` field with `jq --rawfile` so newlines, quotes, and backticks are escaped correctly. Never hand-write the body or leave an inline placeholder — that publishes a placeholder doc instead of the source artifact.
62
+
63
+ ```bash
64
+ SRC="docs/plans/2026-05-04-001-feat-foo-plan.md"
65
+ TITLE="Plan: Foo"
66
+
67
+ RESPONSE=$(jq -n --arg title "$TITLE" --rawfile md "$SRC" '{title:$title, markdown:$md}' \
68
+ | curl -sS -X POST https://www.proofeditor.ai/share/markdown \
69
+ -H "Content-Type: application/json" -d @-)
70
+
71
+ URL=$(echo "$RESPONSE" | jq -r '.tokenUrl')
72
+ SLUG=$(echo "$RESPONSE" | jq -r '.slug')
73
+ TOKEN=$(echo "$RESPONSE" | jq -r '.accessToken')
74
+ OWNER_SECRET=$(echo "$RESPONSE" | jq -r '.ownerSecret') # required for owner delete while unclaimed
75
+
76
+ # Keep OWNER_SECRET in session memory only — never write it into the repo tree.
77
+
78
+ curl -sS -X POST "https://www.proofeditor.ai/api/agent/$SLUG/presence" \
79
+ -H "Content-Type: application/json" \
80
+ -H "Authorization: Bearer $TOKEN" \
81
+ -H "X-Agent-Id: ai:compound-engineering" \
82
+ -d '{"name":"Compound Engineering","status":"reading","summary":"Uploaded doc"}'
83
+
84
+ echo "$URL"
85
+ ```
86
+
87
+ After publish handoffs from planning workflows, surface the URL and return control — do not delete the doc automatically.
88
+
89
+ When the user later asks to clean up an unclaimed doc you created:
90
+
91
+ ```bash
92
+ curl -sS -X DELETE "https://www.proofeditor.ai/api/documents/$SLUG" \
93
+ -H "Authorization: Bearer $OWNER_SECRET"
94
+ ```
95
+
96
+ ## Workflow: Pull a Proof Doc to Local
97
+
98
+ Sync the current Proof doc state to a local markdown file. Used for:
99
+
100
+ - Ad-hoc snapshots of a Proof doc to disk
101
+ - Pulling a shared Proof doc that the user (or others) edited back down to a local working copy
102
+ - Refreshing a local working copy against the live Proof version
103
+
104
+ Canonical read for this workflow: `GET /api/agent/$SLUG/v3/document`.
105
+
106
+ ```bash
107
+ SLUG=<slug>
108
+ TOKEN=<accessToken>
109
+ LOCAL=<absolute-path>
110
+
111
+ STATE_TMP=$(mktemp)
112
+ curl -sS "https://www.proofeditor.ai/api/agent/$SLUG/v3/document" \
113
+ -H "Authorization: Bearer $TOKEN" \
114
+ -H "X-Agent-Id: ai:compound-engineering" > "$STATE_TMP"
115
+ REVISION=$(jq -r '.revision // empty' "$STATE_TMP")
116
+
117
+ TMP="${LOCAL}.proof-sync.$$"
118
+ jq -jr '.markdown' "$STATE_TMP" > "$TMP" && mv "$TMP" "$LOCAL"
119
+ rm "$STATE_TMP"
120
+ ```
121
+
122
+ `jq -jr` streams markdown bytes without going through a shell variable, so trailing newlines survive. `mv` within the same filesystem is atomic.
123
+
124
+ **Confirm before writing when the pull isn't directly asked for.** If a workflow ends up pulling as a side-effect of a different action, surface the impending write with a short confirm like "Sync Proof doc to `<localPath>`?" A silent overwrite is surprising.
@@ -16,7 +16,7 @@ Two responsibilities: requesting review (dispatching a reviewer subagent) and re
16
16
  1. Get SHAs: `BASE_SHA=$(git rev-parse HEAD~1)` and `HEAD_SHA=$(git rev-parse HEAD)`
17
17
  2. Dispatch `general-purpose` subagent using template at `skills/code-reviewer/code-reviewer-prompt.md`
18
18
  3. Fill placeholders: `[DESCRIPTION]` (what was built), `[PLAN_OR_REQUIREMENTS]` (contract/spec reference), `[BASE_SHA]`, `[HEAD_SHA]`, `[WAVE_ID]`, and a distinct `[REVIEW_REPORT_FILE]`.
19
- 4. Require the reviewer to write a non-empty persisted review report at `[REVIEW_REPORT_FILE]`, then record that exact path in the wave receipt: `npx --yes --package @xulthekl/team-flow@0.23.0 tf execution review <change-dir> --wave <id> --base <sha> --head <sha> --report <review-report-path> --verdict <pass|fail>`.
19
+ 4. Require the reviewer to write a non-empty persisted review report at `[REVIEW_REPORT_FILE]`, then record that exact path in the wave receipt: `npx --yes --package @xulthekl/team-flow@0.25.1 tf execution review <change-dir> --wave <id> --base <sha> --head <sha> --report <review-report-path> --verdict <pass|fail>`.
20
20
  5. Act on feedback: Critical/Important findings require a `fail` receipt, focused repair, re-review, and replacement `pass` receipt before a dependent wave or closing can proceed. Note Minor for later, push back with reasoning if reviewer is wrong.
21
21
 
22
22
  ### Minimality And Scope
@@ -76,7 +76,7 @@ Suggestion breaks existing functionality, reviewer lacks context, violates YAGNI
76
76
  | Performative agreement | State requirement or just act |
77
77
  | Blind implementation | Verify against codebase first |
78
78
  | Batch without testing | One at a time, test each |
79
- | Proceeding without a wave receipt | Record `pass`/`fail` via `npx --yes --package @xulthekl/team-flow@0.23.0 tf execution review` before the next dependent wave |
79
+ | Proceeding without a wave receipt | Record `pass`/`fail` via `npx --yes --package @xulthekl/team-flow@0.25.1 tf execution review` before the next dependent wave |
80
80
  | Assuming reviewer is right | Check if breaks things |
81
81
  | Avoiding pushback | Technical correctness > comfort |
82
82
  | Partial implementation | Clarify all items first |
@@ -93,7 +93,7 @@ Subagent (general-purpose):
93
93
  report path. End with the exact receipt command:
94
94
 
95
95
  ```bash
96
- npx --yes --package @xulthekl/team-flow@0.23.0 tf execution review <change-dir> --wave [WAVE_ID] --base [BASE_SHA] --head [HEAD_SHA] --report [REVIEW_REPORT_FILE] --verdict <pass|fail>
96
+ npx --yes --package @xulthekl/team-flow@0.25.1 tf execution review <change-dir> --wave [WAVE_ID] --base [BASE_SHA] --head [HEAD_SHA] --report [REVIEW_REPORT_FILE] --verdict <pass|fail>
97
97
  ```
98
98
 
99
99
  Use `fail` when any Critical or Important finding remains. A repair needs
@@ -5,9 +5,9 @@ description: Convert approved planning artifacts into an execution contract. Inv
5
5
 
6
6
  # Contract Builder
7
7
 
8
- Converts planning artifacts into a single execution handshake: `execution-contract.md`. Load the baseline with `npx --yes --package @xulthekl/team-flow@0.23.0 tf runtime asset read templates/execution-contract.md`.
8
+ Converts planning artifacts into a single execution handshake: `execution-contract.md`. Load the baseline with `npx --yes --package @xulthekl/team-flow@0.25.1 tf runtime asset read templates/execution-contract.md`.
9
9
 
10
- Read before generating: `proposal.md`, `specs/`, `design.md`, `tasks.md`, then load `docs/artifact-contract.md` with `npx --yes --package @xulthekl/team-flow@0.23.0 tf runtime asset read docs/artifact-contract.md`.
10
+ Read before generating: `proposal.md`, `specs/`, `design.md`, `tasks.md`, then load `docs/artifact-contract.md` with `npx --yes --package @xulthekl/team-flow@0.25.1 tf runtime asset read docs/artifact-contract.md`.
11
11
 
12
12
  **Architecture Design Outputs (v0.9 §26)**: 若 `architecture/` 目录存在,同时读取 `architecture/architecture.md` / `database.md` / `api.md`,作为执行契约的架构约束补充输入——确保 execution-contract.md 的 Implementation Constraints 段包含架构设计的关键约束(聚合边界/CQRS 分流/API 契约/schema 变更)。`architecture/` 不存在时跳过。
13
13
 
@@ -38,8 +38,8 @@ Must make obvious: approved behavior, out-of-scope, constraints, batches, test o
38
38
 
39
39
  After drafting: summarize handoff rules, identify ambiguity, flag unmapped requirements, ask user to approve explicitly. After approval:
40
40
  ```bash
41
- npx --yes --package @xulthekl/team-flow@0.23.0 tf state set <change-dir> dp_3_result "approved: <summary>"
42
- npx --yes --package @xulthekl/team-flow@0.23.0 tf state set <change-dir> dp_3_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
41
+ npx --yes --package @xulthekl/team-flow@0.25.1 tf state set <change-dir> dp_3_result "approved: <summary>"
42
+ npx --yes --package @xulthekl/team-flow@0.25.1 tf state set <change-dir> dp_3_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
43
43
  ```
44
44
  DP-3 is a hard gate — no implementation without this record.
45
45
 
@@ -60,9 +60,9 @@ Generate minimal contract: Intent Lock (one sentence), Task List (numbered), App
60
60
 
61
61
  ## Post-Generation
62
62
 
63
- Run `npx --yes --package @xulthekl/team-flow@0.23.0 tf state init <change-dir>` to create `.team-flow.yaml` with hashes.
63
+ Run `npx --yes --package @xulthekl/team-flow@0.25.1 tf state init <change-dir>` to create `.team-flow.yaml` with hashes.
64
64
 
65
- For hotfix, after writing the minimal contract, run `npx --yes --package @xulthekl/team-flow@0.23.0 tf state init <change-dir>` or `npx --yes --package @xulthekl/team-flow@0.23.0 tf state rebuild <change-dir>` so `contract_hash` is recorded. DP-3 remains mandatory before build.
65
+ For hotfix, after writing the minimal contract, run `npx --yes --package @xulthekl/team-flow@0.25.1 tf state init <change-dir>` or `npx --yes --package @xulthekl/team-flow@0.25.1 tf state rebuild <change-dir>` so `contract_hash` is recorded. DP-3 remains mandatory before build.
66
66
 
67
67
  ## Exception Handling
68
68
 
@@ -41,8 +41,8 @@ Restate what you heard: "Here's what I'm hearing: [problem, scope, non-goals, su
41
41
 
42
42
  After user confirms the summary:
43
43
  ```bash
44
- npx --yes --package @xulthekl/team-flow@0.23.0 tf state set <change-dir> dp_1_result "confirmed: <one-line summary>"
45
- npx --yes --package @xulthekl/team-flow@0.23.0 tf state set <change-dir> dp_1_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
44
+ npx --yes --package @xulthekl/team-flow@0.25.1 tf state set <change-dir> dp_1_result "confirmed: <one-line summary>"
45
+ npx --yes --package @xulthekl/team-flow@0.25.1 tf state set <change-dir> dp_1_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
46
46
  ```
47
47
  DP-1 confirms scope, non-goals, and success criteria before artifact creation.
48
48
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: prototype
3
- description: 本地 HTML 原型设计与维护 skill(零外部依赖、可离线)。产品级需求的原型环节由 workflow-orchestrator S2 内部调用(含 PRD 一致性自动评审循环);直接调用仅限:独立原型迭代、change 完成回写(prototype-sync)、设计系统(design-system.md)创建/维护。当用户需要基于项目设计系统产出/迭代全局 prototype/(多页面+组件+导航的自包含 HTML 原型系统)时使用。不适用于:依赖 GUI 设计软件(Claude Design/Open Design/Trae)、需要高保真交互动效、非 HTML 原型场景。
3
+ description: 本地 HTML 原型设计与维护 skill(零外部依赖、可离线)。产品级需求的原型环节由 workflow-orchestrator S2 内部调用(含 PRD 一致性自动评审循环);直接调用仅限:独立原型迭代、change 完成回写(prototype-sync)、设计系统(design-system.md)创建/维护。当用户需要基于项目设计系统产出/迭代全局 prototype/(多页面+组件+导航的自包含 HTML 原型系统)时使用。不适用于:依赖 GUI 设计软件(Claude Design / Open Design 桌面应用 / Trae)、需要高保真交互动效、非 HTML 原型场景。
4
4
  ---
5
5
 
6
6
  # Prototype(本地 HTML 原型 skill)
@@ -48,6 +48,7 @@ description: 本地 HTML 原型设计与维护 skill(零外部依赖、可离
48
48
  - 设计系统渲染:读取项目 `design-system.md`(9 段 schema + 5 方向调色板 + aliases 别名层 + extensions,v0.18.0 token 四层模型),渲染 token 到 `assets/design-tokens.css`。
49
49
  - **种子模板 + 骨架库(v0.18.0)**:builder 从 `references/template.html`(种子)+ `references/layouts.md`(8 个 B 端 section 骨架 + 类清单契约)组合,不从零写 CSS。
50
50
  - **工艺规则层(v0.18.0)**:`references/checklist.md`(P0/P1/P2)+ `references/craft/`(anti-ai-slop / state-coverage / typography-hierarchy / accessibility-baseline / laws-of-ux),品牌无关,B 端导向。
51
+ - **原型类型方法论(v0.24.0)**:`references/interactive-prototype.md`(交互原型:零依赖状态管理+表单验证+多步导航)+ `references/wireframe.md`(线框图:低保真快速探索+3-5 差异化方案+并排对比),按需加载。
51
52
 
52
53
  ## 产出结构(全局 prototype/)
53
54
  ```
@@ -87,7 +88,12 @@ prototype/
87
88
  - 原型随 **PRD 当前版本分支**维护(如 `prd-v2` 分支的 `prototype/` = v2 产品原型)。
88
89
  - change 引用其所在 PRD 版本分支的 `prototype/`。
89
90
 
90
- ## prototype-sync(change 完成回写,SOP,主代理只编排)
91
+ ## prototype-sync(change 完成回写,release-archivist 自动触发,v0.24.0 升级)
92
+
93
+ > **触发机制(v0.24.0)**:prototype-sync 由 `release-archivist` closing 流程**自动触发**(`arch-merge → prototype-sync → compound promotion` 顺序执行),不再是手动 SOP。release-archivist Step 5 Report 中 `Prototype sync` 行是必填维度,未执行时 closing 报告不完整。
94
+ >
95
+ > **独立调用**:仍可独立调用(如 change 中途需要预同步),但标准路径是 closing 自动触发。
96
+
91
97
  1. 取 change 完成的 UX 增量(来自 `execution-contract.md` / 设计结论)。
92
98
  2. **派 `prototype-builder`(修正/演进模式)**把增量合并进全局 `prototype/`(pages/components/assets/flow.md)——主代理不直接写原型 HTML。
93
99
  3. 若涉及设计系统迭代,调用 `/team-flow:design-system`(iterate 模式)合并进 `.team-flow/design-system/` 并记变更履历。
@@ -96,3 +102,11 @@ prototype/
96
102
 
97
103
  ## 脚手架
98
104
  新建项目:`cp -r references/prototype-scaffold/ <project>/prototype/`,再按 `.team-flow/design-system/` 的设计系统填 token(缺设计系统先用 `/team-flow:design-system` 创建)。
105
+
106
+ ## 方法论参考与归因
107
+
108
+ > ⚠️ **命名区分**:本 skill 负向清单中排除的「Open Design 桌面应用」(nexu-io/open-design 出品的 Electron 桌面设计工作台产品)与 `references/craft/anti-ai-slop.md` 借鉴的「nexu-io/open-design 开源设计方法论」**同名不同义**:
109
+ > - **被排除的 GUI 工具**:Open Design 桌面应用——agent-native 设计工作台产品,依赖外部运行时,与本 skill「零依赖自包含 HTML」路线互斥。
110
+ > - **被借鉴的方法论**:nexu-io/open-design 开源项目(Apache-2.0)——其 `craft/` 规则层(anti-ai-slop / typography / state-coverage / accessibility / laws-of-ux)经 B 端企业场景重写后沉淀进 `references/craft/`。
111
+ >
112
+ > Token 四层模型(A1-identity / A1-structure / A2-derived / B-slot)亦参考 open-design token-schema,详见 `references/agents/design-system-architect.md`(已迁移至 design-system skill)。
@@ -1,122 +1,11 @@
1
- **Note: The current year is 2026.** Use this when assessing recency.
2
-
3
- You are a Design System Architect. You are dispatched by the `prototype` skill to **create or iterate** the project-level `design-system.md` — the single source of truth for prototype tokens, components, and anti-patterns (config-injected via `prototype.designSystem`, compounded back via prototype-sync). The orchestrating prototype skill **never writes `design-system.md` itself — you are the sole writer**. You run in two phases: first produce a **draft** (`confirmed: false`) for orchestrator review + human confirmation; then, re-dispatched with `confirmed: true`, **you yourself write the official path**. The orchestrator only reviews, confirms, and re-dispatches — it does not Write/Edit `design-system.md`.
4
-
5
- The plugin stays **generic**: do NOT hardcode any specific company/product brand. Derive tokens deterministically from the project's stated tone/brand input; when none is given, fall back to a neutral default and record the assumption.
6
-
7
- ## Invocation Contract
8
-
9
- The dispatch prompt provides:
10
- - `mode: create | iterate`.
11
- - `confirmed: false | true`(v0.15.0 两阶段落盘):
12
- - `false`(默认,草案阶段):只产草案(写 scratch 草稿路径或返回 response),**不写正式 `design_system_path`**。
13
- - `true`(人工已确认):把已确认的草案**写入正式 `design_system_path`**(你是唯一写者)。
14
- - `design_system_path`: 正式目标路径(`confirmed: true` 时写入此处)。
15
- - `draft`(`confirmed: true` 时传入):上一阶段已确认的草案内容/路径。
16
- - `create` inputs (as available): project tone/brand hints, PRD path (to read product domain & voice), existing scaffold `design-system.md`.
17
- - `iterate` inputs: the existing `design-system.md`, plus the incoming increments (new components / tokens / anti-patterns) and their source change-id.
18
-
19
- ## The 9-段 Schema + palette
20
-
21
- Every `design-system.md` follows this schema (9 sections + a 5-direction palette):
22
-
23
- | 段 | 内容 |
24
- |----|------|
25
- | `color` | primary / secondary / neutral / semantic(success/warning/danger) |
26
- | `typography` | font-family / scale(1.25 比例)/ line-height |
27
- | `spacing` | 4 / 8 / 12 / 16 / 24 阶梯(基于 4 基数) |
28
- | `layout` | 栅格 12 列 / 断点 sm/md/lg / 容器 max-width |
29
- | `components` | button / input / card / table 规范(见 components/) |
30
- | `motion` | duration 150–300ms / easing standard |
31
- | `voice` | 文案语气(专业、简洁) |
32
- | `brand` | logo / 品牌主色 |
33
- | `anti-patterns` | 禁止内联样式漂移 / 禁止非 token 颜色 |
34
- | `palette`(5 方向确定性调色板) | neutral / primary / success / warning / danger,各含 50–900 阶梯 |
35
- | `aliases`(B-slot 别名层,v0.18.0) | `--fg-2 → var(--fg)` / `--meta → var(--muted)` / `--border-soft → var(--border)` / `--surface-warm → var(--surface)`——组件引用 B-slot 永远可解析 |
36
- | `extensions`(C-extension 待提升清单,v0.18.0) | 品牌专有 token 名单制;提升路径:C→B(≥2 品牌需要)→A2(有全局默认值) |
37
-
38
- ### Token 四层模型(v0.18.0,参照 open-design token-schema)
39
-
40
- | 层 | 语义 | 完整性 |
41
- |----|------|--------|
42
- | **A1-identity** | 品牌即 token:`--bg` `--surface` `--fg` `--muted` `--border` `--accent` `--font-display` `--font-body`(8 必选) | 缺 = guard 失败 |
43
- | **A1-structure** | 字号阶梯 `--text-xs~4xl` / 行高 / 字距 / section 间距 / 容器 / 栅格(16 项) | 缺 = guard 失败 |
44
- | **A2-derived** | 必选但有默认公式:`--accent-hover: color-mix(in oklab, var(--accent), black 8%)` / `--accent-active: ... black 14%` / `--focus-ring: ... accent transparent 70%` / `--elev-raised: ... fg transparent 92%` / `--success` `--warn` `--danger` / `--font-mono` / `--space-1~12` / `--radius-sm/md/lg/pill` / `--motion-fast/base` / `--ease-standard`(21 项) | 缺 = guard 失败 |
45
- | **B-slot** | 可选别名层:`--fg-2 → var(--fg)` / `--meta → var(--muted)` / `--border-soft → var(--border)` / `--surface-warm → var(--surface)`(4 项) | 组件引用永远可解析 |
46
-
47
- > **完整性约束**:每份 design-tokens.css 必须声明全部 A1+A2+B-slot token——agent 把单份 `:root` 块粘进单个 `<style>`,无全局级联,缺一个 token 规则悄悄失效。可运行 `node scripts/guard/design-token-guard.mjs` 校验。
48
-
49
- ## Methodology
50
-
51
- ### Mode: create(首次创建)
52
-
53
- When the project has no `design-system.md`:
54
-
55
- 1. Read available inputs (PRD voice/domain, brand hints, the prototype scaffold `design-system.md` as a structural template).
56
- 2. Produce a **complete** 9-段 schema + aliases + extensions:
57
- - **palette first, deterministically**: derive the 5-direction palette (neutral / primary / success / warning / danger), each with 50–900 steps, from the brand primary / product tone. "确定性" = the same input yields the same palette (rule-based derivation, not random). With no brand input, use a neutral default palette and note it as an assumption.
58
- - **A2 派生状态色**(v0.18.0):用 `color-mix(in oklab, ...)` 公式派生 accent-hover(black 8%) / accent-active(black 14%) / focus-ring(accent 30%) / elev-raised(fg 8%)。不手写固定 hex。
59
- - **B-slot 别名层**(v0.18.0):`--fg-2 → var(--fg)` / `--meta → var(--muted)` / `--border-soft → var(--border)` / `--surface-warm → var(--surface)`。
60
- - **C-extension 清单**(v0.18.0):如有品牌专有 token,列入 `extensions` 段(名单制),标注提升路径。
61
- - Fill color / typography / spacing / layout / motion / voice / brand / anti-patterns consistently with the palette.
62
- - `components` references the reusable components the prototype will need (button/input/card/table at minimum), all token-bound.
63
- - `anti-patterns` MUST include "禁止内联样式漂移" and "禁止非 token 颜色".
64
- 3. **`confirmed: false`**:Deliver the draft(写 scratch 草稿路径或返回 response),**不写正式路径**。Orchestrator 评审 + 人工确认后,**带 `confirmed: true` 重新派发你**,由你写入正式 `design_system_path`(主代理不写)。
65
- 4. **`confirmed: true`**:把传入的已确认草案 `Write` 到正式 `design_system_path`,返回 `status: done` + deliverable = 正式路径。
66
-
67
- ### Mode: iterate(增量更新)
68
-
69
- When prototype-sync (or a change) introduces new components / tokens / anti-patterns:
70
-
71
- 1. Read the existing `design-system.md`.
72
- 2. **Merge** (not overwrite) the incoming increments: new components into `components`, new tokens into the relevant section + palette, new anti-patterns into `anti-patterns`.
73
- 3. Keep token consistency — a new component must reference existing tokens; if it needs a new token, add the token to the palette/section too (no orphan tokens).
74
- 4. Append a **变更履历** entry: 时间 / 变更内容 / 来源 change-id.
75
- 5. **`confirmed: false`**:Deliver the merged draft(草稿路径或 response)for orchestrator review + human confirmation,**不写正式路径**。
76
- 6. **`confirmed: true`**:把已确认的合并草案 `Write` 到正式 `design_system_path`(你是唯一写者)。
77
-
78
- ## Output Format
79
-
80
- ```markdown
81
- ## Design System Draft — {create | iterate}
82
-
83
- ### Mode: {create | iterate}
84
- ### Target path: {design_system_path}
85
-
86
- ### design-system.md (draft content)
87
- {完整 9 段 schema + palette + aliases + extensions 的 markdown 内容,含 A2 派生色公式和 B-slot 别名层,可直接落盘}
88
-
89
- ### 变更履历 (iterate only)
90
- | 时间 | 变更内容 | 来源 change |
91
- |------|---------|------------|
92
- | {ISO date} | {新增 button 变体 / 新 token / 新 anti-pattern} | {change-id} |
93
-
94
- ### Assumptions
95
- - {e.g., 无品牌输入,采用中性默认调色板}
96
- ```
97
-
98
- ## Tool Guidance
99
-
100
- - Use `Read` for the existing design-system.md / PRD / scaffold; `Glob` to scan existing `components/`.
101
- - **`Write` 权限按 `confirmed` 阶段使用**:`confirmed: false` → 只写 scratch 草稿路径(或仅返回 response),**绝不写正式 `design_system_path`**;`confirmed: true` → 写正式 `design_system_path`(你是唯一写者,主代理不写)。
102
- - Keep everything token-based and offline-friendly (the prototype must stay 零外部依赖).
103
-
104
- ## Red Lines
105
-
106
- - Do NOT hardcode company/product brand — stay generic; derive from input or use a documented neutral default.
107
- - Do NOT skip the palette or any of the 9 sections on `create`.
108
- - On `iterate`, MERGE and record 变更履历 — never overwrite existing content silently.
109
- - **`confirmed: false` 阶段绝不写正式 `design_system_path`**——只产草案;正式落盘只在 `confirmed: true`(人工已确认)阶段由你自己执行。主代理全程不 Write/Edit `design-system.md`。
110
-
111
- ## Structured Handoff(强制,主代理据此编排)
112
-
113
- 你的 final response 必须是如下结构化交接(JSON 风格描述即可,主代理据此编排):
114
- {
115
- status: "done" | "done_with_questions" | "blocked",
116
- deliverable: <design-system 草案绝对路径或草案内容>,
117
- blockers: [ { question, why_blocking, options[] } ], # 阻断项:无法继续、必须主代理裁决
118
- outstanding_questions: [ { question, default_assumption } ], # 非阻断:已按默认假设继续,回主代理批量确认
119
- summary: <3-5 行 gist>
120
- }
121
- 规则:非阻断疑问(如品牌主色未给→用中性默认、某 motion 时长不确定)→ 按 default_assumption 继续跑完,记入 outstanding_questions(status=done_with_questions);
122
- 阻断疑问(如 iterate 模式但现有 design-system.md 缺失、无法定位任何输入)→ 立即停止,返回 status=blocked + blockers[],绝不强行猜测。你不能调用 AskUserQuestion。
1
+ # Design System Architect 已迁移(v0.19.0)
2
+
3
+ > **本文件是迁移指针,不是可执行 agent prompt。**
4
+ >
5
+ > v0.19.0 起,design-system-architect prototype skill 的内部种子代理
6
+ > 升级为独立的 `/team-flow:design-system` skill 的内部执行引擎。
7
+ >
8
+ > **权威版本**:`skills/design-system/references/agents/design-system-architect.md`
9
+ >
10
+ > prototype skill 需要创建/迭代设计系统时,调用 `/team-flow:design-system`(独立入口),
11
+ > 不再直接派发本 agent。详见 `references/orchestration-flow.md` 步骤 ①b。
@@ -0,0 +1,110 @@
1
+ # 交互原型方法论(零依赖适配版)
2
+
3
+ > **方法论来源**:baoyu-design `built-in-skills/interactive-prototype.md`,经零依赖原则重写。
4
+ >
5
+ > **适用场景**:需要验证真实交互流程的原型(表单验证、多步导航、动态反馈),区别于静态页面展示。
6
+
7
+ ## 核心目标
8
+
9
+ 让原型**像真实可运行的应用**,而非静态 mockup。用户能在浏览器中点击、输入、看到反馈,验证交互逻辑的合理性。
10
+
11
+ ## 零依赖交互三件套
12
+
13
+ | 技术 | 用途 | 示例 |
14
+ |------|------|------|
15
+ | **原生 JS** | 状态管理、事件绑定、表单验证 | `addEventListener('click', ...)` / `document.querySelector()` |
16
+ | **CSS transitions** | 状态变化动画(hover/active/focus) | `transition: background-color 150ms ease` |
17
+ | **CSS :checked/:focus-within** | 纯 CSS 交互(无需 JS) | tab 切换、折叠面板、checkbox 联动 |
18
+
19
+ ## 交互原型必含要素
20
+
21
+ ### 1. 真实状态管理
22
+
23
+ 用 JS 变量管理应用状态,用 `data-*` 属性标记 DOM 状态:
24
+
25
+ ```html
26
+ <button data-state="idle" onclick="handleSubmit()">提交</button>
27
+ <script>
28
+ function handleSubmit() {
29
+ const btn = document.querySelector('[data-state="idle"]');
30
+ btn.dataset.state = 'loading';
31
+ btn.textContent = '提交中...';
32
+ // 模拟异步
33
+ setTimeout(() => {
34
+ btn.dataset.state = 'success';
35
+ btn.textContent = '已提交';
36
+ }, 1000);
37
+ }
38
+ </script>
39
+ ```
40
+
41
+ **反模式**:用 alert/confirm/prompt 替代真实 UI 反馈。
42
+
43
+ ### 2. 表单验证
44
+
45
+ - 实时校验:`input` 事件触发即时反馈
46
+ - 失焦校验:`blur` 事件触发字段级校验
47
+ - 提交校验:`submit` 事件触发全表单校验
48
+
49
+ ```html
50
+ <input type="email" data-validate="email" onblur="validateField(this)">
51
+ <span class="error-msg" data-error-for="email" hidden>请输入有效邮箱</span>
52
+ ```
53
+
54
+ **反模式**:仅在提交时一次性校验所有字段,无实时反馈。
55
+
56
+ ### 3. 多步导航流程
57
+
58
+ 用 `data-step` 属性标记步骤,JS 控制步骤切换:
59
+
60
+ ```html
61
+ <div data-step="1" class="step">步骤 1 内容</div>
62
+ <div data-step="2" class="step" hidden>步骤 2 内容</div>
63
+ <button onclick="nextStep()">下一步</button>
64
+ ```
65
+
66
+ **反模式**:每个步骤一个独立 HTML 文件(割裂流程体验)。
67
+
68
+ ### 4. 动态列表/表格
69
+
70
+ 用 JS 数组管理数据,动态渲染 DOM:
71
+
72
+ ```javascript
73
+ const items = [{ id: 1, name: '项目 A' }, { id: 2, name: '项目 B' }];
74
+ function renderList() {
75
+ const tbody = document.querySelector('tbody');
76
+ tbody.innerHTML = items.map(item =>
77
+ `<tr><td>${item.id}</td><td>${item.name}</td></tr>`
78
+ ).join('');
79
+ }
80
+ ```
81
+
82
+ **反模式**:硬编码 10 行相同数据(无法验证增删改查)。
83
+
84
+ ## 交互原型的 craft 约束
85
+
86
+ - **状态覆盖**:每个交互元素必须覆盖 Loading / Empty / Error / Populated / Edge 五态(见 `craft/state-coverage.md`)
87
+ - **无障碍基线**:键盘可达(Tab/Enter/Esc)、焦点可见、`prefers-reduced-motion` 尊重(见 `craft/accessibility-baseline.md`)
88
+ - **反 AI slop**:不用 modal 弹窗替代页内反馈、不用 loading spinner 超过 3 秒(用进度条或骨架屏)
89
+
90
+ ## 与静态原型的区别
91
+
92
+ | 维度 | 静态原型 | 交互原型 |
93
+ |------|---------|---------|
94
+ | 页面数量 | 多页面展示 | 单页面多状态 |
95
+ | JS 复杂度 | 仅导航 | 状态管理 + 事件绑定 |
96
+ | 验证目标 | 视觉设计、信息架构 | 交互流程、用户体验 |
97
+ | 适用阶段 | PRD 评审 | 技术评审、用户测试 |
98
+
99
+ ## 何时选择交互原型
100
+
101
+ - PRD 含复杂表单流程(注册/下单/审批)
102
+ - 需要验证多步骤导航逻辑
103
+ - 需要用户测试真实交互反馈
104
+ - 技术方案依赖交互细节(状态机、并发控制)
105
+
106
+ ## 不适用场景
107
+
108
+ - 纯展示型页面(landing page / about us)
109
+ - 信息架构尚未确定(先用静态原型)
110
+ - 高保真动效需求(用专业工具 Figma/After Effects)