architext 0.0.5 → 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 (78) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/README.md +18 -16
  3. package/README.zh-CN.md +15 -14
  4. package/dist/index.js +43 -29
  5. package/dist/templates/en/briefs/_base.md +13 -6
  6. package/dist/templates/en/briefs/_modules.md +2 -2
  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 +5 -5
  13. package/dist/templates/en/docs/prompts/code.md +23 -11
  14. package/dist/templates/en/docs/prompts/edit.md +21 -7
  15. package/dist/templates/en/docs/prompts/fix.md +11 -2
  16. package/dist/templates/en/docs/prompts/inherit.md +18 -13
  17. package/dist/templates/en/docs/prompts/map.md +4 -3
  18. package/dist/templates/en/docs/prompts/plan.md +11 -5
  19. package/dist/templates/en/docs/prompts/remove.md +13 -8
  20. package/dist/templates/en/docs/prompts/revise.md +10 -2
  21. package/dist/templates/en/docs/prompts/scope.md +4 -3
  22. package/dist/templates/en/docs/prompts/script.md +102 -0
  23. package/dist/templates/en/docs/prompts/start.md +20 -14
  24. package/dist/templates/en/docs/prompts/ui.md +113 -0
  25. package/dist/templates/en/docs/shared/ui-redlines.md +7 -0
  26. package/dist/templates/en/docs/templates/spec.template.md +1 -1
  27. package/dist/templates/en/docs/templates/ui.template.md +8 -8
  28. package/dist/templates/en/rules/00_system.md +245 -51
  29. package/dist/templates/en/rules/90_custom_rules.md +3 -1
  30. package/dist/templates/en/skills/archi-data-sync/SKILL.md +26 -12
  31. package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +137 -208
  32. package/dist/templates/en/skills/archi-design-patterns/SKILL.md +6 -2
  33. package/dist/templates/en/skills/archi-feature-relations/SKILL.md +6 -2
  34. package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +1 -2
  35. package/dist/templates/en/skills/archi-plan-options/SKILL.md +77 -302
  36. package/dist/templates/en/skills/archi-silent-audit/SKILL.md +4 -5
  37. package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +131 -306
  38. package/dist/templates/icon.svg +16 -0
  39. package/dist/templates/zh/briefs/_base.md +17 -10
  40. package/dist/templates/zh/briefs/_modules.md +2 -2
  41. package/dist/templates/zh/docs/global/error_memory.json +40 -0
  42. package/dist/templates/zh/docs/global/map.json +39 -109
  43. package/dist/templates/zh/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +0 -7
  44. package/dist/templates/zh/{rules/02_tech_stack.md → docs/global/tech_stack.md} +9 -20
  45. package/dist/templates/zh/docs/global/vision.md +1 -1
  46. package/dist/templates/zh/docs/prompts/audit.md +5 -5
  47. package/dist/templates/zh/docs/prompts/code.md +22 -10
  48. package/dist/templates/zh/docs/prompts/edit.md +20 -6
  49. package/dist/templates/zh/docs/prompts/fix.md +10 -1
  50. package/dist/templates/zh/docs/prompts/inherit.md +18 -13
  51. package/dist/templates/zh/docs/prompts/map.md +5 -4
  52. package/dist/templates/zh/docs/prompts/plan.md +11 -5
  53. package/dist/templates/zh/docs/prompts/remove.md +13 -8
  54. package/dist/templates/zh/docs/prompts/revise.md +12 -4
  55. package/dist/templates/zh/docs/prompts/scope.md +4 -3
  56. package/dist/templates/zh/docs/prompts/script.md +102 -0
  57. package/dist/templates/zh/docs/prompts/start.md +19 -15
  58. package/dist/templates/zh/docs/prompts/ui.md +113 -0
  59. package/dist/templates/zh/docs/shared/ui-redlines.md +7 -0
  60. package/dist/templates/zh/docs/templates/spec.template.md +1 -1
  61. package/dist/templates/zh/docs/templates/ui.template.md +8 -8
  62. package/dist/templates/zh/rules/00_system.md +243 -49
  63. package/dist/templates/zh/rules/90_custom_rules.md +2 -1
  64. package/dist/templates/zh/skills/archi-data-sync/SKILL.md +27 -13
  65. package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +133 -204
  66. package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +6 -2
  67. package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +6 -2
  68. package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +1 -2
  69. package/dist/templates/zh/skills/archi-plan-options/SKILL.md +77 -302
  70. package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +4 -5
  71. package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +131 -306
  72. package/package.json +3 -1
  73. package/dist/templates/en/rules/01_workflow.md +0 -95
  74. package/dist/templates/en/rules/03_data_governance.md +0 -106
  75. package/dist/templates/en/rules/99_context_glue.md +0 -53
  76. package/dist/templates/zh/rules/01_workflow.md +0 -95
  77. package/dist/templates/zh/rules/03_data_governance.md +0 -106
  78. package/dist/templates/zh/rules/99_context_glue.md +0 -53
