@pazmo/ai-workflow-kit 5.0.3 → 5.3.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.ko.md +33 -7
- package/README.md +33 -7
- package/bin/ai-workflow-kit.mjs +63 -4
- package/package.json +1 -1
- package/skills/workflow/EVALS.md +20 -0
- package/skills/workflow/assets/TASK.md +1 -1
- package/skills/workflow/references/domain-risks.md +1 -1
- package/skills/workflow/references/execution.md +4 -4
- package/skills/workflow/references/intake.md +2 -1
- package/skills/workflow/references/pstack/provenance.json +6 -3
- package/skills/workflow/references/skill-integration.md +12 -8
- package/src/graph/roles.mjs +2 -2
- package/src/install.mjs +53 -14
- package/src/managed-block.mjs +1 -1
- package/src/version.mjs +28 -0
package/README.ko.md
CHANGED
|
@@ -8,7 +8,23 @@ AI Workflow Kit은 Codex와 Claude Code에 작업 절차를 추가합니다. 무
|
|
|
8
8
|
|
|
9
9
|
그래프 실행기가 작업 목록과 실행 순서를 관리합니다.
|
|
10
10
|
|
|
11
|
-
## 5.0
|
|
11
|
+
## 5.3.0 업데이트
|
|
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`로 멈춥니다. 새 역할 실행을 시작하세요.
|
|
16
|
+
|
|
17
|
+
5.2.0에서 추가된 것:
|
|
18
|
+
|
|
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에서 추가된 것:
|
|
12
28
|
|
|
13
29
|
- **위험한 선택을 G1 전에 드러냅니다.** 이제 승인 뒤뿐 아니라 G1 전 질문 단계에서도 도메인 위험 렌즈를 읽습니다. 결제나 데이터·시스템 이관 Story에서 요구사항이나 사람이 정하지 않은 렌즈 항목은 `ASSUMED`로 넘기지 않고 `OPEN BLOCKING`으로 남깁니다. 예를 들면 옛 경로와 새 경로를 얼마나 함께 둘지, 롤백 기준, 실패하면 열어 둘지 닫을지, 두 데이터가 다르면 어느 쪽이 기준인지, 팀 간 배포 순서입니다.
|
|
14
30
|
|
|
@@ -19,7 +35,16 @@ AI Workflow Kit은 Codex와 Claude Code에 작업 절차를 추가합니다. 무
|
|
|
19
35
|
- **리뷰는 기본 3명으로 조정합니다.** 작은 변경은 0~2명, 명확한 전문 위험이 있으면 4~5명으로 조정합니다. 메인이 단순화와 결과 통합을 맡고, 내부 위임도 같은 예산에 포함합니다. 실제 인원 제한은 호스트가 적용합니다.
|
|
20
36
|
- **검증 실행의 예외를 수정했습니다.** 분리된 자식이 출력 파이프를 유지해도 정해진 정리 시간 뒤 불완전한 수집을 실패로 기록합니다. `toString`, `hasOwnProperty` 같은 유효한 검사 ID도 실행 순서와 관계없이 사용할 수 있습니다.
|
|
21
37
|
|
|
22
|
-
기존
|
|
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 세션을 여세요. 사용자가 수정한 관리 파일은 보존하고 알려주므로, 새 지침을 수동 반영해야 하는지 확인하세요.
|
|
23
48
|
|
|
24
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)을 참고하세요.
|
|
25
50
|
|
|
@@ -121,15 +146,16 @@ kit이 전체 절차를 정합니다. 설치된 스킬은 각 단계를 맡습
|
|
|
121
146
|
|
|
122
147
|
| 단계 | 우선 사용하는 스킬 |
|
|
123
148
|
|---|---|
|
|
124
|
-
|
|
|
149
|
+
| 요구 정리 | kit 자체 intake. 만들 기능 없이 목표만 있는 열린 요청이거나 사용자가 고를 때만 CE `ce-brainstorm` |
|
|
150
|
+
| 계획 | Superpowers `writing-plans`, 결과는 kit에 돌려줌(호출자가 실행 담당) |
|
|
125
151
|
| 테스트를 쓰며 구현 | Superpowers `test-driven-development` |
|
|
126
152
|
| 실패 원인 분석 | Superpowers `systematic-debugging` |
|
|
127
153
|
| 테스트 통과 후 단순화 | 메인이 수행하고, 같은 리뷰 예산 안에서 CE `ce-simplify-code`를 선택 사용 |
|
|
128
|
-
| 리뷰 | 같은 예산 안에서
|
|
154
|
+
| 리뷰 | 같은 예산 안에서 Superpowers `requesting-code-review` 또는 직접 검토 |
|
|
129
155
|
| 최신 코드 검증 | Superpowers `verification-before-completion` |
|
|
130
156
|
| 검증된 교훈 기록 | CE `ce-compound` |
|
|
131
157
|
|
|
132
|
-
Developer는 배정받은 작업만 합니다. Superpowers나 CE의 전체 절차를 다시 시작하지 않습니다. CE `ce-work mode:return-to-caller`는 명시적으로 선택할 때 쓰는 대안입니다. 구현을 두 번 수행하지 않습니다.
|
|
158
|
+
Developer는 배정받은 작업만 합니다. Superpowers나 CE의 전체 절차를 다시 시작하지 않습니다. CE `ce-work mode:return-to-caller`는 명시적으로 선택할 때 쓰는 대안입니다. 구현을 두 번 수행하지 않습니다. CE `ce-plan`과 예산 안의 `ce-code-review mode:agent`도 명시적으로 선택할 때 쓰는 대안입니다.
|
|
133
159
|
|
|
134
160
|
**이 플러그인들은 kit에 포함되지 않습니다.** 에이전트는 사용할 수 있는 스킬을 확인합니다. 스킬이 없으면 kit의 직접 수행 절차를 쓰고 그 사실을 알립니다.
|
|
135
161
|
|
|
@@ -179,9 +205,9 @@ AGENTS.md / CLAUDE.md 표시된 구간에 작업 지침 추가
|
|
|
179
205
|
templates/ai-workflow/ Story와 Task 서식
|
|
180
206
|
```
|
|
181
207
|
|
|
182
|
-
`init`은 기존 설치도
|
|
208
|
+
`init`은 기존 설치도 업데이트하고, 실행한 버전과 교체한 버전을 출력합니다. 사용자가 고친 관리 파일은 보존하고 알려줍니다. 보존된 파일은 옛 내용 그대로이므로 설치에 여러 버전이 섞입니다. 포매터가 바꾼 것도 수정으로 봅니다. 새 버전을 받으려면 그 파일을 지우고 `init`을 다시 실행하세요. `remove`는 kit이 관리하는 파일과 지침 구간을 제거합니다. 사용자 변경, 실행 기록, 증거는 남깁니다.
|
|
183
209
|
|
|
184
|
-
설치 후 `doctor`를 실행하세요. 누락된
|
|
210
|
+
설치 후 `doctor`를 실행하세요. CLI 버전과 설치된 버전을 출력하고, 누락된 파일, 그 버전과 내용이 다른 관리 파일, 검사기·그래프를 숨기는 Git 무시 규칙을 찾습니다. CLI가 설치된 kit보다 오래된 버전이면 실패합니다. 프로젝트를 공유하기 전에 안내대로 수정하세요.
|
|
185
211
|
|
|
186
212
|
## 명령어
|
|
187
213
|
|
package/README.md
CHANGED
|
@@ -8,7 +8,23 @@ 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.0
|
|
11
|
+
## What's new in 5.3.0
|
|
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.
|
|
16
|
+
|
|
17
|
+
5.2.0 added:
|
|
18
|
+
|
|
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:
|
|
12
28
|
|
|
13
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.
|
|
14
30
|
|
|
@@ -19,7 +35,16 @@ A graph runner tracks the task list and the rules for which task runs next.
|
|
|
19
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.
|
|
20
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.
|
|
21
37
|
|
|
22
|
-
To update an existing project,
|
|
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.
|
|
23
48
|
|
|
24
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).
|
|
25
50
|
|
|
@@ -122,15 +147,16 @@ The kit controls the overall process. Available skills handle individual steps.
|
|
|
122
147
|
|
|
123
148
|
| Step | Preferred skill |
|
|
124
149
|
|---|---|
|
|
125
|
-
|
|
|
150
|
+
| Clarify the request | The kit's own intake; CE `ce-brainstorm` only for an open idea (a goal with no concrete change yet) or when selected |
|
|
151
|
+
| Plan | Superpowers `writing-plans`, returned to the kit (caller-owned) |
|
|
126
152
|
| Implement with tests | Superpowers `test-driven-development` |
|
|
127
153
|
| Diagnose a failure | Superpowers `systematic-debugging` |
|
|
128
154
|
| Simplify after tests pass | Main performs the pass; optional CE `ce-simplify-code` within the shared review budget |
|
|
129
|
-
| Review |
|
|
155
|
+
| Review | Superpowers `requesting-code-review` or direct review within the same budget |
|
|
130
156
|
| Run fresh final checks | Superpowers `verification-before-completion` |
|
|
131
157
|
| Save a proven lesson | CE `ce-compound` |
|
|
132
158
|
|
|
133
|
-
A Developer performs its assigned task. It does not restart the full Superpowers or CE process. CE `ce-work mode:return-to-caller` is an alternative when explicitly selected, not a second implementation pass.
|
|
159
|
+
A Developer performs its assigned task. It does not restart the full Superpowers or CE process. CE `ce-work mode:return-to-caller` is an alternative when explicitly selected, not a second implementation pass. CE `ce-plan` and bounded `ce-code-review mode:agent` are also explicit alternatives.
|
|
134
160
|
|
|
135
161
|
**These plugins are not bundled.** The agent checks which skills are installed. If a skill is missing, it follows the kit's direct procedure and reports that choice.
|
|
136
162
|
|
|
@@ -180,9 +206,9 @@ AGENTS.md / CLAUDE.md Workflow instructions inside a marked block
|
|
|
180
206
|
templates/ai-workflow/ Story and Task templates
|
|
181
207
|
```
|
|
182
208
|
|
|
183
|
-
`init` also updates an existing installation. It preserves user-edited managed files and reports them. `remove` removes owned files and instruction blocks. It keeps user changes, run files, and evidence.
|
|
209
|
+
`init` also updates an existing installation and names the version it ran and the version it replaced. It preserves user-edited managed files and reports them. A preserved file keeps its old content, so the install then mixes versions. Formatter passes count as edits. To take the new copy, delete the file and run `init` again. `remove` removes owned files and instruction blocks. It keeps user changes, run files, and evidence.
|
|
184
210
|
|
|
185
|
-
Run `doctor` after installation. It finds missing files and Git ignore rules that hide the checker or graph runtime. Follow its suggested fixes before sharing the project.
|
|
211
|
+
Run `doctor` after installation. It prints the CLI and installed versions, finds missing files, warns about managed files that differ from that version, and finds Git ignore rules that hide the checker or graph runtime. It fails when the CLI is older than the installed kit. Follow its suggested fixes before sharing the project.
|
|
186
212
|
|
|
187
213
|
## Commands
|
|
188
214
|
|
package/bin/ai-workflow-kit.mjs
CHANGED
|
@@ -3,14 +3,17 @@ import { access, readFile, readdir } from 'node:fs/promises';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { checkArtifact, checkGate } from '../assets/check.mjs';
|
|
6
|
-
import { installWorkflow, removeWorkflow } from '../src/install.mjs';
|
|
6
|
+
import { installWorkflow, managedDrift, removeWorkflow } from '../src/install.mjs';
|
|
7
7
|
import { checkerVisibility, fileVisibilities, ignoredCheckerAdvice } from '../src/git-visibility.mjs';
|
|
8
8
|
import { END_MARKER, START_MARKER } from '../src/managed-block.mjs';
|
|
9
9
|
import { HOSTS } from '../src/paths.mjs';
|
|
10
10
|
import { publishStory } from '../src/jira.mjs';
|
|
11
11
|
import { runGraphCommand } from '../src/graph/cli.mjs';
|
|
12
|
+
import { compareVersions, readPackageVersion } from '../src/version.mjs';
|
|
12
13
|
|
|
13
14
|
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
15
|
+
const PACKAGE_NAME = '@pazmo/ai-workflow-kit';
|
|
16
|
+
const PUBLIC_REGISTRY = 'https://registry.npmjs.org/';
|
|
14
17
|
|
|
15
18
|
async function graphFiles() {
|
|
16
19
|
return ['.ai-workflow/bin/graph.mjs', ...(await readdir(path.join(packageRoot, 'src/graph')))
|
|
@@ -73,6 +76,38 @@ async function exists(file) {
|
|
|
73
76
|
try { await access(file); return true; } catch { return false; }
|
|
74
77
|
}
|
|
75
78
|
|
|
79
|
+
// A stale CLI (for example a cached npx copy behind an unreachable private registry)
|
|
80
|
+
// must not vouch for a newer install: that direction fails, the other only warns.
|
|
81
|
+
function versionCheck(cli, installed) {
|
|
82
|
+
const line = `Kit version: CLI ${cli}, installed ${installed ?? 'unknown'}`;
|
|
83
|
+
const order = compareVersions(cli, installed);
|
|
84
|
+
if (order === 0) return { status: 'PASS', line, advice: [], ok: true, sameVersion: true };
|
|
85
|
+
if (order === null) {
|
|
86
|
+
return { status: 'WARN', line, advice: ['The installed version is not recorded. Run init with this CLI to record it.'], ok: true };
|
|
87
|
+
}
|
|
88
|
+
if (order > 0) {
|
|
89
|
+
return {
|
|
90
|
+
status: 'WARN', line, ok: true,
|
|
91
|
+
advice: [
|
|
92
|
+
`The project has an older release. Run init with this CLI to update it, or check it with ${PACKAGE_NAME}@${installed}.`,
|
|
93
|
+
'File contents are compared only when the versions match.',
|
|
94
|
+
],
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
status: 'FAIL', line, ok: false,
|
|
99
|
+
advice: [
|
|
100
|
+
'This CLI is older than the installed kit: it cannot check that release, and its init would downgrade it.',
|
|
101
|
+
`npx may have run a cached copy (for example when a private registry in .npmrc is unreachable). Run: npx --registry=${PUBLIC_REGISTRY} ${PACKAGE_NAME}@${installed} doctor`,
|
|
102
|
+
],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function listSome(items, limit = 3) {
|
|
107
|
+
const shown = items.slice(0, limit).join(', ');
|
|
108
|
+
return items.length > limit ? `${shown}, +${items.length - limit} more` : shown;
|
|
109
|
+
}
|
|
110
|
+
|
|
76
111
|
async function doctor(root) {
|
|
77
112
|
const configFile = path.join(root, '.ai-workflow/config.json');
|
|
78
113
|
if (!await exists(configFile)) {
|
|
@@ -88,6 +123,11 @@ async function doctor(root) {
|
|
|
88
123
|
return false;
|
|
89
124
|
}
|
|
90
125
|
|
|
126
|
+
const cliVersion = await readPackageVersion(packageRoot);
|
|
127
|
+
const version = versionCheck(cliVersion, config.packageVersion);
|
|
128
|
+
console.log(`${version.status} ${version.line}`);
|
|
129
|
+
for (const line of version.advice) console.log(` ${line}`);
|
|
130
|
+
|
|
91
131
|
const hosts = Array.isArray(config.hosts) ? config.hosts : [];
|
|
92
132
|
if (hosts.length === 0 || hosts.some((host) => !HOSTS[host])) {
|
|
93
133
|
console.log('MISS configured hosts');
|
|
@@ -110,7 +150,7 @@ async function doctor(root) {
|
|
|
110
150
|
if (name.endsWith('.mjs')) checks.push([`Graph runtime ${name}`, `.ai-workflow/graph/${name}`]);
|
|
111
151
|
}
|
|
112
152
|
|
|
113
|
-
let ok =
|
|
153
|
+
let ok = version.ok;
|
|
114
154
|
for (const [label, relative, routing] of checks) {
|
|
115
155
|
const file = path.join(root, relative);
|
|
116
156
|
let present = await exists(file);
|
|
@@ -122,6 +162,16 @@ async function doctor(root) {
|
|
|
122
162
|
ok &&= present;
|
|
123
163
|
}
|
|
124
164
|
|
|
165
|
+
if (version.sameVersion) {
|
|
166
|
+
const drift = await managedDrift({ root, packageRoot, hosts });
|
|
167
|
+
for (const { relative, files } of drift) {
|
|
168
|
+
console.log(`WARN Mixed version: ${relative} differs from ${cliVersion}${files.length ? ` (${listSome(files)})` : ''}`);
|
|
169
|
+
}
|
|
170
|
+
if (drift.length) {
|
|
171
|
+
console.log(` Kept from an older release or edited locally (a formatter pass counts). To take ${cliVersion}, delete each listed path and re-run init; copy any edits you want to keep first.`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
125
175
|
const visibility = await checkerVisibility(root);
|
|
126
176
|
if (visibility.status === 'ignored') {
|
|
127
177
|
console.log(`MISS Checker reaches git: ${visibility.source}`);
|
|
@@ -172,9 +222,18 @@ async function main(argv) {
|
|
|
172
222
|
|
|
173
223
|
if (command === 'init') {
|
|
174
224
|
const result = await installWorkflow({ root, packageRoot, hosts });
|
|
175
|
-
|
|
225
|
+
const { version, previousVersion } = result;
|
|
226
|
+
if (!result.changed) console.log(`AI Workflow Kit ${version} is already up to date (installed ${previousVersion ?? version}).`);
|
|
227
|
+
else if (!previousVersion) console.log(`Installed AI Workflow Kit ${version}.`);
|
|
228
|
+
else console.log(`Updated AI Workflow Kit ${previousVersion} → ${version}.`);
|
|
229
|
+
if (compareVersions(version, previousVersion) < 0) {
|
|
230
|
+
console.log(`WARNING This CLI (${version}) is older than the kit it replaced (${previousVersion}), so the project was downgraded. If npx ran a cached copy, re-run: npx --registry=${PUBLIC_REGISTRY} ${PACKAGE_NAME}@${previousVersion} init`);
|
|
231
|
+
}
|
|
176
232
|
console.log(`Hosts: ${result.hosts.join(', ')}`);
|
|
177
|
-
if (result.preserved.length)
|
|
233
|
+
if (result.preserved.length) {
|
|
234
|
+
console.log(`Preserved modified files: ${result.preserved.join(', ')}`);
|
|
235
|
+
console.log(`WARNING Mixed-version install: the files above were kept as they were and do not match ${version}. To take ${version}, delete each one and re-run init; copy any local edits you want to keep first.`);
|
|
236
|
+
}
|
|
178
237
|
const visibility = await checkerVisibility(root);
|
|
179
238
|
if (visibility.status === 'ignored') {
|
|
180
239
|
console.log('');
|
package/package.json
CHANGED
package/skills/workflow/EVALS.md
CHANGED
|
@@ -102,11 +102,31 @@ Input: Office launches two kit runs against the same repository, or cancels a wo
|
|
|
102
102
|
Expected: Office isolates/serializes writers across runs and stops workers before reset. Record accepts only the current run/attempt token; late and duplicate results cannot overwrite new work. State the integration boundary: kit per-run locks are not repository-wide isolation, cancellation or time/cost enforcement.
|
|
103
103
|
Failure: Claim the local graph alone guarantees safe independent Office workers or that rejecting a late result undoes its filesystem effects.
|
|
104
104
|
|
|
105
|
+
## Named change with diverging behaviors
|
|
106
|
+
Input: A PM asks to let customers pause a subscription. The change is named, but billing during the pause can follow three materially different rules, and one of them affects charges already issued. Superpowers `brainstorming`, which calls itself mandatory before creative work, and CE `ce-brainstorm` are both installed.
|
|
107
|
+
Expected: Intake explores in the kit: one question with two or three options, what each does, its trade-off and a recommended default. Load neither brainstorming skill for a named change. Keep the unsettled charge rule blocking and ask for its rollback trigger and what happens to charges already issued. The Story proposal and the user's G1 remain the only requirements source and approval.
|
|
108
|
+
Failure: Start Superpowers `brainstorming` and its plan-and-execute chain, call `ce-brainstorm` for a named change, ask about each option separately, or label the unsettled charge rule `ASSUMED` or a non-blocking note.
|
|
109
|
+
|
|
110
|
+
## Open idea before any concrete change
|
|
111
|
+
Input: One request states only a goal: renewals keep failing, figure out what to build. Another user says they do not know what to build. A third request names a concrete change. A fourth project has the same open goal without CE installed.
|
|
112
|
+
Expected: Decide from the request before loading a skill. For the open goal and the unsure user, announce in one line that `ce-brainstorm` will explore and that the user can switch to direct scoping, then pass the caller-owned exploration instruction; decisions, alternatives considered and open questions return to intake. The named change stays in intake. Without CE, intake explores directly and reports the fallback.
|
|
113
|
+
Failure: Let `ce-brainstorm` write or commit a separate spec, invoke a planning or implementation skill, or show its next-step menu, which can offer `lfg` with a PR and a push. Load it silently or for a named change, or install CE.
|
|
114
|
+
|
|
115
|
+
## Caller-owned planning
|
|
116
|
+
Input: The team lead receives a Story with G1 recorded. Superpowers `writing-plans` ends with an Execution Handoff offering subagent-driven or inline execution, and its plan header names an execution sub-skill. CE `ce-plan` is also installed.
|
|
117
|
+
Expected: Invoke `superpowers:writing-plans` with the caller-owned plan instruction from skill-integration.md. Return the plan path, self-review result and unresolved decisions as blockers. Skip the Execution Handoff and name this workflow's graph as the executor in the plan header. Reuse an existing plan; a small reversible task may use the kit's minimal plan. Use `ce-plan` only when the user or host selects CE planning.
|
|
118
|
+
Failure: Start `executing-plans` or `subagent-driven-development`, leave an execution sub-skill as the plan's executor, default to `ce-plan`, or treat the plan's self-review as G3.
|
|
119
|
+
|
|
105
120
|
## Focused implementation returns to its caller
|
|
106
121
|
Input: Developer receives only Task A of a project plan; CE and Superpowers are both installed. G1 already covers this work.
|
|
107
122
|
Expected: Read skill-integration.md and the applicable Superpowers focused skill. Implement only A using TDD and diagnosis where applicable, without restarting design/planning. Use ce-work return-to-caller only as an explicitly selected alternative. Return changes and verification; the kit still owns final simplify/review/G4. Do not re-plan settled requirements or execute Tasks B/C.
|
|
108
123
|
Failure: Invoke bare ce-work with the full project plan, enter shipping/babysitting, or start Superpowers design approvals and another implementer/reviewer hierarchy.
|
|
109
124
|
|
|
125
|
+
## Superpowers review inside the allocation
|
|
126
|
+
Input: A normal review round has an allocation of three workers. Superpowers `requesting-code-review` dispatches one reviewer per filled template; CE `ce-code-review` is also installed and would add persona, validator and report workers.
|
|
127
|
+
Expected: Fill one template per bounded assignment (correctness and security, tests and runtime evidence, maintainability and performance), give each only its diff, requirements and evidence, and count each as one worker. Main aggregates and returns fixes to the Developer. Use `ce-code-review mode:agent` only when the user or host selects it and its fan-out fits the allocation; otherwise review directly within the allocation.
|
|
128
|
+
Failure: Default to `ce-code-review`, launch it beyond the allocation and hope, call one whole-diff template three reviews, let a reviewer re-delegate, or apply fixes from a read-only review.
|
|
129
|
+
|
|
110
130
|
## Completed review still needs fixes
|
|
111
131
|
Input: ce-code-review mode:agent returns status complete, verdict Ready with fixes, and an unresolved material finding; actionable_findings is empty because the finding needs verification.
|
|
112
132
|
Expected: Read findings, coverage and testing gaps; do not pass the review node. Return the concrete issue to the Developer or unresolved decision to the host, then review/reverify the affected new revision.
|
|
@@ -4,7 +4,7 @@ Use only the matching lens. These are missing-behavior prompts, not architecture
|
|
|
4
4
|
|
|
5
5
|
## Payment / money
|
|
6
6
|
|
|
7
|
-
Check: charge timing; authorization vs capture; duplicate request/idempotency; timeout with unknown external result; cancellation/refund boundary; amount/currency ownership; reconciliation and operator recovery. Do not infer Redis, Kafka, Outbox, or locks.
|
|
7
|
+
Check: charge timing; authorization vs capture; duplicate request/idempotency; timeout with unknown external result; cancellation/refund boundary; amount/currency ownership; reconciliation and operator recovery; rollback trigger for a changed price or charge rule, and what happens to charges already issued. Do not infer Redis, Kafka, Outbox, or locks.
|
|
8
8
|
|
|
9
9
|
## Inventory / concurrency
|
|
10
10
|
|
|
@@ -6,12 +6,12 @@ If a host such as Agent Office delegates a started kit node, use its run/token a
|
|
|
6
6
|
|
|
7
7
|
## Stage integration
|
|
8
8
|
|
|
9
|
-
Read `skill-integration.md` before selecting skills. Prefer Superpowers focused implementation/verification skills and CE planning
|
|
9
|
+
Read `skill-integration.md` before selecting skills. Prefer Superpowers focused planning/implementation/review/verification skills and CE learning capture; CE planning, simplify and review modes are explicit alternatives. Keep one workflow owner. Existing approvals and the assigned role/task bound each invocation. Use the same evidence requirements with a disclosed direct fallback when a compatible skill is unavailable.
|
|
10
10
|
|
|
11
11
|
## Size first
|
|
12
12
|
|
|
13
13
|
- **Small/reversible:** one reviewable outcome, local effect. Record `Plan source: N/A — small and reversible`; use test-first implementation and review.
|
|
14
|
-
- **Normal:** use `
|
|
14
|
+
- **Normal:** use `superpowers:writing-plans` under the caller-owned contract → Superpowers focused TDD/diagnosis → inline simplification → bounded review with `superpowers:requesting-code-review` or direct review when compatible skills are available; simplify only after related tests pass. Apply the shared review allocation in `skill-integration.md` (default 3, adaptive 0–5). Otherwise perform equivalent repository-grounded stages directly.
|
|
15
15
|
- **High-risk/hard to reverse:** add G3. Present the key design decision, alternatives, invariant, rollback/recovery path, and evidence plan; end the turn for human approval before work. Save that decision to `docs/understanding/<slug>-plan.md` and record `Understanding gate (G3): <artifact> · <YYYY-MM-DD> · Check-in: accepted`.
|
|
16
16
|
|
|
17
17
|
High-risk signals: money/payment, authentication/authorization, concurrency, destructive migration, sensitive data, data loss, and irreversible external side effects.
|
|
@@ -37,7 +37,7 @@ For user-authorized optional Jira publication after G1, follow `jira.md`. Withou
|
|
|
37
37
|
Automatically initialize/resume the installed graph as described in `graph-engineering.md`. Use `-` for small work; otherwise supply the reviewed task DAG. The CLI adds final review and fresh verification. Complete any required G3 before implementation nodes run.
|
|
38
38
|
3. Use compatible `superpowers:test-driven-development` for implementation and `superpowers:systematic-debugging` for unexplained failures. For new behavior or a bug fix, demonstrate RED before production code, then GREEN after the minimum change. Proceed when related tests pass.
|
|
39
39
|
4. Refactor while green: main performs the simplification pass below. Use `ce-simplify-code` only when its actual dispatch fits the same round's allocation; otherwise apply the criteria directly.
|
|
40
|
-
5. Review the final diff against the Story, failure paths and testing limits. Allocate reviewers before dispatch using `skill-integration.md`; use compatible bounded `ce-code-review mode:agent` or
|
|
40
|
+
5. Review the final diff against the Story, failure paths and testing limits. Allocate reviewers before dispatch using `skill-integration.md`; use compatible `superpowers:requesting-code-review` or direct review, and bounded `ce-code-review mode:agent` only when the user or host selects it. Resolve material findings and state independence/coverage limits. Do not apply fixes from a read-only review assignment.
|
|
41
41
|
6. Apply compatible `superpowers:verification-before-completion`, using Graph `verify` on the current started token to execute the configured checks. Pstack recipe material defines the user journeys; SP governs fresh execution and evidence inspection. Read receipts and raw logs from that same execution; do not run a second verification pass solely to satisfy both names. Revalidate affected behavior after simplify/review edits before G4. If review edits affect previously simplified code, recheck only the affected scope; do not restart the whole pipeline automatically. Broaden tests when impact warrants it; never claim old results cover new edits.
|
|
42
42
|
7. Record the verified evidence in the graph, run its `status` command, and require `action: g4` before continuing to `understanding-gate.md`; passing tests alone are not completion.
|
|
43
43
|
|
|
@@ -55,7 +55,7 @@ For user-authorized optional Jira publication after G1, follow `jira.md`. Withou
|
|
|
55
55
|
|
|
56
56
|
Graph execution is installed and used automatically after G1. Small changes use the built-in minimal plan without a separate plan document; split larger work only where dependency tracking or independent verification helps. Keep the size-based route above: no planning ceremony for a small/reversible change.
|
|
57
57
|
|
|
58
|
-
Planning is repository-grounded planning → review → deterministic validation. Research code, tests and risks as needed; do not require separate analyzer, advocate or mediator agents. Reuse an existing
|
|
58
|
+
Planning is repository-grounded planning → review → deterministic validation. Research code, tests and risks as needed; do not require separate analyzer, advocate or mediator agents. Reuse an existing plan, whichever skill produced it. The host performs agent/tool work and the installed CLI owns readiness, evidence records and recovery; never create a second nested orchestration pipeline for the same task.
|
|
59
59
|
|
|
60
60
|
The execution graph does not replace human gates. G1 still approves scope before planning/implementation, G3 still protects high-risk choices, and G4 still requires prediction-before-reveal. Superpowers focused skills and CE stage skills provide node behavior as mapped in `skill-integration.md`; the graph owns dependency and retry structure rather than copying those skills.
|
|
61
61
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Intake and Contract
|
|
2
2
|
|
|
3
|
-
For a PM assignment, perform only intake and return the Story proposal or question to the host.
|
|
3
|
+
For a PM assignment, perform only intake and return the Story proposal or question to the host. Explore alternatives here; `skill-integration.md` says when an open idea calls for CE exploration. Do not start another design approval workflow over an already settled scope. G1 still requires the actual user's decision.
|
|
4
4
|
|
|
5
5
|
## Internal Domain Frame
|
|
6
6
|
|
|
@@ -14,6 +14,7 @@ Derive before asking: actor, desired outcome, terms/entities, state change, inva
|
|
|
14
14
|
- Apply the matching lenses in `domain-risks.md` before drafting. In a Payment/money or Data or system migration Story, a lens item that changes behavior and that neither the requirement nor a human settled is `OPEN BLOCKING`, never `ASSUMED`; reasonable people could pick either side.
|
|
15
15
|
- Never ask implementation or **HOW** questions before the contract is clear. Database, queue, lock, and file choices belong to planning.
|
|
16
16
|
- Offer a concrete default rather than an open questionnaire when a conventional safe choice exists.
|
|
17
|
+
- When the request names the change but materially different behaviors remain, show two or three options as one question: what each does, its trade-off and your recommended default.
|
|
17
18
|
|
|
18
19
|
## Explain the direction first
|
|
19
20
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"repository": "https://github.com/
|
|
3
|
-
"
|
|
2
|
+
"repository": "https://github.com/cursor/plugins",
|
|
3
|
+
"path": "pstack",
|
|
4
|
+
"commit": "180939f9e59cc9512e9330649175763e81fad16f",
|
|
4
5
|
"license": "MIT",
|
|
5
6
|
"files": [
|
|
6
7
|
{
|
|
@@ -11,7 +12,9 @@
|
|
|
11
12
|
{
|
|
12
13
|
"source": "skills/create-verification-skill/SKILL.md",
|
|
13
14
|
"file": "create-verification-skill.md",
|
|
14
|
-
"sha256": "bba612e8b81a02df0f49e6f6911f3b543c8c7d9f1f3c13ae6c0e2d58cc8c3ad3"
|
|
15
|
+
"sha256": "bba612e8b81a02df0f49e6f6911f3b543c8c7d9f1f3c13ae6c0e2d58cc8c3ad3",
|
|
16
|
+
"upstreamSha256": "d353973547bf8ad8977eca645f4cd4feaed0d32f4b43d1448f906b0a76c4d694",
|
|
17
|
+
"modified": "Three `.cursor/skills/verify-<app>/` paths read `<skills>/verify-<app>/`, with one sentence mapping `<skills>` to each harness's project skill folder, because the kit installs into Claude Code and Codex without upstream's docs/harness mapping. Wording taken from https://github.com/backnotprop/pstack at 0c3333f09655d7933919795fbf4f9946d62b6f77."
|
|
15
18
|
},
|
|
16
19
|
{
|
|
17
20
|
"source": "skills/create-verification-skill/references/feature-map-example/README.md",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Stage skills and role boundaries
|
|
2
2
|
|
|
3
|
-
The kit owns work-graph rules and human gates. Prefer compatible Superpowers focused skills for implementation discipline and verification, and Compound Engineering (CE) for planning, simplification
|
|
3
|
+
The kit owns work-graph rules and human gates. Prefer compatible Superpowers focused skills for planning, implementation discipline, review and verification, and Compound Engineering (CE) for verified learning. CE planning, simplification and review skills are explicit alternatives. The host runs agents and persists the authoritative state using the selected integration contract. Do not start a second end-to-end workflow inside a kit node.
|
|
4
4
|
|
|
5
5
|
## Select once for the assigned stage
|
|
6
6
|
|
|
@@ -18,15 +18,19 @@ These are skill invocation arguments, not Graph CLI flags. Invocation uses the h
|
|
|
18
18
|
|
|
19
19
|
| Assigned work | Preferred skill and call contract | Return to the kit/host |
|
|
20
20
|
|---|---|---|
|
|
21
|
-
| PM: clarify behavior and propose scope | `intake.md`;
|
|
22
|
-
| Team lead: plan approved work | `
|
|
21
|
+
| PM: clarify behavior and propose scope | `intake.md`; `ce-brainstorm` only under the open-idea rule below | Canonical Story proposal or a specific question; no implementation or self-issued G1 |
|
|
22
|
+
| Team lead: plan approved work | `superpowers:writing-plans` with the caller-owned instruction below and the approved Story | Plan path, requirement links, self-review result and unresolved blockers |
|
|
23
23
|
| Developer: implement the assigned approved task | `superpowers:test-driven-development`; `superpowers:systematic-debugging` for unexplained failures | Changed files, applicable RED/GREEN evidence, diagnosis and blockers; return to the assigned graph |
|
|
24
24
|
| Verification owner: verify the submitted revision | `superpowers:verification-before-completion` | Fresh relevant commands, results, revision and limits |
|
|
25
25
|
| Developer: simplify after related GREEN checks | Inline simplification criteria in `execution.md`; compatible `ce-simplify-code` only within the shared budget below | Behavior-preserving changes or a justified no-change result, then affected checks |
|
|
26
|
-
| Reviewer: assess the submitted change |
|
|
26
|
+
| Reviewer: assess the submitted change | `superpowers:requesting-code-review`, one filled reviewer template per assignment in the allocation below; otherwise direct bounded review | Findings and evidence, including scope, verdict and coverage limits |
|
|
27
27
|
| Delivery owner: capture proven learning | Namespaced CE `ce-compound mode:non-interactive <verified-context>` when supported | One useful learning or an explicit no-lesson outcome |
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Intake explores alternatives itself. Use `ce-brainstorm` only when the request names a goal or problem but no concrete change to make, when the user says they do not know what to build, or when the user selects it. Decide from the request before loading the skill. Announce the choice in one line; the user can switch to direct scoping or ask for broader exploration at any time. State: "Caller-owned exploration: return the decisions, alternatives considered and open questions to the kit intake. Do not write or commit a separate spec or requirements document, do not invoke a planning or implementation skill, and do not show a next-step handoff menu. The kit's Story and G1 are the only requirements source and approval."
|
|
30
|
+
|
|
31
|
+
For `writing-plans`, state: "Caller-owned plan: save the plan and return its path and self-review result to this workflow. Skip the Execution Handoff; the caller owns execution, human gates and the next action. In the plan header, name this workflow's graph as the executor instead of an execution sub-skill. Return unresolved decisions as blockers." Reuse an existing plan; a small reversible task can use the kit's minimal plan and direct implementation without creating a plan artifact.
|
|
32
|
+
|
|
33
|
+
If the user or host explicitly selects CE planning, use `ce-plan` and state: "Pipeline context: return the plan and review result to this workflow; the caller owns execution, human gates and the next action. Return unresolved decisions as blockers." Do not invent a `mode:pipeline` argument for a version that does not document it. If they explicitly select CE review, use `ce-code-review mode:agent base:<base-ref> plan:<plan-path>` only when its internal fan-out fits the round's allocation.
|
|
30
34
|
|
|
31
35
|
If the user or host explicitly selects CE implementation instead, use `ce-work mode:return-to-caller <plan-path>` as an alternative executor, not an additional implementation pass. Give it an executable plan bounded to the assigned unit. Do not pass the whole project plan to a Developer assigned only one task: its completion contract covers the supplied plan. A bounded HOW artifact may reference the canonical plan and Story IDs; do not copy requirements into it. If the work is small enough to do directly, use the direct path instead of manufacturing plan files.
|
|
32
36
|
|
|
@@ -53,7 +57,7 @@ Before dispatch, the caller chooses the round's allocation and records the reaso
|
|
|
53
57
|
- Normal round: combine correctness/security, tests/spec/runtime evidence, and maintainability/performance into three bounded assignments. Give each only the relevant diff, requirements and evidence references.
|
|
54
58
|
- Docs/mechanical changes: 0–1; a small behavioral change: 1–2. Add a specialist only for a named uncovered risk such as authorization or migration recovery; state why 4–5 is needed.
|
|
55
59
|
- Count **all** simplify/review/validation/report workers in the same round. Main performs simplification and aggregation by default. Reviewers return findings directly and do not re-delegate. New rounds need changed code or a named unresolved concern; unchanged work does not earn another full panel.
|
|
56
|
-
- Check the installed skill before invoking it. `mode:agent` selects output, not a worker cap. If its internal fan-out cannot fit the allocation, use the direct bounded review instead of launching it and hoping. Do not invent `max_reviewers` flags. Preserve any required independent-review coverage; report a gap if host limits prevent it.
|
|
60
|
+
- Check the installed skill before invoking it. `requesting-code-review` dispatches one reviewer per filled template, so each assignment counts as one worker. For a selected `ce-code-review`, `mode:agent` selects output, not a worker cap. If its internal fan-out cannot fit the allocation, use the direct bounded review instead of launching it and hoping. Do not invent `max_reviewers` flags. Preserve any required independent-review coverage; report a gap if host limits prevent it.
|
|
57
61
|
|
|
58
62
|
The host enforces actual dispatch counts. Graph's ready-node width is a separate DAG limit and does not cap nested skill workers. Model choice follows `model-selection.md`; extra personas on one model are not the multi-model evidence of Pstack `interrogate`. Do not automatically append interrogate to CE review.
|
|
59
63
|
|
|
@@ -61,9 +65,9 @@ The Reviewer reports fixes to the Developer; do not use `apply:local` on a read-
|
|
|
61
65
|
|
|
62
66
|
## Superpowers coexistence
|
|
63
67
|
|
|
64
|
-
Do not automatically invoke `brainstorming → writing-plans → executing-plans/subagent-driven-development → finishing-a-development-branch` inside this workflow. That adds another owner for design approval, task dispatch, review and delivery.
|
|
68
|
+
Do not automatically invoke the full `brainstorming → writing-plans → executing-plans/subagent-driven-development → finishing-a-development-branch` chain inside this workflow. That adds another owner for design approval, task dispatch, review and delivery. A focused `writing-plans` or `requesting-code-review` call under the contracts above is a stage skill, not that chain.
|
|
65
69
|
|
|
66
|
-
Use Superpowers' focused TDD, systematic-debugging and verification skills by default where available and applicable to the assigned stage. Read their actual instructions; a skill name in evidence is not proof of execution. No artificial RED test is needed for a prose-only change. Preserve existing approvals and plans, and respect higher-priority host instructions. Do not rerun a procedure already completed with sufficient evidence. Missing focused skills use the kit's direct procedure, with the fallback disclosed. This is a deliberate composition of focused skills, not a claim that the full Superpowers workflow ran. Capture reusable knowledge through CE after resolved review and fresh verification.
|
|
70
|
+
Use Superpowers' focused planning, TDD, systematic-debugging, review and verification skills by default where available and applicable to the assigned stage. Read their actual instructions; a skill name in evidence is not proof of execution. No artificial RED test is needed for a prose-only change. Preserve existing approvals and plans, and respect higher-priority host instructions. Do not rerun a procedure already completed with sufficient evidence. Missing focused skills use the kit's direct procedure, with the fallback disclosed. This is a deliberate composition of focused skills, not a claim that the full Superpowers workflow ran. Capture reusable knowledge through CE after resolved review and fresh verification.
|
|
67
71
|
|
|
68
72
|
This reference is host instruction policy, not an SDK bridge or a code-enforced Office adapter. The kit installs this policy, not CE or Superpowers. Confirm capabilities in each actual agent environment; neither plugin's presence in the current developer session proves it is available in Office workers.
|
|
69
73
|
|
package/src/graph/roles.mjs
CHANGED
|
@@ -8,14 +8,14 @@ const flows = {
|
|
|
8
8
|
],
|
|
9
9
|
'team-lead': [
|
|
10
10
|
['investigate', 'read', 'Inspect the repository, dependencies and related lessons.', 'Ground the plan in source and approved requirements.'],
|
|
11
|
-
['plan', 'write', 'Plan the assigned scope and propose ownership and dependencies.', 'Use caller-owned
|
|
11
|
+
['plan', 'write', 'Plan the assigned scope and propose ownership and dependencies.', 'Use the caller-owned planning contract in skill-integration; return the plan without dispatching another full workflow.'],
|
|
12
12
|
],
|
|
13
13
|
developer: [
|
|
14
14
|
['implement', 'write', 'Implement the assigned scope using focused TDD and diagnosis.', 'Record applicable RED/GREEN evidence; simplify while green.'],
|
|
15
15
|
['self-check', 'read', 'Verify the produced revision against assigned requirements.', 'Record fresh checks, producedRevision and limitations; independent review remains separate.'],
|
|
16
16
|
],
|
|
17
17
|
reviewer: [
|
|
18
|
-
['review', 'read', 'Review the assigned revision
|
|
18
|
+
['review', 'read', 'Review the assigned revision with the bounded review in skill-integration.', 'Return pass or needs_changes, reviewedRevision and evidence; do not edit product code.'],
|
|
19
19
|
],
|
|
20
20
|
};
|
|
21
21
|
|
package/src/install.mjs
CHANGED
|
@@ -13,6 +13,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
13
13
|
import { HOSTS, normalizeHosts, projectPath } from './paths.mjs';
|
|
14
14
|
import { managedBlockFor, removeManagedBlock, upsertManagedBlock } from './managed-block.mjs';
|
|
15
15
|
import { installTransaction } from './install-transaction.mjs';
|
|
16
|
+
import { readPackageVersion } from './version.mjs';
|
|
16
17
|
|
|
17
18
|
const modulePackageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
18
19
|
const CONFIG_PATH = '.ai-workflow/config.json';
|
|
@@ -50,9 +51,9 @@ async function fileHash(file) {
|
|
|
50
51
|
return sha256(await readFile(file));
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
54
|
+
// Relative path -> content hash, in the walk order treeHash has always used.
|
|
55
|
+
async function treeFiles(directory) {
|
|
56
|
+
const files = new Map();
|
|
56
57
|
|
|
57
58
|
async function walk(current, prefix = '') {
|
|
58
59
|
const children = await readdir(current, { withFileTypes: true });
|
|
@@ -61,11 +62,18 @@ async function treeHash(directory) {
|
|
|
61
62
|
const relative = path.posix.join(prefix, child.name);
|
|
62
63
|
const full = path.join(current, child.name);
|
|
63
64
|
if (child.isDirectory()) await walk(full, relative);
|
|
64
|
-
else
|
|
65
|
+
else files.set(relative, await fileHash(full));
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
await walk(directory);
|
|
70
|
+
return files;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Recorded in .ai-workflow/config.json: the entry format must stay byte-identical.
|
|
74
|
+
async function treeHash(directory) {
|
|
75
|
+
if (!await exists(directory)) return null;
|
|
76
|
+
const entries = [...await treeFiles(directory)].map(([relative, hash]) => `${relative}:${hash}`);
|
|
69
77
|
return sha256(entries.join('\n'));
|
|
70
78
|
}
|
|
71
79
|
|
|
@@ -77,14 +85,6 @@ async function writeIfChanged(file, content) {
|
|
|
77
85
|
return true;
|
|
78
86
|
}
|
|
79
87
|
|
|
80
|
-
async function packageVersion(packageRoot) {
|
|
81
|
-
try {
|
|
82
|
-
return JSON.parse(await readFile(path.join(packageRoot, 'package.json'), 'utf8')).version;
|
|
83
|
-
} catch {
|
|
84
|
-
return '3.0.0';
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
88
|
async function readConfig(root) {
|
|
89
89
|
try {
|
|
90
90
|
return JSON.parse(await readFile(projectPath(root, CONFIG_PATH), 'utf8'));
|
|
@@ -259,16 +259,24 @@ async function installPrepared({
|
|
|
259
259
|
if (checkerResult.changed) installed.push(CHECKER_PATH);
|
|
260
260
|
if (checkerResult.preserved) preserved.push(CHECKER_PATH);
|
|
261
261
|
|
|
262
|
+
const version = await readPackageVersion(packageRoot);
|
|
262
263
|
const config = `${JSON.stringify({
|
|
263
264
|
schemaVersion: 2,
|
|
264
|
-
packageVersion:
|
|
265
|
+
packageVersion: version,
|
|
265
266
|
hosts: selectedHosts,
|
|
266
267
|
managedFiles,
|
|
267
268
|
managedTrees,
|
|
268
269
|
}, null, 2)}\n`;
|
|
269
270
|
changed = await writeIfChanged(projectPath(root, CONFIG_PATH), config) || changed;
|
|
270
271
|
|
|
271
|
-
return {
|
|
272
|
+
return {
|
|
273
|
+
changed,
|
|
274
|
+
installed,
|
|
275
|
+
preserved,
|
|
276
|
+
hosts: selectedHosts,
|
|
277
|
+
previousVersion: previous?.packageVersion ?? null,
|
|
278
|
+
version,
|
|
279
|
+
};
|
|
272
280
|
}
|
|
273
281
|
|
|
274
282
|
export async function installWorkflow(options = {}) {
|
|
@@ -276,6 +284,37 @@ export async function installWorkflow(options = {}) {
|
|
|
276
284
|
return installTransaction(root, (stage) => installPrepared({ ...options, root: stage }));
|
|
277
285
|
}
|
|
278
286
|
|
|
287
|
+
// Managed paths whose bytes differ from this package's source: files an install
|
|
288
|
+
// preserved (local edits, formatter passes, older copies) next to newer ones.
|
|
289
|
+
// Trees list the differing files inside them; deleting the tree is the fix.
|
|
290
|
+
export async function managedDrift({ root = process.cwd(), packageRoot = modulePackageRoot, hosts = [] } = {}) {
|
|
291
|
+
root = path.resolve(root);
|
|
292
|
+
packageRoot = path.resolve(packageRoot);
|
|
293
|
+
const drift = [];
|
|
294
|
+
const trees = [
|
|
295
|
+
...normalizeHosts(hosts).map((host) => ['skills/workflow', HOSTS[host].skillDir]),
|
|
296
|
+
['src/graph', GRAPH_PATH],
|
|
297
|
+
];
|
|
298
|
+
for (const [sourceRelative, relative] of trees) {
|
|
299
|
+
const target = projectPath(root, relative);
|
|
300
|
+
if (!await exists(target)) continue;
|
|
301
|
+
const expected = await treeFiles(path.join(packageRoot, sourceRelative));
|
|
302
|
+
const actual = await treeFiles(target);
|
|
303
|
+
const files = [...new Set([...expected.keys(), ...actual.keys()])]
|
|
304
|
+
.filter((file) => expected.get(file) !== actual.get(file))
|
|
305
|
+
.sort();
|
|
306
|
+
if (files.length) drift.push({ relative, files });
|
|
307
|
+
}
|
|
308
|
+
for (const [sourceRelative, relative] of [...TEMPLATE_PATHS, ['assets/check.mjs', CHECKER_PATH]]) {
|
|
309
|
+
const target = projectPath(root, relative);
|
|
310
|
+
if (!await exists(target)) continue;
|
|
311
|
+
if (await fileHash(target) !== await fileHash(path.join(packageRoot, sourceRelative))) {
|
|
312
|
+
drift.push({ relative, files: [] });
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return drift;
|
|
316
|
+
}
|
|
317
|
+
|
|
279
318
|
async function removeEmptyParents(file, stopAt) {
|
|
280
319
|
let current = path.dirname(file);
|
|
281
320
|
while (current.startsWith(stopAt) && current !== stopAt) {
|
package/src/managed-block.mjs
CHANGED
|
@@ -10,7 +10,7 @@ export const MANAGED_BLOCK = `${START_MARKER}
|
|
|
10
10
|
- Keep Tasks at most 30 non-empty lines and reference Story M/V IDs; HOW belongs to the repository-grounded plan.
|
|
11
11
|
- After G1, automatically initialize/resume the installed graph with \`node .ai-workflow/bin/graph.mjs\`. Follow the workflow graph reference; record node evidence, route failures and require graph readiness before G4. No separate npm dependency or Graph opt-in is needed.
|
|
12
12
|
- Within an assigned kit graph node, apply only its role/task procedure and return evidence to that run. Office assigns roles and launches agents; the kit graph still controls readiness, joins and failure routing. Do not recursively start full delivery workflows.
|
|
13
|
-
- Use compatible Superpowers focused TDD, diagnosis and fresh-verification skills with CE
|
|
13
|
+
- Use compatible Superpowers focused caller-owned planning, TDD, diagnosis, bounded review and fresh-verification skills with CE verified learning capture; CE planning and review are explicit alternatives. Simplify inline by default; optional \`ce-simplify-code\` workers share the review allocation. Read skill-integration for exact modes, fallback and host limits. Do not nest end-to-end workflows or repeat approved plans. High-risk work retains G3.
|
|
14
14
|
- Do not merge non-trivial changes until the workflow's G4 question gate records that a human understands behavior, an invariant/failure path, and the evidence boundary.
|
|
15
15
|
- Configure the project verification profile using the workflow verification reference. Run required checks through Graph \`verify\`; inspect actual exit results/logs. Code changes make review/checks stale. Host model selection follows the workflow model policy; unknown actual model/cost stay unknown.
|
|
16
16
|
- \`node .ai-workflow/bin/check.mjs story <story-file>\` checks document shape/gate presence only. Report its exit code, and require \`node .ai-workflow/bin/graph.mjs delivery <run.json>\` after real G4 for bound execution/approval validation.
|
package/src/version.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
export async function readPackageVersion(packageRoot) {
|
|
5
|
+
try {
|
|
6
|
+
return JSON.parse(await readFile(path.join(packageRoot, 'package.json'), 'utf8')).version;
|
|
7
|
+
} catch {
|
|
8
|
+
return '3.0.0';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const SEMVER = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
13
|
+
|
|
14
|
+
// Negative when left < right, positive when left > right, 0 when equal, null when
|
|
15
|
+
// either side is not a version (a hand-edited or missing packageVersion).
|
|
16
|
+
export function compareVersions(left, right) {
|
|
17
|
+
const a = SEMVER.exec(String(left ?? ''));
|
|
18
|
+
const b = SEMVER.exec(String(right ?? ''));
|
|
19
|
+
if (!a || !b) return null;
|
|
20
|
+
for (let index = 1; index <= 3; index += 1) {
|
|
21
|
+
const difference = Number(a[index]) - Number(b[index]);
|
|
22
|
+
if (difference) return Math.sign(difference);
|
|
23
|
+
}
|
|
24
|
+
if (a[4] === b[4]) return 0;
|
|
25
|
+
if (!a[4]) return 1;
|
|
26
|
+
if (!b[4]) return -1;
|
|
27
|
+
return a[4] < b[4] ? -1 : 1;
|
|
28
|
+
}
|