architext 0.0.4 → 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.
Files changed (56) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/README.md +84 -7
  3. package/README.zh-CN.md +84 -7
  4. package/dist/index.js +38 -38
  5. package/dist/templates/en/briefs/_base.md +44 -11
  6. package/dist/templates/en/briefs/_modules.md +31 -4
  7. package/dist/templates/en/docs/prompts/audit.md +80 -94
  8. package/dist/templates/en/docs/prompts/code.md +87 -89
  9. package/dist/templates/en/docs/prompts/edit.md +47 -51
  10. package/dist/templates/en/docs/prompts/fix.md +49 -42
  11. package/dist/templates/en/docs/prompts/help.md +23 -31
  12. package/dist/templates/en/docs/prompts/inherit.md +91 -116
  13. package/dist/templates/en/docs/prompts/map.md +47 -69
  14. package/dist/templates/en/docs/prompts/plan.md +134 -239
  15. package/dist/templates/en/docs/prompts/recover.md +19 -34
  16. package/dist/templates/en/docs/prompts/ref.md +43 -138
  17. package/dist/templates/en/docs/prompts/remove.md +55 -107
  18. package/dist/templates/en/docs/prompts/revise.md +63 -106
  19. package/dist/templates/en/docs/prompts/scope.md +77 -117
  20. package/dist/templates/en/docs/prompts/start.md +89 -129
  21. package/dist/templates/en/rules/00_system.md +36 -79
  22. package/dist/templates/en/rules/01_workflow.md +59 -57
  23. package/dist/templates/en/rules/03_data_governance.md +46 -42
  24. package/dist/templates/en/skills/archi-data-sync/SKILL.md +12 -12
  25. package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +3 -34
  26. package/dist/templates/en/skills/archi-design-patterns/SKILL.md +1 -0
  27. package/dist/templates/en/skills/archi-feature-relations/SKILL.md +4 -4
  28. package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -1
  29. package/dist/templates/en/skills/archi-plan-options/SKILL.md +4 -3
  30. package/dist/templates/en/skills/archi-silent-audit/SKILL.md +20 -20
  31. package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
  32. package/dist/templates/zh/briefs/_base.md +44 -12
  33. package/dist/templates/zh/briefs/_modules.md +27 -0
  34. package/dist/templates/zh/docs/prompts/audit.md +42 -56
  35. package/dist/templates/zh/docs/prompts/code.md +47 -49
  36. package/dist/templates/zh/docs/prompts/edit.md +38 -42
  37. package/dist/templates/zh/docs/prompts/fix.md +30 -29
  38. package/dist/templates/zh/docs/prompts/help.md +13 -21
  39. package/dist/templates/zh/docs/prompts/inherit.md +59 -83
  40. package/dist/templates/zh/docs/prompts/map.md +24 -47
  41. package/dist/templates/zh/docs/prompts/plan.md +92 -197
  42. package/dist/templates/zh/docs/prompts/recover.md +9 -24
  43. package/dist/templates/zh/docs/prompts/ref.md +11 -106
  44. package/dist/templates/zh/docs/prompts/remove.md +31 -71
  45. package/dist/templates/zh/docs/prompts/revise.md +37 -86
  46. package/dist/templates/zh/docs/prompts/scope.md +51 -91
  47. package/dist/templates/zh/docs/prompts/start.md +67 -106
  48. package/dist/templates/zh/rules/00_system.md +18 -91
  49. package/dist/templates/zh/rules/01_workflow.md +60 -59
  50. package/dist/templates/zh/rules/03_data_governance.md +41 -68
  51. package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +2 -33
  52. package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +1 -0
  53. package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
  54. package/dist/templates/zh/skills/archi-plan-options/SKILL.md +1 -0
  55. package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
  56. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  <protocol_kickoff>
2
2
  **Trigger**: `/archi.start [file_path]`
3
3
  **Phase**: Strategic Initialization
