dsh-pstack 0.0.0-stage → 0.2.0-beta.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.
- package/LICENSE +22 -0
- package/README.md +133 -2
- package/assets/agents/comment-sicko.md +32 -0
- package/assets/agents/poteto-agent.md +8 -0
- package/assets/docs/guide/01-setup.md +64 -0
- package/assets/docs/guide/02-poteto-mode.md +139 -0
- package/assets/docs/guide/03-understand.md +79 -0
- package/assets/docs/guide/04-design.md +133 -0
- package/assets/docs/guide/05-build-and-clean.md +83 -0
- package/assets/docs/guide/06-verify-and-ship.md +152 -0
- package/assets/docs/guide/07-overnight.md +120 -0
- package/assets/docs/guide/08-principles.md +72 -0
- package/assets/docs/guide/09-make-it-yours.md +96 -0
- package/assets/docs/guide/10-recipes-and-pitfalls.md +180 -0
- package/assets/docs/guide/README.md +38 -0
- package/assets/docs/guide/images/design.jpg +0 -0
- package/assets/docs/guide/images/overnight.jpg +0 -0
- package/assets/docs/guide/images/recipes.jpg +0 -0
- package/assets/docs/guide/images/router.jpg +0 -0
- package/assets/docs/guide/images/understanding.jpg +0 -0
- package/assets/docs/guide/images/verification.jpg +0 -0
- package/assets/docs/harness/dsh.md +60 -0
- package/assets/docs/pstack-models.example.md +54 -0
- package/assets/skills/architect/SKILL.md +81 -0
- package/assets/skills/architect/references/design-red-flags.md +57 -0
- package/assets/skills/architect/references/rationale-template.md +35 -0
- package/assets/skills/architect/references/runner-prompt.md +20 -0
- package/assets/skills/arena/SKILL.md +50 -0
- package/assets/skills/automate-me/SKILL.md +106 -0
- package/assets/skills/benchmark-checklist/SKILL.md +39 -0
- package/assets/skills/blast-radius/SKILL.md +52 -0
- package/assets/skills/bro/SKILL.md +7 -0
- package/assets/skills/correct/SKILL.md +32 -0
- package/assets/skills/create-formal-verification-skill/SKILL.md +43 -0
- package/assets/skills/create-verification-skill/SKILL.md +46 -0
- package/assets/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
- package/assets/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
- package/assets/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
- package/assets/skills/figure-it-out/SKILL.md +54 -0
- package/assets/skills/how/SKILL.md +38 -0
- package/assets/skills/how/references/explainer-prompt.md +55 -0
- package/assets/skills/how/references/explorer-prompt.md +35 -0
- package/assets/skills/in-your-own-words/SKILL.md +7 -0
- package/assets/skills/interrogate/SKILL.md +71 -0
- package/assets/skills/interrogate/references/code-quality-review.md +47 -0
- package/assets/skills/interrogate/references/lead-judgment.md +39 -0
- package/assets/skills/interrogate/references/reviewer-prompt.md +62 -0
- package/assets/skills/interrogate/references/rubric.md +77 -0
- package/assets/skills/ketchup/SKILL.md +45 -0
- package/assets/skills/maintain-formal-verification-skill/SKILL.md +60 -0
- package/assets/skills/maintain-verification-skill/SKILL.md +41 -0
- package/assets/skills/no-comments/SKILL.md +26 -0
- package/assets/skills/poteto-help/SKILL.md +162 -0
- package/assets/skills/poteto-help/references/prompting.md +51 -0
- package/assets/skills/poteto-help/references/recipes.md +51 -0
- package/assets/skills/poteto-mode/SKILL.md +151 -0
- package/assets/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/assets/skills/poteto-mode/playbooks/autonomous-run.md +15 -0
- package/assets/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
- package/assets/skills/poteto-mode/playbooks/autopilot-stack.md +12 -0
- package/assets/skills/poteto-mode/playbooks/babysit.md +23 -0
- package/assets/skills/poteto-mode/playbooks/bug-fix.md +15 -0
- package/assets/skills/poteto-mode/playbooks/eval.md +25 -0
- package/assets/skills/poteto-mode/playbooks/feature.md +21 -0
- package/assets/skills/poteto-mode/playbooks/hillclimb.md +21 -0
- package/assets/skills/poteto-mode/playbooks/investigation.md +14 -0
- package/assets/skills/poteto-mode/playbooks/multi-phase-plan.md +155 -0
- package/assets/skills/poteto-mode/playbooks/opening-a-pr.md +34 -0
- package/assets/skills/poteto-mode/playbooks/orchestrate.md +112 -0
- package/assets/skills/poteto-mode/playbooks/pause-safely.md +10 -0
- package/assets/skills/poteto-mode/playbooks/perf-issue.md +25 -0
- package/assets/skills/poteto-mode/playbooks/prototype.md +14 -0
- package/assets/skills/poteto-mode/playbooks/refactoring.md +16 -0
- package/assets/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/assets/skills/poteto-mode/playbooks/session-pickup.md +11 -0
- package/assets/skills/poteto-mode/playbooks/shipping.md +12 -0
- package/assets/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
- package/assets/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/assets/skills/poteto-mode/playbooks/worktree-cleanup.md +20 -0
- package/assets/skills/poteto-mode/references/bugbot-triage.md +142 -0
- package/assets/skills/poteto-mode/scripts/check-plan.mjs +220 -0
- package/assets/skills/poteto-mode/scripts/check-plan.test.mjs +343 -0
- package/assets/skills/poteto-mode/scripts/orch/orch.mjs +4282 -0
- package/assets/skills/poteto-mode/scripts/orch/orch.test.mjs +2042 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/cli.test.mjs +5101 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/github.test.mjs +1177 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/policy.test.mjs +1441 -0
- package/assets/skills/poteto-mode/scripts/watch-pr/watch-pr.mjs +4601 -0
- package/assets/skills/poteto-mode/scripts/worktree-audit.mjs +675 -0
- package/assets/skills/principle-attack-the-premise/SKILL.md +21 -0
- package/assets/skills/principle-boundary-discipline/SKILL.md +34 -0
- package/assets/skills/principle-build-the-lever/SKILL.md +23 -0
- package/assets/skills/principle-encode-lessons-in-structure/SKILL.md +11 -0
- package/assets/skills/principle-exhaust-the-design-space/SKILL.md +9 -0
- package/assets/skills/principle-experience-first/SKILL.md +19 -0
- package/assets/skills/principle-explain-the-number/SKILL.md +17 -0
- package/assets/skills/principle-fix-root-causes/SKILL.md +21 -0
- package/assets/skills/principle-foundational-thinking/SKILL.md +21 -0
- package/assets/skills/principle-guard-the-context-window/SKILL.md +12 -0
- package/assets/skills/principle-laziness-protocol/SKILL.md +10 -0
- package/assets/skills/principle-make-operations-idempotent/SKILL.md +22 -0
- package/assets/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +14 -0
- package/assets/skills/principle-minimize-reader-load/SKILL.md +18 -0
- package/assets/skills/principle-model-the-domain/SKILL.md +24 -0
- package/assets/skills/principle-never-block-on-the-human/SKILL.md +15 -0
- package/assets/skills/principle-outcome-oriented-execution/SKILL.md +21 -0
- package/assets/skills/principle-prove-it-works/SKILL.md +24 -0
- package/assets/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
- package/assets/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
- package/assets/skills/principle-sequence-verifiable-units/SKILL.md +17 -0
- package/assets/skills/principle-subtract-before-you-add/SKILL.md +18 -0
- package/assets/skills/principle-test-behavior-not-implementation/SKILL.md +20 -0
- package/assets/skills/principle-type-system-discipline/SKILL.md +13 -0
- package/assets/skills/recall/SKILL.md +37 -0
- package/assets/skills/reflect/SKILL.md +69 -0
- package/assets/skills/reflect/references/divergent-reviewer.md +38 -0
- package/assets/skills/reflect/references/judgment-reviewer.md +37 -0
- package/assets/skills/reflect/references/synthesizer.md +56 -0
- package/assets/skills/reflect/references/tooling-reviewer.md +48 -0
- package/assets/skills/setup-pstack/SKILL.md +67 -0
- package/assets/skills/sharpen/SKILL.md +16 -0
- package/assets/skills/show-me-your-work/SKILL.md +84 -0
- package/assets/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/assets/skills/show-me-your-work/scripts/log.mjs +108 -0
- package/assets/skills/swarm/SKILL.md +43 -0
- package/assets/skills/tdd/SKILL.md +42 -0
- package/assets/skills/teach/SKILL.md +23 -0
- package/assets/skills/technical-writing/SKILL.md +108 -0
- package/assets/skills/typescript-best-practices/SKILL.md +34 -0
- package/assets/skills/typescript-best-practices/references/patterns.md +328 -0
- package/assets/skills/unslop/SKILL.md +62 -0
- package/assets/skills/why/SKILL.md +100 -0
- package/assets/skills/why/references/epistemics.md +71 -0
- package/assets/skills/why/references/investigator-prompt.md +84 -0
- package/assets/skills/why/references/source-playbook.md +17 -0
- package/assets/skills/why/references/sources/code-archaeology.md +51 -0
- package/assets/skills/why/references/sources/databricks.md +70 -0
- package/assets/skills/why/references/sources/datadog.md +97 -0
- package/assets/skills/why/references/sources/incident-postmortem.md +5 -0
- package/assets/skills/why/references/sources/linear.md +48 -0
- package/assets/skills/why/references/sources/notion.md +55 -0
- package/assets/skills/why/references/sources/sentry.md +66 -0
- package/assets/skills/why/references/sources/slack.md +17 -0
- package/assets/skills/why/references/synthesizer-prompt.md +129 -0
- package/cordis.patch.yml +39 -0
- package/dist/frontmatter-BQX3ekwP.mjs +229 -0
- package/dist/frontmatter-BQX3ekwP.mjs.map +1 -0
- package/dist/history.d.mts +429 -0
- package/dist/history.mjs +1129 -0
- package/dist/history.mjs.map +1 -0
- package/dist/host-contract-o47JH_r8.d.mts +527 -0
- package/dist/index.d.mts +278 -0
- package/dist/index.mjs +272 -0
- package/dist/index.mjs.map +1 -0
- package/dist/paths-D_JlVmBk.mjs +42 -0
- package/dist/paths-D_JlVmBk.mjs.map +1 -0
- package/dist/script.d.mts +193 -0
- package/dist/script.mjs +782 -0
- package/dist/script.mjs.map +1 -0
- package/dist/subagent.d.mts +336 -0
- package/dist/subagent.mjs +1402 -0
- package/dist/subagent.mjs.map +1 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +106 -3
- package/static/icon.png +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Recipes and pitfalls
|
|
2
|
+
|
|
3
|
+
Prompts worth copying, then the mistakes everyone makes once. Swap in your own paths and finish conditions. The recipes are deliberately informal. That's how they get typed in practice, and the skills read intent fine.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Understand an unfamiliar subsystem
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
use /how first to understand how this initialization works. then use /why to figure out why it broke recently.
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Mechanics first, history second. Each skill's report tells you which sources it searched, so you know what the answer is grounded in.
|
|
14
|
+
|
|
15
|
+
## Restate a noisy report before touching code
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
/poteto-mode read this thread. restate the underlying issue in your own words, in plain english. don't change any code yet.
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
A misreading shows up in the restatement, where it costs one message to correct. Keep your own theory to yourself until the agent has stated its own. `/in-your-own-words` asks for the restatement alone, with no playbook.
|
|
22
|
+
|
|
23
|
+
## Sharpen a prompt before you send it
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
/sharpen write the onboarding doc for the new billing service.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The agent names what an expert would do that you didn't ask for, the raw material they'd start from, their methods and tools, and an outside check that the result is right. It hands back your prompt rewritten to ask for that and doesn't do the task. Send the rewrite when it reads right.
|
|
30
|
+
|
|
31
|
+
## Prototype before you pick
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
/poteto-mode prototype a few options for the settings layout. put them behind a switcher and send me screenshots of each.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
You pick from things that run, not from descriptions. The agent answers its own layout and timing questions along the way.
|
|
38
|
+
|
|
39
|
+
## Turn a settled design into a plan
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
/poteto-mode turn this design into a plan. small verifiable PRs, each with its own proof.
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Ask only after the design settles. The plan is the deliverable, and it names the playbook that will execute it.
|
|
46
|
+
|
|
47
|
+
## Get a second opinion on a design
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
ask /arena for a second opinion on this thread and our approach
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Your current design becomes one candidate among several, and the synthesis tells you whether the panel found something better or confirmed what you had. It costs little next to a design that is expensive to reverse.
|
|
54
|
+
|
|
55
|
+
## Check independent slices in parallel
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
/swarm check every package under packages/ against its check.sh. one worker per package. one report.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Each worker owns one package. The parent waits for every slice and returns one `PASS`, `ISSUES`, or `BLOCKED` report instead of raw worker dumps.
|
|
62
|
+
|
|
63
|
+
## Review a branch skeptically
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
/interrogate the whole branch, but skeptically. don't change anything yet. no nitpicks unless it's an actual bug or regression in behavior.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The qualifiers do real work. "don't change anything yet" keeps it read-only, and the nitpick rule pre-filters the noise so `Act on` findings are worth your time.
|
|
70
|
+
|
|
71
|
+
## Fix a bug through a failing test
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
/poteto-mode repro the duplicate write first. if there's a cheap test path, /tdd it. then fix and rerun.
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
"if there's a cheap test path" matters. Forcing a test through brittle mocks proves less than running the real command, and the playbook is allowed to say so.
|
|
78
|
+
|
|
79
|
+
## Repro and fix a report with proof
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
/poteto-mode repro this with /verify-<app>. if it repros on main, fix it and show me a video as proof.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
"if it repros on main" lets the run stop early when the bug is already gone. The video lets you check the fix before you read the diff.
|
|
86
|
+
|
|
87
|
+
## Prove a property tests rarely reach
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
/create-formal-verification-skill the retry queue. a message must never be delivered twice.
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
You get one property checked in every case within a stated scope, a counterexample in your code's terms if the code already breaks it, and a project skill the next agent runs on any change to that code.
|
|
94
|
+
|
|
95
|
+
## Vet a number before you post it
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
/benchmark-checklist vet this 40% speedup before it goes in the pr description
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
You get faster, slower, no measurable difference, or inconclusive, with the run count, the range, and what limits the number.
|
|
102
|
+
|
|
103
|
+
## Stop correcting the same mistake
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
/correct agents keep adding new config flags without registering them in the schema
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The fix lands in the repo as architecture, a type, a lint, or a test, so the next agent can't make the mistake.
|
|
110
|
+
|
|
111
|
+
## Ask how without starting the work
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
/poteto-help how do i get poteto-mode to stay on every turn?
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
You get an answer, a prompt to send, and a link to the source. Nothing runs until you send that prompt.
|
|
118
|
+
|
|
119
|
+
## Keep a run honest while you're away
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
im going to bed, keep going autonomously until every fixture passes. do not stop. keep a decision log i can audit in the morning.
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The full contract is on the [overnight page](./07-overnight.md). The short form works once the task and finish condition are already in the conversation.
|
|
126
|
+
|
|
127
|
+
## Redirect a drifting run
|
|
128
|
+
|
|
129
|
+
Steering prompts are one line:
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
i said the goal is to repro. i did not ask for a fix yet.
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
apply prove it works. show me the real output, not the build log.
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```text
|
|
140
|
+
/unslop that, no emdashes
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
You rarely need more words. You need the right name, and [the principles page](./08-principles.md) is the vocabulary.
|
|
144
|
+
|
|
145
|
+
## Get the reply in plain words
|
|
146
|
+
|
|
147
|
+
```text
|
|
148
|
+
/bro
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
That's the whole prompt. [`/bro`](../../skills/bro/SKILL.md) restates the last message like one human talking to another, no jargon, shorter. Use it when a reply is technically thorough and you still don't know what it said.
|
|
152
|
+
|
|
153
|
+
## Catch up on a chat you left running
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
/ketchup
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
[`/ketchup`](../../skills/ketchup/SKILL.md) tells you in plain words what changed since your last message, then lists each call waiting on you with its pick, evidence, and risk. It changes nothing while it reports.
|
|
160
|
+
|
|
161
|
+
## The pitfalls
|
|
162
|
+
|
|
163
|
+
- **Enumerating skills in the prompt.** "use /how then /architect then /arena" reorders steps the playbook already sequences. State the goal and constraints. Name a skill only to override a default.
|
|
164
|
+
- **A vague finish condition.** "make it better" gives a goal nothing to check. Give a command or artifact that can pass or fail.
|
|
165
|
+
- **Leading with your theory of the cause.** The agent searches wherever you pointed. Ask it to restate the problem first, then share your hunch.
|
|
166
|
+
- **Taking the first design.** One attempt locks in the first shape the model thought of. Ask for prototypes or `/architect` and pick from evidence.
|
|
167
|
+
- **Polishing an abstract plan.** Adversarial review of a plan with no code behind it invents risks that will never happen. Settle the open questions with prototypes, then review what got built.
|
|
168
|
+
- **Parallel agents in one worktree.** They overwrite each other, and nobody can tell which agent changed what. Say "own worktree per attempt", and pass each child its checkout's absolute path as `cwd`, because a shared checkout isolates nothing.
|
|
169
|
+
- **Looping before you trust the loop.** A loop that can't verify its own work only makes unchecked work faster. Get the verification skill working first.
|
|
170
|
+
- **Trusting an unvetted number.** A warm cache or a skipped code path can fake a speedup. Run `/benchmark-checklist` before the number goes anywhere.
|
|
171
|
+
- **Correcting the same mistake by hand.** A correction in chat helps one run. `/correct` fixes the repo so no later run repeats it.
|
|
172
|
+
- **Using `/arena` for coverage.** `/arena` repeats one design or code brief, then picks a base and grafts the best parts. `/swarm` partitions slices or declared race arms and aggregates one report.
|
|
173
|
+
- **Accepting every review comment.** Bots and humans both file real catches and noise in one list. `/interrogate` sorts findings into act-on and dismissed buckets with reasons, and you can override either way.
|
|
174
|
+
- **Treating `auto` as a model slug.** `auto` and `inherit-parent` mean "omit the model field so the subagent inherits the parent chat model." [Setup](./01-setup.md) covers the roles.
|
|
175
|
+
- **Reporting success off a green build.** A build proves it compiles. Ask for the real command, flow, stored value, or profile, and expect the evidence in the reply.
|
|
176
|
+
- **Writing a `SKILL.md` freehand.** Route it through the [Authoring or modifying a skill playbook](../../skills/poteto-mode/playbooks/authoring-a-skill.md) so validation and review happen.
|
|
177
|
+
|
|
178
|
+
That's the guide. If you skipped ahead, go back to [setup](./01-setup.md) and run one real task. The habits stick from use, not from reading.
|
|
179
|
+
|
|
180
|
+
Back to the [guide index](./README.md).
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# The pstack guide
|
|
2
|
+
|
|
3
|
+
pstack works best when you stop micromanaging the agent. You describe what you want and how you'll know it's done. `/poteto-mode` picks the playbook, runs the other skills as the steps need them, and shows you the evidence. This guide teaches that habit with realistic prompts.
|
|
4
|
+
|
|
5
|
+
Here's what you'll learn:
|
|
6
|
+
|
|
7
|
+
1. [Set up pstack](./01-setup.md). Install the plugin and pick your models.
|
|
8
|
+
2. [Route work through `/poteto-mode`](./02-poteto-mode.md). Give it a goal and watch it pick a playbook.
|
|
9
|
+
3. [Understand the code](./03-understand.md). A read-only investigation, then `/how`, `/why`, `/teach`, and `/recall` before you edit anything.
|
|
10
|
+
4. [Design the change](./04-design.md). `/architect`, `/arena`, `/swarm`, `/interrogate`, prototypes, and plans before code locks in a shape.
|
|
11
|
+
5. [Build and clean the change](./05-build-and-clean.md). The build playbooks, `/tdd`, `/unslop`, and `/no-comments`.
|
|
12
|
+
6. [Verify and ship](./06-verify-and-ship.md). Prove behavior on the real app, formally verify what tests rarely reach, vet numbers with `/benchmark-checklist`, then open a focused PR and drive it to merged.
|
|
13
|
+
7. [Run work while you sleep](./07-overnight.md). Trust before long runs, an overnight contract, a decision log you can audit, and goals, reminders, and worktrees that carry a run past one agent.
|
|
14
|
+
8. [Steer with principle names](./08-principles.md). The 24 names that redirect an agent mid-task.
|
|
15
|
+
9. [Make it yours](./09-make-it-yours.md). Your own mode, `/correct` for repeated mistakes, and how to test a skill change.
|
|
16
|
+
10. [Recipes and pitfalls](./10-recipes-and-pitfalls.md). Prompts to copy and mistakes to skip.
|
|
17
|
+
|
|
18
|
+
Read the pages in order the first time. After that, each page stands alone.
|
|
19
|
+
|
|
20
|
+
When you're stuck, or can't tell which skill fits, type [`/poteto-help`](../../skills/poteto-help/SKILL.md) with your question:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
/poteto-help which skill should i use to review this branch?
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
It answers, hands you a prompt to send, and links the skill or guide page the answer came from. It doesn't start the work, because a pstack run spends real tokens, so you send the prompt when you're ready. It runs only when you type it.
|
|
27
|
+
|
|
28
|
+
## If you only remember one thing
|
|
29
|
+
|
|
30
|
+
Give the agent a goal and a way to check it, in your own words:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
/poteto-mode the export writes duplicate rows when a retry lands mid-run. repro first, then fix and verify.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
You don't need to name a playbook or list skills. "repro first" and a checkable outcome are all the routing signal `/poteto-mode` needs. It matches the Bug fix playbook, copies the steps into a todo list, and calls the right skills as each step fires.
|
|
37
|
+
|
|
38
|
+
Next: [Set up pstack](./01-setup.md).
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# DSH harness mapping
|
|
2
|
+
|
|
3
|
+
> This package ships its static assets, one bundled skill provider, the `pstack_subagent` delegation tool, the ported workflow skills and playbooks, restricted read-only history through `pstack_history`, `pstack_script` for running the bundled CLIs on the Host's own runtime, the official worktree integration mounted on demand, and a long-running-workflow pass that maps automatic goals, reminder heartbeats, and local watchers onto the host tools that actually exist.
|
|
4
|
+
> The tables below are the target contract, not proof that a capability is installed in a profile.
|
|
5
|
+
|
|
6
|
+
Generated from `scripts/capabilities.ts` into `assets/docs/harness/dsh.md`. Edit the table, not this file.
|
|
7
|
+
|
|
8
|
+
## Coverage
|
|
9
|
+
|
|
10
|
+
- `mapped`: DSH has a direct equivalent, and the port keeps the upstream intent.
|
|
11
|
+
- `degraded`: DSH has a partial equivalent, and the row states what is lost.
|
|
12
|
+
- `preserved`: the upstream behavior stays as written, inside its narrower scope.
|
|
13
|
+
- `excluded`: the feature is not carried, and every skill that needs it is adapted.
|
|
14
|
+
- `deferred`: a later unit delivers it, and `Unit` names that unit.
|
|
15
|
+
|
|
16
|
+
A row without `mapped` carries a reason and a delivery unit. A numeric unit names when the
|
|
17
|
+
capability lands; `not planned` marks a gap this port does not close. Neither is evidence
|
|
18
|
+
about this tree.
|
|
19
|
+
|
|
20
|
+
## Tools and fields
|
|
21
|
+
|
|
22
|
+
| Upstream | DSH | Coverage | Unit | Note |
|
|
23
|
+
| --- | --- | --- | --- | --- |
|
|
24
|
+
| `Task` spawn | `pstack_subagent`, which returns a child id and reports by completion notice | mapped | - | Every call starts a managed activation and returns the child id; the result arrives as a completion notice, so nothing polls. A panel role starts one child per configured entry and reports a partial start instead of rolling back. |
|
|
25
|
+
| `subagent_type: generalPurpose` | `agent: "general"` | mapped | - | A plain child with no injected preamble. `agent` accepts only the three pstack kinds, never a DSH agent preset id. |
|
|
26
|
+
| `subagent_type: poteto-agent` | `agent: "poteto-agent"`, with the preamble injected by the tool | mapped | - | The preamble is read from the packaged asset at an absolute path and the `poteto-mode` instructions path is injected into the brief. A missing preamble blocks that agent type instead of degrading to a plain child. |
|
|
27
|
+
| `comment-sicko` subagent | `agent: "comment-sicko"`, briefed read-only | degraded | 3 | The persona preamble is injected, but the no-write rule is brief text rather than a sandbox, so a reviewer's scope still has to be checked. |
|
|
28
|
+
| `run_in_background: true` | field removed; children start as activations | mapped | - | `pstack_subagent` takes no background flag: every child is a managed activation and reports through a completion notice. |
|
|
29
|
+
| `readonly: true` and `readonly: false` | a no-write constraint in the brief; the field is removed | degraded | 3 | Prose is not a sandbox, so a read-only child has to be checked rather than enforced. |
|
|
30
|
+
| `resume` | a fresh child; `send_message` only when state is expensive to move | mapped | - | `pstack_subagent` always starts a fresh child. `send_message` continues a live one; a settled child is never silently resumed. |
|
|
31
|
+
| `file_attachments` | real paths listed in the brief | mapped | - | The brief carries real paths; no invented attachment argument exists in the tool schema. |
|
|
32
|
+
| `AskQuestion` | `ask_user_question` with `multi_select` | mapped | - | |
|
|
33
|
+
| `TodoWrite` | `todo_write` with the full list; a skipped step stays in `content` | mapped | - | |
|
|
34
|
+
| `Grep`, `Glob`, `Read`, `Shell` | `grep`, `glob`, `read`, `bash` | mapped | - | |
|
|
35
|
+
| built-in `create-skill` | the authoring playbook plus this package's frontmatter, link, and structure checks | degraded | 4 | No Cursor drafting, evaluation, or optimization tool is claimed; the playbook points at the validators this package actually runs. |
|
|
36
|
+
| `/name` or the named skill | the `skill` tool for model-invocable skills, `/name` for the rest | mapped | - | The bundled provider lists all 55 skills and loads each body from its absolute path; only `setup-pstack` stays model-invocable, exactly as upstream declares. |
|
|
37
|
+
| `bun` + shell scripts under `poteto-mode/scripts/` | `pstack_script`, which runs the bundled CLIs on the Host's own runtime | mapped | - | `id` is a closed enum over the shipped artefacts, so the tool takes no path and no shell string. Each artefact is one dependency-free Node module launched with `process.execPath`, which is why no `bun`, `bash`, or `node` on PATH is needed; `ELECTRON_RUN_AS_NODE=1` is added only under Electron. Each run starts in the Session's own directory. `background: true` needs the jobs service and is refused with a reason when the composition has none. The tool goes through no command approval and no sandbox policy, which its description states. |
|
|
38
|
+
|
|
39
|
+
## Paths, models, and host features
|
|
40
|
+
|
|
41
|
+
| Upstream | DSH | Coverage | Unit | Note |
|
|
42
|
+
| --- | --- | --- | --- | --- |
|
|
43
|
+
| model slug, reasoning effort, `fast` | `role` resolved from `$DSH_HOME/pstack-models.md`, plus `reasoningEffort` per delegation | mapped | - | A role value is `inherit-parent`, `auto`, `<provider>/<model>`, or `<provider>/<model> [effort]`. The value splits at its first `/`, so a model id may keep its own vendor prefix (`gateway/vendor-a/model-x`); no segment may be empty. The role's effort is the level that role starts at, not a ceiling: `pstack_subagent` takes `reasoningEffort` to raise or lower it for one delegation, and a child can change its own with `set_reasoning_effort`, which applies from its next step. Both are validated against the live adapter metadata, per panel entry, before a child starts, and a refusal lists that model's real efforts. No model id is hardcoded in the assets, and no effort ladder is either. |
|
|
44
|
+
| `~/.cursor/rules/pstack-models.mdc` | `$DSH_HOME/pstack-models.md`, read for each new delegation | mapped | - | `/setup-pstack` writes the file and `pstack_subagent` re-reads it on every delegation. An unreadable file is an error, not an empty configuration. |
|
|
45
|
+
| `.cursor/skills`, `~/.cursor/skills` | `assets/skills/<name>/SKILL.md` inside this package | mapped | - | Skills ship inside the package and are read in place; nothing is copied into `$DSH_HOME/skills`, and no directory is watched. |
|
|
46
|
+
| `~/.cursor/plugins`, `.cursor-plugin` | absolute resource paths inside this package | mapped | - | Each candidate carries its own skill directory as the resource base, so `references/` and `scripts/` resolve next to `SKILL.md`. |
|
|
47
|
+
| `~/.cursor/projects/.../agent-transcripts` | `pstack_history`, a restricted read of raw `sessionQuery` events | degraded | 5 | The tool pages one fixed observation of the calling session or a reviewable direct child, inside the caller's workspace; there is no transcript directory to read, no arbitrary session id, and no descendant traversal. A cold read from persistence cannot separate the stored log from the read-time interrupted-turn closers rc.3 appends, so per-event provenance is reported undeterminable and a full transcript audit stays unfinished for those sessions. The live/prepared split, pagination, and lease release are unit-tested; no real profile read has run yet. |
|
|
48
|
+
| agent store | `.audit/<task-slug>/` or a directory the user names | mapped | - | |
|
|
49
|
+
| `paths:` auto-attach globs in SKILL.md | not consumed; skills load by explicit invocation | degraded | not planned | Automatic attachment by file glob has no equivalent, so `typescript-best-practices` is explicit-invocation only and its body says so. The frontmatter field is dropped from the generated skill rather than shipped as a no-op. |
|
|
50
|
+
| Custom Mode | an explicit `/poteto-mode` on each new task | degraded | 4 | No persistent mode or keyboard shortcut exists. The ported skills say so at the step where a mode would have applied. |
|
|
51
|
+
| `/loop` | `create_goal` for automatic continuation, plus `schedule_create` only as a timed heartbeat | degraded | 6 | There is no command to type and no event subscription. The goal carries a predicate across rounds, and its round driver is a separate host package that a profile may not mount, so a goal can be created while nothing continues on its own. A reminder only delivers a follow-up into the session that created it, refuses a delegated caller, and cannot watch a PR or CI. The event half is a background job whose settlement wakes the session, or a poll the text calls a poll. Nothing here has been exercised on a real profile. |
|
|
52
|
+
| Cursor Automations, `update_state`, `SendToUser` | not mapped; routine-style automation is excluded | excluded | 5 | `automate-me` ships, but it drafts a `-mode` skill from authorized history and opens a PR; it does not create a webhook routine, request a secret, or wake an agent. `schedule_create` is not a webhook routine, it refuses a delegated caller, and no secret is ever requested. |
|
|
53
|
+
| cloud agent, `cloud_base_branch`, dashboard | a local child with a real `cwd`, started from a local branch or a prepared checkout | degraded | 3 | No VM, cross-device resume, dashboard, or cloud liveness check is promised, and the long-running playbooks now say so in the step that used one. Isolation is the official worktree checkout, which does not cover ports, credentials, or services, and every child ends with the host process. |
|
|
54
|
+
| `deslop` | `/no-comments` plus one read-through of the diff | degraded | 4 | It is not the same skill under a new name; the diff read-through replaces the plugin. |
|
|
55
|
+
| `control-ui`, `control-cli` | a project verification skill or an existing driver | degraded | 4 | Without a driver the verification result stays unproven, and reading source is not accepted as a substitute. |
|
|
56
|
+
| Bugbot | triage of review comments already on a pull request | preserved | 4 | Starting or configuring Bugbot is out of scope; existing review threads are read as ordinary data. |
|
|
57
|
+
| built-in pull request tool | resolved `gh`, or an `origin` CLI that is actually available | degraded | 4 | A forge path has to be resolved before the shipping steps can run; there is no built-in PR tool. |
|
|
58
|
+
| image generation, `/visualize` | Mermaid, existing screenshots, or a real renderer | degraded | 4 | No image is fabricated when none can be rendered, and a read-only capture stays read-only. |
|
|
59
|
+
| worktree isolation | the official worktree rows, mounted by this bundle when the profile lacks them | mapped | - | Two rows mount on demand inside the composed profile and are skipped when an equivalent row is already enabled, so the `worktrees` service is provided exactly once. Isolation covers the working directory and branch only: not ports, network, credentials, caches, or services. The four profile paths are not yet verified at runtime. |
|
|
60
|
+
| the `/make-bot-ui` skill | excluded from the port | excluded | 1 | It targets Cursor's Grok Bot webhook and Tailscale flow, and there is no equivalent host feature. |
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# pstack per-role model configuration
|
|
2
|
+
#
|
|
3
|
+
# `/setup-pstack` writes this file to `$DSH_HOME/pstack-models.md`. `pstack_subagent`
|
|
4
|
+
# re-reads it on every delegation, so an edit reaches the next child and never a child
|
|
5
|
+
# that already started.
|
|
6
|
+
#
|
|
7
|
+
# One line per role. The key must match a role in the manifest exactly, commas
|
|
8
|
+
# included. Delete a line to inherit the parent route for that role.
|
|
9
|
+
#
|
|
10
|
+
# Value forms:
|
|
11
|
+
#
|
|
12
|
+
# - `inherit-parent` or `auto` sends no `agentOptions`, so the child runs on the parent
|
|
13
|
+
# route.
|
|
14
|
+
# - `<provider>/<model>` is an exact route. It splits at the first `/`: the
|
|
15
|
+
# provider is the text before it and the model is everything after it, so
|
|
16
|
+
# `gateway/vendor-a/model-x` is provider `gateway` with model
|
|
17
|
+
# `vendor-a/model-x`. No segment may be empty.
|
|
18
|
+
# - `<provider>/<model> [effort]` sets the starting level for that role. A caller
|
|
19
|
+
# raises or lowers it per delegation with `reasoningEffort`, and a running child
|
|
20
|
+
# can change its own with `set_reasoning_effort`. The effort must appear in that
|
|
21
|
+
# model's supported effort list. This package assumes no ladder of its own, so it
|
|
22
|
+
# never invents a token and reports the real ones whenever it refuses one.
|
|
23
|
+
#
|
|
24
|
+
# `arena runners`, `architect runners`, and `interrogate reviewers` are panels: the
|
|
25
|
+
# value is a comma-separated list and one child starts per entry. Two entries on the
|
|
26
|
+
# same route are not a cross-model review, and `pstack_subagent` says so in its
|
|
27
|
+
# result.
|
|
28
|
+
#
|
|
29
|
+
# `arena cross-judge pool` is a list too, but it is not fanned out; pass `roleIndex` to
|
|
30
|
+
# choose the entry. `swarm workers` is a list as well: its first entry is the default
|
|
31
|
+
# route for every worker, `roleIndex` gives one race arm a different entry, and the
|
|
32
|
+
# caller still starts each worker itself.
|
|
33
|
+
#
|
|
34
|
+
# The defaults below are `inherit-parent` because no route is confirmed yet. Replace
|
|
35
|
+
# them with routes your own deployment serves.
|
|
36
|
+
#
|
|
37
|
+
# budget: none (unset)
|
|
38
|
+
feature, refactoring: inherit-parent
|
|
39
|
+
bug-fix: inherit-parent
|
|
40
|
+
perf-issue: inherit-parent
|
|
41
|
+
hillclimb: inherit-parent
|
|
42
|
+
judgment and prose: inherit-parent
|
|
43
|
+
hardest tasks: inherit-parent
|
|
44
|
+
how explorer: inherit-parent
|
|
45
|
+
how explainer: inherit-parent
|
|
46
|
+
why investigators: inherit-parent
|
|
47
|
+
why synthesizer: inherit-parent
|
|
48
|
+
reflect tooling: inherit-parent
|
|
49
|
+
reflect judgment, divergent, synthesizer: inherit-parent
|
|
50
|
+
arena runners: inherit-parent
|
|
51
|
+
arena cross-judge pool: inherit-parent
|
|
52
|
+
swarm workers: inherit-parent
|
|
53
|
+
architect runners: inherit-parent
|
|
54
|
+
interrogate reviewers: inherit-parent
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architect
|
|
3
|
+
description: Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in. Use for /architect, 'architect this', 'design this', or non-trivial work where jumping to code would lock in the wrong shape.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Architect
|
|
8
|
+
|
|
9
|
+
> DSH port of pstack. `pstack_subagent` replaces Cursor's Task tool, and `role` replaces Cursor model slugs. Full mapping: `../../docs/harness/dsh.md`.
|
|
10
|
+
|
|
11
|
+
Sketch types, function signatures, class shapes, and module boundaries with `not implemented` bodies and pseudocode. Synthesize across multiple model perspectives, then fill in code against the chosen sketch.
|
|
12
|
+
|
|
13
|
+
## Start
|
|
14
|
+
|
|
15
|
+
Open a `todo_write` list with one entry per phase before starting.
|
|
16
|
+
|
|
17
|
+
1. Ground
|
|
18
|
+
2. Sketch
|
|
19
|
+
3. Agree
|
|
20
|
+
4. Implement
|
|
21
|
+
5. Scrap
|
|
22
|
+
|
|
23
|
+
## Phase A: Ground the problem
|
|
24
|
+
|
|
25
|
+
Build a real mental model of every system the new code touches. Read the `how` skill's `SKILL.md` at its absolute resource path and run it over the relevant subsystems. Naming a file isn't grounding. Produce the architectural explanation `how` prescribes. If the design redefines ownership or layering, read the `why` skill's `SKILL.md` at its absolute resource path and run it on the existing shape, so the rationale becomes a constraint, not a guess.
|
|
26
|
+
|
|
27
|
+
Skip Phase A only when the work is genuinely greenfield with no surrounding system to integrate.
|
|
28
|
+
|
|
29
|
+
## Phase B: Sketch
|
|
30
|
+
|
|
31
|
+
Read the `arena` skill's `SKILL.md` at its absolute resource path and run it with the design-sketch task and the Phase A grounding artifacts. Pass `references/runner-prompt.md` as each runner's prompt.
|
|
32
|
+
|
|
33
|
+
Use `role: "architect runners"` in place of the `arena runners` role. That role is a panel, so one `pstack_subagent` call starts one runner per entry and reports every child id with the route it actually got. A role the file does not name inherits the parent route; an entry whose route does not resolve fails that runner and names the role file, while the remaining entries still start and the result records the degradation. Two entries on the same route are two sketches from one model, not a multi-model sketch, and the result says so. Each runner needs its own checkout: the child calls `create_worktree` in its own Session, or you create the checkouts one at a time and pass each absolute `path` as that child's `cwd`, because two children writing in one parent checkout is not isolation.
|
|
34
|
+
|
|
35
|
+
Design it twice. Require at least two structurally distinct candidates before synthesis, even when the first looks sufficient. This is `principle-exhaust-the-design-space` made concrete; read its `SKILL.md` at its absolute resource path. Whole-shape alternatives, not point fixes inside one shape.
|
|
36
|
+
|
|
37
|
+
Screen every candidate against [`references/design-red-flags.md`](references/design-red-flags.md) before synthesis. Assume the next contributor is an agent that sees only the files it opened, copies the nearest example, and takes the shortest path that compiles. Prefer the design where a change that looks right from one file is right for the whole repo.
|
|
38
|
+
|
|
39
|
+
Compare viable candidates on interface depth. Prefer the design that hides more complexity behind a smaller, simpler public surface. A rich interface can keep call chains short by concentrating capability instead of scattering it across layers.
|
|
40
|
+
|
|
41
|
+
Arena returns one synthesized design package. Its synthesis decision fills the rationale's "Synthesis decision" section.
|
|
42
|
+
|
|
43
|
+
## Phase C: Agree (opt-in)
|
|
44
|
+
|
|
45
|
+
Default: proceed directly to implementation with the synthesized design. No human checkpoint.
|
|
46
|
+
|
|
47
|
+
Opt in to a checkpoint when the invoker explicitly asks: "/architect with checkpoint," "stop and show me before implementing," or similar. Then surface the synthesized design and pause for sign-off, using `ask_user_question` when there is a real choice. With no answerer, stop and report the design instead of assuming approval.
|
|
48
|
+
|
|
49
|
+
The synthesis can ship as its own commit either way, as the "scaffold first" mode of `principle-foundational-thinking`. Planned and scoped breakage during fill-in is fine, per `principle-outcome-oriented-execution`. Read either `SKILL.md` at its absolute resource path. For adversarial pressure on the design before implementing, read the `interrogate` skill's `SKILL.md` at its absolute resource path and run it on the synthesized sketch.
|
|
50
|
+
|
|
51
|
+
If the human pushes back on the shape (in a checkpoint or after the fact), treat that as Phase A evidence. Re-ground and re-run Phase B before writing more code.
|
|
52
|
+
|
|
53
|
+
## Phase D: Implement against the sketch
|
|
54
|
+
|
|
55
|
+
Replace `not implemented` bodies with code, pseudocode with logic. The synthesized sketch is the contract. Deviations from it are signal to surface, not friction to absorb silently. If a function needs a parameter the sketch didn't anticipate, ask whether the sketch was wrong, the requirement was missed, or the implementation is overreaching.
|
|
56
|
+
|
|
57
|
+
## Phase E: Scrap when the architecture is wrong
|
|
58
|
+
|
|
59
|
+
If implementation keeps producing friction the sketch can't absorb, throw the sketch out. Don't bolt fixes onto a wrong design: read `principle-redesign-from-first-principles` and `principle-fix-root-causes` at their absolute resource paths.
|
|
60
|
+
|
|
61
|
+
The signal is a *pattern*, not single instances. Tells:
|
|
62
|
+
|
|
63
|
+
- The same shape of workaround appearing repeatedly across unrelated code.
|
|
64
|
+
- Multiple unrelated edge cases that all need special-case branches.
|
|
65
|
+
- Types that need escape hatches (`any`, casts, optional fields always set in practice) to compile.
|
|
66
|
+
- The "we need a lock" reflex when the sketch said the state wasn't shared.
|
|
67
|
+
- Callers having to know the abstraction's internal rules to use it.
|
|
68
|
+
- Two or more independent Phase D deviations of the same shape across the implementation.
|
|
69
|
+
|
|
70
|
+
Use judgment. A few edge cases don't condemn an architecture. Some problems are legitimately complex. Complexity in the data is not complexity in the design.
|
|
71
|
+
|
|
72
|
+
When you scrap:
|
|
73
|
+
|
|
74
|
+
1. Read the `how` skill's `SKILL.md` at its absolute resource path and re-run it over what's been built.
|
|
75
|
+
2. Redesign as if the new constraints had been day-one assumptions, per redesign-from-first-principles.
|
|
76
|
+
3. Subtract before adding, as `principle-subtract-before-you-add` requires; read its `SKILL.md` at its absolute resource path. The new sketch should be smaller than the old one before it grows.
|
|
77
|
+
4. Return to Phase B and re-run arena.
|
|
78
|
+
|
|
79
|
+
## Outputs
|
|
80
|
+
|
|
81
|
+
The caller's usage is written first and the type sketch derived from it. One file with new types and signatures for small changes. Module map plus type definitions for larger work. The rationale ships alongside, shaped per `references/rationale-template.md`, including the usage sketch and the synthesis decision.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Design red flags
|
|
2
|
+
|
|
3
|
+
Screen every candidate before synthesis. A red flag is a reason to revise or reject the shape.
|
|
4
|
+
|
|
5
|
+
## Shallow module
|
|
6
|
+
|
|
7
|
+
A shallow module exposes a large interface while hiding little complexity. Judge depth by the capability and policy hidden behind the public surface relative to the size of that surface. Prefer a simple interface backed by substantial behavior.
|
|
8
|
+
|
|
9
|
+
Do not confuse a deep module with a deep call chain. A deep call chain scatters understanding across layers. A deep module concentrates capability behind one interface.
|
|
10
|
+
|
|
11
|
+
Look for these signs:
|
|
12
|
+
|
|
13
|
+
- Callers coordinate several methods to complete one operation.
|
|
14
|
+
- Public options expose internal stages or implementation choices.
|
|
15
|
+
- Learning the interface does not save the caller from learning the implementation.
|
|
16
|
+
|
|
17
|
+
## Information leakage
|
|
18
|
+
|
|
19
|
+
Information leakage makes multiple modules depend on the same internal decision. A representation, policy, or protocol detail appears in more than one place, so changing it requires coordinated edits.
|
|
20
|
+
|
|
21
|
+
Public re-exports of transport or wire types are leakage. Parse external data into domain types behind the interface. Keep storage schemas, framework objects, and protocol details private.
|
|
22
|
+
|
|
23
|
+
## Temporal decomposition
|
|
24
|
+
|
|
25
|
+
Temporal decomposition organizes modules by execution order instead of the knowledge they own. Separate load, validate, transform, and save stages often repeat one representation and its invariants across several boundaries.
|
|
26
|
+
|
|
27
|
+
Group code around domain knowledge and ownership. Methods that run at different times can still belong to one module when they protect the same decisions.
|
|
28
|
+
|
|
29
|
+
## Pass-through method
|
|
30
|
+
|
|
31
|
+
A pass-through method forwards the same arguments to another method with the same shape. It adds a layer without hiding complexity.
|
|
32
|
+
|
|
33
|
+
Remove it or move responsibility to the module that can complete the operation. Keep a forwarding boundary only when it adds policy, adaptation, or a distinct abstraction.
|
|
34
|
+
|
|
35
|
+
## Split ownership
|
|
36
|
+
|
|
37
|
+
More than one module writes the same state or keeps its own copy of it. An agent that edits one writer can't see the others, so their rules diverge.
|
|
38
|
+
|
|
39
|
+
Give each piece of state one owner. Other modules read it or ask the owner to change it.
|
|
40
|
+
|
|
41
|
+
## Two ways to do one task
|
|
42
|
+
|
|
43
|
+
The design supports more than one way to do the same task. An agent copies whichever way it finds first, so every way keeps gaining callers.
|
|
44
|
+
|
|
45
|
+
Keep one way. Move callers off the others and delete them in the same change.
|
|
46
|
+
|
|
47
|
+
## Importable internals
|
|
48
|
+
|
|
49
|
+
A caller can import a module's internals. An agent takes the shortest path that compiles, so it imports them directly and they become part of the interface.
|
|
50
|
+
|
|
51
|
+
Make internals unreachable from outside the module, so an import from outside fails the build.
|
|
52
|
+
|
|
53
|
+
## Hand-synced list
|
|
54
|
+
|
|
55
|
+
Two or more places list the same items, and adding an item means editing every list. An agent that sees one list updates only that one.
|
|
56
|
+
|
|
57
|
+
Keep one list and derive the others from it. If a list can't be derived, make the build fail when the lists disagree.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Rationale template
|
|
2
|
+
|
|
3
|
+
The prose that ships alongside the type sketch. One page. Sentence-case headings, no boilerplate. Replace the italic notes with actual content.
|
|
4
|
+
|
|
5
|
+
## Problem
|
|
6
|
+
|
|
7
|
+
*One paragraph. What we're trying to do, and what about the existing system or constraints makes the shape non-obvious. If [Phase A](../SKILL.md#phase-a-ground-the-problem) surfaced constraints the design must honor (existing types to interop with, callers we can't break, invariants that crossed our boundary), name them here so the reader sees the same constraints you saw.*
|
|
8
|
+
|
|
9
|
+
## Usage (caller's view)
|
|
10
|
+
|
|
11
|
+
*Write this first, before the type sketch. Show the README or quickstart the consumer reads, plus two or three realistic call sites in their own code. What they import, what they call, what comes back. The type sketch in [Shape](#shape) is derived from this. The two must agree. When they diverge, reconcile the sketch to the usage, not the reverse. The caller's experience is the spec. The types serve it.*
|
|
12
|
+
|
|
13
|
+
## Shape
|
|
14
|
+
|
|
15
|
+
*The recommended architecture. Data structures first. Then how data flows through the signatures. Name the load-bearing decisions. State which invariants are encoded in types, where validation lives, and what the system deliberately does not do. Judge interface depth explicitly. State what complexity the public surface hides, what remains exposed to callers, and why the interface is no larger than needed. Cite the principle behind each decision (e.g., `per boundary-discipline`). Don't restate it.*
|
|
16
|
+
|
|
17
|
+
## Synthesis decision
|
|
18
|
+
|
|
19
|
+
*Filled in by [arena](../../arena/SKILL.md). Records which candidate became the base and why, what was adapted from each of the others, and what was rejected and why.*
|
|
20
|
+
|
|
21
|
+
## Tradeoffs accepted
|
|
22
|
+
|
|
23
|
+
*One bullet per tradeoff the chosen shape makes. Form: "we accept X in exchange for Y." Name anything a future reader might mistake for an oversight, including things that look like premature optimization or premature simplification.*
|
|
24
|
+
|
|
25
|
+
## Alternatives considered
|
|
26
|
+
|
|
27
|
+
*Required. Name at least one concrete alternative shape, with one line on why it lost. Judge each alternative on interface depth, not implementation simplicity alone. Name the complexity it exposes to callers and the complexity it hides. Two or three alternatives belong here when the design space had real contenders. One is fine when the constraints forced the answer, with the conclusion phrased as "this was the only viable shape because..." Avoid listing flavors of the same shape. This section covers design alternatives the chosen shape considered and rejected, not other runner candidates.*
|
|
28
|
+
|
|
29
|
+
## Open questions and risks
|
|
30
|
+
|
|
31
|
+
*Things you noticed during the sketch that the human needs to weigh in on, and risks worth flagging before implementation starts. Phrase as questions, not assertions, so the human's answer is the resolution rather than a comment.*
|
|
32
|
+
|
|
33
|
+
## Next implementation step
|
|
34
|
+
|
|
35
|
+
*The first thing to build against the sketch. One sentence. What you'd start writing immediately after synthesis (or after Phase D sign-off, if a checkpoint was opted into).*
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Architect runner prompt
|
|
2
|
+
|
|
3
|
+
The orchestrator passes this file through to every parallel candidate runner during Phase B and fills in the variable inputs around it: the task, the Phase A grounding artifacts, the isolated working directory, and the path to write outputs. The working directory is a git worktree when available, otherwise a per-runner subdirectory under the sketch dir. What matters is independence between candidates.
|
|
4
|
+
|
|
5
|
+
You are producing one candidate design in architect's parallel exploration. Read the **architect** skill in full first. That's the workflow you're inside. Output a candidate design package: type sketch, function signatures, module map, and prose rationale shaped per [`rationale-template.md`](rationale-template.md).
|
|
6
|
+
|
|
7
|
+
Apply the following discipline. The orchestrator compares candidates on these axes to pick a base.
|
|
8
|
+
|
|
9
|
+
- Caller's usage first. Write the README-style usage and two or three real call sites before the types, then derive the type sketch from them. The usage is the spec. The two must agree, so reconcile the sketch to the usage, not the reverse.
|
|
10
|
+
- Data structures first. Get the core types right and the code becomes obvious. Trace each dominant access pattern through the proposed structure. If the answer is "we'll add a map / index / cache later," the structure is wrong.
|
|
11
|
+
- Interface depth. Compare the capability hidden behind the public surface relative to the size of that surface. Prefer a simple interface that pulls complexity into the callee, even when the implementation becomes less simple. Do not put transport or wire types on the public API. Parse into domain types behind the interface.
|
|
12
|
+
- Shared state: if two actors might both write, ask "what happens?" If the answer isn't "nothing," default to per-actor state with a merge at the read boundary, per the **separate-before-serializing-shared-state** principle skill.
|
|
13
|
+
- Make boundaries visible. `not implemented` errors for bodies, `// TODO` pseudocode for tricky logic, doc comments stating intent and invariants. A reader should trace data from input to output by reading types and signatures alone.
|
|
14
|
+
- Encode invariants in types: hard-to-misuse types > runtime checks > prose comments, per the **encode-lessons-in-structure** principle skill.
|
|
15
|
+
- Validate at boundaries, trust types inside, per the **boundary-discipline** principle skill. Business logic as pure functions. The shell stays thin.
|
|
16
|
+
- Single source of truth per invariant. Derive instead of sync.
|
|
17
|
+
- Idempotent state transitions where applicable, per the **make-operations-idempotent** principle skill. Ask what happens if the operation runs twice or crashes halfway.
|
|
18
|
+
- Short call chains. If tracing the flow needs more than three files, flatten the hierarchy, per the **laziness-protocol** and **minimize-reader-load** principle skills.
|
|
19
|
+
|
|
20
|
+
You are one of the parallel runners, each on a different model. Produce the best design your model can make. Don't hedge against the others. Differences between candidates are the signal used to pick a base and graft. Converging on a safe-looking middle defeats the exploration.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: arena
|
|
3
|
+
description: Spawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena, 'arena this', 'throw it in the arena', or when one attempt at a non-trivial artifact would lock in the wrong shape.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Arena
|
|
8
|
+
|
|
9
|
+
> DSH port of pstack. `pstack_subagent` replaces Cursor's Task tool, and `role` replaces Cursor model slugs. Full mapping: `../../docs/harness/dsh.md`.
|
|
10
|
+
|
|
11
|
+
Open a `todo_write` list with one entry per phase (Frame, Fan out, Cross-judge, Pick, Graft, Verify) before launching anything.
|
|
12
|
+
|
|
13
|
+
## Phase A: Frame
|
|
14
|
+
|
|
15
|
+
Every candidate gets the same prompt, so the prompt is the contract.
|
|
16
|
+
|
|
17
|
+
1. State the artifact each candidate is producing.
|
|
18
|
+
2. Derive the rubric, 3-6 concrete gradeable criteria for what success looks like on *this* task. It is the picker's tool in Phase D. Candidates only see the task.
|
|
19
|
+
3. Pick the runners. Use `role: "arena runners"`: that role is a panel, so one `pstack_subagent` call starts one child per entry in the role file and the result lists every child id with the route it actually got. Read the Subagents section of the `poteto-mode` skill at its absolute resource path first. An entry the file does not name inherits the parent route. An entry whose route does not resolve fails that seat and names the role file; the remaining seats still start and the result records the degradation. Two entries on the same route give you two attempts from one model, not a cross-model arena, and the result says so. Add entries when the arena covers multiple design directions, and repeat one route when the work is generation-bound rather than judgment-sensitive. Start from the level the role line names, raise it for hard work and lower it for routine work by passing `reasoningEffort`; a child that cannot call `set_reasoning_effort` keeps the level you gave it.
|
|
20
|
+
4. Give each candidate its own output location. The child calls `create_worktree({ name })` in its own Session and writes there, or you create the checkouts one at a time first and pass each absolute `path` as that child's `cwd`; `create_worktree` returns the path, branch, pinned commit, and repository root. That isolation covers the working directory and branch only, so ports, credentials, running services, and caches still collide. A scratch directory outside the repository is the fallback when Git isolation is not wanted. This is `principle-separate-before-serializing-shared-state`; read its `SKILL.md` at its absolute resource path.
|
|
21
|
+
|
|
22
|
+
## Phase B: Fan out
|
|
23
|
+
|
|
24
|
+
Start all N subagents in one batch of `pstack_subagent` calls, each with the task, the path to the shared grounding, its own output path, and instructions to produce the artifact and a short rationale naming the alternatives it considered and what it rejected. A child is a managed activation, so there is no background flag and nothing polls: each result arrives as a completion notice. A brief that needs a read-only candidate still has to say so, because the tool enforces no such mode.
|
|
25
|
+
|
|
26
|
+
If a candidate produces no output, proceed with N-1 and note the dropout. To keep a live candidate's local state, such as its checkout, uncommitted edits, or a running process, send it another instruction with `send_message`; that returns an acceptance, not an answer, and the reply still arrives as the child's own completion notice. Otherwise start a fresh child, because a settled child is never silently resumed.
|
|
27
|
+
|
|
28
|
+
## Phase C: Cross-judge
|
|
29
|
+
|
|
30
|
+
After all Phase B candidates complete, choose one entry from `role: "arena cross-judge pool"` with `roleIndex`. That role is a list but is not fanned out: one call starts one judge on the entry you picked. Prefer a route whose provider and model family differ from the parent's, and when you cannot confirm a different family, say plainly that the cross-judge is the same model reviewing itself. Start it with a brief that forbids writes and tells it to check `git status` instead of claiming it wrote nothing. It sees the rubric and the candidates by path label, scores each criterion, and recommends a base with rationale. It runs in parallel with your reading in Phase D. Don't start it while candidates are still writing.
|
|
31
|
+
|
|
32
|
+
## Phase D: Pick a base
|
|
33
|
+
|
|
34
|
+
Read every candidate end to end before picking. Score each against the rubric criterion by criterion, not on holistic feel, and compare with the cross-judge. Agreement on the base confirms the pick. Disagreement means one of you is biased or the rubric was ambiguous. Read both rationales before deciding.
|
|
35
|
+
|
|
36
|
+
Pick the base a future maintainer can extend most easily without breaking invariants. When two feel tied, prefer the cleaner boundary or smaller API, per `principle-laziness-protocol`; read its `SKILL.md` at its absolute resource path.
|
|
37
|
+
|
|
38
|
+
## Phase E: Graft
|
|
39
|
+
|
|
40
|
+
Walk each losing candidate once more for what is worth porting into the base, usually one or two things per candidate, not most of it. Fold each graft in by hand, as `principle-redesign-from-first-principles` requires; read its `SKILL.md` at its absolute resource path, so the result stays coherent under one mental model. Don't paste mechanically.
|
|
41
|
+
|
|
42
|
+
If the candidates converge on one shape, that is strong agreement. Note it and ship the consensus shape. No graft is needed. If they wildly diverge, Phase A was under-specified. Reframe and re-run rather than averaging the divergence.
|
|
43
|
+
|
|
44
|
+
## Phase F: Verify
|
|
45
|
+
|
|
46
|
+
Verify the synthesized artifact like any other output, as `principle-prove-it-works` requires; read its `SKILL.md` at its absolute resource path. If verification finds a problem the arena missed, either Phase A was wrong (re-frame and re-run) or a candidate caught it and you missed the graft (go back to Phase E). Don't paper over it.
|
|
47
|
+
|
|
48
|
+
## Outputs
|
|
49
|
+
|
|
50
|
+
One synthesized artifact, with a short synthesis note alongside naming the base and why, the cross-judge's verdict, each graft with its source candidate, what was rejected and why, any convergence or dropouts, and the verification result.
|