architext 0.0.4 → 0.0.6

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 (84) hide show
  1. package/CHANGELOG.md +55 -1
  2. package/README.md +93 -14
  3. package/README.zh-CN.md +92 -14
  4. package/dist/index.js +53 -39
  5. package/dist/templates/en/briefs/_base.md +53 -13
  6. package/dist/templates/en/briefs/_modules.md +31 -4
  7. package/dist/templates/en/docs/global/error_memory.json +40 -0
  8. package/dist/templates/en/docs/global/map.json +46 -90
  9. package/dist/templates/en/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +6 -13
  10. package/dist/templates/en/{rules/02_tech_stack.md → docs/global/tech_stack.md} +7 -18
  11. package/dist/templates/en/docs/global/vision.md +1 -1
  12. package/dist/templates/en/docs/prompts/audit.md +80 -94
  13. package/dist/templates/en/docs/prompts/code.md +99 -89
  14. package/dist/templates/en/docs/prompts/edit.md +61 -51
  15. package/dist/templates/en/docs/prompts/fix.md +59 -43
  16. package/dist/templates/en/docs/prompts/help.md +23 -31
  17. package/dist/templates/en/docs/prompts/inherit.md +97 -117
  18. package/dist/templates/en/docs/prompts/map.md +48 -69
  19. package/dist/templates/en/docs/prompts/plan.md +141 -240
  20. package/dist/templates/en/docs/prompts/recover.md +19 -34
  21. package/dist/templates/en/docs/prompts/ref.md +43 -138
  22. package/dist/templates/en/docs/prompts/remove.md +63 -110
  23. package/dist/templates/en/docs/prompts/revise.md +71 -106
  24. package/dist/templates/en/docs/prompts/scope.md +78 -117
  25. package/dist/templates/en/docs/prompts/script.md +102 -0
  26. package/dist/templates/en/docs/prompts/start.md +98 -132
  27. package/dist/templates/en/docs/prompts/ui.md +113 -0
  28. package/dist/templates/en/docs/shared/ui-redlines.md +7 -0
  29. package/dist/templates/en/docs/templates/spec.template.md +1 -1
  30. package/dist/templates/en/docs/templates/ui.template.md +8 -8
  31. package/dist/templates/en/rules/00_system.md +268 -117
  32. package/dist/templates/en/rules/90_custom_rules.md +3 -1
  33. package/dist/templates/en/skills/archi-data-sync/SKILL.md +37 -23
  34. package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +138 -240
  35. package/dist/templates/en/skills/archi-design-patterns/SKILL.md +6 -1
  36. package/dist/templates/en/skills/archi-feature-relations/SKILL.md +10 -6
  37. package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -2
  38. package/dist/templates/en/skills/archi-plan-options/SKILL.md +77 -301
  39. package/dist/templates/en/skills/archi-silent-audit/SKILL.md +24 -25
  40. package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +175 -305
  41. package/dist/templates/icon.svg +16 -0
  42. package/dist/templates/zh/briefs/_base.md +56 -17
  43. package/dist/templates/zh/briefs/_modules.md +28 -1
  44. package/dist/templates/zh/docs/global/error_memory.json +40 -0
  45. package/dist/templates/zh/docs/global/map.json +39 -109
  46. package/dist/templates/zh/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +0 -7
  47. package/dist/templates/zh/{rules/02_tech_stack.md → docs/global/tech_stack.md} +9 -20
  48. package/dist/templates/zh/docs/global/vision.md +1 -1
  49. package/dist/templates/zh/docs/prompts/audit.md +43 -57
  50. package/dist/templates/zh/docs/prompts/code.md +66 -56
  51. package/dist/templates/zh/docs/prompts/edit.md +52 -42
  52. package/dist/templates/zh/docs/prompts/fix.md +39 -29
  53. package/dist/templates/zh/docs/prompts/help.md +13 -21
  54. package/dist/templates/zh/docs/prompts/inherit.md +67 -86
  55. package/dist/templates/zh/docs/prompts/map.md +28 -50
  56. package/dist/templates/zh/docs/prompts/plan.md +100 -199
  57. package/dist/templates/zh/docs/prompts/recover.md +9 -24
  58. package/dist/templates/zh/docs/prompts/ref.md +11 -106
  59. package/dist/templates/zh/docs/prompts/remove.md +39 -74
  60. package/dist/templates/zh/docs/prompts/revise.md +47 -88
  61. package/dist/templates/zh/docs/prompts/scope.md +52 -91
  62. package/dist/templates/zh/docs/prompts/script.md +102 -0
  63. package/dist/templates/zh/docs/prompts/start.md +75 -110
  64. package/dist/templates/zh/docs/prompts/ui.md +113 -0
  65. package/dist/templates/zh/docs/shared/ui-redlines.md +7 -0
  66. package/dist/templates/zh/docs/templates/spec.template.md +1 -1
  67. package/dist/templates/zh/docs/templates/ui.template.md +8 -8
  68. package/dist/templates/zh/rules/00_system.md +252 -131
  69. package/dist/templates/zh/rules/90_custom_rules.md +2 -1
  70. package/dist/templates/zh/skills/archi-data-sync/SKILL.md +27 -13
  71. package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +133 -235
  72. package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +6 -1
  73. package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +6 -2
  74. package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -2
  75. package/dist/templates/zh/skills/archi-plan-options/SKILL.md +77 -301
  76. package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +4 -5
  77. package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +174 -301
  78. package/package.json +3 -1
  79. package/dist/templates/en/rules/01_workflow.md +0 -93
  80. package/dist/templates/en/rules/03_data_governance.md +0 -102
  81. package/dist/templates/en/rules/99_context_glue.md +0 -53
  82. package/dist/templates/zh/rules/01_workflow.md +0 -94
  83. package/dist/templates/zh/rules/03_data_governance.md +0 -133
  84. package/dist/templates/zh/rules/99_context_glue.md +0 -53