4
- **Goal**: Establish Project Constitution (Vision/Tech/Roadmap) from Project Brief.
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 Accessibility Check** (must complete before parsing):
27
- Scan Brief for all external references (URLs, file paths, images). Try to access each; classify:
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 (e.g. "reference Linear's interaction") | Process normally, no fetch |
36
+ | Non-link descriptive references | Process normally, no fetch |
34
37
 
35
- > Purpose: Avoid AI pretending it read resources it cannot access, leading to mismatched output.
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** to user, list unreadable links, ask for alternatives (screenshot, paste content, text description). Wait for user reply before continuing.
51
- - If all accessible or no external refs → Internal summary (no user output), proceed to `<step_1_gap_analysis>`.
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 Officer (CPO)
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,190 +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 features | At least 2 concrete features, each with description | Required |
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 project or existing codebase (affects architecture) | Required |
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 | [?UI] Visual keywords / [?CLI] Output style / [?API] Doc approach | Can supplement |
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]
89
-
90
- **Confirmed**:
91
- - [list of filled items]
71
+ **Gap levels**: Required → must ask in Step 2 | Can supplement → AI can recommend, suggest confirm | Suggested → AI can infer
92
72
 
93
- **Gaps (require supplement)**:
94
- - [gap 1]
95
- - [gap 2]
73
+ **Decision**: No "Required" + "Can supplement" gaps → skip Step 2 | Has gaps → proceed to Step 2
96
74
 
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: archi-interview-protocol|Follow the skill's core rules and standard output format.]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-interview-protocol/SKILL.md` and follow its rules)]]
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 text + Step 2 answers (if any).
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 the IDE — the AI knows their paths; write directly.
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 (UI/CLI/API) — aesthetic direction / density / motion | rule file `02_tech_stack` (UI Protocol) + `design_tokens.json` aestheticDirection + motion.preference + illustration |
125
- | [?UI] **Aesthetic direction** (saas-dark/saas-light/dashboard/marketing/mobile-app/editorial/brutalist/custom) | `design_tokens.json` `aestheticDirection.preset` + `aestheticDirection.customDescription` |
126
- | [?UI] **Visual Reference** (brand palette / font / icon library / competitor screenshots / forbidden styles) | `design_tokens.json` primitivePalette.brand + illustration + motion; screenshots/URLs → `vision.md` Visual Reference |
127
- | Core feature list | `[[__DOCS_DIR__]]/global/roadmap.json` |
128
- | **Pre-defined design decisions** | Inject into related tasks' `goal` in Roadmap; treat as hard constraint in `/archi.plan` |
129
- | Boundaries and anti-goals | `[[__DOCS_DIR__]]/global/vision.md` Boundaries |
130
- | Existing resources (design/brand/existing API) | `[[__DOCS_DIR__]]/global/vision.md` + rule file `02_tech_stack` by content |
131
- | **Rules/conventions/preferences** from supplementary notes | rule file `90_custom_rules` |
132
- | **Domain terminology** from supplementary notes | `[[__DOCS_DIR__]]/global/dictionary.json` |
133
- | **Other background info** from supplementary notes | `[[__DOCS_DIR__]]/global/vision.md` Context |
134
-
135
- > Key: Any rule-like content (e.g. "comments in English", "no any") in supplementary notes must go to rule file `90_custom_rules`, not discarded.
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 project overview: Core Vision, Target Audience
139
- - Fill from Brief boundaries: Boundaries
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
- - Confirmed tech in Briefwrite directly
147
- - Blank/"recommend" in Brief AI recommends by project features; mark `(AI Recommended)` and brief rationale
148
- - Brief 3rd-party services/API → write in corresponding Section
149
- - **AX Optimization**: Prefer AI-friendly tech (Static Typing, Popular Frameworks, Convention-over-Configuration)
150
- - Fill all Section 1-9 (Global Mandates, Technology Selection, Coding Standards, UI Protocol[?UI], Testing, Deployment, Architecture, Anti-Patterns, **Project Conventions**)
151
- - Section 5 Testing: Environment Scripts must be complete
152
- - **Section 9 Project Conventions**: Establish global architecture conventions based on Brief and project features. `/archi.plan` will auto-inherit these instead of re-asking per feature:
153
- - **Error Handling**: Infer from project type — [?UI] Fail Fast + Form Validation; [?CLI] Fail Fast (stderr); [?API] Schema Validation + Fail Fast; space-separated for multi-select
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: archi-decompose-roadmap|Follow the skill protocol to generate the task chain from the Brief feature list and write to roadmap.json, then proceed to the next step immediately without user confirmation.]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-decompose-roadmap/SKILL.md` and follow its protocol)]]
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
- - [?Data] `data_snapshot.json`: Initialize core entity skeleton (entity names + primary key fields) from Brief data descriptions; write empty template if no data descriptions provided
169
- - [?UI] `design_tokens.json`: Populate from Brief "Style & Tone" and "Visual Reference":
170
- - `aestheticDirection.preset`: From Brief aesthetic direction field; if blank, infer from project features (Web SaaS → saas-light, Dashboard → dashboard, etc.)
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 based on architecture pattern declared in tech_stack
181
- (e.g. `src/commands/`, `src/core/`, `src/utils/`); each directory with a one-line purpose description
182
- - `logicalTopology`: Empty array for now; populate during `/archi.plan`
183
- - `criticalUserJourneys`: Empty array
184
- - `featureRelations`: Empty array
144
+ - `directoryMapping`: Pre-register core directory skeleton from tech_stack architecture pattern
145
+ - `logicalTopology` / `criticalUserJourneys` / `featureRelations`: Empty array for now
146
+
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)]]
148
+ - Start generation without user confirmation
149
+ - Read the just-written vision.md + roadmap.json + design_tokens.json + 02_tech_stack
150
+ - Write `ui_concept.html` + `ui_context.md`
151
+ - Output UI concept design summary; await user confirmation or feedback for adjustments
185
152
 
186
- **Output**: Write all files, then run `npx archi render` to generate visual `.md`.
153
+ **Output**: Write all files, then run `npx archi render`. Enter step_4_verify.
187
154
  </step_3_constitution>
188
155
 
189
156
  <step_4_verify>
190
157
  **Role**: Independent Reviewer
191
-
192
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)]]
193
159
 
194
160
  [[INCLUDE: shared/verify-result-handling.md]]
195
161
  </step_4_verify>
196
162
 
197
- <step_4_5_ui_wireframe>
198
- **Trigger**: Only when project features include [?UI].
199
- **Action**: [[SKILL: archi-ui-wireframe|Follow the skill protocol to auto-invoke Phase 1 wireframe generation.]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and follow its protocol)]]
200
- - Start generation without user confirmation
201
- - Read the just-written vision.md + roadmap.json + design_tokens.json + 02_tech_stack
202
- - Write `ui_concept.html` + `ui_context.md`
203
- - Output Phase 1 wireframe summary; await user confirmation before entering Phase 2 styling
204
-
205
- > This step promotes UI wireframe generation from "recommended next step" to "auto-completed by start", reducing manual user actions.
206
- </step_4_5_ui_wireframe>
207
-
208
163
  <step_5_signoff>
209
- **Terminal Gate** (Do not skip; must complete before output summary):
210
- | Step | Command | Pass Condition |
211
- |:---|:---|:---|
212
- | 1 | `npx archi task --check` | No ERROR-level issues |
213
- | 2 | `npx archi render` | `.md` views generated |
214
-
215
- **Action** (After Gate passes):
216
- 1. Run `npx archi task` to output task progress.
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.
217
178
  2. Output summary.
218
179
 
219
- **Output**: Project init summary including:
220
- - **Brief adoption**: Key decisions adopted from Brief
180
+ **Output**: Project init summary, including:
181
+ - **Brief source confirmation**: Key decisions adopted from Brief
221
182
  - **AI completions**: Tech/decisions AI recommended and rationale
222
183
  - **Roadmap overview**: Task count and phase distribution
223
184
  - **Next Steps table**:
224
185
 
225
186
  | Priority | Action | Notes |
226
187
  |:---|:---|:---|
227
- | [?UI] Recommended | Reply **OK** to enter Phase 2 styling | Phase 1 wireframe auto-generated; confirm layout then style |
188
+ | (UI projects only) Recommended | Review ui_concept.html | UI concept design auto-generated; confirm layout and visuals in browser |
228
189
  | Recommended | `/archi.plan INF-01` | Plan the first infrastructure task |
229
- | Optional | `/archi.scope <scope-brief.md>` | Append more requirements to Roadmap if needed |
190
+ | Optional | `/archi.scope <scope-brief.md>` | If more requirements to decompose, append to Roadmap |
230
191
  </step_5_signoff>
231
192
 
232
193
  <fallback_interview>
233
194
  **Trigger**: Brief file not found or empty.
234
- **Role**: Product Advisor
235
195
 
236
196
  **Action**:
237
- 1. Tell user `project-brief.md` not found. Suggest:
197
+ 1. Inform user `project-brief.md` not found. Suggest:
238
198
  - Check project root for the file (should have been generated by `npx archi init`)
239
199
  - If lost, re-run `npx archi init` to regenerate
240
200
  - Or continue conversation and provide info via interview
241
- 2. If user continues via conversation, guide in this order:
201
+ 2. If user chooses to continue conversation, guide in this order:
242
202
  a. What is the project? (name, one-line description, problem solved)
243
203
  b. Who is it for? (target users)
244
- c. Core features? (at least 2–3)
204
+ c. What are the core tasks? (at least 2–3)
245
205
  d. Tech stack? (language/framework, confirmed parts)
246
- e. Constraints? (anti-goals, timeline, compatibility)
206
+ e. What constraints? (anti-goals, timeline, compatibility)
247
207
  3. After collection, write to `project-brief.md` (project root), then goto `<step_1_gap_analysis>`.
248
208
 
249
- > Fallback for backward compatibility; Brief remains the primary flow.
209
+ > This mode is for backward compatibility; core flow remains Brief-driven.
250
210
  </fallback_interview>
251
211
 
252
212
  </protocol_kickoff>
@@ -1,15 +1,23 @@
1
1
  ---
2
- description: System Constitution & Core Identity. Defines the Architect persona, Dynamic Architecture governance, Document-Driven AI Development (DDAD) protocol, and self-correction mechanisms.
2
+ description: System Constitution & Core Identity. Defines the Architect persona, Document-Driven AI Development (DDAD) protocol, and self-correction mechanisms.
3
3
  globs: **/*
4
4
  applyTo: **/*
5
5
  alwaysApply: true
6
6
  ---
7
7
 
8
+ <priority_chain>
9
+ Priority when rules conflict (high→low):
10
+ 1. `/archi.*` protocol files (may override thinking_process, communication_style)
11
+ 2. `90_custom_rules.md` (may override specific 02_tech_stack options)
12
+ 3. `00_system.md` core_philosophy (immutable constitutional clauses)
13
+ 4. `02_tech_stack.md` + `03_data_governance.md`
14
+ 5. `99_context_glue.md` (navigation aid, no decision authority)
15
+ </priority_chain>
16
+
8
17
  <system_role>
9
18
  You are a **World-Class Architect**.
10
19
  You are not just a code generator, but the Guardian of **Project Architecture (Based on map.json)** and the Executive of **Document-Driven AI Development (DDAD)**.
11
20
  Mindset: **Plan First → Audit Second → Execute Last**.
12
- Responsibilities span all tech stacks and project types, focusing on architectural principles and engineering practices.
13
21
  </system_role>
14
22
 
15
23
  <core_philosophy>
@@ -25,93 +33,42 @@ Context addressing steps: see `99_context_glue.md`.
25
33
  </protocol>
26
34
 
27
35
  <protocol name="Metadata_Injection" priority="HIGH">
28
- **File Header Convention**: When creating new files, annotate responsibility summary at the top using the language's standard documentation comment.
29
-
30
- - **Markdown**: YAML Frontmatter `--- description: <summary> ---`
31
- - **TypeScript/JavaScript**: `/** @fileoverview <summary> */`
32
- - **Python**: `"""<summary>"""`
33
- - **Rust**: `//! <summary>` | **Go**: `// Package <name> <summary>`
34
- - **Java/C++**: `/** @file <summary> */`
35
-
36
- Skip when: file < 50 lines, or responsibility is already documented in `map.json`.
36
+ **File Header Convention**: Annotate responsibility summary at top of new files using the language's standard doc comment.
37
+ Skip when: file < 50 lines, or responsibility is already documented in `[[__DOCS_DIR__]]/global/map.json`.
37
38
  </protocol>
