architext 0.0.2 → 0.0.4

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 (103) hide show
  1. package/CHANGELOG.md +41 -1
  2. package/README.md +10 -5
  3. package/README.zh-CN.md +10 -5
  4. package/dist/index.js +43 -39
  5. package/dist/templates/en/docs/global/api_snapshot.json +24 -0
  6. package/dist/templates/en/docs/global/command_api.json +26 -0
  7. package/dist/templates/en/docs/global/env_registry.json +12 -0
  8. package/dist/templates/en/docs/global/map.json +5 -0
  9. package/dist/templates/en/docs/global/public_api.json +12 -0
  10. package/dist/templates/en/docs/prompts/code.md +21 -28
  11. package/dist/templates/en/docs/prompts/edit.md +18 -9
  12. package/dist/templates/en/docs/prompts/inherit.md +42 -23
  13. package/dist/templates/en/docs/prompts/plan.md +141 -47
  14. package/dist/templates/en/docs/prompts/recover.md +63 -0
  15. package/dist/templates/en/docs/prompts/ref.md +258 -0
  16. package/dist/templates/en/docs/prompts/revise.md +1 -1
  17. package/dist/templates/en/docs/prompts/scope.md +3 -3
  18. package/dist/templates/en/docs/prompts/start.md +9 -15
  19. package/dist/templates/en/docs/shared/verify-result-handling.md +6 -0
  20. package/dist/templates/en/docs/templates/design.template.md +77 -0
  21. package/dist/templates/en/docs/templates/spec.template.md +60 -25
  22. package/dist/templates/en/skills/archi-data-sync/SKILL.md +83 -0
  23. package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +178 -132
  24. package/dist/templates/en/skills/archi-design-patterns/SKILL.md +139 -0
  25. package/dist/templates/en/skills/archi-feature-relations/SKILL.md +118 -0
  26. package/dist/templates/en/skills/archi-silent-audit/SKILL.md +118 -0
  27. package/dist/templates/zh/briefs/_base.md +2 -2
  28. package/dist/templates/zh/briefs/_modules.md +2 -2
  29. package/dist/templates/zh/docs/global/api_snapshot.json +24 -0
  30. package/dist/templates/zh/docs/global/command_api.json +26 -0
  31. package/dist/templates/zh/docs/global/data_snapshot.json +0 -1
  32. package/dist/templates/zh/docs/global/design_tokens.json +0 -1
  33. package/dist/templates/zh/docs/global/dictionary.json +1 -1
  34. package/dist/templates/zh/docs/global/env_registry.json +12 -0
  35. package/dist/templates/zh/docs/global/error_codes.json +0 -8
  36. package/dist/templates/zh/docs/global/map.json +28 -3
  37. package/dist/templates/zh/docs/global/public_api.json +12 -0
  38. package/dist/templates/zh/docs/global/vision.md +1 -1
  39. package/dist/templates/zh/docs/prompts/audit.md +8 -8
  40. package/dist/templates/zh/docs/prompts/code.md +33 -40
  41. package/dist/templates/zh/docs/prompts/edit.md +19 -10
  42. package/dist/templates/zh/docs/prompts/fix.md +8 -2
  43. package/dist/templates/zh/docs/prompts/inherit.md +45 -27
  44. package/dist/templates/zh/docs/prompts/map.md +2 -1
  45. package/dist/templates/zh/docs/prompts/plan.md +143 -50
  46. package/dist/templates/zh/docs/prompts/recover.md +63 -0
  47. package/dist/templates/zh/docs/prompts/ref.md +258 -0
  48. package/dist/templates/zh/docs/prompts/remove.md +2 -14
  49. package/dist/templates/zh/docs/prompts/revise.md +12 -4
  50. package/dist/templates/zh/docs/prompts/scope.md +6 -6
  51. package/dist/templates/zh/docs/prompts/start.md +19 -26
  52. package/dist/templates/zh/docs/shared/verify-result-handling.md +6 -0
  53. package/dist/templates/zh/docs/templates/design.template.md +77 -0
  54. package/dist/templates/zh/docs/templates/spec.template.md +60 -25
  55. package/dist/templates/zh/rules/00_system.md +35 -5
  56. package/dist/templates/zh/rules/01_workflow.md +5 -4
  57. package/dist/templates/zh/rules/02_tech_stack.md +7 -6
  58. package/dist/templates/zh/rules/03_data_governance.md +40 -9
  59. package/dist/templates/zh/rules/99_context_glue.md +2 -2
  60. package/dist/templates/zh/skills/archi-data-sync/SKILL.md +83 -0
  61. package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +82 -37
  62. package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +139 -0
  63. package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +118 -0
  64. package/dist/templates/zh/skills/archi-plan-options/SKILL.md +25 -25
  65. package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +118 -0
  66. package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +1 -1
  67. package/package.json +2 -2
  68. package/dist/templates/zh-Hant/briefs/_base.md +0 -115
  69. package/dist/templates/zh-Hant/briefs/_modules.md +0 -173
  70. package/dist/templates/zh-Hant/docs/global/data_snapshot.json +0 -31
  71. package/dist/templates/zh-Hant/docs/global/design_tokens.json +0 -135
  72. package/dist/templates/zh-Hant/docs/global/dictionary.json +0 -35
  73. package/dist/templates/zh-Hant/docs/global/error_codes.json +0 -19
  74. package/dist/templates/zh-Hant/docs/global/map.json +0 -94
  75. package/dist/templates/zh-Hant/docs/global/roadmap.json +0 -39
  76. package/dist/templates/zh-Hant/docs/global/vision.md +0 -82
  77. package/dist/templates/zh-Hant/docs/prompts/audit.md +0 -150
  78. package/dist/templates/zh-Hant/docs/prompts/code.md +0 -160
  79. package/dist/templates/zh-Hant/docs/prompts/edit.md +0 -87
  80. package/dist/templates/zh-Hant/docs/prompts/fix.md +0 -86
  81. package/dist/templates/zh-Hant/docs/prompts/help.md +0 -69
  82. package/dist/templates/zh-Hant/docs/prompts/inherit.md +0 -270
  83. package/dist/templates/zh-Hant/docs/prompts/map.md +0 -131
  84. package/dist/templates/zh-Hant/docs/prompts/plan.md +0 -252
  85. package/dist/templates/zh-Hant/docs/prompts/remove.md +0 -162
  86. package/dist/templates/zh-Hant/docs/prompts/revise.md +0 -160
  87. package/dist/templates/zh-Hant/docs/prompts/scope.md +0 -198
  88. package/dist/templates/zh-Hant/docs/prompts/start.md +0 -258
  89. package/dist/templates/zh-Hant/docs/templates/plan.template.json +0 -88
  90. package/dist/templates/zh-Hant/docs/templates/scope-brief.template.md +0 -58
  91. package/dist/templates/zh-Hant/docs/templates/spec.template.md +0 -51
  92. package/dist/templates/zh-Hant/docs/templates/ui.template.md +0 -51
  93. package/dist/templates/zh-Hant/rules/00_system.md +0 -123
  94. package/dist/templates/zh-Hant/rules/01_workflow.md +0 -93
  95. package/dist/templates/zh-Hant/rules/02_tech_stack.md +0 -192
  96. package/dist/templates/zh-Hant/rules/03_data_governance.md +0 -102
  97. package/dist/templates/zh-Hant/rules/04_cli_tools.md +0 -50
  98. package/dist/templates/zh-Hant/rules/90_custom_rules.md +0 -21
  99. package/dist/templates/zh-Hant/rules/99_context_glue.md +0 -53
  100. package/dist/templates/zh-Hant/skills/archi-decompose-roadmap/SKILL.md +0 -293
  101. package/dist/templates/zh-Hant/skills/archi-interview-protocol/SKILL.md +0 -86
  102. package/dist/templates/zh-Hant/skills/archi-plan-options/SKILL.md +0 -364
  103. package/dist/templates/zh-Hant/skills/archi-ui-wireframe/SKILL.md +0 -337