@@ -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,161 @@
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
71
+ **Gap levels**: Required → must ask in Step 2 | Can supplement → AI can recommend, suggest confirm | Suggested → AI can infer
84
72
 
85
- **Output**: Brief analysis summary:
86
- ```
87
- ### BRIEF Analysis Report
88
- > **Project**: [name] | **Features**: [activated UI/Data/CLI/Lib/API tags]
73
+ **Decision**: No "Required" + "Can supplement" gaps → skip Step 2 | Has gaps → proceed to Step 2
89
74
 
90
- **Confirmed**:
91
- - [list of filled items]
92
-
93
- **Gaps (require supplement)**:
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: 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 (`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
- | 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.
98
+ | Tech stack, deploy target, 3rd-party libs/services | rule file `tech_stack` |
99
+ | Style/tone — aesthetic direction / density / motion preference | `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` + `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
144
-
145
- ### 3.2 Tech Stack (rule file `02_tech_stack`)
146
- - Confirmed tech in Brief write directly
147
- - Blank/"recommend" in Brief AI recommends by project features; mark `(AI Recommended)` and brief rationale
148
- - Brief 3rd-party services/APIwrite 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)
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
120
+
121
+ ### 3.2 Tech Stack (rule file `tech_stack`)
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
142
+ - (API projects only) `api_snapshot.json`: Initial endpoint registration; extract from Brief if API description exists, otherwise write empty template
143
+ - `env_registry.json`: Initial env var registration
144
+ - (CLI projects only) `command_api.json`: Initial command registration; extract from Brief if command description exists, otherwise write empty template
145
+ - (Lib projects only) `public_api.json`: Initial export registration; extract from Brief if export description exists, otherwise write empty template
146
+
147
+ UI projects only: **UI concept design**: Skip completed independently by `/archi.ui`. Only ensure `design_tokens.json` is populated.
178
148
 
179
149
  ### 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
150
+ - `directoryMapping`: Pre-register core directory skeleton from tech_stack architecture pattern
151
+ - `logicalTopology` / `criticalUserJourneys` / `featureRelations`: Empty array for now
185
152
 
186
- **Output**: Write all files, then run `npx archi render` to generate visual `.md`.
153
+ UI projects only: **UI concept design**: Skip completed independently by `/archi.ui`.
154
+
155
+ **Output**: Write all files, then run `npx archi render`. Enter step_4_verify.
187
156
  </step_3_constitution>
188
157
 
189
158
  <step_4_verify>
190
159
  **Role**: Independent Reviewer
191
-
192
160
  [[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
161
 
194
162
  [[INCLUDE: shared/verify-result-handling.md]]
195
163
  </step_4_verify>
196
164
 
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
165
  <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.
166
+ **Terminal Gate** (do not skip): Standard check (task --check + render).
167
+
168
+ **Pre-signoff Checklist** (confirm each item after Gate passes, before Output):
169
+ vision.md all placeholders replaced, no template example text remaining
170
+ tech_stack.md Sections 1-9 fully filled, Section 9 Project Conventions includes Strategy + Rationale
171
+ □ roadmap.json — archi-decompose-roadmap Skill executed, task chain generated
172
+ map.json core directory skeleton pre-registered (directoryMapping)
173
+ □ dictionary.json + error_codes.json + env_registry.json domain terms, core error codes, env vars extracted
174
+ □ (UI projects only) design_tokens.json — generated
175
+ □ (Data projects only) data_snapshot.json — initial entity skeleton written
176
+ □ (API projects only) api_snapshot.json — initial API endpoints registered
177
+ □ (CLI projects only) command_api.json — initial CLI commands registered
178
+ □ (Lib projects only) public_api.json — initial lib exports registered
179
+ □ Step 4 Silent Audit — executed, all CRITICAL issues resolved
180
+
181
+ **Action** (after Checklist confirmed):
182
+ 1. Run `npx archi task` to output task progress overview.
217
183
  2. Output summary.
218
184
 
219
- **Output**: Project init summary including:
220
- - **Brief adoption**: Key decisions adopted from Brief
185
+ **Output**: Project init summary, including:
186
+ - **Brief source confirmation**: Key decisions adopted from Brief
221
187
  - **AI completions**: Tech/decisions AI recommended and rationale
222
188
  - **Roadmap overview**: Task count and phase distribution
223
189
  - **Next Steps table**:
224
190
 
225
191
  | Priority | Action | Notes |
226
192
  |:---|:---|:---|
227
- | [?UI] Recommended | Reply **OK** to enter Phase 2 styling | Phase 1 wireframe auto-generated; confirm layout then style |
193
+ | (UI projects only) Recommended | `/archi.ui` | Generate UI concept design (`screens/` multi-file structure) |
228
194
  | Recommended | `/archi.plan INF-01` | Plan the first infrastructure task |
229
- | Optional | `/archi.scope <scope-brief.md>` | Append more requirements to Roadmap if needed |
195
+ | (Post-INF) | `/archi.script` | Generate AI automation scripts (validate/dev-up/dev-reset) |
196
+ | Optional | `/archi.scope <scope-brief.md>` | If more requirements to decompose, append to Roadmap |
230
197
  </step_5_signoff>
231
198
 
232
199
  <fallback_interview>
233
200
  **Trigger**: Brief file not found or empty.
234
- **Role**: Product Advisor
235
201
 
236
202
  **Action**:
237
- 1. Tell user `project-brief.md` not found. Suggest:
203
+ 1. Inform user `project-brief.md` not found. Suggest:
238
204
  - Check project root for the file (should have been generated by `npx archi init`)
239
205
  - If lost, re-run `npx archi init` to regenerate
240
206
  - Or continue conversation and provide info via interview
241
- 2. If user continues via conversation, guide in this order:
207
+ 2. If user chooses to continue conversation, guide in this order:
242
208
  a. What is the project? (name, one-line description, problem solved)
243
209
  b. Who is it for? (target users)
244
- c. Core features? (at least 2–3)
210
+ c. What are the core tasks? (at least 2–3)
245
211
  d. Tech stack? (language/framework, confirmed parts)
246
- e. Constraints? (anti-goals, timeline, compatibility)
212
+ e. What constraints? (anti-goals, timeline, compatibility)
247
213
  3. After collection, write to `project-brief.md` (project root), then goto `<step_1_gap_analysis>`.
248
214
 
249
- > Fallback for backward compatibility; Brief remains the primary flow.
215
+ > This mode is for backward compatibility; core flow remains Brief-driven.
250
216
  </fallback_interview>
251
217
 
252
218
  </protocol_kickoff>
@@ -0,0 +1,113 @@
1
+ <protocol_ui>
2
+ **Trigger**: `/archi.ui` | Auto-loaded by Workflow Dispatch on natural language trigger
3
+ **Goal**: Generate or incrementally update multi-file UI concept designs (`screens/` directory).
4
+
5
+ <meta>
6
+ <style>Visual, Systematic, Incremental</style>
7
+ <language>English</language>
8
+ <principles>
9
+ 1. **Auto-Detect**: No subcommands; automatically detects `screens/` directory state to decide full generation or incremental update.
10
+ 2. **Multi-File**: Each screen as independent `S-XX.html`, shared styles in `_shared.css`, `index.html` as navigation hub.
11
+ 3. **Token-Driven**: Visual styles strictly from `design_tokens.json`; no hardcoding.
12
+ 4. **IDE-Native First**: Leverage IDE native capabilities to drive execution rhythm; this protocol defines quality standards and checkpoints without fighting IDE planning/execution mechanisms.
13
+ </principles>
14
+ </meta>
15
+
16
+ <step_1_load>
17
+ **Action**:
18
+ 1. **Pre-flight**: Check `architext.json` → `features` contains `ui`. If not → reject ("UI feature not enabled for this project").
19
+ 2. **Load**: vision.md (platform/users/north star), roadmap.json (UI-related tasks), design_tokens.json, tech_stack.md (platform/navigation framework), ui_context.md (if exists).
20
+ 3. **Mode Detection**:
21
+
22
+ | Condition | Mode | Behavior |
23
+ |:---|:---|:---|
24
+ | `screens/` directory does not exist | **Full Generation** | Extract all UI screens from roadmap → step_2 |
25
+ | `screens/` exists | **Incremental Update** | Compare roadmap + ui_context.md, identify new/changed screens → step_2 |
26
+
27
+ **Output**: Mode determination + context summary. Proceed to step_2_plan.
28
+ </step_1_load>
29
+
30
+ <step_2_plan>
31
+ **Action**:
32
+
33
+ **Full mode**: Extract all UI-related screens from roadmap tasks, assign screen IDs (S-01, S-02...).
34
+ **Incremental mode**: Compare existing `screens/` with roadmap, identify differences:
35
+
36
+ | Diff Type | Action |
37
+ |:---|:---|
38
+ | New screen (roadmap has task but no corresponding S-XX) | Assign new ID, add to generation list |
39
+ | Screen change (existing screen's task has requirement changes) | Add to update list |
40
+ | No change | Skip |
41
+
42
+ **Tokens Check**: Check `design_tokens.json`:
43
+ - `aestheticDirection.preset` empty → guide selection
44
+ - `primitivePalette.brand` empty → guide Hex input
45
+ - Other empty values → AI infers, non-blocking
46
+
47
+ **Output**: Screen plan list (ID / Name / Task / States / Action: add/update/skip).
48
+
49
+ **Gate**: User replies **OK** to proceed to step_3_generate; no file generation without confirmation.
50
+ </step_2_plan>
51
+
52
+ <step_2_5_refinement>
53
+ **Trigger**: User replies non-OK, with corrections, screen additions/removals, or mapping adjustments.
54
+ **Action**: Incorporate feedback, refresh screen plan list and re-output, await confirmation.
55
+
56
+ User replies OK → proceed to step_3_generate.
57
+ </step_2_5_refinement>
58
+
59
+ <step_3_generate>
60
+ **Action**: Call Skill for actual generation.
61
+
62
+ [[SKILL: archi-ui-wireframe|Follow skill protocol to generate multi-file UI concept designs based on confirmed screen plan. Full mode generates all screens; incremental mode generates only new/changed screens.]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and follow its protocol)]]
63
+
64
+ **Artifacts**:
65
+ - `[[__DOCS_DIR__]]/global/screens/_shared.css` — CSS variables (from design_tokens) + base layout + control bar styles
66
+ - `[[__DOCS_DIR__]]/global/screens/S-XX.html` — Each screen as independent file
67
+ - `[[__DOCS_DIR__]]/global/screens/index.html` — Navigation hub listing all screens
68
+ - `[[__DOCS_DIR__]]/global/ui_context.md` — AI screen index (routes reference `screens/S-XX.html`)
69
+
70
+ **Output**: Generated file list + change summary. Proceed to step_4_verify.
71
+ </step_3_generate>
72
+
73
+ <step_4_verify>
74
+ **Role**: Independent Reviewer
75
+
76
+ **Verification checklist**:
77
+
78
+ | Check | Pass Criteria |
79
+ |:---|:---|
80
+ | File completeness | `screens/` contains `index.html` + `_shared.css` + all `S-XX.html` |
81
+ | Cross-file links | All `S-XX.html` links in `index.html` are valid; each `S-XX.html` has back-to-index link |
82
+ | CSS references | Each `S-XX.html` references `_shared.css`; CSS variables from design_tokens |
83
+ | State coverage | Each screen contains default + applicable states (loading/empty/error) |
84
+ | ui_context.md | Screen index routes reference `screens/S-XX.html` paths |
85
+ | (Incremental) Existing screens | Unmodified screen files were not overwritten |
86
+
87
+ Failed items → fix and recheck. All pass → proceed to step_5_signoff.
88
+ </step_4_verify>
89
+
90
+ <step_5_signoff>
91
+ **Pre-signoff Checklist** (confirm before output):
92
+ □ `screens/` directory structure complete (index.html + _shared.css + S-XX.html)
93
+ □ `ui_context.md` generated/updated with correct path references
94
+ □ Step 4 verification all passed
95
+ □ (Incremental) Only target screens modified, other files unchanged
96
+
97
+ **Output**: UI concept design summary:
98
+ - **Mode**: Full generation / Incremental update
99
+ - **Screen coverage**: N screens total (X new / Y updated / Z retained)
100
+ - **Aesthetic direction**: preset + brand color
101
+ - **File list**: Generated/modified files
102
+
103
+ **User confirmation**: Reply **OK** to finish; non-OK enters Refinement (calls Skill for partial update).
104
+
105
+ **Next Steps**:
106
+
107
+ | Priority | Action | Description |
108
+ |:---|:---|:---|
109
+ | Recommended | Open `screens/index.html` in browser | Verify layout and visual design |
110
+ | 1 | `/archi.plan <first pending task ID>` | Start planning tasks |
111
+ </step_5_signoff>
112
+
113
+ </protocol_ui>
@@ -0,0 +1,7 @@
1
+ **UI Design Red Lines (Anti-patterns)**:
2
+ - **No purple-gradient-on-white** — AI default aesthetic signature
3
+ - **No emoji as icons** (🔔📁⚙️) → use self-drawn SVG or declared icon library
4
+ - **No identical centered-card layout for all screens** → list/detail/form must differ
5
+ - **No pure-black + pure-white** → use layered grays
6
+ - **No generic feel** → opening must instantly identify aesthetic (Linear vs Notion vs Grafana)
7
+ - **No hardcoding** — use Tokens for colors, variables for spacing, no magic numbers
@@ -79,7 +79,7 @@ description: Task Specification for {FEATURE_NAME}.
79
79
 
80
80
  ## 5. Constraints
81
81
 
82
- <!-- [AI]: Extract red-line constraints relevant to this task from vision.md + 02_tech_stack.md.
82
+ <!-- [AI]: Extract red-line constraints relevant to this task from vision.md + tech_stack.md.
83
83
 
84
84
  Format:
85
85
  - [constraint content] (ref: [source])
@@ -1,12 +1,12 @@
1
1
  ---
2
- description: Task-level UI scope declaration — screen IDs come from ui_context.md; visual prototype is ui_concept.html (for humans). Do not redefine global layout or navigation.
2
+ description: Task-level UI scope declaration — describes the screens/component scope this task owns. Screen IDs from ui_context.md; visual prototype in screens/ (for humans).
3
3
  glue: Screen IDs referenced from [[__DOCS_DIR__]]/global/ui_context.md. Do not redefine global layout or navigation.
4
4
  ---
5
5
 
6
6
  # UI Scope: {FEATURE_NAME}
7
7
 
8
8
  > **Screen Index**: `[[__DOCS_DIR__]]/global/ui_context.md` (AI reads screen IDs and navigation graph)
9
- > **Visual Prototype**: `[[__DOCS_DIR__]]/global/ui_concept.html` (human browser preview)
9
+ > **Visual Prototype**: `[[__DOCS_DIR__]]/global/screens/index.html` (human browser preview, individual screens at `screens/S-XX.html`)
10
10
  > **Tokens**: `[[__DOCS_DIR__]]/global/design_tokens.json`
11
11
  > **Protocol**: ITP v3.0 (scope limited to components within this task's boundary)
12
12
 
@@ -27,15 +27,15 @@ glue: Screen IDs referenced from [[__DOCS_DIR__]]/global/ui_context.md. Do not r
27
27
  ```text
