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.
Files changed (78) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/README.md +18 -16
  3. package/README.zh-CN.md +15 -14
  4. package/dist/index.js +43 -29
  5. package/dist/templates/en/briefs/_base.md +13 -6
  6. package/dist/templates/en/briefs/_modules.md +2 -2
  7. package/dist/templates/en/docs/global/error_memory.json +40 -0
  8. package/dist/templates/en/docs/global/map.json +46 -90
  9. package/dist/templates/en/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +6 -13
  10. package/dist/templates/en/{rules/02_tech_stack.md → docs/global/tech_stack.md} +7 -18
  11. package/dist/templates/en/docs/global/vision.md +1 -1
  12. package/dist/templates/en/docs/prompts/audit.md +5 -5
  13. package/dist/templates/en/docs/prompts/code.md +23 -11
  14. package/dist/templates/en/docs/prompts/edit.md +21 -7
  15. package/dist/templates/en/docs/prompts/fix.md +11 -2
  16. package/dist/templates/en/docs/prompts/inherit.md +18 -13
  17. package/dist/templates/en/docs/prompts/map.md +4 -3
  18. package/dist/templates/en/docs/prompts/plan.md +11 -5
  19. package/dist/templates/en/docs/prompts/remove.md +13 -8
  20. package/dist/templates/en/docs/prompts/revise.md +10 -2
  21. package/dist/templates/en/docs/prompts/scope.md +4 -3
  22. package/dist/templates/en/docs/prompts/script.md +102 -0
  23. package/dist/templates/en/docs/prompts/start.md +20 -14
  24. package/dist/templates/en/docs/prompts/ui.md +113 -0
  25. package/dist/templates/en/docs/shared/ui-redlines.md +7 -0
  26. package/dist/templates/en/docs/templates/spec.template.md +1 -1
  27. package/dist/templates/en/docs/templates/ui.template.md +8 -8
  28. package/dist/templates/en/rules/00_system.md +245 -51
  29. package/dist/templates/en/rules/90_custom_rules.md +3 -1
  30. package/dist/templates/en/skills/archi-data-sync/SKILL.md +26 -12
  31. package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +137 -208
  32. package/dist/templates/en/skills/archi-design-patterns/SKILL.md +6 -2
  33. package/dist/templates/en/skills/archi-feature-relations/SKILL.md +6 -2
  34. package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +1 -2
  35. package/dist/templates/en/skills/archi-plan-options/SKILL.md +77 -302
  36. package/dist/templates/en/skills/archi-silent-audit/SKILL.md +4 -5
  37. package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +131 -306
  38. package/dist/templates/icon.svg +16 -0
  39. package/dist/templates/zh/briefs/_base.md +17 -10
  40. package/dist/templates/zh/briefs/_modules.md +2 -2
  41. package/dist/templates/zh/docs/global/error_memory.json +40 -0
  42. package/dist/templates/zh/docs/global/map.json +39 -109
  43. package/dist/templates/zh/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +0 -7
  44. package/dist/templates/zh/{rules/02_tech_stack.md → docs/global/tech_stack.md} +9 -20
  45. package/dist/templates/zh/docs/global/vision.md +1 -1
  46. package/dist/templates/zh/docs/prompts/audit.md +5 -5
  47. package/dist/templates/zh/docs/prompts/code.md +22 -10
  48. package/dist/templates/zh/docs/prompts/edit.md +20 -6
  49. package/dist/templates/zh/docs/prompts/fix.md +10 -1
  50. package/dist/templates/zh/docs/prompts/inherit.md +18 -13
  51. package/dist/templates/zh/docs/prompts/map.md +5 -4
  52. package/dist/templates/zh/docs/prompts/plan.md +11 -5
  53. package/dist/templates/zh/docs/prompts/remove.md +13 -8
  54. package/dist/templates/zh/docs/prompts/revise.md +12 -4
  55. package/dist/templates/zh/docs/prompts/scope.md +4 -3
  56. package/dist/templates/zh/docs/prompts/script.md +102 -0
  57. package/dist/templates/zh/docs/prompts/start.md +19 -15
  58. package/dist/templates/zh/docs/prompts/ui.md +113 -0
  59. package/dist/templates/zh/docs/shared/ui-redlines.md +7 -0
  60. package/dist/templates/zh/docs/templates/spec.template.md +1 -1
  61. package/dist/templates/zh/docs/templates/ui.template.md +8 -8
  62. package/dist/templates/zh/rules/00_system.md +243 -49
  63. package/dist/templates/zh/rules/90_custom_rules.md +2 -1
  64. package/dist/templates/zh/skills/archi-data-sync/SKILL.md +27 -13
  65. package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +133 -204
  66. package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +6 -2
  67. package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +6 -2
  68. package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +1 -2
  69. package/dist/templates/zh/skills/archi-plan-options/SKILL.md +77 -302
  70. package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +4 -5
  71. package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +131 -306
  72. package/package.json +3 -1
  73. package/dist/templates/en/rules/01_workflow.md +0 -95
  74. package/dist/templates/en/rules/03_data_governance.md +0 -106
  75. package/dist/templates/en/rules/99_context_glue.md +0 -53
  76. package/dist/templates/zh/rules/01_workflow.md +0 -95
  77. package/dist/templates/zh/rules/03_data_governance.md +0 -106
  78. package/dist/templates/zh/rules/99_context_glue.md +0 -53