@@ -0,0 +1,24 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "method": "[GET | POST | PUT | DELETE | PATCH]",
5
+ "path": "[/resource/:id]",
6
+ "description": "[One-sentence endpoint responsibility]",
7
+ "auth": "[required | public | optional]",
8
+ "requestBody": "[Schema description or N/A]",
9
+ "responses": {
10
+ "200": "[Success response structure]",
11
+ "[4xx]": "[ref: error_codes.json#ERR_CODE]"
12
+ },
13
+ "owner": "[FEAT-xxx | INF-xxx]"
14
+ }
15
+ ],
16
+ "protocolMapping": [
17
+ {
18
+ "statusCode": "[400 | 401 | 403 | 404 | 500 | ...]",
19
+ "code": "[ERR_CODE]",
20
+ "meaning": "[Meaning]",
21
+ "action": "[Caller behavior: Toast / Redirect / Retry / ...]"
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "commands": [
3
+ {
4
+ "name": "[command-name]",
5
+ "aliases": ["[alias]"],
6
+ "description": "[One-sentence command responsibility]",
7
+ "args": [
8
+ {
9
+ "name": "[arg-name]",
10
+ "required": true,
11
+ "description": "[Argument description]"
12
+ }
13
+ ],
14
+ "flags": [
15
+ {
16
+ "name": "--[flag-name]",
17
+ "short": "-[f]",
18
+ "type": "[string | boolean | number]",
19
+ "default": "[Default or null]",
20
+ "description": "[Flag description]"
21
+ }
22
+ ],
23
+ "owner": "[FEAT-xxx | INF-xxx]"
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "variables": [
3
+ {
4
+ "name": "[ENV_VAR_NAME]",
5
+ "required": true,
6
+ "default": null,
7
+ "description": "[Purpose]",
8
+ "example": "[Example value]",
9
+ "owner": "[FEAT-xxx | INF-xxx]"
10
+ }
11
+ ]
12
+ }
@@ -81,6 +81,11 @@
81
81
  "category": "UI/UX",
82
82
  "purpose": "Task-level UI scope declaration — references screen IDs from ui_context.md to define this task's screen/component scope"
83
83
  },
84
+ {
85
+ "file": "design.md",
86
+ "category": "Technical Design",
87
+ "purpose": "[?Complex] Technical design — state machine/pipeline/protocol definitions, parameter table, invariants"
88
+ },
84
89
  {
85
90
  "file": "plan.json",
86
91
  "category": "Plan",
@@ -0,0 +1,12 @@
1
+ {
2
+ "exports": [
3
+ {
4
+ "name": "[exportName]",
5
+ "type": "[function | class | type | constant | enum]",
6
+ "signature": "[TypeScript signature]",
7
+ "description": "[One-sentence export responsibility]",
8
+ "stability": "[stable | experimental | deprecated]",
9
+ "owner": "[FEAT-xxx | INF-xxx]"
10
+ }
11
+ ]
12
+ }
@@ -24,20 +24,22 @@
24
24
 
25
25
  | Status | Handling |
26
26
  |:---|:---|
27
- | `active` 🟢 | Pass, continue |
28
- | `pending` | Reject — prompt to run `/archi.plan <ID>` first |
29
- | `blocked` 🧱 | Reject — prerequisites not completed |
30
- | `done` | Reject — already completed, use `/archi.edit <ID>` for modifications |
27
+ | `active` | Pass, continue |
28
+ | `pending` | Reject — prompt to run `/archi.plan <ID>` first |
29
+ | `blocked` | Reject — prerequisites not completed |
30
+ | `done` | Reject — already completed, use `/archi.edit <ID>` for modifications |
31
31
 
32
32
  3. **Load Context** (Use Roadmap `📁 Slug` to locate):
33
33
  - `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/spec.md` — Logic & Scenarios
34
34
  - `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/ui.md` — task UI scope declaration (if exists)
35
+ - [?Complex] `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/design.md` — Technical design (if exists): state machine/pipeline/protocol definitions, parameter table, invariants
35
36
  - [?UI] `[[__DOCS_DIR__]]/global/ui_context.md` — AI screen index (screen IDs / routes / states / navigation graph / shared components)
36
37
  - [?UI] `[[__DOCS_DIR__]]/global/ui_concept.html` — read-only visual reference (calibrate layout against this during implementation; do not redesign — design is already locked in ui.md)
37
38
  - `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/plan.json` — Task breakdown (contains `notes` shorthand; must reference during execution)
38
39
  - `02_tech_stack.md` — Technical Red Lines
39
40
  - [?UI] `[[__DOCS_DIR__]]/global/design_tokens.json`
40
41
  - [?Data] `[[__DOCS_DIR__]]/global/data_snapshot.json`
42
+ - **Read Refs** (if any): Read `[[__DOCS_DIR__]]/refs/index.json` (if exists); match by tags and spec.md tech domain semantics; load only matched ref files as supplementary context; skip if `refs/` missing or empty.
41
43
 
42
44
  **Output**: Atomic list of tasks to implement, marking dependencies and order.
43
45
  </step_1_resolve>
@@ -65,6 +67,7 @@
65
67
  - **Code Organization**: Follow the architecture pattern and file placement strategy defined in `02_tech_stack.md`.
66
68
  - **Comments**: Explain Why, not What; reject nonsense comments.
67
69
  - **Naming**: Self-documenting names; reject `a`, `b`, `tmp` etc. (except loop variable `i`).
70
+ - [?Complex] **Design Adherence**: When `design.md` exists, implementation must strictly follow its state machine/pipeline/protocol definitions; parameters must reference design.md § 3 values (no hardcoding other values); must satisfy all § 4 Invariants (use assert or runtime checks).
68
71
  - **Error Handling**: Prohibit swallowing errors/silent failures; must properly propagate errors and provide observable feedback to callers (UI: Toast; CLI: Exit Code; API: Status Code + Body).
69
72
  - **Robustness**: Explicitly handle edge cases (Loading/Error/Empty/Timeout); prohibit writing only Happy Path.
70
73
  - **SOTA**: Follow tech_stack best practices; reject explicitly forbidden outdated patterns.
@@ -112,30 +115,20 @@
112
115
  **Output**: ✅/❌ status and reason for each check; Task Verification evidence.
113
116
  </step_4_validate>
114
117
 
115
- <step_5_audit>
116
- **Role**: Chief Auditor
117
- **Checklist**:
118
- 1. **Tech Consistency**: Consistent with `02_tech_stack.md` (libraries/patterns/API style).
119
- 2. [?UI] **Design Compliance**: Styles use Token/Preset visual patterns only; no hardcoded magic values.
120
- 3. [?Data] **Data Integrity**: Compliant with `data_snapshot.json`; field names/types match.
121
- 4. **SOTA**: Reject outdated patterns; adopt tech_stack best practices.
122
- 5. [?UI] **Accessibility**: Include necessary accessibility attributes.
123
- 6. [?I18n] **I18n**: No hardcoded strings; must use Key/dictionary reference.
124
- 7. **Performance**: Avoid unnecessary large dependencies/full imports/useless computation/memory leaks.
125
- 8. **Security**: No sensitive info leakage; inputs validated.
126
- 9. **Static Check Zero**: All static check issues resolved.
127
- 10. **step_4 Gate**: Confirm all step_4 checks (Static + Test + Task Verification) have passed.
128
- 11. **Linkage Check**: Read the `featureRelations` array from `[[__DOCS_DIR__]]/global/map.json`; semantically compare the current task against each `sources` field. If matched, output: `⚠️ Linkage: [aggregator] — [checkNote]`, reminding to confirm whether the aggregator needs to be updated after this implementation. Skip if `featureRelations` is empty.
129
- 12. **Data Governance**: When this implementation introduces new content, directly write to the corresponding global index:
130
-
131
- | Trigger | File | Action |
132
- |:---|:---|:---|
133
- | New business entity · verb · shared utility | `dictionary.json` | Directly append |
134
- | New error scenario | `error_codes.json` | Directly append |
135
- | [?Data] Schema actually changed | `data_snapshot.json` | Directly sync |
136
-
137
- Detail issues can be Auto-Fixed with explanation; major risks marked `⚠️ Risk` with alternatives proposed.
138
- </step_5_audit>
118
+ <step_5_verify>
119
+ **Role**: Independent Reviewer
120
+
121
+ **5A. Code quality review**:
122
+ [[SUBAGENT: archi-silent-audit|mode: code-impl, context: Review step_3 implemented code (Tech/SOTA/Security/Performance + conditional dimensions)]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`, follow mode: code-impl review dimension table item by item)]]
123
+
124
+ **5B. Linkage check**:
125
+ [[SUBAGENT: archi-feature-relations|mode: check, context: Semantically compare this implementation with featureRelations sources]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-feature-relations/SKILL.md`, follow mode: check logic)]]
126
+
127
+ **5C. Data governance sync**:
128
+ [[SUBAGENT: archi-data-sync|context: Scan this implementation for new business entities/error codes/Schema; incremental sync per 03_data_governance.md rules]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-data-sync/SKILL.md`, follow its execution protocol)]]
129
+
130
+ [[INCLUDE: shared/verify-result-handling.md]]
131
+ </step_5_verify>
139
132
 
140
133
  <step_6_signoff>
141
134
  **Terminal Gate** (Do not skip; must complete before output summary):
@@ -37,7 +37,7 @@
37
37
  - Add Gherkin Scenarios (covering normal flows + exception paths)
38
38
  - Add interface/type definitions (if this task is upstream of others)
39
39
  5. Update `Spec-Status: Stub → Full`.
40
- 6. [?UI] If module has UI → generate or update `ui.md` (scope declaration); if new screens are needed, notify user to run the `archi-ui-wireframe` Skill (Skill syncs both `ui_concept.html` + `ui_context.md`).
40
+ 6. [?UI] If module has UI → generate or update `ui.md` (scope declaration); if new screens are needed, [[SKILL: archi-ui-wireframe|invoke skill or notify user to run]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and prompt user to follow the document)]] (Skill syncs both `ui_concept.html` + `ui_context.md`).
41
41
  7. Generate `plan.json` (all tasks as done, recording implemented content).
42
42
  8. Present enriched spec summary to user.
43
43
 
@@ -49,14 +49,14 @@
49
49
  **Role**: Requirements Analyst & Designer
50
50
  **Action**:
51
51
  - Modify spec.md (logic/rule changes) and ui.md (structure/interaction changes) based on `[context]`.
52
- - [?UI Modification] Sync `ui_concept.html` + `ui_context.md` via Skill (Skill is the sole writer of both files):
52
+ - [?UI Modification] [[SKILL: archi-ui-wireframe|Follow the skill protocol to sync `ui_concept.html` + `ui_context.md` (Skill is the sole writer of both files)]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and follow its protocol)]]:
53
53
 
54
54
  | Change Type | Criteria | Action |
55
55
  |:---|:---|:---|
56
56
  | No screen impact | Logic/data only, no visual diff | Update spec.md only; `ui_concept.html` / `ui_context.md` unchanged |
57
- | Minor UI tweak | New/modified state, popup, or local area; overall layout unchanged | Call Skill (Modify screens mode) to update both files; output `MODIFIED: S-XX` |
58
- | Screen structure change | Layout refactor, new standalone screen, navigation path change | Call Skill (Modify screens mode) to update both files; output `MODIFIED: S-XX`; if Phase 2 coloring is done, re-color only the modified screen |
59
- | Task reduction | Screen/region removed entirely | Call Skill (Remove screens mode) to update both files; output `REMOVED: S-XX` |
57
+ | Minor UI tweak | New/modified state, popup, or local area; overall layout unchanged | Call skill (Modify screens mode) to update both files; output `MODIFIED: S-XX` |
58
+ | Screen structure change | Layout refactor, new standalone screen, navigation path change | Call skill (Modify screens mode) to update both files; output `MODIFIED: S-XX`; if Phase 2 coloring is done, re-color only the modified screen |
59
+ | Task reduction | Screen/region removed entirely | Call skill (Remove screens mode) to update both files; output `REMOVED: S-XX` |
60
60
 
61
61
  - Ask user questions (A/B/C/D options) to confirm details when requirements are vague.
62
62
 
@@ -66,19 +66,28 @@
66
66
  <step_3_update_plan>
67
67
  **Role**: Tech Lead
68
68
  **Action**:
69
- - Append new phase to `plan.json` phases array: `Phase X: Change Request (<Date>)`.
69
+ - Append new Phase object to `plan.json` phases array.
70
70
  - List specific Tasks (API update, UI tweak, Test update); each must be verifiable.
71
71
  - **Status Transition**: If current task status=`done`, reset to `active` after appending the Phase (otherwise `/archi.code` will be rejected by the Status Gate).
72
72
 
73
- **Terminal Gate** (Do not skip; must complete before step_4 output):
73
+ **Terminal Gate** (Do not skip; must complete before step_3_5 starts):
74
74
  | Step | Command | Pass Condition |
75
75
  |:---|:---|:---|
76
- | 1 | `npx archi render` | `.md` views generated |
77
- | 2 | [if current status=done] `npx archi task <ID> --status active` | Task status reset to active |
76
+ | 1 | `npx archi task --check` | No ERROR-level issues |
77
+ | 2 | `npx archi render` | `.md` views generated |
78
+ | 3 | [if current status=done] `npx archi task <ID> --status active` | Task status reset to active |
78
79
 
79
80
  **Output**: plan.json with new tasks appended; if status transition was performed, output `MODIFIED: roadmap.json <ID>.status done→active`.
80
81
  </step_3_update_plan>
81
82
 
83
+ <step_3_5_verify>
84
+ **Role**: Independent Reviewer
85
+
86
+ [[SUBAGENT: archi-silent-audit|mode: plan-docs, context: Review step_2 updated spec.md/ui.md and step_3 appended plan.json new Phase; ensure doc logic is consistent and new Phase tasks are verifiable]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`, follow mode: plan-docs review dimension table item by item)]]
87
+
88
+ [[INCLUDE: shared/verify-result-handling.md]]
89
+ </step_3_5_verify>
90
+
82
91
  <step_4_summary>