@@ -101,13 +101,13 @@
101
101
 
102
102
  ### Information Routing Rules
103
103
 
104
- > Rule files (`02_tech_stack`, `90_custom_rules`, etc.) are already injected into context by IDE; AI knows their paths, write directly.
104
+ > Rule files (`tech_stack`, `90_custom_rules`, etc.) are already injected into context by IDE; AI knows their paths, write directly.
105
105
 
106
106
  **With Brief** (Brief → target file):
107
107
  | Brief content | Target file |
108
108
  |:---|:---|
109
109
  | Project identity, target users, success metrics, references | `[[__DOCS_DIR__]]/global/vision.md` |
110
- | Tech stack, deploy target, 3rd-party libs/services | rule file `02_tech_stack` |
110
+ | Tech stack, deploy target, 3rd-party libs/services | rule file `tech_stack` |
111
111
  | Core task list | `[[__DOCS_DIR__]]/global/roadmap.json` (phase-1/2, call archi-decompose-roadmap) |
112
112
  | Rules/conventions/preferences from supplementary notes | rule file `90_custom_rules` |
113
113
  | Style/tone (UI only) | `design_tokens.json` aestheticDirection etc. |
@@ -116,7 +116,7 @@
116
116
  | Source | Target file |
117
117
  |:---|:---|
118
118
  | README description/features | vision.md |
119
- | Dependencies/config/code patterns | 02_tech_stack |
119
+ | Dependencies/config/code patterns | tech_stack |
120
120
  | Directory structure/module deps/user journeys | map.json |
121
121
  | Domain terminology/naming conventions | dictionary.json |
122
122
  | eslint/prettier etc. | 90_custom_rules |
@@ -129,7 +129,7 @@
129
129
  - **Without Brief**: Derive from README + project config; mark un-inferrable items `(AI completion — user review suggested)`
130
130
  - Do not retain template placeholders
131
131
 
132
- ### 3.2 Tech Stack (rule file `02_tech_stack`)
132
+ ### 3.2 Tech Stack (rule file `tech_stack`)
133
133
  - **With Brief**: Brief confirmed → write directly; blank/recommend → AI recommends; code deps as supplement
134
134
  - **Without Brief**: Existing deps/config → write directly; visible conventions → write to Coding Standards
135
135
  - Fill complete Section 1-8
@@ -210,14 +210,13 @@
210
210
  - `dictionary.json`: Extract domain terminology from code
211
211
  - (UI projects only) `design_tokens.json`: Extract from CSS variables/theme
212
212
  - (Data projects only) `data_snapshot.json`: Extract from schema/migration
213
+ - (API projects only) `api_snapshot.json`: Extract endpoints from existing API routes/controller code
214
+ - `env_registry.json`: Extract env vars from `process.env` references in code
215
+ - (CLI projects only) `command_api.json`: Extract commands from existing CLI entry code
216
+ - (Lib projects only) `public_api.json`: Extract exports from package.json exports or entry files
213
217
  - `error_codes.json`: Extract from error definitions in code
214
218
 
215
- UI projects only: **UI concept design (Adopt mode)**: [[SKILL: archi-ui-wireframe|Invoke skill (adopt mode) to reverse-generate UI concept design from code.]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and follow its Adopt protocol)]]
216
- - Read route definitions, page components, layout files from code
217
- - Read design_tokens.json written in step_3 (containing CSS variables/theme extracted from code)
218
- - When tokens incomplete, triggers skill's built-in guidance flow
219
- - Write `ui_concept.html` + `ui_context.md`
220
- - Output UI concept design summary; await user confirmation or feedback for adjustments
219
+ UI projects only: **UI concept design (Adopt mode)**: Skip completed independently by `/archi.ui`.
221
220
 
222
221
  **Output**: Write all files, run `npx archi render`. Enter step_4_verify.
223
222
  </step_3_constitution>
@@ -234,12 +233,16 @@
234
233
 
235
234
  **Pre-signoff Checklist** (confirm each item after Gate passes, before Output):
236
235
  □ vision.md — filled (without Brief: inferred content annotated `(AI completion — review recommended)`)
237
- 02_tech_stack.md — Sections 1-8 fully filled
236
+ tech_stack.md — Sections 1-8 fully filled
238
237
  □ roadmap.json — each functional module has a corresponding LEG-xx (status: done, tag: Legacy)
239
238
  □ tasks/LEG-xx_<Slug>/spec.md — each LEG has a corresponding Stub spec (with related file list)
