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
|
@@ -1,252 +1,241 @@
|
|
|
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
|
-
|
|
43
|
-
**Output**: Present a **Task Context Brief** to the user:
|
|
44
|
-
```
|
|
45
|
-
### Task Context: [Task Name] ([ID])
|
|
46
|
-
|
|
47
|
-
**Goal**: [roadmap task's goal; highlight any [User Presets] if present]
|
|
48
|
-
**Upstream Dependencies**: [completed dependency tasks and their key interfaces/types, or "None"]
|
|
49
|
-
**Project Features**: [activated UI/Data/CLI/Lib/API tags]
|
|
50
|
-
**Technical Constraints**: [key red lines from 02_tech_stack.md]
|
|
51
|
-
**Design Philosophy**: [North Star Metric and design principles from vision.md]
|
|
52
|
-
**Project Conventions**: [from 02_tech_stack.md §9 — Error Handling: X | Data Flow: X | Auth: X, or "Not set" if absent]
|
|
53
|
-
```
|
|
54
|
-
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), 02_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.
|
|
55
32
|
</step_1_load>
|
|
56
33
|
|
|
57
|
-
<
|
|
58
|
-
**
|
|
59
|
-
**Action**: Assess task complexity to decide whether to run the full step_2 flow:
|
|
34
|
+
<step_2_complexity>
|
|
35
|
+
**Action**: Detect task type, assess complexity, decide flow path.
|
|
60
36
|
|
|
61
|
-
|
|
37
|
+
**⓪ Task Type + granularity red lines**:
|
|
62
38
|
|
|
63
|
-
|
|
|
64
|
-
|
|
65
|
-
|
|
|
66
|
-
|
|
|
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 |
|
|
67
45
|
|
|
68
|
-
>
|
|
46
|
+
> Mixed tasks may combine dimensions in § 2 with sub-headings. Trigger split when estimate exceeds cap.
|
|
69
47
|
|
|
70
|
-
|
|
48
|
+
**① Complexity verdict**:
|
|
71
49
|
|
|
72
50
|
| Signal | Verdict | Flow |
|
|
73
51
|
|:---|:---|:---|
|
|
74
|
-
| No deps + no new entities + no
|
|
75
|
-
| Has deps OR new entities OR
|
|
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 |
|
|
76
54
|
|
|
77
|
-
**
|
|
78
|
-
- Skip 5-dimension architecture recommendations and User Confirm Gate
|
|
79
|
-
- spec condensed to 1-2 Gherkin scenarios
|
|
80
|
-
- plan condensed to a single Phase
|
|
81
|
-
- Confirm at signoff (replacing step_2 Gate)
|
|
82
|
-
</step_1_5_complexity>
|
|
55
|
+
**② Design signal detection** (after Standard):
|
|
83
56
|
|
|
84
|
-
|
|
57
|
+
| Signal | Verdict |
|
|
58
|
+
|:---|:---|
|
|
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>
|
|
62
|
+
|
|
63
|
+
<step_3_interview>
|
|
85
64
|
**Role**: Architect
|
|
86
65
|
|
|
87
66
|
---
|
|
88
67
|
|
|
89
|
-
### Unified Proposal
|
|
68
|
+
### Unified Proposal (one-shot)
|
|
90
69
|
|
|
91
|
-
**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.
|
|
92
71
|
|
|
93
72
|
**Action**:
|
|
94
73
|
|
|
95
74
|
#### Part 1: Task Design
|
|
96
75
|
|
|
97
|
-
AI **
|
|
76
|
+
AI **decides which modules to output** by task nature; select from:
|
|
98
77
|
|
|
99
78
|
| Material | When applicable |
|
|
100
79
|
|:---|:---|
|
|
101
80
|
| Flow description (user journey / system flow / command flow) | Multi-step interaction or processing chain |
|
|
102
|
-
| Core entities
|
|
103
|
-
| Touchpoints (
|
|
104
|
-
| 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 |
|
|
105
84
|
|
|
106
85
|
**Reference rules**:
|
|
107
|
-
- Entities/types
|
|
108
|
-
- 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
|
|
109
88
|
- Upstream interfaces → `ref: tasks/<dep_ID>/spec.md#InterfaceName`
|
|
110
89
|
- Existing design tokens/components → `ref: design_tokens.json#preset` / `ref: dictionary.json#component`
|
|
111
90
|
|
|
112
|
-
**Universal requirement**: Use this task's
|
|
113
|
-
|
|
91
|
+
**Universal requirement**: Use this task's concrete entity names and operation names; no generics
|
|
114
92
|
|
|
115
93
|
#### Part 2: Architecture Recommendations
|
|
116
94
|
|
|
117
|
-
[[SKILL:
|
|
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)]]
|
|
118
96
|
|
|
119
|
-
When expanding
|
|
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)]].
|
|
120
98
|
|
|
121
|
-
####
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
## Task Proposal: [Task Name] ([ID])
|
|
99
|
+
#### Part 1.5: Mechanism Preview (Complex tasks only)
|
|
125
100
|
|
|
126
|
-
|
|
127
|
-
[Output per complexity level, see Part 1 above]
|
|
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.
|
|
128
102
|
|
|
129
|
-
|
|
130
|
-
| Dimension | Recommended | Source | Rationale |
|
|
131
|
-
|:---|:---|:---|:---|
|
|
132
|
-
| Core Structure | [Recommended option] | Task | [1-2 sentences specific to this task] |
|
|
133
|
-
| Interaction Pattern | [Recommended option] | Task | [Rationale] |
|
|
134
|
-
| Error Handling | [Convention value] | Project Convention | ref: 02_tech_stack.md §9 |
|
|
135
|
-
| ... | ... | ... | ... |
|
|
136
|
-
|
|
137
|
-
[Only expand option table for dimensions requiring user decision]:
|
|
138
|
-
**[Q<n>] Question title**
|
|
139
|
-
> Why user decision is needed (one sentence)
|
|
103
|
+
#### Output Format
|
|
140
104
|
|
|
141
|
-
|
|
142
|
-
|:---|:---|:---|:---|:---|
|
|
143
|
-
| A [Recommended] | ... | Concrete behavior (2-3 sentences) | Full sentence | Full sentence |
|
|
144
|
-
| B | ... | ... | ... | ... |
|
|
145
|
-
| Z | Custom | (Describe) | - | - |
|
|
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).
|
|
146
106
|
|
|
147
|
-
|
|
148
|
-
> Reply **OK** to accept all recommendations; or annotate what to change, e.g.:
|
|
149
|
-
> - Design correction: "Registration doesn't need email verification step"
|
|
150
|
-
> - Dimension override: "Core Structure=C, Error Handling=B D"
|
|
151
|
-
> - Question answer: "Q1=B"
|
|
152
|
-
```
|
|
107
|
+
**Goal**: Lock `spec`, `ui` (if applicable), `data_snapshot.json` (if applicable).
|
|
153
108
|
|
|
154
|
-
**⌨️ INPUT**: Reply **OK** to accept all; or free-text
|
|
155
|
-
</
|
|
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>
|
|
156
111
|
|
|
157
|
-
<
|
|
158
|
-
**Role**: Consultant
|
|
112
|
+
<step_3_5_refinement>
|
|
159
113
|
**Trigger**: User reply is not OK — contains corrections, questions, overrides, or logic conflicts.
|
|
160
|
-
**Action**: Do
|
|
114
|
+
**Action**: Do not generate docs. Incorporate feedback, refresh Unified Proposal and re-output; await re-confirmation.
|
|
161
115
|
- If task design question → Compare alternatives, re-propose design
|
|
162
|
-
- If architecture dimension question → Explain differences in this task
|
|
116
|
+
- If architecture dimension question → Explain differences in this task context, update recommendation
|
|
163
117
|
- If dimension override → Replace recommendation directly and adjust related design
|
|
164
|
-
</step_2_5_refinement>
|
|
165
118
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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.
|
|
169
124
|
|
|
170
|
-
**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.
|
|
171
126
|
|
|
172
127
|
**Action Checklist**:
|
|
173
128
|
1. **`map.json`**: Register `[[__DOCS_DIR__]]/tasks/<ID>_<Slug>` in `directoryMapping`; define module responsibility and dependencies in `logicalTopology`.
|
|
174
|
-
2.
|
|
175
|
-
3.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
"evidence": "<basis, e.g. 'spec.md §X states this task dynamically lists all Y-type tasks'>",
|
|
183
|
-
"checkNote": "When tasks of this type are added or removed, check whether <aggregator> needs to be updated"
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
If not an aggregator, skip this step.
|
|
187
|
-
|
|
188
|
-
**Output**: Change diffs of above files (brief).
|
|
189
|
-
</step_3_global_sync>
|
|
190
|
-
|
|
191
|
-
<step_4_generate>
|
|
192
|
-
**Role**: Doc Engineer
|
|
193
|
-
**Input**: Confirmed Unified Proposal (task design + architecture recommendations) + updated global context.
|
|
129
|
+
2. **Data governance sync** (`dictionary.json` / `error_codes.json` / `data_snapshot.json` etc.): Per `03_data_governance.md`, incrementally sync new business terms, error codes, Schema to corresponding global files.
|
|
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)]]
|
|
131
|
+
|
|
132
|
+
**Output**: Diff summary of above files. Enter step_5_generate.
|
|
133
|
+
</step_4_global_sync>
|
|
134
|
+
|
|
135
|
+
<step_5_generate>
|
|
136
|
+
**Input**: Confirmed Unified Proposal (task design + arch recommendations) + updated global context + step_1_5 Task Type.
|
|
194
137
|
**Action**: Generate standard docs under `[[__DOCS_DIR__]]/tasks/<ID>_<Slug>/`.
|
|
195
138
|
|
|
196
|
-
**1. `spec.md`** (
|
|
139
|
+
**1. `spec.md`** (required):
|
|
197
140
|
- Template: `templates/spec.template.md`.
|
|
198
|
-
- Convert confirmed task design and architecture recommendations to Gherkin Scenarios.
|
|
199
|
-
- Each Scenario must map to a concrete flow step or exception path from the task design; do not invent scenarios.
|
|
200
|
-
- If upstream task, must include explicit Interface/Type definitions.
|
|
201
141
|
|
|
202
|
-
**2
|
|
142
|
+
**spec § 2 format by Task Type**:
|
|
143
|
+
|
|
144
|
+
| Task Type | § 2 Primary Dimension | Format requirement |
|
|
145
|
+
|:---|:---|:---|
|
|
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 |
|
|
149
|
+
| Edit | Inherit from original | Same as original task type |
|
|
150
|
+
|
|
151
|
+
> Mixed tasks use sub-headings in § 2 to distinguish dimensions.
|
|
152
|
+
|
|
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 + 02_tech_stack.md.
|
|
155
|
+
|
|
156
|
+
**General rules**:
|
|
157
|
+
- Do not invent AC items; each must map to concrete content in task design.
|
|
158
|
+
- If upstream task, must include explicit Interface/Type definitions in § 4.
|
|
159
|
+
|
|
160
|
+
**2. `ui.md`** (when this task involves UI):
|
|
203
161
|
- Template: `templates/ui.template.md`.
|
|
204
162
|
- **With `ui_context.md` (primary path)**:
|
|
205
|
-
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)]].
|
|
206
164
|
|
|
207
|
-
| Divergence
|
|
165
|
+
| Divergence Type | Criteria | Handling |
|
|
208
166
|
|:---|:---|:---|
|
|
209
|
-
| No divergence | Screen index matches design | Write `ui.md` directly
|
|
210
|
-
| Minor addition | New state
|
|
211
|
-
| Structural divergence | Layout
|
|
212
|
-
|
|
213
|
-
2. After resolving divergence, fill
|
|
214
|
-
- **Without `ui_context.md` (fallback
|
|
215
|
-
|
|
216
|
-
**3. `
|
|
217
|
-
- Template: `templates/
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
**
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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 | Call skill to update `ui_concept.html` + `ui_context.md`; note `MODIFIED: S-XX` |
|
|
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.
|
|
189
|
+
|
|
190
|
+
**Principle 3 — Granularity and mutual exclusion**:
|
|
191
|
+
| Signal | Verdict |
|
|
192
|
+
|:---|:---|
|
|
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>
|
|
206
|
+
|
|
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)]]
|
|
210
|
+
|
|
211
|
+
[[INCLUDE: shared/verify-result-handling.md]]
|
|
212
|
+
</step_6_verify>
|
|
213
|
+
|
|
214
|
+
<step_7_signoff>
|
|
215
|
+
**Terminal Gate** (do not skip): Standard check (task --check + render).
|
|
240
216
|
| Step | Command | Pass Condition |
|
|
241
217
|
|:---|:---|:---|
|
|
242
|
-
| 1 | `npx archi task --
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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 synced (dictionary/error_codes/data_snapshot)
|
|
228
|
+
□ Step 6 Silent Audit — executed, all CRITICAL issues resolved
|
|
229
|
+
|
|
230
|
+
**Action** (after Checklist confirmed):
|
|
247
231
|
1. Output summary.
|
|
248
232
|
|
|
249
|
-
**Output**: Task definition summary with
|
|
233
|
+
**Output**: Task definition summary with architecture confirmation table (each dimension final choice and rationale) and Next Steps:
|
|
234
|
+
|
|
235
|
+
| Priority | Action | Notes |
|
|
236
|
+
|:---|:---|:---|
|
|
237
|
+
| 1 | `/archi.code <ID>` | Spec and Plan are ready; start implementation (requires user confirmation) |
|
|
238
|
+
| Optional | Review spec.md / plan.json | Double-check docs before coding |
|
|
250
239
|
</step_6_signoff>
|
|
251
240
|
|
|
252
241
|
</protocol_plan>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<protocol_recover>
|
|
2
|
+
**Trigger**: `/archi.recover <pack-file>`
|
|
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
|
+
|
|
5
|
+
<meta>
|
|
6
|
+
<style>Precise, Efficient, Non-interactive</style>
|
|
7
|
+
<language>English</language>
|
|
8
|
+
<principles>
|
|
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
|
+
</principles>
|
|
14
|
+
</meta>
|
|
15
|
+
|
|
16
|
+
<step_1_ingest>
|
|
17
|
+
**Role**: Intelligence Analyst
|
|
18
|
+
**Action**:
|
|
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
|
+
|
|
22
|
+
| Condition | Handling |
|
|
23
|
+
|:---|:---|
|
|
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
|
+
|
|
28
|
+
**Output**: Internal file list (path + content); not shown to user.
|
|
29
|
+
</step_1_ingest>
|
|
30
|
+
|
|
31
|
+
<step_2_apply>
|
|
32
|
+
**Action**:
|
|
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.
|
|
37
|
+
</step_2_apply>
|
|
38
|
+
|
|
39
|
+
<step_3_signoff>
|
|
40
|
+
**Output**: Restore summary — total files written (ADDED / MODIFIED counted separately) + Next Steps:
|
|
41
|
+
|
|
42
|
+
| Step | Notes |
|
|
43
|
+
|:---|:---|
|
|
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 |
|
|
46
|
+
</step_3_signoff>
|
|
47
|
+
|
|
48
|
+
</protocol_recover>
|