@@ -18,14 +18,14 @@
18
18
 
19
19
  ---
20
20
 
21
- ## Core Tasks
21
+ ## Functional Requirements
22
22
 
23
- > Must-have tasks, each in one paragraph describing expected behavior.
24
- > Detailed specs are defined in `/archi.plan`; here just clarify "what to build."
23
+ > Core capabilities to implement—describe "what" not "how."
24
+ > AI will decompose these into implementation tasks; here just clarify the business goal.
25
25
 
26
- 1.
27
- 2.
28
- 3.
26
+ -
27
+ -
28
+ -
29
29
 
30
30
  ---
31
31
 
@@ -84,6 +84,13 @@
84
84
  **Directory structure**: [already defined → describe key dirs / none (AI generates based on pattern)]
85
85
  **Branching strategy**: [e.g.: Trunk-based / Git Flow / GitHub Flow]
86
86
  **Commit convention**: [e.g.: Conventional Commits (feat/fix/chore) / custom → describe]
87
+
88
+ **AI Git Workflow** (Git conventions when AI runs `/archi.code`):
89
+ - **Auto commit**: [Yes - auto git commit after each Task / No - generate commit message only, user commits manually]
90
+ - **Commit granularity**: [Per Task / Per Phase / As needed]
91
+ - **Branching**: [Work directly on main / Create branch per Task `feat/{task-id}`]
92
+ - **Auto push**: [Yes / No]
93
+
87
94
  **Testing preference**: [e.g.: Vitest / Jest / pytest / no special requirements]
88
95
 
89
96
  ---
@@ -10,7 +10,7 @@
10
10
 
11
11
  > If you already know core data entities and relationships, describe them here. No need for full schema—list entity names and key fields.
12
12
  > AI will generate detailed data model in `/archi.plan`; here just clarify "what data exists."
13
- > Leave blank if not applicable; AI will derive from core tasks.
13
+ > Leave blank if not applicable; AI will derive from core features.
14
14
 
15
15
  <!-- Format reference:
16
16
  - **User**: email, name, role (admin/user), avatar
@@ -71,7 +71,7 @@
71
71
 
72
72
  ### Visual Reference
73
73
 
74
- > Provides aesthetic input for AI—directly impacts `ui_concept.html` visual quality.
74
+ > Provides aesthetic input for AI—directly impacts visual quality of screen prototypes in the `screens/` directory.
75
75
  > Any field below is valid; the more you fill, the better AI can match your expected style.
76
76
 
77
77
  **Competitor/inspiration screenshots**: [paste image / Figma link / URL]
