architext 0.0.2
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 +63 -0
- package/LICENSE +21 -0
- package/README.md +326 -0
- package/README.zh-CN.md +326 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +46 -0
- package/dist/templates/en/briefs/_base.md +115 -0
- package/dist/templates/en/briefs/_modules.md +173 -0
- package/dist/templates/en/docs/global/data_snapshot.json +31 -0
- package/dist/templates/en/docs/global/design_tokens.json +150 -0
- package/dist/templates/en/docs/global/dictionary.json +35 -0
- package/dist/templates/en/docs/global/error_codes.json +19 -0
- package/dist/templates/en/docs/global/map.json +94 -0
- package/dist/templates/en/docs/global/roadmap.json +39 -0
- package/dist/templates/en/docs/global/vision.md +82 -0
- package/dist/templates/en/docs/prompts/audit.md +150 -0
- package/dist/templates/en/docs/prompts/code.md +160 -0
- package/dist/templates/en/docs/prompts/edit.md +87 -0
- package/dist/templates/en/docs/prompts/fix.md +86 -0
- package/dist/templates/en/docs/prompts/help.md +69 -0
- package/dist/templates/en/docs/prompts/inherit.md +270 -0
- package/dist/templates/en/docs/prompts/map.md +131 -0
- package/dist/templates/en/docs/prompts/plan.md +252 -0
- package/dist/templates/en/docs/prompts/remove.md +162 -0
- package/dist/templates/en/docs/prompts/revise.md +160 -0
- package/dist/templates/en/docs/prompts/scope.md +198 -0
- package/dist/templates/en/docs/prompts/start.md +258 -0
- package/dist/templates/en/docs/templates/plan.template.json +113 -0
- package/dist/templates/en/docs/templates/scope-brief.template.md +58 -0
- package/dist/templates/en/docs/templates/spec.template.md +51 -0
- package/dist/templates/en/docs/templates/ui.template.md +51 -0
- package/dist/templates/en/rules/00_system.md +123 -0
- package/dist/templates/en/rules/01_workflow.md +93 -0
- package/dist/templates/en/rules/02_tech_stack.md +197 -0
- package/dist/templates/en/rules/03_data_governance.md +102 -0
- package/dist/templates/en/rules/04_cli_tools.md +50 -0
- package/dist/templates/en/rules/90_custom_rules.md +22 -0
- package/dist/templates/en/rules/99_context_glue.md +53 -0
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +292 -0
- package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +86 -0
- package/dist/templates/en/skills/archi-plan-options/SKILL.md +364 -0
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +342 -0
- package/dist/templates/zh/briefs/_base.md +116 -0
- package/dist/templates/zh/briefs/_modules.md +173 -0
- package/dist/templates/zh/docs/global/data_snapshot.json +31 -0
- package/dist/templates/zh/docs/global/design_tokens.json +135 -0
- package/dist/templates/zh/docs/global/dictionary.json +35 -0
- package/dist/templates/zh/docs/global/error_codes.json +19 -0
- package/dist/templates/zh/docs/global/map.json +94 -0
- package/dist/templates/zh/docs/global/roadmap.json +39 -0
- package/dist/templates/zh/docs/global/vision.md +82 -0
- package/dist/templates/zh/docs/prompts/audit.md +150 -0
- package/dist/templates/zh/docs/prompts/code.md +160 -0
- package/dist/templates/zh/docs/prompts/edit.md +87 -0
- package/dist/templates/zh/docs/prompts/fix.md +86 -0
- package/dist/templates/zh/docs/prompts/help.md +69 -0
- package/dist/templates/zh/docs/prompts/inherit.md +270 -0
- package/dist/templates/zh/docs/prompts/map.md +131 -0
- package/dist/templates/zh/docs/prompts/plan.md +253 -0
- package/dist/templates/zh/docs/prompts/remove.md +162 -0
- package/dist/templates/zh/docs/prompts/revise.md +160 -0
- package/dist/templates/zh/docs/prompts/scope.md +198 -0
- package/dist/templates/zh/docs/prompts/start.md +258 -0
- package/dist/templates/zh/docs/templates/plan.template.json +88 -0
- package/dist/templates/zh/docs/templates/scope-brief.template.md +58 -0
- package/dist/templates/zh/docs/templates/spec.template.md +51 -0
- package/dist/templates/zh/docs/templates/ui.template.md +51 -0
- package/dist/templates/zh/rules/00_system.md +123 -0
- package/dist/templates/zh/rules/01_workflow.md +93 -0
- package/dist/templates/zh/rules/02_tech_stack.md +192 -0
- package/dist/templates/zh/rules/03_data_governance.md +102 -0
- package/dist/templates/zh/rules/04_cli_tools.md +50 -0
- package/dist/templates/zh/rules/90_custom_rules.md +21 -0
- package/dist/templates/zh/rules/99_context_glue.md +53 -0
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +293 -0
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +86 -0
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +364 -0
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +339 -0
- package/dist/templates/zh-Hant/briefs/_base.md +115 -0
- package/dist/templates/zh-Hant/briefs/_modules.md +173 -0
- package/dist/templates/zh-Hant/docs/global/data_snapshot.json +31 -0
- package/dist/templates/zh-Hant/docs/global/design_tokens.json +135 -0
- package/dist/templates/zh-Hant/docs/global/dictionary.json +35 -0
- package/dist/templates/zh-Hant/docs/global/error_codes.json +19 -0
- package/dist/templates/zh-Hant/docs/global/map.json +94 -0
- package/dist/templates/zh-Hant/docs/global/roadmap.json +39 -0
- package/dist/templates/zh-Hant/docs/global/vision.md +82 -0
- package/dist/templates/zh-Hant/docs/prompts/audit.md +150 -0
- package/dist/templates/zh-Hant/docs/prompts/code.md +160 -0
- package/dist/templates/zh-Hant/docs/prompts/edit.md +87 -0
- package/dist/templates/zh-Hant/docs/prompts/fix.md +86 -0
- package/dist/templates/zh-Hant/docs/prompts/help.md +69 -0
- package/dist/templates/zh-Hant/docs/prompts/inherit.md +270 -0
- package/dist/templates/zh-Hant/docs/prompts/map.md +131 -0
- package/dist/templates/zh-Hant/docs/prompts/plan.md +252 -0
- package/dist/templates/zh-Hant/docs/prompts/remove.md +162 -0
- package/dist/templates/zh-Hant/docs/prompts/revise.md +160 -0
- package/dist/templates/zh-Hant/docs/prompts/scope.md +198 -0
- package/dist/templates/zh-Hant/docs/prompts/start.md +258 -0
- package/dist/templates/zh-Hant/docs/templates/plan.template.json +88 -0
- package/dist/templates/zh-Hant/docs/templates/scope-brief.template.md +58 -0
- package/dist/templates/zh-Hant/docs/templates/spec.template.md +51 -0
- package/dist/templates/zh-Hant/docs/templates/ui.template.md +51 -0
- package/dist/templates/zh-Hant/rules/00_system.md +123 -0
- package/dist/templates/zh-Hant/rules/01_workflow.md +93 -0
- package/dist/templates/zh-Hant/rules/02_tech_stack.md +192 -0
- package/dist/templates/zh-Hant/rules/03_data_governance.md +102 -0
- package/dist/templates/zh-Hant/rules/04_cli_tools.md +50 -0
- package/dist/templates/zh-Hant/rules/90_custom_rules.md +21 -0
- package/dist/templates/zh-Hant/rules/99_context_glue.md +53 -0
- package/dist/templates/zh-Hant/skills/archi-decompose-roadmap/SKILL.md +293 -0
- package/dist/templates/zh-Hant/skills/archi-interview-protocol/SKILL.md +86 -0
- package/dist/templates/zh-Hant/skills/archi-plan-options/SKILL.md +364 -0
- package/dist/templates/zh-Hant/skills/archi-ui-wireframe/SKILL.md +337 -0
- package/package.json +85 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<protocol_remove>
|
|
2
|
+
**Trigger**: `/archi.remove <id>`
|
|
3
|
+
**Goal**: Fully decommission the specified Task — delete docs, code, and global references with zero residue.
|
|
4
|
+
|
|
5
|
+
<meta>
|
|
6
|
+
<style>Surgical, Cautious, Thorough</style>
|
|
7
|
+
<language>English</language>
|
|
8
|
+
<principles>
|
|
9
|
+
1. **Dependency Safety**: If other tasks depend on this Task, dependencies must be resolved before proceeding.
|
|
10
|
+
2. **Confirmation Gate**: Deletion is irreversible; must present full impact and obtain explicit confirmation.
|
|
11
|
+
3. **Zero Residue**: Cleanup must cover all associated layers (docs/code/global data/glue entries).
|
|
12
|
+
4. **No Side Effects**: Only remove content related to the target Task; forbidden to touch unrelated files.
|
|
13
|
+
</principles>
|
|
14
|
+
</meta>
|
|
15
|
+
|
|
16
|
+
<step_1_resolve>
|
|
17
|
+
**Role**: System Analyst
|
|
18
|
+
**Action**:
|
|
19
|
+
1. **Resolve ID**: Parse `<id>` from `[[__DOCS_DIR__]]/global/roadmap.json` → Task Name, Slug, status.
|
|
20
|
+
2. **ID Not Found** → Error with list of available task IDs.
|
|
21
|
+
3. **Load Context**:
|
|
22
|
+
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/` — All docs (spec.md, ui.md, plan.json, etc.)
|
|
23
|
+
- `[[__DOCS_DIR__]]/global/roadmap.json` — Task dependency graph
|
|
24
|
+
- `[[__DOCS_DIR__]]/global/map.json` — Architecture registry
|
|
25
|
+
- `99_context_glue.md` — Code↔doc associations
|
|
26
|
+
|
|
27
|
+
**Output**: Target Task info (ID, name, status, associated file count).
|
|
28
|
+
</step_1_resolve>
|
|
29
|
+
|
|
30
|
+
<step_2_impact>
|
|
31
|
+
**Role**: Impact Assessor
|
|
32
|
+
**Action**: Scan each layer to produce an impact manifest.
|
|
33
|
+
|
|
34
|
+
### 2.1 Dependency Check (Blocking)
|
|
35
|
+
|
|
36
|
+
Scan all tasks' `deps` in `roadmap.json` for references to `<id>`.
|
|
37
|
+
|
|
38
|
+
| Situation | Handling |
|
|
39
|
+
|:---|:---|
|
|
40
|
+
| No downstream deps | Pass, continue |
|
|
41
|
+
| Has downstream deps with `pending`/`blocked` status | List affected tasks; ask user: remove dependency and continue, or abort |
|
|
42
|
+
| Has downstream deps with `active`/`done` status | **Block** — these tasks may use this Task's interfaces/components. Must `/archi.edit` to decouple first |
|
|
43
|
+
|
|
44
|
+
### 2.2 Code File Identification
|
|
45
|
+
|
|
46
|
+
Locate code files belonging to this Task via:
|
|
47
|
+
1. `99_context_glue.md` code paths associated with `<id>`.
|
|
48
|
+
2. `map.json` modules/directories registered for this Task.
|
|
49
|
+
3. `plan.json` file paths mentioned in tasks.
|
|
50
|
+
4. Scan code directories for files named with Slug or clearly scoped to this Task.
|
|
51
|
+
|
|
52
|
+
### 2.3 Global Reference Scan
|
|
53
|
+
|
|
54
|
+
| File | Scan Target |
|
|
55
|
+
|:---|:---|
|
|
56
|
+
| `roadmap.json` | Task entry + `deps` references in other tasks |
|
|
57
|
+
| `map.json` | Module registry entries + `featureRelations` entries where the deleted Task is the aggregator |
|
|
58
|
+
| `99_context_glue.md` | Association entries |
|
|
59
|
+
| `dictionary.json` | Terms exclusive to this Task (flag only, no auto-delete) |
|
|
60
|
+
| `error_codes.json` | Error codes exclusive to this Task (flag only, no auto-delete) |
|
|
61
|
+
|
|
62
|
+
### 2.4 Aggregation Linkage Check
|
|
63
|
+
|
|
64
|
+
Read `map.json.featureRelations`; determine whether the deleted Task falls within any aggregator's `sources` coverage.
|
|
65
|
+
|
|
66
|
+
| Situation | Handling |
|
|
67
|
+
|:---|:---|
|
|
68
|
+
| Not in any aggregator's sources range | No special handling |
|
|
69
|
+
| In an aggregator's sources range | List in impact report; prompt to check if aggregator content needs to be cleaned up after deletion |
|
|
70
|
+
| Deleted Task is itself an aggregator | Also remove its entry from `featureRelations` |
|
|
71
|
+
|
|
72
|
+
### 2.5 Cross-Task References
|
|
73
|
+
|
|
74
|
+
Scan other Tasks' `spec.md` for references to the target Task's interfaces, components, or data. Flag as `[Breaking]`.
|
|
75
|
+
|
|
76
|
+
**Output**: Impact report to user:
|
|
77
|
+
```
|
|
78
|
+
### Decommission Impact Report: <ID> <Name>
|
|
79
|
+
|
|
80
|
+
**Task Status**: [status]
|
|
81
|
+
|
|
82
|
+
**Docs to delete**:
|
|
83
|
+
- [[__DOCS_DIR__]]/tasks/<id>_<slug>/ (N files)
|
|
84
|
+
|
|
85
|
+
**Code to delete**:
|
|
86
|
+
| File/Directory | Source |
|
|
87
|
+
|:---|:---|
|
|
88
|
+
| src/xxx/xxx.ts | context_glue |
|
|
89
|
+
| src/xxx/ | map.json |
|
|
90
|
+
|
|
91
|
+
**Global reference cleanup**:
|
|
92
|
+
- roadmap.json: remove task <id>, clean N deps references
|
|
93
|
+
- map.json: remove N module entries
|
|
94
|
+
- context_glue: remove N associations
|
|
95
|
+
|
|
96
|
+
**[?present] Terms/error codes residue** (manual confirmation needed):
|
|
97
|
+
- dictionary.json: [term1], [term2]
|
|
98
|
+
- error_codes.json: [ERR_XXX]
|
|
99
|
+
|
|
100
|
+
**[?present] Aggregation linkage** (check needed):
|
|
101
|
+
| Aggregator | checkNote |
|
|
102
|
+
|:---|:---|
|
|
103
|
+
| [aggregator ID/path] | [checkNote content] |
|
|
104
|
+
|
|
105
|
+
**[?present] Cross-Task references [Breaking]**:
|
|
106
|
+
| Referencing Task | Reference Content | Suggestion |
|
|
107
|
+
|:---|:---|:---|
|
|
108
|
+
| FEAT-005 spec.md | Calls <id>'s UserAPI | /archi.edit FEAT-005 to decouple first |
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
> Reply **OK** to confirm; reply **abort** to cancel.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Gate**: Proceed to step_3 after user replies OK. Re-warn if `[Breaking]` cross-Task refs exist.
|
|
115
|
+
</step_2_impact>
|
|
116
|
+
|
|
117
|
+
<step_3_execute>
|
|
118
|
+
**Role**: Surgeon
|
|
119
|
+
**Action**: Execute in this order (order is mandatory).
|
|
120
|
+
|
|
121
|
+
| # | Operation | Target |
|
|
122
|
+
|:---|:---|:---|
|
|
123
|
+
| 1 | Delete code files/directories | Code paths from step_2 |
|
|
124
|
+
| 2 | Delete Task doc directory | `[[__DOCS_DIR__]]/tasks/<id>_<slug>/` |
|
|
125
|
+
| 3 | Update `roadmap.json` | Remove task entry; clean `deps` refs to `<id>` in other tasks |
|
|
126
|
+
| 4 | Update `map.json` | Remove module entries; if this Task is an aggregator, also remove its `featureRelations` entry |
|
|
127
|
+
| 5 | Update `99_context_glue.md` | Remove association entries for this Task |
|
|
128
|
+
| 6 | [?exclusive terms] Update `dictionary.json` | Remove or mark deprecated |
|
|
129
|
+
| 7 | [?exclusive codes] Update `error_codes.json` | Remove or mark deprecated |
|
|
130
|
+
| 8 | [?aggregation linkage] Check aggregator code | Verify aggregator no longer references the deleted Task |
|
|
131
|
+
|
|
132
|
+
Log each operation (file path + operation type) as it completes.
|
|
133
|
+
</step_3_execute>
|
|
134
|
+
|
|
135
|
+
<step_4_verify>
|
|
136
|
+
**Role**: Verification Engineer
|
|
137
|
+
**Terminal Gate** (Do not skip; must complete before step_5 output):
|
|
138
|
+
| Step | Command | Pass Condition |
|
|
139
|
+
|:---|:---|:---|
|
|
140
|
+
| 1 | `npx archi task --check` | No ERROR-level issues, no dangling deps |
|
|
141
|
+
| 2 | `npx archi render` | `.md` views generated |
|
|
142
|
+
| 3 | Run project build command | Zero compilation errors |
|
|
143
|
+
|
|
144
|
+
| Check | Pass Criteria |
|
|
145
|
+
|:---|:---|
|
|
146
|
+
| Roadmap consistency | `--check` passes, no dangling deps |
|
|
147
|
+
| Build | Zero compilation errors |
|
|
148
|
+
| Residual refs | No import/require of deleted modules in codebase |
|
|
149
|
+
|
|
150
|
+
Build failure or residual refs found → locate, fix, and recheck.
|
|
151
|
+
</step_4_verify>
|
|
152
|
+
|
|
153
|
+
<step_5_summary>
|
|
154
|
+
**Output**: Decommission summary:
|
|
155
|
+
- **Deleted**: N doc files, N code files
|
|
156
|
+
- **Cleaned**: roadmap / map / context_glue references
|
|
157
|
+
- **Build status**: pass/fail
|
|
158
|
+
- **[?present] Manual follow-up needed**: terms/error codes/cross-Task ref residue
|
|
159
|
+
- **Git Commit Suggestion**: `feat(remove): decommission <ID> <Name>`
|
|
160
|
+
</step_5_summary>
|
|
161
|
+
|
|
162
|
+
</protocol_remove>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<protocol_revise>
|
|
2
|
+
**Trigger**: `/archi.revise [context]`
|
|
3
|
+
**Goal**: Execute project-wide global changes (tech stack, architecture, vision, etc.), analyze impact scope, modify global assets after user confirmation, and cascade updates to affected Task documents.
|
|
4
|
+
|
|
5
|
+
<constraints_cursor>
|
|
6
|
+
**Mode Lock**: This protocol must run in **Agent Mode (Normal Mode)**. Prohibited from switching to Plan Mode or other read-only modes.
|
|
7
|
+
</constraints_cursor>
|
|
8
|
+
|
|
9
|
+
<meta>
|
|
10
|
+
<style>Strategic, Analytical, Cautious, Traceable</style>
|
|
11
|
+
<language>English</language>
|
|
12
|
+
<principles>
|
|
13
|
+
1. **User Gate**: Global changes require item-by-item user confirmation before execution. Prohibited from modifying without approval.
|
|
14
|
+
2. **Impact First**: Output complete impact analysis before making any changes.
|
|
15
|
+
3. **Doc Cascade**: After global asset changes, must update affected Task docs following edit protocol standards.
|
|
16
|
+
4. **Traceability**: Every change must be traceable — state rationale and impact scope.
|
|
17
|
+
</principles>
|
|
18
|
+
</meta>
|
|
19
|
+
|
|
20
|
+
<step_1_load>
|
|
21
|
+
**Role**: Systems Analyst
|
|
22
|
+
**Action**:
|
|
23
|
+
1. **Read Global Assets**:
|
|
24
|
+
- `[[__DOCS_DIR__]]/global/vision.md`
|
|
25
|
+
- `[[__DOCS_DIR__]]/global/roadmap.json`
|
|
26
|
+
- `[[__DOCS_DIR__]]/global/map.json`
|
|
27
|
+
- `[[__DOCS_DIR__]]/global/dictionary.json`
|
|
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.
|
|
36
|
+
</step_1_load>
|
|
37
|
+
|
|
38
|
+
<step_2_interview>
|
|
39
|
+
**Role**: Chief Architect
|
|
40
|
+
**Action**:
|
|
41
|
+
Clarify change boundaries based on user description and loaded context:
|
|
42
|
+
|
|
43
|
+
| Dimension | Description |
|
|
44
|
+
|:---|:---|
|
|
45
|
+
| Change Scope | Precisely identify which global files and rules are affected |
|
|
46
|
+
| Change Motivation | Why this change is needed, what outcome is expected |
|
|
47
|
+
| Exclusion List | Any Tasks that should not be affected |
|
|
48
|
+
|
|
49
|
+
- Context is clear enough → merge into step_3 and output impact analysis directly.
|
|
50
|
+
- Ambiguity or multiple viable directions → ask user to confirm (A/B/C/D options).
|
|
51
|
+
</step_2_interview>
|
|
52
|
+
|
|
53
|
+
<step_3_impact>
|
|
54
|
+
**Role**: Impact Analyst
|
|
55
|
+
**Constraint**: **Output only, prohibited from modifying any files**. This step produces the "Change Impact Assessment".
|
|
56
|
+
|
|
57
|
+
**Output Format**:
|
|
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.
|
|
87
|
+
</step_3_impact>
|
|
88
|
+
|
|
89
|
+
<step_3_5_refinement>
|
|
90
|
+
**Role**: Consultant
|
|
91
|
+
**Trigger**: User replies non-OK, contains corrections, rejections, or additional input.
|
|
92
|
+
**Action**: Do not execute changes. Incorporate user feedback, refresh and re-output the impact assessment. Wait for re-confirmation.
|
|
93
|
+
</step_3_5_refinement>
|
|
94
|
+
|
|
95
|
+
<step_4_execute>
|
|
96
|
+
**Role**: Execution Engineer
|
|
97
|
+
**Action**:
|
|
98
|
+
|
|
99
|
+
**Safety Checkpoint** (required before execution):
|
|
100
|
+
1. Check Git working directory status (run `git status`).
|
|
101
|
+
2. If uncommitted changes exist → prompt user to commit or stash first, then continue.
|
|
102
|
+
3. Once working directory is clean, inform user: to roll back, run `git checkout -- .` to restore pre-change state.
|
|
103
|
+
|
|
104
|
+
**Phase 1 — Modify Global Assets**:
|
|
105
|
+
Modify global files per the user-confirmed list. Output change summary for each file.
|
|
106
|
+
|
|
107
|
+
**[?UI] Phase 1.5 — Design System Change Check**:
|
|
108
|
+
If `design_tokens.json` has any of the following changes, notify the user after Phase 2:
|
|
109
|
+
|
|
110
|
+
| Change scope | Impact | Action |
|
|
111
|
+
|:---|:---|:---|
|
|
112
|
+
| `primitivePalette.brand` / `semanticTokens.colors` | Brand/semantic color change | Notify user: re-run `archi-ui-wireframe` Phase 2 (full re-coloring) |
|
|
113
|
+
| `semanticTokens.typography` | Font change | Notify user: re-run Phase 2 |
|
|
114
|
+
| `motion.preference` / `motion.patterns` | Motion change | Notify user: re-run Phase 2 |
|
|
115
|
+
| `illustration.iconLibrary` | Icon library change | Notify user: re-run Phase 2 |
|
|
116
|
+
| `layout` (radius/spacing/shadow) | Component size/radius change | Notify user: re-run Phase 2 |
|
|
117
|
+
|
|
118
|
+
> If none of the above fields changed (e.g., only `mode.default` changed), Phase 2 re-run is not needed.
|
|
119
|
+
|
|
120
|
+
**Phase 2 — Cascade Update Task Docs**:
|
|
121
|
+
For each affected Task, follow `/archi.edit` standards:
|
|
122
|
+
1. Update `spec.md` (logic/rules that need adjustment due to global changes).
|
|
123
|
+
2. [?UI] Update `ui.md` (scope/interaction adjustments due to global changes); if screen structure is affected, run `archi-ui-wireframe` Skill (incremental update mode) to sync both `ui_concept.html` + `ui_context.md`.
|
|
124
|
+
3. Append new Phase to `plan.json` `phases`: `Phase X: Global Revision — [Change Topic] (<Date>)`, listing implementation tasks.
|
|
125
|
+
|
|
126
|
+
**Output**: Change summary for each file (global + Task).
|
|
127
|
+
</step_4_execute>
|
|
128
|
+
|
|
129
|
+
<step_5_summary>
|
|
130
|
+
**Role**: Auditor
|
|
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).
|
|
135
|
+
|
|
136
|
+
**Terminal Gate** (Do not skip; must complete before output summary):
|
|
137
|
+
| Step | Command | Pass Condition |
|
|
138
|
+
|:---|:---|:---|
|
|
139
|
+
| 1 | `npx archi task --check` | No ERROR-level issues |
|
|
140
|
+
| 2 | `npx archi render` | `.md` views generated |
|
|
141
|
+
|
|
142
|
+
**Action** (After Gate passes):
|
|
143
|
+
1. Output change summary.
|
|
144
|
+
|
|
145
|
+
**Output**:
|
|
146
|
+
```
|
|
147
|
+
## Global Revision Summary: [Change Topic]
|
|
148
|
+
|
|
149
|
+
**Global Assets Modified**: [list of modified files]
|
|
150
|
+
**Tasks Updated**: [list of updated Tasks + impact summary each]
|
|
151
|
+
**Audit Result**: [pass/risk items]
|
|
152
|
+
|
|
153
|
+
### Next Steps
|
|
154
|
+
| Priority | Action | Description |
|
|
155
|
+
|:---|:---|:---|
|
|
156
|
+
| ... | ... | ... |
|
|
157
|
+
```
|
|
158
|
+
</step_5_summary>
|
|
159
|
+
|
|
160
|
+
</protocol_revise>
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<protocol_scope>
|
|
2
|
+
**Trigger**: `/archi.scope [file_path]`
|
|
3
|
+
**Phase**: Requirement Decomposition
|
|
4
|
+
**Goal**: Read Scope Brief, decompose large requirements into multiple Roadmap tasks with dependency relationships.
|
|
5
|
+
|
|
6
|
+
<meta>
|
|
7
|
+
<style>Strategic, Analytical, Structured</style>
|
|
8
|
+
<language>English</language>
|
|
9
|
+
<principles>
|
|
10
|
+
1. **Brief-Driven**: Use user-provided Scope Brief as primary input; never brainstorm tasks from scratch.
|
|
11
|
+
2. **Incremental**: Append to existing Roadmap; never rewrite existing tasks.
|
|
12
|
+
3. **User Agency First**: Adopt user-specified choices from Brief as-is; never question or replace.
|
|
13
|
+
4. **Minimal Questions**: Only ask about information gaps; skip questioning if Brief is sufficient.
|
|
14
|
+
5. **Option Z Everywhere**: All supplementary questions must include `[Z] Custom`.
|
|
15
|
+
</principles>
|
|
16
|
+
</meta>
|
|
17
|
+
|
|
18
|
+
<step_0_ingest>
|
|
19
|
+
**Role**: Intelligence Analyst
|
|
20
|
+
**Action**:
|
|
21
|
+
1. Parse `[file_path]` from trigger command:
|
|
22
|
+
- If path provided → read that file
|
|
23
|
+
- If no path → look for `scope-brief.md` (project root), then `[[__DOCS_DIR__]]/scope-brief.md`
|
|
24
|
+
- If none found or empty → jump to `<fallback_interview>`
|
|
25
|
+
|
|
26
|
+
2. Parse Brief sections and extract:
|
|
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
|
|
33
|
+
|
|
34
|
+
> Brief is a one-time input file; user may delete it after processing.
|
|
35
|
+
|
|
36
|
+
**Output**: Internal summary (not shown to user), proceed to `<step_1_load>`.
|
|
37
|
+
</step_0_ingest>
|
|
38
|
+
|
|
39
|
+
<step_1_load>
|
|
40
|
+
**Role**: System Analyst
|
|
41
|
+
**Action**:
|
|
42
|
+
1. **Read Vision**: `[[__DOCS_DIR__]]/global/vision.md` — read North Star Metric and Boundaries sections only; skip remaining chapters.
|
|
43
|
+
2. **Read Roadmap**: `[[__DOCS_DIR__]]/global/roadmap.json` — extract only `id/title/status/deps/tag` fields per task (skip `goal/notes`; requirement decomposition does not need these); read current max ID watermark for new task numbering.
|
|
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).
|
|
47
|
+
|
|
48
|
+
**Output**: Internal context summary, proceed to `<step_2_analysis>`.
|
|
49
|
+
</step_1_load>
|
|
50
|
+
|
|
51
|
+
<step_2_analysis>
|
|
52
|
+
**Role**: Chief Product Strategist (CPO)
|
|
53
|
+
**Input**: Step 0 Brief parsing result + Step 1 project context.
|
|
54
|
+
|
|
55
|
+
**Action**:
|
|
56
|
+
|
|
57
|
+
1. **Vision Alignment Check**: Does the Brief align with vision.md north star metrics? If deviation → flag `[Vision Deviation Warning]`.
|
|
58
|
+
2. **Task List Completeness**: Does the task list sufficiently support the initiative goal?
|
|
59
|
+
3. **Impact Assessment**: Brief "Affected Existing Tasks" → verify against roadmap/tasks for existence and status.
|
|
60
|
+
4. **Gap Identification**: Check Brief for critical missing information.
|
|
61
|
+
5. **Linkage Check**: Read `map.json.featureRelations`; semantically compare the new task's description against each `sources` field to determine if it falls within any aggregator's coverage. Surface a linkage reminder in the summary if matched.
|
|
62
|
+
|
|
63
|
+
**Gap Levels**:
|
|
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)
|
|
67
|
+
|
|
68
|
+
**Decision**:
|
|
69
|
+
- No "Required" or "Recommended" gaps → skip Step 2.5, proceed to Step 3
|
|
70
|
+
- Has gaps → proceed to Step 2.5
|
|
71
|
+
|
|
72
|
+
**Output**: Display Brief analysis summary to user:
|
|
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
|
+
```
|
|
98
|
+
</step_2_analysis>
|
|
99
|
+
|
|
100
|
+
<step_2_5_supplementary>
|
|
101
|
+
**Role**: Product Consultant
|
|
102
|
+
**Trigger**: Only when Step 2 identifies "Required" or "Recommended" gaps.
|
|
103
|
+
**Input**: Step 2 gap list. Max 3 questions.
|
|
104
|
+
|
|
105
|
+
[[SKILL: Follow `archi-interview-protocol` 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
|
+
</step_2_5_supplementary>
|
|
107
|
+
|
|
108
|
+
<step_3_decompose>
|
|
109
|
+
**Role**: Chief Architect
|
|
110
|
+
**Input**: Full Brief + project context + supplementary answers (if any).
|
|
111
|
+
|
|
112
|
+
**Action**: [[SKILL: Follow the `archi-decompose-roadmap` Skill protocol to generate incremental task data from the Scope Brief task list]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-decompose-roadmap/SKILL.md` and follow its protocol)]]
|
|
113
|
+
|
|
114
|
+
**Display format** (convert Skill output into the following format, present to user and await confirmation):
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
#### Phase 1: Infrastructure
|
|
118
|
+
| ID | Title | Description Summary | Tag |
|
|
119
|
+
|
|
120
|
+
#### Phase 2: Core Features
|
|
121
|
+
| ID | Title | Description Summary | Deps | Tag |
|
|
122
|
+
|
|
123
|
+
#### Execution Batches (Parallel Groups)
|
|
124
|
+
(Derived from deps via topological sort)
|
|
125
|
+
Batch 1 (ready immediately): ...
|
|
126
|
+
Batch 2 (after Batch 1): ...
|
|
127
|
+
|
|
128
|
+
#### NFR Cross-Cutting Concerns (merged, not in Roadmap)
|
|
129
|
+
(From Skill's NFR merge list)
|
|
130
|
+
- [NFR name] → injected into [task ID] | affects: [other task IDs]
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Gate**: Proceed to step_4 only after user replies **OK**. Do not write to Roadmap without confirmation. User may refine the plan before confirming (merge/split/adjust deps).
|
|
134
|
+
</step_3_decompose>
|
|
135
|
+
|
|
136
|
+
<step_3_5_refinement>
|
|
137
|
+
**Role**: Consultant
|
|
138
|
+
**Trigger**: User replies non-OK, with merge/split/add/remove/dependency adjustments.
|
|
139
|
+
**Action**: Incorporate user feedback, refresh decomposition plan and re-output, await re-confirmation.
|
|
140
|
+
</step_3_5_refinement>
|
|
141
|
+
|
|
142
|
+
<step_4_roadmap_update>
|
|
143
|
+
**Role**: System Administrator
|
|
144
|
+
**Input**: User-confirmed decomposition plan.
|
|
145
|
+
|
|
146
|
+
**Action**:
|
|
147
|
+
1. Append new tasks to corresponding Phase's `tasks` array in `[[__DOCS_DIR__]]/global/roadmap.json`.
|
|
148
|
+
2. If new Phase needed → append to `phases` array.
|
|
149
|
+
3. Update `lastUpdated` field.
|
|
150
|
+
4. [?New modules] Update `directoryMapping` in `[[__DOCS_DIR__]]/global/map.json`: pre-register inferred module paths for new tasks (based on tech_stack architecture pattern and task descriptions; directory-level only — details to be filled during `/archi.plan`).
|
|
151
|
+
|
|
152
|
+
**Terminal Gate** (Do not skip; must complete before output summary):
|
|
153
|
+
| Step | Command | Pass Condition |
|
|
154
|
+
|:---|:---|:---|
|
|
155
|
+
| 1 | `npx archi task --check` | No ERROR-level issues |
|
|
156
|
+
| 2 | `npx archi render` | `.md` views generated |
|
|
157
|
+
|
|
158
|
+
**Output**: Write confirmation.
|
|
159
|
+
</step_4_roadmap_update>
|
|
160
|
+
|
|
161
|
+
<step_5_signoff>
|
|
162
|
+
**Action** (Gate must complete in step_4):
|
|
163
|
+
1. Run `npx archi task` to display task progress overview.
|
|
164
|
+
2. Output summary.
|
|
165
|
+
|
|
166
|
+
**Output**: Requirement decomposition summary, including:
|
|
167
|
+
- **Brief Source Confirmation**: Initiative name and core objective
|
|
168
|
+
- **New Tasks**: Count and phase distribution
|
|
169
|
+
- **Impact on Existing Tasks**: Impact list (if any)
|
|
170
|
+
- **Next Steps**:
|
|
171
|
+
|
|
172
|
+
| Priority | Action | Description |
|
|
173
|
+
|:---|:---|:---|
|
|
174
|
+
| [?UI] Recommended | Run `archi-ui-wireframe` Skill (append mode) | Append screens for new tasks to `ui_concept.html`, sync `ui_context.md` |
|
|
175
|
+
| 1 | `/archi.plan <first pending task ID>` | Deep planning for the first actionable task |
|
|
176
|
+
| 2 | Review roadmap | Confirm dependency relationships and priorities |
|
|
177
|
+
</step_5_signoff>
|
|
178
|
+
|
|
179
|
+
<fallback_interview>
|
|
180
|
+
**Trigger**: Brief file does not exist or is empty.
|
|
181
|
+
**Role**: Product Consultant
|
|
182
|
+
|
|
183
|
+
**Action**:
|
|
184
|
+
1. Inform user that `scope-brief.md` was not found. Suggest:
|
|
185
|
+
- Run `npx archi template scope-brief` to fetch template to project root
|
|
186
|
+
- Fill in and re-run `/archi.scope scope-brief.md`
|
|
187
|
+
- Or continue conversation to provide information via interview
|
|
188
|
+
2. If user chooses to continue conversation, guide in this order:
|
|
189
|
+
a. What do you want to build? (Initiative name, one-line description, motivation)
|
|
190
|
+
b. What tasks does it include? (Specific task list)
|
|
191
|
+
c. What constraints exist? (Out of scope, dependencies, technical limits)
|
|
192
|
+
d. Which existing tasks will be affected?
|
|
193
|
+
3. After collection, write information to `scope-brief.md` (project root), then jump to `<step_1_load>`.
|
|
194
|
+
|
|
195
|
+
> This mode is for backward compatibility; core flow remains Brief-driven.
|
|
196
|
+
</fallback_interview>
|
|
197
|
+
|
|
198
|
+
</protocol_scope>
|