@justjoshn/pi-pstack 0.15.36-pi.1 → 0.15.36-pi.12
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/CHANGELOG.md +94 -0
- package/README.md +29 -24
- package/agents/ci-watcher.md +28 -0
- package/agents/thermo-nuclear-code-quality-review.md +23 -0
- package/assets/logo.png +0 -0
- package/automations/benny/FOR_AGENTS.md +2 -1
- package/automations/benny/README.md +2 -2
- package/automations/benny/skills/setup-benny/SKILL.md +10 -9
- package/automations/benny/templates/reproduce-automation-prompt.md +1 -1
- package/automations/benny/templates/triage-automation-prompt.md +1 -1
- package/bin/pstack-routines-supervisor +9 -0
- package/docs/guide/01-setup.md +2 -2
- package/docs/guide/07-overnight.md +1 -1
- package/docs/guide/09-make-it-yours.md +1 -1
- package/docs/guide/10-recipes-and-pitfalls.md +1 -1
- package/docs/native-gaps.md +14 -8
- package/docs/parity-reverse-engineering.md +94 -0
- package/docs/parity-status.md +128 -0
- package/package.json +41 -6
- package/packaging/install-supervisor-unit.sh +164 -0
- package/packaging/launchd/com.pstack.routines-supervisor.plist.example +24 -0
- package/packaging/systemd/pstack-routines-supervisor.service.example +15 -0
- package/skills/architect/SKILL.md +1 -1
- package/skills/architect/references/runner-prompt.md +1 -1
- package/skills/arena/SKILL.md +4 -4
- package/skills/check-compiler-errors/SKILL.md +23 -0
- package/skills/create-skill/SKILL.md +515 -29
- package/skills/fix-ci/SKILL.md +29 -0
- package/skills/fix-merge-conflicts/SKILL.md +32 -0
- package/skills/get-pr-comments/SKILL.md +23 -0
- package/skills/how/SKILL.md +1 -1
- package/skills/ketchup/SKILL.md +2 -2
- package/skills/ketchup-video/SKILL.md +2 -2
- package/skills/loop-on-ci/SKILL.md +50 -0
- package/skills/make-bot-ui/SKILL.md +2 -2
- package/skills/make-pr-easy-to-review/SKILL.md +59 -0
- package/skills/new-branch-and-pr/SKILL.md +29 -0
- package/skills/no-inline-imports/SKILL.md +12 -0
- package/skills/poteto-help/SKILL.md +4 -4
- package/skills/poteto-mode/SKILL.md +2 -2
- package/skills/poteto-mode/playbooks/bug-fix.md +1 -1
- package/skills/poteto-mode/playbooks/feature.md +1 -1
- package/skills/poteto-mode/playbooks/hillclimb.md +1 -1
- package/skills/poteto-mode/playbooks/multi-phase-plan.md +2 -2
- package/skills/poteto-mode/playbooks/orchestrate.md +2 -2
- package/skills/poteto-mode/playbooks/perf-issue.md +1 -1
- package/skills/poteto-mode/playbooks/refactoring.md +1 -1
- package/skills/pr-review-canvas/SKILL.md +176 -0
- package/skills/pr-review-canvas/renderer.js +170 -0
- package/skills/pr-review-canvas/styles.css +96 -0
- package/skills/pr-review-canvas/template.html +18 -0
- package/skills/reflect/SKILL.md +2 -2
- package/skills/review-and-ship/SKILL.md +41 -0
- package/skills/run-smoke-tests/SKILL.md +42 -0
- package/skills/setup-pstack/SKILL.md +13 -13
- package/skills/statechart/scripts/test/cli.test.ts +1 -1
- package/skills/swarm/SKILL.md +2 -2
- package/skills/teach/SKILL.md +1 -1
- package/skills/thermo-nuclear-code-quality-review/SKILL.md +192 -0
- package/skills/typescript-exhaustive-switch/SKILL.md +10 -0
- package/skills/verify-this/SKILL.md +74 -0
- package/skills/weekly-review/SKILL.md +32 -0
- package/skills/what-did-i-get-done/SKILL.md +31 -0
- package/skills/why/SKILL.md +2 -2
- package/skills/workflow-from-chats/SKILL.md +50 -0
- package/src/ask.ts +24 -10
- package/src/child-env.ts +15 -2
- package/src/generate-image.ts +98 -0
- package/src/index.ts +28 -9
- package/src/loop.ts +74 -17
- package/src/mode.ts +89 -27
- package/src/paths.ts +18 -0
- package/src/pi-command.ts +12 -0
- package/src/plan.ts +285 -30
- package/src/rule.ts +4 -4
- package/src/sections.ts +27 -3
- package/src/subscriptions/durable-store.ts +531 -0
- package/src/subscriptions/durable-types.ts +69 -0
- package/src/subscriptions/ensure-supervisor.ts +67 -0
- package/src/subscriptions/index.ts +310 -282
- package/src/subscriptions/supervisor-main.ts +134 -0
- package/src/subscriptions/supervisor.ts +325 -0
- package/src/subscriptions/webhook.ts +82 -21
- package/src/task/agents.ts +39 -3
- package/src/task/card.ts +31 -0
- package/src/task/format.ts +17 -3
- package/src/task/models.ts +7 -0
- package/src/task/progress.ts +112 -0
- package/src/task/records.ts +7 -9
- package/src/task/registry.ts +9 -4
- package/src/task/runner.ts +116 -24
- package/src/task/stop.ts +3 -3
- package/src/task/tool.ts +158 -57
- package/src/task/worktree.ts +5 -3
- package/src/todo.ts +29 -4
- package/scripts/live-e2e.mjs +0 -257
- package/test/aliases.test.ts +0 -57
- package/test/ask.test.ts +0 -85
- package/test/autocomplete.test.ts +0 -39
- package/test/e2e/aliases.e2e.test.ts +0 -81
- package/test/e2e/ask.e2e.test.ts +0 -135
- package/test/e2e/harness.ts +0 -179
- package/test/e2e/host.e2e.test.ts +0 -193
- package/test/e2e/lifecycle.e2e.test.ts +0 -99
- package/test/e2e/mode.e2e.test.ts +0 -160
- package/test/e2e/package.e2e.test.ts +0 -67
- package/test/e2e/task.e2e.test.ts +0 -734
- package/test/e2e/todo.e2e.test.ts +0 -59
- package/test/fixtures/cursor-askquestion-calls.json +0 -806
- package/test/fixtures/fake-pi.mjs +0 -96
- package/test/fixtures/image-model.ts +0 -16
- package/test/fixtures/list-models.ts +0 -15
- package/test/fixtures/readonly-shell-exit.ts +0 -17
- package/test/fixtures/scripted-model.ts +0 -113
- package/test/loop.test.ts +0 -209
- package/test/mode.test.ts +0 -143
- package/test/plan.test.ts +0 -126
- package/test/readonly-shell-security.test.ts +0 -84
- package/test/readonly-shell.test.ts +0 -44
- package/test/records.test.ts +0 -143
- package/test/registry.test.ts +0 -18
- package/test/resources.test.ts +0 -162
- package/test/rule.test.ts +0 -92
- package/test/scripts.test.ts +0 -182
- package/test/sections.test.ts +0 -56
- package/test/subscriptions-cron.test.ts +0 -60
- package/test/subscriptions.test.ts +0 -598
- package/test/task-agents.test.ts +0 -49
- package/test/task-card.test.ts +0 -34
- package/test/task-fork.test.ts +0 -233
- package/test/task-format.test.ts +0 -65
- package/test/task-model.test.ts +0 -141
- package/test/task-runner.test.ts +0 -259
- package/test/task-schema.test.ts +0 -50
- package/test/task-status.test.ts +0 -155
- package/test/task-worktree.test.ts +0 -106
- package/test/todo.test.ts +0 -74
- package/test/visualize.test.ts +0 -152
- package/tsconfig.json +0 -5
- package/vitest.config.ts +0 -16
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fix-merge-conflicts
|
|
3
|
+
description: Resolve merge conflicts non-interactively, validate build and tests, and finalize conflict resolution
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Fix merge conflicts
|
|
7
|
+
|
|
8
|
+
## Trigger
|
|
9
|
+
|
|
10
|
+
Branch has unresolved merge conflicts and needs a reliable path to a buildable state.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
1. Detect all conflicting files from git status and conflict markers.
|
|
15
|
+
2. Resolve each conflict with minimal, correctness-first edits.
|
|
16
|
+
3. Prefer preserving both sides when safe. Otherwise, choose the variant that compiles and keeps public behavior stable.
|
|
17
|
+
4. Regenerate lockfiles with package manager tools instead of hand-editing.
|
|
18
|
+
5. Run compile, lint, and relevant tests.
|
|
19
|
+
6. Stage resolved files and summarize key decisions.
|
|
20
|
+
|
|
21
|
+
## Guardrails
|
|
22
|
+
|
|
23
|
+
- Keep changes minimal and readable.
|
|
24
|
+
- Do not leave conflict markers in any file.
|
|
25
|
+
- Avoid broad refactors while resolving conflicts.
|
|
26
|
+
- Do not push or tag during conflict resolution.
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
|
|
30
|
+
- Files resolved
|
|
31
|
+
- Notable resolution choices
|
|
32
|
+
- Build/test outcome
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: get-pr-comments
|
|
3
|
+
description: Fetch and summarize review comments from the active pull request
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Get PR comments
|
|
7
|
+
|
|
8
|
+
## Trigger
|
|
9
|
+
|
|
10
|
+
Need a concise, actionable summary of feedback on the active pull request.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
1. Resolve the active PR for the current branch.
|
|
15
|
+
2. Fetch review comments and discussion comments.
|
|
16
|
+
3. Group feedback by severity and actionability.
|
|
17
|
+
4. Return a concise action list.
|
|
18
|
+
|
|
19
|
+
## Output
|
|
20
|
+
|
|
21
|
+
- Grouped feedback summary
|
|
22
|
+
- Action list ordered by priority
|
|
23
|
+
- Open questions that still need clarification
|
package/skills/how/SKILL.md
CHANGED
|
@@ -8,7 +8,7 @@ disable-model-invocation: true
|
|
|
8
8
|
|
|
9
9
|
Explore the codebase to answer "how does X work?" questions. Produce architectural explanations at the level of a senior engineer onboarding onto a subsystem, enough to build a working mental model, not so much that it reads like annotated source code.
|
|
10
10
|
|
|
11
|
-
Every spawn is a Task subagent with `subagent_type: generalPurpose` and `readonly: true`. Explorers use the `how explorer` line in the model rule
|
|
11
|
+
Every spawn is a Task subagent with `subagent_type: generalPurpose` and `readonly: true`. Explorers use the `how explorer` line in the model rule at the path the system prompt names (default `grok-4.7[effort=xhigh,fast=true]`), and every explainer uses the `how explainer` line (default `claude-opus-5-5:xhigh`). Set `model` to that line's value, or to the default if the rule or the line is missing. Leave `model` unset when the value is `auto` or `inherit-parent`. If the Task tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message. Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section of the **poteto-mode** skill.
|
|
12
12
|
|
|
13
13
|
## 1. Assess complexity
|
|
14
14
|
|
package/skills/ketchup/SKILL.md
CHANGED
|
@@ -34,10 +34,10 @@ For a call between options, give every option the work weighed, each with what i
|
|
|
34
34
|
|
|
35
35
|
## Visuals
|
|
36
36
|
|
|
37
|
-
A visual is a picture: a screenshot, a video, a Mermaid diagram, a
|
|
37
|
+
A visual is a picture: a screenshot, a video, a Mermaid diagram, a bar or line chart from the `visualize` tool, or a generated image. A Markdown table is not a visual, even with before and after columns.
|
|
38
38
|
|
|
39
39
|
When something is easier to grasp as a picture than as sentences, draw it: how a design or system works, a PR stack or dependency chain with each PR's state, a before and after of a fix, or options side by side. Never draw a status list, a list of action items, or boxes with nothing connecting them. Never give a fact twice, in text or across visuals.
|
|
40
40
|
|
|
41
41
|
Keep each visual small enough to read at a glance: at most six boxes, with at most eight words in each. Write labels as plain words a person would say, not tags like "Tests: pass". A fact that needs a sentence belongs in the text, or nowhere.
|
|
42
42
|
|
|
43
|
-
Embed screenshots and videos inline when the change is visible, not only as links. If a visible change has none, mark its summary line "No screenshot yet," and say there what changed on screen. Draw diagrams and charts from facts you have: a Mermaid diagram for how things connect and a `visualize` tool chart for numbers. Never invent a number, and never draw or generate a picture of a screen you did not capture. Link only artifacts that exist.
|
|
43
|
+
Embed screenshots and videos inline when the change is visible, not only as links. Pi's chat renders no image or video inside a reply, so show a screenshot by reading its file with the read tool, which displays it inline in terminals that support images, and name its path. For a video, open the file in the system player (`open` on macOS, `xdg-open` on Linux), read one frame from each slide, and name the path. If a visible change has none, mark its summary line "No screenshot yet," and say there what changed on screen. Draw diagrams and charts from facts you have: a Mermaid diagram for how things connect and a `visualize` tool chart for numbers. Never invent a number, and never draw or generate a picture of a screen you did not capture. Link only artifacts that exist.
|
|
@@ -6,7 +6,7 @@ disable-model-invocation: true
|
|
|
6
6
|
|
|
7
7
|
# Ketchup video
|
|
8
8
|
|
|
9
|
-
Follow [`/ketchup`](../ketchup/SKILL.md), but show what happened in a short subtitled video instead of its summary and visuals. Its window starts at the last message the user wrote before `/ketchup-video`, not before any earlier `/ketchup`. Writing and rendering the video, outside the repo, is the one exception to its read-only rule. The reply is ketchup's opening sentence,
|
|
9
|
+
Follow [`/ketchup`](../ketchup/SKILL.md), but show what happened in a short subtitled video instead of its summary and visuals. Its window starts at the last message the user wrote before `/ketchup-video`, not before any earlier `/ketchup`. Writing and rendering the video, outside the repo, is the one exception to its read-only rule. After render and frame QC, open the mp4 with the OS player (`open` on macOS, `xdg-open` on Linux), read one frame per slide with the read tool for terminals that support images, and name the video path in the reply. Pi chat does not play video inside a reply, so do not assume Markdown embedding plays it. The reply is ketchup's opening sentence, that video delivery (open, path, and frames), one line naming any work left that you can do yourself, and the action items. When the video shows a call's options, call each option by the name the video gives it. If the render fails, say so in one line and give only the calls.
|
|
10
10
|
|
|
11
11
|
## Slides
|
|
12
12
|
|
|
@@ -26,4 +26,4 @@ Give each slide one short subtitle line, about ten words, that says its point th
|
|
|
26
26
|
|
|
27
27
|
Render one silent landscape video, such as an mp4, with motion between slides. Every frame is the slide itself, edge to edge, above its subtitle strip. Make the frames from the slides, never by recording a screen, and burn each subtitle into its slide's frames so it stays on screen for the slide's whole hold. The hold is the time a slide is fully on screen, not counting the motion into or out of it. Hold each slide long enough to read the words it adds, at least one second for each three words. A slide adds its subtitle and each word that was not on the slide before it, including a label it changes. The first slide adds all its words. Words inside a screenshot do not count.
|
|
28
28
|
|
|
29
|
-
Before you
|
|
29
|
+
Before you deliver the video, check the rendered file. Look at one frame from each slide at chat size, and check that its subtitle is readable and covers nothing. Measure each hold by matching the file's frames to the slide, not with a still-frame detector, which counts the faint ends of a fade as still. Count the words each slide adds against its measured hold. Fix any slide you cannot read in that time, render again, and check again. Then open the file in the system player, read one frame per slide into the reply, and name the path.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: loop-on-ci
|
|
3
|
+
description: Monitor PR checks and fix failures until green. Uses gh pr checks as the source of truth for PR-attached checks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Loop on CI
|
|
7
|
+
|
|
8
|
+
## Trigger
|
|
9
|
+
|
|
10
|
+
Need to watch a branch or pull request and iterate on CI failures until all required checks are green.
|
|
11
|
+
|
|
12
|
+
Use `gh pr checks` as the source of truth. It includes all PR-attached checks, while `gh run list` only covers GitHub Actions.
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
1. Resolve the PR for the current branch.
|
|
17
|
+
2. Inspect current PR checks before waiting.
|
|
18
|
+
3. If checks already failed, diagnose those failures first.
|
|
19
|
+
4. If checks are pending, watch with `gh pr checks --watch --fail-fast`.
|
|
20
|
+
5. After each push, re-check the full PR check set and repeat until green.
|
|
21
|
+
|
|
22
|
+
## Commands
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Resolve the active PR
|
|
26
|
+
gh pr view --json number,url,headRefName
|
|
27
|
+
|
|
28
|
+
# Inspect all attached checks
|
|
29
|
+
gh pr checks --json name,bucket,state,workflow,link
|
|
30
|
+
|
|
31
|
+
# Watch pending checks and fail fast
|
|
32
|
+
gh pr checks --watch --fail-fast
|
|
33
|
+
|
|
34
|
+
# GitHub Actions logs, when the failing check links to a GHA run
|
|
35
|
+
gh run view <run-id> --log-failed
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Guardrails
|
|
39
|
+
|
|
40
|
+
- Keep each fix scoped to a single failure cause when possible.
|
|
41
|
+
- Do not bypass hooks (`--no-verify`) to force progress.
|
|
42
|
+
- If the failure is clearly unrelated to the PR and appears fixed on main, merge latest main instead of bloating the PR with unrelated fixes.
|
|
43
|
+
- If failures are flaky, retry once and report flake evidence.
|
|
44
|
+
- Re-run `gh pr checks --json name,bucket,state,workflow,link` after every push; the check set can change.
|
|
45
|
+
|
|
46
|
+
## Output
|
|
47
|
+
|
|
48
|
+
- Current CI status
|
|
49
|
+
- Failure summary and fixes applied
|
|
50
|
+
- PR URL once checks are green
|
|
@@ -20,7 +20,7 @@ Call `subscribe_webhook`. Set these fields:
|
|
|
20
20
|
The routine slug is the kebab-case form of the name.
|
|
21
21
|
The result gives the routine URL, `http://127.0.0.1:<port>/routines/<slug>`, and the credential file path. Use the path the result names, such as `~/.pi/agent/pstack/routines/<slug>/credentials.json` (`PI_CODING_AGENT_DIR` moves it).
|
|
22
22
|
The result does not include the sender key.
|
|
23
|
-
|
|
23
|
+
By default the routine wakes the owning Pi session, which keeps its context across presses the way a bot does. The durable supervisor keeps the listener available after the chat exits. Wakes received while the owner is offline park until that session is restored. Keep the owner running for immediate UI actions, and check the routine with `list_subscriptions`. To act on presses with no chat open, pass `sessionStrategy: "new_session"`: each accepted POST starts a fresh detached run without the owner's context, which must do the work itself. The routine does not expire unless `expiresInHours` sets a limit.
|
|
24
24
|
|
|
25
25
|
## Copy the URL and the sender key
|
|
26
26
|
|
|
@@ -55,7 +55,7 @@ The server POSTs to the routine URL with:
|
|
|
55
55
|
- timeout: 8 seconds
|
|
56
56
|
- one try, no retry
|
|
57
57
|
|
|
58
|
-
The POST returns HTTP 200 when the routine
|
|
58
|
+
The POST returns HTTP 200 when the routine accepts the event. This does not prove that the owning session has handled it.
|
|
59
59
|
Before you tell the user that the UI is live, probe once with a harmless payload.
|
|
60
60
|
Use an action that the prompt ignores.
|
|
61
61
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: make-pr-easy-to-review
|
|
3
|
+
description: Prepare PRs for review by cleaning noisy history, improving PR descriptions, and adding reviewer guidance without changing code behavior. Use for "make this easy to review", "tidy this PR", "clean up commits", or "annotate the diff".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Make PR Easy to Review
|
|
7
|
+
|
|
8
|
+
Prepare a PR so a reviewer can quickly understand the intent, important files, and risk. The default goal is reviewability without behavior changes.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. Resolve the target PR from the user-provided URL or current branch.
|
|
13
|
+
2. Inspect commits, diff size, changed paths, generated files, and PR description.
|
|
14
|
+
3. Identify reviewability issues: noisy commits, stale description, unrelated changes, mixed mechanical and logic changes, missing tests, or unclear reviewer entry points.
|
|
15
|
+
4. Propose a plan before rewriting history or force-pushing.
|
|
16
|
+
5. Apply safe improvements, then verify the tree or diff still matches the intended code.
|
|
17
|
+
|
|
18
|
+
## History Cleanup
|
|
19
|
+
|
|
20
|
+
Only rewrite history when the user asks for it or agrees to the plan. Before rewriting:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
gh pr view <PR> --json title,headRefName,baseRefName,state,commits
|
|
24
|
+
git fetch origin <headRefName> <baseRefName>
|
|
25
|
+
ORIGINAL_TREE=$(git rev-parse origin/<headRefName>^{tree})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Good commit groupings usually follow dependency order:
|
|
29
|
+
|
|
30
|
+
1. Schema/storage or generated API definitions.
|
|
31
|
+
2. Core logic.
|
|
32
|
+
3. Wiring and integration.
|
|
33
|
+
4. UI or surface behavior.
|
|
34
|
+
5. Tests.
|
|
35
|
+
|
|
36
|
+
After rewriting, verify content identity:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
echo "Original tree: $ORIGINAL_TREE"
|
|
40
|
+
echo "Current tree: $(git rev-parse HEAD^{tree})"
|
|
41
|
+
git diff origin/<headRefName> --stat
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Do not push if the tree changed unintentionally.
|
|
45
|
+
|
|
46
|
+
## Reviewer Guidance
|
|
47
|
+
|
|
48
|
+
When code behavior should stay untouched, prefer PR description and review notes:
|
|
49
|
+
|
|
50
|
+
- Add a TL;DR that matches the actual diff.
|
|
51
|
+
- Separate core files from generated or mechanical files.
|
|
52
|
+
- Call out risky behavior changes, migration order, rollout plan, and test coverage.
|
|
53
|
+
- Link issue trackers, dashboards, or design docs when they explain intent.
|
|
54
|
+
|
|
55
|
+
## Guardrails
|
|
56
|
+
|
|
57
|
+
- Never hide meaningful behavior changes inside "cleanup".
|
|
58
|
+
- Do not bypass hooks unless the user explicitly asks.
|
|
59
|
+
- If the PR is too large to make reviewable with notes, recommend splitting instead of polishing around the problem.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: new-branch-and-pr
|
|
3
|
+
description: Create a fresh branch, complete work, and open a pull request
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# New branch and PR
|
|
7
|
+
|
|
8
|
+
## Trigger
|
|
9
|
+
|
|
10
|
+
Starting work that should be shipped through a clean branch and pull request workflow.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
1. Ensure the working tree is clean or explicitly handled.
|
|
15
|
+
2. Create a descriptive branch from the latest main.
|
|
16
|
+
3. Complete implementation and tests.
|
|
17
|
+
4. Commit focused changes and push.
|
|
18
|
+
5. Create a concise PR with summary and test notes.
|
|
19
|
+
|
|
20
|
+
## Guardrails
|
|
21
|
+
|
|
22
|
+
- Keep branch scope focused on one change set.
|
|
23
|
+
- Include verification notes before requesting review.
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
|
|
27
|
+
- New branch name
|
|
28
|
+
- PR summary and test notes
|
|
29
|
+
- PR URL
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: no-inline-imports
|
|
3
|
+
description: Keep imports at top of file and avoid inline imports
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# No Inline Imports
|
|
8
|
+
|
|
9
|
+
# No inline imports
|
|
10
|
+
|
|
11
|
+
Always place imports at the top of the module. Avoid inline imports in function bodies, type annotations, or interface fields unless there is a strict circular-dependency reason and it is documented.
|
|
12
|
+
|
|
@@ -24,7 +24,7 @@ Infer the need from the message and the conversation. A named situation, such as
|
|
|
24
24
|
|
|
25
25
|
Check the state that changes the answer, and mention it only when it does:
|
|
26
26
|
|
|
27
|
-
-
|
|
27
|
+
- If the model rule is absent at the path the system prompt names, every role uses its default model. Do not infer absence from the default path when `PI_CODING_AGENT_DIR` relocates it.
|
|
28
28
|
- No `verify-*` skill or other app harness in the project means agents have no scripted way to drive the app. Mention `/create-verification-skill` when the question is about proving a change works.
|
|
29
29
|
- No formal verification skill in the project means no property is checked past what tests reach. Mention `/create-formal-verification-skill` when the question is about a race, an invariant, or another case tests rarely hit. When one exists and the code it covers changed after the commit it records as last in sync, mention `/maintain-formal-verification-skill` if the question touches that code.
|
|
30
30
|
|
|
@@ -39,7 +39,7 @@ When the model rule is missing and it matters, ask whether the user wants to pic
|
|
|
39
39
|
2. Run [`/setup-pstack`](../setup-pstack/SKILL.md). It asks for a reasoning budget, maps a model to each role, and writes the model rule. The rule applies from the next request. Then it offers once each to generate a verification skill and a formal verification skill for the project, unless the project already has one.
|
|
40
40
|
3. Start a real task with `/poteto-mode`, a goal, and a check that can pass or fail.
|
|
41
41
|
|
|
42
|
-
Installing adds pi-pstack's tools and system-prompt sections
|
|
42
|
+
Installing adds pi-pstack's tools and system-prompt sections. Pi advertises `/setup-pstack` and bundled skills whose frontmatter does not set `disable-model-invocation: true`. The model may read those skills when the user's request matches. Most pstack workflow skills stay hidden from automatic selection and load through an explicit command or another skill's instructions. The [README](../../README.md) and [guide page 1](../../docs/guide/01-setup.md) have the details. Offer to word their first prompt with them, per [`references/prompting.md`](references/prompting.md).
|
|
43
43
|
|
|
44
44
|
If cost is the worry, say where the tokens go and how to spend fewer. pstack spends extra tokens on subagents and review panels. Rerun `/setup-pstack` and pick a smaller budget or cheaper models. A role set to `auto` or `inherit-parent` runs on the chat's model, which saves tokens when the chat runs on a cheaper model. A shorter panel list runs fewer subagents, one for each entry. Save `/poteto-mode` for work that needs rigor.
|
|
45
45
|
|
|
@@ -140,8 +140,8 @@ Principles are one-rule skills that `/poteto-mode` reads and cites in its replie
|
|
|
140
140
|
| A question got treated as the next step of the last task | Say "new task", or say the turn doesn't need the mode. |
|
|
141
141
|
| A new model choice had no effect | The rule from `/setup-pstack` applies from the next request. Send one. |
|
|
142
142
|
| Runs cost more than expected | See the cost paragraph under Get set up. |
|
|
143
|
-
| A skill didn't load on its own |
|
|
144
|
-
| Parallel agents overwrote each other | Give each agent its own worktree
|
|
143
|
+
| A skill didn't load on its own | Check its `disable-model-invocation` frontmatter. Hidden skills load when the user types their command or another skill tells the model to read them. `/poteto-mode` does not run every skill. |
|
|
144
|
+
| Parallel agents overwrote each other | Give each agent its own git worktree with `environment: "cloud"`. They still share this machine. Assign distinct ports, output directories, and writable cache paths to concurrent runtime lanes. Stronger machine isolation is not provided. |
|
|
145
145
|
| An overnight run moved but finished nothing | `/loop` needs a check that can pass or fail, not a duration. See [guide page 7](../../docs/guide/07-overnight.md). |
|
|
146
146
|
| The reply claims success from a green build | Ask for the real command, flow, stored value, or profile. That's the prove-it-works principle. |
|
|
147
147
|
|
|
@@ -94,9 +94,9 @@ Read the leaf skill in full for any principle you apply. Each entry names when i
|
|
|
94
94
|
|
|
95
95
|
**Use `subagent_type: "poteto-agent"` for any subagent you spawn inside a playbook step** (code-writing delegates, ad-hoc helpers). The chat that receives `/poteto-mode` runs the playbook. Never spawn a `poteto-agent` to run the playbook itself. Routed workflow skills (`how`, `why`, `interrogate`, `reflect`, `swarm`) set their own `subagent_type` for diverse-model review. Respect what the skill prescribes, don't override to `poteto-agent`.
|
|
96
96
|
|
|
97
|
-
**Defaults for every `Task` call.** `run_in_background: true` (a `Task resume` that steers or resumes a running agent too, because a foreground call holds your turn while other reports wait), `readonly` unset (readonly strips MCP), file pointers not inlined context, explicit model per role (configurable via `/setup-pstack`. Defaults `grok-4.7
|
|
97
|
+
**Defaults for every `Task` call.** `run_in_background: true` (a `Task resume` that steers or resumes a running agent too, because a foreground call holds your turn while other reports wait), `readonly` unset (readonly strips MCP), file pointers not inlined context, explicit model per role (configurable via `/setup-pstack`. Defaults `grok-4.7[effort=xhigh,fast=true]` for code, `claude-opus-5-5:xhigh` for prose and judgment). Code delegates tier by difficulty. The hardest changes (cross-cutting design, gnarly concurrency, subtle algorithms) go to your strongest judgment model (`claude-opus-5-5:xhigh`), whether the task needs judgment on vague intent or is a precisely specified sequence of steps to execute to the letter. Trivial mechanical edits go to your fast code model. Per-role lines in the model rule override these defaults and the model choices in the routed skills (`how`, `why`, `arena`, `swarm`, `architect`, `interrogate`, `reflect`). A role with no line keeps its default, and a role line of `inherit-parent` or `auto` runs that role on the parent chat model (omit Task `model`). Each code playbook's configured model comes from its line (`feature, refactoring`, `bug-fix`, `perf-issue`, or `hillclimb`), and the hardest changes read `hardest tasks`. Prose and judgment read `judgment and prose`.
|
|
98
98
|
|
|
99
|
-
**Match the model to the job.** Before each spawn, start from the role's line or default and pick the reasoning level and speed the job needs. The `/setup-pstack` budget sets each role's starting level, xhigh by default. Raise it one step, up to max, for the hardest or subtlest work. Lower it one step for judgment and two or more steps for routine work. Use fast mode only when the job is urgent, meaning CI or trunk is red or a person is blocked on the result right now. Otherwise use standard speed, the model rather than its `-fast` variant. Verification is the exception and stays on the `swarm workers` model and speed (`grok-4.7
|
|
99
|
+
**Match the model to the job.** Before each spawn, start from the role's line or default and pick the reasoning level and speed the job needs. The `/setup-pstack` budget sets each role's starting level, xhigh by default. Raise it one step, up to max, for the hardest or subtlest work. Lower it one step for judgment and two or more steps for routine work. Use fast mode only when the job is urgent, meaning CI or trunk is red or a person is blocked on the result right now. Otherwise use standard speed, the model rather than its `-fast` variant. Verification is the exception and stays on the `swarm workers` model and speed (`grok-4.7[effort=xhigh,fast=true]` by default). Change only the effort level and whether the slug is fast, and keep the family the role names, so a diverse panel stays diverse. If the family has no slug at that level and speed, use its nearest slug. A role on `auto` or `inherit-parent` stays on the parent model. If the Task tool rejects the adjusted slug, do not try another adjusted slug. Use the role's line or default and say so. If the Task tool rejects that too, continue with the calling skill's fallback. A slug counts as rejected once a Task error says that the model is not valid, or leaves the slug out of its list of valid slugs. Never pass a rejected slug, and skip any fallback whose slug is already rejected. When the calling skill has no fallback, use the closest valid slug of the role's family from the error's list of valid slugs, or omit `model` so the subagent runs on the parent model when the list has none. When the calling skill's fallback runs out of slugs without saying what to do next, omit `model` too. Say so in both cases.
|
|
100
100
|
|
|
101
101
|
You own every subagent's work. Review the diff and write your own summary, don't pass through what it said. A second opinion is the same prompt against a different model. Agreement is high-signal.
|
|
102
102
|
|
|
@@ -6,7 +6,7 @@ Be scientific. Every shipped line traces to runtime evidence. Belt-and-suspender
|
|
|
6
6
|
|
|
7
7
|
1. Reproduce it yourself on the matching surface via the control skill (Non-negotiables), even when a debug or instrumentation protocol says to ask the user to reproduce. Ask the user only with a stated, specific reason the control surface cannot reach the target, and only after driving it as far as it goes. If it won't reproduce directly, synthesize the trigger, tighten conditions, or instrument until it fires.
|
|
8
8
|
2. Binary-search the cause. Form the candidate hypotheses, then rule them out until one survives. Seed them with `how` over the affected subsystem and the **why** skill for regression history. Each pass, take the split that cuts the most remaining problem space, get runtime evidence, eliminate. When program state is unclear, add instrumentation or logging and read it as the code runs. Don't guess. Drive a long or stubborn hunt with the `/loop` command. Confirm the surviving *mechanism* with runtime evidence before the step-3 architect/interrogate fan-out.
|
|
9
|
-
3. Plan the fix. If it crosses a function boundary, `architect` first. Delegate implementation to a subagent using your configured bug-fix model (default `grok-4.7
|
|
9
|
+
3. Plan the fix. If it crosses a function boundary, `architect` first. Delegate implementation to a subagent using your configured bug-fix model (default `grok-4.7[effort=xhigh,fast=true]`) with a specific scope.
|
|
10
10
|
4. Verify on the same surface. The original repro now passes. "Inconclusive" or wrong-surface is not a pass. Flag it. Unit tests show branch behavior, not bug absence.
|
|
11
11
|
5. Stage the commits so the failing repro lands before the fix in git history. See the **tdd** skill for the failing-test-first cadence when the bug has a cheap local test path. Skip it when the test would be expensive, integration-heavy, or unclear.
|
|
12
12
|
This is the canonical **sequence-verifiable-units** principle skill, the failing test first and the fix on top.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **Independent workstreams.** Disjoint files, services, or layers parallelize. Shared writes serialize.
|
|
10
10
|
- **Shared mutable state.** Default to splitting the target (the **separate-before-serializing-shared-state** principle skill). Serialize only for real invariants.
|
|
11
11
|
- **Smallest safe decomposition.** If one worker is best, name why.
|
|
12
|
-
4. Delegate code-writing to a subagent using your configured feature model (default `grok-4.7
|
|
12
|
+
4. Delegate code-writing to a subagent using your configured feature model (default `grok-4.7[effort=xhigh,fast=true]`) with a specific scope (file paths, named data shape and its organizing structure per **principle-model-the-domain**, a state machine over scattered booleans, a table/registry over branching, a typed model over repeated shape assumptions, chosen before the delegate writes logic, and success criteria). Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section. When the implementation admits multiple valid shapes (error handling, abstraction layer, test structure), delegate via the **arena** skill instead so the runners surface the alternatives and the cross-judge guards the pick. Mandatory: no skip-with-reason escape, and Laziness Protocol does not override it (the gain is review separation, not lines saved). A subagent forbidden to spawn satisfies this by owning the diff directly with the same review separation. No "standing by" reply that waits on a nested agent. Comments per **Comments**. Surgical edits, re-ground against the source for upstream-derived files. Port shared-primitive improvements to all consumers and verify each. Commit liberally.
|
|
13
13
|
5. Verify on the matching surface. "Inconclusive" or wrong-surface is not a pass. Flag it.
|
|
14
14
|
6. Rebase into small, ordered commits. Stack follow-ups.
|
|
15
15
|
Use the **sequence-verifiable-units** principle skill, building, verifying, and committing each small unit before the next.
|
|
@@ -9,7 +9,7 @@ Core discipline: one change, one measurement, keep or revert. Never stack untest
|
|
|
9
9
|
3. Open the decision log via the **show-me-your-work** skill. A `decision.tsv`, one row per attempt: id, hypothesis, change, before, after, delta, tests, verdict (kept or reverted), note. Read it before each attempt. Keep it out of the tree (gitignored).
|
|
10
10
|
4. Ground each hypothesis in the architecture model from step 1, so it names a specific mechanism ("defer X off the boot path because it blocks first paint"), not "try memoizing something". For a perf metric, order hypotheses by the performance mantras in step 2 of the Perf issue playbook (`playbooks/perf-issue.md`). Borrow only their order, not that step's stop rule.
|
|
11
11
|
5. Loop, one hypothesis per iteration:
|
|
12
|
-
- Hand the change to a subagent using your configured hillclimb model (default `grok-4.7
|
|
12
|
+
- Hand the change to a subagent using your configured hillclimb model (default `grok-4.7[effort=xhigh,fast=true]`) with a tight scope. Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section. Supervise and review the diff rather than typing it (the **guard-the-context-window** principle skill). When several independent hypotheses are live, fan them to parallel subagents, each in its own worktree (the **separate-before-serializing-shared-state** principle skill).
|
|
13
13
|
- Measure before and after with the frozen harness, and run the regression gate.
|
|
14
14
|
- Accept only when the metric moves past noise and the gate stays green. Otherwise revert the change in full. A tweak that "might help" is not kept.
|
|
15
15
|
- One commit per accepted fix, staging only the files you changed (`git add <files>`, never `-A`). Log the row either way, kept or reverted.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
6. Run `node <SKILLS>/poteto-mode/scripts/check-plan.mjs <plan.md>` and fix every line it prints (the **encode-lessons-in-structure** principle skill).
|
|
11
11
|
7. Hand back. Post the plan path and the script's output, then stop. Execution starts on the operator's explicit go, under the execution playbook the plan names.
|
|
12
12
|
|
|
13
|
-
**Verification.** Tests alone are not sufficient verification. A PR is verified only when its unit, live, and perf boxes are all checked (the **prove-it-works** principle skill). That sentence is the verification rule. Every verification block opens with it. The live block is mandatory. Ten lanes at the PR head drive the real surface through its control skill, per the **swarm** skill, on the `swarm workers` model (default `grok-4.7
|
|
13
|
+
**Verification.** Tests alone are not sufficient verification. A PR is verified only when its unit, live, and perf boxes are all checked (the **prove-it-works** principle skill). That sentence is the verification rule. Every verification block opens with it. The live block is mandatory. Ten lanes at the PR head drive the real surface through its control skill, per the **swarm** skill, on the `swarm workers` model (default `grok-4.7[effort=xhigh,fast=true]`). Each lane is one box with a concrete scenario, the screenshot it saves, and its pass predicate. One lane is the **Regression lane against trunk.** It runs the same load-bearing scenario on trunk and head. If trunk does not have the feature, the lane records that fact and gates the behavior the diff adds plus the end state the user waits for instead of inventing a trunk result. The perf gate is dual-sided. Trunk and head must both produce the named metric. If trunk lacks the feature, also isolate the work the diff adds and set an absolute budget for that work plus the end-to-end state the user waits for. Do not claim a ratio between unlike scenarios. The perf block names the metric, the interleaved probe, the trunk baseline measured first, and the rule with the number that fails. A PR that changes an interaction is review-gated. The operator reviews it in chat with screenshots and a video before merge. A PR that changes no interaction writes `**Review gate.** None. <PR id> is not review-gated.` and no boxes under it.
|
|
14
14
|
|
|
15
15
|
**Control skill.** Pick it by surface. Browser, Electron, and web UIs use `control-ui`, shipped with pi-pstack. CLIs and TUIs use `control-cli`, shipped with pi-pstack. Native mobile uses whatever simulator-driving skill the repo has. A PR that touches two surfaces gets lanes on both. A surface with no control skill is a risk in Appendix C, and its live block still names how each lane drives it.
|
|
16
16
|
|
|
@@ -68,7 +68,7 @@ Tests alone are not sufficient verification. A PR is verified only when its unit
|
|
|
68
68
|
|
|
69
69
|
### Boot recipe, for every live lane
|
|
70
70
|
|
|
71
|
-
Each live lane runs
|
|
71
|
+
Each live lane runs in its own git worktree (`environment: "cloud"`) at the PR head on this machine. Assign each concurrent lane distinct ports, output directories, and writable cache paths. A worktree does not provide VM or credential isolation. If the lane needs stronger machine isolation, mark it blocked until that isolation is available. Drive through `control-ui` or `control-cli`, shipped with pi-pstack.
|
|
72
72
|
|
|
73
73
|
- [ ] `git fetch origin <head-branch> && git checkout <head SHA>`.
|
|
74
74
|
- [ ] <Start the backend and the surface. Wait for ready.>
|
|
@@ -7,9 +7,9 @@ Run it with your own tools. Spawn workers with `Task`. Keep the program's state
|
|
|
7
7
|
#### Topology
|
|
8
8
|
|
|
9
9
|
- **One owner per PR.** The owner is the only writer of its branch and carries the PR from build to merge. Only the owner pushes, rebases, or retargets it. Closing or retargeting a base PR orphans every PR above it, so the owner does that only on your call. You never author or edit code. Conflicted merges, chain rebases, and fixes go to owners.
|
|
10
|
-
- **A fresh worker for each independent task.** Its kickoff carries everything it needs, including each upstream report it depends on, pasted in full. Workers can't see their siblings. Run workers
|
|
10
|
+
- **A fresh worker for each independent task.** Its kickoff carries everything it needs, including each upstream report it depends on, pasted in full. Workers can't see their siblings. Run workers in a new git worktree (`environment: "cloud"`) unless the work needs the existing checkout or its uncommitted state. Both environments run on this machine and can access its local transcripts, simulators, and auth. Assign distinct ports, output directories, and writable cache paths to concurrent runtime workers, including `control-ui` and `control-cli` checks. A worktree is not a machine or credential boundary. Report stronger isolation as unavailable when the task requires it. Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section.
|
|
11
11
|
- **A sub-coordinator only when one area has many parallel workers.** It owns that area's workers and kickoffs and sends you one rollup, never raw worker reports. Stop at three levels: you, sub-coordinators, and workers. Keep about ten workers in flight per coordinator, and start the next one as each finishes instead of waiting on a whole batch.
|
|
12
|
-
- **Fork with Task `fork` when new work needs a worker's built state,** such as its checkout
|
|
12
|
+
- **Fork with Task `fork` when new work needs a worker's built state,** such as its checkout or uncommitted changes. A fork needs an idle source: a running worker is refused so the two never write one checkout, so wait for its completion notification first. Message a worker with Task `resume` only for a follow-up on the same work. Never message one to check on it, because a message restarts an idle agent.
|
|
13
13
|
- **Each PR gets a verifier that isn't its author,** on a different model family. The owner merges only on that verifier's pass at the current head.
|
|
14
14
|
- **Start with one unit.** Take it through kickoff, owner, verifier, and merge before you fan out, so a flaw in the kickoff costs one agent instead of fifty. On near-identical cheap units, the first unit is that test.
|
|
15
15
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
7. Do it cheaper.
|
|
15
15
|
|
|
16
16
|
When an earlier mantra meets the target, stop.
|
|
17
|
-
3. Plan the fix from the trace. If it crosses a function boundary, `architect` first. Delegate implementation to a subagent using your configured perf-issue model (default `grok-4.7
|
|
17
|
+
3. Plan the fix from the trace. If it crosses a function boundary, `architect` first. Delegate implementation to a subagent using your configured perf-issue model (default `grok-4.7[effort=xhigh,fast=true]`). Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section. Review the diff. Capture a post-fix trace.
|
|
18
18
|
Apply the **sequence-verifiable-units** principle skill, verifying each attempt before trying the next.
|
|
19
19
|
4. Parse and compare the artifacts (JSON to sqlite, diff). "Inconclusive" or wrong-surface is not a pass. Flag it.
|
|
20
20
|
5. Cite the measurement in the PR.
|
|
@@ -8,7 +8,7 @@ If the cleanup reveals a missing feature or a real bug, split it out and ship th
|
|
|
8
8
|
2. Name the structure the code is missing per **principle-model-the-domain**. Boring code stays when the shape is already clear and local. The reshape must delete branches or invalid states, not add indirection.
|
|
9
9
|
3. Name the target shape. State what the module layout, types, and call graph should be if built today (**principle-foundational-thinking**, **principle-redesign-from-first-principles**). If the target crosses a function boundary, run the **architect** skill for parallel design exploration of the shape before the move.
|
|
10
10
|
4. Subtract before you add. Delete dead code, collapse one-caller wrappers, drop redundant validators, and remove orphan references before introducing the new shape (**principle-subtract-before-you-add**). The smallest change that reaches the target shape ships (**principle-laziness-protocol**). A speculative cleanup that "might help" gets reverted.
|
|
11
|
-
5. Move in small behavior-preserving steps, each keeping the pin green. For API reshapes, migrate every caller and delete the old API in the same wave (**principle-migrate-callers-then-delete-legacy-apis**). No compatibility shims, no parallel old-and-new paths. Spot-check every rename against the actual files. Renames silently miss usages in strings, prose, and back-references. Delegate the mechanical edits to a subagent using your configured refactoring model (default `grok-4.7
|
|
11
|
+
5. Move in small behavior-preserving steps, each keeping the pin green. For API reshapes, migrate every caller and delete the old API in the same wave (**principle-migrate-callers-then-delete-legacy-apis**). No compatibility shims, no parallel old-and-new paths. Spot-check every rename against the actual files. Renames silently miss usages in strings, prose, and back-references. Delegate the mechanical edits to a subagent using your configured refactoring model (default `grok-4.7[effort=xhigh,fast=true]`) with a specific scope (file paths, the names being moved, the behavior to hold). Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section.
|
|
12
12
|
6. Prove behavior is unchanged on the real artifact, not "it compiles" (**principle-prove-it-works**). For larger reshapes, run an equivalence check: a script that diffs old-vs-new outputs, a recorded baseline replayed against the new code, or a smoke run on the matching surface via the relevant control skill.
|
|
13
13
|
7. Confirm the change is worth keeping. The success measure is reduced reader load (**principle-minimize-reader-load**). If the diff does not lower reader load somewhere, revert it.
|
|
14
14
|
8. Rebase into small ordered commits. A subtraction commit, then the reshape, then any follow-on cleanup. Shape them with the **sequence-verifiable-units** principle skill, so each behavior-preserving slice stays green before the next. Run **Opening a PR**.
|