architext 0.0.3 → 0.0.5
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 +56 -1
- package/README.md +94 -12
- package/README.zh-CN.md +94 -12
- package/dist/index.js +43 -39
- package/dist/templates/en/briefs/_base.md +44 -11
- package/dist/templates/en/briefs/_modules.md +31 -4
- package/dist/templates/en/docs/global/api_snapshot.json +24 -0
- package/dist/templates/en/docs/global/command_api.json +26 -0
- package/dist/templates/en/docs/global/env_registry.json +12 -0
- package/dist/templates/en/docs/global/map.json +5 -0
- package/dist/templates/en/docs/global/public_api.json +12 -0
- package/dist/templates/en/docs/prompts/audit.md +80 -94
- package/dist/templates/en/docs/prompts/code.md +100 -109
- package/dist/templates/en/docs/prompts/edit.md +52 -47
- package/dist/templates/en/docs/prompts/fix.md +49 -42
- package/dist/templates/en/docs/prompts/help.md +23 -31
- package/dist/templates/en/docs/prompts/inherit.md +110 -116
- package/dist/templates/en/docs/prompts/map.md +47 -69
- package/dist/templates/en/docs/prompts/plan.md +160 -171
- package/dist/templates/en/docs/prompts/recover.md +48 -0
- package/dist/templates/en/docs/prompts/ref.md +163 -0
- package/dist/templates/en/docs/prompts/remove.md +55 -107
- package/dist/templates/en/docs/prompts/revise.md +63 -106
- package/dist/templates/en/docs/prompts/scope.md +77 -117
- package/dist/templates/en/docs/prompts/start.md +93 -139
- package/dist/templates/en/docs/shared/verify-result-handling.md +6 -0
- package/dist/templates/en/docs/templates/design.template.md +77 -0
- package/dist/templates/en/docs/templates/spec.template.md +60 -25
- package/dist/templates/en/rules/00_system.md +36 -79
- package/dist/templates/en/rules/01_workflow.md +59 -57
- package/dist/templates/en/rules/03_data_governance.md +46 -42
- package/dist/templates/en/skills/archi-data-sync/SKILL.md +83 -0
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +166 -151
- package/dist/templates/en/skills/archi-design-patterns/SKILL.md +140 -0
- package/dist/templates/en/skills/archi-feature-relations/SKILL.md +118 -0
- package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -1
- package/dist/templates/en/skills/archi-plan-options/SKILL.md +4 -3
- package/dist/templates/en/skills/archi-silent-audit/SKILL.md +118 -0
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
- package/dist/templates/zh/briefs/_base.md +46 -14
- package/dist/templates/zh/briefs/_modules.md +29 -2
- package/dist/templates/zh/docs/global/api_snapshot.json +24 -0
- package/dist/templates/zh/docs/global/command_api.json +26 -0
- package/dist/templates/zh/docs/global/data_snapshot.json +0 -1
- package/dist/templates/zh/docs/global/design_tokens.json +0 -1
- package/dist/templates/zh/docs/global/dictionary.json +1 -1
- package/dist/templates/zh/docs/global/env_registry.json +12 -0
- package/dist/templates/zh/docs/global/error_codes.json +0 -8
- package/dist/templates/zh/docs/global/map.json +28 -3
- package/dist/templates/zh/docs/global/public_api.json +12 -0
- 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 +68 -77
- package/dist/templates/zh/docs/prompts/edit.md +44 -39
- package/dist/templates/zh/docs/prompts/fix.md +33 -26
- package/dist/templates/zh/docs/prompts/help.md +13 -21
- package/dist/templates/zh/docs/prompts/inherit.md +81 -87
- package/dist/templates/zh/docs/prompts/map.md +23 -45
- package/dist/templates/zh/docs/prompts/plan.md +134 -146
- package/dist/templates/zh/docs/prompts/recover.md +48 -0
- package/dist/templates/zh/docs/prompts/ref.md +163 -0
- package/dist/templates/zh/docs/prompts/remove.md +31 -83
- package/dist/templates/zh/docs/prompts/revise.md +43 -84
- package/dist/templates/zh/docs/prompts/scope.md +53 -93
- package/dist/templates/zh/docs/prompts/start.md +75 -121
- package/dist/templates/zh/docs/shared/verify-result-handling.md +6 -0
- package/dist/templates/zh/docs/templates/design.template.md +77 -0
- package/dist/templates/zh/docs/templates/spec.template.md +60 -25
- package/dist/templates/zh/rules/00_system.md +37 -80
- package/dist/templates/zh/rules/01_workflow.md +60 -58
- package/dist/templates/zh/rules/02_tech_stack.md +7 -6
- package/dist/templates/zh/rules/03_data_governance.md +43 -39
- package/dist/templates/zh/rules/99_context_glue.md +2 -2
- package/dist/templates/zh/skills/archi-data-sync/SKILL.md +83 -0
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +70 -56
- package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +140 -0
- package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +118 -0
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +26 -25
- package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +118 -0
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
- package/package.json +1 -1
- package/dist/templates/zh-Hant/briefs/_base.md +0 -115
- package/dist/templates/zh-Hant/briefs/_modules.md +0 -173
- package/dist/templates/zh-Hant/docs/global/data_snapshot.json +0 -31
- package/dist/templates/zh-Hant/docs/global/design_tokens.json +0 -135
- package/dist/templates/zh-Hant/docs/global/dictionary.json +0 -35
- package/dist/templates/zh-Hant/docs/global/error_codes.json +0 -19
- package/dist/templates/zh-Hant/docs/global/map.json +0 -94
- package/dist/templates/zh-Hant/docs/global/roadmap.json +0 -39
- package/dist/templates/zh-Hant/docs/global/vision.md +0 -82
- package/dist/templates/zh-Hant/docs/prompts/audit.md +0 -150
- package/dist/templates/zh-Hant/docs/prompts/code.md +0 -160
- package/dist/templates/zh-Hant/docs/prompts/edit.md +0 -87
- package/dist/templates/zh-Hant/docs/prompts/fix.md +0 -86
- package/dist/templates/zh-Hant/docs/prompts/help.md +0 -69
- package/dist/templates/zh-Hant/docs/prompts/inherit.md +0 -270
- package/dist/templates/zh-Hant/docs/prompts/map.md +0 -131
- package/dist/templates/zh-Hant/docs/prompts/plan.md +0 -252
- package/dist/templates/zh-Hant/docs/prompts/remove.md +0 -162
- package/dist/templates/zh-Hant/docs/prompts/revise.md +0 -160
- package/dist/templates/zh-Hant/docs/prompts/scope.md +0 -198
- package/dist/templates/zh-Hant/docs/prompts/start.md +0 -258
- package/dist/templates/zh-Hant/docs/templates/plan.template.json +0 -88
- package/dist/templates/zh-Hant/docs/templates/scope-brief.template.md +0 -58
- package/dist/templates/zh-Hant/docs/templates/spec.template.md +0 -51
- package/dist/templates/zh-Hant/docs/templates/ui.template.md +0 -51
- package/dist/templates/zh-Hant/rules/00_system.md +0 -123
- package/dist/templates/zh-Hant/rules/01_workflow.md +0 -93
- package/dist/templates/zh-Hant/rules/02_tech_stack.md +0 -192
- package/dist/templates/zh-Hant/rules/03_data_governance.md +0 -102
- package/dist/templates/zh-Hant/rules/04_cli_tools.md +0 -50
- package/dist/templates/zh-Hant/rules/90_custom_rules.md +0 -21
- package/dist/templates/zh-Hant/rules/99_context_glue.md +0 -53
- package/dist/templates/zh-Hant/skills/archi-decompose-roadmap/SKILL.md +0 -293
- package/dist/templates/zh-Hant/skills/archi-interview-protocol/SKILL.md +0 -86
- package/dist/templates/zh-Hant/skills/archi-plan-options/SKILL.md +0 -364
- package/dist/templates/zh-Hant/skills/archi-ui-wireframe/SKILL.md +0 -337
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<protocol_ref>
|
|
2
|
+
**Trigger**: `/archi.ref <sub> [args]`
|
|
3
|
+
**Goal**: Manage external knowledge refs (3rd-party APIs, internal SDKs, business rules, etc.); store in `refs/` in structured form; inject into `plan`/`code` on demand.
|
|
4
|
+
|
|
5
|
+
**Subcommands**:
|
|
6
|
+
| Subcommand | Format | Purpose |
|
|
7
|
+
|:---|:---|:---|
|
|
8
|
+
| `add` | `/archi.ref add [input]` | Summarize and store external knowledge (core) |
|
|
9
|
+
| `list` | `/archi.ref list` | List all stored refs |
|
|
10
|
+
| `update` | `/archi.ref update <id>` | Re-summarize specified ref |
|
|
11
|
+
| `remove` | `/archi.ref remove <id>` | Remove specified ref |
|
|
12
|
+
|
|
13
|
+
<meta>
|
|
14
|
+
<style>Analytical, Precise, Context-Aware</style>
|
|
15
|
+
<language>English</language>
|
|
16
|
+
<principles>
|
|
17
|
+
1. **Summarize, Not Copy**: Do not copy full original; must distill into structured summary (key interfaces / constraints / examples) for efficient AI use; compression ratio ≥ 50%.
|
|
18
|
+
2. **Format-Aware**: Auto-select best carrier format (`.md` / `.json` / `.yaml`) by content type; preserve original format semantics.
|
|
19
|
+
3. **Tag-Driven**: Each ref must carry tags for `plan`/`code` to match and inject; no tagless refs.
|
|
20
|
+
4. **Index-First**: All ops must sync `refs/index.json`; AI loads via index on demand; no full scan.
|
|
21
|
+
</principles>
|
|
22
|
+
</meta>
|
|
23
|
+
|
|
24
|
+
<!-- ─── Format selection rules ─── -->
|
|
25
|
+
<format_selection>
|
|
26
|
+
**Format-Aware rules** (referenced during step_3_store):
|
|
27
|
+
|
|
28
|
+
| Content type | Recommended format | Rationale |
|
|
29
|
+
|:---|:---|:---|
|
|
30
|
+
| Web / URL / PDF / plain text | `.md` | Structured summary; highest AI read efficiency |
|
|
31
|
+
| OpenAPI / Swagger spec | `.yaml` | Preserve machine-readable structure; do not convert to .md |
|
|
32
|
+
| JSON Schema / config files | `.json` | Original structured data format optimal |
|
|
33
|
+
| Mixed (many code examples) | `.md` (with code blocks) | Code blocks keep syntax; add explanatory context |
|
|
34
|
+
| User paste (pure Markdown) | `.md` | Same format store; may refine |
|
|
35
|
+
</format_selection>
|
|
36
|
+
|
|
37
|
+
<!-- ═══════════════════════════════════════════════ -->
|
|
38
|
+
<!-- ADD subcommand -->
|
|
39
|
+
<!-- ═══════════════════════════════════════════════ -->
|
|
40
|
+
|
|
41
|
+
<sub_add>
|
|
42
|
+
|
|
43
|
+
<step_0_ingest>
|
|
44
|
+
**Role**: Intelligence Analyst
|
|
45
|
+
**Trigger**: `/archi.ref add [input]`
|
|
46
|
+
**Action**: Parse `[input]` to determine input source.
|
|
47
|
+
|
|
48
|
+
| input form | Handling |
|
|
49
|
+
|:---|:---|
|
|
50
|
+
| Local file path (e.g. `./docs/api.yaml`) | Read file content; record `sourceType: local-file` |
|
|
51
|
+
| URL (e.g. `https://...`) | Fetch page content; record `sourceType: url` |
|
|
52
|
+
| Not provided (conversation mode) | Ask user to paste content or provide path/URL; wait for input; record `sourceType: manual` |
|
|
53
|
+
|
|
54
|
+
Check if `[[__DOCS_DIR__]]/refs/index.json` exists:
|
|
55
|
+
- Exists → read; get existing id list (avoid duplicate names)
|
|
56
|
+
- Not exists → initialize as `{ "refs": [] }`
|
|
57
|
+
|
|
58
|
+
**Output**: Internal (raw content + sourceType + existing id list); proceed to `<step_1_analyze>`.
|
|
59
|
+
</step_0_ingest>
|
|
60
|
+
|
|
61
|
+
<step_1_analyze>
|
|
62
|
+
**Action**:
|
|
63
|
+
1. **Content type identification**: Determine raw content type (per `<format_selection>`); decide recommended storage format.
|
|
64
|
+
2. **Key info extraction**: Core interfaces/endpoints/signatures, params and types, important constraints/limits, auth (if any), typical examples (≤3).
|
|
65
|
+
3. **Info gap identification**: id naming (infer candidate), tags (from standard: `api`/`sdk`/`internal`/`payment`/`auth`/`map`/`notification`/`storage`/custom), focus areas (when content large, confirm user's priority interfaces).
|
|
66
|
+
|
|
67
|
+
**Output**: Internal analysis summary; proceed to `<step_2_interview>` (when gaps) or directly `<step_3_store>` (when complete).
|
|
68
|
+
</step_1_analyze>
|
|
69
|
+
|
|
70
|
+
<step_2_interview>
|
|
71
|
+
**Trigger**: Only when id / tags / focus uncertain.
|
|
72
|
+
**Action**: Ask user; max 3 questions; options preferred.
|
|
73
|
+
|
|
74
|
+
**Output**: Ref info confirmation — include content type and storage format, content summary, Q1 ref ID (AI inferred candidate + custom), Q2 tags (multi-select), (when content large) Q3 focus areas.
|
|
75
|
+
|
|
76
|
+
**Gate**: Wait for user reply before `<step_3_store>`.
|
|
77
|
+
</step_2_interview>
|
|
78
|
+
|
|
79
|
+
<step_3_store>
|
|
80
|
+
**Action**:
|
|
81
|
+
1. Determine storage params: `id` (user confirmed or AI inferred), `format` (from format_selection), `filename: {id}.{format}`, `tags`.
|
|
82
|
+
|
|
83
|
+
2. **Generate ref file content** (by format):
|
|
84
|
+
- **`.md`**: frontmatter (id/title/tags/sourceType/source/created/updated) + 4 sections (core info, key interfaces table, important constraints, examples ≤3)
|
|
85
|
+
- **`.yaml`**: Store trimmed OpenAPI/Swagger (remove redundant example fields; keep schema)
|
|
86
|
+
- **`.json`**: Store original structure (remove comments; keep structure)
|
|
87
|
+
|
|
88
|
+
3. **Write file**: `[[__DOCS_DIR__]]/refs/{id}.{ext}`
|
|
89
|
+
|
|
90
|
+
4. **Update index**: Append to `[[__DOCS_DIR__]]/refs/index.json` refs array (id/title/tags/format/file/sourceType/updatedAt).
|
|
91
|
+
|
|
92
|
+
**Output**:
|
|
93
|
+
```
|
|
94
|
+
ADDED [[__DOCS_DIR__]]/refs/{id}.{ext}
|
|
95
|
+
MODIFIED [[__DOCS_DIR__]]/refs/index.json
|
|
96
|
+
```
|
|
97
|
+
</step_3_store>
|
|
98
|
+
|
|
99
|
+
<step_4_signoff_add>
|
|
100
|
+
**Output**: Add summary — ref ID, storage format and rationale, tags, file path, usage notes (plan: auto-read / code: supplement context / manual ref).
|
|
101
|
+
</step_4_signoff_add>
|
|
102
|
+
|
|
103
|
+
</sub_add>
|
|
104
|
+
|
|
105
|
+
<!-- ═══════════════════════════════════════════════ -->
|
|
106
|
+
<!-- LIST subcommand -->
|
|
107
|
+
<!-- ═══════════════════════════════════════════════ -->
|
|
108
|
+
|
|
109
|
+
<sub_list>
|
|
110
|
+
|
|
111
|
+
**Trigger**: `/archi.ref list`
|
|
112
|
+
**Action**: Read `[[__DOCS_DIR__]]/refs/index.json`.
|
|
113
|
+
|
|
114
|
+
| Condition | Handling |
|
|
115
|
+
|:---|:---|
|
|
116
|
+
| Index missing / refs empty | Prompt "No refs yet; run `/archi.ref add` to add first" |
|
|
117
|
+
| Normal | Display grouped by tags (ID / title / format / updated) |
|
|
118
|
+
|
|
119
|
+
</sub_list>
|
|
120
|
+
|
|
121
|
+
<!-- ═══════════════════════════════════════════════ -->
|
|
122
|
+
<!-- UPDATE subcommand -->
|
|
123
|
+
<!-- ═══════════════════════════════════════════════ -->
|
|
124
|
+
|
|
125
|
+
<sub_update>
|
|
126
|
+
|
|
127
|
+
**Trigger**: `/archi.ref update <id>`
|
|
128
|
+
**Action**:
|
|
129
|
+
1. Find `<id>` in index.json; get `file` and `sourceType`.
|
|
130
|
+
2. If `sourceType` is `url` → re-fetch; `local-file` → re-read; `manual` → prompt paste new content.
|
|
131
|
+
3. Re-run `<step_1_analyze>` + `<step_3_store>` (keep original id/tags/format; refresh content and `updatedAt` only).
|
|
132
|
+
|
|
133
|
+
| Condition | Handling |
|
|
134
|
+
|:---|:---|
|
|
135
|
+
| id not in index.json | Stop — prompt to check id; run `/archi.ref list` to view |
|
|
136
|
+
|
|
137
|
+
</sub_update>
|
|
138
|
+
|
|
139
|
+
<!-- ═══════════════════════════════════════════════ -->
|
|
140
|
+
<!-- REMOVE subcommand -->
|
|
141
|
+
<!-- ═══════════════════════════════════════════════ -->
|
|
142
|
+
|
|
143
|
+
<sub_remove>
|
|
144
|
+
|
|
145
|
+
**Trigger**: `/archi.ref remove <id>`
|
|
146
|
+
**Action**:
|
|
147
|
+
1. Find and remove `<id>` entry from index.json.
|
|
148
|
+
2. Delete corresponding `refs/{id}.{ext}` file.
|
|
149
|
+
3. Update index.json.
|
|
150
|
+
|
|
151
|
+
**Output**:
|
|
152
|
+
```
|
|
153
|
+
REMOVED [[__DOCS_DIR__]]/refs/{id}.{ext}
|
|
154
|
+
MODIFIED [[__DOCS_DIR__]]/refs/index.json
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
| Condition | Handling |
|
|
158
|
+
|:---|:---|
|
|
159
|
+
| id not found | Stop — prompt to check id; run `/archi.ref list` to view |
|
|
160
|
+
|
|
161
|
+
</sub_remove>
|
|
162
|
+
|
|
163
|
+
</protocol_ref>
|
|
@@ -1,161 +1,109 @@
|
|
|
1
1
|
<protocol_remove>
|
|
2
2
|
**Trigger**: `/archi.remove <id>`
|
|
3
|
-
**Goal**:
|
|
3
|
+
**Goal**: Decommission the specified Task from the project — delete docs, code, global refs; ensure zero residue.
|
|
4
4
|
|
|
5
5
|
<meta>
|
|
6
6
|
<style>Surgical, Cautious, Thorough</style>
|
|
7
7
|
<language>English</language>
|
|
8
8
|
<principles>
|
|
9
|
-
1. **Dependency Safety**:
|
|
10
|
-
2. **Confirmation Gate**:
|
|
11
|
-
3. **Zero Residue**: Cleanup must cover all
|
|
12
|
-
4. **No Side Effects**: Only
|
|
9
|
+
1. **Dependency Safety**: When other tasks depend on this Task, must decouple first to continue.
|
|
10
|
+
2. **Confirmation Gate**: Delete is irreversible; must show full impact and get explicit user confirmation.
|
|
11
|
+
3. **Zero Residue**: Cleanup must cover all layers (docs/code/global data/addressing entries).
|
|
12
|
+
4. **No Side Effects**: Only delete target Task content; do not touch unrelated files.
|
|
13
13
|
</principles>
|
|
14
14
|
</meta>
|
|
15
15
|
|
|
16
16
|
<step_1_resolve>
|
|
17
|
-
**Role**: System Analyst
|
|
18
17
|
**Action**:
|
|
19
|
-
1. **Resolve ID**: Parse `<id>` from
|
|
20
|
-
2. **ID Not Found** → Error
|
|
21
|
-
3. **Load
|
|
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
|
|
18
|
+
1. **Resolve ID**: Parse `<id>` from roadmap.json → Task Name, Slug, status.
|
|
19
|
+
2. **ID Not Found** → Error and list available task IDs.
|
|
20
|
+
3. **Load**: task docs directory, roadmap.json (deps), map.json (architecture reg), 99_context_glue.md (associations).
|
|
26
21
|
|
|
27
22
|
**Output**: Target Task info (ID, name, status, associated file count).
|
|
28
23
|
</step_1_resolve>
|
|
29
24
|
|
|
30
25
|
<step_2_impact>
|
|
31
|
-
**
|
|
32
|
-
**Action**: Scan each layer to produce an impact manifest.
|
|
26
|
+
**Action**: Scan layer by layer; generate impact list.
|
|
33
27
|
|
|
34
|
-
### 2.1 Dependency
|
|
28
|
+
### 2.1 Dependency check (blocking)
|
|
35
29
|
|
|
36
|
-
Scan all tasks
|
|
30
|
+
Scan roadmap.json all tasks `deps`; find tasks depending on `<id>`.
|
|
37
31
|
|
|
38
|
-
|
|
|
32
|
+
| Condition | Handling |
|
|
39
33
|
|:---|:---|
|
|
40
|
-
| No downstream deps | Pass
|
|
41
|
-
| Has downstream deps
|
|
42
|
-
| Has downstream deps
|
|
34
|
+
| No downstream deps | Pass |
|
|
35
|
+
| Has downstream deps and `pending`/`blocked` | List; ask: remove dep and continue or abort |
|
|
36
|
+
| Has downstream deps and `active`/`done` | **Block** — must `/archi.edit` to decouple first |
|
|
43
37
|
|
|
44
|
-
### 2.2 Code
|
|
38
|
+
### 2.2 Code file identification
|
|
45
39
|
|
|
46
|
-
Locate code files
|
|
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.
|
|
40
|
+
Locate code files via: context_glue paths, map.json registered modules, plan.json mentioned files, Slug-named or clearly owned files.
|
|
51
41
|
|
|
52
|
-
### 2.3 Global
|
|
42
|
+
### 2.3 Global ref scan
|
|
53
43
|
|
|
54
|
-
| File | Scan
|
|
44
|
+
| File | Scan content |
|
|
55
45
|
|:---|:---|
|
|
56
|
-
| `roadmap.json` | Task entry +
|
|
57
|
-
| `map.json` | Module
|
|
46
|
+
| `roadmap.json` | Task entry + deps refs |
|
|
47
|
+
| `map.json` | Module entry + featureRelations where deleted Task is aggregator |
|
|
58
48
|
| `99_context_glue.md` | Association entries |
|
|
59
|
-
| `dictionary.json` |
|
|
60
|
-
| `error_codes.json` |
|
|
49
|
+
| `dictionary.json` | Exclusive terms (mark only) |
|
|
50
|
+
| `error_codes.json` | Exclusive error codes (mark only) |
|
|
61
51
|
|
|
62
|
-
### 2.4
|
|
52
|
+
### 2.4 Aggregator linkage check
|
|
63
53
|
|
|
64
|
-
|
|
54
|
+
[[SUBAGENT: archi-feature-relations|mode: cleanup, context: Check deleted Task refs in featureRelations; output impact report]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-feature-relations/SKILL.md`, follow mode: cleanup logic)]]
|
|
65
55
|
|
|
66
|
-
|
|
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 |
|
|
56
|
+
### 2.5 Cross-Task refs
|
|
90
57
|
|
|
91
|
-
|
|
92
|
-
- roadmap.json: remove task <id>, clean N deps references
|
|
93
|
-
- map.json: remove N module entries
|
|
94
|
-
- context_glue: remove N associations
|
|
58
|
+
Scan other Tasks' `spec.md`; check refs to deleted Task's interface/components/data. Mark refs as `[Breaking]`.
|
|
95
59
|
|
|
96
|
-
**
|
|
97
|
-
- dictionary.json: [term1], [term2]
|
|
98
|
-
- error_codes.json: [ERR_XXX]
|
|
60
|
+
**Output**: Output decommission impact report to user — include Task status, docs and code to delete (file/source table), global ref cleanup items (roadmap/map/context_glue), (if any) term/error code residue (manual confirm needed), (if any) aggregator linkage table, (if any) cross-Task ref [Breaking] table. End: OK to execute / Abort to cancel.
|
|
99
61
|
|
|
100
|
-
**[
|
|
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.
|
|
62
|
+
**Gate**: Proceed to step_3 only after user replies OK. Re-warn when `[Breaking]` refs exist.
|
|
115
63
|
</step_2_impact>
|
|
116
64
|
|
|
117
65
|
<step_3_execute>
|
|
118
66
|
**Role**: Surgeon
|
|
119
|
-
**Action**: Execute in this order (order
|
|
67
|
+
**Action**: Execute in this order (order immutable).
|
|
120
68
|
|
|
121
|
-
| # |
|
|
69
|
+
| # | Action | Target |
|
|
122
70
|
|:---|:---|:---|
|
|
123
|
-
| 1 | Delete code files/
|
|
124
|
-
| 2 | Delete Task
|
|
125
|
-
| 3 | Update `roadmap.json` | Remove task entry; clean
|
|
126
|
-
| 4 | Update `map.json` | Remove module
|
|
127
|
-
| 5 | Update `99_context_glue.md` | Remove association entries
|
|
71
|
+
| 1 | Delete code files/dirs | Code paths from step_2 |
|
|
72
|
+
| 2 | Delete Task docs dir | `[[__DOCS_DIR__]]/tasks/<id>_<slug>/` |
|
|
73
|
+
| 3 | Update `roadmap.json` | Remove task entry; clean deps refs |
|
|
74
|
+
| 4 | Update `map.json` | Remove module entry + featureRelations entry |
|
|
75
|
+
| 5 | Update `99_context_glue.md` | Remove association entries |
|
|
128
76
|
| 6 | [?exclusive terms] Update `dictionary.json` | Remove or mark deprecated |
|
|
129
|
-
| 7 | [?exclusive codes] Update `error_codes.json` | Remove or mark deprecated |
|
|
130
|
-
| 8 | [?
|
|
77
|
+
| 7 | [?exclusive error codes] Update `error_codes.json` | Remove or mark deprecated |
|
|
78
|
+
| 8 | [?aggregator linkage] Check aggregator code | Confirm refs cleaned |
|
|
131
79
|
|
|
132
|
-
|
|
80
|
+
Record operation log after each step.
|
|
133
81
|
</step_3_execute>
|
|
134
82
|
|
|
135
83
|
<step_4_verify>
|
|
136
|
-
**
|
|
137
|
-
**Terminal Gate** (Do not skip; must complete before step_5 output):
|
|
84
|
+
**Terminal Gate** (do not skip): Standard check (task --check + render).
|
|
138
85
|
| Step | Command | Pass Condition |
|
|
139
86
|
|:---|:---|:---|
|
|
140
|
-
|
|
|
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 |
|
|
87
|
+
| 3 | Run project build command | Zero compile errors; no import/require to deleted module |
|
|
149
88
|
|
|
150
|
-
|
|
89
|
+
If build fails or residual refs found → locate, fix, re-check.
|
|
151
90
|
</step_4_verify>
|
|
152
91
|
|
|
153
92
|
<step_5_summary>
|
|
154
|
-
**
|
|
93
|
+
**Pre-signoff Checklist** (confirm each item before Output):
|
|
94
|
+
□ Code files/directories — deleted (step_3 action #1)
|
|
95
|
+
□ tasks/<id>_<slug>/ doc directory — deleted (step_3 action #2)
|
|
96
|
+
□ roadmap.json — task entry + deps refs — cleaned (step_3 action #3)
|
|
97
|
+
□ map.json — module entry + featureRelations — cleaned (step_3 action #4)
|
|
98
|
+
□ 99_context_glue.md — association entries — cleaned (step_3 action #5)
|
|
99
|
+
□ (if exclusive terms/codes) dictionary.json + error_codes.json — handled
|
|
100
|
+
□ Terminal Gate — project build passes, no residual import refs (step_4)
|
|
101
|
+
|
|
102
|
+
**Output**: Decommission completion summary:
|
|
155
103
|
- **Deleted**: N doc files, N code files
|
|
156
|
-
- **Cleaned**: roadmap / map / context_glue
|
|
157
|
-
- **Build status**:
|
|
158
|
-
- **[?
|
|
104
|
+
- **Cleaned**: refs in roadmap / map / context_glue
|
|
105
|
+
- **Build status**: Pass/Fail
|
|
106
|
+
- **[?if any] Manual follow-up**: Term/error code/cross-Task ref residue
|
|
159
107
|
- **Git Commit Suggestion**: `feat(remove): decommission <ID> <Name>`
|
|
160
108
|
</step_5_summary>
|
|
161
109
|
|
|
@@ -1,160 +1,117 @@
|
|
|
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/02_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
|
+
□ (UI projects only, design system changed) User notified to re-run archi-ui-wireframe
|
|
105
|
+
□ Phase 2 — each affected Task: spec.md updated + plan.json appended Revision Phase
|
|
106
|
+
□ Step 5 Silent Audit — executed, all CRITICAL issues resolved
|
|
107
|
+
□ Consistency confirmed: vision ↔ tech_stack ↔ roadmap ↔ map, no orphan refs (stale terms/paths cleaned)
|
|
148
108
|
|
|
149
|
-
**
|
|
150
|
-
|
|
151
|
-
**
|
|
109
|
+
**Terminal Gate** (do not skip): Standard check (task --check + render).
|
|
110
|
+
|
|
111
|
+
**Action** (after Gate passes):
|
|
112
|
+
1. Output change summary.
|
|
152
113
|
|
|
153
|
-
|
|
154
|
-
| Priority | Action | Description |
|
|
155
|
-
|:---|:---|:---|
|
|
156
|
-
| ... | ... | ... |
|
|
157
|
-
```
|
|
114
|
+
**Output**: Global Revision Summary — global asset changed files list, Task update list and impact summary, audit result, Next Steps table.
|
|
158
115
|
</step_5_summary>
|
|
159
116
|
|
|
160
117
|
</protocol_revise>
|