@@ -0,0 +1,40 @@
1
+ {
2
+ "errorPatterns": {
3
+ "_comment": "Error patterns: { id: unique identifier, watchFor: [scenarios to watch before execution], matchWhen: [keywords to match after error], cause: root cause, solution: solution, lesson: lesson/principle }. AI appends here after resolving errors",
4
+ "examples": [
5
+ {
6
+ "id": "build-vite-config-missing",
7
+ "watchFor": ["Run npm run build", "Modify vite.config.ts"],
8
+ "matchWhen": ["ENOENT", "vite.config", "Cannot find module"],
9
+ "cause": "Config file deleted or node_modules not installed",
10
+ "solution": "Check file existence, run npm install to reinstall deps",
11
+ "lesson": "Backup before modifying configs, regularly verify node_modules integrity"
12
+ },
13
+ {
14
+ "id": "type-import-assertion-deprecated",
15
+ "watchFor": ["Import JSON files"],
16
+ "matchWhen": ["assert", "SyntaxError", "import", "type"],
17
+ "cause": "Node.js 18+ deprecated import assert syntax, use import attributes instead",
18
+ "solution": "Change assert { type: 'json' } to with { type: 'json' }",
19
+ "lesson": "Watch Node.js version updates, verify import JSON syntax for your version"
20
+ }
21
+ ]
22
+ },
23
+ "checkpoints": {
24
+ "_comment": "Checkpoints: { before: operation description to match before execution, check: [list of errorPatterns.id to check] }. AI auto-generates from watchFor scenarios",
25
+ "examples": [
26
+ {
27
+ "before": "Run npm run build",
28
+ "check": ["build-vite-config-missing"]
29
+ },
30
+ {
31
+ "before": "Modify config files",
32
+ "check": ["build-vite-config-missing"]
33
+ },
34
+ {
35
+ "before": "Import JSON files",
36
+ "check": ["type-import-assertion-deprecated"]
37
+ }
38
+ ]
39
+ }
40
+ }
@@ -1,99 +1,55 @@
1
1
  {
2
- "governance": {
3
- "coreRules": [
2
+ "directoryMapping": {
3
+ "_comment": "Code directory ↔ module mapping: { path: directory path, module: module name, responsibility: responsibility description }",
4
+ "examples": [
4
5
  {
5
- "file": "00_system.md",
6
- "role": "System Role",
7
- "when": "At the start of every session (Identity, Core Principles)"
6
+ "path": "src/features/auth",
7
+ "module": "auth",
8
+ "responsibility": "User authentication, login, registration"
8
9
  },
9
10
  {
10
- "file": "01_workflow.md",
11
- "role": "SOP",
12
- "when": "Decides current task flow (Task vs Fix) & Acceptance Criteria"
13
- },
14
- {
15
- "file": "02_tech_stack.md",
16
- "role": "Tech Stack",
17
- "when": "Tech choices, coding standards, engineering governance"
18
- },
19
- {
20
- "file": "03_data_governance.md",
21
- "role": "Data Governance",
22
- "when": "When reading/writing global JSON data files"
23
- },
24
- {
25
- "file": "04_cli_tools.md",
26
- "role": "CLI Reference",
27
- "when": "When executing Terminal Gate commands (npx archi task/plan/render syntax reference)"
28
- },
29
- {
30
- "file": "99_context_glue.md",
31
- "role": "Context Bridge",
32
- "when": "Automatically links context docs when touching code"
11
+ "path": "src/features/todos",
12
+ "module": "todo",
13
+ "responsibility": "Todo CRUD operations"
33
14
  }
34
- ],
35
- "globalReference": [
36
- {
37
- "file": "roadmap.json",
38
- "role": "Roadmap",
39
- "content": "Progress tracking, milestones, technical debt management"
40
- },
41
- {
42
- "file": "vision.md",
43
- "role": "Vision",
44
- "content": "Vision, North Star Metric, Design Philosophy"
45
- },
46
- {
47
- "file": "map.json",
48
- "role": "Map (This file)",
49
- "content": "Directory structure, file index, logical topology"
50
- },
51
- {
52
- "file": "dictionary.json",
53
- "role": "Dictionary",
54
- "content": "Business glossary, shared component registry"
55
- },
56
- {
57
- "file": "design_tokens.json",
58
- "role": "Visuals [?UI]",
59
- "content": "Colors, typography, spacing variables"
60
- },
61
- {
62
- "file": "data_snapshot.json",
63
- "role": "Data [?Data]",
64
- "content": "Database Schema snapshot"
65
- },
66
- {
67
- "file": "error_codes.json",
68
- "role": "Errors",
69
- "content": "Error codes & protocol contracts"
15
+ ]
16
+ },
17
+ "logicalTopology": {
18
+ "_comment": "Logical topology: { module: module name, layer: layer(layer/domain/interface/infrastructure), depends: [dependent modules] }",
19
+ "examples": [
20
+ { "module": "auth", "layer": "domain", "depends": ["user-repo"] },
21
+ { "module": "todo", "layer": "domain", "depends": ["auth", "todo-repo"] }
22
+ ]
23
+ },
24
+ "criticalUserJourneys": {
25
+ "_comment": "Critical user journeys: { journey: journey name, steps: [steps], owner: owning task ID }",
26
+ "examples": [
27
+ {
28
+ "journey": "User Registration & Login",
29
+ "steps": [
30
+ "Visit homepage",
31
+ "Click register",
32
+ "Fill form",
33
+ "Submit",
34
+ "Login success"
35
+ ],
36
+ "owner": "FEAT-AUTH"
70
37
  }
71
38
  ]
72
39
  },
73
- "featureDocs": [
74
- {
75
- "file": "spec.md",
76
- "category": "Specification",
77
- "purpose": "Business Logic, Algorithms, Acceptance Criteria (Logic)"
78
- },
79
- {
80
- "file": "ui.md",
81
- "category": "UI/UX",
82
- "purpose": "Task-level UI scope declaration — references screen IDs from ui_context.md to define this task's screen/component scope"
83
- },
84
- {
85
- "file": "design.md",
86
- "category": "Technical Design",
87
- "purpose": "[?Complex] Technical design — state machine/pipeline/protocol definitions, parameter table, invariants"
88
- },
89
- {
90
- "file": "plan.json",
91
- "category": "Plan",
92
- "purpose": "Detailed Step Breakdown & Test Cases (Execution)"
93
- }
94
- ],
95
- "directoryMapping": [],
96
- "logicalTopology": [],
97
- "criticalUserJourneys": [],
98
- "featureRelations": []
40
+ "featureRelations": {
41
+ "_comment": "Impact relations organized as networks: { group: network name, members: [member files], rule: change rule }",
42
+ "examples": [
43
+ {
44
+ "group": "Tech Specs",
45
+ "members": [
46
+ "tech_stack.md",
47
+ "prompts/code.md",
48
+ "prompts/audit.md",
49
+ "rules/00_system.md"
50
+ ],
51
+ "rule": "Tech stack changes need to sync protocol docs"
52
+ }
53
+ ]
54
+ }
99
55
  }
@@ -1,13 +1,6 @@
1
- ---
2
- description: CLI Reference Manual. Working directory rule and command syntax for npx archi task/plan/render.
3
- globs: **/*
4
- applyTo: **/*
5
- alwaysApply: true
6
- ---
7
-
8
1
  # CLI Reference
9
2
 
10
- > **Role**: Command quick-reference. Provides syntax and parameters for `npx archi` commands, for use during Terminal Gate execution.
3
+ > **Role**: Command reference manual. Provides syntax and parameters for `npx archi` commands, for use during Terminal Gate execution.
11
4
 
12
5
  ## ⛔ Working Directory Gate
13
6
 
@@ -16,7 +9,7 @@ alwaysApply: true
16
9
  | Check | Pass Condition |
17
10
  |:---|:---|
18
11
  | Current directory | Must be project root (directory containing `[[__DOCS_DIR__]]/`) |
19
- | If unsure | Confirm current directory first; forbidden to guess |
12
+ | When uncertain | Confirm current directory first; do not guess |
20
13
  | In subdirectory | Must `cd` to root before executing |
21
14
 
22
15
  ---
@@ -27,7 +20,7 @@ alwaysApply: true
27
20
 
28
21
  | Subcommand | Purpose | Example |
29
22
  |:---|:---|:---|
30
- | `npx archi task` | List all tasks with progress | `npx archi task` |
23
+ | `npx archi task` | List all tasks and progress | `npx archi task` |
31
24
  | `npx archi task <ID> --status <s>` | Update task status | `npx archi task INF-001 --status done` |
32
25
  | `npx archi task --check` | Check Roadmap consistency | `npx archi task --check` |
33
26
 
@@ -37,7 +30,7 @@ alwaysApply: true
37
30
 
38
31
  | Subcommand | Purpose | Example |
39
32
  |:---|:---|:---|
40
- | `npx archi plan <ID>` | Check Task's Plan completion | `npx archi plan SUB-01` |
33
+ | `npx archi plan <ID>` | Check Task Plan completion | `npx archi plan SUB-01` |
41
34
 
42
35
  Automatically identifies Manual Verification sections and excludes them from automated statistics.
43
36
 
@@ -45,6 +38,6 @@ Automatically identifies Manual Verification sections and excludes them from aut
45
38
 
46
39
  | Subcommand | Purpose | Example |
47
40
  |:---|:---|:---|
48
- | `npx archi render` | Render all JSON data files into human-readable `.md` views | `npx archi render` |
41
+ | `npx archi render` | Render all JSON data files as human-readable `.md` views | `npx archi render` |
49
42
 
50
- > `.md` views are auto-generated; forbidden to edit directly. Modifications must go through `.json` source files.
43
+ > `.md` views are auto-generated; do not edit directly. Modifications must go through the `.json` source files.
@@ -1,10 +1,3 @@
1
- ---
2
- description: Technical Standards & Technology Stack. Contains language versions, framework choices, coding conventions, naming rules, and forbidden patterns. Consult when writing code.
3
- globs: **/*
4
- applyTo: **/*
5
- alwaysApply: true
6
- ---
7
-
8
1
  # Tech Stack & Engineering Standards: [Project Name]
9
2
 
10
3
  > **Role:** The "Law" of the codebase. Defines tools, structure, and engineering workflows.
@@ -53,23 +46,19 @@ alwaysApply: true
53
46
 
54
47
  ---
55
48
 
56
- ## 4. UI Protocol: ITP v3.0 (Dual-Artifact) [Optional - Only for UI Projects]
49
+ ## 4. UI Protocol: ITP v3.0 (Tri-Artifact) [Optional - Only for UI Projects]
57
50
  <!-- Core UI Description Protocol -->
58
51
  > **Note:** If project has no UI (e.g. CLI, Backend API, Library), remove this section.
59
52
 
60
- ### 4.1 Dual-Artifact Strategy
61
-
62
- UI artifact hierarchy:
53
+ ### 4.1 Tri-Artifact Strategy
63
54
 
64
55
  | Artifact | Format | Reader | Responsibility |
65
56
  |:---|:---|:---|:---|
66
- | `ui_concept.html` | Single-file HTML | Human (browser) | **Global visual source of truth** — wireframes/styled screens for the entire project |
67
- | `ui_context.md` | Structured Markdown | AI (plan/code/audit/edit) | **AI screen index** — lightweight list of screen IDs / routes / states / navigation graph / shared components |
68
- | `ui.md` | ITP v3.0 DSL | AI (code/audit) | Task-level UI scope declaration — which screens/components this task covers |
69
- - `ui_concept.html` is generated by the `archi-ui-wireframe` Skill, covering all user-visible screens; for human browser preview only
70
- - `ui_context.md` is generated by the same Skill simultaneously; it is the sole AI entry point for UI structure; do not edit manually
71
- - `ui.md` only declares "which screens/states in ui_context.md this task is responsible for"; do not redefine global layout
72
- - Code phase uses `ui.md` (task design) + `ui_context.md` (structure/navigation) + `design_tokens.json` (visual constraints) as source; also uses `ui_concept.html` as **read-only visual reference** to calibrate layout; implement equivalent visual effect with the **project's own tech stack**
57
+ | `screens/` | Multi-file HTML (`index.html` + `S-XX.html` + `_shared.css`) | Human (browser) | **Global visual source of truth** — triggered by `/archi.ui` Skill; each screen independently previewable |
58
+ | `ui_context.md` | Structured Markdown | AI (plan/code/audit/edit) | **AI screen index** — sole AI entry point for UI structure; generated by same Skill; do not edit manually |
59
+ | `ui.md` | ITP v3.0 DSL | AI (code/audit) | Task-level UI scope declaration — only declares which screens/states this task covers; do not redefine global layout |
60
+
61
+ - Code phase uses `ui.md` + `ui_context.md` + `design_tokens.json` as source; `screens/S-XX.html` as **read-only visual reference**; implement equivalent visual effect with **project's own tech stack**
73
62
 
74
63
  ### 4.2 Naming (PrefixFunction)
75
64
  Component naming must follow `Prefix+Function` format:
@@ -77,6 +77,6 @@ description: Project Constitution: Vision, Personas, Principles & Boundaries.
77
77
  **Trigger**: Only modify during project initialization (`/archi.start`) or major strategic pivot (`/archi.revise`).
78
78
 
79
79
  **Action**:
80
- 1. **Alignment**: Ensure Section 3 (Principles) conflicts with technology choices in `02_tech_stack.md`.
80
+ 1. **Alignment**: Ensure Section 3 (Principles) conflicts with technology choices in `tech_stack.md`.
81
81
  2. **Completeness**: Must fill all `[ ]` placeholders, strictly no "Example" text remaining.
82
82
  3. **Consistency**: All Task Specs (`.spec.md`) must reference the Vision in this file to ensure alignment.
@@ -33,10 +33,10 @@
33
33
  | `pending` | Reject — no code to review |
34
34
  | `blocked` | Reject — upstream deps incomplete |
35
35
 
36
- 3. **Load**: vision.md (direction anchor) + task docs (spec/plan/ui) + prior audit.md (for comparison) + project context (tech_stack/design_tokens/data_snapshot/ui_context/ui_concept). Read all code files for this task.
36
+ 3. **Load**: vision.md (direction anchor) + task docs (spec/plan/ui) + prior audit.md (for comparison) + project context (tech_stack/design_tokens/data_snapshot/ui_context/screens/). Read all code files for this task.
37
37
 
38
38
  **Project-level — Load Overview**:
39
- 1. Read vision.md, roadmap.json, map.json, 02_tech_stack.md.
39
+ 1. Read vision.md, roadmap.json, map.json, tech_stack.md.
40
40
  2. Scan tasks/ directory structure.
41
41
  3. Read project code entry points and key modules.
42
42
 
@@ -57,15 +57,15 @@
57
57
  | 4 | **Logic correctness** | Business logic errors, contradictions, missing branches, state machine defects |
58
58
  | 5 | **Bug hunting** | null/undefined, race conditions, resource leaks, infinite loops, off-by-one |
59
59
  | 6 | **Error handling** | Swallowing, silent failure, error propagation chain, user-visible feedback |
60
- | 7 | **Tech Stack compliance** | Per `02_tech_stack.md`: forbidden patterns, outdated API, hardcoding |
60
+ | 7 | **Tech Stack compliance** | Per `tech_stack.md`: forbidden patterns, outdated API, hardcoding |
61
61
  | 8 | **Security** | Sensitive info leak, unvalidated input, injection risk, permission checks |
62
62
  | 9 | **Performance** | Unnecessary full imports, large loops, dead computation, memory leaks, N+1 queries |
63
- | 10 | (When this task involves UI) **Design compliance** | Token usage; no hardcoded magic values; visual consistency with `ui_concept.html` |
63
+ | 10 | (When this task involves UI) **Design compliance** | Token usage; no hardcoded magic values; visual consistency with `screens/S-XX.html` |
64
64
  | 11 | (When this task involves data) **Data consistency** | Field names/types match `data_snapshot.json` |
65
65
  | 12 | (i18n projects only) **I18n compliance** | No hardcoded strings; must use Key/dictionary refs |
66
66
  | 13 | **Orphan .gitkeep** | `.gitkeep` exists when dir has other files — remove |
67
67
  | 14 | **Spec-Code drift** | Interface/type/behavior match `spec.md`; manual changes synced to docs |
68
- | 15 | (When this task involves UI) **UI ref completeness** | `ui.md` `ref: ui_concept.html#S-XX` pointers still valid |
68
+ | 15 | (When this task involves UI) **UI ref completeness** | `ui.md` `ref: screens/S-XX.html` pointers still valid |
69
69
 
70
70
  **Output**: Finding list grouped by dimension; each with level, location, description. Enter step_3_report.
71
71
  </step_2a_task>
@@ -1,6 +1,6 @@
1
1
  <protocol_code>
2
2
  **Trigger**: `/archi.code <id>` | Auto-loaded by Workflow Dispatch on natural language trigger
3
- **Goal**: Complete feature development per `tasks/<id>_<Slug>/plan.json` task list; follow `02_tech_stack.md` (UI projects only: also follow `design_tokens.json`); pass build, types, Lint, format, tests and audit.
3
+ **Goal**: Complete feature development per `tasks/<id>_<Slug>/plan.json` task list; follow `tech_stack.md` (UI projects only: also follow `design_tokens.json`); pass build, types, Lint, format, tests and audit.
4
4
 
5
5
  <meta>
6
6
  <style>Deterministic, Type-Safe, SOTA-First</style>
@@ -29,7 +29,7 @@
29
29
  | `blocked` | Reject — upstream deps incomplete |
30
30
  | `done` | Reject — already done; use `/archi.edit <ID>` for changes |
31
31
 
32
- 3. **Load**: task docs (spec/ui/design/plan) + project context (tech_stack/design_tokens/data_snapshot/ui_context/ui_concept) + refs (match by tags; load only matched files).
32
+ 3. **Load**: task docs (spec/ui/design/plan) + project context (tech_stack/design_tokens/data_snapshot/ui_context/screens/) + refs (match by tags; load only matched files).
33
33
 
34
34
  **Output**: Atomic task list to implement with dependencies and order.
35
35
  </step_1_resolve>
@@ -49,10 +49,10 @@
49
49
  <step_3_implement>
50
50
  **Protocol**:
51
51
  - **Read First**: Must read target file before modify; follow existing project code style.
52
- - **Use Existing Stack**: Use only tech and libs declared in `02_tech_stack.md`.
53
- - (When this task involves UI) **Design Tokens Only**: Styles strictly use Token/Preset; no hardcoded magic values.
52
+ - **Use Existing Stack**: Use only tech and libs declared in `tech_stack.md`.
53
+ - (When this task involves UI) [[INCLUDE: shared/ui-redlines.md]]
54
54
  - **Type-Safe**: Complete type definitions; use project type system to guard boundaries.
55
- - **Code Organization**: Follow `02_tech_stack.md` architecture and file placement.
55
+ - **Code Organization**: Follow `tech_stack.md` architecture and file placement.
56
56
  - **Comments**: Explain Why, not What.
57
57
  - **Naming**: Self-explanatory names; no meaningless names.
58
58
  - Complex tasks only: **Design Adherence**: When `design.md` exists, implementation must strictly follow its state machine/pipeline/protocol; params reference § 3 values; must satisfy all § 4 Invariants.
@@ -68,9 +68,13 @@
68
68
  </step_3_implement>
69
69
 
70
70
  <step_4_validate>
71
- **Action** (on failure fix and re-run; commands per `02_tech_stack.md` Section 5):
71
+ **Action** (on failure fix and re-run; commands per `tech_stack.md` Section 5):
72
72
 
73
- **Automated Check**: Run `[[__DOCS_DIR__]]/scripts/validate` (if exists); otherwise execute checklist:
73
+ **Automated Check**: Check `scripts/validate`:
74
+ - **Exists** → Must run, results per script output
75
+ - **Not exists** → Execute checklist below
76
+
77
+ > **Scripts Check**: If `scripts/` directory does not exist → Suggest running `/archi.script` to generate automation scripts first.
74
78
 
75
79
  | Phase | Check | Requirement |
76
80
  |:---|:---|:---|
@@ -111,7 +115,7 @@
111
115
  [[SUBAGENT: archi-feature-relations|mode: check, context: Compare implemented feature with featureRelations sources semantically]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-feature-relations/SKILL.md`, follow mode: check logic)]]
112
116
 
113
117
  **5C. Data governance sync**:
114
- [[SUBAGENT: archi-data-sync|context: Scan new business entities/error codes/Schema from implementation; incrementally sync per 03_data_governance.md]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-data-sync/SKILL.md` and follow its protocol)]]
118
+ [[SUBAGENT: archi-data-sync|context: Scan new business entities/error codes/Schema from implementation; incrementally sync per 00_system.md]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-data-sync/SKILL.md` and follow its protocol)]]
115
119
 
116
120
  [[INCLUDE: shared/verify-result-handling.md]]
117
121
  </step_5_verify>
@@ -128,7 +132,7 @@
128
132
  1. Confirm `plan.json` each task `done` flag updated.
129
133
  2. **Drift Warning**: Compare code changes with `spec.md` key points. If beyond spec coverage → mark `⚠️ Spec drift`, suggest `/archi.edit <ID>`.
130
134
  3. Output completed task list and patch links.
131
- 4. Provide next steps and Git Commit Suggestion (Conventional Commits).
135
+ 4. Provide next steps.
132
136
 
133
137
  **Pre-signoff Checklist** (confirm each item before Output):
134
138
  □ plan.json — every task done flag updated in real-time (not batch-updated at signoff)
@@ -136,13 +140,21 @@
136
140
  □ Step 4 — Task Verification executed for each project type with Evidence attached
137
141
  □ Step 5A Silent Audit — executed, all CRITICAL issues resolved
138
142
  □ Step 5B featureRelations check — executed
139
- Step 5C data governance sync executed
143
+ - Check if modified files affect other linked files
144
+ □ Step 5C data governance sync — executed:
145
+ - dictionary.json + error_codes.json + env_registry.json — required
146
+ - (UI projects only) design_tokens.json + ui_context.md
147
+ - (Data projects only) data_snapshot.json
148
+ - (API projects only) api_snapshot.json
149
+ - (CLI projects only) command_api.json
150
+ - (Lib projects only) public_api.json
140
151
  □ Terminal Gate — npx archi plan <ID> all complete (exempt items only)
141
152
 
142
- **Output**: Completion summary with completed tasks, exempt items (if any), Git Commit suggestion, Next Steps:
153
+ **Output**: Completion summary with completed tasks, exempt items (if any), Next Steps:
143
154
 
144
155
  | Priority | Action | Notes |
145
156
  |:---|:---|:---|
157
+ | (If no scripts/) | `/archi.script` | Generate automation scripts (validate/dev-up/dev-reset) |
146
158
  | Recommended | `/archi.audit <ID>` | Independent review of implementation |
147
159
  | (If Spec drift) | `/archi.edit <ID>` | Update docs before continuing |
148
160
  | (If next pending task) | `/archi.plan <next pending ID>` | Plan the next task |
@@ -41,14 +41,14 @@
41
41
  <step_2_refine_docs>
42
42
  **Action**:
43
43
  - Modify spec.md and ui.md per `[context]`.
44
- - (UI modified) [[SKILL: archi-ui-wireframe|Follow the skill protocol to sync `ui_concept.html` + `ui_context.md`]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md`)]]:
44
+ - (UI modified) [[SKILL: archi-ui-wireframe|Follow the skill protocol to sync `screens/S-XX.html` + `ui_context.md`]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md`)]]:
45
45
 
46
46
  | Change Type | Criteria | Handling |
47
47
  |:---|:---|:---|
48
48
  | No screen impact | Logic/data change only | Update spec.md only |
49
- | Minor UI tweak | New/modified state, popup, local area | Call skill to update; output `MODIFIED: S-XX` |
49
+ | Minor UI tweak | New/modified state, popup, local area | Call skill to update; output `MODIFIED: screens/S-XX.html` |
50
50
  | Screen structure change | Layout refactor, new screen, navigation change | Call skill to update |
51
- | Task reduction | Screen/region removed entirely | Call skill to remove; output `REMOVED: S-XX` |
51
+ | Task reduction | Screen/region removed entirely | Call skill to remove; output `REMOVED: screens/S-XX.html` |
52
52
 
53
53
  - Ask user when requirements are vague.
54
54
 
@@ -65,9 +65,15 @@
65
65
  |:---|:---|:---|
66
66
  | 3 | [when status=done] `npx archi task <ID> --status active` | Status reset |
67
67
 
68
- **Output**: plan.json with new tasks appended; if status transition performed, output `MODIFIED: roadmap.json <ID>.status done→active`. Enter step_4_verify.
68
+ **Output**: plan.json with new tasks appended; if status transition performed, output `MODIFIED: roadmap.json <ID>.status done→active`. Enter step_4_data_sync.
69
69
  </step_3_update_plan>
70
70
 
71
+ <step_4_data_sync>
72
+ **Data governance sync**:
73
+
74
+ [[SUBAGENT: archi-data-sync|context: Scan new business entities/error codes/Schema/endpoints/commands/exports from requirement changes, incrementally sync per 00_system.md]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-data-sync/SKILL.md`, follow its execution protocol)]]
75
+ </step_4_data_sync>
76
+
71
77
  <step_4_verify>
