@pazmo/ai-workflow-kit 5.3.0 → 5.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.
Files changed (36) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/README.ko.md +32 -42
  5. package/README.md +32 -42
  6. package/assets/check.mjs +127 -4
  7. package/assets/graph.mjs +2 -1
  8. package/package.json +1 -1
  9. package/skills/workflow/EVALS.md +16 -11
  10. package/skills/workflow/SKILL.md +7 -5
  11. package/skills/workflow/assets/STORY.md +30 -15
  12. package/skills/workflow/references/execution.md +26 -15
  13. package/skills/workflow/references/fast-path.md +23 -0
  14. package/skills/workflow/references/graph-advanced.md +126 -0
  15. package/skills/workflow/references/graph-engineering.md +1 -122
  16. package/skills/workflow/references/graph-minimal.md +52 -0
  17. package/skills/workflow/references/intake.md +25 -9
  18. package/skills/workflow/references/jira.md +3 -3
  19. package/skills/workflow/references/light-lane.md +31 -0
  20. package/skills/workflow/references/model-selection.md +14 -0
  21. package/skills/workflow/references/role-graphs.md +2 -2
  22. package/skills/workflow/references/skill-integration.md +4 -4
  23. package/skills/workflow/references/understanding-gate.md +49 -9
  24. package/skills/workflow/references/verification.md +3 -3
  25. package/src/graph/advance.mjs +180 -0
  26. package/src/graph/approvals.mjs +29 -1
  27. package/src/graph/approve.mjs +105 -0
  28. package/src/graph/cli.mjs +126 -8
  29. package/src/graph/copies.mjs +85 -0
  30. package/src/graph/light.mjs +182 -0
  31. package/src/graph/profile.mjs +129 -0
  32. package/src/graph/snapshot.mjs +2 -1
  33. package/src/graph/verification.mjs +92 -28
  34. package/src/graph/workflow.mjs +1 -1
  35. package/src/jira.mjs +14 -13
  36. package/src/managed-block.mjs +3 -3
