pi-pstack-workflow-kit 0.0.0-stage → 0.1.1

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 (138) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +146 -2
  3. package/agents/ci-watcher.md +1 -0
  4. package/agents/comment-sicko.md +1 -0
  5. package/agents/poteto-agent.md +1 -0
  6. package/agents/quality-agent.md +1 -0
  7. package/agents/worker.md +3 -0
  8. package/lib/catalog-data.json +560 -0
  9. package/lib/catalog.ts +160 -0
  10. package/lib/jobs.ts +5 -0
  11. package/lib/models.ts +125 -0
  12. package/lib/pool.ts +27 -0
  13. package/lib/state.ts +127 -0
  14. package/lib/transcript.ts +48 -0
  15. package/lib/validation.ts +16 -0
  16. package/package.json +65 -4
  17. package/reference/GAPS.md +21 -0
  18. package/reference/PARITY.md +169 -0
  19. package/reference/benny/config.example.json +12 -0
  20. package/reference/benny/repro.md +3 -0
  21. package/reference/benny/setup.md +3 -0
  22. package/reference/benny/triage.md +3 -0
  23. package/reference/parity.json +3095 -0
  24. package/reference/rules/no-inline-imports.md +3 -0
  25. package/reference/rules/typescript-exhaustive-switch.md +3 -0
  26. package/reference/source-map.json +8594 -0
  27. package/scripts/job-input.ts +190 -0
  28. package/scripts/run-job.mjs +121 -0
  29. package/skills/architect/SKILL.md +16 -0
  30. package/skills/arena/SKILL.md +16 -0
  31. package/skills/automate-me/SKILL.md +10 -0
  32. package/skills/benchmark-checklist/SKILL.md +10 -0
  33. package/skills/blast-radius/SKILL.md +10 -0
  34. package/skills/bro/SKILL.md +10 -0
  35. package/skills/check-compiler-errors/SKILL.md +10 -0
  36. package/skills/control-cli/SKILL.md +10 -0
  37. package/skills/control-ui/SKILL.md +10 -0
  38. package/skills/correct/SKILL.md +10 -0
  39. package/skills/create-formal-verification-skill/SKILL.md +16 -0
  40. package/skills/create-verification-skill/SKILL.md +16 -0
  41. package/skills/deslop/SKILL.md +10 -0
  42. package/skills/figure-it-out/SKILL.md +17 -0
  43. package/skills/fix-ci/SKILL.md +10 -0
  44. package/skills/fix-merge-conflicts/SKILL.md +10 -0
  45. package/skills/get-pr-comments/SKILL.md +10 -0
  46. package/skills/how/SKILL.md +10 -0
  47. package/skills/in-your-own-words/SKILL.md +11 -0
  48. package/skills/interrogate/SKILL.md +17 -0
  49. package/skills/ketchup/SKILL.md +10 -0
  50. package/skills/ketchup-video/SKILL.md +10 -0
  51. package/skills/loop-on-ci/SKILL.md +10 -0
  52. package/skills/maintain-formal-verification-skill/SKILL.md +16 -0
  53. package/skills/maintain-verification-skill/SKILL.md +16 -0
  54. package/skills/make-bot-ui/SKILL.md +10 -0
  55. package/skills/make-pr-easy-to-review/SKILL.md +10 -0
  56. package/skills/new-branch-and-pr/SKILL.md +10 -0
  57. package/skills/no-comments/SKILL.md +16 -0
  58. package/skills/poteto-help/SKILL.md +11 -0
  59. package/skills/poteto-mode/SKILL.md +60 -0
  60. package/skills/poteto-mode/playbooks/authoring-a-skill.md +20 -0
  61. package/skills/poteto-mode/playbooks/autonomous-run.md +20 -0
  62. package/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
  63. package/skills/poteto-mode/playbooks/autopilot-stack.md +20 -0
  64. package/skills/poteto-mode/playbooks/babysit.md +21 -0
  65. package/skills/poteto-mode/playbooks/bug-fix.md +26 -0
  66. package/skills/poteto-mode/playbooks/eval.md +20 -0
  67. package/skills/poteto-mode/playbooks/feature.md +26 -0
  68. package/skills/poteto-mode/playbooks/hillclimb.md +24 -0
  69. package/skills/poteto-mode/playbooks/investigation.md +19 -0
  70. package/skills/poteto-mode/playbooks/multi-phase-plan.md +19 -0
  71. package/skills/poteto-mode/playbooks/opening-a-pr.md +20 -0
  72. package/skills/poteto-mode/playbooks/pause-safely.md +18 -0
  73. package/skills/poteto-mode/playbooks/perf-issue.md +24 -0
  74. package/skills/poteto-mode/playbooks/prototype.md +21 -0
  75. package/skills/poteto-mode/playbooks/refactoring.md +23 -0
  76. package/skills/poteto-mode/playbooks/runtime-forensics.md +20 -0
  77. package/skills/poteto-mode/playbooks/session-pickup.md +20 -0
  78. package/skills/poteto-mode/playbooks/shipping.md +24 -0
  79. package/skills/poteto-mode/playbooks/trace-forensics.md +20 -0
  80. package/skills/poteto-mode/playbooks/visual-parity.md +22 -0
  81. package/skills/poteto-mode/playbooks/worktree-cleanup.md +19 -0
  82. package/skills/pr-review-canvas/SKILL.md +10 -0
  83. package/skills/principle-attack-the-premise/SKILL.md +12 -0
  84. package/skills/principle-boundary-discipline/SKILL.md +12 -0
  85. package/skills/principle-build-the-lever/SKILL.md +12 -0
  86. package/skills/principle-encode-lessons-in-structure/SKILL.md +12 -0
  87. package/skills/principle-exhaust-the-design-space/SKILL.md +12 -0
  88. package/skills/principle-experience-first/SKILL.md +12 -0
  89. package/skills/principle-explain-the-number/SKILL.md +12 -0
  90. package/skills/principle-fix-root-causes/SKILL.md +12 -0
  91. package/skills/principle-foundational-thinking/SKILL.md +12 -0
  92. package/skills/principle-guard-the-context-window/SKILL.md +12 -0
  93. package/skills/principle-laziness-protocol/SKILL.md +12 -0
  94. package/skills/principle-make-operations-idempotent/SKILL.md +12 -0
  95. package/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +12 -0
  96. package/skills/principle-minimize-reader-load/SKILL.md +12 -0
  97. package/skills/principle-model-the-domain/SKILL.md +12 -0
  98. package/skills/principle-never-block-on-the-human/SKILL.md +12 -0
  99. package/skills/principle-outcome-oriented-execution/SKILL.md +12 -0
  100. package/skills/principle-prove-it-works/SKILL.md +12 -0
  101. package/skills/principle-redesign-from-first-principles/SKILL.md +12 -0
  102. package/skills/principle-separate-before-serializing-shared-state/SKILL.md +12 -0
  103. package/skills/principle-sequence-verifiable-units/SKILL.md +12 -0
  104. package/skills/principle-subtract-before-you-add/SKILL.md +12 -0
  105. package/skills/principle-test-behavior-not-implementation/SKILL.md +12 -0
  106. package/skills/principle-type-system-discipline/SKILL.md +12 -0
  107. package/skills/recall/SKILL.md +10 -0
  108. package/skills/reflect/SKILL.md +10 -0
  109. package/skills/review-and-ship/SKILL.md +10 -0
  110. package/skills/run-smoke-tests/SKILL.md +10 -0
  111. package/skills/setup-pstack/SKILL.md +17 -0
  112. package/skills/sharpen/SKILL.md +11 -0
  113. package/skills/show-me-your-work/SKILL.md +16 -0
  114. package/skills/statechart/SKILL.md +10 -0
  115. package/skills/swarm/SKILL.md +16 -0
  116. package/skills/tdd/SKILL.md +10 -0
  117. package/skills/teach/SKILL.md +17 -0
  118. package/skills/technical-writing/SKILL.md +10 -0
  119. package/skills/thermo-nuclear-code-quality-review/SKILL.md +10 -0
  120. package/skills/typescript-best-practices/SKILL.md +10 -0
  121. package/skills/unslop/SKILL.md +10 -0
  122. package/skills/verify-this/SKILL.md +17 -0
  123. package/skills/weekly-review/SKILL.md +10 -0
  124. package/skills/what-did-i-get-done/SKILL.md +10 -0
  125. package/skills/why/SKILL.md +10 -0
  126. package/skills/workflow-from-chats/SKILL.md +10 -0
  127. package/src/catalog-ui.ts +86 -0
  128. package/src/delegate.ts +367 -0
  129. package/src/forge.ts +246 -0
  130. package/src/git.ts +28 -0
  131. package/src/index.ts +25 -0
  132. package/src/models.ts +189 -0
  133. package/src/parent-diff.ts +64 -0
  134. package/src/plan.ts +181 -0
  135. package/src/records.ts +85 -0
  136. package/src/session.ts +124 -0
  137. package/src/support.ts +47 -0
  138. package/src/worktrees.ts +188 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Josh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,147 @@
