architext 0.0.4 → 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 +27 -1
- package/README.md +84 -7
- package/README.zh-CN.md +84 -7
- package/dist/index.js +38 -38
- package/dist/templates/en/briefs/_base.md +44 -11
- package/dist/templates/en/briefs/_modules.md +31 -4
- package/dist/templates/en/docs/prompts/audit.md +80 -94
- package/dist/templates/en/docs/prompts/code.md +87 -89
- package/dist/templates/en/docs/prompts/edit.md +47 -51
- 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 +91 -116
- package/dist/templates/en/docs/prompts/map.md +47 -69
- package/dist/templates/en/docs/prompts/plan.md +134 -239
- 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 +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 +89 -129
- 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 +12 -12
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +3 -34
- package/dist/templates/en/skills/archi-design-patterns/SKILL.md +1 -0
- package/dist/templates/en/skills/archi-feature-relations/SKILL.md +4 -4
- 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 +20 -20
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
- package/dist/templates/zh/briefs/_base.md +44 -12
- package/dist/templates/zh/briefs/_modules.md +27 -0
- package/dist/templates/zh/docs/prompts/audit.md +42 -56
- package/dist/templates/zh/docs/prompts/code.md +47 -49
- package/dist/templates/zh/docs/prompts/edit.md +38 -42
- package/dist/templates/zh/docs/prompts/fix.md +30 -29
- package/dist/templates/zh/docs/prompts/help.md +13 -21
- package/dist/templates/zh/docs/prompts/inherit.md +59 -83
- package/dist/templates/zh/docs/prompts/map.md +24 -47
- package/dist/templates/zh/docs/prompts/plan.md +92 -197
- 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 +31 -71
- package/dist/templates/zh/docs/prompts/revise.md +37 -86
- package/dist/templates/zh/docs/prompts/scope.md +51 -91
- package/dist/templates/zh/docs/prompts/start.md +67 -106
- package/dist/templates/zh/rules/00_system.md +18 -91
- package/dist/templates/zh/rules/01_workflow.md +60 -59
- package/dist/templates/zh/rules/03_data_governance.md +41 -68
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +2 -33
- package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +1 -0
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +1 -0
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
<protocol_ref>
|
|
2
2
|
**Trigger**: `/archi.ref <sub> [args]`
|
|
3
|
-
**Goal**: Manage external knowledge
|
|
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
4
|
|
|
5
5
|
**Subcommands**:
|
|
6
6
|
| Subcommand | Format | Purpose |
|
|
7
7
|
|:---|:---|:---|
|
|
8
8
|
| `add` | `/archi.ref add [input]` | Summarize and store external knowledge (core) |
|
|
9
|
-
| `list` | `/archi.ref list` | List all stored
|
|
10
|
-
| `update` | `/archi.ref update <id>` | Re-summarize
|
|
11
|
-
| `remove` | `/archi.ref remove <id>` | Remove
|
|
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
12
|
|
|
13
13
|
<meta>
|
|
14
14
|
<style>Analytical, Precise, Context-Aware</style>
|
|
15
15
|
<language>English</language>
|
|
16
16
|
<principles>
|
|
17
|
-
1. **Summarize, Not Copy**: Do not copy full original
|
|
18
|
-
2. **Format-Aware**:
|
|
19
|
-
3. **Tag-Driven**: Each ref must carry tags for `plan`/`code` to match and inject
|
|
20
|
-
4. **Index-First**: All
|
|
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
21
|
</principles>
|
|
22
22
|
</meta>
|
|
23
23
|
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
|
|
28
28
|
| Content type | Recommended format | Rationale |
|
|
29
29
|
|:---|:---|:---|
|
|
30
|
-
| Web
|
|
30
|
+
| Web / URL / PDF / plain text | `.md` | Structured summary; highest AI read efficiency |
|
|
31
31
|
| OpenAPI / Swagger spec | `.yaml` | Preserve machine-readable structure; do not convert to .md |
|
|
32
|
-
| JSON Schema / config files | `.json` | Original structured data format
|
|
33
|
-
| Mixed (
|
|
34
|
-
| User
|
|
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
35
|
</format_selection>
|
|
36
36
|
|
|
37
37
|
<!-- ═══════════════════════════════════════════════ -->
|
|
@@ -47,117 +47,47 @@
|
|
|
47
47
|
|
|
48
48
|
| input form | Handling |
|
|
49
49
|
|:---|:---|
|
|
50
|
-
| Local file path (e.g. `./docs/api.yaml`) | Read file content
|
|
51
|
-
| URL (e.g. `https://...`) | Fetch page content
|
|
52
|
-
| Not provided (conversation mode) | Ask user to paste content or provide path/URL
|
|
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
53
|
|
|
54
54
|
Check if `[[__DOCS_DIR__]]/refs/index.json` exists:
|
|
55
|
-
- Exists →
|
|
56
|
-
- Not exists →
|
|
55
|
+
- Exists → read; get existing id list (avoid duplicate names)
|
|
56
|
+
- Not exists → initialize as `{ "refs": [] }`
|
|
57
57
|
|
|
58
|
-
**Output**: Internal (raw content + sourceType + existing id list)
|
|
58
|
+
**Output**: Internal (raw content + sourceType + existing id list); proceed to `<step_1_analyze>`.
|
|
59
59
|
</step_0_ingest>
|
|
60
60
|
|
|
61
61
|
<step_1_analyze>
|
|
62
|
-
**Role**: System Analyst
|
|
63
62
|
**Action**:
|
|
64
|
-
1. **Content type identification**: Determine
|
|
65
|
-
2. **Key info extraction**:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- Auth/authorization (if any)
|
|
70
|
-
- Typical usage examples (≤ 3)
|
|
71
|
-
3. **Info gap identification**:
|
|
72
|
-
- id naming (infer a candidate, e.g. `wechat-pay`, pending user confirmation)
|
|
73
|
-
- tags (infer from standard tags: `api` / `sdk` / `internal` / `payment` / `auth` / `map` / `notification` / `storage` / custom)
|
|
74
|
-
- Focus areas (if content is large, confirm which interfaces/features user cares about)
|
|
75
|
-
|
|
76
|
-
**Output**: Internal analysis summary, proceed to `<step_2_interview>` (if gaps) or directly `<step_3_store>` (if complete).
|
|
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).
|
|
77
68
|
</step_1_analyze>
|
|
78
69
|
|
|
79
70
|
<step_2_interview>
|
|
80
|
-
**
|
|
81
|
-
**
|
|
82
|
-
**Action**: Ask user questions, max 3 questions, prefer multiple choice.
|
|
83
|
-
|
|
84
|
-
**Output format**:
|
|
85
|
-
```
|
|
86
|
-
### Reference info confirmation
|
|
87
|
-
|
|
88
|
-
**Content type**: [identified] → will store as [.md / .yaml / .json]
|
|
89
|
-
**Content summary**: [one-sentence description of raw content]
|
|
90
|
-
|
|
91
|
-
**Q1 — Reference ID** (for file naming and reference):
|
|
92
|
-
[A] [AI-inferred candidate] (recommended)
|
|
93
|
-
[B] Custom
|
|
94
|
-
|
|
95
|
-
**Q2 — Tags** (multi-select):
|
|
96
|
-
[A] api [B] sdk [C] internal [D] payment [E] auth [F] Other: ___
|
|
71
|
+
**Trigger**: Only when id / tags / focus uncertain.
|
|
72
|
+
**Action**: Ask user; max 3 questions; options preferred.
|
|
97
73
|
|
|
98
|
-
(
|
|
99
|
-
[A] Keep full [B] Keep only [specific interface list] [C] Custom
|
|
100
|
-
|
|
101
|
-
**INPUT**: Q1 answer | Q2 answer | Q3 answer (if any)
|
|
102
|
-
```
|
|
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.
|
|
103
75
|
|
|
104
76
|
**Gate**: Wait for user reply before `<step_3_store>`.
|
|
105
77
|
</step_2_interview>
|
|
106
78
|
|
|
107
79
|
<step_3_store>
|
|
108
|
-
**Role**: Senior Engineer
|
|
109
80
|
**Action**:
|
|
110
|
-
1. Determine storage params:
|
|
111
|
-
- `id`: User-confirmed value (or AI-inferred)
|
|
112
|
-
- `format`: File extension from `<format_selection>` rules
|
|
113
|
-
- `filename`: `{id}.{format}`
|
|
114
|
-
- `tags`: User-confirmed tags list
|
|
81
|
+
1. Determine storage params: `id` (user confirmed or AI inferred), `format` (from format_selection), `filename: {id}.{format}`, `tags`.
|
|
115
82
|
|
|
116
83
|
2. **Generate ref file content** (by format):
|
|
117
|
-
|
|
118
|
-
**`.
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
id: {id}
|
|
122
|
-
title: {title}
|
|
123
|
-
tags: [{tags}]
|
|
124
|
-
sourceType: url | local-file | manual
|
|
125
|
-
source: {source path or URL, "manual-input" when manual}
|
|
126
|
-
created: {YYYY-MM-DD}
|
|
127
|
-
updated: {YYYY-MM-DD}
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## Core info
|
|
131
|
-
<!-- Base URL, version, auth, etc. -->
|
|
132
|
-
|
|
133
|
-
## Key interfaces
|
|
134
|
-
| Interface/Function | Path/Signature | Description |
|
|
135
|
-
|:---|:---|:---|
|
|
136
|
-
|
|
137
|
-
## Important constraints and caveats
|
|
138
|
-
|
|
139
|
-
## Examples
|
|
140
|
-
<!-- ≤ 3 most representative examples -->
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
**`.yaml` format**: Store original OpenAPI/Swagger content (trim redundant example fields in responses, keep schema structure).
|
|
144
|
-
|
|
145
|
-
**`.json` format**: Store original JSON Schema or config (remove comments, keep structure).
|
|
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)
|
|
146
87
|
|
|
147
88
|
3. **Write file**: `[[__DOCS_DIR__]]/refs/{id}.{ext}`
|
|
148
89
|
|
|
149
|
-
4. **Update index**: Append to `[[__DOCS_DIR__]]/refs/index.json` refs array
|
|
150
|
-
```json
|
|
151
|
-
{
|
|
152
|
-
"id": "{id}",
|
|
153
|
-
"title": "{title}",
|
|
154
|
-
"tags": ["{tags}"],
|
|
155
|
-
"format": "{ext}",
|
|
156
|
-
"file": "{id}.{ext}",
|
|
157
|
-
"sourceType": "url | local-file | manual",
|
|
158
|
-
"updatedAt": "{YYYY-MM-DD}"
|
|
159
|
-
}
|
|
160
|
-
```
|
|
90
|
+
4. **Update index**: Append to `[[__DOCS_DIR__]]/refs/index.json` refs array (id/title/tags/format/file/sourceType/updatedAt).
|
|
161
91
|
|
|
162
92
|
**Output**:
|
|
163
93
|
```
|
|
@@ -167,18 +97,7 @@
|
|
|
167
97
|
</step_3_store>
|
|
168
98
|
|
|
169
99
|
<step_4_signoff_add>
|
|
170
|
-
**Output**: Add summary
|
|
171
|
-
- **Reference ID**: `{id}`
|
|
172
|
-
- **Storage format**: `{ext}` — rationale (one sentence)
|
|
173
|
-
- **Tags**: `[tags]`
|
|
174
|
-
- **File path**: `[[__DOCS_DIR__]]/refs/{id}.{ext}`
|
|
175
|
-
- **How to use**:
|
|
176
|
-
|
|
177
|
-
| Scenario | Description |
|
|
178
|
-
|:---|:---|
|
|
179
|
-
| `/archi.plan <ID>` | When planning involves `[tags]`-related features, AI auto-reads this ref |
|
|
180
|
-
| `/archi.code <ID>` | Injected as supplementary context during coding, provides interface signatures and constraint details |
|
|
181
|
-
| Manual reference | Mention "see `refs/{id}`" in conversation |
|
|
100
|
+
**Output**: Add summary — ref ID, storage format and rationale, tags, file path, usage notes (plan: auto-read / code: supplement context / manual ref).
|
|
182
101
|
</step_4_signoff_add>
|
|
183
102
|
|
|
184
103
|
</sub_add>
|
|
@@ -189,59 +108,45 @@
|
|
|
189
108
|
|
|
190
109
|
<sub_list>
|
|
191
110
|
|
|
192
|
-
**Role**: System Analyst
|
|
193
111
|
**Trigger**: `/archi.ref list`
|
|
194
112
|
**Action**: Read `[[__DOCS_DIR__]]/refs/index.json`.
|
|
195
113
|
|
|
196
114
|
| Condition | Handling |
|
|
197
115
|
|:---|:---|
|
|
198
|
-
| Index missing / refs empty | Prompt "No
|
|
199
|
-
| Normal | Display grouped by tags |
|
|
200
|
-
|
|
201
|
-
**Output**:
|
|
202
|
-
```
|
|
203
|
-
### External knowledge references (N total)
|
|
204
|
-
|
|
205
|
-
#### [tag group name]
|
|
206
|
-
| ID | Title | Format | Updated |
|
|
207
|
-
|:---|:---|:---|:---|
|
|
208
|
-
| wechat-pay | WeChat Pay V3 API | .md | 2025-01-15 |
|
|
209
|
-
| openapi-spec | Internal service OpenAPI | .yaml | 2025-01-10 |
|
|
210
|
-
```
|
|
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) |
|
|
211
118
|
|
|
212
119
|
</sub_list>
|
|
213
120
|
|
|
214
121
|
<!-- ═══════════════════════════════════════════════ -->
|
|
215
|
-
<!-- UPDATE subcommand
|
|
122
|
+
<!-- UPDATE subcommand -->
|
|
216
123
|
<!-- ═══════════════════════════════════════════════ -->
|
|
217
124
|
|
|
218
125
|
<sub_update>
|
|
219
126
|
|
|
220
|
-
**Role**: Senior Engineer
|
|
221
127
|
**Trigger**: `/archi.ref update <id>`
|
|
222
128
|
**Action**:
|
|
223
|
-
1. Find `<id>` in
|
|
224
|
-
2. If `sourceType` is `url` → re-fetch
|
|
225
|
-
3. Re-run `<step_1_analyze>` + `<step_3_store>` (keep original id/tags/format
|
|
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).
|
|
226
132
|
|
|
227
133
|
| Condition | Handling |
|
|
228
134
|
|:---|:---|
|
|
229
|
-
| id not in index.json | Stop — prompt to check id
|
|
135
|
+
| id not in index.json | Stop — prompt to check id; run `/archi.ref list` to view |
|
|
230
136
|
|
|
231
137
|
</sub_update>
|
|
232
138
|
|
|
233
139
|
<!-- ═══════════════════════════════════════════════ -->
|
|
234
|
-
<!-- REMOVE subcommand
|
|
140
|
+
<!-- REMOVE subcommand -->
|
|
235
141
|
<!-- ═══════════════════════════════════════════════ -->
|
|
236
142
|
|
|
237
143
|
<sub_remove>
|
|
238
144
|
|
|
239
|
-
**Role**: System Administrator
|
|
240
145
|
**Trigger**: `/archi.ref remove <id>`
|
|
241
146
|
**Action**:
|
|
242
|
-
1. Find and remove `<id>` from
|
|
147
|
+
1. Find and remove `<id>` entry from index.json.
|
|
243
148
|
2. Delete corresponding `refs/{id}.{ext}` file.
|
|
244
|
-
3. Update
|
|
149
|
+
3. Update index.json.
|
|
245
150
|
|
|
246
151
|
**Output**:
|
|
247
152
|
```
|
|
@@ -251,7 +156,7 @@ MODIFIED [[__DOCS_DIR__]]/refs/index.json
|
|
|
251
156
|
|
|
252
157
|
| Condition | Handling |
|
|
253
158
|
|:---|:---|
|
|
254
|
-
| id not found | Stop — prompt to check id
|
|
159
|
+
| id not found | Stop — prompt to check id; run `/archi.ref list` to view |
|
|
255
160
|
|
|
256
161
|
</sub_remove>
|
|
257
162
|
|
|
@@ -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
|
|