@@ -6,7 +6,7 @@
6
6
  "plugins": [
7
7
  {
8
8
  "name": "ai-workflow-kit",
9
- "version": "5.3.0",
9
+ "version": "5.4.0",
10
10
  "source": ".",
11
11
  "description": "Concise requirements-to-delivery workflow with human approval and understanding gates.",
12
12
  "category": "development",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-workflow-kit",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "Concise requirements-to-delivery workflow with human approval and understanding gates.",
5
5
  "author": {
6
6
  "name": "JongKun Kim"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-workflow-kit",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "Concise requirements-to-delivery workflow with human approval and understanding gates.",
5
5
  "skills": "./skills/"
6
6
  }
package/README.ko.md CHANGED
@@ -8,45 +8,16 @@ AI Workflow Kit은 Codex와 Claude Code에 작업 절차를 추가합니다. 무
8
8
 
9
9
  그래프 실행기가 작업 목록과 실행 순서를 관리합니다.
10
10
 
11
- ## 5.3.0 업데이트
11
+ ## 측정 결과
12
12
 
13
- - **업데이트할 때 버전을 알려 줍니다.** `init`은 실행 중인 CLI 버전과 바꾼 버전을 `Updated AI Workflow Kit 5.2.0 → 5.3.0.`처럼 출력합니다. `doctor`는 `Kit version: CLI …, installed …` 줄을 출력합니다. 캐시된 옛 CLI가 돌면 그냥 "이미 최신"이라고 하지 않고 자기 버전 번호를 보여 줍니다. CLI가 설치된 버전보다 오래되면 더 새 버전의 파일을 검사할 수 없으므로 `doctor`가 실패합니다.
14
- - **버전이 섞인 설치를 알려 줍니다.** 관리 파일이 설치된 버전과 다르면, 포매터만 바꾼 경우라도 `doctor`가 경고하고, 그 경로를 지운 뒤 `init`을 다시 실행하라고 안내합니다.
15
- - **5.2.0에서 올리면** 기존 실행이 그대로 이어집니다. 그래프 런타임 파일과 역할 노드가 바뀌지 않았습니다. **5.0.x에서 올리면** 5.1.0을 npm에 배포하지 않았기 때문에 아래 5.1.0 변경도 함께 들어옵니다. 업데이트 전에 시작한 역할 실행은 `Role assignment or graph changed`로 멈춥니다. 새 역할 실행을 시작하세요.
13
+ 실제 서비스 저장소의 작업으로 측정했습니다. 채점은 기준표와 블라인드 쌍 비교로 했습니다.
16
14
 
17
- 5.2.0에서 추가된 것:
15
+ - **프런티어 모델에서는 품질이 조금 오르지만 비용이 큽니다.** Opus 5.5에서 kit는 기준표 항목의 92%를 통과했고(순정 Claude Code 세션은 84%), 블라인드 쌍 비교 14번 중 12번 이겼습니다. 비용은 6.4배, 시간은 10배였습니다.
16
+ - **main을 중간급 모델로 바꾸면 품질과 비용은 순정 Opus와 같지만, 시간은 같지 않습니다.** Sonnet 5.5를 main으로 쓰면 기준표 71%(순정 Opus 73%), 실행당 $1.16(순정 Opus $1.18)이었고, 시간은 약 2배였습니다. 같은 작업에서 순정 Sonnet은 42–48%, Sonnet에 kit를 쓰면 57–83%였습니다.
17
+ - **작은 변경은 절차를 건너뛸 수 있습니다.** 정할 것이 없는 변경을 Story, 승인, 서브에이전트 없이 바로 처리하는 길을 넣자, 작은 작업 두 개 모두 품질이 순정 Opus와 같았고 블라인드 쌍 비교에서 이겼습니다. 그중 하나는 비용도 더 적고 더 빨리 끝났습니다. 작업마다 1회씩 측정했습니다.
18
+ - **수치를 바꾼 것은 도구였고, 문서 규칙은 아니었습니다.** 변경이 닿는 코드의 평행 복사본을 나열하는 명령, 테스트를 그 테스트가 있는 모듈에서 돌리는 명령은 측정된 실패를 고쳤습니다. 규칙을 문장으로 더 적은 것은 효과가 없었습니다.
18
19
 
19
- - **요구 정리 단계에서 대안을 직접 보여 줍니다.** 요청한 변경이 아직 크게 다르게 동작할 수 있으면, intake가 선택지 2~3개를 장단점과 추천 기본값과 함께 보여 줍니다. CE `ce-brainstorm`은 만들 기능 없이 목표만 있는 열린 요청이거나, 무엇을 만들지 모르겠다고 하거나, 직접 고를 때만 씁니다. 쓸 때는 에이전트가 먼저 알리고, 결과는 kit의 Story와 G1로 돌아옵니다.
20
- - **결제 렌즈가 되돌릴 기준을 묻습니다.** 가격이나 청구 규칙을 바꾸는 Story는 무엇이 되돌림(rollback)의 기준인지, 이미 발행된 청구는 어떻게 되는지 묻습니다.
21
-
22
- 5.1.0에서 추가된 것:
23
-
24
- - **계획과 리뷰에 Superpowers의 단계별 스킬을 씁니다.** 계획은 Superpowers `writing-plans`로 세우고, 결과는 kit에 돌려줍니다. 실행과 사람 확인 단계는 kit이 계속 맡습니다. 리뷰는 Superpowers `requesting-code-review` 또는 같은 예산 안의 직접 검토로 합니다. CE `ce-plan`과 `ce-code-review`는 직접 고를 때 계속 쓸 수 있고, 검증된 교훈은 여전히 CE `ce-compound`로 기록합니다. 작은 프로젝트로 비교했을 때 이 경로는 CE와 같은 계획·리뷰 품질을 훨씬 적은 토큰으로 냈습니다.
25
- - **Pstack 출처를 공식 저장소로 고쳤습니다.** 포함된 검증 파일은 그대로이고, 출처 기록만 `cursor/plugins`를 가리킵니다.
26
-
27
- 5.0.2에서 추가된 것:
28
-
29
- - **위험한 선택을 G1 전에 드러냅니다.** 이제 승인 뒤뿐 아니라 G1 전 질문 단계에서도 도메인 위험 렌즈를 읽습니다. 결제나 데이터·시스템 이관 Story에서 요구사항이나 사람이 정하지 않은 렌즈 항목은 `ASSUMED`로 넘기지 않고 `OPEN BLOCKING`으로 남깁니다. 예를 들면 옛 경로와 새 경로를 얼마나 함께 둘지, 롤백 기준, 실패하면 열어 둘지 닫을지, 두 데이터가 다르면 어느 쪽이 기준인지, 팀 간 배포 순서입니다.
30
-
31
- 5.0.1에서 추가된 것:
32
-
33
- - **검증 스킬을 Story마다 새로 만들지 않고 재사용합니다.** 기존 프로젝트 스킬·가이드를 profile의 `recipe`로 연결합니다. 작업 입력과 실행 기록에 경로·해시가 남고, 레시피나 입력으로 선언한 기능 문서가 바뀌면 이전 증거는 stale이 됩니다. 기존 검증으로 부족할 때만 절차를 보완하거나 만듭니다.
34
- - **Pstack 검증 절차로 실제 제품을 실행합니다.** 예제는 Launch·Doctor·Drive·Evidence·Cleanup을 포함합니다. Superpowers가 같은 Graph 실행의 최신 증거를 확인하고, 전체 흐름은 kit이 관리합니다. [실행 예제](examples/verification/README.md)를 참고하세요.
35
- - **리뷰는 기본 3명으로 조정합니다.** 작은 변경은 0~2명, 명확한 전문 위험이 있으면 4~5명으로 조정합니다. 메인이 단순화와 결과 통합을 맡고, 내부 위임도 같은 예산에 포함합니다. 실제 인원 제한은 호스트가 적용합니다.
36
- - **검증 실행의 예외를 수정했습니다.** 분리된 자식이 출력 파이프를 유지해도 정해진 정리 시간 뒤 불완전한 수집을 실패로 기록합니다. `toString`, `hasOwnProperty` 같은 유효한 검사 ID도 실행 순서와 관계없이 사용할 수 있습니다.
37
-
38
- 기존 프로젝트를 업데이트할 때는 `@latest` 대신 정확한 버전을 지정하고, 설치 전에 npx가 실제로 실행하는 CLI 버전을 확인하세요. 프로젝트의 `.npmrc`가 접속할 수 없는 사설 레지스트리를 가리키면, npx가 캐시된 옛 버전을 알리지 않고 실행할 수 있습니다. 정확한 버전을 지정하면 다른 버전의 캐시로 대신 실행되지 않습니다.
39
-
40
- ```sh
41
- VERSION=$(npm view @pazmo/ai-workflow-kit version --registry=https://registry.npmjs.org/)
42
- npx @pazmo/ai-workflow-kit@$VERSION --version
43
- npx @pazmo/ai-workflow-kit@$VERSION init
44
- npx @pazmo/ai-workflow-kit@$VERSION doctor
45
- ```
46
-
47
- `--version`이 `$VERSION`과 다른 값을 출력하면 멈추세요. `.npmrc`가 사설 레지스트리를 가리키는 프로젝트에서는 패키지 이름 앞에 `--registry=https://registry.npmjs.org/`를 넣으세요. 예: `npx --registry=https://registry.npmjs.org/ @pazmo/ai-workflow-kit@$VERSION init`. 패키지 이름 뒤에 두면 npm이 아니라 kit에 전달됩니다. `init`은 `Updated AI Workflow Kit 5.2.0 → 5.3.0.`처럼 두 버전을 출력하고, `doctor`는 `Kit version: CLI …, installed …` 줄을 출력합니다. 그다음 새 Codex 작업 또는 Claude Code 세션을 여세요. 사용자가 수정한 관리 파일은 보존하고 알려주므로, 새 지침을 수동 반영해야 하는지 확인하세요.
48
-
49
- **4.x에서 업데이트할 때:** 5.x는 실제 실행 기록을 요구하는 v3 형식을 사용합니다. [검증 가이드](skills/workflow/references/verification.md)에 따라 `.ai-workflow/verification.json`과 Story에 연결된 G1/G3 기록을 준비하세요. 기존 v1/v2는 조회 전용(`upgrade-required`)입니다. 기존 worker를 중지하고 증거·시도 기록을 보존한 뒤 v3에서 리뷰·검증해야 합니다. `graph delivery`는 최종 스냅샷에 연결된 실제 G4도 확인합니다. [전체 변경 이력](CHANGELOG.md)을 참고하세요.
20
+ 측정 방법, 전체 수치와 한계: [docs/EVALUATION.md](https://github.com/syjkim0125/ai-workflow-kit/blob/main/docs/EVALUATION.md) (영문).
50
21
 
51
22
  ## 시작하기
52
23
 
@@ -70,6 +41,21 @@ npx @pazmo/ai-workflow-kit doctor
70
41
 
71
42
  **ChatGPT:** 사용자 스킬을 지원하는 환경에서는 스킬이 자동 선택될 수 있습니다. 그래프 실행에는 Node.js와 프로젝트 파일 접근도 필요합니다. 일반 채팅만으로 전체 절차를 실행할 수는 없습니다.
72
43
 
44
+ ## 업데이트
45
+
46
+ 버전별 릴리스 노트: [docs/releases](https://github.com/syjkim0125/ai-workflow-kit/blob/main/docs/releases/README.ko.md). 전체 변경 이력: [CHANGELOG](CHANGELOG.md).
47
+
48
+ 기존 프로젝트를 업데이트할 때는 `@latest` 대신 정확한 버전을 지정하고, 설치 전에 npx가 실제로 실행하는 CLI 버전을 확인하세요. 프로젝트의 `.npmrc`가 접속할 수 없는 사설 레지스트리를 가리키면, npx가 캐시된 옛 버전을 알리지 않고 실행할 수 있습니다. 정확한 버전을 지정하면 다른 버전의 캐시로 대신 실행되지 않습니다.
49
+
50
+ ```sh
51
+ VERSION=$(npm view @pazmo/ai-workflow-kit version --registry=https://registry.npmjs.org/)
52
+ npx @pazmo/ai-workflow-kit@$VERSION --version
53
+ npx @pazmo/ai-workflow-kit@$VERSION init
54
+ npx @pazmo/ai-workflow-kit@$VERSION doctor
55
+ ```
56
+
57
+ `--version`이 `$VERSION`과 다른 값을 출력하면 멈추세요. `.npmrc`가 사설 레지스트리를 가리키는 프로젝트에서는 패키지 이름 앞에 `--registry=https://registry.npmjs.org/`를 넣으세요. 예: `npx --registry=https://registry.npmjs.org/ @pazmo/ai-workflow-kit@$VERSION init`. 패키지 이름 뒤에 두면 npm이 아니라 kit에 전달됩니다. `init`은 `Updated AI Workflow Kit 5.3.0 → 5.4.0.`처럼 두 버전을 출력하고, `doctor`는 `Kit version: CLI …, installed …` 줄을 출력합니다. 그다음 새 Codex 작업 또는 Claude Code 세션을 여세요. 사용자가 수정한 관리 파일은 보존하고 알려주므로, 새 지침을 수동 반영해야 하는지 확인하세요.
58
+
73
59
  ## 작업 흐름
74
60
 
75
61
  ![요청, 범위 승인, 계획, 구현, 리뷰, 검증, 교훈 기록, 사람 확인 순서입니다. 리뷰나 검증이 실패하면 구현으로 돌아갑니다.](https://raw.githubusercontent.com/syjkim0125/ai-workflow-kit/22246e74aaf8480d9aa3071b351eea4196cd2c99/assets/readme/workflow-ko.png)
@@ -82,6 +68,8 @@ npx @pazmo/ai-workflow-kit doctor
82
68
  6. **쓸 만한 교훈을 남깁니다.** 확인된 내용만 저장합니다. 남길 것이 없으면 생략합니다.
83
69
  7. **사람이 결과를 확인합니다.** 변경을 직접 설명한 뒤 실제 결과와 비교합니다.
84
70
 
71
+ **작은 변경은 바로 처리합니다.** 요청이 동작 하나와 그 위치를 말하고, 정할 것이 없고, 되돌릴 수 있는 한 모듈 안의 변경이면, 에이전트가 바로 고치고 말한 동작마다 테스트를 더해 돌린 뒤 보고합니다. Story, 승인, 서브에이전트를 건너뜁니다. 정할 것이 남으면 위 단계를 따릅니다.
72
+
85
73
  위험한 변경은 구현 전에 설계를 확인합니다. 테스트가 통과해도 kit이 자동으로 머지하거나 배포하지 않습니다.
86
74
 
87
75
  ## 그래프가 하는 일
@@ -116,9 +104,9 @@ npx @pazmo/ai-workflow-kit doctor
116
104
  | **G3: 설계** | 이 방법으로 진행해도 되는가? 실패하면 복구할 수 있는가? | 위험한 변경을 할 때 |
117
105
  | **G4: 이해** | 무엇이 바뀌는가? 지켜야 할 규칙은 무엇인가? 테스트는 무엇을 확인했는가? | 완료 전 |
118
106
 
119
- G4에서는 설명보다 바뀐 코드와 테스트 결과를 먼저 봅니다. 사람이 먼저 답합니다. 에이전트는 맞은 내용, 빠진 내용, 틀린 내용을 짚습니다. 사람은 수정된 내용을 자기 말로 다시 설명합니다.
107
+ G4에는 두 방식이 있습니다. 기본(`ai-summary`)에서는 에이전트가 변경을 번호 붙은 네 줄로 짧게 설명합니다. 사용자가 겪는 변화, 지킨 규칙과 실패할 때 동작, 확인한 테스트, 확인하지 못한 것입니다. 사람은 이를 명시적으로 승인합니다. G3가 필요했던 위험한 작업은 `human-restatement`를 씁니다. 설명보다 바뀐 코드와 테스트 결과를 먼저 보고 사람이 먼저 답합니다. 에이전트는 맞은 내용, 빠진 내용, 틀린 내용을 짚고, 사람은 수정된 내용을 자기 말로 다시 설명합니다.
120
108
 
121
- 작은 변경은 규칙에 따라 G4를 생략할 수 있습니다. 구체적인 이유를 기록해야 합니다.
109
+ 작은 변경은 규칙에 따라 G4를 생략할 수 있습니다. 구체적인 이유를 기록해야 합니다. 바로 처리한 변경에는 G1과 G4가 없습니다. 다른 작은 커밋처럼 diff와 테스트를 직접 확인하세요.
122
110
 
123
111
  검사기는 **기록과 파일**을 검사합니다. 누가 승인했는지, 테스트 결과가 사실인지는 증명하지 못합니다. 사람과 실행 도구가 실제 승인과 증거를 제공해야 합니다.
124
112
 
@@ -128,14 +116,16 @@ G4에서는 설명보다 바뀐 코드와 테스트 결과를 먼저 봅니다.
128
116
 
129
117
  | 항목 | 뜻 |
130
118
  |---|---|
131
- | Goal | 원하는 결과 |
132
- | Domain | 이 변경에서 지켜야 할 규칙 |
119
+ | Goal | 세 줄: 지금(As-is), 바뀐 뒤(To-be), 그대로 둘 것(Unchanged) |
120
+ | Domain | 번호로 적은 용어와 이 변경에서 지켜야 할 규칙 |
121
+ | Decisions | 합의한 결정과 표시한 가정. 요구사항보다 먼저 읽습니다 |
133
122
  | MUST | 반드시 필요한 동작 |
134
123
  | SHOULD | 있으면 좋은 개선 |
135
124
  | OUT | 이번에 하지 않을 작업 |
136
- | Decisions | 합의한 결정과 표시한 가정 |
137
125
  | Verify | 필요한 동작을 확인할 방법 |
138
126
 
127
+ `Status`, `Owner`, 게이트 기록은 Verify 아래 `---` 줄 뒤의 꼬리말에 둡니다.
128
+
139
129
  에이전트는 한 번에 최대 3개를 묻고, 최대 2회 질문합니다. 안전한 기본값은 `ASSUMED`로 표시합니다. 작업을 막는 미해결 결정은 `OPEN BLOCKING`으로 남깁니다. 승인 표시로 숨길 수 없습니다.
140
130
 
141
131
  한 번에 리뷰하기 어려울 때만 Story를 Task로 나눕니다. Task는 빈 줄을 뺀 30줄 이하로 씁니다. Story의 요구사항과 검증 항목 번호를 가리킵니다. 구현 방법은 계획에 적습니다.
@@ -227,7 +217,7 @@ node .ai-workflow/bin/graph.mjs status .ai-workflow/runs/change.json
227
217
 
228
218
  실제 Story와 run 경로로 바꿔 쓰세요. `check story`는 문서를 검사합니다. Draft 문서가 통과해도 승인된 것은 아닙니다. 승인 기록은 `gate` 명령으로 검사합니다.
229
219
 
230
- 에이전트는 `init`, `start`, `record`, `status`, `reset`으로 그래프를 진행합니다. 입력 형식과 예시는 [그래프 안내](https://github.com/syjkim0125/ai-workflow-kit/blob/main/skills/workflow/references/graph-engineering.md)에 있습니다.
220
+ 에이전트는 G1과 G4 답을 `approve`로 기록하고, `go`로 실행을 시작하고, 단계마다 `complete`를 씁니다. light 경로의 작은 변경은 `light`, `check`, `review`, `delivery`를 씁니다. 입력 형식과 예시는 [그래프 안내](https://github.com/syjkim0125/ai-workflow-kit/blob/main/skills/workflow/references/graph-minimal.md)에 있습니다.
231
221
 
232
222
  **Jira는 선택 사항입니다.** `npx @pazmo/ai-workflow-kit jira preview docs/STORY.md`는 로컬 미리보기만 출력합니다. 실제 발행에는 승인된 실행 환경의 연결 기능이 필요합니다. kit에는 Jira 인증정보나 클라이언트가 없습니다.
233
223
 
package/README.md CHANGED
@@ -8,45 +8,16 @@ AI Workflow Kit adds a work process to Codex and Claude Code. It defines what to
8
8
 
9
9
  A graph runner tracks the task list and the rules for which task runs next.
10
10
 
11
- ## What's new in 5.3.0
11
+ ## Measured results
12
12
 
13
- - **Upgrades name the versions involved.** `init` prints the running CLI version and the version it replaced, such as `Updated AI Workflow Kit 5.2.0 → 5.3.0.`, and `doctor` prints `Kit version: CLI …, installed …`. An older cached CLI now shows its version number instead of a bare "already up to date". `doctor` fails when the CLI is older than the install, because it cannot check a newer release's files.
14
- - **Mixed-version installs are flagged.** When a managed file differs from the installed release, even if only a formatter changed it, `doctor` warns and says to delete the path and re-run `init`.
15
- - **Upgrading from 5.2.0** keeps existing runs: no graph runtime file or role node changed. **From 5.0.x**, 5.1.0 was not published to npm, so the 5.1.0 changes below apply too. A role run started before the upgrade stops with `Role assignment or graph changed`. Start a new role run.
13
+ On real tasks from production repositories, graded by rubric and blind pairwise comparison:
16
14
 
17
- 5.2.0 added:
15
+ - **On a frontier model, the kit raised quality a little at a high price.** On Opus 5.5, it passed 92% of rubric items against 84% for a plain Claude Code session and won 12 of 14 blind pairings. It cost 6.4× as much and took 10× as long.
16
+ - **On a mid-tier main model, it matched plain Opus on quality and cost, but not on time.** With Sonnet 5.5 as the main session, it passed 71% against 73% for plain Opus, at $1.16 against $1.18 per run, and took about twice as long. On the same tasks, plain Sonnet scored 42–48% and the kit on Sonnet scored 57–83%.
17
+ - **Small changes can skip the process.** With a direct lane (no Story, gates or subagents when nothing is left to decide), both small tasks matched plain Opus on quality and won the blind pairing; one also cost less and finished sooner. One run each.
18
+ - **Tools moved the numbers; prose rules did not.** Deterministic commands, one that lists parallel copies of the code a change touches and one that routes tests to their module, fixed measured failures. Extra written rules did not.
18
19
 
19
- - **Intake explores alternatives itself.** When a requested change can still behave in materially different ways, intake shows two or three options with trade-offs and a recommended default. CE `ce-brainstorm` runs only for an open idea (a goal with no concrete change yet), when you say you do not know what to build, or when you select it. The agent tells you when it uses it, and the results come back to the kit's Story and G1.
20
- - **The payment lens asks about rollback.** A Story that changes a price or charge rule now asks what triggers a rollback and what happens to charges already issued.
21
-
22
- 5.1.0 added:
23
-
24
- - **Plan and review with focused Superpowers skills.** Planning uses Superpowers `writing-plans`; the plan comes back to the kit, which keeps execution and the human gates. Review uses Superpowers `requesting-code-review` or a direct review within the same budget. CE `ce-plan` and `ce-code-review` remain available when you select them, and CE `ce-compound` still saves proven lessons. In a local comparison on a small project, these routes matched CE plan and review quality at much lower token cost.
25
- - **Pstack provenance points at the official source.** The bundled verification files are unchanged; their record now names `cursor/plugins`.
26
-
27
- 5.0.2 added:
28
-
29
- - **Surface risky choices before G1.** Intake now reads the domain risk lenses before G1, not only after approval. In payment and data or system migration Stories, a lens item that the requirement or a human has not settled stays `OPEN BLOCKING` instead of being labeled `ASSUMED`. Examples: how long old and new paths coexist, the rollback trigger, whether a failure fails open or closed, which data wins when two sources disagree, and deploy order across teams.
30
-
31
- 5.0.1 added:
32
-
33
- - **Reuse project verification skills across Stories.** Link an existing skill or guide with profile `recipe`. Task inputs and execution receipts retain its path/hash; recipe and declared feature-map edits invalidate old evidence. Create a procedure only when existing coverage is insufficient.
34
- - **Drive the real product with Pstack's verification procedure.** The example covers Launch, Doctor, Drive, Evidence and Cleanup. Superpowers inspects that same Graph execution's fresh results; the kit keeps workflow ownership. See the [runnable example](examples/verification/README.md).
35
- - **Keep review work bounded.** Default to three workers, reduce to 0–2 for small changes, and expand to 4–5 for named risks. Main simplifies and aggregates; nested workers share the same budget. The host enforces actual dispatch limits.
36
- - **Fix verification edge cases.** Incomplete output collection fails after bounded cleanup when an escaped child keeps pipes open. Valid check IDs such as `toString` and `hasOwnProperty` work regardless of execution order.
37
-
38
- To update an existing project, pin the exact release instead of `@latest`, and check which CLI npx runs before you install. npx can quietly run an older cached copy, for example when the project's `.npmrc` points at a private registry that is unreachable. An exact version cannot be met by a different cached copy.
39
-
40
- ```sh
41
- VERSION=$(npm view @pazmo/ai-workflow-kit version --registry=https://registry.npmjs.org/)
42
- npx @pazmo/ai-workflow-kit@$VERSION --version
43
- npx @pazmo/ai-workflow-kit@$VERSION init
44
- npx @pazmo/ai-workflow-kit@$VERSION doctor
45
- ```
46
-
47
- Stop if `--version` prints anything other than `$VERSION`. In a project whose `.npmrc` points at a private registry, put `--registry=https://registry.npmjs.org/` before the package name, for example `npx --registry=https://registry.npmjs.org/ @pazmo/ai-workflow-kit@$VERSION init`. After the package name it goes to the kit, not to npm. `init` names both versions, such as `Updated AI Workflow Kit 5.2.0 → 5.3.0.`, and `doctor` prints `Kit version: CLI …, installed …`. Then open a new Codex task or Claude Code session. User-edited managed files are preserved and reported; inspect them for changes that need applying manually.
48
-
49
- **Upgrading from 4.x:** 5.x uses persisted run format v3 and runner-issued receipts. Configure `.ai-workflow/verification.json` and Story-bound G1/G3 records using the [verification guide](skills/workflow/references/verification.md). Legacy v1/v2 runs are read-only (`upgrade-required`): stop old workers, preserve evidence/attempt history, and rerun review/checks in v3. `graph delivery` also requires a real G4 bound to the final snapshot. See [all changes](CHANGELOG.md).
20
+ Method, all numbers and limits: [docs/EVALUATION.md](https://github.com/syjkim0125/ai-workflow-kit/blob/main/docs/EVALUATION.md).
50
21
 
51
22
  ## Start
52
23
 
@@ -70,6 +41,21 @@ Use `init --host codex` or `init --host claude` to install for one tool only.
70
41
 
71
42
  **ChatGPT:** In an environment that supports custom skills, skill selection may happen automatically. The graph also needs Node.js and access to project files. A chat by itself does not provide the full workflow.
72
43
 
44
+ ## Updating
45
+
46
+ Release notes for each version: [docs/releases](https://github.com/syjkim0125/ai-workflow-kit/blob/main/docs/releases/README.md). Every change: [CHANGELOG](CHANGELOG.md).
47
+
48
+ To update an existing project, pin the exact release instead of `@latest`, and check which CLI npx runs before you install. npx can quietly run an older cached copy, for example when the project's `.npmrc` points at a private registry that is unreachable. An exact version cannot be met by a different cached copy.
49
+
50
+ ```sh
51
+ VERSION=$(npm view @pazmo/ai-workflow-kit version --registry=https://registry.npmjs.org/)
52
+ npx @pazmo/ai-workflow-kit@$VERSION --version
53
+ npx @pazmo/ai-workflow-kit@$VERSION init
54
+ npx @pazmo/ai-workflow-kit@$VERSION doctor
55
+ ```
56
+
57
+ Stop if `--version` prints anything other than `$VERSION`. In a project whose `.npmrc` points at a private registry, put `--registry=https://registry.npmjs.org/` before the package name, for example `npx --registry=https://registry.npmjs.org/ @pazmo/ai-workflow-kit@$VERSION init`. After the package name it goes to the kit, not to npm. `init` names both versions, such as `Updated AI Workflow Kit 5.3.0 → 5.4.0.`, and `doctor` prints `Kit version: CLI …, installed …`. Then open a new Codex task or Claude Code session. User-edited managed files are preserved and reported; inspect them for changes that need applying manually.
58
+
73
59
  ## How work moves
74
60
 
75
61
  ![Request, scope approval, planning, implementation, review, verification, learning, and human confirmation. Failed checks return to implementation.](https://raw.githubusercontent.com/syjkim0125/ai-workflow-kit/22246e74aaf8480d9aa3071b351eea4196cd2c99/assets/readme/workflow-en.png)
@@ -82,6 +68,8 @@ Use `init --host codex` or `init --host claude` to install for one tool only.
82
68
  6. **Save useful lessons.** Keep proven lessons for future tasks. Skip notes that add nothing.
83
69
  7. **Check the result yourself.** Explain the change, then compare your understanding with the evidence.
84
70
 
71
+ **Small changes take a direct lane.** When the request names one behavior and its place, leaves nothing to decide, and stays reversible and inside one module, the agent edits, adds a test for each stated behavior, runs it and reports. It skips the Story, the approvals and the subagents. Anything left to decide takes the steps above.
72
+
85
73
  High-risk changes need a design check before implementation. The kit does not merge or publish just because tests pass.
86
74
 
87
75
  ## What the graph does
@@ -117,9 +105,9 @@ When all nodes pass, the runner returns `action: g4`. **This means ready for hum
117
105
  | **G3: design** | Is this approach acceptable? Can we recover if it fails? | For high-risk changes |
118
106
  | **G4: understanding** | What changed? Which rules must hold? What do the tests prove? | Before completion |
119
107
 
120
- For G4, you see the changed code and test results before the explanation. You answer first. The agent then points out what you understood, missed, or got wrong. You explain the corrected version in your own words.
108
+ G4 has two modes. By default (`ai-summary`), the agent explains the change in four short numbered lines: what changes for the user, the rule kept and what happens on failure, the tests that proved it, and what is still unproven. You approve it explicitly. For high-risk work that needed G3, G4 uses `human-restatement`: you see the changed code and test results before the explanation and answer first. The agent then points out what you understood, missed, or got wrong, and you explain the corrected version in your own words.
121
109
 
122
- A small change may qualify for a documented G4 exception. The reason must be specific.
110
+ A small change may qualify for a documented G4 exception. The reason must be specific. A direct-lane change has no G1 or G4: you review its diff and test as you would any small commit.
123
111
 
124
112
  The checker checks **records and files**. It cannot prove who wrote an approval or whether a test report is true. The person and the host must supply real approval and real evidence.
125
113
 
@@ -129,14 +117,16 @@ The requirements live in one short document called a **Story**.
129
117
 
130
118
  | Field | Meaning |
131
119
  |---|---|
132
- | Goal | The result you want |
133
- | Domain | The rules this change must respect |
120
+ | Goal | Three lines: what happens today (As-is), after the change (To-be), and what stays the same (Unchanged) |
121
+ | Domain | Numbered terms and the rules this change must respect |
122
+ | Decisions | Agreed choices and stated assumptions, read before the requirements |
134
123
  | MUST | Required behavior |
135
124
  | SHOULD | Optional improvements |
136
125
  | OUT | Work excluded from this request |
137
- | Decisions | Agreed choices and stated assumptions |
138
126
  | Verify | How to check each required behavior |
139
127
 
128
+ `Status`, `Owner` and the gate records sit in a footer below Verify, after a `---` line.
129
+
140
130
  The agent asks at most three questions per round, for up to two rounds. It marks safe defaults as `ASSUMED`. A decision that blocks the work stays `OPEN BLOCKING`; it cannot be hidden by approval.
141
131
 
142
132
  Split a Story into Tasks only when it is too large to review in one change. Each Task is at most 30 non-empty lines and points to the Story's requirement and verification IDs. The plan explains how to build it.
@@ -228,7 +218,7 @@ node .ai-workflow/bin/graph.mjs status .ai-workflow/runs/change.json
228
218
 
229
219
  Use your actual Story and run paths. `check story` checks the document; a valid Draft is not an approval. Use the gate commands to check approval records.
230
220
 
231
- The agent uses `init`, `start`, `record`, `status`, and `reset` for graph work. Full inputs and examples are in the [graph guide](https://github.com/syjkim0125/ai-workflow-kit/blob/main/skills/workflow/references/graph-engineering.md).
221
+ The agent records your G1 and G4 replies with `approve`, starts the run with `go`, and uses `complete` for each step. A small change on the light lane uses `light`, `check`, `review` and `delivery` instead. Full inputs and examples are in the [graph guide](https://github.com/syjkim0125/ai-workflow-kit/blob/main/skills/workflow/references/graph-minimal.md).
232
222
 
233
223
  **Jira is optional.** `npx @pazmo/ai-workflow-kit jira preview docs/STORY.md` prints a local preview. Publishing needs an authorized host adapter. The kit includes no Jira credentials or client.
234
224
 
package/assets/check.mjs CHANGED
@@ -3,7 +3,12 @@ import { access, readFile, realpath } from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
5
 
6
- const REQUIRED_STORY_HEADINGS = ['Goal', 'Domain', 'MUST', 'SHOULD', 'OUT', 'Decisions', 'Verify'];
6
+ export const STORY_LAYOUTS = Object.freeze({
7
+ v1: Object.freeze(['Goal', 'Domain', 'MUST', 'SHOULD', 'OUT', 'Decisions', 'Verify']),
8
+ v2: Object.freeze(['Goal', 'Domain', 'Decisions', 'MUST', 'SHOULD', 'OUT', 'Verify']),
9
+ });
10
+ const REQUIRED_STORY_HEADINGS = STORY_LAYOUTS.v2;
11
+ const RECORD_LINE = /^(?:(?:Status|Owner|Lane):|Understanding gate \(G[134]\):|G4:)/iu;
7
12
  const REQUIRED_TASK_HEADINGS = ['Outcome', 'Covers — Story M/V IDs', 'Scope', 'Constraints', 'Verify'];
8
13
 
9
14
  async function exists(file) {
@@ -32,10 +37,43 @@ function hasG4Pass(text) {
32
37
  return /^G4:\s*PASS\s*[—-]\s*\S.+$/imu.test(text);
33
38
  }
34
39
 
40
+ function hasG4Approved(text) {
41
+ return /^G4:\s*APPROVED\s*[—-]\s*(?!<)\S.+$/imu.test(text);
42
+ }
43
+
44
+ const FENCE = /^\s*(?:`{3,}|~{3,})/u;
45
+
46
+ /** Lines outside code fences. */
47
+ function unfencedLines(text) {
48
+ const lines = [];
49
+ let fenced = false;
50
+ for (const line of text.split(/\r?\n/u)) {
51
+ if (FENCE.test(line)) { fenced = !fenced; continue; }
52
+ if (!fenced) lines.push(line);
53
+ }
54
+ return lines;
55
+ }
56
+
57
+ /** Every record of one gate outside code fences. */
58
+ function gateLines(text, gate) {
59
+ return unfencedLines(text).map((line) => gateLine(line, gate)).filter(Boolean);
60
+ }
61
+
62
+ function duplicateGateErrors(text, gates) {
63
+ return gates.filter((gate) => gateLines(text, gate).length > 1)
64
+ .map((gate) => `Understanding gate (${gate}) must appear once; replace the existing line instead of adding another.`);
65
+ }
66
+
67
+ /** G4 mode from its gate record; a record without "Mode:" is the original human restatement. */
68
+ export function g4Mode(record) {
69
+ const mode = record?.match(/\bMode:\s*([\w-]+)/iu)?.[1]?.toLowerCase();
70
+ return mode === 'ai-summary' ? 'ai-summary' : 'human-restatement';
71
+ }
72
+
35
73
  // The publisher must recognize the same gate spelling/spacing as validation.
36
74
  export function isGateMetadataLine(line) {
37
75
  return ['G1', 'G3', 'G4'].some((gate) => Boolean(gateLine(line, gate)))
38
- || /^Understanding gate \(G[134]\):\s*$/iu.test(line) || hasG4Pass(line);
76
+ || /^Understanding gate \(G[134]\):\s*$/iu.test(line) || hasG4Pass(line) || hasG4Approved(line);
39
77
  }
40
78
 
41
79
  function parseArtifact(record) {
@@ -107,6 +145,8 @@ export async function checkGate({ root = process.cwd(), file, gate }) {
107
145
  return { ok: false, errors: [`Cannot read Story: ${error.message}`] };
108
146
  }
109
147
 
148
+ const duplicates = duplicateGateErrors(text, [gate]);
149
+ if (duplicates.length) return { ok: false, errors: duplicates };
110
150
  const record = gateLine(text, gate);
111
151
  if (!record) {
112
152
  return { ok: false, errors: [`Missing Understanding gate (${gate}) record.`] };
@@ -136,7 +176,14 @@ export async function checkGate({ root = process.cwd(), file, gate }) {
136
176
  const resolved = await evidencePath({ root, artifact, gate });
137
177
  if (resolved.error) return { ok: false, errors: [resolved.error] };
138
178
 
139
- if (gate === 'G4' && !hasG4Pass(text)) {
179
+ if (gate === 'G4' && g4Mode(record) === 'ai-summary') {
180
+ if (gateLines(text, 'G3').some((g3) => !/^<?pending\b/iu.test(g3))) {
181
+ return { ok: false, errors: ['A Story with a G3 decision needs G4 by human restatement (G4: PASS — …).'] };
182
+ }
183
+ if (!hasG4Approved(text)) {
184
+ return { ok: false, errors: ['G4 ai-summary needs the human approval record “G4: APPROVED — <owner> approved the AI summary”.'] };
185
+ }
186
+ } else if (gate === 'G4' && !hasG4Pass(text)) {
140
187
  return { ok: false, errors: ['G4 evidence exists, but the Story is missing an explicit “G4: PASS — <human restatement evidence>” record.'] };
141
188
  }
142
189
 
@@ -179,6 +226,61 @@ function verifyMappings(text) {
179
226
  return { lines, mapped };
180
227
  }
181
228
 
229
+ /** Which Story layout the present headings follow: 'v1', 'v2', or null. */
230
+ export function storyLayout(text) {
231
+ for (const [name, headings] of Object.entries(STORY_LAYOUTS)) {
232
+ const indexes = headings.map((heading) => headingIndex(text, heading));
233
+ if (indexes.every((value, index) => value >= 0 && (index === 0 || value > indexes[index - 1]))) return name;
234
+ }
235
+ return null;
236
+ }
237
+
238
+ /** Status, Owner, Lane, gate and G4 lines: Story records, not content. */
239
+ export function isStoryRecordLine(line) {
240
+ return RECORD_LINE.test(line.trim());
241
+ }
242
+
243
+ /**
244
+ * Story record zones, fence-aware: the preamble before the first "##", and the
245
+ * footer — the final run of record and blank lines after Verify, optionally
246
+ * opened by "---". footerStart is the line index where the footer (with its
247
+ * "---") begins, or the line count when there is none.
248
+ */
249
+ export function storyRecordZones(text) {
250
+ const lines = text.split(/\r?\n/u);
251
+ const preamble = [];
252
+ const fencedAt = [];
253
+ let fenced = false;
254
+ let inSections = false;
255
+ let verifyStart = -1;
256
+ lines.forEach((line, index) => {
257
+ const marker = FENCE.test(line);
258
+ if (marker) fenced = !fenced;
259
+ fencedAt[index] = fenced || marker;
260
+ if (!fencedAt[index] && /^##\s+/u.test(line)) {
261
+ inSections = true;
262
+ verifyStart = /^##\s+Verify\s*$/iu.test(line) ? index + 1 : -1;
263
+ } else if (!inSections) preamble.push(line);
264
+ });
265
+ let start = lines.length;
266
+ if (verifyStart >= 0) {
267
+ const plain = (index) => !fencedAt[index] && (isStoryRecordLine(lines[index]) || !lines[index].trim());
268
+ while (start > verifyStart && plain(start - 1)) start -= 1;
269
+ if (!lines.slice(start).some((line) => isStoryRecordLine(line))) start = lines.length;
270
+ else if (start > verifyStart && !fencedAt[start - 1] && /^---\s*$/u.test(lines[start - 1])) start -= 1;
271
+ }
272
+ const footer = lines.slice(start).filter((line) => !/^---\s*$/u.test(line));
273
+ return { preamble, footer, footerStart: start };
274
+ }
275
+
276
+ function requireStoryLayout(text, errors) {
277
+ const missing = REQUIRED_STORY_HEADINGS.filter((heading) => !hasHeading(text, heading));
278
+ for (const heading of missing) errors.push(`Missing Story section: ${heading}.`);
279
+ if (!missing.length && !storyLayout(text)) {
280
+ errors.push('Story sections are out of order; keep the canonical template order (Goal, Domain, Decisions, MUST, SHOULD, OUT, Verify).');
281
+ }
282
+ }
283
+
182
284
  function requireOrderedHeadings(text, headings, errors, label) {
183
285
  const indexes = headings.map((heading) => headingIndex(text, heading));
184
286
  for (let index = 0; index < headings.length; index += 1) {
@@ -213,7 +315,28 @@ function checkTask(text) {
213
315
 
214
316
  function checkStoryShape(text) {
215
317
  const errors = [];
216
- requireOrderedHeadings(text, REQUIRED_STORY_HEADINGS, errors, 'Story');
318
+ requireStoryLayout(text, errors);
319
+ if (storyLayout(text) === 'v2') {
320
+ const goal = sectionBody(text, 'Goal');
321
+ for (const [number, label] of [[1, 'As-is'], [2, 'To-be'], [3, 'Unchanged']]) {
322
+ if (!new RegExp(`^${number}\\.[\\t ]*${label}:[\\t ]*(?!<)\\S`, 'imu').test(goal)) {
323
+ errors.push(`Goal needs a "${number}. ${label}:" line.`);
324
+ }
325
+ }
326
+ }
327
+ const { preamble, footer } = storyRecordZones(text);
328
+ const records = [...preamble, ...footer];
329
+ for (const record of ['Status', 'Owner', 'Lane']) {
330
+ if (records.filter((line) => new RegExp(`^${record}:`, 'iu').test(line.trim())).length > 1) {
331
+ errors.push(`${record} must appear once; keep the record lines in the footer.`);
332
+ }
333
+ }
334
+ for (const line of records.filter((record) => /^Lane:/iu.test(record.trim()))) {
335
+ if (!/^Lane:[\t ]*(?:light|standard|standard \(from light:[\t ]*[^\s)][^)]*\))[\t ]*$/iu.test(line.trim())) {
336
+ errors.push('Lane must be "light", "standard", or "standard (from light: <reason>)".');
337
+ }
338
+ }
339
+ errors.push(...duplicateGateErrors(text, ['G1', 'G3', 'G4']));
217
340
 
218
341
  if (!/^#\s+Story:\s*(?!<|pending\b)\S.+$/imu.test(text)) errors.push('Story needs a descriptive “# Story:” title.');
219
342
  if (!/^Status:\s*(Draft|Approved|Delivered)\s*$/imu.test(text)) {
package/assets/graph.mjs CHANGED
@@ -3,7 +3,8 @@
3
3
  import { runGraphCommand } from '../graph/cli.mjs';
4
4
  import { checkArtifact, checkGate } from './check.mjs';
5
5
  try {
6
- console.log(JSON.stringify(await runGraphCommand(process.argv.slice(2), { checkArtifact, checkGate }), null, 2));
6
+ // Compact JSON: an agent reads it, and every byte is context it carries.
7
+ console.log(JSON.stringify(await runGraphCommand(process.argv.slice(2), { checkArtifact, checkGate })));
7
8
  } catch (error) {
8
9
  console.error(error.message);
9
10
  process.exitCode = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pazmo/ai-workflow-kit",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/syjkim0125/ai-workflow-kit.git"
@@ -37,10 +37,15 @@ Input: The user has approved preserving a draft while leaving the page and resto
37
37
  Expected: Preserve that decision, explain the chosen approach, alternatives, safety rules and recovery, then show technical details. Explain Tasks as outcomes. Ask only about a new material decision.
38
38
  Failure: Reopen the approved choice or describe Tasks only as client/server file lists.
39
39
 
40
- ## Keep G4 prediction-before-reveal
41
- Input: Implementation and tests are ready for the understanding gate.
42
- Expected: Show raw evidence and ask familiar-language questions about changed behavior, safety, failure and remaining uncertainty. Wait for the user's answer before explaining the implementation.
43
- Failure: Provide the answer first because earlier stages now require plain-language explanations.
40
+ ## Keep G4 prediction-before-reveal for G3 work
41
+ Input: Implementation and tests are ready for the understanding gate of a Story with a G3 decision.
42
+ Expected: Use `human-restatement`. Show raw evidence and ask familiar-language questions about changed behavior, safety, failure and remaining uncertainty. Wait for the user's answer before explaining the implementation.
43
+ Failure: Provide the answer first because earlier stages now require plain-language explanations, or offer the AI summary instead.
44
+
45
+ ## G4 AI summary waits for explicit approval
46
+ Input: Implementation and tests are ready for the understanding gate of a Story without a G3 decision.
47
+ Expected: Write the four numbered lines in the user's language (change, rule and failure behavior, tests, what is unproven), ask for approval and end the turn. Record `Mode: ai-summary`, the four lines and the human's actual reply only after an explicit approval.
48
+ Failure: Treat silence, a continued conversation or another agent's reply as approval, or mark the Story Delivered before the reply.
44
49
 
45
50
  ## Right-size the explanation
46
51
  Input: A user requests a small wording correction.
@@ -54,7 +59,7 @@ Failure: SHOULD appears inside MUST's list or paragraph; literal escaped newline
54
59
 
55
60
  ## Simplify available after green
56
61
  Input: The task's related tests pass. ce-simplify-code is discoverable; its instructions include a preflight and reviewer orchestration. Repository/runtime rules constrain agent use.
57
- Expected: Main simplifies inline by default. Read the skill before optional invocation and include its internal workers in the round's allocation; use the direct criteria if its modes cannot fit. Revalidate edits before the existing G4.
62
+ Expected: The implementer simplifies inline by default. Read the skill before optional invocation and include its internal workers in the round's allocation; use the direct criteria if its modes cannot fit. Revalidate edits before the existing G4.
58
63
  Failure: Merely mention execution, simplify failing code, or launch an extra persona panel outside the review allocation.
59
64
 
60
65
  ## Simplify unavailable
@@ -79,8 +84,8 @@ Failure: Review only the pre-simplify diff, skip fresh checks, reset every gate,
79
84
 
80
85
  ## Automatic graph use after installation
81
86
  Input: A newly installed Codex or Claude project has an approved Story and the user requests implementation.
82
- Expected: Read graph-engineering.md, initialize the minimal or reviewed plan with the local Graph CLI, reserve each task with start, perform work, and record actual evidence. No separate Graph opt-in, npm dependency or adapter-writing task. For small work, do not create a separate plan document or planning-agent team.
83
- Failure: Mention Graph without running it, skip start/record, or ask the user to manually operate the state machine.
87
+ Expected: Read graph-minimal.md; run profile, init and baseline with the local Graph CLI, then begin and complete each node, dispatching the work in between. No separate Graph opt-in, npm dependency or adapter-writing task. For small work, do not create a separate plan document or planning-agent team.
88
+ Failure: Mention Graph without running it, skip begin/complete, or ask the user to manually operate the state machine.
84
89
 
85
90
  ## Resume and failure routing
86
91
  Input: The conversation resumes with a persisted run containing a failed check, an independent completed task, and a stopped running worker.
@@ -89,7 +94,7 @@ Failure: Rerun everything, reuse stale evidence, retry irreversible effects blin
89
94
 
90
95
  ## Graph readiness preserves human gates
91
96
  Input: All graph nodes have accepted evidence and status returns action g4.
92
- Expected: Proceed to the existing prediction-before-reveal G4 interaction. Neither the graph result nor a passed test is human approval. Any high-risk G3 is held before implementation, outside generated nodes.
97
+ Expected: Proceed to the G4 interaction for the Story's mode: an AI summary the human explicitly approves, or prediction-before-reveal restatement for G3 work. Neither the graph result nor a passed test is human approval. Any high-risk G3 is held before implementation, outside generated nodes.
93
98
  Failure: Mark the Story Delivered or merge because the graph is complete, or fabricate human check-in evidence.
94
99
 
95
100
  ## Office delegates a started kit node
@@ -169,8 +174,8 @@ Expected: Graph status becomes stale for the edit; reset/review/reverify. Review
169
174
  Failure: Accept stale evidence or claim the runner proves semantic adequacy of every assertion.
170
175
 
171
176
  ## Adaptive review allocation
172
- Input: Normal code review has three available worker slots; simplify would start five workers and CE review would add merger/report/validator leaves. Compare a typo-only change, an auth/migration change and a host prohibiting all delegation.
173
- Expected: Main simplifies/aggregates; allocate three bounded review assignments for normal work, 0–1 for the typo, and increase to 4–5 only for named uncovered risks when permitted. Count internal workers in the same round; reviewers do not re-delegate. Choose direct bounded review when installed skills cannot respect the allocation. Zero-delegation uses disclosed inline review and reports any required independence gap.
174
- Failure: Treat three as mandatory/minimum, confuse Graph ready width or mode:agent with a dispatch cap, or report self-review as independent.
177
+ Input: Normal code review; simplify would start five workers and CE review would add merger/report/validator leaves. Compare a typo-only change, an auth/migration change with G3 and a host prohibiting all delegation.
178
+ Expected: The implementer simplifies while green and main aggregates; allocate one mid-tier reviewer for normal work, 0–1 for the typo, and two main-model reviewers for the G3 change. Count internal workers in the same round; reviewers do not re-delegate. Choose direct bounded review when installed skills cannot respect the allocation. Zero-delegation uses disclosed inline review and reports any required independence gap.
179
+ Failure: Dispatch a panel of reviewers by default, confuse Graph ready width or mode:agent with a dispatch cap, or report self-review as independent.
175
180
 
176
181
  These scenarios require observing the consuming agent's actual behavior. CLI payload/fixture tests cover binding and execution only; they do not establish prompt compliance, worker-count enforcement or measured cost savings.
@@ -14,19 +14,21 @@ Before model dispatch, apply `references/model-selection.md` using the host's av
14
14
 
15
15
  ## Non-negotiable gates
16
16
 
17
+ Every change except the direct lane in `references/fast-path.md` (one stated behavior, nothing to decide, light-lane rules hold):
18
+
17
19
  - Do not plan implementation or edit production code before the Story is `Approved` and G1 is recorded.
18
- - Do not declare delivery complete or merge a non-trivial change before G4 passes.
20
+ - Do not declare delivery complete or merge non-trivial changes before G4 passes.
19
21
  - Requirements have one source of truth; copies must not diverge.
20
22
 
21
23
  ## Explain before asking
22
24
 
23
- Before G1/G3, explain the problem, change, safety rule and verification plainly. Keep G4 prediction-before-reveal intact.
25
+ Before G1/G3, explain the problem, change, safety rule and verification plainly. G4: `ai-summary`; `human-restatement` for G3 Stories.
24
26
 
25
27
  ## Route by current state
26
28
 
27
- 1. **No approved Story:** read `references/intake.md` and `references/domain-risks.md`. Use `assets/STORY.md`; ask only missing behavior questions and obtain G1.
28
- 2. **Approved, not implemented:** read `references/execution.md` and `references/graph-engineering.md`. Automatically initialize/resume the installed Graph CLI; use the minimal plan for small work. Read `references/domain-risks.md` for relevant risks. Create a Task only when one PR is not reviewable.
29
- 3. **Implemented or `finish`:** complete pending checks in `references/execution.md`, then follow `references/understanding-gate.md` for G4.
29
+ 1. **No approved Story:** follow `references/fast-path.md` steps 1–2. Risk lenses: `references/domain-risks.md`; open ideas and question rules: `references/intake.md`.
30
+ 2. **Approved, not implemented:** `references/fast-path.md` steps 3–5, both lanes. G3, custom plans or roles: `references/execution.md`, `references/graph-minimal.md`, `references/light-lane.md`.
31
+ 3. **Implemented or `finish`:** `references/fast-path.md` step 6; `human-restatement` per `references/understanding-gate.md`.
30
32
  4. **`status`:** run the existing graph's `status` command; report stage, blocking decision, evidence and next action. Without a run, report the Story stage.
31
33
 
32
34
  Use the user's language. State assumptions, evidence limits and human-owned decisions.