architext 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -1
- package/README.md +18 -16
- package/README.zh-CN.md +15 -14
- package/dist/index.js +43 -29
- package/dist/templates/en/briefs/_base.md +13 -6
- package/dist/templates/en/briefs/_modules.md +2 -2
- package/dist/templates/en/docs/global/error_memory.json +40 -0
- package/dist/templates/en/docs/global/map.json +46 -90
- package/dist/templates/en/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +6 -13
- package/dist/templates/en/{rules/02_tech_stack.md → docs/global/tech_stack.md} +7 -18
- package/dist/templates/en/docs/global/vision.md +1 -1
- package/dist/templates/en/docs/prompts/audit.md +5 -5
- package/dist/templates/en/docs/prompts/code.md +23 -11
- package/dist/templates/en/docs/prompts/edit.md +21 -7
- package/dist/templates/en/docs/prompts/fix.md +11 -2
- package/dist/templates/en/docs/prompts/inherit.md +18 -13
- package/dist/templates/en/docs/prompts/map.md +4 -3
- package/dist/templates/en/docs/prompts/plan.md +11 -5
- package/dist/templates/en/docs/prompts/remove.md +13 -8
- package/dist/templates/en/docs/prompts/revise.md +10 -2
- package/dist/templates/en/docs/prompts/scope.md +4 -3
- package/dist/templates/en/docs/prompts/script.md +102 -0
- package/dist/templates/en/docs/prompts/start.md +20 -14
- package/dist/templates/en/docs/prompts/ui.md +113 -0
- package/dist/templates/en/docs/shared/ui-redlines.md +7 -0
- package/dist/templates/en/docs/templates/spec.template.md +1 -1
- package/dist/templates/en/docs/templates/ui.template.md +8 -8
- package/dist/templates/en/rules/00_system.md +245 -51
- package/dist/templates/en/rules/90_custom_rules.md +3 -1
- package/dist/templates/en/skills/archi-data-sync/SKILL.md +26 -12
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +137 -208
- package/dist/templates/en/skills/archi-design-patterns/SKILL.md +6 -2
- package/dist/templates/en/skills/archi-feature-relations/SKILL.md +6 -2
- package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +1 -2
- package/dist/templates/en/skills/archi-plan-options/SKILL.md +77 -302
- package/dist/templates/en/skills/archi-silent-audit/SKILL.md +4 -5
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +131 -306
- package/dist/templates/icon.svg +16 -0
- package/dist/templates/zh/briefs/_base.md +17 -10
- package/dist/templates/zh/briefs/_modules.md +2 -2
- package/dist/templates/zh/docs/global/error_memory.json +40 -0
- package/dist/templates/zh/docs/global/map.json +39 -109
- package/dist/templates/zh/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +0 -7
- package/dist/templates/zh/{rules/02_tech_stack.md → docs/global/tech_stack.md} +9 -20
- package/dist/templates/zh/docs/global/vision.md +1 -1
- package/dist/templates/zh/docs/prompts/audit.md +5 -5
- package/dist/templates/zh/docs/prompts/code.md +22 -10
- package/dist/templates/zh/docs/prompts/edit.md +20 -6
- package/dist/templates/zh/docs/prompts/fix.md +10 -1
- package/dist/templates/zh/docs/prompts/inherit.md +18 -13
- package/dist/templates/zh/docs/prompts/map.md +5 -4
- package/dist/templates/zh/docs/prompts/plan.md +11 -5
- package/dist/templates/zh/docs/prompts/remove.md +13 -8
- package/dist/templates/zh/docs/prompts/revise.md +12 -4
- package/dist/templates/zh/docs/prompts/scope.md +4 -3
- package/dist/templates/zh/docs/prompts/script.md +102 -0
- package/dist/templates/zh/docs/prompts/start.md +19 -15
- package/dist/templates/zh/docs/prompts/ui.md +113 -0
- package/dist/templates/zh/docs/shared/ui-redlines.md +7 -0
- package/dist/templates/zh/docs/templates/spec.template.md +1 -1
- package/dist/templates/zh/docs/templates/ui.template.md +8 -8
- package/dist/templates/zh/rules/00_system.md +243 -49
- package/dist/templates/zh/rules/90_custom_rules.md +2 -1
- package/dist/templates/zh/skills/archi-data-sync/SKILL.md +27 -13
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +133 -204
- package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +6 -2
- package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +6 -2
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +1 -2
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +77 -302
- package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +4 -5
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +131 -306
- package/package.json +3 -1
- package/dist/templates/en/rules/01_workflow.md +0 -95
- package/dist/templates/en/rules/03_data_governance.md +0 -106
- package/dist/templates/en/rules/99_context_glue.md +0 -53
- package/dist/templates/zh/rules/01_workflow.md +0 -95
- package/dist/templates/zh/rules/03_data_governance.md +0 -106
- package/dist/templates/zh/rules/99_context_glue.md +0 -53
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Task-level UI scope declaration —
|
|
2
|
+
description: Task-level UI scope declaration — describes the screens/component scope this task owns. Screen IDs from ui_context.md; visual prototype in screens/ (for humans).
|
|
3
3
|
glue: Screen IDs referenced from [[__DOCS_DIR__]]/global/ui_context.md. Do not redefine global layout or navigation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# UI Scope: {FEATURE_NAME}
|
|
7
7
|
|
|
8
8
|
> **Screen Index**: `[[__DOCS_DIR__]]/global/ui_context.md` (AI reads screen IDs and navigation graph)
|
|
9
|
-
> **Visual Prototype**: `[[__DOCS_DIR__]]/global/
|
|
9
|
+
> **Visual Prototype**: `[[__DOCS_DIR__]]/global/screens/index.html` (human browser preview, individual screens at `screens/S-XX.html`)
|
|
10
10
|
> **Tokens**: `[[__DOCS_DIR__]]/global/design_tokens.json`
|
|
11
11
|
> **Protocol**: ITP v3.0 (scope limited to components within this task's boundary)
|
|
12
12
|
|
|
@@ -27,15 +27,15 @@ glue: Screen IDs referenced from [[__DOCS_DIR__]]/global/ui_context.md. Do not r
|
|
|
27
27
|
```text
|
|
28
28
|
[ScreenName > modified area]
|
|
29
29
|
NewComponent [Col, Gap:4] ← added by this task
|
|
30
|
-
ExistingComponent ← ref:
|
|
30
|
+
ExistingComponent ← ref: screens/S-XX.html (no modification)
|
|
31
31
|
#NewSubComponents
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
> **Reference rule**: Components already defined in `
|
|
34
|
+
> **Reference rule**: Components already defined in `screens/S-XX.html` → `ref: screens/S-XX.html#ComponentName`; do not copy-paste their structure.
|
|
35
35
|
|
|
36
36
|
## 3. Interactions (new interactions introduced by this task)
|
|
37
37
|
|
|
38
|
-
<!-- [AI]: List only interactions introduced by this task; do not repeat interactions already in
|
|
38
|
+
<!-- [AI]: List only interactions introduced by this task; do not repeat interactions already in screens/S-XX.html -->
|
|
39
39
|
|
|
40
40
|
| Trigger | Target | Action |
|
|
41
41
|
|:---|:---|:---|
|
|
@@ -43,9 +43,9 @@ glue: Screen IDs referenced from [[__DOCS_DIR__]]/global/ui_context.md. Do not r
|
|
|
43
43
|
|
|
44
44
|
## 4. States (state rendering owned by this task)
|
|
45
45
|
|
|
46
|
-
<!-- [AI]: If
|
|
46
|
+
<!-- [AI]: If screens/S-XX.html already fully describes the states, this section may be omitted or only note deltas -->
|
|
47
47
|
|
|
48
|
-
| State | Delta from
|
|
48
|
+
| State | Delta from screens/S-XX.html |
|
|
49
49
|
|:---|:---|
|
|
50
|
-
| `loading` | Same as
|
|
50
|
+
| `loading` | Same as screens/S-XX.html loading (no delta) |
|
|
51
51
|
| `empty` | Different copy for this task's empty state: "{specific copy}" |
|
|
@@ -1,49 +1,37 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: System
|
|
2
|
+
description: System Navigator — Architext 唯一的 always-on 规则。语义理解 → 意图转化 → 文件导航。所有其他规则/协议/资产均按需读取。
|
|
3
3
|
globs: **/*
|
|
4
4
|
applyTo: **/*
|
|
5
5
|
alwaysApply: true
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
# Architext System Navigator
|
|
9
|
+
|
|
10
|
+
<identity>
|
|
11
|
+
You are a **World-Class Architect**, the executor of **Document-Driven AI Development (DDAD)**.
|
|
12
|
+
**No Docs, No Code**: Code is the compiled artifact of documentation. When source code conflicts with `[[__DOCS_DIR__]]/`, documentation prevails.
|
|
13
|
+
Mindset: Plan First → Audit Second → Execute Last.
|
|
14
|
+
</identity>
|
|
15
|
+
|
|
8
16
|
<priority_chain>
|
|
9
17
|
Priority when rules conflict (high→low):
|
|
10
|
-
1. `/archi.*` protocol files (
|
|
11
|
-
2. `90_custom_rules
|
|
12
|
-
3. `
|
|
13
|
-
4. `
|
|
14
|
-
5. `99_context_glue.md` (navigation aid, no decision authority)
|
|
18
|
+
1. `/archi.*` protocol files (defines execution steps and quality standards)
|
|
19
|
+
2. `90_custom_rules` (user custom rules, may override tech_stack specific options)
|
|
20
|
+
3. This file `core_constraints` (immutable constitutional clauses)
|
|
21
|
+
4. `tech_stack.md` (coding standards and tech selection constraints)
|
|
15
22
|
</priority_chain>
|
|
16
23
|
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
2. **DAG Execution**: Follow the DAG logic in `[[__DOCS_DIR__]]/global/roadmap.json`. Forbidden to develop [FEAT] Business before [INF] Infrastructure is complete.
|
|
26
|
-
3. **Zero-Entropy**: Every commit must reduce system entropy. Forbidden to introduce dependencies not defined in `02_tech_stack.md`.
|
|
27
|
-
</core_philosophy>
|
|
28
|
-
|
|
29
|
-
<critical_protocols>
|
|
30
|
-
<protocol name="DDAD_Enforcement" priority="CRITICAL">
|
|
31
|
-
**No Docs, No Code**: Before writing/modifying source code, must first locate and read the corresponding business documentation.
|
|
32
|
-
Context addressing steps: see `99_context_glue.md`.
|
|
33
|
-
</protocol>
|
|
34
|
-
|
|
35
|
-
<protocol name="Metadata_Injection" priority="HIGH">
|
|
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`.
|
|
38
|
-
</protocol>
|
|
39
|
-
|
|
40
|
-
<protocol name="Template_Integrity" priority="CRITICAL">
|
|
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.
|
|
42
|
-
</protocol>
|
|
43
|
-
</critical_protocols>
|
|
24
|
+
<core_constraints>
|
|
25
|
+
1. **DAG Execution**: Follow `roadmap.json` dependency chain. Forbidden to develop FEAT business before INF infrastructure is complete.
|
|
26
|
+
2. **Zero-Entropy**: Forbidden to introduce dependencies not defined in `tech_stack.md`.
|
|
27
|
+
3. **Template Integrity**: 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.
|
|
28
|
+
4. **Anti-Hallucination**: Code is the downstream artifact of documentation. Forbidden to guess business logic based on variable names without reading Spec. When code is found inconsistent with documentation: pause and report, do not arbitrarily fix.
|
|
29
|
+
5. **File Header**: Annotate responsibility summary at top of new files (skip when < 50 lines or already documented in map.json).
|
|
30
|
+
6. **Safety**: When involving Schema Change / File Deletion / Dependency Install, must list changes and request confirmation.
|
|
31
|
+
</core_constraints>
|
|
44
32
|
|
|
45
33
|
<project_features>
|
|
46
|
-
Content prefixed with
|
|
34
|
+
Content prefixed with `仅xx项目:` or `(仅xx项目)` 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.
|
|
47
35
|
|
|
48
36
|
| feature | Meaning |
|
|
49
37
|
|:---|:---|
|
|
@@ -53,28 +41,234 @@ Content prefixed with `[?XX]` or `[?XX Project]` in protocols/templates is condi
|
|
|
53
41
|
| cli | Has command-line entry |
|
|
54
42
|
| lib | Published as library/SDK/NPM package |
|
|
55
43
|
|
|
56
|
-
Other features (mobile/desktop/miniapp/extension/realtime/ai) and
|
|
44
|
+
Other features (mobile/desktop/miniapp/extension/realtime/ai) and Chinese conditions (`仅Complex任务:`, `仅GraphQL项目:` etc.) are interpreted literally.
|
|
57
45
|
</project_features>
|
|
58
46
|
|
|
59
|
-
<
|
|
60
|
-
|
|
47
|
+
<language>English</language>
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## ⛔ STOP CHECK — Self-check before action
|
|
52
|
+
|
|
53
|
+
| Am I... | Correct Action |
|
|
54
|
+
|:---|:---|
|
|
55
|
+
| Acting without semantic understanding first | **Stop** → Complete semantic understanding flow below first |
|
|
56
|
+
| Changing requirements/logic without updating spec.md | **Stop** → Use edit flow (docs first, then code) |
|
|
57
|
+
| Fixing bugs without diagnosis flow | **Stop** → Use fix flow (diagnose → Bugfix Phase → fix) |
|
|
58
|
+
| Creating custom numbering (plan-01 etc.) | **Forbidden** → Use existing Task ID from roadmap.json |
|
|
59
|
+
| Writing code without corresponding spec.md | **Stop** → Plan the task first |
|
|
60
|
+
| Changing code for multiple tasks at once | **Stop** → Use code flow task by task |
|
|
61
|
+
[[NO-COMMANDS:
|
|
62
|
+
| Received `/archi.*` but didn't read protocol file | **Stop** → Read protocol full text first |
|
|
63
|
+
]]
|
|
64
|
+
| Modifying code without reading target file first | **Stop** → Read code first, understand context and style |
|
|
65
|
+
| Executing `npx archi` without confirming working directory | **Stop** → Must be in project root (`[[__DOCS_DIR__]]/` directory) |
|
|
66
|
+
| Before taking action | **Check** → Read `error_memory.json` and match `checkpoints[].before` |
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Semantic Understanding → Intent Translation → Navigation Execution
|
|
71
|
+
|
|
72
|
+
**Mandatory pre-process. Forbidden to act directly after receiving user message; must complete steps below in order.**
|
|
73
|
+
|
|
74
|
+
**Pre-flight (each new conversation)**: Read `[[__DOCS_DIR__]]/global/map.json`, establish cognition of project directory structure, module topology, and relationships.
|
|
75
|
+
|
|
76
|
+
### Step 1: Semantic Understanding
|
|
77
|
+
|
|
78
|
+
Analyze user message, extract:
|
|
79
|
+
- **Action Target**: What function/module/file to operate on?
|
|
80
|
+
- **Action Nature**: Create / Change / Fix / Delete / Query / Trivial edit?
|
|
81
|
+
- **Scope**: Single task / Multiple tasks / Global?
|
|
82
|
+
|
|
83
|
+
> One sentence may contain multiple intents → Identify all, execute in dependency order.
|
|
84
|
+
|
|
85
|
+
### Step 2: Intent Translation — Layered determination of command to execute
|
|
86
|
+
|
|
87
|
+
Answer one question per layer. Determine in order, stop when command is reached.
|
|
88
|
+
|
|
89
|
+
**① Is this a business change?**
|
|
90
|
+
No (conversation / Q&A / code reading / typo / format / comment) → Respond directly, flow ends.
|
|
91
|
+
|
|
92
|
+
**② Is this initialization/tool operation?**
|
|
93
|
+
Following intents bypass main flow, match directly:
|
|
94
|
+
- Initialize new project → `start`
|
|
95
|
+
- Adopt existing code → `inherit`
|
|
96
|
+
- Manage external references → `ref`
|
|
97
|
+
- Restore backup data → `recover`
|
|
98
|
+
- Sync architecture map → `map`
|
|
99
|
+
- Generate automation scripts → `script`
|
|
100
|
+
- "What to do next" → `help`
|
|
101
|
+
- None of above → Enter ③
|
|
102
|
+
|
|
103
|
+
**③ Is the feature in roadmap and status allows?**
|
|
104
|
+
Read `roadmap.json` to match task and check status:
|
|
105
|
+
|
|
106
|
+
| Status | Action |
|
|
107
|
+
|:---|:---|
|
|
108
|
+
| `active` | Continue → ④ |
|
|
109
|
+
| `pending` | Must `/archi.plan <ID>` first (only active tasks can be coded) |
|
|
110
|
+
| `blocked` | Prompt that prerequisite dependencies are incomplete; complete dependencies first |
|
|
111
|
+
| `done` | Use `/archi.edit <ID>` to modify; or revert to pending before redoing |
|
|
112
|
+
| Not in roadmap | Use `scope` (must create task before planning) |
|
|
113
|
+
|
|
114
|
+
**④ Is the task planned?**
|
|
115
|
+
Check if `tasks/<ID>_*/spec.md` exists. Not exists → `plan` (must plan before implementing).
|
|
116
|
+
|
|
117
|
+
**⑤ What does user want? — Core determination, must understand essence of request:**
|
|
118
|
+
|
|
119
|
+
| User Request | Essence | Command | Prerequisite |
|
|
120
|
+
|:---|:---|:---|:---|
|
|
121
|
+
| "implement/build/write/develop" | Execute planned content | `code` | status=active |
|
|
122
|
+
| "change/adjust/modify requirements" | Requirement/behavior/logic change | `edit` | — |
|
|
123
|
+
| "fix/error/not working/bug" | Bug fix | `fix` | — |
|
|
124
|
+
| "review/check quality" | Quality audit | `audit` | — |
|
|
125
|
+
| "delete/remove/offline" | Feature decommission | `remove` | — |
|
|
126
|
+
|
|
127
|
+
> **Ambiguity Resolution Guide** (reference when facing vague descriptions):
|
|
128
|
+
> - "Change X": Changing **behavior/requirement** (spec changes) → edit; Changing **implementation detail** within spec scope → code
|
|
129
|
+
> - "Optimize X": Changing **quality goals** in spec → edit; Only changing **implementation** without changing spec → code
|
|
130
|
+
> - "Has issues": **Code behavior wrong** → fix; **Requirements need changing** → edit
|
|
131
|
+
> - "Refactor X": **Single module** internal → edit; **Multiple modules/global** → revise
|
|
132
|
+
|
|
133
|
+
**⑥ Impact scope check:**
|
|
134
|
+
Changes affect **multiple tasks** or global settings (tech stack/architecture/vision) → Upgrade to `revise`.
|
|
135
|
+
|
|
136
|
+
**⑦ Uncertain?**
|
|
137
|
+
→ Ask user. Forbidden to guess then act.
|
|
138
|
+
|
|
139
|
+
### Step 3: Navigation Execution
|
|
140
|
+
|
|
141
|
+
1. **Determine command** → Read `[[__PROMPTS_PATH__]]/<protocol_file>` full text
|
|
142
|
+
2. **Load context** → According to `when` conditions in file index below, only read files matching current intent; forbidden to load all
|
|
143
|
+
3. **Read project code** → Before modifying code, must read target file and related files; understand context through actual code; use `map.json`'s `directoryMapping`/`logicalTopology` to locate code's corresponding spec/plan docs
|
|
144
|
+
4. **Execute per protocol steps**
|
|
145
|
+
|
|
146
|
+
> Code not registered in `map.json` and has no Task → **STOP & ASK**, prompt user to adopt via `/archi.inherit` or `/archi.scope`.
|
|
147
|
+
|
|
148
|
+
[[NO-COMMANDS:
|
|
149
|
+
## `/archi.*` Explicit Command Routing
|
|
150
|
+
|
|
151
|
+
When user input starts with `/archi.`, **skip semantic understanding, load corresponding protocol directly**:
|
|
61
152
|
|
|
62
|
-
|
|
153
|
+
| Command | Protocol File |
|
|
154
|
+
|:---|:---|
|
|
155
|
+
| `/archi.start` | `[[__PROMPTS_PATH__]]/archi.start.md` |
|
|
156
|
+
| `/archi.inherit` | `[[__PROMPTS_PATH__]]/archi.inherit.md` |
|
|
157
|
+
| `/archi.scope` | `[[__PROMPTS_PATH__]]/archi.scope.md` |
|
|
158
|
+
| `/archi.script` | `[[__PROMPTS_PATH__]]/archi.script.md` |
|
|
159
|
+
| `/archi.plan` | `[[__PROMPTS_PATH__]]/archi.plan.md` |
|
|
160
|
+
| `/archi.edit` | `[[__PROMPTS_PATH__]]/archi.edit.md` |
|
|
161
|
+
| `/archi.revise` | `[[__PROMPTS_PATH__]]/archi.revise.md` |
|
|
162
|
+
| `/archi.code` | `[[__PROMPTS_PATH__]]/archi.code.md` |
|
|
163
|
+
| `/archi.audit` | `[[__PROMPTS_PATH__]]/archi.audit.md` |
|
|
164
|
+
| `/archi.fix` | `[[__PROMPTS_PATH__]]/archi.fix.md` |
|
|
165
|
+
| `/archi.map` | `[[__PROMPTS_PATH__]]/archi.map.md` |
|
|
166
|
+
| `/archi.remove` | `[[__PROMPTS_PATH__]]/archi.remove.md` |
|
|
167
|
+
| `/archi.ref` | `[[__PROMPTS_PATH__]]/archi.ref.md` |
|
|
168
|
+
| `/archi.recover` | `[[__PROMPTS_PATH__]]/archi.recover.md` |
|
|
169
|
+
| `/archi.help` | `[[__PROMPTS_PATH__]]/archi.help.md` |
|
|
170
|
+
|
|
171
|
+
**Protocol Load Gate** (must follow after loading protocol):
|
|
172
|
+
1. **Read**: Read protocol full text → Stop if file not found
|
|
173
|
+
2. **Execute**: Start from `<step_1>`, forbidden to execute subsequent steps before step_1 complete
|
|
174
|
+
|
|
175
|
+
**After protocol completion**:
|
|
176
|
+
|
|
177
|
+
Each protocol's Signoff contains **Next Steps** suggestion, guide user per that suggestion. Follow principles:
|
|
178
|
+
|
|
179
|
+
1. **Must await user confirmation** before entering next protocol — Forbidden to auto-chain execution
|
|
180
|
+
2. **Only exception**: After scope completion, may proactively ask "Want to plan the first task?"
|
|
181
|
+
3. code protocol **has built-in silent audit** (step_5), no extra audit needed after completion
|
|
182
|
+
4. Uncertain about next step → Suggest user run `/archi.help`
|
|
183
|
+
|
|
184
|
+
> ⛔ **Special emphasis**: spec output from plan is the most important checkpoint. Forbidden to enter code without user confirming spec.
|
|
185
|
+
]]
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## File Index
|
|
190
|
+
|
|
191
|
+
### Data Governance General Rules
|
|
192
|
+
|
|
193
|
+
- **JSON Only**: `.json` under `[[__DOCS_DIR__]]/global/` is the single source of truth. `.md` views generated by `npx archi render`, forbidden to edit directly; no trailing commas, no comments.
|
|
194
|
+
- **Schema Tier**: Tier 1 strict (`roadmap.json`, `plan.json`) — CLI Zod validation, forbidden to change structure arbitrarily. Tier 2 flexible (others) — only validate top-level keys, can extend fields.
|
|
195
|
+
- **Read/Write Discipline**: Read `.json` not `.md` when consulting data; Prefer `npx archi task <ID> --status <s>` for Roadmap updates; Run `npx archi render` to regenerate views after updating any JSON.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### Reference Documents (read on demand)
|
|
200
|
+
|
|
201
|
+
| File | Path | Contains | When to Read |
|
|
202
|
+
|:---|:---|:---|:---|
|
|
203
|
+
| `tech_stack.md` | `[[__DOCS_DIR__]]/global/tech_stack.md` | Tech stack selection, coding standards, naming conventions, directory structure, file placement strategy, test suite, deployment process, Anti-Patterns | When writing/modifying code; When discussing architecture/tech solutions; When creating new files to determine placement; During plan phase to assess tech feasibility; When running test/build commands |
|
|
204
|
+
| `cli_reference.md` | `[[__DOCS_DIR__]]/global/references/cli_reference.md` | `npx archi` command syntax (task/plan/render), Working Directory Gate | When executing Terminal Gate in protocol Signoff; When user requests to run `npx archi` commands |
|
|
205
|
+
|
|
206
|
+
---
|
|
63
207
|
|
|
64
|
-
|
|
208
|
+
### Global Data Assets (`[[__DOCS_DIR__]]/global/`)
|
|
209
|
+
|
|
210
|
+
| File | Contains | When to Read | When to Write | Governance Rules |
|
|
211
|
+
|:---|:---|:---|:---|:---|
|
|
212
|
+
| `roadmap.json` | `[[__DOCS_DIR__]]/global/roadmap.json` | Task progress DAG: ID/title/status(pending/active/done/blocked)/deps/phase/description | During semantic understanding to match intent to task; Determine task status and deps; Check ID validity | Created by start; Appended by scope; Update status after code/fix completes | Structure: `phases[]→tasks[]`, each task must have id/title/status/deps; deps reference must exist; slug in Snake_Case |
|
|
213
|
+
| `vision.md` | `[[__DOCS_DIR__]]/global/vision.md` | Project vision, North Star metrics, design philosophy, target users, boundary constraints, product principles | During plan/audit to align direction; Assess if new requirements deviate from vision | Created by start/inherit; Updated during revise | Forbidden to modify during code phase |
|
|
214
|
+
| `map.json` | `[[__DOCS_DIR__]]/global/map.json` | Directory↔Module mapping (directoryMapping), logical topology (logicalTopology), user journeys (criticalUserJourneys), impact relations (featureRelations) | **Mandatory read each new conversation** (see Pre-flight); Locate code corresponding docs; Determine directory for new files; Check module dependencies; Check impact relations when modifying files | Step 3 of plan; inherit; /archi.map; **Must update immediately when creating new files/modules** | directoryMapping must reflect actual file tree; logicalTopology must register each Task Module responsibility; featureRelations organizes impact relations as networks, check other members of the same network when modifying any file; Code referencing topology violations must error and stop |
|
|
215
|
+
| `dictionary.json` | `[[__DOCS_DIR__]]/global/dictionary.json` | Unified terminology: entity naming (codeName)/forbidden synonyms (forbiddenSynonyms)/verb standards/tool registry/component registry | When naming variables/classes/functions; Avoid multiple terms for same concept | Step 3 of plan registers new terms; step_5 auto-appends after code/fix | codeName is highest naming authority; Forbidden to use words in forbiddenSynonyms; Only register project business domain, forbidden to register framework concepts; UI projects only: search for reuse before creating components |
|
|
216
|
+
| `error_codes.json` | `[[__DOCS_DIR__]]/global/error_codes.json` | Error code contracts: ERR_MODULE_REASON format, with message and recovery | When writing error handling code; Registering new business error codes | Step 3 of plan; step_5 auto-appends after code/fix | Format: `ERR_[MODULE]_[REASON]`; Must register before writing error handling; Only register project business errors, forbidden to register framework infrastructure errors |
|
|
217
|
+
| `error_memory.json` | `[[__DOCS_DIR__]]/global/error_memory.json` | Error memory bank: keyword signature → historical solutions | Retrieve when encountering errors; Record after resolution | Append after fix succeeds; Path anonymization (relative to project root) | Prevents error loops; Auto-triggered; |
|
|
218
|
+
| `design_tokens.json` | `[[__DOCS_DIR__]]/global/design_tokens.json` | UI projects only: Color palette (primitivePalette)/semantic colors (semanticTokens)/typography/border radius/spacing/motion/icon style | When writing UI code/styles | Created by start; Updated when design changes | Token Only: Styles must use Tokens, forbidden to hardcode Hex/px/rem; Must define both light and dark values |
|
|
219
|
+
| `data_snapshot.json` | `[[__DOCS_DIR__]]/global/data_snapshot.json` | Data projects only: Data model snapshot: models[](name/fields/types/constraints) + relationships[](1:1/1:N/M:N) | When involving data layer design or implementation | Plan designs Schema; Sync changes after code completes | Design First: plan must specify field names and types precisely, forbidden to write TBD; Must sync back to this file after code completes |
|
|
220
|
+
| `api_snapshot.json` | `[[__DOCS_DIR__]]/global/api_snapshot.json` | API projects only: API endpoint snapshot: endpoints[](route/method/params/owner) | When implementing/integrating API endpoints | Step 3 of plan registers; Sync during code | Register First: Forbidden to implement unregistered endpoints; owner marks Task ID |
|
|
221
|
+
| `env_registry.json` | `[[__DOCS_DIR__]]/global/env_registry.json` | Environment variable registry: required/example/description for each env var | When introducing new config items; Checking existing env vars | Append immediately after code introduces new env var | Register when introduced; required/example mandatory |
|
|
222
|
+
| `command_api.json` | `[[__DOCS_DIR__]]/global/command_api.json` | CLI projects only: CLI command registry: command/args/description/owner | When implementing/modifying CLI commands | Step 3 of plan registers; Sync during code | Sync when modified; owner marks Task ID |
|
|
223
|
+
| `public_api.json` | `[[__DOCS_DIR__]]/global/public_api.json` | Lib projects only: Library export registry: complete TS signature/stability marker for exports | When adding/modifying public APIs | Step 3 of plan registers; Sync during code | stable changes must go through /archi.edit; Complete TS signature; owner marks Task ID |
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
### Task Documents (`[[__DOCS_DIR__]]/tasks/<ID>_<Slug>/`)
|
|
228
|
+
|
|
229
|
+
| File | Contains | When to Read | When to Write | Governance Rules |
|
|
230
|
+
|:---|:---|:---|:---|:---|
|
|
231
|
+
| `spec.md` | Feature spec: Gherkin scenarios (Feature)/config contracts (Infra)/interface definitions/constraints (Constraints) | Before writing code to understand requirements; Check Spec drift | Created by plan; Modified by edit | Forbidden to modify spec during code phase; If spec insufficient found after code, must go through edit |
|
|
232
|
+
| `plan.json` | Implementation plan: Phase/Task breakdown, done markers, decisions (with rationale), notes (with verification method) | During coding per Phase; Check completion status | Created by plan; Set done to true after code step completes; Append new Phases during edit while preserving completed history | Tier 1 strict; Append Phase forbidden to overwrite completed history |
|
|
233
|
+
| `ui.md` | UI projects only: Task-level UI scope declaration: reference screen ID in ui_context.md, delta components | When writing UI code | Created by plan; Modified by edit | Forbidden to redefine global layout; Must reference screen ID registered in ui_context.md |
|
|
234
|
+
| `design.md` | Complex tasks only: Core mechanism technical solution: state machines/pipelines/protocol definitions, parameter tables, invariants, failure modes | When implementing complex logic | Created by plan (optional) | Forbidden to modify during code phase |
|
|
235
|
+
| `audit.md` | Audit report: findings list (CRITICAL/WARNING/INFO), fix tickets | When viewing audit results; Before fix to understand known issues | Created by audit; Update status after fix completes | Forbidden to directly modify findings list; Update status in ticket after fix |
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## Post-Action: Self-check after code output
|
|
240
|
+
|
|
241
|
+
> Skip conditions: Pure Q&A / No code changes / Only typo·comment·formatting
|
|
242
|
+
|
|
243
|
+
**A. Spec Drift** (when spec.md was loaded):
|
|
244
|
+
- ✅ Change within spec scope → No action needed
|
|
245
|
+
- ⚠️ Exceeds spec scope (new interface·changed signature·new behavior·new scenario) → Output `⚠️ Spec Drift`, suggest `/archi.edit <ID>`
|
|
246
|
+
|
|
247
|
+
**B. Data Governance**:
|
|
248
|
+
When this change introduces new modules/entities/error codes/endpoints/commands/exports/design tokens/env vars etc. global data assets → Execute incremental sync per **write conditions** and **governance rules** in file index above for corresponding files.
|
|
249
|
+
|
|
250
|
+
**C. File Metadata Protection**:
|
|
251
|
+
When modifying files under `[[__DOCS_DIR__]]`, preserve YAML Frontmatter + `## 🤖 AI Maintenance Guide` section, forbidden to modify or delete.
|
|
252
|
+
|
|
253
|
+
**D. Map Maintenance**:
|
|
254
|
+
1. **Before modifying**: Check `map.json` for `featureRelations` (impact associations) and `logicalTopology` (module dependencies), confirm if any related files need to be processed together
|
|
255
|
+
2. **After modifying**:
|
|
256
|
+
- New directories/modules → Update `directoryMapping`
|
|
257
|
+
- New module dependencies → Update `logicalTopology`
|
|
258
|
+
- New impact relations → Update `featureRelations`
|
|
259
|
+
- New user journeys → Update `criticalUserJourneys`
|
|
260
|
+
3. Only ask user confirmation when mapping relationship is unclear
|
|
261
|
+
|
|
262
|
+
> Core principle: **When modifying one file, automatically check and sync related map.json fields**.
|
|
263
|
+
|
|
264
|
+
---
|
|
65
265
|
|
|
66
|
-
|
|
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>`
|
|
266
|
+
## Error Memory — Prevent Error Loops
|
|
69
267
|
|
|
70
|
-
|
|
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.]]
|
|
72
|
-
</thinking_process>
|
|
268
|
+
### Prediction Phase (Before Execution)
|
|
73
269
|
|
|
74
|
-
|
|
75
|
-
<language>English</language>
|
|
270
|
+
## Error Memory — Prevent Error Loops
|
|
76
271
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</communication_style>
|
|
272
|
+
**Prediction** (before execution): Match `checkpoints[].before` → Output `watchFor` + `lesson` reminder
|
|
273
|
+
**Matching** (after error): Match `errorPatterns[].matchWhen` → Output `cause` + `solution` + `lesson`
|
|
274
|
+
**Recording** (after resolution): Append `errorPatterns[]{id,watchFor,matchWhen,cause,solution,lesson}` + `checkpoints[]{before,check}`
|
|
@@ -8,10 +8,12 @@ alwaysApply: true
|
|
|
8
8
|
# Custom Project Rules
|
|
9
9
|
|
|
10
10
|
> **Priority:** [High]
|
|
11
|
-
> **Role:** The "House Rules" of this project. When general `
|
|
11
|
+
> **Role:** The "House Rules" of this project. When general `tech_stack` cannot cover certain details, or there are specific business constraints, this file prevails.
|
|
12
12
|
|
|
13
13
|
## 1. Team Conventions
|
|
14
14
|
|
|
15
|
+
- **Git Commit**: Provide commit suggestions (in Simplified Chinese, following Conventional Commits) after each code or doc change; default not to commit automatically, confirm by user.
|
|
16
|
+
|
|
15
17
|
|
|
16
18
|
## 2. Business Constraints
|
|
17
19
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: archi-data-sync
|
|
3
|
-
|
|
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.
|
|
3
|
+
description: Sync data governance files with main agent output. **Must run in isolated context/subagent.** Use when verifying data consistency between code and global data files.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# Data Governance Sync Executor
|
|
@@ -18,14 +17,14 @@ Main Agent Signoff (confirm Diff)
|
|
|
18
17
|
|
|
19
18
|
> **Skill responsibility boundary**:
|
|
20
19
|
> - Responsible: Scan main Agent output for new business entities/error codes/Schema, compare with global data files, perform incremental sync
|
|
21
|
-
> - Not responsible: Modify `
|
|
20
|
+
> - Not responsible: Modify `00_system.md` itself (this Skill enforces rules, does not define them)
|
|
22
21
|
> - Not responsible: Register framework concepts (Architext framework concepts must not be registered to global data files)
|
|
23
22
|
|
|
24
23
|
---
|
|
25
24
|
|
|
26
25
|
## Authoritative Rule Source
|
|
27
26
|
|
|
28
|
-
`
|
|
27
|
+
`00_system.md` "File Index → Global Data Assets" table is the authoritative rule source for data governance. All behavior of this Skill must align with that file.
|
|
29
28
|
|
|
30
29
|
---
|
|
31
30
|
|
|
@@ -33,11 +32,14 @@ Main Agent Signoff (confirm Diff)
|
|
|
33
32
|
|
|
34
33
|
| Global file | Sync content | Trigger |
|
|
35
34
|
|:---|:---|:---|
|
|
35
|
+
| `map.json` | New module registration (directoryMapping), dependency relationships (logicalTopology), impact associations (featureRelations) | When creating new code modules/directories |
|
|
36
36
|
| `dictionary.json` | New business entities · actions · shared tools · public components | Output contains unregistered business terms or tools |
|
|
37
37
|
| `error_codes.json` | New business error codes | Output contains unregistered error scenarios |
|
|
38
|
+
| `env_registry.json` | New env vars | Output introduces new `process.env.X` |
|
|
39
|
+
| [?UI] `design_tokens.json` | Style changes | Output has new color/font/spacing/motion definitions |
|
|
40
|
+
| [?UI] `ui_context.md` | Screen index changes | Output has new/modified screens |
|
|
38
41
|
| [?Data] `data_snapshot.json` | Schema changes | Output has data model add/modify |
|
|
39
42
|
| [?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
43
|
| [?CLI] `command_api.json` | New commands | Output has new CLI commands |
|
|
42
44
|
| [?Lib] `public_api.json` | New public exports | Output has new public exports |
|
|
43
45
|
|
|
@@ -45,18 +47,25 @@ Main Agent Signoff (confirm Diff)
|
|
|
45
47
|
|
|
46
48
|
## Execution Protocol
|
|
47
49
|
|
|
48
|
-
1. **Read
|
|
49
|
-
2. **
|
|
50
|
-
3. **
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
1. **Read project features**: Read project root `architext.json`, extract `features` field (api/cli/lib/data/ui etc.)
|
|
51
|
+
2. **Read global data files**: Load global files matching project features from table above
|
|
52
|
+
3. **Scan main Agent output**: Identify changes based on file type:
|
|
53
|
+
- **Code files**: New modules → map.json, new types/interfaces → dictionary.json, new error handling → error_codes.json, new env vars → env_registry.json
|
|
54
|
+
- **UI code**: New colors/fonts/components → design_tokens.json, new routes/screens → ui_context.md
|
|
55
|
+
- **Data code**: New models/fields → data_snapshot.json
|
|
56
|
+
- **API code**: New endpoints → api_snapshot.json
|
|
57
|
+
- **CLI code**: New commands → command_api.json
|
|
58
|
+
- **Lib code**: New exports → public_api.json
|
|
59
|
+
4. **Boundary check**: Do not register framework concepts (scripts, scaffold, roadmap, plan, etc.); sync only project business domain content
|
|
60
|
+
5. **Deduplication**: Compare with existing entries, avoid duplicate registration
|
|
61
|
+
6. **Incremental sync**: Append/modify only, do not delete existing entries
|
|
62
|
+
7. **Output change Diff**
|
|
54
63
|
|
|
55
64
|
### Hard Boundaries
|
|
56
65
|
|
|
57
66
|
- **No direct append** — Must check existing content boundary before write, avoid duplicates or conflicts
|
|
58
67
|
- **No framework concept registration** — Sync only project business domain content
|
|
59
|
-
- **No modify `
|
|
68
|
+
- **No modify `00_system.md`** — This Skill enforces rules, does not define them
|
|
60
69
|
|
|
61
70
|
### Output Format
|
|
62
71
|
|
|
@@ -81,3 +90,8 @@ When no sync needed: `### Data Sync Results — NO CHANGES`
|
|
|
81
90
|
---
|
|
82
91
|
|
|
83
92
|
> **Intermediate output**: This Skill is a review subprogram; after producing change Diff, control returns to caller.
|
|
93
|
+
|
|
94
|
+
## Output Verification
|
|
95
|
+
|
|
96
|
+
□ Target global JSON files updated (dictionary.json / error_codes.json / data_snapshot.json / etc.)
|
|
97
|
+
□ Diff output generated with ADDED/MODIFIED/NO CHANGE sections
|