@ecc-hgy/ae 0.3.0 → 0.4.0

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/README.md CHANGED
@@ -5,6 +5,29 @@
5
5
 
6
6
  Agentic Engineering is a lightweight personal software lifecycle method: SDD records what to build, TDD drives how to prove it works. It is delivered as a zero-dependency npm CLI plus agent skills for Claude Code and Codex.
7
7
 
8
+ ## How It Works
9
+
10
+ ```text
11
+ (one-time) ─────▶ S0 Bootstrap · ae setup → ae init
12
+
13
+ (each request) ──▶ Router · is this request a *need*?
14
+
15
+ ┌──── no ────┴──── yes ────┐
16
+ ▼ ▼
17
+ just do it enter S1 Main Loop
18
+ (Q&A / quick fix / │
19
+ throwaway script) ├─ A. Need: align → PRD → design → todo → TDD → verify
20
+ └─ B. Accept: accept → debug → fix → reverify → sediment
21
+
22
+ ▼ (rules proven useful)
23
+ S2 Evolution
24
+
25
+ Legend: SDD = align→PRD→design→todo · TDD = TDD→verify, fix→reverify
26
+ State: spec/ = what to build (persistent) · INDEX.md = need@node · handoff.md = session snapshot
27
+ ```
28
+
29
+ A router (the `using-agentic-engineering` skill) gates each non-trivial request: a *need* enters the SDD+TDD loop, everything else is just done. Questions, quick fixes, and throwaway scripts never pay the ceremony.
30
+
8
31
  ## Quick Start
9
32
 
10
33
  ```bash
@@ -37,7 +60,7 @@ Both commands are idempotent. They create missing files, skip existing files, an
37
60
 
38
61
  - `AGENTS.md` is the canonical project instructions file.
39
62
  - `CLAUDE.md` is a short pointer to `AGENTS.md`; do not maintain a separate copy there.
40
- - All project-specific rules live in `AGENTS.md` under `## Project-Specific Rules`.
63
+ - `ae init` renders `AGENTS.md` nearly blank (title + goal); add your own rules and sections as the project grows — no imposed format.
41
64
 
42
65
  ## Platform Scope
43
66
 
@@ -66,6 +89,7 @@ The two hard gates are:
66
89
 
67
90
  | Skill | Role |
68
91
  |-------|------|
92
+ | `using-agentic-engineering` | Router: at the start of a non-trivial change, decides whether it enters the SDD+TDD loop and dispatches to the right node skill. |
69
93
  | `brainstorming` | Coarse requirement alignment before writing PRD. |
70
94
  | `grill-me` | Fine-grained questioning for interface, field, parameter, or expected-state ambiguity. |
71
95
  | `to-prd` | Writes `spec/needs/<need-name>/prd.md`. |
@@ -78,6 +102,7 @@ The two hard gates are:
78
102
  | `handoff` | Writes the latest session snapshot to `handoff.md`. |
79
103
  | `improve-codebase-architecture` | User-triggered architecture deepening review. |
80
104
  | `zoom-out` | User-triggered higher-level codebase map. |
105
+ | `karpathy-guidelines` | Always-on coding discipline during A5/B5: think before coding, simplicity first, surgical changes, goal-driven execution. |
81
106
 
82
107
  ## Documentation
83
108
 
@@ -101,11 +126,16 @@ tests/ node:test coverage for CLI behavior
101
126
 
102
127
  ## Roadmap
103
128
 
104
- 1. Stage 2: npm CLI asset distribution with `init` and `ingest-mother`. Superseded by v0.2.
105
- 2. v0.2: split CLI into `setup` + `init`, remove slash command assets, and move rule sync into `ae init`.
106
- 3. v0.3: remove rules injection; make `AGENTS.md` the single source of truth and `CLAUDE.md` a pointer.
107
- 4. Stage 3: design `ae update` for skill/template upgrades and implement `ae index-rebuild`.
108
- 5. Add CI and Windows path validation before broader distribution.
129
+ Completed:
130
+
131
+ - v0.2: split CLI into `setup` + `init` and remove slash command assets.
132
+ - v0.3: remove rules injection; make `AGENTS.md` the single source of truth and `CLAUDE.md` a pointer.
133
+
134
+ Next:
135
+
136
+ 1. Design `ae update` for skill/template upgrades.
137
+ 2. Implement `ae index-rebuild`.
138
+ 3. Add CI and Windows path validation before broader distribution.
109
139
 