240
239
  □ map.json — directoryMapping + logicalTopology + criticalUserJourneys + featureRelations all filled
241
- □ dictionary.json + error_codes.json — extracted from codebase
242
- □ (UI projects only) design_tokens.json + ui_concept.html + ui_context.md — Adopt mode executed
240
+ □ dictionary.json + error_codes.json + env_registry.json — extracted from codebase
241
+ □ (UI projects only) design_tokens.json — Adopt mode executed
242
+ □ (Data projects only) data_snapshot.json — initial entity skeleton written
243
+ □ (API projects only) api_snapshot.json — initial API endpoints registered
244
+ □ (CLI projects only) command_api.json — initial CLI commands registered
245
+ □ (Lib projects only) public_api.json — initial lib exports registered
243
246
  □ Step 4 Silent Audit — executed, all CRITICAL issues resolved
244
247
 
245
248
  **Action** (after Checklist confirmed):
@@ -256,6 +259,8 @@
256
259
  | Priority | Action | Notes |
257
260
  |:---|:---|:---|
258
261
  | 1 | Review vision.md | Confirm AI-completed vision description |
262
+ | (UI projects only) Recommended | `/archi.ui` | Generate UI concept design (`screens/` multi-file structure, Adopt mode) |
263
+ | (Post-INF) | `/archi.script` | Generate AI automation scripts (validate/dev-up/dev-reset) |
259
264
  | 2 | `/archi.edit LEG-xx` | Enrich core module stubs into full spec (auto-triggers Enrich flow) |
260
265
  | 3 | `/archi.scope [file_path]` | Plan new features/major modules |
261
266
  | 4 | `/archi.plan <task ID>` | Deep-plan individual task |
@@ -8,7 +8,7 @@
8
8
  <principles>
9
9
  1. **Scan vs Map**: Actual filesystem is Ground Truth; map.json is old snapshot.
10
10
  2. **Smart Granularity**: Directory-level by default; when single file has multiple responsibilities, refine to file-level.
11
- 3. **Architecture Inference**: New entry layer/location must reference existing map pattern + `02_tech_stack.md`.
11
+ 3. **Architecture Inference**: New entry layer/location must reference existing map pattern + `tech_stack.md`.
12
12
  4. **Batch Confirm**: Show all changes at once; user confirms in batch.
13
13
  5. **IDE-Native First**: Leverage IDE native capabilities to drive execution rhythm; this protocol defines quality standards and checkpoints, not fight IDE planning/execution mechanisms.
14
14
  </principles>
@@ -17,7 +17,7 @@
17
17
  <step_1_scan>
18
18
  **Action**:
19
19
  1. **Read Map**: Read `[[__DOCS_DIR__]]/global/map.json` — current architecture map.
20
- 2. **Read Tech Stack**: Read `02_tech_stack.md` — directory structure conventions, architecture pattern.
20
+ 2. **Read Tech Stack**: Read `tech_stack.md` — directory structure conventions, architecture pattern.
21
21
  3. **Scan Directory Tree**: Scan project directory structure.
22
22
  - **Exclude**: `.git/`, `node_modules/`, `dist/`, `build/`, `[[__DOCS_DIR__]]/`, and paths in `.gitignore`.
23
23
  - **Depth**: Follow granularity pattern of existing map.json entries.
@@ -48,7 +48,7 @@
48
48
  ### Classification strategy
49
49
 
50
50
  1. **Pattern match**: Reference same-level existing entries in map.json.
51
- 2. **Tech Stack conventions**: Directory structure rules in `02_tech_stack.md`.
51
+ 2. **Tech Stack conventions**: Directory structure rules in `tech_stack.md`.
52
52
  3. **Content inference**: Read file content (imports, exported types).
53
53
  4. **Cannot determine**: Mark `[?]` for user to specify.
54
54
 
@@ -100,6 +100,7 @@
100
100
  □ Stale entries removed from directoryMapping
101
101
  □ New entries correctly classified (path + layer + description all filled)
102
102
  □ Renamed entries explicitly handled (not silently ignored)
103
+ □ featureRelations — updated if directory changes affect linkage relations
103
104
  □ lastUpdated updated
104
105
  □ Terminal Gate — task --check + render passed
105
106
 
@@ -24,7 +24,7 @@
24
24
  <step_1_load>
25
25
  **Action**:
26
26
  1. **Pre-flight**: Read roadmap.json; read only `<ID>` entry and direct deps' `id/title/status`; reject if deps incomplete (unless user forces).