72
78
  **Role**: Independent Reviewer
73
79
 
@@ -76,17 +82,25 @@
76
82
  [[INCLUDE: shared/verify-result-handling.md]]
77
83
  </step_4_verify>
78
84
 
79
- <step_5_summary>
85
+ <step_6_summary>
80
86
  **Pre-signoff Checklist** (confirm each item before Output):
81
87
  □ spec.md — updated per context, changes tracked
82
- □ (if UI changed) ui.md + ui_concept.html + ui_context.md — synced
88
+ □ (if UI changed) ui.md + screens/S-XX.html + ui_context.md — synced
83
89
  □ plan.json — new Phase appended (history tasks fully preserved)
84
90
  □ (if original status=done) roadmap.json — status reset to active
91
+ □ Global files — related JSON files synced for changes:
92
+ - dictionary.json + error_codes.json + env_registry.json — required
93
+ - (UI projects only) design_tokens.json + ui_context.md
94
+ - (Data projects only) data_snapshot.json
95
+ - (API projects only) api_snapshot.json
96
+ - (CLI projects only) command_api.json
97
+ - (Lib projects only) public_api.json
98
+ □ Step 4 Data Sync — archi-data-sync executed
85
99
  □ Step 4 Silent Audit — executed, all CRITICAL issues resolved
