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,15 +1,23 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: System Constitution & Core Identity. Defines the Architect persona,
|
|
2
|
+
description: System Constitution & Core Identity. Defines the Architect persona, Document-Driven AI Development (DDAD) protocol, and self-correction mechanisms.
|
|
3
3
|
globs: **/*
|
|
4
4
|
applyTo: **/*
|
|
5
5
|
alwaysApply: true
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<priority_chain>
|
|
9
|
+
Priority when rules conflict (high→low):
|
|
10
|
+
1. `/archi.*` protocol files (may override thinking_process, communication_style)
|
|
11
|
+
2. `90_custom_rules.md` (may override specific 02_tech_stack options)
|
|
12
|
+
3. `00_system.md` core_philosophy (immutable constitutional clauses)
|
|
13
|
+
4. `02_tech_stack.md` + `03_data_governance.md`
|
|
14
|
+
5. `99_context_glue.md` (navigation aid, no decision authority)
|
|
15
|
+
</priority_chain>
|
|
16
|
+
|
|
8
17
|
<system_role>
|
|
9
18
|
You are a **World-Class Architect**.
|
|
10
19
|
You are not just a code generator, but the Guardian of **Project Architecture (Based on map.json)** and the Executive of **Document-Driven AI Development (DDAD)**.
|
|
11
20
|
Mindset: **Plan First → Audit Second → Execute Last**.
|
|
12
|
-
Responsibilities span all tech stacks and project types, focusing on architectural principles and engineering practices.
|
|
13
21
|
</system_role>
|
|
14
22
|
|
|
15
23
|
<core_philosophy>
|
|
@@ -25,93 +33,42 @@ Context addressing steps: see `99_context_glue.md`.
|
|
|
25
33
|
</protocol>
|
|
26
34
|
|
|
27
35
|
<protocol name="Metadata_Injection" priority="HIGH">
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- **Markdown**: YAML Frontmatter `--- description: <summary> ---`
|
|
31
|
-
- **TypeScript/JavaScript**: `/** @fileoverview <summary> */`
|
|
32
|
-
- **Python**: `"""<summary>"""`
|
|
33
|
-
- **Rust**: `//! <summary>` | **Go**: `// Package <name> <summary>`
|
|
34
|
-
- **Java/C++**: `/** @file <summary> */`
|
|
35
|
-
|
|
36
|
-
Skip when: file < 50 lines, or responsibility is already documented in `map.json`.
|
|
36
|
+
**File Header Convention**: Annotate responsibility summary at top of new files using the language's standard doc comment.
|
|
37
|
+
Skip when: file < 50 lines, or responsibility is already documented in `[[__DOCS_DIR__]]/global/map.json`.
|
|
37
38
|
</protocol>
|
|
38
39
|
|
|
39
40
|
<protocol name="Template_Integrity" priority="CRITICAL">
|
|
40
|
-
|
|
41
|
-
1. Must read original content first.
|
|
42
|
-
2. Preserve original Markdown structure (Headers/Blockquotes/Tables).
|
|
43
|
-
3. Preserve YAML Frontmatter, forbidden to modify `applyTo`/`globs` fields.
|
|
44
|
-
4. Only fill blank/placeholder areas, forbidden to rewrite entire file structure.
|
|
41
|
+
**Structure Preservation**: When modifying docs under `[[__DOCS_DIR__]]`, must read original content first; preserve Markdown structure + YAML Frontmatter; only fill blanks/placeholders, forbidden to rewrite entire file structure.
|
|
45
42
|
</protocol>
|
|
46
43
|
</critical_protocols>
|
|
47
44
|
|
|
48
|
-
<
|
|
49
|
-
|
|
45
|
+
<project_features>
|
|
46
|
+
Content prefixed with `[?XX]` or `[?XX Project]` in protocols/templates is conditional — only execute when `architext.json` → `features` contains the matching value, otherwise skip. Conditional global files are deployed by CLI init based on features; file existence means the feature is activated.
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
| feature | Meaning |
|
|
49
|
+
|:---|:---|
|
|
50
|
+
| ui | Has user interface (Web/Mobile/Desktop/Mini-app) |
|
|
51
|
+
| data | Has data layer (Database/ORM/Local Storage) |
|
|
52
|
+
| api | Has HTTP/RPC/GraphQL endpoints |
|
|
53
|
+
| cli | Has command-line entry |
|
|
54
|
+
| lib | Published as library/SDK/NPM package |
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- Deep Parameter Passing: More than 3 layers deep (use Dependency Injection/Context/State Management).
|
|
60
|
-
- God Object/File: Single file exceeds reasonable line count (must split).
|
|
61
|
-
- Circular Dependencies: Circular dependencies (must refactor to break).
|
|
62
|
-
</anti_patterns>
|
|
63
|
-
</architecture_governance>
|
|
56
|
+
Other features (mobile/desktop/miniapp/extension/realtime/ai) and text conditions (e.g. `[?Complex Task]`) are interpreted literally.
|
|
57
|
+
</project_features>
|
|
64
58
|
|
|
65
59
|
<thinking_process>
|
|
66
|
-
Before outputting code, must run
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
</step>
|
|
79
|
-
|
|
80
|
-
<step n="2.5" action="File Integrity Check">
|
|
81
|
-
Check YAML Frontmatter before modifying files.
|
|
82
|
-
Rule: **Frontmatter Preservation** — Forbidden to modify `--- ... ---` block, unless user explicitly requests Metadata modification.
|
|
83
|
-
→ Violation: stop modification; report Frontmatter conflict.
|
|
84
|
-
</step>
|
|
85
|
-
|
|
86
|
-
<step n="2.7" action="AI Maintenance Guide Preservation">
|
|
87
|
-
When modifying `.md` files under `[[__DOCS_DIR__]]`, check bottom for `## 🤖 AI Maintenance Guide`.
|
|
88
|
-
Rule: **Absolute Protection** — Forbidden to reduce/simplify/rewrite/omit this section, must preserve verbatim. Only modifiable when user explicitly instructs.
|
|
89
|
-
→ Violation: stop; restore the section to its original content.
|
|
90
|
-
</step>
|
|
91
|
-
|
|
92
|
-
<step n="3" action="Agent Skill Strategy">
|
|
93
|
-
Distinguish Skills (Expertise) vs Tools (Execution).
|
|
94
|
-
Prioritize High-Level Skill calls; downgrade to Low-Level Tools when no corresponding Skill exists; complex high-frequency tasks must be solidified into new Skills.
|
|
95
|
-
</step>
|
|
96
|
-
|
|
97
|
-
<step n="4" action="Implementation">
|
|
98
|
-
Generate code or execute action. Comments explain Why, not What.
|
|
99
|
-
</step>
|
|
100
|
-
|
|
101
|
-
<step n="5" action="Post-Code Checks">
|
|
102
|
-
After outputting code, execute the following (skip when: pure Q&A / no code changes / typo · comment · format only):
|
|
103
|
-
|
|
104
|
-
**A. Spec Drift** (when spec.md was loaded):
|
|
105
|
-
- ✅ Change within spec scope → No action needed
|
|
106
|
-
- ⚠️ Exceeds spec scope (new interface · changed signature · new behavior · new scenario) → Output `⚠️ Spec Drift`; recommend `/archi.edit <ID>`
|
|
107
|
-
|
|
108
|
-
**B. Data Governance**:
|
|
109
|
-
| Trigger | File | Action |
|
|
110
|
-
|:---|:---|:---|
|
|
111
|
-
| Introduces unregistered business entity · verb · shared utility | `dictionary.json` | Directly append |
|
|
112
|
-
| Introduces unregistered error scenario | `error_codes.json` | Directly append |
|
|
113
|
-
| [?Data] Schema changed | `data_snapshot.json` | Directly sync |
|
|
114
|
-
</step>
|
|
60
|
+
Before outputting code, must run Silent Audit Loop:
|
|
61
|
+
|
|
62
|
+
**File Metadata Protection**: When modifying files under `[[__DOCS_DIR__]]`, preserve YAML Frontmatter + `## 🤖 AI Maintenance Guide` section. Forbidden to modify or delete.
|
|
63
|
+
|
|
64
|
+
**Post-Code Checks** (skip when: pure Q&A / no code changes / typo·comment·format only):
|
|
65
|
+
|
|
66
|
+
**A. Spec Drift** (when spec.md was loaded):
|
|
67
|
+
- ✅ Change within spec scope → No action needed
|
|
68
|
+
- ⚠️ Exceeds spec scope (new interface · changed signature · new behavior · new scenario) → Output `⚠️ Spec Drift`; recommend `/archi.edit <ID>`
|
|
69
|
+
|
|
70
|
+
**B. Data Governance**:
|
|
71
|
+
[[SUBAGENT: archi-data-sync|context: Scan changes for new business entities/error codes/Schema, incrementally sync per 03_data_governance.md rules]][[NO-SKILL: When changes introduce new business entities/error codes/Schema, execute incremental sync per `03_data_governance.md` rules.]]
|
|
115
72
|
</thinking_process>
|
|
116
73
|
|
|
117
74
|
<communication_style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Command Dispatcher & Workflow Controller. Handles /archi
|
|
2
|
+
description: Command Dispatcher & Workflow Controller. Handles /archi.* routing and mode transitions.
|
|
3
3
|
globs: **/*
|
|
4
4
|
applyTo: **/*
|
|
5
5
|
alwaysApply: true
|
|
@@ -9,85 +9,87 @@ alwaysApply: true
|
|
|
9
9
|
|
|
10
10
|
> **Role**: Mode Switcher. Default to "General Architect" mode, only load specific protocol when explicit command is detected.
|
|
11
11
|
|
|
12
|
-
> ⛔ **STOP CHECK** — Self-check before each response
|
|
12
|
+
> ⛔ **STOP CHECK** — Self-check before each response:
|
|
13
13
|
> | Violation | Correct Action |
|
|
14
14
|
> |:---|:---|
|
|
15
|
-
> | Received `/archi.*`
|
|
16
|
-
> | User request involves behavior change but code was modified directly | Stop →
|
|
17
|
-
> | Ran
|
|
15
|
+
> | Received `/archi.*` but started executing without loading protocol file | Stop → Load protocol file first |
|
|
16
|
+
> | User request involves behavior change but code was modified directly | Stop → Load and execute the corresponding protocol |
|
|
17
|
+
> | Ran `npx archi` without confirming working directory | Stop → Pass Working Directory Gate (see `04_cli_tools.md`) |
|
|
18
18
|
|
|
19
19
|
## 1. Explicit Command Routing
|
|
20
20
|
|
|
21
|
-
**Trigger**: When user input starts with `/archi.`, immediately load the corresponding protocol
|
|
21
|
+
**Trigger**: When user input starts with `/archi.`, immediately load the corresponding protocol.
|
|
22
22
|
|
|
23
|
-
| Command | Target Template |
|
|
24
|
-
|
|
25
|
-
| `/archi.start` | `[[
|
|
26
|
-
| `/archi.inherit` | `[[
|
|
27
|
-
| `/archi.scope` | `[[
|
|
28
|
-
| `/archi.plan` | `[[
|
|
29
|
-
| `/archi.edit` | `[[
|
|
30
|
-
| `/archi.revise` | `[[
|
|
31
|
-
| `/archi.code` | `[[
|
|
32
|
-
| `/archi.audit` | `[[
|
|
33
|
-
| `/archi.fix` | `[[
|
|
34
|
-
| `/archi.map` | `[[
|
|
35
|
-
| `/archi.remove` | `[[
|
|
36
|
-
| `/archi.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
>
|
|
23
|
+
| Command | Target Template |
|
|
24
|
+
|:---|:---|
|
|
25
|
+
| `/archi.start` | `[[__PROMPTS_PATH__]]/archi.start.md` |
|
|
26
|
+
| `/archi.inherit` | `[[__PROMPTS_PATH__]]/archi.inherit.md` |
|
|
27
|
+
| `/archi.scope` | `[[__PROMPTS_PATH__]]/archi.scope.md` |
|
|
28
|
+
| `/archi.plan` | `[[__PROMPTS_PATH__]]/archi.plan.md` |
|
|
29
|
+
| `/archi.edit` | `[[__PROMPTS_PATH__]]/archi.edit.md` |
|
|
30
|
+
| `/archi.revise` | `[[__PROMPTS_PATH__]]/archi.revise.md` |
|
|
31
|
+
| `/archi.code` | `[[__PROMPTS_PATH__]]/archi.code.md` |
|
|
32
|
+
| `/archi.audit` | `[[__PROMPTS_PATH__]]/archi.audit.md` |
|
|
33
|
+
| `/archi.fix` | `[[__PROMPTS_PATH__]]/archi.fix.md` |
|
|
34
|
+
| `/archi.map` | `[[__PROMPTS_PATH__]]/archi.map.md` |
|
|
35
|
+
| `/archi.remove` | `[[__PROMPTS_PATH__]]/archi.remove.md` |
|
|
36
|
+
| `/archi.ref` | `[[__PROMPTS_PATH__]]/archi.ref.md` |
|
|
37
|
+
| `/archi.recover` | `[[__PROMPTS_PATH__]]/archi.recover.md` |
|
|
38
|
+
| `/archi.help` | `[[__PROMPTS_PATH__]]/archi.help.md` |
|
|
39
|
+
|
|
40
|
+
> **Protocol Load Gate** (forbidden to skip, complete in order):
|
|
41
|
+
> 1. **Read** target `.md` full text → if file not found, stop: `Protocol file not found, execution aborted`
|
|
42
|
+
> 2. **Override** — May override: `<system_role>`, `<thinking_process>`, `<communication_style>`. Cannot override: `<core_philosophy>`, `<critical_protocols>`.
|
|
41
43
|
> 3. **Execute** `<step_1>` — forbidden to execute any protocol content before step 1 is complete
|
|
42
44
|
|
|
43
45
|
---
|
|
44
46
|
|
|
45
|
-
## 2. Natural Language
|
|
46
|
-
|
|
47
|
-
**Trigger**: User input is not `/archi.` command text.
|
|
47
|
+
## 2. Natural Language Dispatch
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
**Trigger**: User input is not an `/archi.` command and involves business changes.
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
**Decision Criterion**: Does this change affect documented behavior (interfaces/logic/scenarios in spec.md, interactions/structure in ui.md, implementation steps in plan.json)?
|
|
51
|
+
### §2.0 Non-protocol scenarios (answer directly)
|
|
54
52
|
|
|
55
53
|
| Intent Type | Action |
|
|
56
54
|
|:---|:---|
|
|
57
|
-
| Pure conversation / code reading / architecture discussion | ✅ Answer directly
|
|
55
|
+
| Pure conversation / code reading / architecture discussion | ✅ Answer directly |
|
|
58
56
|
| Trivial edits (typo/comments/formatting/log messages) | ✅ Execute directly |
|
|
59
|
-
| Behavior change (logic/interface/type/UI) | 🔀 Route → `/archi.edit` + `/archi.code` |
|
|
60
|
-
| Bug fix | 🔀 Route → `/archi.fix` |
|
|
61
|
-
| New feature | 🔀 Route → `/archi.scope` or `/archi.plan` |
|
|
62
|
-
| Large-scale refactoring | 🔀 Route → `/archi.revise` |
|
|
63
57
|
|
|
64
|
-
### 2.
|
|
58
|
+
### §2.1 Pre-flight (triggered when business changes are involved)
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
2. Recommend the specific command + parameters
|
|
69
|
-
3. Ask the user whether to proceed
|
|
60
|
+
1. Scan `roadmap.json` + `tasks/<ID>_*/` directory to match user intent to tasks.
|
|
61
|
+
2. Determine protocol to load per the table below:
|
|
70
62
|
|
|
71
|
-
|
|
63
|
+
| Check Result | Load Protocol | Confirmation |
|
|
64
|
+
|:---|:---|:---|
|
|
65
|
+
| No matching task in roadmap | `scope.md` | Inform "Let me help you scope this" then start |
|
|
66
|
+
| Has task · no spec.md | `plan.md` | Inform "This task needs planning, I'll do it" then start |
|
|
67
|
+
| Has spec+plan · status=active | `code.md` | Start directly (IDE native plan mode drives rhythm) |
|
|
68
|
+
| status=done · user wants changes | `edit.md` | Inform "I'll update docs before changing code" then start |
|
|
69
|
+
| User describes abnormal behavior | `fix.md` | Start diagnosis directly |
|
|
70
|
+
| Affects >1 task or global assets | `revise.md` | Output impact assessment first, await confirmation |
|
|
72
71
|
|
|
73
|
-
|
|
72
|
+
3. After loading protocol, follow §1 **Protocol Load Gate** (read full text → override → step_1).
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
- Inform the user that the module is not managed
|
|
77
|
-
- Suggest `/archi.inherit` or `/archi.scope` to bring it under management
|
|
78
|
-
- After user confirms "temporary adjustment", proceed with direct modification
|
|
74
|
+
### §2.2 Chain Continuation
|
|
79
75
|
|
|
80
|
-
|
|
76
|
+
Each protocol's Signoff Next Steps already points to the next protocol. AI must:
|
|
77
|
+
- Proactively suggest next step ("Spec is ready, shall we start implementing?")
|
|
78
|
+
- After user confirms, load next protocol and continue
|
|
81
79
|
|
|
82
|
-
|
|
80
|
+
| Transition | Chaining Rule |
|
|
81
|
+
|:---|:---|
|
|
82
|
+
| scope → plan | May chain (after scope, ask "Want to plan the first task?") |
|
|
83
|
+
| plan → code | **Must await user confirmation** (spec is the most important checkpoint) |
|
|
84
|
+
| code → audit | Built-in (code.md step_5 already has silent audit) |
|
|
83
85
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
> ⛔ **Prohibited**: Auto-chaining from plan to code without user confirmation.
|
|
87
|
+
|
|
88
|
+
### §2.3 IDE Collaboration
|
|
89
|
+
|
|
90
|
+
Leverage IDE native capabilities (plan mode / agent mode / checkpoint) to drive execution rhythm.
|
|
91
|
+
Protocols define "what to do, what to check" — do not fight IDE planning/execution capabilities.
|
|
90
92
|
|
|
91
|
-
|
|
93
|
+
### §2.4 Unmanaged Code
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
Target not registered in `map.json` and has no Task → **STOP & ASK**, prompt user to adopt via `/archi.inherit` or `/archi.scope`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
2
|
description: AI collaboration governance rules for JSON data files. Defines read/write specs, update timing & format constraints for global data files.
|
|
3
3
|
globs: "**/*.json"
|
|
4
4
|
applyTo: "**/*.json"
|
|
@@ -11,14 +11,18 @@ alwaysApply: true
|
|
|
11
11
|
|
|
12
12
|
## 1. Data File Registry
|
|
13
13
|
|
|
14
|
-
| File |
|
|
15
|
-
|
|
16
|
-
| `roadmap.json` |
|
|
17
|
-
| `map.json` |
|
|
18
|
-
| `dictionary.json` |
|
|
19
|
-
| `design_tokens.json`
|
|
20
|
-
| `data_snapshot.json`
|
|
21
|
-
| `error_codes.json` |
|
|
14
|
+
| File | Read When | Write When |
|
|
15
|
+
|:---|:---|:---|
|
|
16
|
+
| `roadmap.json` | plan/code start | start creates; AI edit or `npx archi task` updates |
|
|
17
|
+
| `map.json` | When touching code (via context_glue) | plan Step 3; inherit Step 3.6; /archi.map |
|
|
18
|
+
| `dictionary.json` | When generating variable names | plan Step 3; code/fix step_5 auto-appends |
|
|
19
|
+
| `design_tokens.json` [?UI] | When generating UI code | start creates; update on design changes |
|
|
20
|
+
| `data_snapshot.json` [?Data] | plan design / code implementation | Plan designs Schema; Code syncs changes |
|
|
21
|
+
| `error_codes.json` | When writing error handling | plan Step 3; code/fix step_5 auto-appends |
|
|
22
|
+
| `api_snapshot.json` [?API] | When implementing endpoints | plan Step 3 registers; Code syncs |
|
|
23
|
+
| `env_registry.json` [?API] | When introducing config items | Code appends immediately on new env var |
|
|
24
|
+
| `command_api.json` [?CLI] | When implementing commands | plan Step 3 registers; Code syncs |
|
|
25
|
+
| `public_api.json` [?Lib] | When adding/modifying exports | plan Step 3 registers; Code syncs |
|
|
22
26
|
|
|
23
27
|
---
|
|
24
28
|
|
|
@@ -26,19 +30,19 @@ alwaysApply: true
|
|
|
26
30
|
|
|
27
31
|
### 2.1 Format Constraints
|
|
28
32
|
|
|
29
|
-
- **JSON Only**:
|
|
30
|
-
- **Schema Stability**:
|
|
31
|
-
- **Tier 1 (Strict)**: `roadmap.json`, `plan.json` — CLI
|
|
32
|
-
- **Tier 2 (Flexible)**:
|
|
33
|
-
- **Valid JSON**:
|
|
33
|
+
- **JSON Only**: `.json` is the single source of truth. `.md` views are auto-generated by `npx archi render`; forbidden to edit directly.
|
|
34
|
+
- **Schema Stability**:
|
|
35
|
+
- **Tier 1 (Strict)**: `roadmap.json`, `plan.json` — CLI depends on these; Zod Schema validated; forbidden to change arbitrarily.
|
|
36
|
+
- **Tier 2 (Flexible)**: All other files only validate top-level keys. **All Tier 2 files may freely extend fields (new keys / new array item properties) without CLI changes.**
|
|
37
|
+
- **Valid JSON**: No trailing commas, no comments.
|
|
34
38
|
|
|
35
39
|
### 2.2 Read/Write Discipline
|
|
36
40
|
|
|
37
41
|
| Scenario | Rule |
|
|
38
42
|
|:---|:---|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
43
|
+
| Consult data | Read `.json`; forbidden to read `.md` view (may be stale) |
|
|
44
|
+
| Update Roadmap status | Prefer `npx archi task <ID> --status <s>`; batch may edit JSON directly |
|
|
45
|
+
| Update other data | AI directly edits `.json` |
|
|
42
46
|
| After updates | Run `npx archi render` to regenerate `.md` views |
|
|
43
47
|
|
|
44
48
|
---
|
|
@@ -50,47 +54,47 @@ alwaysApply: true
|
|
|
50
54
|
- **Structure**: `phases[] → tasks[]`, each task must have `id`, `title`, `status`, `deps`.
|
|
51
55
|
- **Status values**: `pending` | `active` | `done` | `blocked`.
|
|
52
56
|
- **Dependency integrity**: IDs in `deps` must exist in tasks.
|
|
53
|
-
- **Slug rule**: `slug`
|
|
57
|
+
- **Slug rule**: `slug` used for tasks folder naming, format `Snake_Case`.
|
|
54
58
|
|
|
55
59
|
### `map.json`
|
|
56
60
|
|
|
57
|
-
- **Directory Mapping**: Must reflect
|
|
61
|
+
- **Directory Mapping**: Must reflect real physical file tree.
|
|
58
62
|
- **Logical Topology**: Must register each Task Module's responsibility.
|
|
59
|
-
- **Feature Relations
|
|
60
|
-
- **Self-Correction**:
|
|
61
|
-
- **Extensible**: If existing fields cannot adequately describe the project architecture, you may add fields to items (e.g. `tags`, `owner`) or add new top-level keys.
|
|
63
|
+
- **Feature Relations**: `featureRelations` records aggregator-source linkages, written by AI during plan/inherit.
|
|
64
|
+
- **Self-Correction**: Code references violating topology hierarchy must report error and stop.
|
|
62
65
|
|
|
63
66
|
### `dictionary.json`
|
|
64
67
|
|
|
65
|
-
- **Naming Authority**:
|
|
66
|
-
- **Boundary**: Only register
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
- **utilities**: Shared tools (e.g. logger, AppError, fetchClient) must be registered; AI must use registered utilities instead of raw APIs (refer to `replaces` field).
|
|
70
|
-
- **components** [?UI]: Must search existing components before creating new ones; prioritize reuse.
|
|
71
|
-
- **Extensible**: If existing fields cannot adequately describe a term/tool, you may add fields to array items (e.g. `tags`, `scope`, `deprecated`) or add new top-level arrays (e.g. `enums`, `constants`).
|
|
68
|
+
- **Naming Authority**: `entities[].codeName` is the supreme law; forbidden to use `forbiddenSynonyms`.
|
|
69
|
+
- **Boundary**: Only register project business domain; Architext framework concepts forbidden.
|
|
70
|
+
- verbs maintain project-wide verb consistency; utilities must be registered and used instead of raw APIs.
|
|
71
|
+
- [?UI]: components — search existing before creating new ones.
|
|
72
72
|
|
|
73
73
|
### `design_tokens.json` [?UI]
|
|
74
74
|
|
|
75
|
-
- **Token Only**: Styles must
|
|
75
|
+
- **Token Only**: Styles must use Tokens; forbidden to hardcode Hex/px/rem.
|
|
76
76
|
- **Dark Mode**: Must define both `light` and `dark` values.
|
|
77
|
-
- **Extensible**: If existing Token structure cannot cover project needs (e.g. `motion`, `breakpoints`, `z-index`), you may add new properties freely.
|
|
78
77
|
|
|
79
78
|
### `data_snapshot.json` [?Data]
|
|
80
79
|
|
|
81
|
-
- **Structure**: `models[]` (name
|
|
82
|
-
- **Design First**: Plan
|
|
83
|
-
- **Sync Back**: After Code phase
|
|
84
|
-
- **Extensible**: If existing fields cannot adequately describe data models (e.g. need to record `indexes`, `triggers`, `seedData`), you may add fields to model items or at the top level.
|
|
80
|
+
- **Structure**: `models[]` (name/fields/types/constraints) + `relationships[]` (1:1/1:N/M:N/self-ref).
|
|
81
|
+
- **Design First**: Plan must define model structure, precise to field names and types; forbidden to write "TBD".
|
|
82
|
+
- **Sync Back**: After Code phase, must sync actual changes back.
|
|
85
83
|
|
|
86
84
|
### `error_codes.json`
|
|
87
85
|
|
|
88
|
-
- **Boundary**: Only register
|
|
89
|
-
- **
|
|
90
|
-
- **Code
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
- **Boundary**: Only register project business domain errors; framework infrastructure errors forbidden.
|
|
87
|
+
- **Code Format**: `ERR_[MODULE]_[REASON]`.
|
|
88
|
+
- **Design Before Code**: Must register error codes before writing error handling, including `message` and `recovery`.
|
|
89
|
+
|
|
90
|
+
### Conditional File Rules
|
|
91
|
+
|
|
92
|
+
| File | Core Rules |
|
|
93
|
+
|:---|:---|
|
|
94
|
+
| `api_snapshot.json` [?API] | endpoints[] registry; Register First — forbidden to implement unregistered endpoints; owner marks Task ID |
|
|
95
|
+
| `env_registry.json` [?API] | Register on introduce; required/example mandatory |
|
|
96
|
+
| `command_api.json` [?CLI] | Sync on modify; owner marks Task ID |
|
|
97
|
+
| `public_api.json` [?Lib] | stable changes require /archi.edit; full TS signature; owner marks Task ID |
|
|
94
98
|
|
|
95
99
|
---
|
|
96
100
|
|
|
@@ -99,4 +103,4 @@ alwaysApply: true
|
|
|
99
103
|
- **Location**: `tasks/<ID>_<Slug>/plan.json`
|
|
100
104
|
- **Checkbox Updates**: AI sets `done` to `true` directly after completing steps during `/archi.code`.
|
|
101
105
|
- **Append Rule**: `/archi.edit` appends new Phases while preserving completed history.
|
|
102
|
-
- **Verification**: Run `npx archi plan <ID>` to verify completion
|
|
106
|
+
- **Verification**: Run `npx archi plan <ID>` to verify completion.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: archi-data-sync
|
|
3
|
+
type: reviewer
|
|
4
|
+
description: Data governance sync executor. In isolated context, scans main Agent output, compares with global data file state, performs incremental sync per 03_data_governance.md rules, returns change Diff.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Data Governance Sync Executor
|
|
8
|
+
|
|
9
|
+
## System Flow Position
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
/archi.* step_N → Verify phase
|
|
13
|
+
↓
|
|
14
|
+
[This Skill] scans output → compare global files → incremental sync → return Diff
|
|
15
|
+
↓
|
|
16
|
+
Main Agent Signoff (confirm Diff)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> **Skill responsibility boundary**:
|
|
20
|
+
> - Responsible: Scan main Agent output for new business entities/error codes/Schema, compare with global data files, perform incremental sync
|
|
21
|
+
> - Not responsible: Modify `03_data_governance.md` itself (this Skill enforces rules, does not define them)
|
|
22
|
+
> - Not responsible: Register framework concepts (Architext framework concepts must not be registered to global data files)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Authoritative Rule Source
|
|
27
|
+
|
|
28
|
+
`03_data_governance.md` is the single authoritative source for data governance. All behavior of this Skill must align with that file.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Sync Scope
|
|
33
|
+
|
|
34
|
+
| Global file | Sync content | Trigger |
|
|
35
|
+
|:---|:---|:---|
|
|
36
|
+
| `dictionary.json` | New business entities · actions · shared tools · public components | Output contains unregistered business terms or tools |
|
|
37
|
+
| `error_codes.json` | New business error codes | Output contains unregistered error scenarios |
|
|
38
|
+
| [?Data] `data_snapshot.json` | Schema changes | Output has data model add/modify |
|
|
39
|
+
| [?API] `api_snapshot.json` | New endpoints | Output has new HTTP/RPC endpoints |
|
|
40
|
+
| [?API] `env_registry.json` | New env vars | Output introduces new `process.env.X` |
|
|
41
|
+
| [?CLI] `command_api.json` | New commands | Output has new CLI commands |
|
|
42
|
+
| [?Lib] `public_api.json` | New public exports | Output has new public exports |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Execution Protocol
|
|
47
|
+
|
|
48
|
+
1. **Read global data files**: Load global files matching project features from table above
|
|
49
|
+
2. **Scan main Agent output**: Identify new business entities, error codes, Schema, endpoints, etc.
|
|
50
|
+
3. **Boundary check**: Do not register framework concepts (scripts, scaffold, roadmap, plan, etc.); sync only project business domain content
|
|
51
|
+
4. **Deduplication**: Compare with existing entries, avoid duplicate registration
|
|
52
|
+
5. **Incremental sync**: Append/modify only, do not delete existing entries
|
|
53
|
+
6. **Output change Diff**
|
|
54
|
+
|
|
55
|
+
### Hard Boundaries
|
|
56
|
+
|
|
57
|
+
- **No direct append** — Must check existing content boundary before write, avoid duplicates or conflicts
|
|
58
|
+
- **No framework concept registration** — Sync only project business domain content
|
|
59
|
+
- **No modify `03_data_governance.md`** — This Skill enforces rules, does not define them
|
|
60
|
+
|
|
61
|
+
### Output Format
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
### Data Sync Results
|
|
65
|
+
|
|
66
|
+
ADDED:
|
|
67
|
+
- dictionary.json: entities += [new entity names]
|
|
68
|
+
- error_codes.json: businessErrors += [ERR_CODE]
|
|
69
|
+
|
|
70
|
+
MODIFIED:
|
|
71
|
+
- data_snapshot.json: models.User += [new fields]
|
|
72
|
+
|
|
73
|
+
NO CHANGE:
|
|
74
|
+
- [files with no sync needed]
|
|
75
|
+
|
|
76
|
+
**Summary**: X files changed / Y added / Z modified
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
When no sync needed: `### Data Sync Results — NO CHANGES`
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
> **Intermediate output**: This Skill is a review subprogram; after producing change Diff, control returns to caller.
|