architext 0.0.3 → 0.0.4

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 (103) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/README.md +10 -5
  3. package/README.zh-CN.md +10 -5
  4. package/dist/index.js +42 -38
  5. package/dist/templates/en/docs/global/api_snapshot.json +24 -0
  6. package/dist/templates/en/docs/global/command_api.json +26 -0
  7. package/dist/templates/en/docs/global/env_registry.json +12 -0
  8. package/dist/templates/en/docs/global/map.json +5 -0
  9. package/dist/templates/en/docs/global/public_api.json +12 -0
  10. package/dist/templates/en/docs/prompts/code.md +21 -28
  11. package/dist/templates/en/docs/prompts/edit.md +18 -9
  12. package/dist/templates/en/docs/prompts/inherit.md +42 -23
  13. package/dist/templates/en/docs/prompts/plan.md +141 -47
  14. package/dist/templates/en/docs/prompts/recover.md +63 -0
  15. package/dist/templates/en/docs/prompts/ref.md +258 -0
  16. package/dist/templates/en/docs/prompts/revise.md +1 -1
  17. package/dist/templates/en/docs/prompts/scope.md +3 -3
  18. package/dist/templates/en/docs/prompts/start.md +9 -15
  19. package/dist/templates/en/docs/shared/verify-result-handling.md +6 -0
  20. package/dist/templates/en/docs/templates/design.template.md +77 -0
  21. package/dist/templates/en/docs/templates/spec.template.md +60 -25
  22. package/dist/templates/en/skills/archi-data-sync/SKILL.md +83 -0
  23. package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +178 -132
  24. package/dist/templates/en/skills/archi-design-patterns/SKILL.md +139 -0
  25. package/dist/templates/en/skills/archi-feature-relations/SKILL.md +118 -0
  26. package/dist/templates/en/skills/archi-silent-audit/SKILL.md +118 -0
  27. package/dist/templates/zh/briefs/_base.md +2 -2
  28. package/dist/templates/zh/briefs/_modules.md +2 -2
  29. package/dist/templates/zh/docs/global/api_snapshot.json +24 -0
  30. package/dist/templates/zh/docs/global/command_api.json +26 -0
  31. package/dist/templates/zh/docs/global/data_snapshot.json +0 -1
  32. package/dist/templates/zh/docs/global/design_tokens.json +0 -1
  33. package/dist/templates/zh/docs/global/dictionary.json +1 -1
  34. package/dist/templates/zh/docs/global/env_registry.json +12 -0
  35. package/dist/templates/zh/docs/global/error_codes.json +0 -8
  36. package/dist/templates/zh/docs/global/map.json +28 -3
  37. package/dist/templates/zh/docs/global/public_api.json +12 -0
  38. package/dist/templates/zh/docs/global/vision.md +1 -1
  39. package/dist/templates/zh/docs/prompts/audit.md +8 -8
  40. package/dist/templates/zh/docs/prompts/code.md +33 -40
  41. package/dist/templates/zh/docs/prompts/edit.md +19 -10
  42. package/dist/templates/zh/docs/prompts/fix.md +8 -2
  43. package/dist/templates/zh/docs/prompts/inherit.md +45 -27
  44. package/dist/templates/zh/docs/prompts/map.md +2 -1
  45. package/dist/templates/zh/docs/prompts/plan.md +143 -50
  46. package/dist/templates/zh/docs/prompts/recover.md +63 -0
  47. package/dist/templates/zh/docs/prompts/ref.md +258 -0
  48. package/dist/templates/zh/docs/prompts/remove.md +2 -14
  49. package/dist/templates/zh/docs/prompts/revise.md +12 -4
  50. package/dist/templates/zh/docs/prompts/scope.md +6 -6
  51. package/dist/templates/zh/docs/prompts/start.md +19 -26
  52. package/dist/templates/zh/docs/shared/verify-result-handling.md +6 -0
  53. package/dist/templates/zh/docs/templates/design.template.md +77 -0
  54. package/dist/templates/zh/docs/templates/spec.template.md +60 -25
  55. package/dist/templates/zh/rules/00_system.md +35 -5
  56. package/dist/templates/zh/rules/01_workflow.md +5 -4
  57. package/dist/templates/zh/rules/02_tech_stack.md +7 -6
  58. package/dist/templates/zh/rules/03_data_governance.md +40 -9
  59. package/dist/templates/zh/rules/99_context_glue.md +2 -2
  60. package/dist/templates/zh/skills/archi-data-sync/SKILL.md +83 -0
  61. package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +82 -37
  62. package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +139 -0
  63. package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +118 -0
  64. package/dist/templates/zh/skills/archi-plan-options/SKILL.md +25 -25
  65. package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +118 -0
  66. package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +1 -1
  67. package/package.json +1 -1
  68. package/dist/templates/zh-Hant/briefs/_base.md +0 -115
  69. package/dist/templates/zh-Hant/briefs/_modules.md +0 -173
  70. package/dist/templates/zh-Hant/docs/global/data_snapshot.json +0 -31
  71. package/dist/templates/zh-Hant/docs/global/design_tokens.json +0 -135
  72. package/dist/templates/zh-Hant/docs/global/dictionary.json +0 -35
  73. package/dist/templates/zh-Hant/docs/global/error_codes.json +0 -19
  74. package/dist/templates/zh-Hant/docs/global/map.json +0 -94
  75. package/dist/templates/zh-Hant/docs/global/roadmap.json +0 -39
  76. package/dist/templates/zh-Hant/docs/global/vision.md +0 -82
  77. package/dist/templates/zh-Hant/docs/prompts/audit.md +0 -150
  78. package/dist/templates/zh-Hant/docs/prompts/code.md +0 -160
  79. package/dist/templates/zh-Hant/docs/prompts/edit.md +0 -87
  80. package/dist/templates/zh-Hant/docs/prompts/fix.md +0 -86
  81. package/dist/templates/zh-Hant/docs/prompts/help.md +0 -69
  82. package/dist/templates/zh-Hant/docs/prompts/inherit.md +0 -270
  83. package/dist/templates/zh-Hant/docs/prompts/map.md +0 -131
  84. package/dist/templates/zh-Hant/docs/prompts/plan.md +0 -252
  85. package/dist/templates/zh-Hant/docs/prompts/remove.md +0 -162
  86. package/dist/templates/zh-Hant/docs/prompts/revise.md +0 -160
  87. package/dist/templates/zh-Hant/docs/prompts/scope.md +0 -198
  88. package/dist/templates/zh-Hant/docs/prompts/start.md +0 -258
  89. package/dist/templates/zh-Hant/docs/templates/plan.template.json +0 -88
  90. package/dist/templates/zh-Hant/docs/templates/scope-brief.template.md +0 -58
  91. package/dist/templates/zh-Hant/docs/templates/spec.template.md +0 -51
  92. package/dist/templates/zh-Hant/docs/templates/ui.template.md +0 -51
  93. package/dist/templates/zh-Hant/rules/00_system.md +0 -123
  94. package/dist/templates/zh-Hant/rules/01_workflow.md +0 -93
  95. package/dist/templates/zh-Hant/rules/02_tech_stack.md +0 -192
  96. package/dist/templates/zh-Hant/rules/03_data_governance.md +0 -102
  97. package/dist/templates/zh-Hant/rules/04_cli_tools.md +0 -50
  98. package/dist/templates/zh-Hant/rules/90_custom_rules.md +0 -21
  99. package/dist/templates/zh-Hant/rules/99_context_glue.md +0 -53
  100. package/dist/templates/zh-Hant/skills/archi-decompose-roadmap/SKILL.md +0 -293
  101. package/dist/templates/zh-Hant/skills/archi-interview-protocol/SKILL.md +0 -86
  102. package/dist/templates/zh-Hant/skills/archi-plan-options/SKILL.md +0 -364
  103. package/dist/templates/zh-Hant/skills/archi-ui-wireframe/SKILL.md +0 -337
