architext 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/LICENSE +21 -0
- package/README.md +326 -0
- package/README.zh-CN.md +326 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +46 -0
- package/dist/templates/en/briefs/_base.md +115 -0
- package/dist/templates/en/briefs/_modules.md +173 -0
- package/dist/templates/en/docs/global/data_snapshot.json +31 -0
- package/dist/templates/en/docs/global/design_tokens.json +150 -0
- package/dist/templates/en/docs/global/dictionary.json +35 -0
- package/dist/templates/en/docs/global/error_codes.json +19 -0
- package/dist/templates/en/docs/global/map.json +94 -0
- package/dist/templates/en/docs/global/roadmap.json +39 -0
- package/dist/templates/en/docs/global/vision.md +82 -0
- package/dist/templates/en/docs/prompts/audit.md +150 -0
- package/dist/templates/en/docs/prompts/code.md +160 -0
- package/dist/templates/en/docs/prompts/edit.md +87 -0
- package/dist/templates/en/docs/prompts/fix.md +86 -0
- package/dist/templates/en/docs/prompts/help.md +69 -0
- package/dist/templates/en/docs/prompts/inherit.md +270 -0
- package/dist/templates/en/docs/prompts/map.md +131 -0
- package/dist/templates/en/docs/prompts/plan.md +252 -0
- package/dist/templates/en/docs/prompts/remove.md +162 -0
- package/dist/templates/en/docs/prompts/revise.md +160 -0
- package/dist/templates/en/docs/prompts/scope.md +198 -0
- package/dist/templates/en/docs/prompts/start.md +258 -0
- package/dist/templates/en/docs/templates/plan.template.json +113 -0
- package/dist/templates/en/docs/templates/scope-brief.template.md +58 -0
- package/dist/templates/en/docs/templates/spec.template.md +51 -0
- package/dist/templates/en/docs/templates/ui.template.md +51 -0
- package/dist/templates/en/rules/00_system.md +123 -0
- package/dist/templates/en/rules/01_workflow.md +93 -0
- package/dist/templates/en/rules/02_tech_stack.md +197 -0
- package/dist/templates/en/rules/03_data_governance.md +102 -0
- package/dist/templates/en/rules/04_cli_tools.md +50 -0
- package/dist/templates/en/rules/90_custom_rules.md +22 -0
- package/dist/templates/en/rules/99_context_glue.md +53 -0
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +292 -0
- package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +86 -0
- package/dist/templates/en/skills/archi-plan-options/SKILL.md +364 -0
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +342 -0
- package/dist/templates/zh/briefs/_base.md +116 -0
- package/dist/templates/zh/briefs/_modules.md +173 -0
- package/dist/templates/zh/docs/global/data_snapshot.json +31 -0
- package/dist/templates/zh/docs/global/design_tokens.json +135 -0
- package/dist/templates/zh/docs/global/dictionary.json +35 -0
- package/dist/templates/zh/docs/global/error_codes.json +19 -0
- package/dist/templates/zh/docs/global/map.json +94 -0
- package/dist/templates/zh/docs/global/roadmap.json +39 -0
- package/dist/templates/zh/docs/global/vision.md +82 -0
- package/dist/templates/zh/docs/prompts/audit.md +150 -0
- package/dist/templates/zh/docs/prompts/code.md +160 -0
- package/dist/templates/zh/docs/prompts/edit.md +87 -0
- package/dist/templates/zh/docs/prompts/fix.md +86 -0
- package/dist/templates/zh/docs/prompts/help.md +69 -0
- package/dist/templates/zh/docs/prompts/inherit.md +270 -0
- package/dist/templates/zh/docs/prompts/map.md +131 -0
- package/dist/templates/zh/docs/prompts/plan.md +253 -0
- package/dist/templates/zh/docs/prompts/remove.md +162 -0
- package/dist/templates/zh/docs/prompts/revise.md +160 -0
- package/dist/templates/zh/docs/prompts/scope.md +198 -0
- package/dist/templates/zh/docs/prompts/start.md +258 -0
- package/dist/templates/zh/docs/templates/plan.template.json +88 -0
- package/dist/templates/zh/docs/templates/scope-brief.template.md +58 -0
- package/dist/templates/zh/docs/templates/spec.template.md +51 -0
- package/dist/templates/zh/docs/templates/ui.template.md +51 -0
- package/dist/templates/zh/rules/00_system.md +123 -0
- package/dist/templates/zh/rules/01_workflow.md +93 -0
- package/dist/templates/zh/rules/02_tech_stack.md +192 -0
- package/dist/templates/zh/rules/03_data_governance.md +102 -0
- package/dist/templates/zh/rules/04_cli_tools.md +50 -0
- package/dist/templates/zh/rules/90_custom_rules.md +21 -0
- package/dist/templates/zh/rules/99_context_glue.md +53 -0
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +293 -0
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +86 -0
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +364 -0
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +339 -0
- package/dist/templates/zh-Hant/briefs/_base.md +115 -0
- package/dist/templates/zh-Hant/briefs/_modules.md +173 -0
- package/dist/templates/zh-Hant/docs/global/data_snapshot.json +31 -0
- package/dist/templates/zh-Hant/docs/global/design_tokens.json +135 -0
- package/dist/templates/zh-Hant/docs/global/dictionary.json +35 -0
- package/dist/templates/zh-Hant/docs/global/error_codes.json +19 -0
- package/dist/templates/zh-Hant/docs/global/map.json +94 -0
- package/dist/templates/zh-Hant/docs/global/roadmap.json +39 -0
- package/dist/templates/zh-Hant/docs/global/vision.md +82 -0
- package/dist/templates/zh-Hant/docs/prompts/audit.md +150 -0
- package/dist/templates/zh-Hant/docs/prompts/code.md +160 -0
- package/dist/templates/zh-Hant/docs/prompts/edit.md +87 -0
- package/dist/templates/zh-Hant/docs/prompts/fix.md +86 -0
- package/dist/templates/zh-Hant/docs/prompts/help.md +69 -0
- package/dist/templates/zh-Hant/docs/prompts/inherit.md +270 -0
- package/dist/templates/zh-Hant/docs/prompts/map.md +131 -0
- package/dist/templates/zh-Hant/docs/prompts/plan.md +252 -0
- package/dist/templates/zh-Hant/docs/prompts/remove.md +162 -0
- package/dist/templates/zh-Hant/docs/prompts/revise.md +160 -0
- package/dist/templates/zh-Hant/docs/prompts/scope.md +198 -0
- package/dist/templates/zh-Hant/docs/prompts/start.md +258 -0
- package/dist/templates/zh-Hant/docs/templates/plan.template.json +88 -0
- package/dist/templates/zh-Hant/docs/templates/scope-brief.template.md +58 -0
- package/dist/templates/zh-Hant/docs/templates/spec.template.md +51 -0
- package/dist/templates/zh-Hant/docs/templates/ui.template.md +51 -0
- package/dist/templates/zh-Hant/rules/00_system.md +123 -0
- package/dist/templates/zh-Hant/rules/01_workflow.md +93 -0
- package/dist/templates/zh-Hant/rules/02_tech_stack.md +192 -0
- package/dist/templates/zh-Hant/rules/03_data_governance.md +102 -0
- package/dist/templates/zh-Hant/rules/04_cli_tools.md +50 -0
- package/dist/templates/zh-Hant/rules/90_custom_rules.md +21 -0
- package/dist/templates/zh-Hant/rules/99_context_glue.md +53 -0
- package/dist/templates/zh-Hant/skills/archi-decompose-roadmap/SKILL.md +293 -0
- package/dist/templates/zh-Hant/skills/archi-interview-protocol/SKILL.md +86 -0
- package/dist/templates/zh-Hant/skills/archi-plan-options/SKILL.md +364 -0
- package/dist/templates/zh-Hant/skills/archi-ui-wireframe/SKILL.md +337 -0
- package/package.json +85 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Project Constitution: Vision, Personas, Principles & Boundaries.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Product Vision: [Project Name]
|
|
6
|
+
|
|
7
|
+
> **Version:** 1.0.0
|
|
8
|
+
> **Status:** Active
|
|
9
|
+
> **Role:** The "Constitution" of the project. All Tasks and Specs must align with this.
|
|
10
|
+
|
|
11
|
+
## 1. Core Vision
|
|
12
|
+
|
|
13
|
+
**Elevator Pitch:**
|
|
14
|
+
[Product Name] is a [Target Market/Category] platform designed to help [Target User] solve [Core Pain Point], achieving [Ultimate Value] through [Core Solution/Uniqueness].
|
|
15
|
+
|
|
16
|
+
**North Star Metric:**
|
|
17
|
+
|
|
18
|
+
* [Metric Name]: [Description - e.g., Daily Focus Time per User]
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 2. Target Audience
|
|
23
|
+
|
|
24
|
+
### Primary Persona
|
|
25
|
+
|
|
26
|
+
* **Role:** [e.g., Student preparing for exams]
|
|
27
|
+
* **Key Traits:** [Keywords]
|
|
28
|
+
* **Pain Points:**
|
|
29
|
+
* [Pain Point 1]
|
|
30
|
+
* [Pain Point 2]
|
|
31
|
+
* **Goals:**
|
|
32
|
+
* [Desired Outcome]
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 3. Product Principles
|
|
37
|
+
|
|
38
|
+
* **[Principle 1]:** [e.g., Simplicity First - Any extra click needs a reason]
|
|
39
|
+
* **[Principle 2]:** [e.g., Encourage over Punish - Give encouragement instead of red warnings when tasks aren't met]
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 4. Design & Experience [?UI]
|
|
44
|
+
|
|
45
|
+
> **Note:** This section applies only to projects with UI. For specific color values and radius definitions, strictly refer to `[[__DOCS_DIR__]]/global/design_tokens.json`.
|
|
46
|
+
|
|
47
|
+
### Visual Style
|
|
48
|
+
|
|
49
|
+
* **Keywords:** [e.g., Warm, Focused, Distraction-free]
|
|
50
|
+
* **Density:** [e.g., High whitespace, Immersive]
|
|
51
|
+
* **Animation:** [e.g., Subtle micro-interactions, no flashy transitions]
|
|
52
|
+
|
|
53
|
+
### Tone of Voice
|
|
54
|
+
|
|
55
|
+
* **Personality:** [e.g., Like a study buddy, not a strict teacher]
|
|
56
|
+
* **Do's:** [e.g., Use "Let's" instead of "You should"]
|
|
57
|
+
* **Don'ts:** [e.g., Don't use robotic error codes]
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 5. Boundaries
|
|
62
|
+
|
|
63
|
+
### In Scope
|
|
64
|
+
|
|
65
|
+
* [Core Task A]
|
|
66
|
+
* [Core Task B]
|
|
67
|
+
|
|
68
|
+
### Out of Scope
|
|
69
|
+
|
|
70
|
+
* **[Anti-Goal 1]:** [e.g., No social leaderboards]
|
|
71
|
+
* **[Anti-Goal 2]:** [e.g., No dark mode switch (Default is dark)]
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 🤖 AI Maintenance Guide
|
|
76
|
+
|
|
77
|
+
**Trigger**: Only modify during project initialization (`/archi.start`) or major strategic pivot (`/archi.revise`).
|
|
78
|
+
|
|
79
|
+
**Action**:
|
|
80
|
+
1. **Alignment**: Ensure Section 3 (Principles) conflicts with technology choices in `02_tech_stack.md`.
|
|
81
|
+
2. **Completeness**: Must fill all `[ ]` placeholders, strictly no "Example" text remaining.
|
|
82
|
+
3. **Consistency**: All Task Specs (`.spec.md`) must reference the Vision in this file to ensure alignment.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<protocol_audit>
|
|
2
|
+
**Trigger**: `/archi.audit [id]`
|
|
3
|
+
**Goal**: Independent deep code audit. With `<id>`, audit the task's code implementation; without `<id>`, execute project-level health check. No code modifications — output audit report and fix tickets only.
|
|
4
|
+
|
|
5
|
+
<meta>
|
|
6
|
+
<style>Investigative, Thorough, Evidence-Based</style>
|
|
7
|
+
<language>English</language>
|
|
8
|
+
<principles>
|
|
9
|
+
1. **Read-Only**: Prohibited from modifying any code files. Audit ≠ Fix.
|
|
10
|
+
2. **Evidence-Based**: Every finding must include file path, line number, and code snippet.
|
|
11
|
+
3. **Actionable Output**: Every issue must include a recommended fix command (`/archi.fix`, `/archi.edit`, etc.).
|
|
12
|
+
4. **Vision Anchored**: Always use `vision.md` as directional baseline to detect deviations.
|
|
13
|
+
5. **Report Persistence**: Audit results must be written to file — task-level → `tasks/<id>_*/audit.md` (overwrite), project-level → `audits/YYYY-MM-DD.md` (date-archived, same-day overwrite).
|
|
14
|
+
</principles>
|
|
15
|
+
</meta>
|
|
16
|
+
|
|
17
|
+
<step_1_resolve>
|
|
18
|
+
**Role**: System Analyst
|
|
19
|
+
**Mode Gate**:
|
|
20
|
+
|
|
21
|
+
| Input | Mode | Next Steps |
|
|
22
|
+
|:---|:---|:---|
|
|
23
|
+
| `/archi.audit <id>` | Task-level deep audit | step_2_task → step_3_report |
|
|
24
|
+
| `/archi.audit` | Project-level health check | step_2_project → step_3_report |
|
|
25
|
+
|
|
26
|
+
**Task-level — Resolve ID**:
|
|
27
|
+
1. Parse `<id>` from `[[__DOCS_DIR__]]/global/roadmap.json` → Task Name, Slug, status.
|
|
28
|
+
2. **Status Gate** — Only `active` or `done` can be audited:
|
|
29
|
+
|
|
30
|
+
| Status | Handling |
|
|
31
|
+
|:---|:---|
|
|
32
|
+
| `active` / `done` | Pass |
|
|
33
|
+
| `pending` | Reject — no code to audit, run `/archi.plan` + `/archi.code` first |
|
|
34
|
+
| `blocked` | Reject — prerequisites not completed |
|
|
35
|
+
|
|
36
|
+
3. **Load Context**:
|
|
37
|
+
- `[[__DOCS_DIR__]]/global/vision.md` — Project directional baseline
|
|
38
|
+
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/spec.md` — Task logic
|
|
39
|
+
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/plan.json` — Task checklist
|
|
40
|
+
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/ui.md` — Task UI scope declaration (if exists)
|
|
41
|
+
- [?UI] `[[__DOCS_DIR__]]/global/ui_context.md` — AI screen index (locate corresponding screen IDs)
|
|
42
|
+
- [?UI] `[[__DOCS_DIR__]]/global/ui_concept.html` — read-only visual reference (source of visual truth for #10 compliance comparison)
|
|
43
|
+
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/audit.md` — Previous audit report (if exists, for comparison)
|
|
44
|
+
- `02_tech_stack.md` — Technical red lines
|
|
45
|
+
- [?UI] `[[__DOCS_DIR__]]/global/design_tokens.json`
|
|
46
|
+
- [?Data] `[[__DOCS_DIR__]]/global/data_snapshot.json`
|
|
47
|
+
4. Read all code files corresponding to this task.
|
|
48
|
+
|
|
49
|
+
**Project-level — Load Overview**:
|
|
50
|
+
1. Read `[[__DOCS_DIR__]]/global/vision.md`, `roadmap.json`, `map.json`.
|
|
51
|
+
2. Read `02_tech_stack.md`.
|
|
52
|
+
3. Scan `[[__DOCS_DIR__]]/tasks/` directory structure.
|
|
53
|
+
4. Read project code entry points and key modules.
|
|
54
|
+
|
|
55
|
+
**Output**: Audit scope and context inventory.
|
|
56
|
+
</step_1_resolve>
|
|
57
|
+
|
|
58
|
+
<step_2_task>
|
|
59
|
+
**Role**: Chief Auditor
|
|
60
|
+
**Scope**: Task-level deep code audit (execute only for `/archi.audit <id>`).
|
|
61
|
+
|
|
62
|
+
Audit dimension by dimension; every finding must include `file:line` + code snippet + severity:
|
|
63
|
+
|
|
64
|
+
| # | Dimension | Audit Focus |
|
|
65
|
+
|:---|:---|:---|
|
|
66
|
+
| 1 | **Vision Alignment** | Does the implementation direction conflict with or deviate from `vision.md` |
|
|
67
|
+
| 2 | **Spec Completeness** | Does code cover all scenarios and edge cases in `spec.md` |
|
|
68
|
+
| 3 | **Plan Truthfulness** | Are tasks marked `done` actually implemented in code (detect false marks) |
|
|
69
|
+
| 4 | **Logic Correctness** | Business logic errors, contradictions, missing branches, state machine defects |
|
|
70
|
+
| 5 | **Bug Hunting** | Null/undefined, race conditions, resource leaks, infinite loops, off-by-one |
|
|
71
|
+
| 6 | **Error Handling** | Swallowed errors, silent failures, error propagation chain integrity, user-visible feedback |
|
|
72
|
+
| 7 | **Tech Stack Compliance** | Against `02_tech_stack.md`: forbidden patterns, outdated APIs, hardcoded values |
|
|
73
|
+
| 8 | **Security** | Sensitive info leakage, unvalidated input, injection risks, permission checks |
|
|
74
|
+
| 9 | **Performance** | Unnecessary full imports/large loops/useless computation/memory leaks/N+1 queries |
|
|
75
|
+
| 10 | [?UI] **Design Compliance** | Styles use visual patterns from Tokens; no hardcoded magic values; implementation visually consistent with corresponding screen in `ui_concept.html` |
|
|
76
|
+
| 11 | [?Data] **Data Integrity** | Field names/types consistent with `data_snapshot.json` |
|
|
77
|
+
| 12 | [?I18n] **I18n Compliance** | No hardcoded strings; must use Key/dictionary references |
|
|
78
|
+
| 13 | **Orphan .gitkeep** | Dir has other files but still contains `.gitkeep` — must remove |
|
|
79
|
+
| 14 | **Spec-Code Drift** | Do code interfaces/types/behaviors match `spec.md`; have manual changes been synced to docs |
|
|
80
|
+
| 15 | [?UI] **UI Reference Integrity** | Are `ref: ui_concept.html#S-XX` pointers in `ui.md` still valid; have referenced screens/components been renamed or removed after edit/revise |
|
|
81
|
+
|
|
82
|
+
**Output**: Findings list grouped by dimension, each with severity, location, description.
|
|
83
|
+
</step_2_task>
|
|
84
|
+
|
|
85
|
+
<step_2_project>
|
|
86
|
+
**Role**: Chief Auditor
|
|
87
|
+
**Scope**: Project-level health check (execute only for `/archi.audit` without arguments).
|
|
88
|
+
|
|
89
|
+
| # | Check Item | Description |
|
|
90
|
+
|:---|:---|:---|
|
|
91
|
+
| 1 | **Vision Drift** | Are `roadmap.json` task directions consistent with `vision.md` |
|
|
92
|
+
| 2 | **Architecture Consistency** | `map.json` vs actual directory structure — drift or unregistered modules |
|
|
93
|
+
| 3 | **Roadmap Health** | Consistency + progress stats + long-term blocked tasks + dependency cycle detection |
|
|
94
|
+
| 4 | **Documentation Completeness** | Each Task has spec.md + plan.json; detect orphan directories |
|
|
95
|
+
| 5 | **Tech Stack Global Compliance** | Spot-check key entry points and modules for global violations |
|
|
96
|
+
| 6 | **Cross-Task Consistency** | Duplicate logic, naming conflicts, interface inconsistencies |
|
|
97
|
+
| 7 | **Orphan .gitkeep** | Dir has other files but still contains `.gitkeep` — must remove |
|
|
98
|
+
|
|
99
|
+
After scanning, prioritize and recommend Tasks needing deep audit:
|
|
100
|
+
- `done` but plan not fully completed
|
|
101
|
+
- Large codebase but no tests
|
|
102
|
+
- Long-term `active` with no progress
|
|
103
|
+
|
|
104
|
+
**Output**: Project health overview + deep audit recommendation list.
|
|
105
|
+
</step_2_project>
|
|
106
|
+
|
|
107
|
+
<step_3_report>
|
|
108
|
+
**Role**: Report Writer
|
|
109
|
+
**Action**:
|
|
110
|
+
|
|
111
|
+
**Issue Classification**:
|
|
112
|
+
|
|
113
|
+
| Level | Meaning | Example |
|
|
114
|
+
|:---|:---|:---|
|
|
115
|
+
| `CRITICAL` | Must fix, blocks release | Logic errors, security vulnerabilities, data corruption risk |
|
|
116
|
+
| `WARNING` | Should fix, carries risk | Missing error handling, performance hazards, incomplete Spec coverage |
|
|
117
|
+
| `INFO` | Suggested improvement | Naming conventions, missing comments, simplifiable code |
|
|
118
|
+
|
|
119
|
+
**Issue Format** (each must include):
|
|
120
|
+
```
|
|
121
|
+
[LEVEL] file/path:line — Dimension Name
|
|
122
|
+
Description: specific issue
|
|
123
|
+
-> Recommended fix: /archi.fix <ID> <description> or /archi.edit <ID> <description>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Action Routing** (recommend command by issue type):
|
|
127
|
+
|
|
128
|
+
| Issue Type | Recommended Command |
|
|
129
|
+
|:---|:---|
|
|
130
|
+
| Bug (logic error, edge case miss) | `/archi.fix <ID> <description>` |
|
|
131
|
+
| Spec gap (task not fully implemented) | `/archi.edit <ID> <supplement>` |
|
|
132
|
+
| Architecture-level issue (global violation) | `/archi.revise <description>` |
|
|
133
|
+
| Incomplete task (plan falsely marked done) | `/archi.code <ID>` |
|
|
134
|
+
| Minor issue (naming, comments, simplification) | Address in next `/archi.code` |
|
|
135
|
+
|
|
136
|
+
**Report Structure**:
|
|
137
|
+
1. Audit summary (mode, scope, date)
|
|
138
|
+
2. Findings list (sorted by severity: CRITICAL → WARNING → INFO)
|
|
139
|
+
3. Statistics summary (count per severity level)
|
|
140
|
+
4. Fix ticket summary (directly executable command list)
|
|
141
|
+
5. Next Steps table
|
|
142
|
+
|
|
143
|
+
**Write Report File**:
|
|
144
|
+
- Task-level → `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/audit.md` (overwrite)
|
|
145
|
+
- Project-level → `[[__DOCS_DIR__]]/audits/YYYY-MM-DD.md` (date-archived, same-day overwrite)
|
|
146
|
+
|
|
147
|
+
**Output**: Complete audit report (output to both conversation and file).
|
|
148
|
+
</step_3_report>
|
|
149
|
+
|
|
150
|
+
</protocol_audit>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<protocol_code>
|
|
2
|
+
**Trigger**: `/archi.code <id>`
|
|
3
|
+
**Goal**: Based on the `tasks/<id>_<Slug>/plan.json` task list, complete task implementation; follow `02_tech_stack.md` ([?UI] also follow `design_tokens.json`); pass build, type check, lint, formatting, test and audit.
|
|
4
|
+
|
|
5
|
+
<meta>
|
|
6
|
+
<style>Deterministic, Type-Safe, SOTA-First</style>
|
|
7
|
+
<language>English</language>
|
|
8
|
+
<principles>
|
|
9
|
+
1. **Frontmatter Preservation**: Prohibited from modifying existing files' YAML Frontmatter.
|
|
10
|
+
2. **Follow Conventions**: Use only existing repo libraries and patterns; read before modify.
|
|
11
|
+
3. **Security First**: Prohibit introducing/printing secrets; sensitive info must not be written to disk.
|
|
12
|
+
4. **SOTA Pattern Check**: Reject outdated practices; adopt best practices defined in tech_stack.
|
|
13
|
+
5. **No Commit Policy**: Do not commit without authorization; present changes as patches.
|
|
14
|
+
6. **Static Check First**: Must pass all static checks (Type/Lint/Format).
|
|
15
|
+
7. **Plan Completion Gate**: Verify Plan completion before signing off. All AI-completable tasks must be finished; only "Human Intervention" and "Force Majeure" are exempt.
|
|
16
|
+
</principles>
|
|
17
|
+
</meta>
|
|
18
|
+
|
|
19
|
+
<step_1_resolve>
|
|
20
|
+
**Role**: System Analyst
|
|
21
|
+
**Action**:
|
|
22
|
+
1. **Resolve ID**: Parse `<id>` → Task Name, Slug, phase/status from `[[__DOCS_DIR__]]/global/roadmap.json`.
|
|
23
|
+
2. **Status Gate** — Only `active` can enter code workflow:
|
|
24
|
+
|
|
25
|
+
| Status | Handling |
|
|
26
|
+
|:---|:---|
|
|
27
|
+
| `active` 🟢 | Pass, continue |
|
|
28
|
+
| `pending` ⏳ | Reject — prompt to run `/archi.plan <ID>` first |
|
|
29
|
+
| `blocked` 🧱 | Reject — prerequisites not completed |
|
|
30
|
+
| `done` ✅ | Reject — already completed, use `/archi.edit <ID>` for modifications |
|
|
31
|
+
|
|
32
|
+
3. **Load Context** (Use Roadmap `📁 Slug` to locate):
|
|
33
|
+
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/spec.md` — Logic & Scenarios
|
|
34
|
+
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/ui.md` — task UI scope declaration (if exists)
|
|
35
|
+
- [?UI] `[[__DOCS_DIR__]]/global/ui_context.md` — AI screen index (screen IDs / routes / states / navigation graph / shared components)
|
|
36
|
+
- [?UI] `[[__DOCS_DIR__]]/global/ui_concept.html` — read-only visual reference (calibrate layout against this during implementation; do not redesign — design is already locked in ui.md)
|
|
37
|
+
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/plan.json` — Task breakdown (contains `notes` shorthand; must reference during execution)
|
|
38
|
+
- `02_tech_stack.md` — Technical Red Lines
|
|
39
|
+
- [?UI] `[[__DOCS_DIR__]]/global/design_tokens.json`
|
|
40
|
+
- [?Data] `[[__DOCS_DIR__]]/global/data_snapshot.json`
|
|
41
|
+
|
|
42
|
+
**Output**: Atomic list of tasks to implement, marking dependencies and order.
|
|
43
|
+
</step_1_resolve>
|
|
44
|
+
|
|
45
|
+
<step_2_plan>
|
|
46
|
+
**Role**: Tech Lead
|
|
47
|
+
**Action**:
|
|
48
|
+
Generate execution blueprint (dynamically adjusted by project type):
|
|
49
|
+
- **Phase A (Domain/Data/API)**: Data models/interfaces/validation
|
|
50
|
+
- **Phase B (UI/Presentation)**: Component structure/styling (use Design Tokens only); non-UI projects adjust to corresponding presentation layer
|
|
51
|
+
- **Phase C (Integration)**: End-to-end wiring (state management, routing, data flow, error handling)
|
|
52
|
+
|
|
53
|
+
Write completion criteria for each task: static checks passed, tests passed, compliant with tech_stack specs.
|
|
54
|
+
|
|
55
|
+
**Output**: Implementation-oriented atomic task list (Checkbox).
|
|
56
|
+
</step_2_plan>
|
|
57
|
+
|
|
58
|
+
<step_3_implement>
|
|
59
|
+
**Role**: Senior Engineer
|
|
60
|
+
**Protocol**:
|
|
61
|
+
- **Read First**: Must read target file before modification; follow existing code style.
|
|
62
|
+
- **Use Existing Stack**: Use only technologies and libraries declared in `02_tech_stack.md`.
|
|
63
|
+
- [?UI] **Design Tokens Only**: Styles strictly use visual patterns defined by Tokens/Presets; prohibited hardcoding magic values (colors, sizes, spacing, etc.).
|
|
64
|
+
- **Type-Safe**: Complete type definitions; use the project tech stack's type system to guard boundaries.
|
|
65
|
+
- **Code Organization**: Follow the architecture pattern and file placement strategy defined in `02_tech_stack.md`.
|
|
66
|
+
- **Comments**: Explain Why, not What; reject nonsense comments.
|
|
67
|
+
- **Naming**: Self-documenting names; reject `a`, `b`, `tmp` etc. (except loop variable `i`).
|
|
68
|
+
- **Error Handling**: Prohibit swallowing errors/silent failures; must properly propagate errors and provide observable feedback to callers (UI: Toast; CLI: Exit Code; API: Status Code + Body).
|
|
69
|
+
- **Robustness**: Explicitly handle edge cases (Loading/Error/Empty/Timeout); prohibit writing only Happy Path.
|
|
70
|
+
- **SOTA**: Follow tech_stack best practices; reject explicitly forbidden outdated patterns.
|
|
71
|
+
- **Scaffold Safety**: Scaffolds in non-empty directories may overwrite files — must generate in new directory and protect `[[__DOCS_DIR__]]/`; delete/overwrite operations must list manifest and confirm first.
|
|
72
|
+
- **.gitkeep Cleanup**: Empty dirs may use `.gitkeep` for Git tracking; when adding other files to a dir, must remove that dir's `.gitkeep`.
|
|
73
|
+
- **Patch Output**: Output changes as patches, with Code References.
|
|
74
|
+
- **Progress Tracking**: After completing each task, immediately update the corresponding task's `done: true` in `plan.json`; prohibited from batch-updating at signoff (progress will be lost if session is interrupted).
|
|
75
|
+
|
|
76
|
+
**Action**: Implement Phase A/B/C step by step; produce complete, production-quality code (with necessary tests); new files/directories must align with tech_stack.
|
|
77
|
+
</step_3_implement>
|
|
78
|
+
|
|
79
|
+
<step_4_validate>
|
|
80
|
+
**Role**: Validation Engineer
|
|
81
|
+
**Action** (Fix and re-run on failure; commands subject to `02_tech_stack.md` Section 5):
|
|
82
|
+
|
|
83
|
+
**Automated Check**: Run `[[__DOCS_DIR__]]/scripts/validate` (if exists); otherwise execute the checklist below manually.
|
|
84
|
+
|
|
85
|
+
| Phase | Check Item | Requirement |
|
|
86
|
+
|:---|:---|:---|
|
|
87
|
+
| **Static** | Build | Zero compilation errors |
|
|
88
|
+
| | Type Check | Zero type errors |
|
|
89
|
+
| | Lint | Zero lint errors (warnings must explain reason) |
|
|
90
|
+
| | Format | Compliant with format rules (if failed, auto-fix then re-check) |
|
|
91
|
+
| **Test** | Existing Tests | Run existing test suite, all pass; must not break existing tests |
|
|
92
|
+
| | New Coverage | Add tests for newly added/modified critical logic; pure styling exempt |
|
|
93
|
+
|
|
94
|
+
**Task Verification (Mandatory)**
|
|
95
|
+
|
|
96
|
+
> Prohibited from marking complete via code review or automated tests alone; must actually run and verify the target task.
|
|
97
|
+
> If dev server is not running, execute `[[__DOCS_DIR__]]/scripts/dev-up` first.
|
|
98
|
+
> **Read `notes.Verify` first**: Read the `Verify: [...]` portion at the end of the current task's `notes` field and use that operation as the concrete e2e step. Fall back to the table below only if the `notes` field has no `Verify` entry.
|
|
99
|
+
|
|
100
|
+
| Project Type | Verification Action | Pass Criteria |
|
|
101
|
+
|:---|:---|:---|
|
|
102
|
+
| [?Web] | Browser-navigate target task path | Renders correctly, no interaction errors, clean console |
|
|
103
|
+
| [?API] | Call new/modified endpoints | Status code and body match spec |
|
|
104
|
+
| [?CLI] | Execute target command (normal args + edge cases) | stdout as expected, correct exit code |
|
|
105
|
+
| [?Lib] | Run example code or playground to verify exported API | No runtime errors, correct return values |
|
|
106
|
+
| [?Mobile] | Emulator/device operate target task | UI renders, interactions respond |
|
|
107
|
+
| [?Desktop] | Launch app operate target task | Window renders, task functional |
|
|
108
|
+
|
|
109
|
+
**Evidence**: Output must include verification results (command output summary / screenshot / error log).
|
|
110
|
+
**Fallback**: If verification keeps failing and environment issues suspected → `[[__DOCS_DIR__]]/scripts/dev-reset` → `[[__DOCS_DIR__]]/scripts/dev-up` → retry.
|
|
111
|
+
|
|
112
|
+
**Output**: ✅/❌ status and reason for each check; Task Verification evidence.
|
|
113
|
+
</step_4_validate>
|
|
114
|
+
|
|
115
|
+
<step_5_audit>
|
|
116
|
+
**Role**: Chief Auditor
|
|
117
|
+
**Checklist**:
|
|
118
|
+
1. **Tech Consistency**: Consistent with `02_tech_stack.md` (libraries/patterns/API style).
|
|
119
|
+
2. [?UI] **Design Compliance**: Styles use Token/Preset visual patterns only; no hardcoded magic values.
|
|
120
|
+
3. [?Data] **Data Integrity**: Compliant with `data_snapshot.json`; field names/types match.
|
|
121
|
+
4. **SOTA**: Reject outdated patterns; adopt tech_stack best practices.
|
|
122
|
+
5. [?UI] **Accessibility**: Include necessary accessibility attributes.
|
|
123
|
+
6. [?I18n] **I18n**: No hardcoded strings; must use Key/dictionary reference.
|
|
124
|
+
7. **Performance**: Avoid unnecessary large dependencies/full imports/useless computation/memory leaks.
|
|
125
|
+
8. **Security**: No sensitive info leakage; inputs validated.
|
|
126
|
+
9. **Static Check Zero**: All static check issues resolved.
|
|
127
|
+
10. **step_4 Gate**: Confirm all step_4 checks (Static + Test + Task Verification) have passed.
|
|
128
|
+
11. **Linkage Check**: Read the `featureRelations` array from `[[__DOCS_DIR__]]/global/map.json`; semantically compare the current task against each `sources` field. If matched, output: `⚠️ Linkage: [aggregator] — [checkNote]`, reminding to confirm whether the aggregator needs to be updated after this implementation. Skip if `featureRelations` is empty.
|
|
129
|
+
12. **Data Governance**: When this implementation introduces new content, directly write to the corresponding global index:
|
|
130
|
+
|
|
131
|
+
| Trigger | File | Action |
|
|
132
|
+
|:---|:---|:---|
|
|
133
|
+
| New business entity · verb · shared utility | `dictionary.json` | Directly append |
|
|
134
|
+
| New error scenario | `error_codes.json` | Directly append |
|
|
135
|
+
| [?Data] Schema actually changed | `data_snapshot.json` | Directly sync |
|
|
136
|
+
|
|
137
|
+
Detail issues can be Auto-Fixed with explanation; major risks marked `⚠️ Risk` with alternatives proposed.
|
|
138
|
+
</step_5_audit>
|
|
139
|
+
|
|
140
|
+
<step_6_signoff>
|
|
141
|
+
**Terminal Gate** (Do not skip; must complete before output summary):
|
|
142
|
+
| Step | Command | Pass Condition |
|
|
143
|
+
|:---|:---|:---|
|
|
144
|
+
| 1 | `npx archi plan <ID>` | All done or exempt only; not passed → return to step_3 |
|
|
145
|
+
| 2 | `npx archi task <ID> --status done` | Task status updated |
|
|
146
|
+
| 3 | `npx archi task --check` | No ERROR-level issues |
|
|
147
|
+
| 4 | `npx archi render` | `.md` views generated |
|
|
148
|
+
|
|
149
|
+
**Action** (After Gate passes):
|
|
150
|
+
1. Confirm all task `done` marks in `plan.json` are updated (should be done in real-time during step_3; this is a final check).
|
|
151
|
+
2. **Drift Warning**: Compare code changes against `spec.md`'s key checkpoints (interface signatures, return types, key operations in Gherkin scenarios). If code exceeds spec coverage → mark `⚠️ Spec Drift`, suggest running `/archi.edit <ID>` to sync docs.
|
|
152
|
+
3. Output completed task list with patch links (Code Reference).
|
|
153
|
+
4. Provide next step suggestions and Git Commit Suggestion (Conventional Commits).
|
|
154
|
+
|
|
155
|
+
**Checkpoint** (Confirm before Output): □ Terminal Gate all executed
|
|
156
|
+
|
|
157
|
+
**Output**: Completion summary with completed tasks, exempt items (if any), Git Commit suggestion, Next Steps table.
|
|
158
|
+
</step_6_signoff>
|
|
159
|
+
|
|
160
|
+
</protocol_code>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<protocol_edit>
|
|
2
|
+
**Trigger**: `/archi.edit <id> [context]`
|
|
3
|
+
**Goal**: Based on new requirements/feedback, update Spec/UI docs of an already managed module and append development plans.
|
|
4
|
+
|
|
5
|
+
<meta>
|
|
6
|
+
<style>Collaborative, Iterative, Traceable</style>
|
|
7
|
+
<language>English</language>
|
|
8
|
+
<principles>
|
|
9
|
+
1. **Doc First**: Must modify docs (Spec/UI) first, then generate Plan. Prohibited from skipping docs to change code plans directly.
|
|
10
|
+
2. **Incremental**: Only append new Tasks to Plan, keep completed history (unless rollback needed).
|
|
11
|
+
3. **Conflict Check**: Check if new requirements conflict with tech_stack / design_tokens.
|
|
12
|
+
4. **Frontmatter Preservation**: Prohibited from destroying existing document Metadata.
|
|
13
|
+
</principles>
|
|
14
|
+
</meta>
|
|
15
|
+
|
|
16
|
+
<step_1_load>
|
|
17
|
+
**Role**: Product Manager
|
|
18
|
+
**Action**:
|
|
19
|
+
- Read `[[__DOCS_DIR__]]/tasks/<ID>_<Slug>/` spec.md, ui.md, plan.json.
|
|
20
|
+
- [?UI] Read `[[__DOCS_DIR__]]/global/ui_context.md` (locate the screen scope and navigation graph for this task).
|
|
21
|
+
- Check `Spec-Status` field in spec.md:
|
|
22
|
+
- `Full` → Normal flow, proceed to step_2.
|
|
23
|
+
- `Stub` → Proceed to step_1_5_enrich.
|
|
24
|
+
- [?Major UX Change] Quick search for similar product best practices.
|
|
25
|
+
</step_1_load>
|
|
26
|
+
|
|
27
|
+
<step_1_5_enrich>
|
|
28
|
+
**Role**: Reverse Engineer
|
|
29
|
+
**Trigger**: spec.md contains `Spec-Status: Stub` (lightweight snapshot generated by `/archi.inherit`).
|
|
30
|
+
|
|
31
|
+
**Action**:
|
|
32
|
+
1. Inform user: "This task only has a lightweight snapshot. A full spec must be generated before modifications can proceed."
|
|
33
|
+
2. Extract source file paths from the stub's "Associated Files" section.
|
|
34
|
+
3. Read each associated file with medium-depth scan (entry point + core logic).
|
|
35
|
+
4. Enrich the stub into a full spec based on code analysis:
|
|
36
|
+
- Preserve existing overview and key flows
|
|
37
|
+
- Add Gherkin Scenarios (covering normal flows + exception paths)
|
|
38
|
+
- Add interface/type definitions (if this task is upstream of others)
|
|
39
|
+
5. Update `Spec-Status: Stub → Full`.
|
|
40
|
+
6. [?UI] If module has UI → generate or update `ui.md` (scope declaration); if new screens are needed, notify user to run the `archi-ui-wireframe` Skill (Skill syncs both `ui_concept.html` + `ui_context.md`).
|
|
41
|
+
7. Generate `plan.json` (all tasks as done, recording implemented content).
|
|
42
|
+
8. Present enriched spec summary to user.
|
|
43
|
+
|
|
44
|
+
**Gate**: User confirms enriched content is correct before proceeding to step_2_refine_docs.
|
|
45
|
+
**Exception**: Associated files missing/moved → prompt user to update paths.
|
|
46
|
+
</step_1_5_enrich>
|
|
47
|
+
|
|
48
|
+
<step_2_refine_docs>
|
|
49
|
+
**Role**: Requirements Analyst & Designer
|
|
50
|
+
**Action**:
|
|
51
|
+
- Modify spec.md (logic/rule changes) and ui.md (structure/interaction changes) based on `[context]`.
|
|
52
|
+
- [?UI Modification] Sync `ui_concept.html` + `ui_context.md` via Skill (Skill is the sole writer of both files):
|
|
53
|
+
|
|
54
|
+
| Change Type | Criteria | Action |
|
|
55
|
+
|:---|:---|:---|
|
|
56
|
+
| No screen impact | Logic/data only, no visual diff | Update spec.md only; `ui_concept.html` / `ui_context.md` unchanged |
|
|
57
|
+
| Minor UI tweak | New/modified state, popup, or local area; overall layout unchanged | Call Skill (Modify screens mode) to update both files; output `MODIFIED: S-XX` |
|
|
58
|
+
| Screen structure change | Layout refactor, new standalone screen, navigation path change | Call Skill (Modify screens mode) to update both files; output `MODIFIED: S-XX`; if Phase 2 coloring is done, re-color only the modified screen |
|
|
59
|
+
| Task reduction | Screen/region removed entirely | Call Skill (Remove screens mode) to update both files; output `REMOVED: S-XX` |
|
|
60
|
+
|
|
61
|
+
- Ask user questions (A/B/C/D options) to confirm details when requirements are vague.
|
|
62
|
+
|
|
63
|
+
**Output**: Updated Spec, UI documents, and `ui_concept.html` / `ui_context.md` change summary.
|
|
64
|
+
</step_2_refine_docs>
|
|
65
|
+
|
|
66
|
+
<step_3_update_plan>
|
|
67
|
+
**Role**: Tech Lead
|
|
68
|
+
**Action**:
|
|
69
|
+
- Append new phase to `plan.json` phases array: `Phase X: Change Request (<Date>)`.
|
|
70
|
+
- List specific Tasks (API update, UI tweak, Test update); each must be verifiable.
|
|
71
|
+
- **Status Transition**: If current task status=`done`, reset to `active` after appending the Phase (otherwise `/archi.code` will be rejected by the Status Gate).
|
|
72
|
+
|
|
73
|
+
**Terminal Gate** (Do not skip; must complete before step_4 output):
|
|
74
|
+
| Step | Command | Pass Condition |
|
|
75
|
+
|:---|:---|:---|
|
|
76
|
+
| 1 | `npx archi render` | `.md` views generated |
|
|
77
|
+
| 2 | [if current status=done] `npx archi task <ID> --status active` | Task status reset to active |
|
|
78
|
+
|
|
79
|
+
**Output**: plan.json with new tasks appended; if status transition was performed, output `MODIFIED: roadmap.json <ID>.status done→active`.
|
|
80
|
+
</step_3_update_plan>
|
|
81
|
+
|
|
82
|
+
<step_4_summary>
|
|
83
|
+
**Action** (Gate must complete in step_3):
|
|
84
|
+
**Output**: Task update summary with Spec/UI/Plan change overview and Next Steps table. Recommend running `/archi.code <ID>`.
|
|
85
|
+
</step_4_summary>
|
|
86
|
+
|
|
87
|
+
</protocol_edit>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<protocol_fix>
|
|
2
|
+
**Trigger**: `/archi.fix [id] <context>`
|
|
3
|
+
**Goal**: Diagnose Bug and execute fix directly. If `[id]` not provided, auto-locate relevant task module.
|
|
4
|
+
|
|
5
|
+
<meta>
|
|
6
|
+
<style>Diagnostic, Surgical, Spec-Compliant</style>
|
|
7
|
+
<language>English</language>
|
|
8
|
+
<principles>
|
|
9
|
+
1. **Spec Immutable**: Prohibited from modifying `spec.md` / `ui.md` (unless Bug itself is a documentation error).
|
|
10
|
+
2. **Reproduction**: Must conceive reproduction steps or test cases first.
|
|
11
|
+
3. **Root Cause**: Must analyze root cause, not patch the surface.
|
|
12
|
+
4. **Test-Driven**: Fix plan must include new test cases.
|
|
13
|
+
5. **Auto-Discovery**: If ID not specified, locate Task via Context semantic search.
|
|
14
|
+
</principles>
|
|
15
|
+
</meta>
|
|
16
|
+
|
|
17
|
+
<step_1_diagnose>
|
|
18
|
+
**Role**: Fault Analyst
|
|
19
|
+
**Action**:
|
|
20
|
+
1. **Resolve Target**:
|
|
21
|
+
- Has `<id>`: Lock target `tasks/<ID>_<Slug>/`.
|
|
22
|
+
- No `<id>`: Analyze `[context]` to search most relevant module.
|
|
23
|
+
Unique match → Auto lock | Multiple matches → List candidates and ask | Cannot locate → Report error requesting ID.
|
|
24
|
+
2. Read all docs under target directory (`spec.md`, `ui.md`, `plan.json`) and related code.
|
|
25
|
+
3. Read `02_tech_stack.md` (ensure fix does not violate tech red lines) and `[[__DOCS_DIR__]]/global/vision.md` (ensure fix direction stays aligned with project vision).
|
|
26
|
+
4. Analyze `[context]`, combine with code logic to locate potential failure points.
|
|
27
|
+
5. **Hypothesis**: Propose 1-3 root cause hypotheses.
|
|
28
|
+
|
|
29
|
+
**Output**: Root Cause Analysis report.
|
|
30
|
+
</step_1_diagnose>
|
|
31
|
+
|
|
32
|
+
<step_2_plan_fix>
|
|
33
|
+
**Role**: Tech Lead
|
|
34
|
+
**Action**:
|
|
35
|
+
- Update `[[__DOCS_DIR__]]/tasks/<ID>_<Slug>/plan.json`, append to `phases` array a phase object with `name`: `Bugfix: <Bug Title>`.
|
|
36
|
+
- Tasks: 1) Create reproduction test (Red) 2) Apply fix (Green) 3) Regression test.
|
|
37
|
+
|
|
38
|
+
**Terminal Gate** (Do not skip; must complete before step_5 output):
|
|
39
|
+
| Step | Command | Pass Condition |
|
|
40
|
+
|:---|:---|:---|
|
|
41
|
+
| 1 | `npx archi render` | `.md` views generated |
|
|
42
|
+
|
|
43
|
+
**Output**: plan.json with fix tasks appended.
|
|
44
|
+
</step_2_plan_fix>
|
|
45
|
+
|
|
46
|
+
<step_3_execute_fix>
|
|
47
|
+
**Role**: Senior Engineer (Surgical Fix — bug only, no scope creep)
|
|
48
|
+
**Action**:
|
|
49
|
+
- Modify code directly according to Plan.
|
|
50
|
+
- Fix Bug only; prohibited from opportunistic refactoring or modifying unrelated code.
|
|
51
|
+
- Error handling follows `code.md` specs (no swallowing errors/no silent failures).
|
|
52
|
+
</step_3_execute_fix>
|
|
53
|
+
|
|
54
|
+
<step_4_verify>
|
|
55
|
+
**Role**: QA Engineer
|
|
56
|
+
**Terminal Gate** (Do not skip; must complete before step_5 output):
|
|
57
|
+
| Step | Command | Pass Condition |
|
|
58
|
+
|:---|:---|:---|
|
|
59
|
+
| 1 | Run build command | Build succeeds |
|
|
60
|
+
| 2 | Run type check | Zero type errors |
|
|
61
|
+
| 3 | Run Lint/Format | Pass |
|
|
62
|
+
| 4 | Run tests | Reproduction + regression tests pass |
|
|
63
|
+
|
|
64
|
+
Any failure must be fixed until passed.
|
|
65
|
+
</step_4_verify>
|
|
66
|
+
|
|
67
|
+
<step_4_5_plan_update>
|
|
68
|
+
**Role**: Tech Lead
|
|
69
|
+
**Action**:
|
|
70
|
+
1. Update `plan.json`: set `done: true` for completed tasks in the Bugfix Phase.
|
|
71
|
+
2. [current status=`done` and all Bugfix Phase tasks passed] → Keep status as `done`.
|
|
72
|
+
3. [Bugfix Phase has unresolved tasks] → Run `npx archi task <ID> --status active`; note in signoff that `/archi.code` is needed to complete remaining fixes.
|
|
73
|
+
|
|
74
|
+
**Output**: `MODIFIED: plan.json Bugfix Phase done marks` (if status changed, append `MODIFIED: roadmap.json <ID>.status`).
|
|
75
|
+
</step_4_5_plan_update>
|
|
76
|
+
|
|
77
|
+
<step_5_summary>
|
|
78
|
+
**Output**: Bug fix summary with Root Cause analysis, fix content, new tests, and Next Steps table:
|
|
79
|
+
|
|
80
|
+
| Priority | Action | Notes |
|
|
81
|
+
|:---|:---|:---|
|
|
82
|
+
| Recommended | `/archi.audit <ID>` | Re-audit to confirm fix is complete and no new issues introduced |
|
|
83
|
+
| Optional | `/archi.code <ID>` | If Bugfix Phase has remaining incomplete tasks |
|
|
84
|
+
</step_5_summary>
|
|
85
|
+
|
|
86
|
+
</protocol_fix>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<protocol_help>
|
|
2
|
+
**Trigger**: `/archi.help [question]`
|
|
3
|
+
**Goal**: Project navigation and contextual Q&A. Analyze current project state to recommend next actions; or answer user questions based on project context.
|
|
4
|
+
|
|
5
|
+
<meta>
|
|
6
|
+
<style>Concise, Contextual, Actionable</style>
|
|
7
|
+
<language>English</language>
|
|
8
|
+
<principles>
|
|
9
|
+
1. **Context-Aware**: Answer based on real project state. No guessing.
|
|
10
|
+
2. **Actionable Output**: Every output must include an executable next step (specific command + args).
|
|
11
|
+
3. **Minimal Token**: Keep output concise. Don't repeat what the user already knows. Only present conclusions and recommendations.
|
|
12
|
+
4. **No Audit**: No deep auditing (that's `/archi.audit`'s job). Focus on navigation and Q&A.
|
|
13
|
+
</principles>
|
|
14
|
+
</meta>
|
|
15
|
+
|
|
16
|
+
<step_1_load_context>
|
|
17
|
+
**Role**: Project Observer
|
|
18
|
+
**Action**:
|
|
19
|
+
1. Read `[[__DOCS_DIR__]]/global/roadmap.json` — extract only `id/title/status/deps/tag` fields per task; skip `goal/notes` (navigation and status aggregation do not need these details).
|
|
20
|
+
2. Scan `[[__DOCS_DIR__]]/tasks/` directory — get existing Tasks and their doc completeness (spec.md / ui.md / plan.json).
|
|
21
|
+
3. [?question] If user provided a question, locate relevant files by semantic match (spec / plan / vision / tech_stack / data_snapshot, etc.), read as needed.
|
|
22
|
+
|
|
23
|
+
**Output**: Internal context (not shown to user).
|
|
24
|
+
</step_1_load_context>
|
|
25
|
+
|
|
26
|
+
<step_2_route>
|
|
27
|
+
**Role**: Router
|
|
28
|
+
**Action**: Branch based on input:
|
|
29
|
+
|
|
30
|
+
| Input | Branch |
|
|
31
|
+
|:---|:---|
|
|
32
|
+
| No args | → step_3_navigate (project navigation) |
|
|
33
|
+
| Has `[question]` | → step_4_answer (contextual Q&A) |
|
|
34
|
+
|
|
35
|
+
</step_2_route>
|
|
36
|
+
|
|
37
|
+
<step_3_navigate>
|
|
38
|
+
**Role**: Project Navigator
|
|
39
|
+
**Action**:
|
|
40
|
+
1. **Determine project phase**:
|
|
41
|
+
|
|
42
|
+
| Signal | Phase | Recommendation |
|
|
43
|
+
|:---|:---|:---|
|
|
44
|
+
| roadmap.json missing | Not initialized | New project → `/archi.start`; existing code → `/archi.inherit` |
|
|
45
|
+
| Has roadmap but no Task dirs | Started, not planned | Run `/archi.scope` to plan new tasks |
|
|
46
|
+
| Has Legacy stubs (Spec-Status: Stub) | Inherited, not enriched | Run `/archi.edit LEG-xx` to enrich spec |
|
|
47
|
+
| Has active tasks with complete plan.json | Ready to code | Run `/archi.code <ID>` |
|
|
48
|
+
| Has active tasks but missing spec/plan | Planning incomplete | Run `/archi.plan <ID>` to complete |
|
|
49
|
+
| All tasks done | Complete | Run `/archi.scope` to plan new tasks or release |
|
|
50
|
+
| Has blocked tasks | Blocked | Show blocking reason and prerequisites |
|
|
51
|
+
|
|
52
|
+
2. **Output format**:
|
|
53
|
+
- One-line summary of current state
|
|
54
|
+
- Recommended next action (with specific command)
|
|
55
|
+
- If multiple paths available, list by priority (max 3)
|
|
56
|
+
</step_3_navigate>
|
|
57
|
+
|
|
58
|
+
<step_4_answer>
|
|
59
|
+
**Role**: Project Advisor
|
|
60
|
+
**Action**:
|
|
61
|
+
1. Parse `[question]` semantics, locate relevant project files.
|
|
62
|
+
2. Read relevant files, synthesize answer.
|
|
63
|
+
3. If question involves an action (e.g. "how to do X"), include specific command suggestions.
|
|
64
|
+
4. If insufficient info to answer, state what's missing instead of fabricating.
|
|
65
|
+
|
|
66
|
+
**Output**: Concise answer based on project context + relevant file references.
|
|
67
|
+
</step_4_answer>
|
|
68
|
+
|
|
69
|
+
</protocol_help>
|