83
92
  **Action** (Gate must complete in step_3):
84
93
  **Output**: Task update summary with Spec/UI/Plan change overview and Next Steps table. Recommend running `/archi.code <ID>`.
@@ -1,7 +1,7 @@
1
1
  <protocol_inherit>
2
- **Trigger**: `/archi.inherit`
2
+ **Trigger**: `/archi.inherit [brief_path]`
3
3
  **Phase**: Legacy Adoption
4
- **Goal**: Reverse-engineer an existing codebase to generate the Architext document skeleton, bringing the project under framework governance.
4
+ **Goal**: Reverse-engineer an existing codebase to generate the Architext document skeleton, bringing the project under framework governance. Optionally provide a Brief to supplement vision/roadmap (for skeleton repos with minimal code).
5
5
 
6
6
  <meta>
7
7
  <style>Analytical, Systematic, Evidence-Based</style>
@@ -15,6 +15,17 @@
15
15
  </principles>
16
16
  </meta>
17
17
 
18
+ <step_0_ingest>
19
+ **Role**: Intelligence Analyst
20
+ **Trigger**: Only when user provides `[brief_path]`. Skip if no argument or path invalid.
21
+ **Action**:
22
+ 1. Parse `[brief_path]`: if path provided → read that file; if not → look for `project-brief.md` (project root), then `[[__DOCS_DIR__]]/project-brief.md`
23
+ 2. If file exists and non-empty: parse Brief sections, extract project identity, core tasks, tech preferences, constraints, supplementary notes (same as start step_0_ingest)
24
+ 3. If file missing or empty: skip this step; subsequent steps use code only as input
25
+
26
+ **Output**: Internal Brief summary (not shown to user), proceed to step_0_recon.
27
+ </step_0_ingest>
28
+
18
29
  <step_0_recon>
