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.
- package/CHANGELOG.md +27 -1
- package/README.md +84 -7
- package/README.zh-CN.md +84 -7
- package/dist/index.js +38 -38
- package/dist/templates/en/briefs/_base.md +44 -11
- package/dist/templates/en/briefs/_modules.md +31 -4
- package/dist/templates/en/docs/prompts/audit.md +80 -94
- package/dist/templates/en/docs/prompts/code.md +87 -89
- package/dist/templates/en/docs/prompts/edit.md +47 -51
- 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 +91 -116
- package/dist/templates/en/docs/prompts/map.md +47 -69
- package/dist/templates/en/docs/prompts/plan.md +134 -239
- package/dist/templates/en/docs/prompts/recover.md +19 -34
- package/dist/templates/en/docs/prompts/ref.md +43 -138
- 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 +89 -129
- 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 +12 -12
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +3 -34
- package/dist/templates/en/skills/archi-design-patterns/SKILL.md +1 -0
- package/dist/templates/en/skills/archi-feature-relations/SKILL.md +4 -4
- 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 +20 -20
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
- package/dist/templates/zh/briefs/_base.md +44 -12
- package/dist/templates/zh/briefs/_modules.md +27 -0
- package/dist/templates/zh/docs/prompts/audit.md +42 -56
- package/dist/templates/zh/docs/prompts/code.md +47 -49
- package/dist/templates/zh/docs/prompts/edit.md +38 -42
- package/dist/templates/zh/docs/prompts/fix.md +30 -29
- package/dist/templates/zh/docs/prompts/help.md +13 -21
- package/dist/templates/zh/docs/prompts/inherit.md +59 -83
- package/dist/templates/zh/docs/prompts/map.md +24 -47
- package/dist/templates/zh/docs/prompts/plan.md +92 -197
- package/dist/templates/zh/docs/prompts/recover.md +9 -24
- package/dist/templates/zh/docs/prompts/ref.md +11 -106
- package/dist/templates/zh/docs/prompts/remove.md +31 -71
- package/dist/templates/zh/docs/prompts/revise.md +37 -86
- package/dist/templates/zh/docs/prompts/scope.md +51 -91
- package/dist/templates/zh/docs/prompts/start.md +67 -106
- package/dist/templates/zh/rules/00_system.md +18 -91
- package/dist/templates/zh/rules/01_workflow.md +60 -59
- package/dist/templates/zh/rules/03_data_governance.md +41 -68
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +2 -33
- package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +1 -0
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +1 -0
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
- 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
|
|
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,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
|
|
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]
|
|
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
|
-
**
|
|
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
|
|
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
|
|
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: archi-decompose-roadmap|Follow the skill protocol to generate
|
|
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
|
-
|
|
183
|
-
- `
|
|
184
|
-
-
|
|
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
|
|
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** (
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
|
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
|
-
|
|
|
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>` |
|
|
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.
|
|
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
|
|
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.
|
|
204
|
+
c. What are the core tasks? (at least 2–3)
|
|
245
205
|
d. Tech stack? (language/framework, confirmed parts)
|
|
246
|
-
e.
|
|
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
|
-
>
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
49
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
58
|
-
|
|
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
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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>
|