architext 0.0.3 → 0.0.5
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.
- package/CHANGELOG.md +56 -1
- package/README.md +94 -12
- package/README.zh-CN.md +94 -12
- package/dist/index.js +43 -39
- package/dist/templates/en/briefs/_base.md +44 -11
- package/dist/templates/en/briefs/_modules.md +31 -4
- package/dist/templates/en/docs/global/api_snapshot.json +24 -0
- package/dist/templates/en/docs/global/command_api.json +26 -0
- package/dist/templates/en/docs/global/env_registry.json +12 -0
- package/dist/templates/en/docs/global/map.json +5 -0
- package/dist/templates/en/docs/global/public_api.json +12 -0
- package/dist/templates/en/docs/prompts/audit.md +80 -94
- package/dist/templates/en/docs/prompts/code.md +100 -109
- package/dist/templates/en/docs/prompts/edit.md +52 -47
- package/dist/templates/en/docs/prompts/fix.md +49 -42
- package/dist/templates/en/docs/prompts/help.md +23 -31
- package/dist/templates/en/docs/prompts/inherit.md +110 -116
- package/dist/templates/en/docs/prompts/map.md +47 -69
- package/dist/templates/en/docs/prompts/plan.md +160 -171
- package/dist/templates/en/docs/prompts/recover.md +48 -0
- package/dist/templates/en/docs/prompts/ref.md +163 -0
- package/dist/templates/en/docs/prompts/remove.md +55 -107
- package/dist/templates/en/docs/prompts/revise.md +63 -106
- package/dist/templates/en/docs/prompts/scope.md +77 -117
- package/dist/templates/en/docs/prompts/start.md +93 -139
- package/dist/templates/en/docs/shared/verify-result-handling.md +6 -0
- package/dist/templates/en/docs/templates/design.template.md +77 -0
- package/dist/templates/en/docs/templates/spec.template.md +60 -25
- package/dist/templates/en/rules/00_system.md +36 -79
- package/dist/templates/en/rules/01_workflow.md +59 -57
- package/dist/templates/en/rules/03_data_governance.md +46 -42
- package/dist/templates/en/skills/archi-data-sync/SKILL.md +83 -0
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +166 -151
- package/dist/templates/en/skills/archi-design-patterns/SKILL.md +140 -0
- package/dist/templates/en/skills/archi-feature-relations/SKILL.md +118 -0
- package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -1
- package/dist/templates/en/skills/archi-plan-options/SKILL.md +4 -3
- package/dist/templates/en/skills/archi-silent-audit/SKILL.md +118 -0
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
- package/dist/templates/zh/briefs/_base.md +46 -14
- package/dist/templates/zh/briefs/_modules.md +29 -2
- package/dist/templates/zh/docs/global/api_snapshot.json +24 -0
- package/dist/templates/zh/docs/global/command_api.json +26 -0
- package/dist/templates/zh/docs/global/data_snapshot.json +0 -1
- package/dist/templates/zh/docs/global/design_tokens.json +0 -1
- package/dist/templates/zh/docs/global/dictionary.json +1 -1
- package/dist/templates/zh/docs/global/env_registry.json +12 -0
- package/dist/templates/zh/docs/global/error_codes.json +0 -8
- package/dist/templates/zh/docs/global/map.json +28 -3
- package/dist/templates/zh/docs/global/public_api.json +12 -0
- package/dist/templates/zh/docs/global/vision.md +1 -1
- package/dist/templates/zh/docs/prompts/audit.md +43 -57
- package/dist/templates/zh/docs/prompts/code.md +68 -77
- package/dist/templates/zh/docs/prompts/edit.md +44 -39
- package/dist/templates/zh/docs/prompts/fix.md +33 -26
- package/dist/templates/zh/docs/prompts/help.md +13 -21
- package/dist/templates/zh/docs/prompts/inherit.md +81 -87
- package/dist/templates/zh/docs/prompts/map.md +23 -45
- package/dist/templates/zh/docs/prompts/plan.md +134 -146
- package/dist/templates/zh/docs/prompts/recover.md +48 -0
- package/dist/templates/zh/docs/prompts/ref.md +163 -0
- package/dist/templates/zh/docs/prompts/remove.md +31 -83
- package/dist/templates/zh/docs/prompts/revise.md +43 -84
- package/dist/templates/zh/docs/prompts/scope.md +53 -93
- package/dist/templates/zh/docs/prompts/start.md +75 -121
- package/dist/templates/zh/docs/shared/verify-result-handling.md +6 -0
- package/dist/templates/zh/docs/templates/design.template.md +77 -0
- package/dist/templates/zh/docs/templates/spec.template.md +60 -25
- package/dist/templates/zh/rules/00_system.md +37 -80
- package/dist/templates/zh/rules/01_workflow.md +60 -58
- package/dist/templates/zh/rules/02_tech_stack.md +7 -6
- package/dist/templates/zh/rules/03_data_governance.md +43 -39
- package/dist/templates/zh/rules/99_context_glue.md +2 -2
- package/dist/templates/zh/skills/archi-data-sync/SKILL.md +83 -0
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +70 -56
- package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +140 -0
- package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +118 -0
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +26 -25
- package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +118 -0
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
- package/package.json +1 -1
- package/dist/templates/zh-Hant/briefs/_base.md +0 -115
- package/dist/templates/zh-Hant/briefs/_modules.md +0 -173
- package/dist/templates/zh-Hant/docs/global/data_snapshot.json +0 -31
- package/dist/templates/zh-Hant/docs/global/design_tokens.json +0 -135
- package/dist/templates/zh-Hant/docs/global/dictionary.json +0 -35
- package/dist/templates/zh-Hant/docs/global/error_codes.json +0 -19
- package/dist/templates/zh-Hant/docs/global/map.json +0 -94
- package/dist/templates/zh-Hant/docs/global/roadmap.json +0 -39
- package/dist/templates/zh-Hant/docs/global/vision.md +0 -82
- package/dist/templates/zh-Hant/docs/prompts/audit.md +0 -150
- package/dist/templates/zh-Hant/docs/prompts/code.md +0 -160
- package/dist/templates/zh-Hant/docs/prompts/edit.md +0 -87
- package/dist/templates/zh-Hant/docs/prompts/fix.md +0 -86
- package/dist/templates/zh-Hant/docs/prompts/help.md +0 -69
- package/dist/templates/zh-Hant/docs/prompts/inherit.md +0 -270
- package/dist/templates/zh-Hant/docs/prompts/map.md +0 -131
- package/dist/templates/zh-Hant/docs/prompts/plan.md +0 -252
- package/dist/templates/zh-Hant/docs/prompts/remove.md +0 -162
- package/dist/templates/zh-Hant/docs/prompts/revise.md +0 -160
- package/dist/templates/zh-Hant/docs/prompts/scope.md +0 -198
- package/dist/templates/zh-Hant/docs/prompts/start.md +0 -258
- package/dist/templates/zh-Hant/docs/templates/plan.template.json +0 -88
- package/dist/templates/zh-Hant/docs/templates/scope-brief.template.md +0 -58
- package/dist/templates/zh-Hant/docs/templates/spec.template.md +0 -51
- package/dist/templates/zh-Hant/docs/templates/ui.template.md +0 -51
- package/dist/templates/zh-Hant/rules/00_system.md +0 -123
- package/dist/templates/zh-Hant/rules/01_workflow.md +0 -93
- package/dist/templates/zh-Hant/rules/02_tech_stack.md +0 -192
- package/dist/templates/zh-Hant/rules/03_data_governance.md +0 -102
- package/dist/templates/zh-Hant/rules/04_cli_tools.md +0 -50
- package/dist/templates/zh-Hant/rules/90_custom_rules.md +0 -21
- package/dist/templates/zh-Hant/rules/99_context_glue.md +0 -53
- package/dist/templates/zh-Hant/skills/archi-decompose-roadmap/SKILL.md +0 -293
- package/dist/templates/zh-Hant/skills/archi-interview-protocol/SKILL.md +0 -86
- package/dist/templates/zh-Hant/skills/archi-plan-options/SKILL.md +0 -364
- package/dist/templates/zh-Hant/skills/archi-ui-wireframe/SKILL.md +0 -337
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<protocol_kickoff>
|
|
2
2
|
**Trigger**: `/archi.start [file_path]`
|
|
3
3
|
**Phase**: Strategic Initialization
|
|
4
|
-
**Goal**: Establish
|
|
4
|
+
**Goal**: Establish project constitution (Vision/Tech/Roadmap) from Project Brief.
|
|
5
5
|
|
|
6
6
|
<meta>
|
|
7
7
|
<style>Strict, Professional, CLI-Like</style>
|
|
@@ -20,42 +20,37 @@
|
|
|
20
20
|
**Action**:
|
|
21
21
|
1. Parse `[file_path]` from trigger:
|
|
22
22
|
- If path provided → read that file
|
|
23
|
-
- If not → search `project-brief.md` (project root), then `[[__DOCS_DIR__]]/project-brief.md`
|
|
23
|
+
- If not provided → search `project-brief.md` (project root), then `[[__DOCS_DIR__]]/project-brief.md`
|
|
24
24
|
- If neither exists or empty → goto `<fallback_interview>`
|
|
25
25
|
|
|
26
|
-
2. **Resource
|
|
27
|
-
|
|
26
|
+
2. **Resource scan and read** (must complete before parsing):
|
|
27
|
+
|
|
28
|
+
**a) `brief-assets/` directory scan**: Check if `brief-assets/` exists at project root. If so, read all files (images/PDFs/docs/Schema). Match files referenced in Brief via `./brief-assets/filename` with files read here.
|
|
29
|
+
|
|
30
|
+
**b) Brief full-text external reference check**: Scan Brief for all external references (URLs, file paths, images). Try to access each:
|
|
28
31
|
|
|
29
32
|
| Status | Handling |
|
|
30
33
|
|:---|:---|
|
|
31
|
-
| Accessible | Read content, include in analysis |
|
|
34
|
+
| Accessible (incl. local files in brief-assets/) | Read content, include in analysis |
|
|
32
35
|
| Inaccessible (auth required/404/private) | Mark `[unreadable]`, report to user later |
|
|
33
|
-
| Non-link references
|
|
36
|
+
| Non-link descriptive references | Process normally, no fetch |
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
**c) Asset semantic tag extraction**: For assets referenced in Brief as `- [semantic label] path`, record tag-to-file mapping for later steps (e.g. `[competitor reference]` → affects design_tokens, `[database Schema]` → affects data_snapshot).
|
|
36
39
|
|
|
37
|
-
3. Parse Brief sections, extract:
|
|
38
|
-
- Project feature tags (UI/Data/CLI/Lib/API — inferred from tech fields and paragraphs)
|
|
39
|
-
- Core feature list
|
|
40
|
-
- Pre-defined design decisions (user's preset design for specific features/pages/flows)
|
|
41
|
-
- Tech preferences (distinguish "confirmed" vs "blank/recommend")
|
|
42
|
-
- Existing resources and context
|
|
43
|
-
- Boundaries and constraints
|
|
44
|
-
- Reference projects
|
|
45
|
-
- Supplementary notes (rules/terminology/background)
|
|
40
|
+
3. Parse Brief sections, extract: project feature tags, core task list, business process (if any), pre-defined design decisions, tech preferences (distinguish "confirmed" vs "blank/recommend"), data model draft (if any), existing API endpoints (if any), existing resources, boundaries and constraints, reference projects, supplementary notes.
|
|
46
41
|
|
|
47
|
-
> Brief is a one-time input file; user may delete after processing.
|
|
42
|
+
> Brief is a one-time input file; user may delete after processing (brief-assets/ likewise).
|
|
48
43
|
|
|
49
44
|
**Output**:
|
|
50
|
-
- If any resources inaccessible → **Immediately output Resource Accessibility Report
|
|
51
|
-
- If all accessible or no external refs → Internal summary
|
|
45
|
+
- If any resources inaccessible → **Immediately output Resource Accessibility Report**, wait for user reply before continuing.
|
|
46
|
+
- If all accessible or no external refs → Internal summary, proceed to `<step_1_gap_analysis>`.
|
|
52
47
|
</step_0_ingest>
|
|
53
48
|
|
|
54
49
|
<step_1_gap_analysis>
|
|
55
|
-
**Role**: Chief Product
|
|
50
|
+
**Role**: Chief Product Strategist (CPO)
|
|
56
51
|
**Input**: Step 0 parsing result.
|
|
57
52
|
|
|
58
|
-
**Action**: Check Brief completeness, identify information gaps.
|
|
53
|
+
**Action**: Check Brief completeness item by item, identify information gaps.
|
|
59
54
|
|
|
60
55
|
**Checklist**:
|
|
61
56
|
|
|
@@ -63,196 +58,155 @@
|
|
|
63
58
|
|:---|:---|:---|
|
|
64
59
|
| Project identity | Name + one-line description + problem statement all filled | Required |
|
|
65
60
|
| Target users | At least core user role described | Required |
|
|
66
|
-
| Core
|
|
61
|
+
| Core tasks | At least 2 concrete tasks listed, each with description | Required |
|
|
67
62
|
| Tech stack – core | Language/runtime + core framework filled (non-empty) | Required |
|
|
68
63
|
| Tech stack – optional | DB/ORM/CSS/deploy etc. blanks | Can supplement |
|
|
69
|
-
| Project starting point | New
|
|
64
|
+
| Project starting point | New or existing codebase (affects architecture) | Required |
|
|
70
65
|
| Existing resources | Design/brand/existing API/3rd-party services explicit? | Can supplement |
|
|
71
|
-
| Style/tone |
|
|
66
|
+
| Style/tone | (UI projects only) Visual keywords / (CLI projects only) Output style / (API projects only) Doc approach | Can supplement |
|
|
72
67
|
| Boundaries | At least 1 anti-goal or hard constraint declared | Suggested |
|
|
73
68
|
| Success metrics | Concrete quantifiable metrics filled | Suggested |
|
|
74
69
|
| Reference projects | At least 1 reference listed | Suggested |
|
|
75
70
|
|
|
76
|
-
**Gap levels**:
|
|
77
|
-
- **Required**: Must ask in Step 2
|
|
78
|
-
- **Can supplement**: AI can recommend but better to confirm
|
|
79
|
-
- **Suggested**: AI can infer, does not block flow
|
|
80
|
-
|
|
81
|
-
**Decision**:
|
|
82
|
-
- No "Required" gaps + no "Can supplement" gaps → skip Step 2, go to Step 3
|
|
83
|
-
- Otherwise → go to Step 2
|
|
84
|
-
|
|
85
|
-
**Output**: Brief analysis summary:
|
|
86
|
-
```
|
|
87
|
-
### BRIEF Analysis Report
|
|
88
|
-
> **Project**: [name] | **Features**: [activated UI/Data/CLI/Lib/API tags]
|
|
71
|
+
**Gap levels**: Required → must ask in Step 2 | Can supplement → AI can recommend, suggest confirm | Suggested → AI can infer
|
|
89
72
|
|
|
90
|
-
**
|
|
91
|
-
- [list of filled items]
|
|
73
|
+
**Decision**: No "Required" + "Can supplement" gaps → skip Step 2 | Has gaps → proceed to Step 2
|
|
92
74
|
|
|
93
|
-
**
|
|
94
|
-
- [gap 1]
|
|
95
|
-
- [gap 2]
|
|
96
|
-
|
|
97
|
-
**AI will auto-complete** (no action):
|
|
98
|
-
- [items AI can infer]
|
|
99
|
-
```
|
|
75
|
+
**Output**: Output BRIEF analysis report to user — include project name/feature tags, confirmed items list, information gap list (require supplement), AI auto-complete items.
|
|
100
76
|
</step_1_gap_analysis>
|
|
101
77
|
|
|
102
78
|
<step_2_supplementary>
|
|
103
|
-
**Role**: Product Advisor
|
|
104
79
|
**Trigger**: Only when Step 1 finds "Required" or "Can supplement" gaps.
|
|
105
80
|
**Input**: Step 1 gap list. Max 3–6 questions.
|
|
106
81
|
|
|
107
|
-
[[SKILL:
|
|
82
|
+
[[SKILL: archi-interview-protocol|Follow the skill's core rules and standard output format for questioning.]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-interview-protocol/SKILL.md` and follow its rules)]]
|
|
108
83
|
</step_2_supplementary>
|
|
109
84
|
|
|
110
85
|
<step_3_constitution>
|
|
111
86
|
**Role**: Chief Architect
|
|
112
|
-
**Input**: Full Brief
|
|
87
|
+
**Input**: Full Brief + Step 2 supplement answers (if any).
|
|
113
88
|
|
|
114
89
|
**Action**: Generate project constitution files in one pass. All Brief content must be consumed and routed; nothing omitted.
|
|
115
90
|
|
|
116
91
|
### Information Routing Rules
|
|
117
92
|
|
|
118
|
-
> Rule files (`02_tech_stack`, `90_custom_rules`, etc.) are already injected into context by
|
|
93
|
+
> Rule files (`02_tech_stack`, `90_custom_rules`, etc.) are already injected into context by IDE; AI knows their paths, write directly.
|
|
119
94
|
|
|
120
95
|
| Brief content | Target file |
|
|
121
96
|
|:---|:---|
|
|
122
97
|
| Project identity, target users, success metrics, references | `[[__DOCS_DIR__]]/global/vision.md` |
|
|
123
98
|
| Tech stack, deploy target, 3rd-party libs/services | rule file `02_tech_stack` |
|
|
124
|
-
| Style/tone
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
| Core
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
135
|
-
|
|
99
|
+
| Style/tone — aesthetic direction / density / motion preference | `02_tech_stack` (UI Protocol) + `design_tokens.json` |
|
|
100
|
+
| (UI projects only) Aesthetic preset + visual reference (brand palette / font / icon / competitor screenshots) | `design_tokens.json` corresponding fields + `vision.md` Visual Reference |
|
|
101
|
+
| (UI projects only) Images in brief-assets/ tagged `[competitor reference]` | `design_tokens.json` aestheticDirection reference + `vision.md` Visual Reference |
|
|
102
|
+
| Core task list | `[[__DOCS_DIR__]]/global/roadmap.json` |
|
|
103
|
+
| Business process (if any) | Inject into Roadmap task `description` / `goal`; aids `/archi.plan` context |
|
|
104
|
+
| Pre-defined design decisions | Inject into Roadmap task `goal`; hard constraint in `/archi.plan` |
|
|
105
|
+
| (Data projects only) Data model draft (if any) | `data_snapshot.json` initial entity skeleton |
|
|
106
|
+
| (API projects only) Existing API endpoints (if any) | `vision.md` Context + Roadmap task `description` injection |
|
|
107
|
+
| Files in brief-assets/ tagged `[database Schema]` | Parse and write to `data_snapshot.json` |
|
|
108
|
+
| Files in brief-assets/ tagged `[API docs]` | Parse and route to `vision.md` Context + related Roadmap tasks |
|
|
109
|
+
| Boundaries and anti-goals | `vision.md` Boundaries |
|
|
110
|
+
| Existing resources | `vision.md` + `02_tech_stack` by content |
|
|
111
|
+
| Rules/conventions/preferences from supplementary notes | rule file `90_custom_rules` |
|
|
112
|
+
| Domain terminology from supplementary notes | `dictionary.json` |
|
|
113
|
+
| Other background from supplementary notes | `vision.md` Context |
|
|
114
|
+
|
|
115
|
+
> Key: Rule-like content in supplementary notes must go to `90_custom_rules`; do not discard.
|
|
136
116
|
|
|
137
117
|
### 3.1 Vision (`[[__DOCS_DIR__]]/global/vision.md`)
|
|
138
|
-
- Fill from Brief
|
|
139
|
-
- Fill
|
|
140
|
-
- Fill from Brief style/tone (if any): Design & Experience
|
|
141
|
-
- Derive Product Principles from Brief references
|
|
142
|
-
- Extract background context from Brief existing resources + supplementary notes
|
|
143
|
-
- Fill all `[ ]` placeholders; do not retain template example text
|
|
118
|
+
- Fill from Brief: Core Vision / Target Audience / Boundaries / Design & Experience / Product Principles / background context
|
|
119
|
+
- Fill all placeholders; do not retain template example text
|
|
144
120
|
|
|
145
121
|
### 3.2 Tech Stack (rule file `02_tech_stack`)
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
- **
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
-
|
|
154
|
-
- [?UI] **Data Flow**: Based on realtime needs — no realtime → Standard Request (+ SWR/React Query if applicable); Brief mentions realtime/collab → Realtime
|
|
155
|
-
- [?Web/API] **Auth & Access**: Based on Brief user roles — single role → Authenticated; multi-role → RBAC; no auth mentioned → leave empty for per-feature decision in Plan
|
|
156
|
-
- Each item must have Strategy/Default + Rationale (rationale must be specific to this project)
|
|
122
|
+
- Brief confirmed → write directly | Blank/"recommend" → AI recommends and mark `(AI Recommended)` + rationale
|
|
123
|
+
- **AX Optimization**: Prefer AI-friendly tech when recommending
|
|
124
|
+
- Fill complete Section 1-9
|
|
125
|
+
- **Section 9 Project Conventions**: Establish global conventions by project features (Error Handling / Data Flow / Auth & Access); `/archi.plan` will auto-inherit
|
|
126
|
+
- Error Handling: (UI projects only) Fail Fast + Form Validation / (CLI projects only) Fail Fast (stderr) / (API projects only) Schema Validation + Fail Fast
|
|
127
|
+
- (UI projects only) Data Flow: No realtime need → Standard Request / Brief mentions realtime → Realtime
|
|
128
|
+
- (UI or API projects only) Auth & Access: Single role → Authenticated / Multi-role → RBAC / No description → leave empty for Plan
|
|
129
|
+
- Each item must have Strategy/Default + Rationale
|
|
157
130
|
|
|
158
131
|
### 3.3 Custom Rules (rule file `90_custom_rules`)
|
|
159
|
-
- Extract rule-like content from Brief supplementary notes
|
|
160
|
-
- Convert Brief tech red lines into concrete prohibitions
|
|
161
|
-
- If user provided nothing, keep template default
|
|
132
|
+
- Extract rule-like content from Brief supplementary notes + convert tech red lines to prohibitions
|
|
162
133
|
|
|
163
134
|
### 3.4 Roadmap (`[[__DOCS_DIR__]]/global/roadmap.json`)
|
|
164
|
-
[[SKILL:
|
|
135
|
+
[[SKILL: archi-decompose-roadmap|Follow the skill protocol to generate task chain from Brief task list, write to roadmap.json; proceed to next step immediately without user confirmation.]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-decompose-roadmap/SKILL.md` and follow its protocol)]]
|
|
165
136
|
|
|
166
137
|
### 3.5 Other global docs (as needed)
|
|
167
138
|
- `dictionary.json`: Extract domain terms from Brief
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
|
|
171
|
-
- `aestheticDirection.customDescription`: Only fill when preset is "custom"
|
|
172
|
-
- `primitivePalette.brand`: Extract Hex values from brand palette; leave empty if none
|
|
173
|
-
- `mode`: Infer default + support array from aesthetic direction (saas-dark → default:"dark", saas-light → default:"light", etc.)
|
|
174
|
-
- `motion.preference` / `motion.patterns`: Set from motion preference (subtle / rich / none); expand patterns for rich
|
|
175
|
-
- `illustration.style` / `illustration.iconLibrary`: Set from illustration style and icon library fields
|
|
176
|
-
- `semanticTokens.colors`: If brand color present, fill Primary using Brand-600/Brand-500 keys
|
|
177
|
-
- `error_codes.json`: Predefine core error codes from feature list
|
|
139
|
+
- (Data projects only) `data_snapshot.json`: Initialize core entity skeleton; write empty template if no data description
|
|
140
|
+
- (UI projects only) `design_tokens.json`: Fill aestheticDirection / primitivePalette / mode / motion / illustration / semanticTokens from "Style & Tone" and "Visual Reference"
|
|
141
|
+
- `error_codes.json`: Predefine core error codes from task list
|
|
178
142
|
|
|
179
143
|
### 3.6 Map (`[[__DOCS_DIR__]]/global/map.json`)
|
|
180
|
-
- `directoryMapping`: Pre-register core directory skeleton
|
|
181
|
-
|
|
182
|
-
- `logicalTopology`: Empty array for now; populate during `/archi.plan`
|
|
183
|
-
- `criticalUserJourneys`: Empty array
|
|
184
|
-
- `featureRelations`: Empty array
|
|
185
|
-
|
|
186
|
-
**Output**: Write all files, then run `npx archi render` to generate visual `.md`.
|
|
187
|
-
</step_3_constitution>
|
|
144
|
+
- `directoryMapping`: Pre-register core directory skeleton from tech_stack architecture pattern
|
|
145
|
+
- `logicalTopology` / `criticalUserJourneys` / `featureRelations`: Empty array for now
|
|
188
146
|
|
|
189
|
-
|
|
190
|
-
**Role**: Chief Auditor
|
|
191
|
-
**Checklist**:
|
|
192
|
-
1. **Vision completeness**: Does `vision.md` include North Star metric and design philosophy?
|
|
193
|
-
2. **Tech Stack consistency**: Is rule file `02_tech_stack` aligned with Brief preferences? Contains full stack?
|
|
194
|
-
3. **Custom Rules**: Did Brief supplementary notes/tech red lines get written to rule file `90_custom_rules`?
|
|
195
|
-
4. **Roadmap compliance**: Run `npx archi task --check` to verify.
|
|
196
|
-
5. [?UI] **Design Tokens**: Does `design_tokens.json` have base color/font/spacing definitions?
|
|
197
|
-
6. **Brief alignment**: All Brief core features mapped to Roadmap tasks?
|
|
198
|
-
7. **Zero omission**: All user-provided content routed to correct files?
|
|
199
|
-
|
|
200
|
-
Silently fix issues; mark critical ones with `Risk Warning`.
|
|
201
|
-
</step_4_audit>
|
|
202
|
-
|
|
203
|
-
<step_4_5_ui_wireframe>
|
|
204
|
-
**Trigger**: Only when project features include [?UI].
|
|
205
|
-
**Action**: Auto-invoke `archi-ui-wireframe` Skill (Phase 1 wireframe).
|
|
147
|
+
UI projects only: **UI concept design**: [[SKILL: archi-ui-wireframe|Follow the skill protocol to auto-generate UI concept design.]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and follow its protocol)]]
|
|
206
148
|
- Start generation without user confirmation
|
|
207
149
|
- Read the just-written vision.md + roadmap.json + design_tokens.json + 02_tech_stack
|
|
208
150
|
- Write `ui_concept.html` + `ui_context.md`
|
|
209
|
-
- Output
|
|
151
|
+
- Output UI concept design summary; await user confirmation or feedback for adjustments
|
|
210
152
|
|
|
211
|
-
|
|
212
|
-
</
|
|
153
|
+
**Output**: Write all files, then run `npx archi render`. Enter step_4_verify.
|
|
154
|
+
</step_3_constitution>
|
|
213
155
|
|
|
214
|
-
<
|
|
215
|
-
**
|
|
216
|
-
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
156
|
+
<step_4_verify>
|
|
157
|
+
**Role**: Independent Reviewer
|
|
158
|
+
[[SUBAGENT: archi-silent-audit|mode: init, context: Review step_3 generated global files (vision, tech_stack, roadmap, dictionary, etc.)]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`, follow mode: init review dimension table item by item)]]
|
|
159
|
+
|
|
160
|
+
[[INCLUDE: shared/verify-result-handling.md]]
|
|
161
|
+
</step_4_verify>
|
|
220
162
|
|
|
221
|
-
|
|
222
|
-
|
|
163
|
+
<step_5_signoff>
|
|
164
|
+
**Terminal Gate** (do not skip): Standard check (task --check + render).
|
|
165
|
+
|
|
166
|
+
**Pre-signoff Checklist** (confirm each item after Gate passes, before Output):
|
|
167
|
+
□ vision.md — all placeholders replaced, no template example text remaining
|
|
168
|
+
□ 02_tech_stack.md — Sections 1-9 fully filled, Section 9 Project Conventions includes Strategy + Rationale
|
|
169
|
+
□ roadmap.json — archi-decompose-roadmap Skill executed, task chain generated
|
|
170
|
+
□ map.json — core directory skeleton pre-registered (directoryMapping)
|
|
171
|
+
□ dictionary.json + error_codes.json — domain terms and core error codes extracted
|
|
172
|
+
□ (UI projects only) design_tokens.json + ui_concept.html + ui_context.md — generated
|
|
173
|
+
□ (Data projects only) data_snapshot.json — initial entity skeleton written
|
|
174
|
+
□ Step 4 Silent Audit — executed, all CRITICAL issues resolved
|
|
175
|
+
|
|
176
|
+
**Action** (after Checklist confirmed):
|
|
177
|
+
1. Run `npx archi task` to output task progress overview.
|
|
223
178
|
2. Output summary.
|
|
224
179
|
|
|
225
|
-
**Output**: Project init summary including:
|
|
226
|
-
- **Brief
|
|
180
|
+
**Output**: Project init summary, including:
|
|
181
|
+
- **Brief source confirmation**: Key decisions adopted from Brief
|
|
227
182
|
- **AI completions**: Tech/decisions AI recommended and rationale
|
|
228
183
|
- **Roadmap overview**: Task count and phase distribution
|
|
229
184
|
- **Next Steps table**:
|
|
230
185
|
|
|
231
186
|
| Priority | Action | Notes |
|
|
232
187
|
|:---|:---|:---|
|
|
233
|
-
|
|
|
188
|
+
| (UI projects only) Recommended | Review ui_concept.html | UI concept design auto-generated; confirm layout and visuals in browser |
|
|
234
189
|
| Recommended | `/archi.plan INF-01` | Plan the first infrastructure task |
|
|
235
|
-
| Optional | `/archi.scope <scope-brief.md>` |
|
|
190
|
+
| Optional | `/archi.scope <scope-brief.md>` | If more requirements to decompose, append to Roadmap |
|
|
236
191
|
</step_5_signoff>
|
|
237
192
|
|
|
238
193
|
<fallback_interview>
|
|
239
194
|
**Trigger**: Brief file not found or empty.
|
|
240
|
-
**Role**: Product Advisor
|
|
241
195
|
|
|
242
196
|
**Action**:
|
|
243
|
-
1.
|
|
197
|
+
1. Inform user `project-brief.md` not found. Suggest:
|
|
244
198
|
- Check project root for the file (should have been generated by `npx archi init`)
|
|
245
199
|
- If lost, re-run `npx archi init` to regenerate
|
|
246
200
|
- Or continue conversation and provide info via interview
|
|
247
|
-
2. If user
|
|
201
|
+
2. If user chooses to continue conversation, guide in this order:
|
|
248
202
|
a. What is the project? (name, one-line description, problem solved)
|
|
249
203
|
b. Who is it for? (target users)
|
|
250
|
-
c.
|
|
204
|
+
c. What are the core tasks? (at least 2–3)
|
|
251
205
|
d. Tech stack? (language/framework, confirmed parts)
|
|
252
|
-
e.
|
|
206
|
+
e. What constraints? (anti-goals, timeline, compatibility)
|
|
253
207
|
3. After collection, write to `project-brief.md` (project root), then goto `<step_1_gap_analysis>`.
|
|
254
208
|
|
|
255
|
-
>
|
|
209
|
+
> This mode is for backward compatibility; core flow remains Brief-driven.
|
|
256
210
|
</fallback_interview>
|
|
257
211
|
|
|
258
212
|
</protocol_kickoff>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "[?Complex] Technical Design — Defines implementation strategy, state flow, parameters and invariants for core mechanisms. Generated only when the task involves non-trivial technical decisions."
|
|
3
|
+
glue: Bridges spec.md (WHAT) and plan.json (DO), defining HOW. plan.json tasks must cover all mechanisms in this doc; spec.md § 2 AC must be traceable to complete paths in this design.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Technical Design: {FEATURE_NAME}
|
|
7
|
+
|
|
8
|
+
> **Spec**: `spec.md` (Acceptance Criteria — constraint source for this design)
|
|
9
|
+
> **Plan**: `plan.json` (Execution tasks — downstream consumer of this design)
|
|
10
|
+
> **Trigger**: [AI: One sentence explaining why this task needs technical design]
|
|
11
|
+
|
|
12
|
+
## 1. Solution Overview
|
|
13
|
+
|
|
14
|
+
<!-- [AI]: 2-3 sentences summarizing the technical approach and key trade-offs.
|
|
15
|
+
- Reference plan.json decisions (e.g. "Data Flow=Realtime WebSocket")
|
|
16
|
+
- Explain why this approach over alternatives (brief ref if discussed in step_2)
|
|
17
|
+
- Do not repeat spec.md acceptance criteria; this section answers "how to implement" not "what to implement"
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
## 2. Core Mechanisms
|
|
21
|
+
|
|
22
|
+
<!-- [AI]: Main body of this doc. Select ≥1 structured pattern per technical need.
|
|
23
|
+
Each mechanism in its own subsection (2.1, 2.2, ...), labeled with pattern type.
|
|
24
|
+
Same task may combine patterns (e.g. State Machine for connection mgmt + Pipeline for message handling).
|
|
25
|
+
|
|
26
|
+
[[SKILL: archi-design-patterns|Follow the skill's pattern selection guide, generate standard-format tables and run self-checks. If any check fails, fix and re-check before proceeding to next mechanism.]]
|
|
27
|
+
-->
|
|
28
|
+
|
|
29
|
+
### 2.1 [Mechanism Name] — Pattern: [State Machine / Pipeline / Decision Matrix / Protocol]
|
|
30
|
+
|
|
31
|
+
<!-- Fill per archi-design-patterns skill's standard format for the chosen pattern -->
|
|
32
|
+
|
|
33
|
+
## 3. Parameters
|
|
34
|
+
|
|
35
|
+
<!-- [AI]: All concrete numeric values used across mechanisms, centralized.
|
|
36
|
+
Prohibit vague descriptions (e.g. "appropriate timeout", "reasonable interval"); must state concrete value + unit + rationale.
|
|
37
|
+
|
|
38
|
+
| Parameter | Value | Unit | Rationale |
|
|
39
|
+
|:---|:---|:---|:---|
|
|
40
|
+
| [name] | [value] | [unit] | [why this value] |
|
|
41
|
+
-->
|
|
42
|
+
|
|
43
|
+
## 4. Invariants
|
|
44
|
+
|
|
45
|
+
<!-- [AI]: Assertions that must hold at any time. Each must be assertable or testable.
|
|
46
|
+
Format: [INV-N] assertion description
|
|
47
|
+
|
|
48
|
+
Constraints:
|
|
49
|
+
- Each invariant must map to at least one plan.json test entry or task notes verification
|
|
50
|
+
- Invariants are implementation "guardrails": AI must ensure no violation when writing code
|
|
51
|
+
-->
|
|
52
|
+
|
|
53
|
+
## 5. Failure Modes
|
|
54
|
+
|
|
55
|
+
<!-- [AI]: Explicitly list possible failure scenarios for core mechanisms. Each must have detection and response.
|
|
56
|
+
|
|
57
|
+
| Failure | Detection | Response | Fallback |
|
|
58
|
+
|:---|:---|:---|:---|
|
|
59
|
+
| [description] | [how to detect: event/timeout/exception type] | [primary recovery: retry/reconnect/rollback] | [if recovery fails: switch mode/prompt user/silent log] |
|
|
60
|
+
|
|
61
|
+
Constraints:
|
|
62
|
+
- Detection must be concrete (no "on error"; write "4xx response / 3 heartbeat timeouts / catch TypeError")
|
|
63
|
+
- Fallback must be observable (no "report error"; write specific UI feedback or exit code)
|
|
64
|
+
-->
|
|
65
|
+
|
|
66
|
+
## 6. Trace Verification
|
|
67
|
+
|
|
68
|
+
<!-- [AI]: From each spec.md § 2 AC, trace the execution path through this design.
|
|
69
|
+
|
|
70
|
+
| AC (from spec § 2) | Trace Path (execution chain in this design) | Result |
|
|
71
|
+
|:---|:---|:---|
|
|
72
|
+
| [Given X When Y Then Z] | [State A →(event)→ State B →(action)→ State C] or [Pipeline Step 1→2→3] | ✓ Reachable |
|
|
73
|
+
| [Given X When Error Then W] | [State A →(error)→ State D; Failure Mode #2 → fallback] | ✓ Reachable |
|
|
74
|
+
|
|
75
|
+
**Gap Check**: If an AC cannot be traced → design has a gap; return to § 2 to add mechanism or § 5 to add failure handling.
|
|
76
|
+
Design is deliverable only when all ACs are ✓.
|
|
77
|
+
-->
|
|
@@ -1,51 +1,86 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Task Specification for {FEATURE_NAME}.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Task Spec: {FEATURE_NAME}
|
|
6
6
|
|
|
7
7
|
> **Status:** [Draft]
|
|
8
|
-
> **
|
|
8
|
+
> **Task Type:** [Feature / Infra / Polish]
|
|
9
|
+
> **Context:** [AI: One-sentence summary of this task's goal and value]
|
|
9
10
|
|
|
10
|
-
## 1.
|
|
11
|
+
## 1. Overview
|
|
11
12
|
|
|
12
|
-
<!-- [AI
|
|
13
|
+
<!-- [AI]: Brief task background, goal, and user value (2-3 sentences).
|
|
14
|
+
- FEAT task: From user perspective describe "As a [Role], I want to [Action], So that [Benefit]"
|
|
15
|
+
- INF task: Describe the downstream scope this infrastructure supports
|
|
16
|
+
- POLISH task: Describe current state and optimization target
|
|
17
|
+
-->
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
## 2. Acceptance Criteria
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
<!-- [AI]: Core acceptance contract — sole basis for development and testing.
|
|
22
|
+
Select applicable dimension format by Task Type (inferred from ID prefix); may combine multiple dimensions.
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
=== Dimension Building Blocks (select at least one primary dimension) ===
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
▸ Behavioral [FEAT primary]
|
|
27
|
+
Use Gherkin Given/When/Then to define system behavior paths (happy + exception).
|
|
21
28
|
|
|
22
|
-
|
|
29
|
+
▸ Structural [INF primary]
|
|
30
|
+
Use Configuration Contract to define target state of files/config:
|
|
31
|
+
- Path: file path
|
|
32
|
+
- Key Settings: key config items and concrete values (no generic descriptions like "configure X")
|
|
33
|
+
- Constraints: technical red lines
|
|
34
|
+
- Verify: executable command + expected output
|
|
23
35
|
|
|
24
|
-
|
|
36
|
+
▸ Quantitative [POLISH primary]
|
|
37
|
+
Use Quality Target to define measurable goals:
|
|
38
|
+
- Metric: metric name
|
|
39
|
+
- Baseline: current value
|
|
40
|
+
- Target: target value
|
|
41
|
+
- Verify: measurement method
|
|
25
42
|
|
|
26
|
-
|
|
43
|
+
▸ Contractual [integration / shared engine]
|
|
44
|
+
Define interface contracts for external exposure or integration:
|
|
45
|
+
- External API Input/Output/Error mapping
|
|
46
|
+
- Shared module export type signatures
|
|
27
47
|
|
|
28
|
-
|
|
48
|
+
▸ Invariant [refactoring]
|
|
49
|
+
Declare behavior/interface that must remain unchanged:
|
|
50
|
+
- Preserve: [behavior or interface that must not change]
|
|
51
|
+
- Verify: [regression verification method]
|
|
29
52
|
|
|
30
|
-
|
|
53
|
+
=== Mixed task example ===
|
|
54
|
+
INF task may include Behavioral sub-dimension (e.g. hotkey registration has behavior path)
|
|
55
|
+
FEAT task may include Structural sub-dimension (e.g. config file creation)
|
|
56
|
+
Use sub-headings to distinguish dimensions.
|
|
57
|
+
-->
|
|
31
58
|
|
|
32
|
-
|
|
59
|
+
## 3. Data Requirements
|
|
33
60
|
|
|
34
|
-
|
|
61
|
+
<!-- [AI]: [?Data] Declare data changes, reference table structure in data_snapshot.json.
|
|
62
|
+
Write "N/A" when no data changes.
|
|
35
63
|
|
|
36
|
-
|
|
64
|
+
* Schema: [Table Name] -> [Field] (Add/Modify)
|
|
65
|
+
* API: [Method] [Path]
|
|
66
|
+
* Permissions: [Required Role]
|
|
67
|
+
-->
|
|
37
68
|
|
|
38
|
-
|
|
69
|
+
## 4. Interface Exports
|
|
39
70
|
|
|
40
|
-
|
|
71
|
+
<!-- [AI]: [?Upstream] Public interfaces, conventions, import paths this task exposes to downstream tasks.
|
|
72
|
+
Downstream tasks depend on this declaration rather than guessing. Omit when no downstream consumers.
|
|
41
73
|
|
|
42
|
-
|
|
74
|
+
Format:
|
|
75
|
+
| Export | Value | Consumer |
|
|
76
|
+
|:---|:---|:---|
|
|
77
|
+
| [convention/API/path alias/script] | [concrete value] | [downstream task ID] |
|
|
78
|
+
-->
|
|
43
79
|
|
|
44
|
-
|
|
45
|
-
- Example: `Comment` -> `content` (Add), `parent_id` (Add, nullable)
|
|
80
|
+
## 5. Constraints
|
|
46
81
|
|
|
47
|
-
|
|
48
|
-
- Example: `POST /api/comments`, `GET /api/comments/:id`
|
|
82
|
+
<!-- [AI]: Extract red-line constraints relevant to this task from vision.md + 02_tech_stack.md.
|
|
49
83
|
|
|
50
|
-
|
|
51
|
-
-
|
|
84
|
+
Format:
|
|
85
|
+
- [constraint content] (ref: [source])
|
|
86
|
+
-->
|