architext 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -1
- package/README.md +93 -14
- package/README.zh-CN.md +92 -14
- package/dist/index.js +53 -39
- package/dist/templates/en/briefs/_base.md +53 -13
- package/dist/templates/en/briefs/_modules.md +31 -4
- package/dist/templates/en/docs/global/error_memory.json +40 -0
- package/dist/templates/en/docs/global/map.json +46 -90
- package/dist/templates/en/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +6 -13
- package/dist/templates/en/{rules/02_tech_stack.md → docs/global/tech_stack.md} +7 -18
- package/dist/templates/en/docs/global/vision.md +1 -1
- package/dist/templates/en/docs/prompts/audit.md +80 -94
- package/dist/templates/en/docs/prompts/code.md +99 -89
- package/dist/templates/en/docs/prompts/edit.md +61 -51
- package/dist/templates/en/docs/prompts/fix.md +59 -43
- package/dist/templates/en/docs/prompts/help.md +23 -31
- package/dist/templates/en/docs/prompts/inherit.md +97 -117
- package/dist/templates/en/docs/prompts/map.md +48 -69
- package/dist/templates/en/docs/prompts/plan.md +141 -240
- package/dist/templates/en/docs/prompts/recover.md +19 -34
- package/dist/templates/en/docs/prompts/ref.md +43 -138
- package/dist/templates/en/docs/prompts/remove.md +63 -110
- package/dist/templates/en/docs/prompts/revise.md +71 -106
- package/dist/templates/en/docs/prompts/scope.md +78 -117
- package/dist/templates/en/docs/prompts/script.md +102 -0
- package/dist/templates/en/docs/prompts/start.md +98 -132
- package/dist/templates/en/docs/prompts/ui.md +113 -0
- package/dist/templates/en/docs/shared/ui-redlines.md +7 -0
- package/dist/templates/en/docs/templates/spec.template.md +1 -1
- package/dist/templates/en/docs/templates/ui.template.md +8 -8
- package/dist/templates/en/rules/00_system.md +268 -117
- package/dist/templates/en/rules/90_custom_rules.md +3 -1
- package/dist/templates/en/skills/archi-data-sync/SKILL.md +37 -23
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +138 -240
- package/dist/templates/en/skills/archi-design-patterns/SKILL.md +6 -1
- package/dist/templates/en/skills/archi-feature-relations/SKILL.md +10 -6
- package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -2
- package/dist/templates/en/skills/archi-plan-options/SKILL.md +77 -301
- package/dist/templates/en/skills/archi-silent-audit/SKILL.md +24 -25
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +175 -305
- package/dist/templates/icon.svg +16 -0
- package/dist/templates/zh/briefs/_base.md +56 -17
- package/dist/templates/zh/briefs/_modules.md +28 -1
- package/dist/templates/zh/docs/global/error_memory.json +40 -0
- package/dist/templates/zh/docs/global/map.json +39 -109
- package/dist/templates/zh/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +0 -7
- package/dist/templates/zh/{rules/02_tech_stack.md → docs/global/tech_stack.md} +9 -20
- package/dist/templates/zh/docs/global/vision.md +1 -1
- package/dist/templates/zh/docs/prompts/audit.md +43 -57
- package/dist/templates/zh/docs/prompts/code.md +66 -56
- package/dist/templates/zh/docs/prompts/edit.md +52 -42
- package/dist/templates/zh/docs/prompts/fix.md +39 -29
- package/dist/templates/zh/docs/prompts/help.md +13 -21
- package/dist/templates/zh/docs/prompts/inherit.md +67 -86
- package/dist/templates/zh/docs/prompts/map.md +28 -50
- package/dist/templates/zh/docs/prompts/plan.md +100 -199
- package/dist/templates/zh/docs/prompts/recover.md +9 -24
- package/dist/templates/zh/docs/prompts/ref.md +11 -106
- package/dist/templates/zh/docs/prompts/remove.md +39 -74
- package/dist/templates/zh/docs/prompts/revise.md +47 -88
- package/dist/templates/zh/docs/prompts/scope.md +52 -91
- package/dist/templates/zh/docs/prompts/script.md +102 -0
- package/dist/templates/zh/docs/prompts/start.md +75 -110
- package/dist/templates/zh/docs/prompts/ui.md +113 -0
- package/dist/templates/zh/docs/shared/ui-redlines.md +7 -0
- package/dist/templates/zh/docs/templates/spec.template.md +1 -1
- package/dist/templates/zh/docs/templates/ui.template.md +8 -8
- package/dist/templates/zh/rules/00_system.md +252 -131
- package/dist/templates/zh/rules/90_custom_rules.md +2 -1
- package/dist/templates/zh/skills/archi-data-sync/SKILL.md +27 -13
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +133 -235
- package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +6 -1
- package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +6 -2
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -2
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +77 -301
- package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +4 -5
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +174 -301
- package/package.json +3 -1
- package/dist/templates/en/rules/01_workflow.md +0 -93
- package/dist/templates/en/rules/03_data_governance.md +0 -102
- package/dist/templates/en/rules/99_context_glue.md +0 -53
- package/dist/templates/zh/rules/01_workflow.md +0 -94
- package/dist/templates/zh/rules/03_data_governance.md +0 -133
- package/dist/templates/zh/rules/99_context_glue.md +0 -53
|
@@ -1,346 +1,247 @@
|
|
|
1
1
|
<protocol_plan>
|
|
2
|
-
**Trigger**: `/archi.plan <ID> [context]`
|
|
3
|
-
**Goal**: Define
|
|
2
|
+
**Trigger**: `/archi.plan <ID> [context]` | Auto-loaded by Workflow Dispatch on natural language trigger
|
|
3
|
+
**Goal**: Define task Spec/UI/Plan through deep architecture interview.
|
|
4
4
|
**Input**:
|
|
5
|
-
- `<ID>` (required):
|
|
6
|
-
- `[context]` (optional): Known context for the task (e.g
|
|
5
|
+
- `<ID>` (required): Existing task ID in Roadmap. Must create via `/archi.scope` or `/archi.inherit` first.
|
|
6
|
+
- `[context]` (optional): Known context for the task (e.g. requirement descriptions, references, constraints). When provided, serves as pre-input for step_2 interview, reducing questions.
|
|
7
7
|
|
|
8
8
|
<constraints_cursor>
|
|
9
|
-
**Mode Lock**: This protocol
|
|
9
|
+
**Mode Lock**: This protocol must run in **Agent Mode (Normal Mode)**. Do not switch to Plan Mode or other read-only modes.
|
|
10
10
|
</constraints_cursor>
|
|
11
11
|
|
|
12
12
|
<meta>
|
|
13
13
|
<style>Architectural, Exhaustive, Strict, Technology-Agnostic</style>
|
|
14
14
|
<language>English</language>
|
|
15
15
|
<principles>
|
|
16
|
-
1. **Global First**:
|
|
17
|
-
2. **AI-Native Perspective**: All option Pros/Cons
|
|
16
|
+
1. **Global First**: Local task birth must accompany global index (Map/Data/Dict) updates.
|
|
17
|
+
2. **AI-Native Perspective**: All option Pros/Cons from AI Agent perspective. Focus: Context Locality, Type Safety, Boilerplate, Ambiguity.
|
|
18
18
|
3. **Flexible Interaction**: Options are heuristic suggestions; support multi-select, hybrid, or custom.
|
|
19
19
|
4. **Audit-Gated**: Only audited docs can be delivered.
|
|
20
|
+
5. **IDE-Native First**: Leverage IDE native capabilities to drive execution rhythm; this protocol defines quality standards and checkpoints, not fight IDE planning/execution mechanisms.
|
|
20
21
|
</principles>
|
|
21
22
|
</meta>
|
|
22
23
|
|
|
23
24
|
<step_1_load>
|
|
24
|
-
**Role**: System Analyst
|
|
25
25
|
**Action**:
|
|
26
|
-
1. **
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
4.5 [?UI] **Read UI Context**: `[[__DOCS_DIR__]]/global/ui_context.md` (if it exists).
|
|
33
|
-
- Look up the screen inventory to locate the screen IDs (e.g. S-03) for this task and their state coverage.
|
|
34
|
-
- Lock the screen scope to fill in `ui.md §1` in step_4; do not invent new screen IDs.
|
|
35
|
-
- If `ui_context.md` does not exist → skip; write `ui.md` in full ITP format.
|
|
36
|
-
5. [?Data] **Read Data Model**: `[[__DOCS_DIR__]]/global/data_snapshot.json`.
|
|
37
|
-
6. **Read Dependency Context** (if dependent tasks exist):
|
|
38
|
-
- Read only the Interface/Type definitions section of the dep's `spec.md` (`## Interface` or `## Types` chapter); skip Scenarios and other content.
|
|
39
|
-
- Execute only when a `ref: tasks/<dep_id>/spec.md#X` reference appears in the current spec/plan; skip if no reference found.
|
|
40
|
-
- **Stub Compatibility**: If a dependency's Spec-Status is Stub, extract source files from the stub's "Associated Files", read entry files to extract public interfaces/exported types as upstream interface reference.
|
|
41
|
-
- Avoid re-defining upstream interfaces; ensure integration points are precisely aligned.
|
|
42
|
-
7. **Read Refs** (if any): Read `[[__DOCS_DIR__]]/refs/index.json` (if exists).
|
|
43
|
-
- Match relevant ref entries by tags and current task description semantics.
|
|
44
|
-
- Load only matched ref files (`[[__DOCS_DIR__]]/refs/{id}.{ext}`); skip unrelated entries.
|
|
45
|
-
- If `refs/index.json` does not exist or refs is empty → skip.
|
|
46
|
-
|
|
47
|
-
**Output**: Present a **Task Context Brief** to the user:
|
|
48
|
-
```
|
|
49
|
-
### Task Context: [Task Name] ([ID])
|
|
50
|
-
|
|
51
|
-
**Task Type**: [Inferred from ID prefix: Infrastructure / Feature / Quality / Edit]
|
|
52
|
-
**Goal**: [roadmap task's goal; highlight any [User Presets] if present]
|
|
53
|
-
**Upstream Dependencies**: [completed dependency tasks and their key interfaces/types, or "None"]
|
|
54
|
-
**Project Features**: [activated UI/Data/CLI/Lib/API tags]
|
|
55
|
-
**Technical Constraints**: [key red lines from 02_tech_stack.md]
|
|
56
|
-
**Design Philosophy**: [North Star Metric and design principles from vision.md]
|
|
57
|
-
**Project Conventions**: [from 02_tech_stack.md §9 — Error Handling: X | Data Flow: X | Auth: X, or "Not set" if absent]
|
|
58
|
-
**External knowledge refs**: [matched ref ids, e.g. `wechat-pay`, `company-sdk`; or "None"]
|
|
59
|
-
```
|
|
60
|
-
Retain full context materials internally, proceed to step_2.
|
|
26
|
+
1. **Pre-flight**: Read roadmap.json; read only `<ID>` entry and direct deps' `id/title/status`; reject if deps incomplete (unless user forces).
|
|
27
|
+
2. **Load**: vision.md (North Star + design philosophy only), tech_stack.md (red lines + §9 project conventions; extract Error Handling/Data Flow/Auth inheritance), (UI projects only) design_tokens.json + ui_context.md (locate screen IDs, lock scope for step_4; do not invent new IDs; skip if absent), (Data projects only) data_snapshot.json.
|
|
28
|
+
3. **Dependency Context** (when deps exist): Read only dep task spec.md Interface/Type section; skip if no ref. Stub dep → extract public interfaces from associated files.
|
|
29
|
+
4. **Refs** (if any): Read refs/index.json; match by tag semantics; load only matched ref files; skip if absent.
|
|
30
|
+
|
|
31
|
+
**Output**: Output **Task Context Brief** to user — include task type (from ID prefix), goal (highlight [User Preset]), upstream deps and key interfaces, project feature tags, tech constraints, design philosophy, project conventions (§9 values, or "not set"), external ref ids (matched). Retain full context internally; enter step_2_complexity.
|
|
61
32
|
</step_1_load>
|
|
62
33
|
|
|
63
|
-
<
|
|
64
|
-
**Role**: Product Consultant
|
|
34
|
+
<step_2_complexity>
|
|
65
35
|
**Action**: Detect task type, assess complexity, decide flow path.
|
|
66
36
|
|
|
67
|
-
**⓪ Task Type
|
|
68
|
-
|
|
69
|
-
Infer task type from `<ID>` prefix; applies to all subsequent steps:
|
|
70
|
-
|
|
71
|
-
| ID Prefix | Task Type | spec § 2 Primary Dimension | spec § 4 Interface Exports |
|
|
72
|
-
|:---|:---|:---|:---|
|
|
73
|
-
| `INF-` | Infrastructure | Structural (config contracts) | **Required** (downstream infrastructure) |
|
|
74
|
-
| `FEAT-` | Feature | Behavioral (behavior scenarios) | Required when has downstream deps |
|
|
75
|
-
| `POLISH-` | Quality | Quantitative (quality targets) | Usually omit |
|
|
76
|
-
| `EDIT-` | Edit | Inherit from original task | Inherit |
|
|
37
|
+
**⓪ Task Type + granularity red lines**:
|
|
77
38
|
|
|
78
|
-
|
|
39
|
+
| ID Prefix | Task Type | spec § 2 Primary Dimension | § 4 Interface | AC Cap | Phase Cap |
|
|
40
|
+
|:---|:---|:---|:---|:---|:---|
|
|
41
|
+
| `INF-` | Infrastructure | Structural (config contracts) | **Required** | ≤ 8 Contracts | ≤ 5 |
|
|
42
|
+
| `FEAT-` | Feature | Behavioral (scenarios) | Required when has downstream deps | ≤ 6 Scenarios | ≤ 4 |
|
|
43
|
+
| `POLISH-` | Quality | Quantitative (targets) | Usually omit | ≤ 4 Targets | ≤ 3 |
|
|
44
|
+
| `EDIT-` | Edit | Inherit from original | Inherit | Inherit | Inherit |
|
|
79
45
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
| Task Type | Acceptance Criteria item cap | plan.json Phase cap |
|
|
83
|
-
|:---|:---|:---|
|
|
84
|
-
| Feature | ≤ 6 Scenarios | ≤ 4 |
|
|
85
|
-
| Infrastructure | ≤ 8 Contracts | ≤ 5 |
|
|
86
|
-
| Quality | ≤ 4 Targets | ≤ 3 |
|
|
46
|
+
> Mixed tasks may combine dimensions in § 2 with sub-headings. Trigger split when estimate exceeds cap.
|
|
87
47
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
**② Complexity verdict (after granularity passes)**:
|
|
48
|
+
**① Complexity verdict**:
|
|
91
49
|
|
|
92
50
|
| Signal | Verdict | Flow |
|
|
93
51
|
|:---|:---|:---|
|
|
94
|
-
| No deps + no new entities + no
|
|
95
|
-
| Has deps OR new entities OR
|
|
96
|
-
|
|
97
|
-
**Simple Mode**:
|
|
98
|
-
- Skip 5-dimension architecture recommendations and User Confirm Gate
|
|
99
|
-
- spec condensed to 1-2 Acceptance Criteria items (format by Task Type)
|
|
100
|
-
- plan condensed to a single Phase
|
|
101
|
-
- Confirm at signoff (replacing step_2 Gate)
|
|
52
|
+
| No deps + no new entities + no arch decision + estimated ≤3 tasks | **Simple** | Skip step_2; generate spec + plan directly (condensed single Phase; confirm at signoff) |
|
|
53
|
+
| Has deps OR new entities OR arch decision needed | **Standard** | Execute step_2 Unified Proposal normally |
|
|
102
54
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
For Standard tasks, detect whether to generate `design.md` (technical design):
|
|
55
|
+
**② Design signal detection** (after Standard):
|
|
106
56
|
|
|
107
57
|
| Signal | Verdict |
|
|
108
58
|
|:---|:---|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
> When Standard + Design: step_2 must output mechanism preview (Part 1.5); step_4 must additionally generate `design.md`.
|
|
114
|
-
</step_1_5_complexity>
|
|
59
|
+
| AI- contains complexity warning OR involves custom state machine / non-trivial algorithm / multi-component coordination / retry recovery | **Standard + Design** (step_2 output mechanism preview; step_4 add design.md) |
|
|
60
|
+
| Standard CRUD / config / simple integration | **Standard** |
|
|
61
|
+
</step_2_complexity>
|
|
115
62
|
|
|
116
|
-
<
|
|
63
|
+
<step_3_interview>
|
|
117
64
|
**Role**: Architect
|
|
118
65
|
|
|
119
66
|
---
|
|
120
67
|
|
|
121
|
-
### Unified Proposal
|
|
68
|
+
### Unified Proposal (one-shot)
|
|
122
69
|
|
|
123
|
-
**Core principle**: Merge task design and architecture decisions into **one
|
|
70
|
+
**Core principle**: Merge task design and architecture decisions into **one output**; user confirms or overrides in one round.
|
|
124
71
|
|
|
125
72
|
**Action**:
|
|
126
73
|
|
|
127
74
|
#### Part 1: Task Design
|
|
128
75
|
|
|
129
|
-
AI **
|
|
76
|
+
AI **decides which modules to output** by task nature; select from:
|
|
130
77
|
|
|
131
78
|
| Material | When applicable |
|
|
132
79
|
|:---|:---|
|
|
133
80
|
| Flow description (user journey / system flow / command flow) | Multi-step interaction or processing chain |
|
|
134
|
-
| Core entities
|
|
135
|
-
| Touchpoints (
|
|
136
|
-
| Pre-defined decisions | When goal
|
|
81
|
+
| Core entities and data | New or modified entities; existing use `→ ref: data_snapshot.json#EntityName` |
|
|
82
|
+
| Touchpoints (page / command / endpoint / method) | User-facing or external surface |
|
|
83
|
+
| Pre-defined decisions | When goal has `[User Preset]` → highlight and enforce strictly |
|
|
137
84
|
|
|
138
85
|
**Reference rules**:
|
|
139
|
-
- Entities/types
|
|
140
|
-
- Design philosophy/principles → `ref: vision.md#PrincipleName
|
|
86
|
+
- Entities/types in global → `ref: data_snapshot.json#X`; only describe **additions or changes** for this task
|
|
87
|
+
- Design philosophy/principles → `ref: vision.md#PrincipleName`; no restatement
|
|
141
88
|
- Upstream interfaces → `ref: tasks/<dep_ID>/spec.md#InterfaceName`
|
|
142
89
|
- Existing design tokens/components → `ref: design_tokens.json#preset` / `ref: dictionary.json#component`
|
|
143
90
|
|
|
144
|
-
**Universal requirement**: Use this task's
|
|
145
|
-
|
|
91
|
+
**Universal requirement**: Use this task's concrete entity names and operation names; no generics
|
|
146
92
|
|
|
147
93
|
#### Part 2: Architecture Recommendations
|
|
148
94
|
|
|
149
|
-
[[SKILL: archi-plan-options|Follow the skill's three-step selection
|
|
150
|
-
|
|
151
|
-
When expanding a Q-table, follow the format in [[SKILL: archi-interview-protocol|the skill's standard output format]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-interview-protocol/SKILL.md` and follow its rules)]].
|
|
95
|
+
[[SKILL: archi-plan-options|Follow the skill's three-step selection (convention inheritance → tag routing → recommend vs expand) to generate arch recommendations from five dimensions.]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-plan-options/SKILL.md` and follow its three-step logic)]]
|
|
152
96
|
|
|
153
|
-
|
|
97
|
+
When expanding Q-table, follow [[SKILL: archi-interview-protocol|skill's standard output format]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-interview-protocol/SKILL.md` and follow its rules)]].
|
|
154
98
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
```
|
|
158
|
-
### Mechanism Preview (will generate design.md)
|
|
159
|
-
| Mechanism | Pattern | Brief |
|
|
160
|
-
|:---|:---|:---|
|
|
161
|
-
| [name] | [State Machine / Pipeline / Decision Matrix / Protocol] | [one-sentence description] |
|
|
162
|
-
```
|
|
99
|
+
#### Part 1.5: Mechanism Preview (Complex tasks only)
|
|
163
100
|
|
|
164
|
-
|
|
101
|
+
Output only when step_1_5 verdict is **Standard + Design**. List core mechanisms needing design and intended pattern (Mechanism / Pattern / Brief table). User may add/remove mechanisms or change pattern.
|
|
165
102
|
|
|
166
103
|
#### Output Format
|
|
167
104
|
|
|
168
|
-
|
|
169
|
-
## Task Proposal: [Task Name] ([ID])
|
|
170
|
-
|
|
171
|
-
### Task Design
|
|
172
|
-
[Output per complexity level, see Part 1 above]
|
|
173
|
-
|
|
174
|
-
### Architecture Recommendations
|
|
175
|
-
| Dimension | Recommended | Source | Rationale |
|
|
176
|
-
|:---|:---|:---|:---|
|
|
177
|
-
| Core Structure | [Recommended option] | Task | [1-2 sentences specific to this task] |
|
|
178
|
-
| Interaction Pattern | [Recommended option] | Task | [Rationale] |
|
|
179
|
-
| Error Handling | [Convention value] | Project Convention | ref: 02_tech_stack.md §9 |
|
|
180
|
-
| ... | ... | ... | ... |
|
|
181
|
-
|
|
182
|
-
[Only when Standard + Design]:
|
|
183
|
-
### Mechanism Preview (will generate design.md)
|
|
184
|
-
| Mechanism | Pattern | Brief |
|
|
185
|
-
|:---|:---|:---|
|
|
186
|
-
| ... | ... | ... |
|
|
105
|
+
Output **Task Proposal** including: task design (per Part 1), architecture table (dimension/recommendation/source/rationale), (Standard+Design only) mechanism preview table, (dimensions needing user decision only) expanded Q-table (ID/option/description/AI+/AI-, A recommended, Z custom). End with confirmation: OK to accept all; or annotate changes (design fix / dimension override / answer / mechanism change).
|
|
187
106
|
|
|
188
|
-
|
|
189
|
-
**[Q<n>] Question title**
|
|
190
|
-
> Why user decision is needed (one sentence)
|
|
107
|
+
**Goal**: Lock `spec`, `ui` (if applicable), `data_snapshot.json` (if applicable).
|
|
191
108
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
| A [Recommended] | ... | Concrete behavior (2-3 sentences) | Full sentence | Full sentence |
|
|
195
|
-
| B | ... | ... | ... | ... |
|
|
196
|
-
| Z | Custom | (Describe) | - | - |
|
|
109
|
+
**⌨️ INPUT**: Reply **OK** to accept all (→ enter step_4_global_sync); or free-text changes (→ enter step_3_5_refinement). No fixed format.
|
|
110
|
+
</step_3_interview>
|
|
197
111
|
|
|
198
|
-
|
|
199
|
-
> Reply **OK** to accept all recommendations; or annotate what to change, e.g.:
|
|
200
|
-
> - Design correction: "Registration doesn't need email verification step"
|
|
201
|
-
> - Dimension override: "Core Structure=C, Error Handling=B D"
|
|
202
|
-
> - Question answer: "Q1=B"
|
|
203
|
-
> - Mechanism change: "Remove Pipeline, reconnection doesn't need that complexity"
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
**⌨️ INPUT**: Reply **OK** to accept all; or free-text annotations for changes. No fixed format required.
|
|
207
|
-
</step_2_interview>
|
|
208
|
-
|
|
209
|
-
<step_2_5_refinement>
|
|
210
|
-
**Role**: Consultant
|
|
112
|
+
<step_3_5_refinement>
|
|
211
113
|
**Trigger**: User reply is not OK — contains corrections, questions, overrides, or logic conflicts.
|
|
212
|
-
**Action**: Do
|
|
114
|
+
**Action**: Do not generate docs. Incorporate feedback, refresh Unified Proposal and re-output; await re-confirmation.
|
|
213
115
|
- If task design question → Compare alternatives, re-propose design
|
|
214
|
-
- If architecture dimension question → Explain differences in this task
|
|
116
|
+
- If architecture dimension question → Explain differences in this task context, update recommendation
|
|
215
117
|
- If dimension override → Replace recommendation directly and adjust related design
|
|
216
|
-
</step_2_5_refinement>
|
|
217
118
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
119
|
+
User replies OK → enter step_4_global_sync.
|
|
120
|
+
</step_3_5_refinement>
|
|
121
|
+
|
|
122
|
+
<step_4_global_sync>
|
|
123
|
+
**Constraint**: Must update the following global files **before** generating Task docs.
|
|
221
124
|
|
|
222
|
-
**Boundary**: Only register **project business domain** content. Architext framework concepts (scripts, scaffold, roadmap, plan, etc.) and framework
|
|
125
|
+
**Boundary**: Only register **project business domain** content. Architext framework concepts (scripts, scaffold, roadmap, plan, etc.) and framework infra errors must not be registered.
|
|
223
126
|
|
|
224
127
|
**Action Checklist**:
|
|
225
128
|
1. **`map.json`**: Register `[[__DOCS_DIR__]]/tasks/<ID>_<Slug>` in `directoryMapping`; define module responsibility and dependencies in `logicalTopology`.
|
|
226
|
-
2. **Data governance sync
|
|
227
|
-
3. **`map.json` featureRelations**: [[SUBAGENT: archi-feature-relations|mode: register, context: Determine if this Task is aggregator; if yes
|
|
129
|
+
2. **Data governance sync**: [[SUBAGENT: archi-data-sync|context: Scan Task proposal for new business entities/error codes/Schema/endpoints/commands/exports, incrementally sync per 00_system.md]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-data-sync/SKILL.md`, follow its execution protocol)]]
|
|
130
|
+
3. **`map.json` featureRelations**: [[SUBAGENT: archi-feature-relations|mode: register, context: Determine if this Task is aggregator; if yes register featureRelations entry]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-feature-relations/SKILL.md`, follow mode: register logic)]]
|
|
228
131
|
|
|
229
|
-
**Output**:
|
|
230
|
-
</
|
|
132
|
+
**Output**: Diff summary of above files. Enter step_5_generate.
|
|
133
|
+
</step_4_global_sync>
|
|
231
134
|
|
|
232
|
-
<
|
|
233
|
-
**
|
|
234
|
-
**Input**: Confirmed Unified Proposal (task design + architecture recommendations) + updated global context + Task Type from step_1_5.
|
|
135
|
+
<step_5_generate>
|
|
136
|
+
**Input**: Confirmed Unified Proposal (task design + arch recommendations) + updated global context + step_1_5 Task Type.
|
|
235
137
|
**Action**: Generate standard docs under `[[__DOCS_DIR__]]/tasks/<ID>_<Slug>/`.
|
|
236
138
|
|
|
237
|
-
**1. `spec.md`** (
|
|
139
|
+
**1. `spec.md`** (required):
|
|
238
140
|
- Template: `templates/spec.template.md`.
|
|
239
141
|
|
|
240
|
-
**spec § 2
|
|
142
|
+
**spec § 2 format by Task Type**:
|
|
241
143
|
|
|
242
144
|
| Task Type | § 2 Primary Dimension | Format requirement |
|
|
243
145
|
|:---|:---|:---|
|
|
244
|
-
| Feature | Behavioral | Gherkin (Given/When/Then); each Scenario maps to concrete flow step or exception path
|
|
245
|
-
| Infrastructure | Structural | Configuration Contract per config file/service (Path + Key Settings + Constraints + Verify). Key Settings **must state concrete values**; no generic descriptions
|
|
246
|
-
| Quality | Quantitative | Quality Target; each
|
|
146
|
+
| Feature | Behavioral | Gherkin (Given/When/Then); each Scenario maps to concrete flow step or exception path in task design |
|
|
147
|
+
| Infrastructure | Structural | Configuration Contract; one per config file/service (Path + Key Settings + Constraints + Verify). Key Settings **must state concrete values**; no generic descriptions |
|
|
148
|
+
| Quality | Quantitative | Quality Target; each goal has Metric + Baseline + Target + Verify |
|
|
247
149
|
| Edit | Inherit from original | Same as original task type |
|
|
248
150
|
|
|
249
|
-
> Mixed tasks use sub-headings in § 2 to distinguish dimensions
|
|
151
|
+
> Mixed tasks use sub-headings in § 2 to distinguish dimensions.
|
|
250
152
|
|
|
251
|
-
**spec § 4 Interface Exports**: INF
|
|
252
|
-
**spec § 5 Constraints**: **Required** — extract relevant red lines from vision.md +
|
|
153
|
+
**spec § 4 Interface Exports**: INF **required**; FEAT required when has downstream deps.
|
|
154
|
+
**spec § 5 Constraints**: **Required** — extract relevant red lines from vision.md + tech_stack.md.
|
|
253
155
|
|
|
254
156
|
**General rules**:
|
|
255
|
-
- Do not invent
|
|
157
|
+
- Do not invent AC items; each must map to concrete content in task design.
|
|
256
158
|
- If upstream task, must include explicit Interface/Type definitions in § 4.
|
|
257
159
|
|
|
258
|
-
**2. `ui.md`**
|
|
160
|
+
**2. `ui.md`** (when this task involves UI):
|
|
259
161
|
- Template: `templates/ui.template.md`.
|
|
260
162
|
- **With `ui_context.md` (primary path)**:
|
|
261
|
-
1. **UI
|
|
163
|
+
1. **UI divergence check** (required before writing `ui.md`): Compare task design with screen index; identify divergence. [[SKILL: archi-ui-wireframe|Follow skill protocol to handle UI divergence]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and follow its protocol)]].
|
|
262
164
|
|
|
263
|
-
| Divergence
|
|
165
|
+
| Divergence Type | Criteria | Handling |
|
|
264
166
|
|:---|:---|:---|
|
|
265
|
-
| No divergence | Screen index matches design | Write `ui.md` directly
|
|
266
|
-
| Minor addition | New state
|
|
267
|
-
| Structural divergence | Layout
|
|
268
|
-
|
|
269
|
-
2. After resolving divergence, fill
|
|
270
|
-
- **Without `ui_context.md` (fallback
|
|
271
|
-
|
|
272
|
-
**3. `design.md
|
|
273
|
-
- Template: `templates/design.template.md`.
|
|
274
|
-
-
|
|
275
|
-
- §
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
280
|
-
|
|
281
|
-
**
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
**
|
|
287
|
-
|
|
288
|
-
**Principle 1 — Deliverable-oriented**: Each task `title` describes **deliverable** not activity.
|
|
289
|
-
> ✅ Good: `apps/web/tsconfig.json — strict + path aliases`
|
|
290
|
-
> ❌ Bad: `Configure TypeScript`
|
|
291
|
-
|
|
292
|
-
**Principle 2 — 100% coverage**: After generation, verify coverage:
|
|
293
|
-
| Check | Rule |
|
|
294
|
-
|:---|:---|
|
|
295
|
-
| Each spec § 2 Acceptance Criteria item | Must have ≥1 task covering it |
|
|
296
|
-
| Each spec § 4 Interface Export | Must have task responsible for creating/exposing it |
|
|
297
|
-
| Each spec § 5 Constraint | Must be referenced in some task's notes |
|
|
298
|
-
Add tasks until 100% covered.
|
|
167
|
+
| No divergence | Screen index matches design | Write `ui.md` directly; reference screen ID |
|
|
168
|
+
| Minor addition | New state/popup/local area; overall layout unchanged | Run `/archi.ui` to update `screens/S-XX.html` + `ui_context.md`; note `MODIFIED: screens/S-XX.html` |
|
|
169
|
+
| Structural divergence | Layout refactor, new standalone screen, flow path change | **Pause** — output divergence summary to user; wait for **OK**; then call skill to update; then write `ui.md` |
|
|
170
|
+
|
|
171
|
+
2. After resolving divergence, fill screen scope and delta components per `ui.template.md`.
|
|
172
|
+
- **Without `ui_context.md` (fallback)**: Describe full ITP v3.0 component tree; reference `design_tokens.json` token definitions.
|
|
173
|
+
|
|
174
|
+
**3. Complex tasks only: `design.md`**:
|
|
175
|
+
- Template: `templates/design.template.md`. Generate only when **Standard + Design**.
|
|
176
|
+
- § 2 Core Mechanisms: Per confirmed mechanism preview, call [[SKILL: archi-design-patterns|skill pattern selection guide and standard format to generate mechanism description and run self-check]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-design-patterns/SKILL.md` and follow its pattern format and self-check list)]].
|
|
177
|
+
- § 3 Parameters: Values must be concrete; no vagueness. § 4 Invariants: Must be testable; map to plan.json test entries. § 5 Failure Modes: Must have detection + fallback. § 6 Trace Verification: Trace from each spec § 2 AC to design path; fix gaps.
|
|
178
|
+
|
|
179
|
+
**4. `plan.json`** (required):
|
|
180
|
+
- Template: `templates/plan.template.json`. Adjust Phases by project type; each Task context self-contained.
|
|
181
|
+
- Each Phase must include a `rationale` field recording key design decision rationale (user choice / AI recommendation reason).
|
|
182
|
+
|
|
183
|
+
**WBS decomposition three principles**:
|
|
184
|
+
|
|
185
|
+
**Principle 1 — Deliverable-oriented**: Each task `title` describes **deliverable**, not activity.
|
|
186
|
+
> Red Flag: `Configure TypeScript` ← should be `apps/web/tsconfig.json — strict + path aliases`
|
|
187
|
+
|
|
188
|
+
**Principle 2 — 100% coverage**: Each spec § 2 AC → ≥1 task covers; each § 4 Interface → task creates; each § 5 Constraint → task notes references. Add if missing.
|
|
299
189
|
|
|
300
190
|
**Principle 3 — Granularity and mutual exclusion**:
|
|
301
191
|
| Signal | Verdict |
|
|
302
192
|
|:---|:---|
|
|
303
|
-
| Task
|
|
304
|
-
|
|
|
305
|
-
| Two tasks modify same file same region | Violates mutual exclusion — merge or redraw
|
|
306
|
-
|
|
|
307
|
-
|
|
308
|
-
**`decisions` quality
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
-
|
|
315
|
-
|
|
316
|
-
> ✅ Good: `Create apps/web/next.config.ts · spec §2.2 · transpilePackages: ['@repo/ui'], output: 'standalone' · no CSS-in-JS · Verify: pnpm --filter web build succeeds (exit 0)`
|
|
317
|
-
> ❌ Bad: `Configure Next.js · spec §2.2` ← no concrete content, constraints, or verification
|
|
318
|
-
> ❌ Bad: `Create file · spec §2.1 · Verify: check file exists` ← "check file exists" not executable
|
|
319
|
-
> **Red Flag**: notes degenerate to title synonym. Each notes must contain information **not present** in title.
|
|
320
|
-
|
|
321
|
-
- Run `npx archi render` after generation to produce readable `.md` view.
|
|
322
|
-
</step_4_generate>
|
|
323
|
-
|
|
324
|
-
<step_5_verify>
|
|
325
|
-
**Role**: Independent Reviewer
|
|
193
|
+
| Task touches ≥3 unrelated files | Too coarse — split |
|
|
194
|
+
| Title cannot map to concrete output file | Too abstract — concretize |
|
|
195
|
+
| Two tasks modify same file same region | Violates mutual exclusion — merge or redraw |
|
|
196
|
+
| Notes single sentence with no verification | Insufficient — supplement |
|
|
197
|
+
|
|
198
|
+
**`decisions` quality**: `rationale` must include implementation guidance; not just "why choose" but "how to configure".
|
|
199
|
+
> Red Flag: `Brief explicitly requires` ← zero implementation guidance
|
|
200
|
+
|
|
201
|
+
**`notes` quality**: Format `[output file path] · [spec ref] · [key constraints] · Verify: [executable command + expected result]`. Do not leave empty.
|
|
202
|
+
> Red Flag: notes degenerate to title synonym. Each notes must contain information **not in** title.
|
|
203
|
+
|
|
204
|
+
- Run `npx archi render` after generation to produce readable `.md` views. Enter step_6_verify.
|
|
205
|
+
</step_5_generate>
|
|
326
206
|
|
|
327
|
-
|
|
207
|
+
<step_6_verify>
|
|
208
|
+
**Role**: Independent Reviewer
|
|
209
|
+
[[SUBAGENT: archi-silent-audit|mode: plan-docs, context: Review step_4 generated docs (spec.md, ui.md, plan.json, design.md)]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`, follow mode: plan-docs review dimension table)]]
|
|
328
210
|
|
|
329
211
|
[[INCLUDE: shared/verify-result-handling.md]]
|
|
330
|
-
</
|
|
212
|
+
</step_6_verify>
|
|
331
213
|
|
|
332
|
-
<
|
|
333
|
-
**Terminal Gate** (
|
|
214
|
+
<step_7_signoff>
|
|
215
|
+
**Terminal Gate** (do not skip): Standard check (task --check + render).
|
|
334
216
|
| Step | Command | Pass Condition |
|
|
335
217
|
|:---|:---|:---|
|
|
336
|
-
| 1 | `npx archi task --
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
218
|
+
| 1 | `npx archi task <ID> --status active` | Task marked as in-progress |
|
|
219
|
+
|
|
220
|
+
**Pre-signoff Checklist** (confirm each item after Gate passes, before Output):
|
|
221
|
+
□ spec.md § 2 — ACs/scenarios/contracts map to specific design content (no fabrication)
|
|
222
|
+
□ spec.md § 4 Interface — filled (required for INF tasks / tasks with downstream deps)
|
|
223
|
+
□ spec.md § 5 Constraints — extracted from vision + tech_stack (not empty)
|
|
224
|
+
□ plan.json — every AC in spec § 2 → ≥1 task covering it (100% coverage rule)
|
|
225
|
+
□ plan.json — every task notes includes verification field (not empty, not title paraphrase)
|
|
226
|
+
□ map.json — tasks/<ID>_<Slug> registered in directoryMapping
|
|
227
|
+
□ Global files — new terms/error codes/schemas/Tokens/env vars synced:
|
|
228
|
+
- dictionary.json + error_codes.json + env_registry.json — required
|
|
229
|
+
- (UI projects only) design_tokens.json + ui_context.md
|
|
230
|
+
- (Data projects only) data_snapshot.json
|
|
231
|
+
- (API projects only) api_snapshot.json
|
|
232
|
+
- (CLI projects only) command_api.json
|
|
233
|
+
- (Lib projects only) public_api.json
|
|
234
|
+
□ Step 6 Silent Audit — executed, all CRITICAL issues resolved
|
|
235
|
+
|
|
236
|
+
**Action** (after Checklist confirmed):
|
|
341
237
|
1. Output summary.
|
|
342
238
|
|
|
343
|
-
**Output**: Task definition summary with
|
|
239
|
+
**Output**: Task definition summary with architecture confirmation table (each dimension final choice and rationale) and Next Steps:
|
|
240
|
+
|
|
241
|
+
| Priority | Action | Notes |
|
|
242
|
+
|:---|:---|:---|
|
|
243
|
+
| 1 | `/archi.code <ID>` | Spec and Plan are ready; start implementation (requires user confirmation) |
|
|
244
|
+
| Optional | Review spec.md / plan.json | Double-check docs before coding |
|
|
344
245
|
</step_6_signoff>
|
|
345
246
|
|
|
346
247
|
</protocol_plan>
|
|
@@ -1,63 +1,48 @@
|
|
|
1
1
|
<protocol_recover>
|
|
2
2
|
**Trigger**: `/archi.recover <pack-file>`
|
|
3
|
-
**Goal**: Read
|
|
3
|
+
**Goal**: Read pack file; write all user data (docs, tasks, custom rules) to corresponding paths in current project; complete data restore after framework upgrade.
|
|
4
4
|
|
|
5
5
|
<meta>
|
|
6
6
|
<style>Precise, Efficient, Non-interactive</style>
|
|
7
7
|
<language>English</language>
|
|
8
8
|
<principles>
|
|
9
|
-
1. **User Data Only**:
|
|
10
|
-
2. **Overwrite Always**:
|
|
11
|
-
3. **Delta Notation**:
|
|
12
|
-
4. **No Partial Write**: If any file write fails, stop immediately and report
|
|
9
|
+
1. **User Data Only**: Pack file contains only user data (`global/`, `tasks/`, `scripts/`, `refs/`, custom rules); write all; no filtering.
|
|
10
|
+
2. **Overwrite Always**: When target path exists, overwrite directly (in upgrade scenario old data is empty template; safe to replace).
|
|
11
|
+
3. **Delta Notation**: Output must label each written file as `ADDED` / `MODIFIED`.
|
|
12
|
+
4. **No Partial Write**: If any file write fails, stop immediately and report; already-written files are not rolled back (idempotent; safe to re-run).
|
|
13
13
|
</principles>
|
|
14
14
|
</meta>
|
|
15
15
|
|
|
16
16
|
<step_1_ingest>
|
|
17
17
|
**Role**: Intelligence Analyst
|
|
18
18
|
**Action**:
|
|
19
|
-
1. Read
|
|
20
|
-
2. Parse
|
|
19
|
+
1. Read file at `<pack-file>` path.
|
|
20
|
+
2. Parse XML; extract `path` attribute and CDATA content of each `<file>` element under `<files>`.
|
|
21
21
|
|
|
22
|
-
| Condition |
|
|
22
|
+
| Condition | Handling |
|
|
23
23
|
|:---|:---|
|
|
24
|
-
| File not found or unreadable | Stop — ask user to
|
|
25
|
-
| XML malformed | Stop —
|
|
26
|
-
| `<files>`
|
|
24
|
+
| File not found or unreadable | Stop — ask user to check path; suggest running `archi pack` to generate |
|
|
25
|
+
| XML malformed | Stop — suggest file may be corrupted; re-run `archi pack` |
|
|
26
|
+
| `<files>` empty | Stop — inform pack is empty |
|
|
27
27
|
|
|
28
|
-
**Output**: Internal file list (path + content)
|
|
28
|
+
**Output**: Internal file list (path + content); not shown to user.
|
|
29
29
|
</step_1_ingest>
|
|
30
30
|
|
|
31
31
|
<step_2_apply>
|
|
32
|
-
**Role**: Senior Engineer
|
|
33
32
|
**Action**:
|
|
34
|
-
1. For each `<file>` entry:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- Write the full CDATA content, preserving original line endings and encoding.
|
|
39
|
-
2. Note: paths in the pack may contain nested subdirectories (e.g. `tasks/FEAT-001_auth/spec.md`); ensure parent directories exist before writing.
|
|
40
|
-
|
|
41
|
-
**Output**:
|
|
42
|
-
```
|
|
43
|
-
ADDED .architext/global/vision.md
|
|
44
|
-
ADDED .architext/global/roadmap.json
|
|
45
|
-
ADDED .architext/tasks/FEAT-001_auth/spec.md
|
|
46
|
-
MODIFIED .cursor/rules/90_custom_rules.mdc
|
|
47
|
-
...
|
|
48
|
-
```
|
|
33
|
+
1. For each `<file>` entry: use `path` (relative to project root) as write target; exists → overwrite (`MODIFIED`), not exists → create (`ADDED`). Write full CDATA content; preserve original line endings and encoding.
|
|
34
|
+
2. Paths in pack may have nested subdirs; ensure parent dirs exist.
|
|
35
|
+
|
|
36
|
+
**Output**: Each file's `ADDED` / `MODIFIED` status list.
|
|
49
37
|
</step_2_apply>
|
|
50
38
|
|
|
51
39
|
<step_3_signoff>
|
|
52
|
-
**
|
|
53
|
-
1. Output restore summary:
|
|
54
|
-
- Total files written (ADDED and MODIFIED counted separately)
|
|
55
|
-
2. Next Steps:
|
|
40
|
+
**Output**: Restore summary — total files written (ADDED / MODIFIED counted separately) + Next Steps:
|
|
56
41
|
|
|
57
42
|
| Step | Notes |
|
|
58
43
|
|:---|:---|
|
|
59
|
-
| Verify framework state | Run `/archi.help` to check project
|
|
60
|
-
| Clean up pack file |
|
|
44
|
+
| Verify framework state | Run `/archi.help` to check project state and suggested next actions |
|
|
45
|
+
| Clean up pack file | May delete `<pack-file>`; no longer needed |
|
|
61
46
|
</step_3_signoff>
|
|
62
47
|
|
|
63
48
|
</protocol_recover>
|