27
- 2. **Load**: vision.md (North Star + design philosophy only), 02_tech_stack.md (red lines + §9 project conventions; extract Error Handling/Data Flow/Auth inheritance), (UI projects only) design_tokens.json + ui_context.md (locate screen IDs, lock scope for step_4; do not invent new IDs; skip if absent), (Data projects only) data_snapshot.json.
27
+ 2. **Load**: vision.md (North Star + design philosophy only), tech_stack.md (red lines + §9 project conventions; extract Error Handling/Data Flow/Auth inheritance), (UI projects only) design_tokens.json + ui_context.md (locate screen IDs, lock scope for step_4; do not invent new IDs; skip if absent), (Data projects only) data_snapshot.json.
28
28
  3. **Dependency Context** (when deps exist): Read only dep task spec.md Interface/Type section; skip if no ref. Stub dep → extract public interfaces from associated files.
29
29
  4. **Refs** (if any): Read refs/index.json; match by tag semantics; load only matched ref files; skip if absent.
30
30
 
@@ -126,7 +126,7 @@
126
126
 
127
127
  **Action Checklist**:
128
128
  1. **`map.json`**: Register `[[__DOCS_DIR__]]/tasks/<ID>_<Slug>` in `directoryMapping`; define module responsibility and dependencies in `logicalTopology`.
129
- 2. **Data governance sync** (`dictionary.json` / `error_codes.json` / `data_snapshot.json` etc.): Per `03_data_governance.md`, incrementally sync new business terms, error codes, Schema to corresponding global files.
129
+ 2. **Data governance sync**: [[SUBAGENT: archi-data-sync|context: Scan Task proposal for new business entities/error codes/Schema/endpoints/commands/exports, incrementally sync per 00_system.md]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-data-sync/SKILL.md`, follow its execution protocol)]]
130
130
  3. **`map.json` featureRelations**: [[SUBAGENT: archi-feature-relations|mode: register, context: Determine if this Task is aggregator; if yes register featureRelations entry]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-feature-relations/SKILL.md`, follow mode: register logic)]]
131
131
 
132
132
  **Output**: Diff summary of above files. Enter step_5_generate.
@@ -151,7 +151,7 @@
151
151
  > Mixed tasks use sub-headings in § 2 to distinguish dimensions.
152
152
 
153
153
  **spec § 4 Interface Exports**: INF **required**; FEAT required when has downstream deps.
154
- **spec § 5 Constraints**: **Required** — extract relevant red lines from vision.md + 02_tech_stack.md.
154
+ **spec § 5 Constraints**: **Required** — extract relevant red lines from vision.md + tech_stack.md.
155
155
 
156
156
  **General rules**:
157
157
  - Do not invent AC items; each must map to concrete content in task design.
@@ -165,7 +165,7 @@
165
165
  | Divergence Type | Criteria | Handling |
166
166
  |:---|:---|:---|
167
167
  | No divergence | Screen index matches design | Write `ui.md` directly; reference screen ID |
168
- | Minor addition | New state/popup/local area; overall layout unchanged | Call skill to update `ui_concept.html` + `ui_context.md`; note `MODIFIED: S-XX` |
168
+ | Minor addition | New state/popup/local area; overall layout unchanged | Run `/archi.ui` to update `screens/S-XX.html` + `ui_context.md`; note `MODIFIED: screens/S-XX.html` |
169
169
  | Structural divergence | Layout refactor, new standalone screen, flow path change | **Pause** — output divergence summary to user; wait for **OK**; then call skill to update; then write `ui.md` |
170
170
 
171
171
  2. After resolving divergence, fill screen scope and delta components per `ui.template.md`.
@@ -224,7 +224,13 @@
224
224
  □ plan.json — every AC in spec § 2 → ≥1 task covering it (100% coverage rule)
225
225
  □ plan.json — every task notes includes verification field (not empty, not title paraphrase)
226
226
  □ map.json — tasks/<ID>_<Slug> registered in directoryMapping
227
- □ Global files — new terms/error codes/schemas synced (dictionary/error_codes/data_snapshot)
227
+ □ Global files — new terms/error codes/schemas/Tokens/env vars synced:
228
+ - dictionary.json + error_codes.json + env_registry.json — required
229
+ - (UI projects only) design_tokens.json + ui_context.md
230
+ - (Data projects only) data_snapshot.json
231
+ - (API projects only) api_snapshot.json
232
+ - (CLI projects only) command_api.json
233
+ - (Lib projects only) public_api.json
228
234
  □ Step 6 Silent Audit — executed, all CRITICAL issues resolved
229
235
 
230
236
  **Action** (after Checklist confirmed):
@@ -17,7 +17,7 @@
17
17
  **Action**:
18
18
  1. **Resolve ID**: Parse `<id>` from roadmap.json → Task Name, Slug, status.
19
19
  2. **ID Not Found** → Error and list available task IDs.