28
28
  [ScreenName > modified area]
29
29
  NewComponent [Col, Gap:4] ← added by this task
30
- ExistingComponent ← ref: ui_concept.html S-XX (no modification)
30
+ ExistingComponent ← ref: screens/S-XX.html (no modification)
31
31
  #NewSubComponents
32
32
  ```
33
33
 
34
- > **Reference rule**: Components already defined in `ui_concept.html` → `ref: ui_concept.html#S-XX-ComponentName`; do not copy-paste their structure.
34
+ > **Reference rule**: Components already defined in `screens/S-XX.html` → `ref: screens/S-XX.html#ComponentName`; do not copy-paste their structure.
35
35
 
36
36
  ## 3. Interactions (new interactions introduced by this task)
37
37
 
38
- <!-- [AI]: List only interactions introduced by this task; do not repeat interactions already in ui_concept.html -->
38
+ <!-- [AI]: List only interactions introduced by this task; do not repeat interactions already in screens/S-XX.html -->
39
39
 
40
40
  | Trigger | Target | Action |
41
41
  |:---|:---|:---|
@@ -43,9 +43,9 @@ glue: Screen IDs referenced from [[__DOCS_DIR__]]/global/ui_context.md. Do not r
43
43
 
44
44
  ## 4. States (state rendering owned by this task)
45
45
 
46
- <!-- [AI]: If ui_concept.html already fully describes the states, this section may be omitted or only note deltas -->
46
+ <!-- [AI]: If screens/S-XX.html already fully describes the states, this section may be omitted or only note deltas -->
47
47
 
48
- | State | Delta from ui_concept.html |
48
+ | State | Delta from screens/S-XX.html |
49
49
  |:---|:---|
50
- | `loading` | Same as ui_concept.html S-XX loading (no delta) |
50
+ | `loading` | Same as screens/S-XX.html loading (no delta) |
51
51
  | `empty` | Different copy for this task's empty state: "{specific copy}" |