@@ -0,0 +1,139 @@
1
+ ---
2
+ name: archi-design-patterns
3
+ description: Architext technical design structured pattern library. Defines standard formats and self-check lists for four core mechanism description patterns (State Machine / Pipeline / Decision Matrix / Protocol). Referenced by /archi.plan step_4 when generating design.md § 2, and by /archi.code step_5 when auditing implementation vs. design consistency.
4
+ ---
5
+
6
+ # Technical Design Structured Pattern Library
7
+
8
+ ## System Flow Position
9
+
10
+ ```
11
+ /archi.plan step_4_generate → design.md § 2
12
+
13
+ [This Skill] pattern selection → format generation → self-check
14
+
15
+ design.md § 2 Core Mechanisms content
16
+ ```
17
+
18
+ > **Skill responsibility boundary**:
19
+ > - Responsible for: pattern selection guide, standard table formats per pattern, self-check lists
20
+ > - Not responsible for: design.md overall structure (see `design.template.md`), parameters/invariants/failure modes (see template §§ 3-5)
21
+
22
+ ---
23
+
24
+ ## Pattern Selection Guide
25
+
26
+ Select ≥1 pattern per mechanism characteristic. Same feature may combine multiple (e.g. State Machine for connection mgmt + Pipeline for message handling).
27
+
28
+ | Mechanism Characteristic | Recommended Pattern | Typical Scenarios |
29
+ |:---|:---|:---|
30
+ | Discrete state set with transitions | **State Machine** | Connection mgmt, workflow engine, component lifecycle, auth flow |
31
+ | Data/requests through ordered processing steps | **Pipeline** | Message decode chain, middleware stack, data transform pipe, request interceptor |
32
+ | Behavior depends on multi-condition combination | **Decision Matrix** | Permission check, policy routing, degradation rules, feature flags |
33
+ | Defined message exchange between two or more components | **Protocol** | Client-server comms, IPC, event bus, Worker messages |
34
+
35
+ **Execution flow**: Select pattern → fill standard format → **run self-check immediately** → if any item fails, fix and re-check → all pass before next mechanism.
36
+
37
+ ---
38
+
39
+ ## Pattern A: State Machine
40
+
41
+ ### Standard Format
42
+
43
+ **States**:
44
+
45
+ | State | Meaning | Entry Condition |
46
+ |:---|:---|:---|
47
+ | `idle` | [Initial/Idle] | [Init complete or active disconnect] |
48
+ | `connecting` | [Connecting] | [Connection request initiated] |
49
+ | `connected` | [Connected] | [open event received] |
50
+ | ... | ... | ... |
51
+
52
+ **Transitions**:
53
+
54
+ | From | → To | Guard (Trigger) | Action (Side Effect) |
55
+ |:---|:---|:---|:---|
56
+ | `idle` | `connecting` | [User triggers connect] | [Create Socket instance] |
57
+ | `connecting` | `connected` | [open event received] | [Start heartbeat, clear retry count] |
58
+ | `connecting` | `disconnected` | [Timeout or error event] | [Log error, increment retry count] |
59
+ | ... | ... | ... | ... |
60
+
61
+ ### Self-Check List
62
+
63
+ | # | Check | Verification |
64
+ |:---|:---|:---|
65
+ | 1 | **Completeness**: No deadlock | Every state has ≥1 outgoing edge |
66
+ | 2 | **Reachability**: No orphan | Every non-initial state has ≥1 incoming edge |
67
+ | 3 | **Termination**: Exit path exists | Terminal state or stable loop exists |
68
+ | 4 | **Determinism**: No ambiguous transition | Outgoing Guards from same state are mutually exclusive |
69
+ | 5 | **Exception coverage**: Not Happy Path only | Every non-terminal state has error/timeout outgoing edge |
70
+
71
+ ---
72
+
73
+ ## Pattern B: Pipeline
74
+
75
+ ### Standard Format
76
+
77
+ | Step | Input | Process | Output | On Error |
78
+ |:---|:---|:---|:---|:---|
79
+ | 1. [name] | [input type] | [logic] | [output type] | [drop/retry/abort/degrade] |
80
+ | 2. [name] | [prev Output] | [logic] | [output type] | [error handling] |
81
+ | ... | ... | ... | ... | ... |
82
+
83
+ ### Self-Check List
84
+
85
+ | # | Check | Verification |
86
+ |:---|:---|:---|
87
+ | 1 | **Type chain**: No break | Step N Output = Step N+1 Input |
88
+ | 2 | **Error handling**: No silent swallow | Every step has On Error |
89
+ | 3 | **Idempotency note**: Retry safety clear | Mark which steps are safe to retry, which have side effects |
90
+ | 4 | **Recoverability**: Safe termination | Any Step error can recover or exit safely |
91
+
92
+ ---
93
+
94
+ ## Pattern C: Decision Matrix
95
+
96
+ ### Standard Format
97
+
98
+ | Condition A | Condition B | Condition C | → Behavior | Note |
99
+ |:---|:---|:---|:---|:---|
100
+ | [val1] | [val1] | [val1] | [behavior] | |
101
+ | [val1] | [val1] | [val2] | [behavior] | |
102
+ | [val1] | [val2] | * | [behavior] | *=any |
103
+ | * | * | * | [fallback] | Default when unmatched |
104
+
105
+ ### Self-Check List
106
+
107
+ | # | Check | Verification |
108
+ |:---|:---|:---|
109
+ | 1 | **Exhaustiveness**: No gap | All condition value combos covered (* wildcards for unlisted) |
110
+ | 2 | **Unambiguous**: Single match | Same input hits only one row (priority top-to-bottom, or conditions mutually exclusive) |
111
+ | 3 | **Fallback row**: Default exists | Last row is * wildcard |
112
+ | 4 | **Testable**: Can construct cases | Each row can construct test input |
113
+
114
+ ---
115
+
116
+ ## Pattern D: Protocol
117
+
118
+ ### Standard Format
119
+
120
+ **Parties**: [Component A] ↔ [Component B]
121
+
122
+ | Seq | Sender → Receiver | Message | Payload | Expected Response | Timeout |
123
+ |:---|:---|:---|:---|:---|:---|
124
+ | 1 | [A → B] | `[name]` | {[field: type]} | `[response]` {[field: type]} | [Ns → timeout handling] |
125
+ | 2 | [B → A] | `[name]` | {[field: type]} | None (one-way push) | - |
126
+ | ... | ... | ... | ... | ... | ... |
127
+
128
+ ### Self-Check List
129
+
130
+ | # | Check | Verification |
131
+ |:---|:---|:---|
132
+ | 1 | **Pairing**: Request has response | Messages needing response have Response + Timeout defined |
133
+ | 2 | **Type explicit**: No any | Every Payload field has concrete type |
134
+ | 3 | **Order dependency**: Precedence declared | Mark which messages must follow which |
135
+ | 4 | **Concurrency safe**: Strategy stated | If multiple messages may arrive concurrently, state handling (queue/drop/merge) |
136
+
137
+ ---
138
+
139
+ > **Intermediate output**: This Skill is a subroutine; after producing mechanism description + self-check results, control returns to caller (step_4_generate or step_5_audit) to continue.
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: archi-feature-relations
3
+ type: reviewer
4
+ description: featureRelations linkage handler. In isolated context, handles map.json featureRelations register/check/cleanup, ensures aggregator Tasks maintain correct linkage with their sources.
5
+ ---
6
+
7
+ # featureRelations linkage handler
8
+
9
+ ## System flow position
10
+
11
+ ```
12
+ /archi.* step_N → Verify phase
13
+
14
+ [This Skill] receives mode param → process featureRelations → return result
15
+
16
+ Main Agent Signoff (confirm linkage prompts)
17
+ ```
18
+
19
+ > **Skill responsibility boundary**:
20
+ > - Responsible: featureRelations register/check/cleanup
21
+ > - Not responsible: Modify business code, modify spec/plan docs
22
+
23
+ ---
24
+
25
+ ## Modes and behavior
26
+
27
+ ### Mode `register` (caller: plan, inherit)
28
+
29
+ Determine if current Task is an "aggregator Task"; if so, append to `map.json` featureRelations.
30
+
31
+ **Aggregator Task criteria**:
32
+ - Core responsibility is **listing, aggregating, or dynamically reflecting** other Tasks of a class
33
+ - Code pattern: iterate/enumerate/dynamic load of similar modules (`for (const cmd of allCommands)`, `Object.values(registry)`, read dir then dynamic import)
34
+ - Description pattern: "aggregate all page entries", "register all routes", "list all commands"
35
+
36
+ **Action**:
37
+ 1. Analyze Task spec/goal description
38
+ 2. Determine if aggregator
39
+ 3. If yes → append featureRelations entry:
40
+ ```json
41
+ {
42
+ "aggregator": "<Task ID or file path>",
43
+ "sources": "<source scope description>",
44
+ "evidence": "<basis>",
45
+ "checkNote": "When such Tasks are added/removed, check if <aggregator> needs sync"
46
+ }
47
+ ```
48
+ 4. If no → output `NOT AGGREGATOR`, skip
49
+
50
+ ### Mode `check` (caller: scope, code)
51
+
52
+ Compare current Task with featureRelations sources field semantically, output linkage prompts.
53
+
54
+ **Action**:
55
+ 1. Read `map.json` featureRelations array
56
+ 2. If featureRelations empty → output `NO RELATIONS`, skip
57
+ 3. Compare this task/implemented feature with each sources semantically
58
+ 4. On match, output linkage prompt
59
+
60
+ ### Mode `cleanup` (caller: remove)
61
+
62
+ Remove featureRelations entries referencing removed Task, assess impact.
63
+
64
+ **Action**:
65
+ 1. Read `map.json` featureRelations array
66
+ 2. Find entries where aggregator or sources references removed Task
67
+ 3. Assess removal impact:
68
+ - Removed is aggregator → delete entire entry
69
+ - Removed is one of sources → update sources description, prompt to check if aggregator needs adjustment
70
+ 4. Output impact report
71
+
72
+ ---
73
+
74
+ ## Output format
75
+
76
+ ### register mode
77
+
78
+ ```
79
+ ### Feature Relations: register
80
+
81
+ RESULT: AGGREGATOR REGISTERED
82
+ - aggregator: <ID>
83
+ - sources: <description>
84
+ - evidence: <basis>
85
+ ```
86
+
87
+ Or: `RESULT: NOT AGGREGATOR — This Task is not aggregator, skip`
88
+
89
+ ### check mode
90
+
91
+ ```
92
+ ### Feature Relations: check
93
+
94
+ HITS:
95
+ - [aggregator] — [checkNote]
96
+
97
+ NO HITS: [no matching relations]
98
+ ```
99
+
100
+ Or: `NO RELATIONS — featureRelations is empty`
101
+
102
+ ### cleanup mode
103
+
104
+ ```
105
+ ### Feature Relations: cleanup
106
+
107
+ REMOVED:
108
+ - [deleted entries]
109
+
110
+ UPDATED:
111
+ - [entries with updated sources]
112
+
113
+ IMPACT: [impact description]
114
+ ```
115
+
116
+ ---
117
+
118
+ > **Intermediate output**: This Skill is a review subprogram; after producing result, control returns to caller.
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: archi-silent-audit
3
+ type: reviewer
4
+ description: Embedded lightweight review. In an isolated context, reviews main Agent output, filters review dimensions by mode, returns finding list. Must not generate report files. Shares dimension definitions with audit.md but differs in responsibility: audit.md is user-triggered standalone deep review; this Skill is protocol-triggered lightweight check.
5
+ ---
6
+
7
+ # Embedded Lightweight Review
8
+
9
+ ## System flow position
10
+
11
+ ```
12
+ /archi.* step_N → Verify phase
13
+
14
+ [This Skill] receives mode param → isolated review → returns finding list
15
+
16
+ Main Agent Signoff (must respond to findings)
17
+ ```
18
+
19
+ > **Skill responsibility boundary**:
20
+ > - Responsible: Review main Agent output in isolated context, output graded finding list
21
+ > - Not responsible: Fix issues (return to main Agent), generate report files (that is audit.md's job), run Terminal Gate commands
22
+
23
+ > **Relationship with `audit.md`**:
24
+ > - `audit.md` = Standalone deep review protocol, generates report file, only user-triggered via `/archi.audit`
25
+ > - This Skill = Embedded lightweight check, inline finding list, protocol-triggered
26
+ > - Both share review dimension definitions (see `audit.md` step_2_task); this Skill filters by mode
27
+
28
+ ---
29
+
30
+ ## Modes and review dimensions
31
+
32
+ ### Mode `init` (caller: start, inherit)
33
+
34
+ Review global file quality for new/inherited projects.
35
+
36
+ | # | Dimension | Review points |
37
+ |:---|:---|:---|
38
+ | 1 | **Vision-Roadmap alignment** | Roadmap task direction aligns with vision.md north star |
39
+ | 2 | **Tech Stack consistency** | `02_tech_stack.md` matches actual deps/config |
40
+ | 3 | **Global file completeness** | Required global files present (vision, roadmap, map, dictionary, tech_stack, custom_rules) |
41
+ | 4 | **Zero info omission** | All Brief/code info routed to corresponding files |
42
+ | 5 | 仅ui项目: **Design Tokens** | `design_tokens.json` has base colors/fonts/spacing |
43
+
44
+ ### Mode `plan-docs` (caller: plan)
45
+
46
+ Review planning doc (spec/ui/plan) quality.
47
+
48
+ | # | Dimension | Review points |
49
+ |:---|:---|:---|
50
+ | 1 | **Design Fidelity** | spec § 2 fully covers confirmed functional design |
51
+ | 2 | **Dimension Match** | spec § 2 dimension format matches Task Type |
52
+ | 3 | **Tech Consistency** | No tech not declared in `02_tech_stack.md` |
53
+ | 4 | **WBS Coverage** | plan.json 100% covers each AC in spec |
54
+ | 5 | **Notes Quality** | plan.json each task notes has deliverable+constraint+executable verification |
55
+ | 6 | **Interface Exports** | INF task § 4 filled; interface declared when downstream deps exist |
56
+ | 7 | **Constraints** | § 5 includes vision.md + tech_stack red lines |
57
+ | 8 | 本任务涉及data时: **Data Integrity** | Entities and fields match confirmed core entities |
58
+ | 9 | 仅Complex任务: **Design Trace** | design.md § 6 all ACs traceable |
59
+ | 10 | 仅Complex任务: **Parameter Specificity** | design.md § 3 params concrete (no vague terms) |
60
+ | 11 | 仅Complex任务: **Self-Check Pass** | design.md § 2 mechanism self-check list passes |
61
+
62
+ ### Mode `code-impl` (caller: code)
63
+
64
+ Review code implementation quality.
65
+
66
+ | # | Dimension | Review points |
67
+ |:---|:---|:---|
68
+ | 1 | **Tech Consistency** | Matches `02_tech_stack.md` (libs/patterns/API style) |
69
+ | 2 | **SOTA** | Reject outdated patterns; use tech_stack best practices |
70
+ | 3 | **Security** | No sensitive info leak; input validated |
71
+ | 4 | **Performance** | Avoid unnecessary large deps/full imports/useless computation/memory leaks |
72
+ | 5 | 本任务涉及ui时: **Design Compliance** | Styles use Token/Preset only; no hardcoded magic values |
73
+ | 6 | 本任务涉及ui时: **Accessibility** | Necessary a11y attributes present |
74
+ | 7 | 本任务涉及data时: **Data Integrity** | Matches `data_snapshot.json`; field names/types consistent |
75
+ | 8 | 仅i18n项目: **I18n** | No hardcoded strings; use Key/dictionary reference |
76
+ | 9 | 仅Complex任务: **Design Compliance** | State transitions/flows/protocols match design.md § 2 |
77
+ | 10 | 仅Complex任务: **Invariant Enforcement** | design.md § 4 invariants have assert/runtime checks in code |
78
+ | 11 | 仅Complex任务: **Parameter Alignment** | Code values match design.md § 3 param table |
79
+
80
+ ---
81
+
82
+ ## Execution protocol
83
+
84
+ 1. **Load context**: Load required docs and code per caller-provided file paths
85
+ 2. **Filter dimensions by mode**: Execute only dimensions for current mode
86
+ 3. **Review item by item**: Each dimension outputs PASS or finding (level+location+description)
87
+ 4. **Output finding list**: Return sorted by level
88
+
89
+ ### Finding levels
90
+
91
+ | Level | Meaning | Main Agent must |
92
+ |:---|:---|:---|
93
+ | `CRITICAL` | Blocking issue | **Must fix** before signoff, cannot skip |
94
+ | `WARNING` | Risk | **Must explain** handling in signoff report |
95
+ | `INFO` | Suggestion | May decide whether to handle |
96
+
97
+ ### Output format
98
+
99
+ ```
100
+ ### Silent Audit Results (mode: <mode>)
101
+
102
+ **CRITICAL** (must fix):
103
+ - [Dimension] location: description
104
+
105
+ **WARNING** (must explain):
106
+ - [Dimension] location: description
107
+
108
+ **INFO** (suggestion):
109
+ - [Dimension] location: description
110
+
111
+ **Summary**: X CRITICAL / Y WARNING / Z INFO
112
+ ```
113
+
114
+ When no findings: `### Silent Audit Results (mode: <mode>) — ALL PASS`
115
+
116
+ ---
117
+
118
+ > **Intermediate output**: This Skill is a review subprogram; after producing finding list, control returns to caller; main Agent responds to findings in Signoff.
@@ -44,8 +44,8 @@
44
44
 
45
45
  > 已确定的直接填写。不确定的留空或写"推荐",AI 会基于项目特征推荐。
46
46
 
47
- **项目类型**: [[__PROJECT_TYPE__]]
48
- <!-- archi init 自动填入;手动填写时参考 templates/archi-decompose-roadmap SKILL 中的类型表 -->
47
+ **项目特征**: [[__PROJECT_TYPE__]]
48
+ <!-- archi init 自动填入(逗号分隔的特征标签);手动填写时从 ui/data/api/cli/lib/mobile/desktop/miniapp/extension/realtime/ai 中选择 -->
49
49
  **语言/运行时**: [例:TypeScript + Node.js 22]
50
50
  **核心框架**: [例:Next.js 15 / Fastify / Tauri]
51
51
  **包管理器**: [例:pnpm / npm / yarn / cargo]
@@ -116,7 +116,7 @@
116
116
  **实时传输方案**: [例:Socket.io / 原生 WebSocket / SSE / WebRTC]
117
117
  **实时框架/托管**: [例:Ably / Pusher / Liveblocks / 自建]
118
118
  **房间/频道模型**: [例:按用户 ID 订阅 / 按文档 ID 房间 / 广播]
119
- **[?CRDT] 协作冲突解决**: [例:Yjs / Automerge / 不需要(仅广播)]
119
+ **(仅CRDT项目) 协作冲突解决**: [例:Yjs / Automerge / 不需要(仅广播)]
120
120
  **离线支持**: [例:离线队列 + 重连同步 / 不需要]
121
121
  <!-- @end -->
122
122
 
@@ -125,7 +125,7 @@
125
125
  **AI 框架**: [例:Vercel AI SDK / LangChain / LlamaIndex / 无框架直调 API]
126
126
  **Tool/Function Calling**: [例:需要(列出工具名称)/ 不需要]
127
127
  **Memory 方案**: [例:向量数据库(pgvector/Pinecone)/ 滑动窗口历史 / 无]
128
- **[?MCP] MCP 协议**: [例:@modelcontextprotocol/sdk / 不需要]
128
+ **(仅MCP项目) MCP 协议**: [例:@modelcontextprotocol/sdk / 不需要]
129
129
  **流式输出**: [例:SSE 流式 / 批量返回]
130
130
  <!-- @end -->
131
131
 
@@ -0,0 +1,24 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "method": "[GET | POST | PUT | DELETE | PATCH]",
5
+ "path": "[/resource/:id]",
6
+ "description": "[一句话描述端点职责]",
7
+ "auth": "[required | public | optional]",
8
+ "requestBody": "[schema 描述或 N/A]",
9
+ "responses": {
10
+ "200": "[成功响应结构描述]",
11
+ "[4xx]": "[ref: error_codes.json#ERR_CODE]"
12
+ },
13
+ "owner": "[FEAT-xxx | INF-xxx]"
14
+ }
15
+ ],
16
+ "protocolMapping": [
17
+ {
18
+ "statusCode": "[400 | 401 | 403 | 404 | 500 | ...]",
19
+ "code": "[ERR_CODE]",
20
+ "meaning": "[含义]",
21
+ "action": "[调用方行为: Toast / Redirect / Retry / ...]"
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "commands": [
3
+ {
4
+ "name": "[command-name]",
5
+ "aliases": ["[alias]"],
6
+ "description": "[一句话描述命令职责]",
7
+ "args": [
8
+ {
9
+ "name": "[arg-name]",
10
+ "required": true,
11
+ "description": "[参数说明]"
12
+ }
13
+ ],
14
+ "flags": [
15
+ {
16
+ "name": "--[flag-name]",
17
+ "short": "-[f]",
18
+ "type": "[string | boolean | number]",
19
+ "default": "[默认值或 null]",
20
+ "description": "[标志说明]"
21
+ }
22
+ ],
23
+ "owner": "[FEAT-xxx | INF-xxx]"
24
+ }
25
+ ]
26
+ }
@@ -1,5 +1,4 @@
1
1
  {
2
- "scope": "[?Data]",
3
2
  "models": [
4
3
  {
5
4
  "name": "[ModelName]",
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "_comment": "由 /archi.start 基于 Brief「风格与调性」和「视觉参考」生成。所有值须从 Brief 推导,禁直接复用任何模板默认值。",
3
- "scope": "[?UI]",
4
3
  "status": "drafting",
5
4
 
6
5
  "aestheticDirection": {
@@ -25,7 +25,7 @@
25
25
  "replaces": "[替代的原始 API, 如 console.log]"
26
26
  }
27
27
  ],
28
- "components [?UI]": [
28
+ "components(仅ui项目)": [
29
29
  {
30
30
  "name": "[组件名]",
31
31
  "path": "[文件路径]",
@@ -0,0 +1,12 @@
1
+ {
2
+ "variables": [
3
+ {
4
+ "name": "[ENV_VAR_NAME]",
5
+ "required": true,
6
+ "default": null,
7
+ "description": "[用途说明]",
8
+ "example": "[示例值]",
9
+ "owner": "[FEAT-xxx | INF-xxx]"
10
+ }
11
+ ]
12
+ }
@@ -1,12 +1,4 @@
1
1
  {
2
- "protocolMapping [?API]": [
3
- {
4
- "statusCode": "[400 | EXIT_1 | ...]",
5
- "code": "[ERR_VALIDATION]",
6
- "meaning": "[含义]",
7
- "action": "[调用方行为: Toast / Exit / Retry / ...]"
8
- }
9
- ],
10
2
  "businessErrors": [
11
3
  {
12
4
  "module": "[MODULE]",
@@ -55,18 +55,38 @@
55
55
  },
56
56
  {
57
57
  "file": "design_tokens.json",
58
- "role": "Visuals [?UI]",
58
+ "role": "Visuals (仅ui项目)",
59
59
  "content": "颜色、字体、间距变量"
60
60
  },
61
61
  {
62
62
  "file": "data_snapshot.json",
63
- "role": "Data [?Data]",
63
+ "role": "Data (仅data项目)",
64
64
  "content": "数据库 Schema 镜像"
65
65
  },
66
66
  {
67
67
  "file": "error_codes.json",
68
68
  "role": "Errors",
69
- "content": "错误码与协议契约"
69
+ "content": "业务错误码注册表"
70
+ },
71
+ {
72
+ "file": "api_snapshot.json",
73
+ "role": "API (仅api项目)",
74
+ "content": "HTTP 端点注册表与协议映射"
75
+ },
76
+ {
77
+ "file": "env_registry.json",
78
+ "role": "Env (仅api项目)",
79
+ "content": "运行时环境变量清单"
80
+ },
81
+ {
82
+ "file": "command_api.json",
83
+ "role": "Commands (仅cli项目)",
84
+ "content": "CLI 命令签名注册表"
85
+ },
86
+ {
87
+ "file": "public_api.json",
88
+ "role": "Exports (仅lib项目)",
89
+ "content": "库 / SDK 公共导出 API 注册表"
70
90
  }
71
91
  ]
72
92
  },
@@ -81,6 +101,11 @@
81
101
  "category": "UI/UX",
82
102
  "purpose": "任务级 UI 范围声明 — 引用 ui_context.md 中的屏幕 ID,指定本任务涵盖的屏幕/组件范围"
83
103
  },
104
+ {
105
+ "file": "design.md",
106
+ "category": "Technical Design",
107
+ "purpose": "仅Complex任务: 技术方案设计 — 核心机制的状态机/流水线/协议定义、参数表与不变量"
108
+ },
84
109
  {
85
110
  "file": "plan.json",
86
111
  "category": "Plan",
@@ -0,0 +1,12 @@
1
+ {
2
+ "exports": [
3
+ {
4
+ "name": "[exportName]",
5
+ "type": "[function | class | type | constant | enum]",
6
+ "signature": "[TypeScript 签名]",
7
+ "description": "[一句话描述导出项职责]",
8
+ "stability": "[stable | experimental | deprecated]",
9
+ "owner": "[FEAT-xxx | INF-xxx]"
10
+ }
11
+ ]
12
+ }
@@ -40,7 +40,7 @@ description: Project Constitution: Vision, Personas, Principles & Boundaries.
40
40
 
41
41
  ---
42
42
 
43
- ## 4. Design & Experience (设计与体验语言) [?UI]
43
+ ## 4. Design & Experience (设计与体验语言) (仅ui项目)
44
44
 
45
45
  > **Note:** 本节仅适用于有 UI 的项目。具体色值和圆角定义请严格参阅 `[[__DOCS_DIR__]]/global/design_tokens.json`。
46
46
 
@@ -38,12 +38,12 @@
38
38
  - `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/spec.md` — 功能逻辑
39
39
  - `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/plan.json` — 任务清单
40
40
  - `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/ui.md` — 任务 UI 范围声明(如存在)
41
- - [?UI] `[[__DOCS_DIR__]]/global/ui_context.md` — AI 屏幕索引(定位对应屏幕 ID)
42
- - [?UI] `[[__DOCS_DIR__]]/global/ui_concept.html` — 只读视觉参考(#10 合规对比的视觉标准源)
41
+ - (仅ui项目) `[[__DOCS_DIR__]]/global/ui_context.md` — AI 屏幕索引(定位对应屏幕 ID)
42
+ - (仅ui项目) `[[__DOCS_DIR__]]/global/ui_concept.html` — 只读视觉参考(#10 合规对比的视觉标准源)
43
43
  - `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/audit.md` — 上次审计报告(如存在,用于对比)
44
44
  - `02_tech_stack.md` — 技术红线
45
- - [?UI] `[[__DOCS_DIR__]]/global/design_tokens.json`
46
- - [?Data] `[[__DOCS_DIR__]]/global/data_snapshot.json`
45
+ - (仅ui项目) `[[__DOCS_DIR__]]/global/design_tokens.json`
46
+ - (仅data项目) `[[__DOCS_DIR__]]/global/data_snapshot.json`
47
47
  4. 读取该任务对应的所有代码文件。
48
48
 
49
49
  **项目级 — Load Overview**:
@@ -72,12 +72,12 @@
72
72
  | 7 | **Tech Stack 合规** | 对照 `02_tech_stack.md`:违禁模式、过时 API、硬编码 |
73
73
  | 8 | **安全性** | 敏感信息泄露、输入未校验、注入风险、权限检查 |
74
74
  | 9 | **性能** | 不必要全量导入/大循环/无用计算/内存泄漏/N+1 查询 |
75
- | 10 | [?UI] **Design 合规** | 样式是否用 Token 定义的视觉模式;无硬编码魔法值;实现与 `ui_concept.html` 对应屏幕视觉一致 |
76
- | 11 | [?Data] **数据一致性** | 字段名/类型与 `data_snapshot.json` 是否一致 |
77
- | 12 | [?I18n] **I18n 合规** | 无硬编码字符串;须用 Key/字典引用 |
75
+ | 10 | (本任务涉及ui时) **Design 合规** | 样式是否用 Token 定义的视觉模式;无硬编码魔法值;实现与 `ui_concept.html` 对应屏幕视觉一致 |
76
+ | 11 | (本任务涉及data时) **数据一致性** | 字段名/类型与 `data_snapshot.json` 是否一致 |
77
+ | 12 | (仅i18n项目) **I18n 合规** | 无硬编码字符串;须用 Key/字典引用 |
78
78
  | 13 | **Orphan .gitkeep** | 目录已有其他文件时仍存在 `.gitkeep` — 须删除 |
79
79
  | 14 | **Spec-Code 漂移** | 代码中的接口/类型/行为是否与 `spec.md` 一致;手动变更是否已同步到文档 |
80
- | 15 | [?UI] **UI 引用完整性** | `ui.md` 中的 `ref: ui_concept.html#S-XX` 指针是否仍然有效;被引用的屏幕/组件是否因 edit/revise 后已改名或删除 |
80
+ | 15 | (本任务涉及ui时) **UI 引用完整性** | `ui.md` 中的 `ref: ui_concept.html#S-XX` 指针是否仍然有效;被引用的屏幕/组件是否因 edit/revise 后已改名或删除 |
81
81
 
82
82
  **Output**: 按维度分组的发现列表,每项含级别、位置、描述。
83
83
  </step_2_task>