110
140
  ## Limits
111
141
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecc-hgy/ae",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Agentic Engineering is a lightweight personal software lifecycle method: SDD records what to build, TDD drives how to prove it works.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,7 +18,7 @@ If B2 has NOT been completed (the expected behavior is still ambiguous), STOP an
18
18
 
19
19
  ## Exit Contract (hand-off to B4)
20
20
 
21
- After Phase 6, do NOT write the issue file inline - that is B4's job. Instead, hand off a structured summary so B4 can write `spec/needs/<need-name>/issues/<topic>.md` in one pass, using the 7-section format in [assets/issue-7-sections.md](assets/issue-7-sections.md).
21
+ After Phase 6, do NOT write the issue file inline - that is B4's job. Instead, hand off a structured summary so B4 can write `spec/needs/<need-name>/issues/<topic>.md` (`<topic>` is kebab-case) in one pass, using the 7-section format in [assets/issue-7-sections.md](assets/issue-7-sections.md).
22
22
 
23
23
  Sections this skill is expected to populate:
24
24
 
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: karpathy-guidelines
3
+ description: Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
4
+ license: MIT
5
+ ---
6
+
7
+ # Karpathy Guidelines
8
+ **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
9
+
10
+ ## 1. Think Before Coding
11
+
12
+ **Don't assume. Don't hide confusion. Surface tradeoffs.**
13
+
14
+ Before implementing:
15
+ - State your assumptions explicitly. If uncertain, ask.
16
+ - If multiple interpretations exist, present them - don't pick silently.
17
+ - If a simpler approach exists, say so. Push back when warranted.
18
+ - If something is unclear, stop. Name what's confusing. Ask.
19
+
20
+ ## 2. Simplicity First
21
+
22
+ **Minimum code that solves the problem. Nothing speculative.**
23
+
24
+ - No features beyond what was asked.
25
+ - No abstractions for single-use code.
26
+ - No "flexibility" or "configurability" that wasn't requested.
27
+ - No error handling for impossible scenarios.
28
+ - If you write 200 lines and it could be 50, rewrite it.
29
+
30
+ Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
31
+
32
+ ## 3. Surgical Changes
33
+
34
+ **Touch only what you must. Clean up only your own mess.**
35
+
36
+ When editing existing code:
37
+ - Don't "improve" adjacent code, comments, or formatting.
38
+ - Don't refactor things that aren't broken.
39
+ - Match existing style, even if you'd do it differently.
40
+ - If you notice unrelated dead code, mention it - don't delete it.
41
+
42
+ When your changes create orphans:
43
+ - Remove imports/variables/functions that YOUR changes made unused.
44
+ - Don't remove pre-existing dead code unless asked.
45
+
46
+ The test: Every changed line should trace directly to the user's request.
47
+
48
+ ## 4. Goal-Driven Execution
49
+
50
+ **Define success criteria. Loop until verified.**
51
+
52
+ Transform tasks into verifiable goals:
53
+ - "Add validation" → "Write tests for invalid inputs, then make them pass"
54
+ - "Fix the bug" → "Write a test that reproduces it, then make it pass"
55
+ - "Refactor X" → "Ensure tests pass before and after"
56
+
57
+ For multi-step tasks, state a brief plan:
58
+ ```
59
+ 1. [Step] → verify: [check]
60
+ 2. [Step] → verify: [check]
61
+ 3. [Step] → verify: [check]
62
+ ```
63
+
64
+ Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: review
3
- description: Two-axis review (Standards / Spec) of the changes for a need that is about to close, followed by sedimentation routing - review findings flow into prd.md / design.md / spec/ADR/ / S2 candidates per `spec-framework.md`. Used at S1 node B7.
3
+ description: Two-axis review (Standards / Spec) of the changes for a need that is about to close, followed by sedimentation routing - review findings flow into prd.md / design.md / spec/ADR/ / S2 candidates per `spec/AGENTS.md`. Used at S1 node B7.
4
4
  ---
5
5
 
6
6
  # Review
@@ -96,7 +96,7 @@ After routing:
96
96
  - Set every `issues/*.md` referenced in this close to "已验收"