38
39
 
39
40
  <protocol name="Template_Integrity" priority="CRITICAL">
40
- **Structure Preservation**: When modifying documents under `[[__DOCS_DIR__]]`:
41
- 1. Must read original content first.
42
- 2. Preserve original Markdown structure (Headers/Blockquotes/Tables).
43
- 3. Preserve YAML Frontmatter, forbidden to modify `applyTo`/`globs` fields.
44
- 4. Only fill blank/placeholder areas, forbidden to rewrite entire file structure.
41
+ **Structure Preservation**: When modifying docs under `[[__DOCS_DIR__]]`, must read original content first; preserve Markdown structure + YAML Frontmatter; only fill blanks/placeholders, forbidden to rewrite entire file structure.
45
42
  </protocol>
46
43
  </critical_protocols>
47
44
 
48
- <architecture_governance>
49
- <style>Defined in `02_tech_stack.md` (Dynamic)</style>
45
+ <project_features>
46
+ Content prefixed with `[?XX]` or `[?XX Project]` in protocols/templates is conditional — only execute when `architext.json` → `features` contains the matching value, otherwise skip. Conditional global files are deployed by CLI init based on features; file existence means the feature is activated.
50
47
 
51
- <layering_rules>
52
- 1. **Uni-directional Flow**: Follow Upper→Lower dependency principle, specific hierarchy defined in `[[__DOCS_DIR__]]/global/map.json`.
53
- 2. **Slice Isolation**: Same-level modules forbidden to reference each other directly.
54
- 3. **Public API Only**: Cross-module references only via `index` (Public API), forbidden to deeply reference internal files.
55
- </layering_rules>
48
+ | feature | Meaning |
49
+ |:---|:---|
50
+ | ui | Has user interface (Web/Mobile/Desktop/Mini-app) |
51
+ | data | Has data layer (Database/ORM/Local Storage) |
52
+ | api | Has HTTP/RPC/GraphQL endpoints |
53
+ | cli | Has command-line entry |
54
+ | lib | Published as library/SDK/NPM package |
56
55
 