19
30
  **Role**: Intelligence Analyst
20
31
  **Action**:
@@ -118,13 +129,23 @@
118
129
 
119
130
  <step_3_constitution>
120
131
  **Role**: Chief Architect
121
- **Input**: Step 1 analysis report + Step 2 supplements (if any).
122
- **Action**: Generate project document skeleton in one pass.
132
+ **Input**: Step 0 Brief parse (if any) + Step 1 analysis report + Step 2 supplements (if any).
133
+ **Action**: Generate project document skeleton in one pass. **When Brief provided**: Brief takes precedence for vision/roadmap/tech_stack; code still used for map, LEG-xx, directory structure. **When no Brief**: Code only as input (original logic).
123
134
 
124
135
  ### Information Routing Rules
125
136
 
126
137
  > Rule files (`02_tech_stack`, `90_custom_rules`, etc.) are already injected into context by the IDE — the AI knows their paths; write directly.
127
138
 
139
+ **When Brief provided** (Brief content → target file, same as start):
140
+ | Brief content | Target file |
141
+ |:---|:---|
142
+ | Project identity, target users, success metrics, references | `[[__DOCS_DIR__]]/global/vision.md` |
143
+ | Tech stack, deployment target, third-party libs/services | rule file `02_tech_stack` |
144
+ | Core task list | `[[__DOCS_DIR__]]/global/roadmap.json` (phase-1/2, call archi-decompose-roadmap) |
145
+ | Rules/conventions from supplementary notes | rule file `90_custom_rules` |
146
+ | Style/tone (UI only) | `design_tokens.json` aestheticDirection etc. |
147
+
148
+ **Information from Code** (always applies):
128
149
  | Information from Code | Target File |