97
97
  - If any `prd.md` / `design.md` was patched, leave `status: active` and refresh `last-aligned`
98
98
  - If a new ADR was created, add a row under `## ADR` with `status: proposed`
99
- - If unsure, run `/ae-index-rebuild`
99
+ - If unsure, run `ae index-rebuild`
100
100
  2. Print a one-block summary to the user:
101
101
  - Findings routed to prd / design / ADR / S2-candidates with counts
102
102
  - Files modified (path list)
@@ -135,8 +135,8 @@ After all tests pass, look for [refactor candidates](refactoring.md):
135
135
  1. Tick the corresponding `- [ ]` -> `- [x]` in `spec/needs/<need-name>/todo.md`
136
136
  2. Update `spec/INDEX.md`:
137
137
  - Bump the `todo` column counter (e.g. `2/8` -> `3/8`)
138
- - If all `## 实施` items are now checked, set `当前节点` to `A6 verify` (per `spec-framework.md` INDEX rules)
139
- - If unsure, run `/ae-index-rebuild`
138
+ - If all `## 实施` items are now checked, set `当前节点` to `A6 verify` (per `spec/AGENTS.md` INDEX rules)
139
+ - If unsure, run `ae index-rebuild`
140
140
  3. Commit. Suggested message: `feat(<need-name>): T<n> <title>`.
141
141
 
142
142
  ## After All Slices Checked (A5 only)
@@ -68,8 +68,8 @@ Format summary (full rules live in [`todo-template.md`](todo-template.md)):
68
68
 
69
69
  1. Update `spec/INDEX.md`:
70
70
  - Set the `todo` column to `0/N` (where N = total tasks in `## 实施`)
71
- - Recompute the `当前节点` column per the rules in `spec-framework.md` §INDEX 推导规则 (likely now `A5 执行`)
72
- - If unsure, run `/ae-index-rebuild` for an idempotent rescan
71
+ - Recompute the `当前节点` column per the rules in `spec/AGENTS.md` §INDEX 推导规则 (likely now `A5 执行`)
72
+ - If unsure, run `ae index-rebuild` for an idempotent rescan
73
73
  2. Hand off to the next S1 node: A5 `tdd` will read this `todo.md` (plus `design.md`) and drive the red-green-refactor loop. Tell the user the task list is ready and recommend invoking `tdd` next.
74
74
 
75
75
  ## Boundaries
@@ -13,13 +13,13 @@
13
13
  - B1 <blocker description, link back to the design section that needs sharpening>
14
14
 
15
15
  <!--
16
- Rules for maintaining this file (see also `spec-framework.md` §frontmatter / todo.md):
16
+ Rules for maintaining this file:
17
17
 
18
18
  - NO frontmatter — this is a rolling working artifact, not a stateful spec document.
19
19
  - Use `- [ ]` for unfinished, `- [x]` for finished. Never delete completed items — they are visible history.
20
20
  - Sort by dependency order (blockers first); within the same level, sort by suggested execution order.
21
21
  - If a slice depends on a design decision that is still open, put it in `## 阻塞 / 待澄清` instead of `## 实施`.
22
- - Each slice MUST be traceable to a section in `design.md`. If a new slice has no traceable design section, that itself is a finding — go back and patch `design.md` rather than smuggling new scope into `todo.md` (matches `spec-framework.md` §边界规则: "todo 不应该出现 design 里没提的事").
22
+ - Each slice MUST be traceable to a section in `design.md`. If a new slice has no traceable design section, that itself is a finding — go back and patch `design.md` rather than smuggling new scope into `todo.md`.
23
23
  - Slice identifiers: `T<n>` for execution tasks, `B<n>` for blockers. Stable across the life of the need; do not renumber.
24
24
  - Acceptance criteria: a single observable behavior that proves the slice is done. If it needs multiple lines, the slice is probably too coarse — split it.
25
25
  -->
@@ -15,7 +15,7 @@ Check with the user that these seams match their expectations.
15
15
 
16
16
  2.5. Align the `need-name` (kebab-case) with the user. This is the slug used to create `spec/needs/<need-name>/`. Surface a concrete suggestion derived from the PRD topic and confirm before writing.
17
17
 