1
- # Temporary Holding Version
1
+ # Pi pstack workflow kit
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An installable Pi package that reimplements the workflows described by the supplied pstack 0.15.46, Team Kit 1.2.0 and Cursor CLI skill map. It uses the current `@earendil-works/pi-coding-agent` extension API, Pi Agent Skills, native Pi child processes, native session entries and native terminal UI. It does not require a Cursor installation, a Cursor account, another coding agent, or an npm runtime dependency beyond the Pi host. It does not ship Cursor's proprietary cloud services.
4
+
5
+ **Status: source-map-complete implementation candidate, not certified behavioral parity.** All 161 node IDs, 163 dependency edges, and 65 views are retained and mapped. The skills and playbooks are independently written from the JSON descriptions, with selected official upstream source cross-checks. They are not a complete copy of the upstream pinned repository's leaf files, scripts, templates, or full playbook contracts. Some nodes are model-mediated skills or require a project's own tools. The managed service gaps and test limits are explicit in `reference/PARITY.md` and `reference/GAPS.md`.
6
+
7
+ ## Install
8
+
9
+ Requires Pi and Node.js 22.19 or newer. Verification below uses Pi 1.6.0, Bun, and Python 3.9 or newer for the generator checks. Pi's own minimum runtime version takes precedence. Git is required for worktree features and the integration tests. GitHub CLI (`gh`) and authentication are required for GitHub operations. Browser, terminal, formal proof, video, Slack and tracker workflows depend on the relevant configured project tools.
10
+
11
+ Install current Pi if needed, following the official [Quickstart](https://docs.pi.dev/latest/quickstart) or [pi.dev](https://pi.dev/):
12
+
13
+ ```sh
14
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent
15
+ ```
16
+
17
+ Install the npm package in Pi:
18
+
19
+ ```sh
20
+ pi install npm:pi-pstack-workflow-kit
21
+ pi list
22
+ ```
23
+
24
+ Use `pi -e npm:pi-pstack-workflow-kit` to try it for one session. Add `--local` to `pi install` to register it in the current project instead. For a source checkout, run `pi install "$PWD"` from the package directory. Project resources require Pi project trust. Review the extension before granting trust, then use `/reload` or restart Pi.
25
+
26
+ ## Use
27
+
28
+ ```text
29
+ /setup-pstack
30
+ /setup-pstack show
31
+ /poteto-mode on
32
+ /pstack-run bug-fix Reproduce the failing login, fix it, and prove the original flow passes
33
+ /pstack-status
34
+ /pstack-map
35
+ /pstack-map all-dependencies
36
+ /pstack-map cli-cloud
37
+ /pstack-goal All required checks pass on the verified patch
38
+ /pstack-loop 60 10 Check current-head CI and stop when green or blocked
39
+ /pstack-loop stop
40
+ /pstack-pause
41
+ /pstack-clear
42
+ /poteto-mode off
43
+ ```
44
+
45
+ `/poteto-mode <goal>` attaches the workflow to one request. `/poteto-mode on` persists the router for the selected session branch. The receiving session selects and owns the playbook. `/pstack-run <route> <goal>` selects an explicit playbook. The native task tool initializes ordered steps, records evidence and requires each step to be completed or explicitly skipped before finishing. The router chooses `figure-it-out` for broad/unmatched work. Use `/skill:principle-...` to read a specific principle; the principles are conditional rather than a fixed sequence.
46
+
47
+ The package registers 52 original slash-skill names (34 ordinary pstack and 18 Team Kit) and nine model-callable tools. All 76 skills, including 24 principle leaves, use the standard `/skill:<name>` interface. Playbooks remain supporting files, not 22 extra ordinary skills. Use Pi's standard `/model`, `/resume`, `/tree`, `/compact`, `/mcp`, `/reload`, `pi install`, and headless JSON/RPC interfaces for host capabilities.
48
+
49
+ | Tool | Behavior |
50
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
51
+ | `pstack_catalog` | Search, inspect nodes, read instructions, list route triggers and browse dependency views. |
52
+ | `pstack_plan` | Start, update, inspect or finish a branch-local task list with evidence. |
53
+ | `pstack_delegate` | Single, swarm, arena or interrogate workers using independent native Pi CLI processes. |
54
+ | `pstack_log` | Append a timestamped decision record to a TSV. |
55
+ | `pstack_history` | Read bounded entries on the active native session branch. |
56
+ | `pstack_wake` | Inspect or stop a bounded operator-started loop. |
57
+ | `pstack_worktree` | Create isolated Git worktrees, inspect dirty/merged state, approve safe removal. |
58
+ | `pstack_pr` | Read fresh GitHub PR state, head and checks. |
59
+ | `pstack_ship` | Require a shipping or autopilot-full plan and operator confirmation; recheck and merge the verified contiguous prefix. |
60
+
61
+ ## Configuration and workers
62
+
63
+ `/setup-pstack` uses Pi's model registry and native selection dialogs. Nine role selections and the reasoning budget are saved atomically at `$PI_CODING_AGENT_DIR/pstack-models.json`, default `~/.pi/agent/pstack-models.json`. The file uses a `defaults: 3` marker. The parent model remains unchanged. Cursor-specific model slugs do not map reliably to Pi provider IDs, so unconfigured roles inherit the parent; explicitly choose available `provider/id` models. The picker lists the models in the current scope that workers can load. It includes a model of a provider registered by an extension when pstack finds that extension: pstack runs `pi --list-models` once per loaded extension that registers a slash command and uses the one that lists the model. Such a model stays excluded when its extension registers no slash command, or when Pi lists the provider without the extension, as it does for one that replaces a built-in provider. Both `auto` and `inherit-parent` resolve to the current parent model; setup warns if workers cannot use it. Delegation checks availability only for the workers and judge selected for that run. For arena and interrogate configure at least two panel seats. Arena uses the first available judge in the configured pool whose vendor differs from the parent and every candidate. Pi itself may clamp reasoning to model support. The `large`, `medium`, `small` budgets lower the role's reasoning target; the Gemini panel seat uses its higher target where selected.
64
+
65
+ Each delegate starts a fresh Pi CLI process via `pi.exec`. `PSTACK_PI_BIN` can select the Pi binary. Concurrency is bounded to eight workers, with default three concurrent workers. Each job retains its report and native JSONL session. Only bounded output excerpts return to the parent. Read-only reviewers receive only Pi's read/grep/find/ls tools; no shell, write, edit, MCP or discovered extensions. Write delegates require explicit confirmation in the terminal UI or via Pi RPC and get separate detached Git worktrees at the selected committed ref (default HEAD). Uncommitted parent files are not copied automatically; the parent saves a repository-root-relative patch of up to 2 MiB. If tracked changes alone exceed the limit, no patch is attached. Otherwise, untracked, non-ignored files are added as whole patches while space remains, and workers are told which files were omitted. The parent inspects, reconciles and verifies worker output. Workers never automatically merge, cherry-pick, or delete worktrees. Worktrees are isolation of checkout state, not an OS security sandbox. Child processes inherit the OS environment. A worker whose model comes from a provider registered by an extension also loads that extension. Its code runs in the worker with the trust it has in the parent session; the tool allowlist still limits what the model can call. Delegation refuses a model whose extension it cannot find before starting any worker. Use a real external sandbox for untrusted code or secrets.
66
+
67
+ Arena stores candidate sessions, removes model metadata and known model names from message projections, asks the independent judge to read the actual projected transcripts, and audits read tool calls. This is partial blinding: transcript text, tool paths or outputs can still identify an author; a read call alone cannot prove the judge read every line. It does not claim a fully controlled evaluation environment. If judging fails, the tool returns an inconclusive judgment alongside the completed candidate reports and their artifact directory.
68
+
69
+ ## Session state and delivery
70
+
71
+ Task and mode state use Pi's branch-local custom entries. Timers stop on session shutdown, branch change, abort, completion, or iteration limit. Restored sessions recover state with wake loops paused. If the latest saved pstack state is invalid or unsupported, the extension starts with empty state rather than reviving an older plan. Wakes only run while a terminal Pi session is open. `/pstack-pause` saves a resume note without implicitly committing, deleting or changing a branch. Artifacts live under `$PI_CODING_AGENT_DIR/pstack/sessions/<session-id>/`.
72
+
73
+ The shipping gate uses GitHub CLI and requires an active shipping or autopilot-full plan. Finishing the plan closes the gate. It requires independent evidence tied to each exact head, shows the exact PR URLs and heads for explicit approval in the terminal UI or via Pi RPC, and checks readiness immediately before each `gh pr merge --match-head-commit`. If an initial PR lookup fails, the gate can still offer the verified prefix before it and reports the failed lookup as `lookupFailure`. A merge counts as confirmed only when GitHub reports `MERGED` at the approved head. If a merge was attempted but its result could not be confirmed, the tool reports its PR number separately as `unconfirmed`, not `unmerged`. Inspect the forge state before retrying. The operator must verify that order and the provenance of the evidence; the extension cannot prove the stack topology or that a model's evidence string is truthful. The gate applies to its own tool, not arbitrary user-installed tools or the parent's general shell. It does not merge in autopilot-stack or in print or JSON mode. The model cannot select the `shipping` or `autopilot-full` route through `pstack_plan` without a confirmation; `/pstack-run` selects it directly. Worktree removal and write delegation also require a confirmation-capable UI. Removal deletes ignored files in the worktree. The confirmation counts individual ignored paths, including files inside ignored directories, and shows the first ten. Removal stops if the path list changes after approval. Origin-specific operations are instructions only; no Origin service is bundled.
74
+
75
+ ## Benny and automation
76
+
77
+ `/pstack-automation benny-triage`, `/pstack-automation benny-repro`, or `/pstack-automation custom` creates an initially disabled draft in the session artifact directory. It refuses to overwrite a previous draft. Copy the Benny configuration template to a trusted target project outside the package. Configure project-specific Slack/tracker/control MCP tools, and use an explicit allowlist in the draft. Review the tool semantics. Benny requires narrowly scoped tools and prohibits the generic shell, codemode, dynamic tool search and MCP tool names whose words (snake_case, kebab-case or camelCase) indicate merge, squash, rebase, push, commit, deploy, publish, delete, exec, shell, script or command operations, or create/update/write of files, branches or refs. Native `edit` and `write` are accepted only for `benny-repro`; `benny-triage` is read-only. Pull request creation tools are accepted only for `benny-repro` with `allowDraftPr: true`. This is not a security sandbox; configured MCP permissions must enforce those restrictions too.
78
+
79
+ `node scripts/run-job.mjs --run /absolute/path/job.json [signed-event.json]` is a local headless Pi entrypoint. It is not a daemon, managed cloud worker, Slack subscription, or scheduler. The job and Benny config must be separately enabled by the operator. The external trusted event adapter must provide an envelope `{ "payload": "<JSON string>", "signature": "<HMAC-SHA256 hex>" }`, signed with `PSTACK_EVENT_SECRET`. A report payload includes `type: "report"`, `topLevel: true`, `channel`, `thread`, and `eventId`. A reproduction payload includes `type: "triage-marker"`, `trusted: true`, `classification: "bug"` or `"performance"`, `ticket`, and the same immutable thread identity fields. The adapter, not arbitrary Slack text, establishes trust. A claimed run directory is unique per workflow/thread; repeated dispatches fail closed. If Pi cannot start, the runner prints the claim location and writes a sanitized `not-started` receipt to `result.json`. An absent receipt is not proof that Pi never started. Investigate ambiguous failures before rearming any event. The runner removes the event signing secret from the child environment and sends the prompt through stdin rather than as process arguments. Pi can load skills and prompt templates from the trusted project; the job's explicit tool allowlist still applies. It preserves private run logs and uses Pi's native MCP integration for explicitly named external tools. Benny's application-specific adapter, event receiver, tracker actions and real end-to-end proof are not implemented by this generic package. See `reference/benny/`.
80
+
81
+ ## Verify
82
+
83
+ Run the development checks from a source checkout:
84
+
85
+ ```sh
86
+ bun install --frozen-lockfile
87
+ bun run check
88
+ python3 scripts/generate.py --check
89
+ node scripts/smoke.ts
90
+ ```
91
+
92
+ `bun run check` runs the `bun fmt` format check, type-aware oxlint, the TypeScript compiler against the installed Pi SDK, and the tests with the coverage gate. `bun run format` and `bun run lint:fix` apply the fixes. The formatter skips the three configuration files listed in `.prettierignore`, which are kept exactly as written. `python3 scripts/generate.py --check` reports generated files that no longer match their sources.
93
+
94
+ The tests are TypeScript on Vitest and run without a build step. `bun run test` runs them once and `bun run test:watch` reruns them as files change. They use a mock Pi host and forge, a fake child CLI for job dispatch, and temporary real Git repositories. `bun run test:coverage` also applies the gate in `vitest.config.ts`: each file in `src/` needs 80% statement, branch, function and line coverage.
95
+
96
+ `node scripts/smoke.ts` launches real Pi in an isolated RPC session without model requests. It checks discovery of all 76 native skills and 52 original slash names, writes and reads mode state, and checks that `/setup-pstack` lists the model of a provider registered by a fixture extension. Set `PSTACK_PI_BIN` to point to a different Pi executable. This smoke does not exercise live models, GitHub, Slack, or MCP services. Test those integrations with disposable resources before relying on them.
97
+
98
+ ## Continuous integration and releases
99
+
100
+ Three workflows in `.github/workflows` run on GitHub-hosted runners:
101
+
102
+ - `ci.yml` runs on every pull request. The `Lint` job runs the format check, oxlint, the TypeScript compiler and the generator check. The `Test` jobs run the tests with the coverage gate and the smoke test on Node 22.19.0, 24 and 26. The smoke test uses the Pi that `bun install` puts in `node_modules`.
103
+ - `release.yml` runs on every push to `main`. It runs the same checks, then compares `version` in `package.json` with npm. If npm does not have that version, the workflow publishes the package with provenance, then creates the tag `v<version>` and its GitHub release, with generated notes, at the published commit. Runs of this workflow do not overlap: up to 100 wait in a queue.
104
+ - `verify-lockfile.yml` runs on pull requests and on pushes to `main`. It fails when `.github/workflows/actions.lock` no longer matches the workflows or the commits it pins.
105
+
106
+ To release, change `version` in `package.json` in a pull request and merge it. Do not create the tag or the release by hand. The workflow never touches an existing tag, and it stops before publishing when the tag exists and npm does not have the version. npm refuses a prerelease version such as `1.0.0-beta.1` without a dist-tag, so the workflow cannot publish one.
107
+
108
+ If a run fails after npm accepted the version, use **Re-run all jobs**. While `package.json` still names that version, a run finds it on npm, skips publishing and creates the missing tag and release at the commit npm recorded for it. It creates neither when the tag already exists, or when npm recorded no commit, which is the case for a version published outside a Git checkout.
109
+
110
+ Publishing needs an npm [trusted publisher](https://docs.npmjs.com/trusted-publishers) for this repository, with the workflow `release.yml`, the environment `npm`, and `npm publish` allowed. No secret is involved. The workflow also accepts an npm access token in a [secret](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets) named `NPM_TOKEN`, which is the method in GitHub's documentation, but npm removes direct publishing with a token in January 2027.
111
+
112
+ The first release run creates the `npm` [environment](https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/manage-environments) without rules. Add a deployment branch rule for `main` so that no other branch can publish.
113
+
114
+ `actions.lock` pins every action the workflows use to a commit. After you add or change a `uses:` line, run `gh actions-lock` and commit the result. The command comes from the [`gh-actions-lock`](https://github.com/github/gh-actions-lock) extension of the GitHub CLI. Dependabot proposes new releases of the actions each week and updates the lockfile in the same pull request.
115
+
116
+ CI installs Bun 1.4.5, the release the files were formatted with. Change `BUN_VERSION` in `ci.yml` when you format with a newer Bun.
117
+
118
+ ## Files
119
+
120
+ - `src/`: the extension, one file per feature: `session.ts` (branch state and wake timer), `plan.ts`, `catalog-ui.ts`, `records.ts`, `models.ts`, `delegate.ts`, `parent-diff.ts`, `worktrees.ts`, `forge.ts`, with `git.ts` and `support.ts` shared.
121
+ - `lib/`: type-checked TypeScript with no Pi dependency: `catalog.ts`, `models.ts`, `state.ts`, `pool.ts`, `transcript.ts`, `jobs.ts`, `validation.ts`.
122
+ - `scripts/catalog-source.json`: the instructions written for Pi: playbook steps, principle rules, skill bodies and implementation classifications. Edit this, not the generated files.
123
+ - `scripts/generate.py`: `python3 scripts/generate.py` rebuilds `skills/`, `lib/catalog-data.json`, `reference/parity.json` and `reference/PARITY.md` from the source map and `catalog-source.json`, and formats them with `bun fmt`. Regeneration removes obsolete generator-marked skill and playbook files, not hand-authored files. With `--check` it reports drift without writing.
124
+ - `skills/`: 76 native skill directories and 22 nested ordered playbooks (generated).
125
+ - `agents/`: worker and reviewer contracts.
126
+ - `reference/source-map.json`: original attachment, unchanged byte-for-byte.
127
+ - `reference/parity.json` (generated): machine-readable original IDs, edges and views with implementation classifications.
128
+ - `reference/PARITY.md`, `reference/GAPS.md`: audit matrix and residual gaps.
129
+ - `reference/benny/`: dormant configuration and workflow instructions.
130
+ - `scripts/run-job.mjs`, `scripts/job-input.ts`, `scripts/smoke.ts`, `scripts/smoke-provider.ts`, `tests/`: runner, job validation and verification.
131
+ - `.github/`: the CI, release and lockfile workflows, the action lockfile and the Dependabot configuration.
132
+
133
+ ## Official references
134
+
135
+ The extension targets the `@earendil-works` Pi SDK, not the older `@mariozechner` namespace.
136
+
137
+ - [Extensions](https://docs.pi.dev/latest/extensions)
138
+ - [Packages](https://docs.pi.dev/latest/packages)
139
+ - [Skills](https://docs.pi.dev/latest/skills)
140
+ - [Command line](https://docs.pi.dev/latest/cli)
141
+ - [RPC commands](https://docs.pi.dev/latest/rpc-commands)
142
+ - [Configuration](https://docs.pi.dev/latest/configuration)
143
+ - [Environment variables](https://docs.pi.dev/latest/environment-variables)
144
+ - [Pinned original router](https://github.com/cursor/plugins/blob/7a583913eb1b8d1a0ee76753d1a2cf072e7b54f9/pstack/skills/poteto-mode/SKILL.md)
145
+ - [Pinned original setup](https://github.com/cursor/plugins/blob/7a583913eb1b8d1a0ee76753d1a2cf072e7b54f9/pstack/skills/setup-pstack/SKILL.md)
146
+
147
+ Every upstream source URL from the map remains in `reference/source-map.json` and `reference/parity.json`. No claim is made that the independently authored instructions reproduce every detail in those upstream files.
@@ -0,0 +1 @@
1
+ Read-only CI review. Report the PR head, check names, statuses, and log pointers supplied by the parent. Identify stale results and blockers. Do not modify or merge.
@@ -0,0 +1 @@
1
+ Read-only comment review. Inspect the actual diff. Identify redundant, misleading or implementation-narrating comments with exact paths/lines and a proposed deletion or structural replacement. Keep necessary constraints and public API documentation. Do not modify files.
@@ -0,0 +1 @@
1
+ Read worker.md and the full poteto-mode skill. Implement only the parent’s scoped task; the parent owns routing. Name the data shape first, select applicable principles and run the actual acceptance check. Return a diff or artifact location and evidence.
@@ -0,0 +1 @@
1
+ Read-only independent maintainability review. Locate concrete coupling, complexity, type holes, unnecessary indirection and excessive mutable state. Supply a reproducible finding with a file pointer and minimal remedy. Do not modify files.
@@ -0,0 +1,3 @@
1
+ # Pi worker contract
2
+
3
+ Read this file first. Read the poteto-mode skill before any direct implementation work. The parent owns the playbook, verification, and delivery. Start with the goal and scope, respect all supplied approval boundaries, and work only on your assigned output. Do not merge, deploy, force-push, post external messages, or delete unrelated work. Do not open PRs unless the parent explicitly requests it and grants the necessary scope. Return actual commands, exit results, artifact paths, unresolved risks, and a concise summary. Preserve your worktree and session for inspection. Do not claim a test you did not run.