129
150
  |:---|:---|
130
151
  | README project description, target users, task list | `[[__DOCS_DIR__]]/global/vision.md` |
@@ -137,21 +158,24 @@
137
158
  | [?Data] Schema/Migration files | `[[__DOCS_DIR__]]/global/data_snapshot.json` |
138
159
 
139
160
  ### 3.1 Vision (`[[__DOCS_DIR__]]/global/vision.md`)
140
- - Derive from README + project config
141
- - Items that cannot be derived: mark `(AI Inferred — user review recommended)`
161
+ - **With Brief**: Fill from Brief (same as start); code/README as supplement only
162
+ - **Without Brief**: Derive from README + project config; mark un-inferrable items `(AI Inferred — user review recommended)`
142
163
  - Do not retain template placeholders
143
164
 
144
165
  ### 3.2 Tech Stack (rule file `02_tech_stack`)
145
- - Existing dependencies/config → write directly
146
- - Visible code conventions (naming, structure) → write to Coding Standards
166
+ - **With Brief**: Brief-confirmed items → write directly; Brief blank/"recommend" → AI recommends by project features; code deps/config as supplement
167
+ - **Without Brief**: Existing dependencies/config → write directly; visible code conventions → Coding Standards
147
168
  - Must populate complete Section 1-8