18
- 3. Write the PRD using the template below. Save it to `spec/needs/<need-name>/prd.md` with the frontmatter block shown below the template. After saving, update `spec/INDEX.md` (add or update the row for this need) — or run `/ae-index-rebuild` to recompute.
18
+ 3. Write the PRD using the template below. Save it to `spec/needs/<need-name>/prd.md` with the frontmatter block shown below the template. After saving, update `spec/INDEX.md` (add or update the row for this need) — or run `ae index-rebuild` to recompute.
19
19
 
20
20
  <prd-template>
21
21
 
@@ -97,8 +97,8 @@ State transitions:
97
97
  1. Update `spec/INDEX.md`:
98
98
  - If the need is new: add a row under `## 需求`
99
99
  - If updating: set the `prd` column to `active`
100
- - Recompute the `当前节点` column per the rules in `spec-framework.md` §INDEX 推导规则
101
- - If unsure, run `/ae-index-rebuild` for an idempotent rescan
100
+ - Recompute the `当前节点` column per the rules in `spec/AGENTS.md` §INDEX 推导规则
101
+ - If unsure, run `ae index-rebuild` for an idempotent rescan
102
102
  2. Hand off to the next S1 node: A3 `writing-plans` will read this `prd.md` and produce `spec/needs/<need-name>/design.md`. Tell the user the PRD is ready and recommend invoking `writing-plans` next.
103
103
 
104
104
  ## Boundaries
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: using-agentic-engineering
3
+ description: Router for projects that use Agentic Engineering. Use at the start of a feature, bug fix, or other non-trivial change to decide whether it should enter the SDD+TDD loop and which node/skill to start from. Skip for quick fixes, questions, and throwaway scripts.
4
+ ---
5
+
6
+ # Using Agentic Engineering
7
+
8
+ This project follows the **Agentic Engineering** method: SDD records *what to build* (in `spec/`), TDD proves *it works*. This skill is a **router** — it decides whether the current request enters that loop and, if so, hands off to the right node skill. It does not carry the method itself; each node has its own skill.
9
+
10
+ ## Instruction priority
11
+
12
+ 1. **The user's explicit request this turn** — highest. If they say "just do X" / "skip the process," do exactly that.
13
+ 2. **`AGENTS.md`** — the project's own rules (whatever the project declares there).
14
+ 3. **Agentic Engineering defaults (below)** — lowest.
15
+
16
+ AE never blocks something you were explicitly asked to do. These are defaults, not laws.
17
+
18
+ ## Step 0 — Orient (only when needed)
19
+
20
+ Read `handoff.md` (latest session snapshot) and `spec/INDEX.md` (needs + current node) **only when you lack context** — at the start of a fresh session, or when you can't tell whether this request continues existing work or starts something new. If you already have that context from the conversation, skip straight to routing. Don't re-read them every turn.
21
+
22
+ ## Step 1 — Route: is this a *need*?
23
+
24
+ The one question: **does this request create or change a *need* — durable, product-facing behavior worth recording in `spec/`?**
25
+
26
+ **Does NOT enter the loop — just do it, no ceremony:**
27
+ - Questions / explanations ("what does this do?", "why is it slow?")
28
+ - Quick fixes, one-line changes, typos
29
+ - Throwaway / one-off scripts, spikes, experiments
30
+ - Chores: rename, format, dependency bump, run tests, git
31
+ - Anything the user explicitly asked to do directly
32
+
33
+ **Enters the loop:**
34
+ - A new feature or non-trivial capability → go to **A1**
35
+ - A bug / wrong behavior on an existing need → go to **B2**
36
+ - Continuing an existing need → resume at its **current node** (from `spec/INDEX.md`)
37
+
38
+ **Unsure?** Default to *not* entering: do what was asked, then add one line — "This looks like it might be a need; want me to capture it in `spec/` / align first?" — and hand the decision back to the user. Don't gate.
39
+
40
+ ## Step 2 — Dispatch (only when it enters the loop)
41
+
42
+ Hand off to the node skill below. Two hard gates are rigid:
43
+ - **A1 not aligned → do not write `prd.md`.**
44
+ - **B2 expected behavior not aligned → do not start fixing.**
45
+
46
+ | Node | Purpose | Skill |
47
+ |------|---------|-------|
48
+ | A1 | Align the requirement | `brainstorming` (+ `grill-me` for detail) |
49
+ | A2 | Write `prd.md` | `to-prd` |
50
+ | A3 | Write `design.md` | `writing-plans` |
51
+ | A4 | Write `todo.md` | `to-issues` |
52
+ | A5 | Implement (TDD) | `tdd` |
53
+ | A6 | Verify on the real path | `verification-before-completion` |
54
+ | B2 | Align expected behavior | `grill-me` |
55
+ | B3 | Find root cause | `diagnose` |
56
+ | B4 | Write the issue file | (7-section format) |
57
+ | B5 | Fix (TDD) | `tdd` |
58
+ | B7 | Review & sediment findings | `review` |
59
+
60
+ `karpathy-guidelines` is always-on whenever you write or change code (no node).
61
+
62
+ Spec file mechanics — INDEX derivation, frontmatter, state machine, R1 — live in `spec/AGENTS.md`.
@@ -135,8 +135,8 @@ This is non-negotiable.
135
135
  If verification passes:
136
136
 
137
137
  1. Update `spec/INDEX.md`:
138
- - Recompute `当前节点` per `spec-framework.md` INDEX rules - for a fresh need this becomes "B1 user acceptance" (the next node is user-driven, not skill-driven)
139
- - If unsure, run `/ae-index-rebuild`
138
+ - Recompute `当前节点` per `spec/AGENTS.md` INDEX rules - for a fresh need this becomes "B1 user acceptance" (the next node is user-driven, not skill-driven)
139
+ - If unsure, run `ae index-rebuild`
140
140
  2. Hand off to B1: tell the user the need is ready for their hands-on acceptance test. Do NOT mark anything `archived` - `archived` is reserved for needs that get superseded, not completed.
141
141
 
142
142
  If verification fails:
@@ -103,8 +103,8 @@ If you find issues, fix them inline. No need to re-review — just fix and move
103
103
 
104
104
  1. Update `spec/INDEX.md`:
105
105
  - Set the `design` column to `active` (or `draft` if key trade-offs still need user approval)
106
- - Recompute the `当前节点` column per the rules in `spec-framework.md` §INDEX 推导规则
107
- - If unsure, run `/ae-index-rebuild` for an idempotent rescan
106
+ - Recompute the `当前节点` column per the rules in `spec/AGENTS.md` §INDEX 推导规则
107
+ - If unsure, run `ae index-rebuild` for an idempotent rescan
108
108
  2. If you promoted any decision to `spec/ADR/`, also add a row under `## ADR` in `INDEX.md`.
109
109
  3. Hand off to the next S1 node: A4 `to-issues` will read this `design.md` and produce `spec/needs/<need-name>/todo.md`. Tell the user the design is ready and recommend invoking `to-issues` next.
110
110
 
package/src/skeleton.js CHANGED
@@ -27,6 +27,10 @@ const ENTRY_FILES = [
27
27
  'handoff.md',
28
28
  path.join('spec', 'README.md'),
29
29
  path.join('spec', 'INDEX.md'),
30
+ path.join('spec', 'AGENTS.md'),
31
+ path.join('spec', 'CLAUDE.md'),
32
+ path.join('spec', 'ADR', 'AGENTS.md'),
33
+ path.join('spec', 'ADR', 'CLAUDE.md'),
30
34
  ];
31
35
 