20
- 3. **Load**: task docs directory, roadmap.json (deps), map.json (architecture reg), 99_context_glue.md (associations).
20
+ 3. **Load**: task docs directory, roadmap.json (deps), map.json (architecture reg).
21
21
 
22
22
  **Output**: Target Task info (ID, name, status, associated file count).
23
23
  </step_1_resolve>
@@ -37,7 +37,7 @@
37
37
 
38
38
  ### 2.2 Code file identification
39
39
 
40
- Locate code files via: context_glue paths, map.json registered modules, plan.json mentioned files, Slug-named or clearly owned files.
40
+ Locate code files via: map.json registered modules, plan.json mentioned files, Slug-named or clearly owned files.
41
41
 
42
42
  ### 2.3 Global ref scan
43
43
 
@@ -45,7 +45,6 @@
45
45
  |:---|:---|
46
46
  | `roadmap.json` | Task entry + deps refs |
47
47
  | `map.json` | Module entry + featureRelations where deleted Task is aggregator |
48
- | `99_context_glue.md` | Association entries |
49
48
  | `dictionary.json` | Exclusive terms (mark only) |
50
49
  | `error_codes.json` | Exclusive error codes (mark only) |
51
50
 
@@ -57,7 +56,7 @@
57
56
 
58
57
  Scan other Tasks' `spec.md`; check refs to deleted Task's interface/components/data. Mark refs as `[Breaking]`.
59
58
 
60
- **Output**: Output decommission impact report to user — include Task status, docs and code to delete (file/source table), global ref cleanup items (roadmap/map/context_glue), (if any) term/error code residue (manual confirm needed), (if any) aggregator linkage table, (if any) cross-Task ref [Breaking] table. End: OK to execute / Abort to cancel.
59
+ **Output**: Output decommission impact report to user — include Task status, docs and code to delete (file/source table), global ref cleanup items (roadmap/map), (if any) term/error code residue (manual confirm needed), (if any) aggregator linkage table, (if any) cross-Task ref [Breaking] table. End: OK to execute / Abort to cancel.
61
60
 
62
61
  **Gate**: Proceed to step_3 only after user replies OK. Re-warn when `[Breaking]` refs exist.
63
62
  </step_2_impact>
@@ -72,8 +71,7 @@
72
71
  | 2 | Delete Task docs dir | `[[__DOCS_DIR__]]/tasks/<id>_<slug>/` |
73
72
  | 3 | Update `roadmap.json` | Remove task entry; clean deps refs |
74
73
  | 4 | Update `map.json` | Remove module entry + featureRelations entry |
75
- | 5 | Update `99_context_glue.md` | Remove association entries |
76
- | 6 | [?exclusive terms] Update `dictionary.json` | Remove or mark deprecated |
74
+ | 5 | [?exclusive terms] Update `dictionary.json` | Remove or mark deprecated |
77
75
  | 7 | [?exclusive error codes] Update `error_codes.json` | Remove or mark deprecated |
78
76
  | 8 | [?aggregator linkage] Check aggregator code | Confirm refs cleaned |
79
77
 