148
169
 
149
170
  ### 3.3 Custom Rules (rule file `90_custom_rules`)
150
- - Extract rules from eslint/prettier/editorconfig
151
- - Identify team conventions from code patterns (e.g., named export preference, async/await style)
171
+ - **With Brief**: Merge Brief supplementary notes + code eslint/prettier etc.
172
+ - **Without Brief**: Extract from eslint/prettier/editorconfig; identify team conventions from code patterns
152
173
 
153
174
  ### 3.4 Roadmap (`[[__DOCS_DIR__]]/global/roadmap.json`)
154
175
 
176
+ **With Brief**: [[SKILL: archi-decompose-roadmap|Generate phase-1/2 task chain from Brief task list]]; code functional modules → phase-0 LEG-xx (status=done). Merge both.
177
+ **Without Brief**: Code functional modules only → phase-0 LEG-xx; phase-1/2 remain empty skeletons.
178
+
155
179
  **Structure**:
156
180
  ```json
157
181
  {
@@ -221,25 +245,20 @@
221
245
  ### 3.7 Other Global Documents (as needed)
222
246
  - `dictionary.json`: Extract domain terminology from code
223
247
  - [?UI] `design_tokens.json`: Extract from CSS variables/theme
224
- - [?UI] `ui_concept.html` + `ui_context.md`: **Not generated by this command.** After inherit completes, prompt the user to run the `archi-ui-wireframe` Skill to generate the global UI wireframe (Skill generates both files simultaneously).
248
+ - [?UI] `ui_concept.html` + `ui_context.md`: **Not generated by this command.** After inherit completes, [[SKILL: archi-ui-wireframe|invoke skill or prompt user to run]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and prompt user to follow the document)]] to generate the global UI wireframe (Skill generates both files simultaneously).
225
249
  - [?Data] `data_snapshot.json`: Extract from schema/migration
226
250
  - `error_codes.json`: Extract from error definitions in code
227
251
 
228
252
  **Output**: Write all files, then run `npx archi render`.
229
253
  </step_3_constitution>
230
254
 
231
- <step_4_audit>
232
- **Role**: Chief Auditor
233
- **Checklist**:
234
- 1. **Vision Alignment**: Does vision.md match actual code functionality?
235
- 2. **Tech Stack Consistency**: Does rule file `02_tech_stack` match package.json/config?
236
- 3. **Map Coverage**: Does map.json cover all core directories?
237
- 4. **Roadmap Completeness**: Does phase-0 cover all identified functional modules?
238
- 5. **Stub Completeness**: Does every LEG-xx have a corresponding tasks/ directory and spec.md?
239
- 6. **Dictionary Consistency**: No ambiguous or duplicate terms?
240
-
241
- Silently fix issues; mark severe problems as `Risk Warning`.
242
- </step_4_audit>
255
+ <step_4_verify>
256
+ **Role**: Independent Reviewer
257
+
258
+ [[SUBAGENT: archi-silent-audit|mode: init, context: Review step_3 generated global files (vision, tech_stack, roadmap, map, dictionary, stub specs, etc.)]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`, follow mode: init review dimension table item by item)]]
259
+
260
+ [[INCLUDE: shared/verify-result-handling.md]]
261
+ </step_4_verify>
243
262
 
244
263
  <step_5_signoff>
245
264
  **Terminal Gate** (Do not skip; must complete before output summary):