57
- <anti_patterns>
58
- - Cross-Import: Task A imports Task B (violates module isolation).
59
- - Deep Parameter Passing: More than 3 layers deep (use Dependency Injection/Context/State Management).
60
- - God Object/File: Single file exceeds reasonable line count (must split).
61
- - Circular Dependencies: Circular dependencies (must refactor to break).
62
- </anti_patterns>
63
- </architecture_governance>
56
+ Other features (mobile/desktop/miniapp/extension/realtime/ai) and text conditions (e.g. `[?Complex Task]`) are interpreted literally.
57
+ </project_features>
64
58
 
65
59
  <thinking_process>
66
- Before outputting code, must run "Silent Audit Loop":
67
-
68
- <step n="1" action="Context & Dependency">
69
- Consult `[[__DOCS_DIR__]]/global/map.json` (Architecture) & `[[__DOCS_DIR__]]/global/roadmap.json` (Progress).
70
- Check: Is current task blocked by Dep? Modifying other modules without permission?
71
- → Violation: stop when blocked or unauthorized; report and refuse to generate code.
72
- </step>
73
-
74
- <step n="2" action="Rule & Constraint">
75
- Consult `02_tech_stack.md` (Tech) & `90_custom_rules.md` (House Rules).
76
- Check: Does the solution violate tech selection? Does it conform to project-specific conventions?
77
- Violation: stop when non-compliant; adjust to comply before executing.
78
- </step>
79
-
80
- <step n="2.5" action="File Integrity Check">
81
- Check YAML Frontmatter before modifying files.
82
- Rule: **Frontmatter Preservation** — Forbidden to modify `--- ... ---` block, unless user explicitly requests Metadata modification.
83
- → Violation: stop modification; report Frontmatter conflict.
84
- </step>
85
-
86
- <step n="2.7" action="AI Maintenance Guide Preservation">
87
- When modifying `.md` files under `[[__DOCS_DIR__]]`, check bottom for `## 🤖 AI Maintenance Guide`.
88
- Rule: **Absolute Protection** — Forbidden to reduce/simplify/rewrite/omit this section, must preserve verbatim. Only modifiable when user explicitly instructs.
89
- → Violation: stop; restore the section to its original content.
90
- </step>
91
-
92
- <step n="3" action="Agent Skill Strategy">
93
- Distinguish Skills (Expertise) vs Tools (Execution).
94
- Prioritize High-Level Skill calls; downgrade to Low-Level Tools when no corresponding Skill exists; complex high-frequency tasks must be solidified into new Skills.
95
- </step>
96
-
97
- <step n="4" action="Implementation">
98
- Generate code or execute action. Comments explain Why, not What.
99
- </step>
100
-
101
- <step n="5" action="Post-Code Checks">
102
- After outputting code, execute the following (skip when: pure Q&A / no code changes / typo · comment · format only):
103
-
104
- **A. Spec Drift** (when spec.md was loaded):
105
- - ✅ Change within spec scope → No action needed
106
- - ⚠️ Exceeds spec scope (new interface · changed signature · new behavior · new scenario) → Output `⚠️ Spec Drift`; recommend `/archi.edit <ID>`
107
-
108
- **B. Data Governance**:
109
- | Trigger | File | Action |
110
- |:---|:---|:---|
111
- | Introduces unregistered business entity · verb · shared utility | `dictionary.json` | Directly append |
112
- | Introduces unregistered error scenario | `error_codes.json` | Directly append |
113
- | [?Data] Schema changed | `data_snapshot.json` | Directly sync |
114
- </step>
60
+ Before outputting code, must run Silent Audit Loop:
61
+
62
+ **File Metadata Protection**: When modifying files under `[[__DOCS_DIR__]]`, preserve YAML Frontmatter + `## 🤖 AI Maintenance Guide` section. Forbidden to modify or delete.
63
+
64
+ **Post-Code Checks** (skip when: pure Q&A / no code changes / typo·comment·format only):
65
+
66
+ **A. Spec Drift** (when spec.md was loaded):
67
+ - ✅ Change within spec scope → No action needed
68
+ - ⚠️ Exceeds spec scope (new interface · changed signature · new behavior · new scenario) → Output `⚠️ Spec Drift`; recommend `/archi.edit <ID>`
69
+
70
+ **B. Data Governance**:
71
+ [[SUBAGENT: archi-data-sync|context: Scan changes for new business entities/error codes/Schema, incrementally sync per 03_data_governance.md rules]][[NO-SKILL: When changes introduce new business entities/error codes/Schema, execute incremental sync per `03_data_governance.md` rules.]]
115
72
  </thinking_process>
116
73
 
117
74
  <communication_style>