86
100
  □ Terminal Gate — task --check no ERROR (executed in step_3)
87
101
 
88
102
  **Action** (Gate must complete in step_3):
89
103
  **Output**: Task update summary with Spec/UI/Plan change overview and Next Steps table. Recommend running `/archi.code <ID>`.
90
- </step_5_summary>
104
+ </step_6_summary>
91
105
 
92
106
  </protocol_edit>
@@ -23,7 +23,7 @@
23
23
  - Without `<id>`: Analyze `[context]` to find most relevant module.
24
24
  Single match → auto lock | Multiple matches → list candidates and ask | Cannot locate → error, request ID.
25
25
  2. Read all docs and related code in target directory.
26
- 3. Read 02_tech_stack.md (tech red lines) and vision.md (direction anchor).
26
+ 3. Read tech_stack.md (tech red lines) and vision.md (direction anchor).
27
27
  4. Analyze `[context]` with code logic to locate potential fault points.
28
28
  5. **Hypothesis**: Propose 1–3 root cause hypotheses.
29
29
 
@@ -50,6 +50,7 @@
50
50
  **Terminal Gate** (do not skip):
51
51
  | Step | Command | Pass Condition |
52
52
  |:---|:---|:---|
53
+ | 0 | Check `scripts/validate` | If exists, must run; results per script |
53
54
  | 1 | Run build command | Build success |
