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.
- package/CHANGELOG.md +55 -1
- package/README.md +93 -14
- package/README.zh-CN.md +92 -14
- package/dist/index.js +53 -39
- package/dist/templates/en/briefs/_base.md +53 -13
- package/dist/templates/en/briefs/_modules.md +31 -4
- package/dist/templates/en/docs/global/error_memory.json +40 -0
- package/dist/templates/en/docs/global/map.json +46 -90
- package/dist/templates/en/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +6 -13
- package/dist/templates/en/{rules/02_tech_stack.md → docs/global/tech_stack.md} +7 -18
- package/dist/templates/en/docs/global/vision.md +1 -1
- package/dist/templates/en/docs/prompts/audit.md +80 -94
- package/dist/templates/en/docs/prompts/code.md +99 -89
- package/dist/templates/en/docs/prompts/edit.md +61 -51
- package/dist/templates/en/docs/prompts/fix.md +59 -43
- package/dist/templates/en/docs/prompts/help.md +23 -31
- package/dist/templates/en/docs/prompts/inherit.md +97 -117
- package/dist/templates/en/docs/prompts/map.md +48 -69
- package/dist/templates/en/docs/prompts/plan.md +141 -240
- package/dist/templates/en/docs/prompts/recover.md +19 -34
- package/dist/templates/en/docs/prompts/ref.md +43 -138
- package/dist/templates/en/docs/prompts/remove.md +63 -110
- package/dist/templates/en/docs/prompts/revise.md +71 -106
- package/dist/templates/en/docs/prompts/scope.md +78 -117
- package/dist/templates/en/docs/prompts/script.md +102 -0
- package/dist/templates/en/docs/prompts/start.md +98 -132
- package/dist/templates/en/docs/prompts/ui.md +113 -0
- package/dist/templates/en/docs/shared/ui-redlines.md +7 -0
- package/dist/templates/en/docs/templates/spec.template.md +1 -1
- package/dist/templates/en/docs/templates/ui.template.md +8 -8
- package/dist/templates/en/rules/00_system.md +268 -117
- package/dist/templates/en/rules/90_custom_rules.md +3 -1
- package/dist/templates/en/skills/archi-data-sync/SKILL.md +37 -23
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +138 -240
- package/dist/templates/en/skills/archi-design-patterns/SKILL.md +6 -1
- package/dist/templates/en/skills/archi-feature-relations/SKILL.md +10 -6
- package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -2
- package/dist/templates/en/skills/archi-plan-options/SKILL.md +77 -301
- package/dist/templates/en/skills/archi-silent-audit/SKILL.md +24 -25
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +175 -305
- package/dist/templates/icon.svg +16 -0
- package/dist/templates/zh/briefs/_base.md +56 -17
- package/dist/templates/zh/briefs/_modules.md +28 -1
- package/dist/templates/zh/docs/global/error_memory.json +40 -0
- package/dist/templates/zh/docs/global/map.json +39 -109
- package/dist/templates/zh/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +0 -7
- package/dist/templates/zh/{rules/02_tech_stack.md → docs/global/tech_stack.md} +9 -20
- package/dist/templates/zh/docs/global/vision.md +1 -1
- package/dist/templates/zh/docs/prompts/audit.md +43 -57
- package/dist/templates/zh/docs/prompts/code.md +66 -56
- package/dist/templates/zh/docs/prompts/edit.md +52 -42
- package/dist/templates/zh/docs/prompts/fix.md +39 -29
- package/dist/templates/zh/docs/prompts/help.md +13 -21
- package/dist/templates/zh/docs/prompts/inherit.md +67 -86
- package/dist/templates/zh/docs/prompts/map.md +28 -50
- package/dist/templates/zh/docs/prompts/plan.md +100 -199
- package/dist/templates/zh/docs/prompts/recover.md +9 -24
- package/dist/templates/zh/docs/prompts/ref.md +11 -106
- package/dist/templates/zh/docs/prompts/remove.md +39 -74
- package/dist/templates/zh/docs/prompts/revise.md +47 -88
- package/dist/templates/zh/docs/prompts/scope.md +52 -91
- package/dist/templates/zh/docs/prompts/script.md +102 -0
- package/dist/templates/zh/docs/prompts/start.md +75 -110
- package/dist/templates/zh/docs/prompts/ui.md +113 -0
- package/dist/templates/zh/docs/shared/ui-redlines.md +7 -0
- package/dist/templates/zh/docs/templates/spec.template.md +1 -1
- package/dist/templates/zh/docs/templates/ui.template.md +8 -8
- package/dist/templates/zh/rules/00_system.md +252 -131
- package/dist/templates/zh/rules/90_custom_rules.md +2 -1
- package/dist/templates/zh/skills/archi-data-sync/SKILL.md +27 -13
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +133 -235
- package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +6 -1
- package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +6 -2
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -2
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +77 -301
- package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +4 -5
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +174 -301
- package/package.json +3 -1
- package/dist/templates/en/rules/01_workflow.md +0 -93
- package/dist/templates/en/rules/03_data_governance.md +0 -102
- package/dist/templates/en/rules/99_context_glue.md +0 -53
- package/dist/templates/zh/rules/01_workflow.md +0 -94
- package/dist/templates/zh/rules/03_data_governance.md +0 -133
- package/dist/templates/zh/rules/99_context_glue.md +0 -53
|
@@ -1,160 +1,125 @@
|
|
|
1
1
|
<protocol_revise>
|
|
2
2
|
**Trigger**: `/archi.revise [context]`
|
|
3
|
-
**Goal**: Execute project-wide global changes (tech stack, architecture, vision, etc.)
|
|
3
|
+
**Goal**: Execute project-wide global changes (tech stack, architecture, vision, etc.); analyze impact scope; modify global assets after user confirmation and cascade update affected Task docs.
|
|
4
4
|
|
|
5
5
|
<constraints_cursor>
|
|
6
|
-
**Mode Lock**: This protocol must run in **Agent Mode (Normal Mode)**.
|
|
6
|
+
**Mode Lock**: This protocol must run in **Agent Mode (Normal Mode)**. Do not switch to Plan Mode or other read-only modes.
|
|
7
7
|
</constraints_cursor>
|
|
8
8
|
|
|
9
9
|
<meta>
|
|
10
10
|
<style>Strategic, Analytical, Cautious, Traceable</style>
|
|
11
11
|
<language>English</language>
|
|
12
12
|
<principles>
|
|
13
|
-
1. **User Gate**: Global changes require item-by-item user confirmation before execution.
|
|
14
|
-
2. **Impact First**: Output complete impact analysis before making
|
|
15
|
-
3. **Doc Cascade**: After global asset changes, must
|
|
13
|
+
1. **User Gate**: Global changes require item-by-item user confirmation before execution. Do not modify without approval.
|
|
14
|
+
2. **Impact First**: Output complete impact analysis before making changes.
|
|
15
|
+
3. **Doc Cascade**: After global asset changes, must sync affected Task docs per edit standards.
|
|
16
16
|
4. **Traceability**: Every change must be traceable — state rationale and impact scope.
|
|
17
17
|
</principles>
|
|
18
18
|
</meta>
|
|
19
19
|
|
|
20
20
|
<step_1_load>
|
|
21
|
-
**Role**: Systems Analyst
|
|
22
21
|
**Action**:
|
|
23
|
-
1. **
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- `[[__DOCS_DIR__]]/global/error_codes.json`
|
|
29
|
-
- `02_tech_stack.md`
|
|
30
|
-
- [?UI] `[[__DOCS_DIR__]]/global/design_tokens.json`
|
|
31
|
-
- [?Data] `[[__DOCS_DIR__]]/global/data_snapshot.json`
|
|
32
|
-
2. **Scan Task Index**: Scan `[[__DOCS_DIR__]]/tasks/` directory, build Task index (ID, name, status).
|
|
33
|
-
3. **Intent Analysis**: Based on user `[context]`, identify which global asset categories are affected.
|
|
34
|
-
|
|
35
|
-
**Output**: Change intent summary — list of initially identified global files. Proceed to step_2.
|
|
22
|
+
1. **Load**: All global assets (vision/roadmap/map/dictionary/error_codes/tech_stack + conditional: design_tokens/data_snapshot).
|
|
23
|
+
2. **Scan Task Index**: Scan tasks/ directory; build Task index (ID, name, status).
|
|
24
|
+
3. **Intent Analysis**: From `[context]`, identify affected global asset categories.
|
|
25
|
+
|
|
26
|
+
**Output**: Change intent summary — list initially identified global files; proceed to step_2.
|
|
36
27
|
</step_1_load>
|
|
37
28
|
|
|
38
29
|
<step_2_interview>
|
|
39
30
|
**Role**: Chief Architect
|
|
40
31
|
**Action**:
|
|
41
|
-
Clarify change boundaries
|
|
32
|
+
Clarify change boundaries from user description and loaded context:
|
|
42
33
|
|
|
43
34
|
| Dimension | Description |
|
|
44
35
|
|:---|:---|
|
|
45
|
-
| Change
|
|
46
|
-
| Change
|
|
47
|
-
| Exclusion
|
|
36
|
+
| Change scope | Precisely identify which global files and rules are affected |
|
|
37
|
+
| Change motivation | Why this change; expected outcome |
|
|
38
|
+
| Exclusion list | Any Tasks that should not be affected |
|
|
48
39
|
|
|
49
|
-
-
|
|
50
|
-
-
|
|
40
|
+
- When context is clear enough → merge into step_3 and output impact analysis directly.
|
|
41
|
+
- When ambiguity or multiple viable directions → ask user to confirm (A/B/C/D options).
|
|
51
42
|
</step_2_interview>
|
|
52
43
|
|
|
53
44
|
<step_3_impact>
|
|
54
|
-
**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
## Change Impact Assessment: [Change Topic]
|
|
60
|
-
|
|
61
|
-
### 1. Global Asset Change List
|
|
62
|
-
| File | Change Content | Type |
|
|
63
|
-
|:---|:---|:---|
|
|
64
|
-
| vision.md | [what specifically changes, or "no change needed"] | modify/no change |
|
|
65
|
-
| 02_tech_stack.md | [...] | ... |
|
|
66
|
-
| roadmap.json | [...] | ... |
|
|
67
|
-
| map.json | [...] | ... |
|
|
68
|
-
| dictionary.json | [...] | ... |
|
|
69
|
-
| data_snapshot.json | [...] | ... |
|
|
70
|
-
| design_tokens.json | [...] | ... |
|
|
71
|
-
| error_codes.json | [...] | ... |
|
|
72
|
-
|
|
73
|
-
### 2. Affected Tasks List
|
|
74
|
-
| Task ID | Name | Impact Points | Severity |
|
|
75
|
-
|:---|:---|:---|:---|
|
|
76
|
-
| INF-001 | [name] | [which parts of spec/ui/plan are affected] | High/Med/Low |
|
|
77
|
-
|
|
78
|
-
### 3. Items Requiring User Decision (if any)
|
|
79
|
-
- [?] [uncertain item description + options]
|
|
80
|
-
- [?] ...
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
> Reply **OK** to confirm all; or annotate items that need adjustment.
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
**Gate**: Wait for user confirmation. Prohibited from entering step_4 without confirmation.
|
|
45
|
+
**Constraint**: **Output only; do not modify any files**. This step produces the "Change Impact Assessment".
|
|
46
|
+
|
|
47
|
+
**Output**: Change impact assessment — global asset change list table (file/change content/type), affected Task list table (ID/name/impact points/severity), user decision items (if any). End with confirmation: OK to confirm all; or annotate adjustments.
|
|
48
|
+
|
|
49
|
+
**Gate**: Wait for user confirmation. Do not enter step_4 without confirmation.
|
|
87
50
|
</step_3_impact>
|
|
88
51
|
|
|
89
52
|
<step_3_5_refinement>
|
|
90
|
-
**
|
|
91
|
-
**
|
|
92
|
-
**Action**: Do not execute changes. Incorporate user feedback, refresh and re-output the impact assessment. Wait for re-confirmation.
|
|
53
|
+
**Trigger**: User reply is not OK — contains corrections, rejections, or additional input.
|
|
54
|
+
**Action**: Do not execute changes. Incorporate feedback, refresh impact assessment and re-output; await re-confirmation.
|
|
93
55
|
</step_3_5_refinement>
|
|
94
56
|
|
|
95
57
|
<step_4_execute>
|
|
96
|
-
**Role**: Execution Engineer
|
|
97
58
|
**Action**:
|
|
98
59
|
|
|
99
|
-
**Safety Checkpoint** (
|
|
60
|
+
**Safety Checkpoint** (must complete before execution):
|
|
100
61
|
1. Check Git working directory status (run `git status`).
|
|
101
|
-
2. If uncommitted changes exist → prompt user to commit or stash first
|
|
102
|
-
3. Once working directory
|
|
62
|
+
2. If uncommitted changes exist → prompt user to commit or stash first.
|
|
63
|
+
3. Once working directory clean, inform user: to rollback, run `git checkout -- .`.
|
|
103
64
|
|
|
104
|
-
**Phase 1 — Modify
|
|
105
|
-
Modify global files per
|
|
65
|
+
**Phase 1 — Modify global assets**:
|
|
66
|
+
Modify global files per user-confirmed list. Output change summary for each file.
|
|
106
67
|
|
|
107
|
-
**
|
|
108
|
-
If `design_tokens.json` has
|
|
68
|
+
**(UI projects only) Phase 1.5 — Design system change check**:
|
|
69
|
+
If `design_tokens.json` has the following changes, notify user to re-run `archi-ui-wireframe` to regenerate:
|
|
109
70
|
|
|
110
|
-
| Change scope | Impact |
|
|
111
|
-
|
|
112
|
-
| `primitivePalette.brand` / `semanticTokens.colors` | Brand/semantic color change |
|
|
113
|
-
| `semanticTokens.typography` | Font change |
|
|
114
|
-
| `motion.preference` / `motion.patterns` | Motion change |
|
|
115
|
-
| `illustration.iconLibrary` | Icon library change |
|
|
116
|
-
| `layout` (radius/spacing/shadow) | Component size/radius change |
|
|
71
|
+
| Change scope | Impact |
|
|
72
|
+
|:---|:---|
|
|
73
|
+
| `primitivePalette.brand` / `semanticTokens.colors` | Brand/semantic color change |
|
|
74
|
+
| `semanticTokens.typography` | Font change |
|
|
75
|
+
| `motion.preference` / `motion.patterns` | Motion change |
|
|
76
|
+
| `illustration.iconLibrary` | Icon library change |
|
|
77
|
+
| `layout` (radius/spacing/shadow) | Component size/radius change |
|
|
117
78
|
|
|
118
|
-
> If
|
|
79
|
+
> If above fields unchanged (e.g. only `mode.default` changed), no need to re-run.
|
|
119
80
|
|
|
120
|
-
**Phase 2 — Cascade
|
|
81
|
+
**Phase 2 — Cascade update Task docs**:
|
|
121
82
|
For each affected Task, follow `/archi.edit` standards:
|
|
122
|
-
1. Update `spec.md
|
|
123
|
-
2.
|
|
124
|
-
3. Append new Phase to `plan.json
|
|
83
|
+
1. Update `spec.md`.
|
|
84
|
+
2. (UI projects only) Update `ui.md`; if screen structure affected, [[SKILL: archi-ui-wireframe|run skill (local update mode) to sync]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and follow its protocol)]].
|
|
85
|
+
3. Append new Phase to `plan.json`: `Phase X: Global Revision — [Change Topic] (<Date>)`.
|
|
125
86
|
|
|
126
|
-
**Output**: Change summary for each file (global + Task).
|
|
87
|
+
**Output**: Change summary for each file (global + Task). Enter step_5_verify.
|
|
127
88
|
</step_4_execute>
|
|
128
89
|
|
|
129
|
-
<
|
|
130
|
-
**Role**:
|
|
131
|
-
**Checklist**:
|
|
132
|
-
1. Cross-consistency between global assets (vision ↔ tech_stack ↔ roadmap ↔ map).
|
|
133
|
-
2. Task docs aligned with updated global assets.
|
|
134
|
-
3. No orphaned references (stale terms/paths in dictionary/map cleaned up).
|
|
90
|
+
<step_5_verify>
|
|
91
|
+
**Role**: Independent Reviewer
|
|
135
92
|
|
|
136
|
-
|
|
137
|
-
| Step | Command | Pass Condition |
|
|
138
|
-
|:---|:---|:---|
|
|
139
|
-
| 1 | `npx archi task --check` | No ERROR-level issues |
|
|
140
|
-
| 2 | `npx archi render` | `.md` views generated |
|
|
93
|
+
[[SUBAGENT: archi-silent-audit|mode: plan-docs, context: Review step_4 Phase 2 cascade-updated Task docs for alignment with modified global assets]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`, follow mode: plan-docs review dimension table)]]
|
|
141
94
|
|
|
142
|
-
|
|
143
|
-
|
|
95
|
+
[[INCLUDE: shared/verify-result-handling.md]]
|
|
96
|
+
</step_5_verify>
|
|
97
|
+
|
|
98
|
+
<step_6_summary>
|
|
99
|
+
**Role**: Chief Auditor
|
|
144
100
|
|
|
145
|
-
**Output
|
|
146
|
-
|
|
147
|
-
|
|
101
|
+
**Pre-signoff Checklist** (confirm each item after Gate passes, before Output):
|
|
102
|
+
□ step_4 Safety Checkpoint — Git workspace confirmed (no uncommitted changes or user informed)
|
|
103
|
+
□ Phase 1 — all confirmed global assets modified, change summary output per file
|
|
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`
|
|
113
|
+
□ Phase 2 — each affected Task: spec.md updated + plan.json appended Revision Phase
|
|
114
|
+
□ Step 5 Silent Audit — executed, all CRITICAL issues resolved
|
|
115
|
+
□ Consistency confirmed: vision ↔ tech_stack ↔ roadmap ↔ map, no orphan refs (stale terms/paths cleaned)
|
|
148
116
|
|
|
149
|
-
**
|
|
150
|
-
|
|
151
|
-
**
|
|
117
|
+
**Terminal Gate** (do not skip): Standard check (task --check + render).
|
|
118
|
+
|
|
119
|
+
**Action** (after Gate passes):
|
|
120
|
+
1. Output change summary.
|
|
152
121
|
|
|
153
|
-
|
|
154
|
-
| Priority | Action | Description |
|
|
155
|
-
|:---|:---|:---|
|
|
156
|
-
| ... | ... | ... |
|
|
157
|
-
```
|
|
122
|
+
**Output**: Global Revision Summary — global asset changed files list, Task update list and impact summary, audit result, Next Steps table.
|
|
158
123
|
</step_5_summary>
|
|
159
124
|
|
|
160
125
|
</protocol_revise>
|
|
@@ -1,117 +1,78 @@
|
|
|
1
1
|
<protocol_scope>
|
|
2
|
-
**Trigger**: `/archi.scope [file_path]`
|
|
2
|
+
**Trigger**: `/archi.scope [file_path]` | Auto-loaded by Workflow Dispatch on natural language trigger
|
|
3
3
|
**Phase**: Requirement Decomposition
|
|
4
|
-
**Goal**: Read Scope Brief, decompose large requirements into
|
|
4
|
+
**Goal**: Read Scope Brief, decompose large requirements into Roadmap tasks with dependencies.
|
|
5
5
|
|
|
6
6
|
<meta>
|
|
7
7
|
<style>Strategic, Analytical, Structured</style>
|
|
8
8
|
<language>English</language>
|
|
9
9
|
<principles>
|
|
10
|
-
1. **Brief-Driven**:
|
|
11
|
-
2. **Incremental**: Append to existing Roadmap;
|
|
12
|
-
3. **User Agency First**:
|
|
13
|
-
4. **Minimal Questions**:
|
|
14
|
-
5. **Option Z Everywhere**:
|
|
10
|
+
1. **Brief-Driven**: User-provided Scope Brief is the core input; no task brainstorming from thin air.
|
|
11
|
+
2. **Incremental**: Append to existing Roadmap; do not rewrite existing tasks.
|
|
12
|
+
3. **User Agency First**: User-filled choices in Brief must be adopted directly; do not question or replace.
|
|
13
|
+
4. **Minimal Questions**: Ask only for information gaps; skip when Brief is sufficient.
|
|
14
|
+
5. **Option Z Everywhere**: Supplementary questions must include `[Z] Custom`.
|
|
15
|
+
6. **IDE-Native First**: Leverage IDE native capabilities to drive execution rhythm; this protocol defines quality standards and checkpoints, not fight IDE planning/execution mechanisms.
|
|
15
16
|
</principles>
|
|
16
17
|
</meta>
|
|
17
18
|
|
|
18
19
|
<step_0_ingest>
|
|
19
20
|
**Role**: Intelligence Analyst
|
|
20
21
|
**Action**:
|
|
21
|
-
1. Parse `[file_path]` from trigger
|
|
22
|
+
1. Parse `[file_path]` from trigger:
|
|
22
23
|
- If path provided → read that file
|
|
23
|
-
- If
|
|
24
|
-
- If
|
|
24
|
+
- If not provided → search `scope-brief.md` (project root), then `[[__DOCS_DIR__]]/scope-brief.md`
|
|
25
|
+
- If user entered via natural language description (no file_path param) and above files not found → goto `<fallback_interview>`
|
|
26
|
+
- If neither exists or empty → goto `<fallback_interview>`
|
|
25
27
|
|
|
26
|
-
2. Parse Brief sections and
|
|
27
|
-
- Initiative name and description
|
|
28
|
-
- Task list
|
|
29
|
-
- Existing design decisions
|
|
30
|
-
- Boundaries & constraints (out of scope, timeline, dependencies, technical limits)
|
|
31
|
-
- Affected existing tasks
|
|
32
|
-
- References
|
|
28
|
+
2. Parse Brief sections, extract: initiative name and description, task list, pre-defined design decisions, boundaries and constraints, affected existing tasks, references.
|
|
33
29
|
|
|
34
|
-
> Brief is a one-time input file; user may delete
|
|
30
|
+
> Brief is a one-time input file; user may delete after processing.
|
|
35
31
|
|
|
36
32
|
**Output**: Internal summary (not shown to user), proceed to `<step_1_load>`.
|
|
37
33
|
</step_0_ingest>
|
|
38
34
|
|
|
39
35
|
<step_1_load>
|
|
40
|
-
**Role**: System Analyst
|
|
41
36
|
**Action**:
|
|
42
|
-
1. **
|
|
43
|
-
2. **
|
|
44
|
-
3. **Read Tech Stack**: `02_tech_stack.md` — technical constraints.
|
|
45
|
-
4. **Read Map**: `[[__DOCS_DIR__]]/global/map.json` — read `directoryMapping` and `featureRelations` only; skip `logicalTopology` and `criticalUserJourneys`.
|
|
46
|
-
5. **Scan Tasks**: Scan `[[__DOCS_DIR__]]/tasks/` directory — understand existing task summaries (title + key flows, no full read needed).
|
|
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
|
+
2. **Scan Tasks**: Scan tasks/ — understand existing task summaries (title + key flows; full read not needed).
|
|
47
39
|
|
|
48
40
|
**Output**: Internal context summary, proceed to `<step_2_analysis>`.
|
|
49
41
|
</step_1_load>
|
|
50
42
|
|
|
51
43
|
<step_2_analysis>
|
|
52
44
|
**Role**: Chief Product Strategist (CPO)
|
|
53
|
-
**Input**: Step 0 Brief
|
|
45
|
+
**Input**: Step 0 Brief parse result + Step 1 project context.
|
|
54
46
|
|
|
55
47
|
**Action**:
|
|
56
48
|
|
|
57
|
-
1. **Vision
|
|
58
|
-
2. **Task
|
|
59
|
-
3. **Impact
|
|
60
|
-
4. **Gap
|
|
61
|
-
5. **Linkage
|
|
49
|
+
1. **Vision alignment check**: Does Brief align with vision.md North Star? If deviation → mark `[Vision Deviation Warning]`.
|
|
50
|
+
2. **Task list completeness**: Sufficient to support initiative goal?
|
|
51
|
+
3. **Impact assessment**: Brief "affected existing tasks" → verify against roadmap/tasks.
|
|
52
|
+
4. **Gap identification**: Key info missing in Brief?
|
|
53
|
+
5. **Linkage check**: [[SUBAGENT: archi-feature-relations|mode: check, context: Compare new task descriptions with featureRelations sources; output linkage reminder if matched]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-feature-relations/SKILL.md`, follow mode: check logic)]]
|
|
62
54
|
|
|
63
|
-
**Gap
|
|
64
|
-
- **Required**: Missing prevents reasonable decomposition (e.g., empty task list)
|
|
65
|
-
- **Recommended**: AI can infer but should confirm (e.g., unclear dependencies)
|
|
66
|
-
- **Optional**: AI can decide autonomously (e.g., task grouping approach)
|
|
55
|
+
**Gap levels**: Required → cannot decompose | Can supplement → AI can derive, suggest confirm | Suggested → AI decides
|
|
67
56
|
|
|
68
|
-
**Decision**:
|
|
69
|
-
- No "Required" or "Recommended" gaps → skip Step 2.5, proceed to Step 3
|
|
70
|
-
- Has gaps → proceed to Step 2.5
|
|
57
|
+
**Decision**: No "Required" + "Can supplement" gaps → skip Step 3 | Has gaps → enter Step 3
|
|
71
58
|
|
|
72
|
-
**Output**:
|
|
73
|
-
```
|
|
74
|
-
### SCOPE BRIEF Analysis Report
|
|
75
|
-
> **Initiative**: [Name] | **Scale**: Estimated [N] tasks
|
|
76
|
-
|
|
77
|
-
**Vision Alignment**: [Aligned / ⚠️ Deviation — reason]
|
|
78
|
-
|
|
79
|
-
**Confirmed Information**:
|
|
80
|
-
- [list]
|
|
81
|
-
|
|
82
|
-
**Affected Existing Tasks**:
|
|
83
|
-
| Task | Status | Estimated Impact |
|
|
84
|
-
|:---|:---|:---|
|
|
85
|
-
| [ID: Name] | [done/active/stub] | [needs modification/extension/no impact] |
|
|
86
|
-
|
|
87
|
-
**[?matched] Linkage Reminder**:
|
|
88
|
-
| Aggregator | checkNote |
|
|
89
|
-
|:---|:---|
|
|
90
|
-
| [aggregator ID/path] | [checkNote content] |
|
|
91
|
-
|
|
92
|
-
**Information Gaps** (to be addressed):
|
|
93
|
-
- [gap list]
|
|
94
|
-
|
|
95
|
-
**AI Will Auto-Decide** (no action needed):
|
|
96
|
-
- [list]
|
|
97
|
-
```
|
|
59
|
+
**Output**: Output SCOPE BRIEF analysis report to user — include initiative name/estimated scale, Vision alignment, confirmed info, affected existing tasks table (task/status/estimated impact), (if matched) linkage reminder table, information gaps, AI auto-decide items. Enter step_3_supplementary (has gaps) or step_4_decompose (no gaps).
|
|
98
60
|
</step_2_analysis>
|
|
99
61
|
|
|
100
|
-
<
|
|
101
|
-
**
|
|
102
|
-
**Trigger**: Only when Step 2 identifies "Required" or "Recommended" gaps.
|
|
62
|
+
<step_3_supplementary>
|
|
63
|
+
**Trigger**: Only when Step 2 finds "Required" or "Can supplement" gaps.
|
|
103
64
|
**Input**: Step 2 gap list. Max 3 questions.
|
|
104
65
|
|
|
105
|
-
[[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)]]
|
|
106
|
-
</
|
|
66
|
+
[[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)]]
|
|
67
|
+
</step_3_supplementary>
|
|
107
68
|
|
|
108
|
-
<
|
|
69
|
+
<step_4_decompose>
|
|
109
70
|
**Role**: Chief Architect
|
|
110
|
-
**Input**: Full Brief + project context +
|
|
71
|
+
**Input**: Full Brief + project context + supplement answers (if any).
|
|
111
72
|
|
|
112
|
-
**Action**: [[SKILL: archi-decompose-roadmap|Follow the skill protocol to generate incremental task data from
|
|
73
|
+
**Action**: [[SKILL: archi-decompose-roadmap|Follow the skill protocol to generate incremental task data from Scope Brief task list.]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-decompose-roadmap/SKILL.md` and follow its protocol)]]
|
|
113
74
|
|
|
114
|
-
**Display format** (convert Skill output
|
|
75
|
+
**Display format** (convert Skill output to the following format, present to user, await confirmation):
|
|
115
76
|
|
|
116
77
|
```
|
|
117
78
|
#### Phase 1: Infrastructure
|
|
@@ -120,79 +81,79 @@
|
|
|
120
81
|
#### Phase 2: Core Features
|
|
121
82
|
| ID | Title | Description Summary | Deps | Tag |
|
|
122
83
|
|
|
123
|
-
#### Execution Batches (
|
|
124
|
-
(Derived from deps via topological sort)
|
|
84
|
+
#### Execution Batches (parallel execution groups)
|
|
125
85
|
Batch 1 (ready immediately): ...
|
|
126
|
-
Batch 2 (after Batch 1): ...
|
|
86
|
+
Batch 2 (after Batch 1 complete): ...
|
|
127
87
|
|
|
128
|
-
#### NFR
|
|
129
|
-
|
|
130
|
-
- [NFR name] → injected into [task ID] | affects: [other task IDs]
|
|
88
|
+
#### NFR cross-cutting concerns (merged, not in Roadmap)
|
|
89
|
+
- [NFR name] → inject [task ID] | affects: [other task IDs]
|
|
131
90
|
```
|
|
132
91
|
|
|
133
|
-
**Gate**:
|
|
134
|
-
</
|
|
92
|
+
**Gate**: User replies **OK** to enter step_5_roadmap_update; do not write to Roadmap without confirmation.
|
|
93
|
+
</step_4_decompose>
|
|
135
94
|
|
|
136
|
-
<
|
|
137
|
-
**
|
|
138
|
-
**Trigger**: User replies non-OK, with merge/split/add/remove/dependency adjustments.
|
|
95
|
+
<step_4_5_refinement>
|
|
96
|
+
**Trigger**: User reply is not OK — contains merge/split/add/remove/dependency adjustments.
|
|
139
97
|
**Action**: Incorporate user feedback, refresh decomposition plan and re-output, await re-confirmation.
|
|
140
|
-
|
|
98
|
+
|
|
99
|
+
User replies OK → enter step_5_roadmap_update.
|
|
100
|
+
</step_4_5_refinement>
|
|
141
101
|
|
|
142
102
|
<step_4_roadmap_update>
|
|
143
|
-
**Role**: System Administrator
|
|
144
103
|
**Input**: User-confirmed decomposition plan.
|
|
145
104
|
|
|
146
105
|
**Action**:
|
|
147
|
-
1. Append new tasks to corresponding Phase's `tasks` array in
|
|
106
|
+
1. Append new tasks to corresponding Phase's `tasks` array in roadmap.json.
|
|
148
107
|
2. If new Phase needed → append to `phases` array.
|
|
149
|
-
3. Update `lastUpdated
|
|
150
|
-
4.
|
|
108
|
+
3. Update `lastUpdated`.
|
|
109
|
+
4. (New modules) Update map.json `directoryMapping`: pre-register inferred module paths for new tasks.
|
|
151
110
|
|
|
152
|
-
**Terminal Gate** (
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
| 2 | `npx archi render` | `.md` views generated |
|
|
111
|
+
**Terminal Gate** (do not skip): Standard check (task --check + render).
|
|
112
|
+
|
|
113
|
+
**Output**: Write confirmation. Enter step_6_signoff.
|
|
114
|
+
</step_5_roadmap_update>
|
|
157
115
|
|
|
158
|
-
|
|
159
|
-
|
|
116
|
+
<step_6_signoff>
|
|
117
|
+
**Pre-signoff Checklist** (confirm each item before Output):
|
|
118
|
+
□ Decomposition proposal confirmed by user (replied OK before writing to roadmap — step_4 Gate)
|
|
119
|
+
□ roadmap.json — tasks appended (not overwritten), lastUpdated updated
|
|
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
|
|
122
|
+
□ step_5 Terminal Gate — task --check + render passed
|
|
160
123
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
1. Run `npx archi task` to display task progress overview.
|
|
124
|
+
**Action** (Gate must complete in step_5):
|
|
125
|
+
1. Run `npx archi task` to output task progress overview.
|
|
164
126
|
2. Output summary.
|
|
165
127
|
|
|
166
128
|
**Output**: Requirement decomposition summary, including:
|
|
167
|
-
- **Brief
|
|
168
|
-
- **New
|
|
169
|
-
- **Impact on
|
|
129
|
+
- **Brief source confirmation**: Initiative name and core goal
|
|
130
|
+
- **New tasks**: Count and phase distribution
|
|
131
|
+
- **Impact on existing tasks**: Impact list (if any)
|
|
170
132
|
- **Next Steps**:
|
|
171
133
|
|
|
172
|
-
| Priority | Action |
|
|
134
|
+
| Priority | Action | Notes |
|
|
173
135
|
|:---|:---|:---|
|
|
174
|
-
|
|
|
175
|
-
| 1 | `/archi.plan <first pending task ID>` | Deep
|
|
136
|
+
| (UI projects only) Recommended | `/archi.ui` | Generate/update UI concept design (`screens/` multi-file structure) |
|
|
137
|
+
| 1 | `/archi.plan <first pending task ID>` | Deep-plan the first executable task |
|
|
176
138
|
| 2 | Review roadmap | Confirm dependency relationships and priorities |
|
|
177
139
|
</step_5_signoff>
|
|
178
140
|
|
|
179
141
|
<fallback_interview>
|
|
180
|
-
**Trigger**: Brief file
|
|
181
|
-
**Role**: Product Consultant
|
|
142
|
+
**Trigger**: Brief file not found or empty, or user entered via natural language description.
|
|
182
143
|
|
|
183
144
|
**Action**:
|
|
184
|
-
1. Inform user that
|
|
185
|
-
- Run `npx archi template scope-brief` to
|
|
145
|
+
1. Inform user that requirements will be gathered via conversation. Suggest:
|
|
146
|
+
- Run `npx archi template scope-brief` to get template to project root
|
|
186
147
|
- Fill in and re-run `/archi.scope scope-brief.md`
|
|
187
|
-
- Or continue conversation
|
|
188
|
-
2. If user chooses to continue
|
|
189
|
-
a.
|
|
190
|
-
b.
|
|
191
|
-
c.
|
|
192
|
-
d.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
148
|
+
- Or continue conversation and provide info via interview
|
|
149
|
+
2. If user chooses to continue, guide by the following dimensions (skip if already known, 1-2 questions each):
|
|
150
|
+
a. **Motivation & Goals**: Why build this? What problem does it solve? What outcome is expected?
|
|
151
|
+
b. **Scope**: Which features/modules are included? What's excluded?
|
|
152
|
+
c. **Task Breakdown**: Do you have a rough task split in mind? (If not, AI will decompose in step_3)
|
|
153
|
+
d. **Constraints**: Technical limits, time constraints, dependencies?
|
|
154
|
+
e. **Impact**: Which existing features will be affected?
|
|
155
|
+
3. After collection, write to `scope-brief.md` (project root), following scope-brief template structure.
|
|
156
|
+
4. Inform user brief is generated, then goto `<step_1_load>` to continue.
|
|
196
157
|
</fallback_interview>
|
|
197
158
|
|
|
198
159
|
</protocol_scope>
|
|
@@ -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>
|