32
36
  export async function createDirectories(target, options = {}) {
@@ -1,24 +1,3 @@
1
1
  # {{PROJECT_NAME}}
2
2
 
3
3
  > {{PROJECT_GOAL}}
4
-
5
- ## Project-Specific Rules
6
-
7
- <!-- 在这里写本项目的稳定规则,例如:
8
- - 代码风格 / 注释语言
9
- - 提交规范
10
- - 协作偏好
11
- 这些规则会被 Claude Code / Codex 在每次 session 自动加载。
12
- 未来新规则直接追加到本段,不需要其他工具命令。 -->
13
-
14
- ## Stack
15
-
16
- TODO: 简述项目技术栈与运行环境。
17
-
18
- ## Structure
19
-
20
- TODO: 简述目录结构,标注关键入口。
21
-
22
- ## Operating Guidelines
23
-
24
- TODO: 简述代码、测试、提交、PR 的操作规范。
@@ -1,18 +1,32 @@
1
1
  # {{PROJECT_NAME}}
2
2
 
3
- {{PROJECT_GOAL}}
3
+ > {{PROJECT_GOAL}}
4
4
 
5
- ## Setup
5
+ <!--
6
+ 根 README 的核心:让别人 30 秒搞清「为什么有用、能做什么、怎么用」。
7
+ 下面是建议骨架,按需增删、不必都填,也不必拘泥小节名:
8
+ - 它是什么 + 一句话价值 → 上面的标题 + 一行(已占位)
9
+ - 为什么 / 给谁 → 解决什么问题、面向谁
10
+ - Quick Start → 最快见效的一段命令 / 步骤(装好 + 第一个能见效的操作)
11
+ - 使用示例 → 典型场景(必要时再贴一段真实用法)
12
+ - 目录地图 / 文档入口 → 关键目录 + 深入文档的链接
13
+ -->
6
14
 
7
- TODO: 记录安装和启动方式。
15
+ ## 这是什么
8
16
 
9
- ## Usage
17
+ TODO: 一段话说清它解决什么问题、给谁用、用它能做什么。
10
18
 
11
- TODO: 记录常用操作。
19
+ ## Quick Start
12
20
 
13
- ## Project Map
21
+ TODO: 最快跑起来的命令或步骤。
14
22
 
15
- - `reference/`: 原始素材,只读心态。
16
- - `spec/`: SDD/TDD 规格产物。
17
- - `data/`: 运行产物、导出和缓存。
18
- - `scripts/`: 辅助脚本。
23
+ <!-- ## 使用示例 —— 有典型场景时再加,贴一段真实用法 -->
24
+
25
+ ## 目录地图
26
+
27
+ - `spec/`:SDD/TDD 规格产物——需求索引看 `spec/INDEX.md`,项目地图看 `spec/README.md`。
28
+ - `reference/`:原始素材,只读心态。
29
+ - `data/`:运行产物、导出、缓存。
30
+ - `scripts/`:辅助脚本。
31
+
32
+ <!-- 文档入口:AGENTS.md(项目指令)· handoff.md(当前态快照)· spec/INDEX.md(需求索引) -->
@@ -0,0 +1,30 @@
1
+ # spec/ADR/ 规则
2
+
3
+ > 架构决策记录(ADR)规则。在 `spec/ADR/` 下创建或修改 ADR 时遵守本文件。
4
+
5
+ ## 命名
6
+
7
+ `NNNN-<标题>.md`,**4 位序号**,kebab-case 标题。例:`0001-postgres-as-primary-store.md`。
8
+
9
+ ## frontmatter
10
+
11
+ ```yaml
12
+ ---
13
+ status: accepted # proposed | accepted | superseded
14
+ date: 2026-06-14
15
+ supersedes: 0000-xxx.md # 仅当取代旧 ADR 时填
16
+ ---
17
+ ```
18
+
19
+ 正文按具体决策自然组织(背景 / 决策 / 理由 / 影响),不强加重模板。
20
+
21
+ ## 状态机
22
+
23
+ ```text
24
+ proposed ─(评审接受)─► accepted ─(新 ADR 取代)─► superseded
25
+ ```
26
+
27
+ - `proposed`:新提案,未拍板(由 writing-plans / review / improve-codebase-architecture 创建时默认)。
28
+ - `accepted`:已评审接受;视为**约束**,其他需求不得违背。
29
+ - `superseded`:被新 ADR 取代;新 ADR 的 `supersedes` 指回旧编号,**不删旧文件**。
30
+
@@ -0,0 +1,5 @@
1
+ # spec/ADR/
2
+
3
+ **Always read [AGENTS.md](./AGENTS.md) in this directory before creating or editing an ADR.**
4
+
5
+ `spec/ADR/AGENTS.md` defines ADR naming, frontmatter, and the proposed/accepted/superseded state machine.
@@ -0,0 +1,35 @@
1
+ # spec/ 规则
2
+
3
+ > 本目录(`spec/`)的工作规则。在 `spec/` 下读写文件时遵守本文件。
4
+
5
+ ## 总领
6
+
7
+ S1 节点 → 产物 → skill 的路由总览,见随包的 `using-agentic-engineering` skill——它判定"进不进 AE 流程"并分发到各节点。
8
+
9
+ 两道硬门禁:**A1 未对齐不写 prd**;**B2 期望态未对齐不修复**。
10
+
11
+
12
+ ## R1:落盘后同步 INDEX
13
+ 落盘 `spec/needs/<需求名>/` 下任何文件后,**必须同步更新 `spec/INDEX.md`** 对应行。若不确定如何更新,按上面「INDEX 推导规则」手动重算(未来可用 `ae index-rebuild` 幂等重扫)。
14
+
15
+ ### INDEX 推导规则
16
+
17
+ `spec/INDEX.md` 给模型看:一次扫描看到所有需求 + 状态 + 进度。`当前节点` 列**不存储**在任何 frontmatter,由该需求下文件状态**实时推导**:
18
+
19
+ | 条件 | 当前节点 |
20
+ |------|---------|
21
+ | prd 不存在 或 status=draft | A1 / A2 |
22
+ | prd active + design 不存在/draft | A3 设计 |
23
+ | prd+design active + todo 不存在 | A4 拆解 |
24
+ | prd+design active + todo 有未完成项 | A5 执行 |
25
+ | todo 全勾 + 未端到端验证 | A6 verify |
26
+ | 所有 issues 已验收 + 已交付 | 已完成 |
27
+ | 存在 active 的 issues | 进 B 子路径,按 issues 状态推 B2…B7 |
28
+ | prd / design 任一 archived | 已归档 |
29
+
30
+ - INDEX 是**推导态**:文件状态变就重新推导,**不要手编 `当前节点` 列**。
31
+
32
+
33
+ ## 何时升 ADR
34
+
35
+ 决策影响**多个需求**或属项目级不变量时,从 `design.md` 升到`spec/ADR`(判断:推翻它会改动 >1 个需求)。单需求的技术决策留在该需求的 `design.md`。
@@ -0,0 +1,5 @@
1
+ # spec/
2
+
3
+ **Always read [AGENTS.md](./AGENTS.md) in this directory before working under `spec/`.**
4
+
5
+ `spec/AGENTS.md` defines the S1 node map, the INDEX derivation table, and the post-write INDEX sync rule (R1).
@@ -2,14 +2,27 @@
2
2
 
3
3
  ## 需求
4
4
 
5
+ <!--
6
+ 各列怎么填:
7
+ - 需求名:`spec/needs/<需求名>/` 的 kebab 目录名
8
+ - prd / design:对应文件 frontmatter 的 status(draft/active/archived);文件不存在填 -
9
+ - todo:todo.md 的 已勾数/总数(如 5/8,即拆解任务的完成进度);无 todo.md 填 -。这是 A5 内部子进度,不是节点位次(节点看「当前节点」列)
10
+ - issues:该需求 issues/ 下文件数 + 是否有未结(如 0 / 1 active);无则 -
11
+ - 当前节点:由文件状态推导得出,不手编(推导规则见 spec/AGENTS.md「INDEX 推导规则」)
12
+ -->
13
+
5
14
  | 需求名 | prd | design | todo | issues | 当前节点 |
6
15
  |--------|-----|--------|------|--------|----------|
7
16
 
8
17
  ## ADR
9
18
 
19
+ <!-- 编号 4 位 / 状态 proposed|accepted|superseded / 日期,均取自各 ADR frontmatter(详见 spec/ADR/AGENTS.md) -->
20
+
10
21
  | 编号 | 标题 | 状态 | 日期 |
11
22
  |------|------|------|------|
12
23
 
13
24
  ## 跨需求引用
14
25
 
26
+ <!-- 从各 prd/design frontmatter 的 related-needs 聚合 -->
27
+
15
28
  - 暂无
@@ -1,5 +1,7 @@
1
1
  # Spec Map
2
2
 
3
+ > 给人看:回忆"项目长什么样"。以 ASCII 图为主,可省细节、突出全貌。**README ≠ INDEX 镜像**——INDEX 给模型看进度,这里给人看全貌。
4
+
3
5
  ## Needs
4
6
 
5
7
  ```text
@@ -12,6 +14,8 @@ TODO: 用 ASCII 图画出需求地图。
12
14
  TODO: 用 ASCII 图画出核心业务流程。
13
15
  ```
14
16
 
17
+ > 全局架构总览画在这里(而非写进某个需求的 design.md)。
18
+
15
19
  ## Relationships
16
20
 
17
21
  ```text