54
55
  | 2 | Run type check | Zero type errors |
55
56
  | 3 | Run Lint/Format | Pass |
@@ -63,6 +64,12 @@
63
64
  [[INCLUDE: shared/verify-result-handling.md]]
64
65
  </step_4_verify>
65
66
 
67
+ <step_4_5_data_sync>
68
+ **Data governance sync**:
69
+
70
+ [[SUBAGENT: archi-data-sync|context: Scan new business entities/error codes/Schema from Bug fix, incrementally sync per 00_system.md]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-data-sync/SKILL.md`, follow its execution protocol)]]
71
+ </step_4_5_data_sync>
72
+
66
73
  <step_5_plan_update>
67
74
  **Action**:
68
75
  1. Update plan.json Bugfix Phase completed tasks `done: true`.
@@ -78,6 +85,7 @@
78
85
  □ plan.json — Bugfix Phase appended (step_2)
79
86
  □ Reproduction test created and verified (Red → Green)
80
87
  □ Code fix targets Bug only, no opportunistic refactoring
88
+ □ Step 4.5 Data Sync — archi-data-sync executed
81
89
  □ Step 4 Terminal Gate — Build / type check / Lint / tests all passed
82
90
  □ Step 4 Silent Audit — executed, all CRITICAL issues resolved
83
91
  □ plan.json Bugfix Phase — done flags updated (step_5)
@@ -86,8 +94,9 @@
86
94
 
87
95
  | Priority | Action | Notes |
88
96
  |:---|:---|:---|
97
+ | (If no scripts/) | `/archi.script` | Generate automation validation scripts |
89
98
  | Recommended | `/archi.audit <ID>` | Re-audit to confirm fix complete |
90
99
  | Optional | `/archi.code <ID>` | If incomplete items, continue implementation |
91
- </step_5_summary>
100
+ </step_6_summary>
92
101
 
93
102
  </protocol_fix>