@@ -95,13 +93,20 @@
95
93
  □ tasks/<id>_<slug>/ doc directory — deleted (step_3 action #2)
96
94
  □ roadmap.json — task entry + deps refs — cleaned (step_3 action #3)
97
95
  □ map.json — module entry + featureRelations — cleaned (step_3 action #4)
98
- □ 99_context_glue.md — association entries — cleaned (step_3 action #5)
99
96
  □ (if exclusive terms/codes) dictionary.json + error_codes.json — handled
97
+ □ Global files cleanup check:
98
+ - vision.md + tech_stack.md — required
99
+ - dictionary.json + error_codes.json + env_registry.json — required
100
+ - (UI projects only) design_tokens.json + ui_context.md
101
+ - (Data projects only) data_snapshot.json
102
+ - (API projects only) api_snapshot.json
103
+ - (CLI projects only) command_api.json
104
+ - (Lib projects only) public_api.json
100
105
  □ Terminal Gate — project build passes, no residual import refs (step_4)
101
106
 
102
107
  **Output**: Decommission completion summary:
103
108
  - **Deleted**: N doc files, N code files
104
- - **Cleaned**: refs in roadmap / map / context_glue
109
+ - **Cleaned**: refs in roadmap / map
105
110
  - **Build status**: Pass/Fail
106
111
  - **[?if any] Manual follow-up**: Term/error code/cross-Task ref residue
107
112
  - **Git Commit Suggestion**: `feat(remove): decommission <ID> <Name>`
@@ -19,7 +19,7 @@
19
19
 
20
20
  <step_1_load>
21
21
  **Action**:
22
- 1. **Load**: All global assets (vision/roadmap/map/dictionary/error_codes/02_tech_stack + conditional: design_tokens/data_snapshot).
22
+ 1. **Load**: All global assets (vision/roadmap/map/dictionary/error_codes/tech_stack + conditional: design_tokens/data_snapshot).
23
23
  2. **Scan Task Index**: Scan tasks/ directory; build Task index (ID, name, status).
24
24
  3. **Intent Analysis**: From `[context]`, identify affected global asset categories.
25
25
 
@@ -101,7 +101,15 @@
101
101
  **Pre-signoff Checklist** (confirm each item after Gate passes, before Output):
102
102
  □ step_4 Safety Checkpoint — Git workspace confirmed (no uncommitted changes or user informed)
103
103
  □ Phase 1 — all confirmed global assets modified, change summary output per file
104
- (UI projects only, design system changed) User notified to re-run archi-ui-wireframe
104
+ Phase 1 Global files check:
105
+ - roadmap.json + vision.md + tech_stack.md + map.json — required
106
+ - dictionary.json + error_codes.json + env_registry.json — required
107
+ - (UI projects only) design_tokens.json + ui_context.md
108
+ - (Data projects only) data_snapshot.json
109
+ - (API projects only) api_snapshot.json
110
+ - (CLI projects only) command_api.json
111
+ - (Lib projects only) public_api.json
112
+ □ (UI projects only, design system changed) User notified to re-run `/archi.ui`
105
113
  □ Phase 2 — each affected Task: spec.md updated + plan.json appended Revision Phase
106
114
  □ Step 5 Silent Audit — executed, all CRITICAL issues resolved
107
115
  □ Consistency confirmed: vision ↔ tech_stack ↔ roadmap ↔ map, no orphan refs (stale terms/paths cleaned)
@@ -34,7 +34,7 @@
34
34
 
35
35
  <step_1_load>
36
36
  **Action**:
37
- 1. **Load**: vision.md (North Star + Boundaries only), roadmap.json (id/title/status/deps/tag + max ID watermark only), 02_tech_stack.md, map.json (directoryMapping + featureRelations only).
37
+ 1. **Load**: vision.md (North Star + Boundaries only), roadmap.json (id/title/status/deps/tag + max ID watermark only), tech_stack.md, map.json (directoryMapping + featureRelations only).
38
38
  2. **Scan Tasks**: Scan tasks/ — understand existing task summaries (title + key flows; full read not needed).
39
39
 
40
40
  **Output**: Internal context summary, proceed to `<step_2_analysis>`.
@@ -117,7 +117,8 @@
117
117
  **Pre-signoff Checklist** (confirm each item before Output):
118
118
  □ Decomposition proposal confirmed by user (replied OK before writing to roadmap — step_4 Gate)
119
119
  □ roadmap.json — tasks appended (not overwritten), lastUpdated updated
120
- □ (new modules) map.json directoryMapping — new task module paths pre-registered
120
+ □ (new modules) map.json directoryMapping + logicalTopology — new task module paths pre-registered
121
+ □ featureRelations — synced if new tasks involve impact on existing file linkages
121
122
  □ step_5 Terminal Gate — task --check + render passed
122
123
 
123
124
  **Action** (Gate must complete in step_5):
@@ -132,7 +133,7 @@
132
133
 
133
134
  | Priority | Action | Notes |
134
135
  |:---|:---|:---|
135
- | (UI projects only) Recommended | [[SKILL: archi-ui-wireframe|Run skill (append mode)]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and follow its protocol)]] | Append screens for new tasks to `ui_concept.html` |
136
+ | (UI projects only) Recommended | `/archi.ui` | Generate/update UI concept design (`screens/` multi-file structure) |
136
137
  | 1 | `/archi.plan <first pending task ID>` | Deep-plan the first executable task |
137
138
  | 2 | Review roadmap | Confirm dependency relationships and priorities |
138
139
  </step_5_signoff>
@@ -0,0 +1,102 @@
1
+ <protocol_script>
2
+ **Trigger**: `/archi.script`
3
+ **Goal**: Generate/update `.architext/scripts/` based on frozen `tech_stack.md`.
4
+ **When**: After infrastructure tasks (INF-01, etc.) complete, when `tech_stack` commands are actual values (not placeholders) and runnable.
5
+
6
+ <meta>
7
+ <style>Deterministic, Auto-Detect, Post-Infra</style>
8
+ <language>English</language>
9
+ <principles>
10
+ 1. **Post-Infra Only**: Only run after infrastructure is ready, `tech_stack` commands must be actual values.
11
+ 2. **Auto-Detect**: Auto-detect OS, generate `.sh` (Unix) and `.ps1` (Windows).
12
+ 3. **Tech-Stack Driven**: Strictly extract actual commands from `tech_stack.md`, no hardcoding.
13
+ 4. **Idempotent**: Multiple runs produce same result, only write on change.
14
+ </principles>
15
+ </meta>
16
+
17
+ <step_1_ingest>
18
+ **Action**:
19
+ 1. Read `[[__DOCS_DIR__]]/global/tech_stack.md`
20
+ 2. Read actual project code, extract real commands:
21
+ - `package.json` → `scripts` field (if exists)
22
+ - Config files → `vite.config.*` / `webpack.config.*` / `tsconfig.json`, etc.
23
+ - CI configs → `.github/workflows/` / `.gitlab-ci.yml`, etc. (if exists)
24
+ 3. Cross-validate: tech_stack commands vs actual config
25
+ - Consistent → use tech_stack commands
26
+ - Inconsistent → use actual code (tech_stack may be outdated)
27
+ 4. Extract commands (skip `[e.g.: ...]` placeholders):
28
+ - **Lint**: Section 3 Static Analysis
29
+ - **Format**: Section 3 Formatter
30
+ - **Build**: Section 3 Build Command
31
+ - **Test**: Section 5 Test Command
32
+ - **Dev**: Section 3 Dev Command
33
+ - **Install**: Section 3 Package Manager + install
34
+ 5. Detect current OS (Windows / Unix-like)
35
+
36
+ **Output**: Internal command map (tech_stack + actual code cross-validated), enter step_2_generate.
37
+ </step_1_ingest>
38
+
39
+ <step_2_generate>
40
+ **Action**: Generate three scripts based on extracted commands:
41
+
42
+ ### validate
43
+ Aggregated checks: Lint → Format Check → Type Check → Build → Test
44
+ - Exit on first failure (exit 1)
45
+ - Colored output (green=pass, red=fail, yellow=skip)
46
+
47
+ ### dev-up
48
+ Start environment: Install → Build → Health Check
49
+ - Health Check: Run build artifact (e.g., `--version` for CLI)
50
+
51
+ ### dev-reset
52
+ Reset environment: Kill Process → Clean Cache → Reinstall → Rebuild → Health Check
53
+ - Kill: Terminate node/tsx processes
54
+ - Clean: Remove node_modules/.cache, dist, coverage
55
+
56
+ **Script Structure**:
57
+ - Unix (`.sh`): `#!/bin/bash`, `set -e`, ANSI colors
58
+ - Windows (`.ps1`): PowerShell, `$ErrorActionPreference`, Write-Host colors
59
+
60
+ **Output**: Script content in memory, enter step_3_write.
61
+ </step_2_generate>
62
+
63
+ <step_3_write>
64
+ **Action**:
65
+ 1. Ensure `[[__DOCS_DIR__]]/scripts/` directory exists
66
+ 2. Compare with existing scripts (if any):
67
+ - Same content → skip
68
+ - Changed → overwrite, mark `MODIFIED`
69
+ - Not exists → write, mark `ADDED`
70
+ 3. Write files:
71
+ - Unix: `validate`, `dev-up`, `dev-reset` (no ext, +x)
72
+ - Windows: `validate.ps1`, `dev-up.ps1`, `dev-reset.ps1`
73
+
74
+ **Output**: File change list.
75
+ </step_3_write>
76
+
77
+ <step_4_signoff>
78
+ **Terminal Gate** (do not skip): Standard check (task --check + render).
79
+
80
+ **Pre-signoff Checklist**:
81
+ □ tech_stack.md — Successfully extracted non-placeholder commands
82
+ □ scripts/ — validate/dev-up/dev-reset generated (Unix + Windows)
83
+ □ Change labels — ADDED / MODIFIED / SKIPPED correctly output
84
+
85
+ **Output**:
86
+ ```
87
+ ✅ Scripts Generated
88
+
89
+ | Script | OS | Status |
90
+ |:---|:---|:---|
91
+ | validate | Unix | ADDED/MODIFIED/SKIPPED |
92
+ | validate | Windows | ADDED/MODIFIED/SKIPPED |
93
+ | dev-up | Unix | ... |
94
+ | dev-up | Windows | ... |
95
+ | dev-reset | Unix | ... |
96
+ | dev-reset | Windows | ... |
97
+
98
+ **Next**: AI will auto-use `scripts/validate` when running `/archi.code`
99
+ ```
100
+ </step_4_signoff>
101
+
102
+ </protocol_script>
@@ -90,13 +90,13 @@
90
90
 
91
91
  ### Information Routing Rules
92
92
 
93
- > Rule files (`02_tech_stack`, `90_custom_rules`, etc.) are already injected into context by IDE; 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.
94
94
 
95
95
  | Brief content | Target file |
96
96
  |:---|:---|
97
97
  | Project identity, target users, success metrics, references | `[[__DOCS_DIR__]]/global/vision.md` |
98
- | Tech stack, deploy target, 3rd-party libs/services | rule file `02_tech_stack` |
99
- | Style/tone — aesthetic direction / density / motion preference | `02_tech_stack` (UI Protocol) + `design_tokens.json` |
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
100
  | (UI projects only) Aesthetic preset + visual reference (brand palette / font / icon / competitor screenshots) | `design_tokens.json` corresponding fields + `vision.md` Visual Reference |
101
101
  | (UI projects only) Images in brief-assets/ tagged `[competitor reference]` | `design_tokens.json` aestheticDirection reference + `vision.md` Visual Reference |
102
102
  | Core task list | `[[__DOCS_DIR__]]/global/roadmap.json` |
@@ -107,7 +107,7 @@
107
107
  | Files in brief-assets/ tagged `[database Schema]` | Parse and write to `data_snapshot.json` |
108
108
  | Files in brief-assets/ tagged `[API docs]` | Parse and route to `vision.md` Context + related Roadmap tasks |
109
109
  | Boundaries and anti-goals | `vision.md` Boundaries |
110
- | Existing resources | `vision.md` + `02_tech_stack` by content |
110
+ | Existing resources | `vision.md` + `tech_stack` by content |
111
111
  | Rules/conventions/preferences from supplementary notes | rule file `90_custom_rules` |
112
112
  | Domain terminology from supplementary notes | `dictionary.json` |
113
113
  | Other background from supplementary notes | `vision.md` Context |
@@ -118,7 +118,7 @@
118
118
  - Fill from Brief: Core Vision / Target Audience / Boundaries / Design & Experience / Product Principles / background context
119
119
  - Fill all placeholders; do not retain template example text
120
120
 
121
- ### 3.2 Tech Stack (rule file `02_tech_stack`)
121
+ ### 3.2 Tech Stack (rule file `tech_stack`)
122
122
  - Brief confirmed → write directly | Blank/"recommend" → AI recommends and mark `(AI Recommended)` + rationale
123
123
  - **AX Optimization**: Prefer AI-friendly tech when recommending
124
124
  - Fill complete Section 1-9
@@ -139,16 +139,18 @@
139
139
  - (Data projects only) `data_snapshot.json`: Initialize core entity skeleton; write empty template if no data description
140
140
  - (UI projects only) `design_tokens.json`: Fill aestheticDirection / primitivePalette / mode / motion / illustration / semanticTokens from "Style & Tone" and "Visual Reference"
141
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.
142
148
 
143
149
  ### 3.6 Map (`[[__DOCS_DIR__]]/global/map.json`)
144
150
  - `directoryMapping`: Pre-register core directory skeleton from tech_stack architecture pattern
145
151
  - `logicalTopology` / `criticalUserJourneys` / `featureRelations`: Empty array for now
146
152
 
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
153
+ UI projects only: **UI concept design**: Skip completed independently by `/archi.ui`.
152
154
 
153
155
  **Output**: Write all files, then run `npx archi render`. Enter step_4_verify.
154
156
  </step_3_constitution>
@@ -165,12 +167,15 @@
165
167
 
166
168
  **Pre-signoff Checklist** (confirm each item after Gate passes, before Output):
167
169
  □ 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
170
+ tech_stack.md — Sections 1-9 fully filled, Section 9 Project Conventions includes Strategy + Rationale
169
171
  □ roadmap.json — archi-decompose-roadmap Skill executed, task chain generated
170
172
  □ 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
+ □ dictionary.json + error_codes.json + env_registry.json — domain terms, core error codes, env vars extracted
174
+ □ (UI projects only) design_tokens.json — generated
173
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
174
179
  □ Step 4 Silent Audit — executed, all CRITICAL issues resolved
175
180
 
176
181
  **Action** (after Checklist confirmed):
@@ -185,8 +190,9 @@
185
190
 
186
191
  | Priority | Action | Notes |
187
192
  |:---|:---|:---|
188
- | (UI projects only) Recommended | Review ui_concept.html | UI concept design auto-generated; confirm layout and visuals in browser |
193
+ | (UI projects only) Recommended | `/archi.ui` | Generate UI concept design (`screens/` multi-file structure) |
189
194
  | Recommended | `/archi.plan INF-01` | Plan the first infrastructure task |
195
+ | (Post-INF) | `/archi.script` | Generate AI automation scripts (validate/dev-up/dev-reset) |
190
196
  | Optional | `/archi.scope <scope-brief.md>` | If more requirements to decompose, append to Roadmap |
191
197
  </step_5_signoff>
192
198
 
@@ -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])