@zenspc/pi-pstack 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/agents/comment-sicko.md +34 -0
- package/agents/poteto-agent.md +13 -0
- package/extensions/pstack/config.ts +228 -0
- package/extensions/pstack/index.ts +211 -0
- package/package.json +57 -0
- package/skills/architect/SKILL.md +82 -0
- package/skills/architect/references/design-red-flags.md +33 -0
- package/skills/architect/references/rationale-template.md +35 -0
- package/skills/architect/references/runner-prompt.md +20 -0
- package/skills/arena/SKILL.md +70 -0
- package/skills/automate-me/SKILL.md +114 -0
- package/skills/blast-radius/SKILL.md +49 -0
- package/skills/bro/SKILL.md +6 -0
- package/skills/create-verification-skill/SKILL.md +43 -0
- package/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
- package/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
- package/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
- package/skills/figure-it-out/SKILL.md +54 -0
- package/skills/how/SKILL.md +134 -0
- package/skills/how/references/critic-prompt.md +59 -0
- package/skills/how/references/critique-rubric.md +58 -0
- package/skills/how/references/explainer-prompt.md +55 -0
- package/skills/how/references/explorer-prompt.md +52 -0
- package/skills/interrogate/SKILL.md +109 -0
- package/skills/interrogate/references/code-quality-review.md +47 -0
- package/skills/interrogate/references/lead-judgment.md +58 -0
- package/skills/interrogate/references/reviewer-prompt.md +72 -0
- package/skills/interrogate/references/rubric.md +77 -0
- package/skills/maintain-verification-skill/SKILL.md +38 -0
- package/skills/no-comments/SKILL.md +23 -0
- package/skills/poteto-mode/SKILL.md +140 -0
- package/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
- package/skills/poteto-mode/playbooks/autopilot-full.md +13 -0
- package/skills/poteto-mode/playbooks/autopilot-stack.md +31 -0
- package/skills/poteto-mode/playbooks/babysit.md +27 -0
- package/skills/poteto-mode/playbooks/bug-fix.md +17 -0
- package/skills/poteto-mode/playbooks/eval.md +27 -0
- package/skills/poteto-mode/playbooks/feature.md +21 -0
- package/skills/poteto-mode/playbooks/hillclimb.md +21 -0
- package/skills/poteto-mode/playbooks/investigation.md +14 -0
- package/skills/poteto-mode/playbooks/multi-phase-plan.md +3 -0
- package/skills/poteto-mode/playbooks/opening-a-pr.md +35 -0
- package/skills/poteto-mode/playbooks/orchestrate.md +113 -0
- package/skills/poteto-mode/playbooks/pause-safely.md +10 -0
- package/skills/poteto-mode/playbooks/perf-issue.md +24 -0
- package/skills/poteto-mode/playbooks/prototype.md +14 -0
- package/skills/poteto-mode/playbooks/refactoring.md +16 -0
- package/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/skills/poteto-mode/playbooks/session-pickup.md +13 -0
- package/skills/poteto-mode/playbooks/shipping.md +40 -0
- package/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
- package/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/skills/poteto-mode/playbooks/worktree-cleanup.md +14 -0
- package/skills/poteto-mode/references/bugbot-triage.md +142 -0
- package/skills/poteto-mode/references/plan.md +105 -0
- package/skills/poteto-mode/scripts/bootstrap.ts +62 -0
- package/skills/poteto-mode/scripts/bun.lock +67 -0
- package/skills/poteto-mode/scripts/orch/orch.test.ts +634 -0
- package/skills/poteto-mode/scripts/orch/orch.ts +578 -0
- package/skills/poteto-mode/scripts/orch/store.ts +1607 -0
- package/skills/poteto-mode/scripts/package.json +16 -0
- package/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
- package/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
- package/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +118 -0
- package/skills/poteto-mode/scripts/watch-pr/github.test.ts +306 -0
- package/skills/poteto-mode/scripts/watch-pr/github.ts +699 -0
- package/skills/poteto-mode/scripts/watch-pr/policy.test.ts +420 -0
- package/skills/poteto-mode/scripts/watch-pr/policy.ts +832 -0
- package/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
- package/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
- package/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
- package/skills/poteto-mode/scripts/watch-pr/types.ts +401 -0
- package/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
- package/skills/poteto-mode/scripts/worktree-audit.sh +85 -0
- package/skills/principle-boundary-discipline/SKILL.md +33 -0
- package/skills/principle-build-the-lever/SKILL.md +22 -0
- package/skills/principle-encode-lessons-in-structure/SKILL.md +30 -0
- package/skills/principle-exhaust-the-design-space/SKILL.md +20 -0
- package/skills/principle-experience-first/SKILL.md +18 -0
- package/skills/principle-fix-root-causes/SKILL.md +22 -0
- package/skills/principle-foundational-thinking/SKILL.md +20 -0
- package/skills/principle-guard-the-context-window/SKILL.md +16 -0
- package/skills/principle-laziness-protocol/SKILL.md +17 -0
- package/skills/principle-make-operations-idempotent/SKILL.md +23 -0
- package/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +21 -0
- package/skills/principle-minimize-reader-load/SKILL.md +22 -0
- package/skills/principle-model-the-domain/SKILL.md +25 -0
- package/skills/principle-never-block-on-the-human/SKILL.md +22 -0
- package/skills/principle-outcome-oriented-execution/SKILL.md +21 -0
- package/skills/principle-prove-it-works/SKILL.md +32 -0
- package/skills/principle-redesign-from-first-principles/SKILL.md +15 -0
- package/skills/principle-separate-before-serializing-shared-state/SKILL.md +15 -0
- package/skills/principle-sequence-verifiable-units/SKILL.md +21 -0
- package/skills/principle-subtract-before-you-add/SKILL.md +21 -0
- package/skills/principle-type-system-discipline/SKILL.md +30 -0
- package/skills/recall/SKILL.md +40 -0
- package/skills/reflect/SKILL.md +77 -0
- package/skills/reflect/references/divergent-reviewer.md +43 -0
- package/skills/reflect/references/judgment-reviewer.md +42 -0
- package/skills/reflect/references/synthesizer.md +56 -0
- package/skills/reflect/references/tooling-reviewer.md +57 -0
- package/skills/setup-pstack/SKILL.md +28 -0
- package/skills/show-me-your-work/SKILL.md +89 -0
- package/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/skills/show-me-your-work/scripts/log.sh +40 -0
- package/skills/swarm/SKILL.md +45 -0
- package/skills/tdd/SKILL.md +43 -0
- package/skills/teach/SKILL.md +20 -0
- package/skills/technical-writing/SKILL.md +129 -0
- package/skills/typescript-best-practices/SKILL.md +28 -0
- package/skills/typescript-best-practices/references/patterns.md +292 -0
- package/skills/unslop/SKILL.md +80 -0
- package/skills/why/SKILL.md +229 -0
- package/skills/why/references/epistemics.md +144 -0
- package/skills/why/references/investigator-prompt.md +103 -0
- package/skills/why/references/source-playbook.md +17 -0
- package/skills/why/references/sources/code-archaeology.md +88 -0
- package/skills/why/references/sources/databricks.md +70 -0
- package/skills/why/references/sources/datadog.md +99 -0
- package/skills/why/references/sources/incident-postmortem.md +15 -0
- package/skills/why/references/sources/linear.md +48 -0
- package/skills/why/references/sources/notion.md +55 -0
- package/skills/why/references/sources/sentry.md +100 -0
- package/skills/why/references/sources/slack.md +54 -0
- package/skills/why/references/synthesizer-prompt.md +135 -0
|
@@ -0,0 +1,82 @@
|
|
|
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 /skill:architect, 'architect this', 'design this', or non-trivial work where jumping to code would lock in the wrong shape."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Architect
|
|
7
|
+
|
|
8
|
+
Design before implementing. 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. If implementation proves the sketch wrong, throw it out and redesign.
|
|
9
|
+
|
|
10
|
+
## Start
|
|
11
|
+
|
|
12
|
+
Open a todolist with one entry per phase before starting. Autonomous mode without checkpoints needs the list to show phase position and keep phases from silently disappearing.
|
|
13
|
+
|
|
14
|
+
1. Ground
|
|
15
|
+
2. Sketch
|
|
16
|
+
3. Agree
|
|
17
|
+
4. Implement
|
|
18
|
+
5. Scrap
|
|
19
|
+
|
|
20
|
+
## Phase A: Ground the problem
|
|
21
|
+
|
|
22
|
+
Build a real mental model of every system the new code touches. Run the **how** skill over the relevant subsystems. Critique mode if existing structure is the constraint or the design must push back on it.
|
|
23
|
+
|
|
24
|
+
Naming a file isn't grounding. Produce the traced model `how` prescribes. If the design redefines ownership or layering, also run the **why** skill on the existing shape so the rationale becomes a constraint, not a guess.
|
|
25
|
+
|
|
26
|
+
Skip Phase A only when the work is genuinely greenfield with no surrounding system to integrate.
|
|
27
|
+
|
|
28
|
+
## Phase B: Sketch
|
|
29
|
+
|
|
30
|
+
Run the **arena** skill with the design-sketch task and the Phase A grounding artifacts. Pass `references/runner-prompt.md` as each runner's prompt. Each candidate produces a design package shaped per `references/rationale-template.md`: the caller's usage written first, then the type sketch, function signatures, module map, and prose rationale derived from it.
|
|
31
|
+
|
|
32
|
+
Use the configured `architect runners` list when present. Otherwise use the parent model (default `inherit-parent`) and spawn two children for two design directions. To compare models, run `/setup-pstack` and set a list.
|
|
33
|
+
|
|
34
|
+
Design it twice. Require at least two structurally distinct candidates before synthesis, even when the first looks sufficient. This is the **exhaust-the-design-space** principle skill made concrete. Whole-shape alternatives, not point fixes inside one shape.
|
|
35
|
+
|
|
36
|
+
Screen every candidate against [`references/design-red-flags.md`](references/design-red-flags.md) before synthesis. Reject or revise shallow modules, information leakage, temporal decomposition, and pass-through methods.
|
|
37
|
+
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+
Arena returns one synthesized design package. The synthesis decision populates the rationale's "Synthesis decision" section.
|
|
41
|
+
|
|
42
|
+
## Phase C: Agree (opt-in)
|
|
43
|
+
|
|
44
|
+
Default: proceed directly to implementation with the synthesized design. No human checkpoint.
|
|
45
|
+
|
|
46
|
+
Opt in to a checkpoint when the invoker explicitly asks: "/skill:architect with checkpoint," "stop and show me before implementing," or similar. Then surface the synthesized design and pause for sign-off.
|
|
47
|
+
|
|
48
|
+
The synthesis can ship as its own commit either way. That's the "scaffold first" mode of the **foundational-thinking** principle skill; subsequent commits read as filling in bodies against a stable contract. Planned and scoped breakage during fill-in is fine, per the **outcome-oriented-execution** principle skill. For adversarial pressure on the design before implementing, run the **interrogate** skill on the synthesized sketch.
|
|
49
|
+
|
|
50
|
+
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.
|
|
51
|
+
|
|
52
|
+
## Phase D: Implement against the sketch
|
|
53
|
+
|
|
54
|
+
Replace `not implemented` bodies with code, pseudocode with logic. The synthesized sketch is the contract.
|
|
55
|
+
|
|
56
|
+
Deviations from the sketch are signal worth surfacing, 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. Surface it; don't bolt it on.
|
|
57
|
+
|
|
58
|
+
## Phase E: Scrap when the architecture is wrong
|
|
59
|
+
|
|
60
|
+
If implementation keeps producing friction the sketch can't absorb, throw the sketch out. Don't bolt fixes onto a wrong design, per the **redesign-from-first-principles** and **fix-root-causes** principle skills.
|
|
61
|
+
|
|
62
|
+
The signal is a *pattern*, not single instances. Tells:
|
|
63
|
+
|
|
64
|
+
- The same shape of workaround appearing repeatedly across unrelated code.
|
|
65
|
+
- Multiple unrelated edge cases that all need special-case branches.
|
|
66
|
+
- Types that need escape hatches (`any`, casts, optional fields always set in practice) to compile.
|
|
67
|
+
- The "we need a lock" reflex when the sketch said the state wasn't shared.
|
|
68
|
+
- Callers having to know the abstraction's internal rules to use it.
|
|
69
|
+
- Two or more independent Phase D deviations of the same shape across the implementation. Surfacing deviations is Phase D's job; a repeated pattern of them is Phase E's trigger.
|
|
70
|
+
|
|
71
|
+
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. The rewrite signal is repeated friction of the same shape, not single hard cases.
|
|
72
|
+
|
|
73
|
+
When you scrap:
|
|
74
|
+
|
|
75
|
+
1. Re-run the **how** skill over what's been built. The implementation lessons enter the new design as inputs, not vibes.
|
|
76
|
+
2. Redesign as if the new constraints had been day-one assumptions, per redesign-from-first-principles.
|
|
77
|
+
3. Subtract before adding, per the **subtract-before-you-add** principle skill. The new sketch should be smaller than the old one before it grows.
|
|
78
|
+
4. Return to Phase B and re-run arena.
|
|
79
|
+
|
|
80
|
+
## Outputs
|
|
81
|
+
|
|
82
|
+
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,33 @@
|
|
|
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.
|
|
@@ -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 surface; 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 several 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,70 @@
|
|
|
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 /skill:arena, 'arena this', 'throw it in the arena', or when one attempt at a non-trivial artifact would lock in the wrong shape."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Arena
|
|
7
|
+
|
|
8
|
+
Fan out N parallel attempts at the same task. Read every candidate end to end. Pick the strongest as the base. Graft the best ideas from the others into it. Verify the synthesized result.
|
|
9
|
+
|
|
10
|
+
## Start
|
|
11
|
+
|
|
12
|
+
Open a todolist with one entry per phase before launching anything. The arena runs autonomously and the list keeps phases from silently disappearing.
|
|
13
|
+
|
|
14
|
+
1. Frame
|
|
15
|
+
2. Fan out
|
|
16
|
+
3. Cross-judge
|
|
17
|
+
4. Pick
|
|
18
|
+
5. Graft
|
|
19
|
+
6. Verify
|
|
20
|
+
|
|
21
|
+
## Phase A: Frame
|
|
22
|
+
|
|
23
|
+
The N candidates will receive the same prompt, so the prompt is the contract. Get it right before spawning anything.
|
|
24
|
+
|
|
25
|
+
1. State the artifact each candidate is producing.
|
|
26
|
+
2. Derive the rubric. State what success looks like for *this* task, then turn it into 3-6 concrete gradeable criteria. Concrete: `Adds a --dry-run flag that skips writes`. Vague: `code is correct`. The rubric is the picker's tool in Phase D; candidates only see the task.
|
|
27
|
+
3. Pick the runners. Use the configured `arena runners` list from `~/.pi/agent/pstack/models.json` when present. Otherwise spawn one runner on the parent model (default `inherit-parent`). To compare models, run `/setup-pstack` and set a list. Spawn more when the arena covers multiple design directions. Same model N times when the work is generation-bound rather than judgment-sensitive.
|
|
28
|
+
4. Assign output paths. Each candidate writes to its own location (a git worktree where possible, otherwise `/tmp/arena-<slug>/candidate-<n>/`). N candidates writing to the same path is shared mutable state and fails the the **separate-before-serializing-shared-state** principle skill test.
|
|
29
|
+
|
|
30
|
+
## Phase B: Fan out
|
|
31
|
+
|
|
32
|
+
Spawn all N subagents as one parallel fanout, async, each with the task, the path to the shared grounding, its own output path, and instructions to produce both the artifact and a short rationale.
|
|
33
|
+
|
|
34
|
+
The rationale is mandatory. Without it, the parent cannot tell whether a candidate's structure is principled or accidental, which makes Phase E grafting unreliable. Each rationale names the alternatives the candidate considered and what it rejected.
|
|
35
|
+
|
|
36
|
+
If a candidate fails to produce output, proceed with N-1 and note the dropout in the synthesis record.
|
|
37
|
+
|
|
38
|
+
## Phase C: Cross-judge
|
|
39
|
+
|
|
40
|
+
After all Phase B candidates complete, choose one model from the configured `arena cross-judge pool` in `~/.pi/agent/pstack/models.json` when present. Otherwise use the parent model (default `inherit-parent`). When the pool has a real slug, prefer a different model family from the parent's. Spawn one read-only judge subagent (tools: `read, grep, find, ls, bash`) on that model. It sees the rubric and the candidates by path label, scores each criterion, and recommends a base with rationale. It runs in parallel with the parent's reading in Phase D, not with the candidates themselves. Spawning while candidates are still writing means the judge sees partial or empty outputs and reports them as dropouts.
|
|
41
|
+
|
|
42
|
+
## Phase D: Pick a base
|
|
43
|
+
|
|
44
|
+
Read every candidate end to end before picking. Skimming N candidates surfaces only the candidate whose surface looks most familiar.
|
|
45
|
+
|
|
46
|
+
Score each candidate against the rubric criterion by criterion, not on holistic feel. Compare against 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.
|
|
47
|
+
|
|
48
|
+
Pick the base on which candidate a future maintainer can extend most easily without breaking invariants. Prefer the cleaner boundary or smaller surface area when two feel tied, per the Laziness Protocol.
|
|
49
|
+
|
|
50
|
+
Record the pick and the reason in a short synthesis note alongside the base artifact, including the cross-judge's verdict.
|
|
51
|
+
|
|
52
|
+
## Phase E: Graft
|
|
53
|
+
|
|
54
|
+
Walk each losing candidate once more and identify what is worth porting into the base. The signal is usually one or two things per candidate, not most of it.
|
|
55
|
+
|
|
56
|
+
Fold each graft in by hand, per the **redesign-from-first-principles** principle skill. Don't paste mechanically. The result has to remain coherent under one mental model.
|
|
57
|
+
|
|
58
|
+
Record what was grafted, from which candidate, and what was rejected and why. The rejection notes are the highest-signal part of the record. Future readers learn from what you considered and dropped, not just what you kept.
|
|
59
|
+
|
|
60
|
+
When N candidates converge on the same shape, that is a strong agreement signal. Note the convergence in the record and ship the consensus shape. No graft is needed. When N candidates wildly diverge, Phase A was under-specified. Reframe and re-run rather than averaging the divergence.
|
|
61
|
+
|
|
62
|
+
## Phase F: Verify
|
|
63
|
+
|
|
64
|
+
The synthesized artifact has to hold up under the same scrutiny as any other output, per the **prove-it-works** principle skill. The arena does not earn you a pass.
|
|
65
|
+
|
|
66
|
+
If verification surfaces a problem the arena did not catch, either Phase A was wrong (re-frame and re-run) or one candidate caught it and you missed the graft (go back to Phase E). Don't paper over.
|
|
67
|
+
|
|
68
|
+
## Outputs
|
|
69
|
+
|
|
70
|
+
One synthesized artifact. One short synthesis note alongside, naming the base, the grafts (with source candidate), the rejections, the dropouts if any, and the verification result.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: automate-me
|
|
3
|
+
description: "Use for \"automate me\", \"create/update/refresh my -mode skill\", \"turn/capture my preferences or working style into a skill\", or wanting agents to follow how the user works. Drafts or revises a personal -mode skill via authoring-a-skill + unslop, optionally pulling fresh evidence from recent transcripts."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Automate me
|
|
7
|
+
|
|
8
|
+
A guided flow for turning the user's working conventions into a skill agents will follow. The output is one `-mode` skill tailored to them (e.g. `jay-mode`, `priya-mode`).
|
|
9
|
+
|
|
10
|
+
This skill orchestrates three others: an inline mining pass (see step 1), `playbooks/authoring-a-skill.md`, and the **unslop** skill (prose discipline). It sequences them; it doesn't replace them.
|
|
11
|
+
|
|
12
|
+
## Flow
|
|
13
|
+
|
|
14
|
+
### 0. Check for an existing skill
|
|
15
|
+
|
|
16
|
+
Look recursively for `.pi/skills/**/*-mode/SKILL.md` and `~/.pi/agent/skills/*-mode/SKILL.md` matching the user's handle. Mode skills can live in a personal category directory (`.pi/skills/<handle>/`), not only at the top level. If one exists, confirm intent with `ask_user_question` (unless they already said "update my skill" or similar):
|
|
17
|
+
|
|
18
|
+
- Update the existing skill (default for repeat runs)
|
|
19
|
+
- Start fresh (rare; ask why before doing it)
|
|
20
|
+
|
|
21
|
+
Update mode changes the rest of the flow:
|
|
22
|
+
- Step 1 mines only history since the skill was last edited (`git log -1 --format=%cI <path>`).
|
|
23
|
+
- Step 2 asks what's changed or missing, not what to capture from zero.
|
|
24
|
+
- Step 4 edits the existing file in place. Preserve sections the user hasn't contradicted; revise ones with new evidence; add new sections only for genuinely new rules.
|
|
25
|
+
|
|
26
|
+
### 1. Mine their history
|
|
27
|
+
|
|
28
|
+
Locate the active workspace's transcripts before fanning out.
|
|
29
|
+
The active Pi session file is `$PI_SESSION_FILE` (unset for ephemeral `--no-session` runs).
|
|
30
|
+
Use it directly when present.
|
|
31
|
+
To list earlier sessions for this same working directory, list `~/.pi/agent/sessions/--<cwd>--/` where `<cwd>` is the absolute cwd with every `/` replaced by `-` (example: `/home/you/proj` → `--home-you-proj--`).
|
|
32
|
+
Read only files under that directory.
|
|
33
|
+
Never glob `~/.pi/agent/sessions/*.jsonl` and never walk sibling cwd directories.
|
|
34
|
+
That crosses project boundaries and can read unrelated private chats.
|
|
35
|
+
|
|
36
|
+
Survey recent agent conversations within that scope for recurring patterns. Run multiple parallel subagents across slices of history (e.g. last 2-4 weeks, split into 3 slices so each has enough material). Each slice mining subagent reads transcripts from the workspace-scoped path the parent provides, looks for the signals below, and returns a short structured list of patterns it saw with evidence pointers. Default signals worth hunting:
|
|
37
|
+
|
|
38
|
+
- Response preferences (length, tone, format, "dumb it down" corrections)
|
|
39
|
+
- Delegation habits (subagents, models, specialized workflows, parallelism)
|
|
40
|
+
- Verification posture (what "done" means; unit tests vs live repro; reviewers)
|
|
41
|
+
- Code and prose discipline (style, principles cited, lint/format tools)
|
|
42
|
+
- Process conventions (worktrees, commits, PRs, review/merge tooling)
|
|
43
|
+
- Meta preferences (fixing skills mid-task, proposing new ones)
|
|
44
|
+
|
|
45
|
+
Cross-check across slices before elevating a signal. Patterns seen in 2+ slices are high-confidence; lone signals are weak and usually get dropped.
|
|
46
|
+
|
|
47
|
+
### 2. Ask the user directly
|
|
48
|
+
|
|
49
|
+
Mining misses intent that hasn't come up yet. Use the `ask_user_question` tool (structured multi-choice) rather than asking the user to type from scratch. Lower cognitive load, higher hit rate.
|
|
50
|
+
|
|
51
|
+
Shape: one or two questions with 4-6 options each, `allow_multiple: true` for category questions. Start broad ("Which areas matter most?"), then follow up on selected areas with specific options. After the structured rounds, one free-form chat question catches anything the options missed.
|
|
52
|
+
|
|
53
|
+
Don't dump 20 questions. Two structured rounds plus one open question is usually enough.
|
|
54
|
+
|
|
55
|
+
### 3. Cluster findings
|
|
56
|
+
|
|
57
|
+
Group the combined signals into sections. Common ones (use only what applies):
|
|
58
|
+
|
|
59
|
+
- **Response style**: length, tone, format.
|
|
60
|
+
- **Autonomy**: how much to do without asking; MCP tool use.
|
|
61
|
+
- **Understand first**: which skills to reach for when scoping or investigating a change.
|
|
62
|
+
- **Subagents**: default, parallelism, model-to-task, specialized workflows.
|
|
63
|
+
- **Prose / code discipline**: principles, lint tools, style guides.
|
|
64
|
+
- **Review and verify**: repro posture, verification skills, live-testing tools.
|
|
65
|
+
- **Process**: git worktrees, commits, PRs, review/merge tooling.
|
|
66
|
+
- **Skills**: skill-authoring habits, fix-the-skill-first, proposing new skills.
|
|
67
|
+
|
|
68
|
+
The **poteto-mode** skill shows the shape. Read it for granularity. Don't copy its content; the user's rules are not the same as poteto-mode's.
|
|
69
|
+
|
|
70
|
+
### 4. Draft the skill
|
|
71
|
+
|
|
72
|
+
Author the skill following `playbooks/authoring-a-skill.md`. Placement:
|
|
73
|
+
|
|
74
|
+
- Path: preserve an existing mode skill's category. For a new mode, use `.pi/skills/<handle>/<handle>-mode/SKILL.md` when the repo has an established personal category for that handle; otherwise default to `.pi/skills/<handle>-mode/SKILL.md` in the project (or `~/.pi/skills/<handle>-mode/` if the user prefers a personal skill).
|
|
75
|
+
- Handle: the user's first name or chosen identifier.
|
|
76
|
+
- Frontmatter `description`: trigger on their name + `/<handle>-mode` + "work in their style", not on generic keywords like "write code" or "review PR".
|
|
77
|
+
- Frontmatter formatting: follow the Agent Skills standard YAML rules (pi validates `name` and `description`). Keep `description` as one YAML scalar; quote it or use `description: >-` with indented continuation lines when punctuation or wrapping requires it.
|
|
78
|
+
- Keep `description` narrow so the skill triggers on the user's handle and `/<handle>-mode`, not on generic phrases like write code.
|
|
79
|
+
|
|
80
|
+
### 5. Iterate on prose
|
|
81
|
+
|
|
82
|
+
Apply the **unslop** skill and `playbooks/authoring-a-skill.md` to every line. Both apply to any agent-read prose, not just skills.
|
|
83
|
+
|
|
84
|
+
Show the draft to the user and take feedback. Expect multiple iterations. Cut ruthlessly; a mode skill is not a manual.
|
|
85
|
+
|
|
86
|
+
### 6. Land it
|
|
87
|
+
|
|
88
|
+
Work in a worktree off main. Commit and open a PR so the user can review it. Don't push to main directly.
|
|
89
|
+
|
|
90
|
+
## Guardrails
|
|
91
|
+
|
|
92
|
+
- **Don't overfit to one conversation.** A preference stated once and contradicted another time is noise. Require multiple instances before codifying it.
|
|
93
|
+
- **Don't be clever.** Restating other skills' contents, inventing metaphors, or writing "poetic" prose for an agent reader is cost without benefit. Keep it operational.
|
|
94
|
+
- **Reference, don't inline.** Other skills the user relies on should appear as path references, not pasted excerpts. Same for any principle docs they maintain elsewhere.
|
|
95
|
+
- **Keep sections minimal.** Only add a section if the user has a specific, non-default rule there. "Communicate clearly" is not a section. "Short paragraphs. Tables when comparing options. Bullets only when items are genuinely parallel." is.
|
|
96
|
+
- **Name conventions generic.** Use "the user" or "the human" in imperatives, not the author's first name. Others may read or adopt the skill.
|
|
97
|
+
- **Don't force symmetry.** If a user has no process rules worth writing down, skip the Process section entirely. Sparse is fine; bloated is not.
|
|
98
|
+
|
|
99
|
+
## Evaluation
|
|
100
|
+
|
|
101
|
+
A `-mode` skill is subjective output. A test/iterate benchmark loop isn't useful here. Vibe-check with the user: does it read like them? Did it miss anything? Then ship.
|
|
102
|
+
|
|
103
|
+
Run a description-optimization loop only if the skill's trigger accuracy turns out to be a problem in practice.
|
|
104
|
+
|
|
105
|
+
## When not to use
|
|
106
|
+
|
|
107
|
+
- User wants a task-specific skill (not working conventions): `playbooks/authoring-a-skill.md` + **unslop** alone, no mining required.
|
|
108
|
+
- User wants to capture one narrow workflow (e.g. "how I write commit messages"): that's a regular skill, not a mode skill.
|
|
109
|
+
|
|
110
|
+
## Reference files
|
|
111
|
+
|
|
112
|
+
- The **poteto-mode** skill: example of the output shape.
|
|
113
|
+
- The **unslop** skill: prose discipline for every line.
|
|
114
|
+
- `playbooks/authoring-a-skill.md` + **unslop**: skill authoring process and writing guidelines.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blast-radius
|
|
3
|
+
description: "Find what a change could break somewhere else before it ships, beyond the diff, and prove the one fact it's safe because of by running real code instead of writing it up. Use for 'blast radius of X', 'what could this break', or reviewing a small diff you don't trust."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Blast radius
|
|
7
|
+
|
|
8
|
+
Find what a change breaks somewhere else, before it ships. Use for "blast radius of X", "what could this break", or reviewing a small diff you don't trust yet.
|
|
9
|
+
|
|
10
|
+
Companion to `how` and `why`. `how` tells you what the code does. `why` tells you why it's shaped that way. Blast radius tells you what it breaks somewhere else.
|
|
11
|
+
|
|
12
|
+
Listing the callers is not the job. The agent can grep those in a second. The job is the breakage grep won't show you.
|
|
13
|
+
|
|
14
|
+
## Don't trust your own writeup
|
|
15
|
+
|
|
16
|
+
A blast-radius writeup that sounds right is worthless. It reads as convincing whether or not it's true, and that is the trap you are walking into. So don't hand back the writeup. Find the one or two facts the whole thing depends on and prove them by running code. Words are where you start, not what you ship.
|
|
17
|
+
|
|
18
|
+
### How sure are you
|
|
19
|
+
|
|
20
|
+
For each fact the change's safety depends on, get it as far down this list as is cheap, and say where it stopped.
|
|
21
|
+
|
|
22
|
+
1. You said so. Worthless on its own.
|
|
23
|
+
2. You pointed at the line. A real `file:line`, or the library's own source.
|
|
24
|
+
3. You showed the bad case can't happen. You walked the failure step by step and it doesn't reach.
|
|
25
|
+
4. You ran it. A script or test that calls the real code and fails loud if you're wrong.
|
|
26
|
+
5. You reproduced it in the running app.
|
|
27
|
+
|
|
28
|
+
Any safety fact you can't get to step 4, say so out loud. Don't write it up as settled. Step 4 is usually one small script that imports the same library the app ships and calls the exact function you're worried about.
|
|
29
|
+
|
|
30
|
+
## Steps
|
|
31
|
+
|
|
32
|
+
1. Read the change. The diff, the symbols it adds, changes, and deletes, and what it now does differently, including the part the diff doesn't spell out. Use `why` step 2 to pull the PR and commits.
|
|
33
|
+
2. Find the one fact it's safe because of. Most changes that look scary are safe because of a single fact, like "this call only drops already-dead cache entries and does nothing else". Find that fact. If it holds, most of the scary cases die at once. Spend your time here, not on a long list of maybes.
|
|
34
|
+
3. Look where grep stops. Read the source of the library you call, and check its pinned version and any local patch. Work out when things run: microtasks, unmount and teardown, Solid versus React. Follow what a symbol search misses: the JSON an API returns, a DB column, a wire format, another language reading the same bytes, a feature flag, code three hops downstream.
|
|
35
|
+
4. Be honest about each risk. Give it a real chance of happening and a real cost if it does. Keep the risks you confirmed; list the ones you checked and cleared separately. Same rules as `why`. Cite a real `file:line`, a search that finds nothing is still an answer, and never make up a caller or an API.
|
|
36
|
+
5. Prove the one fact. Write a script or test that runs the real code, run it, and paste what happened. If you can't prove it cheaply, mark it unproven. Don't round up.
|
|
37
|
+
6. For a big or wide change, run it as an `arena`. Ask several models the same question and merge the answers. Different models catch different real bugs.
|
|
38
|
+
|
|
39
|
+
## What to hand back
|
|
40
|
+
|
|
41
|
+
- **What it does.** What changed, including the part that isn't obvious.
|
|
42
|
+
- **The one fact it's safe because of.** State it, say which step you got it to, and show the proof. If you couldn't prove it, write unproven.
|
|
43
|
+
- **Risks.** Only the real ones. Each names how it breaks, the `file:line`, how likely and how bad, and how to check. Paste the proof for the ones that matter.
|
|
44
|
+
- **Cleared.** What you checked and why it's fine.
|
|
45
|
+
- **Before you merge.** The cheapest test or repro that catches the real bug, including the script you wrote.
|
|
46
|
+
|
|
47
|
+
Write it through `unslop`, cite real code, and strip anything private before it goes anywhere public.
|
|
48
|
+
|
|
49
|
+
**Reply:** the writeup above, with the one safety fact either proven or marked unproven.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-verification-skill
|
|
3
|
+
description: "Generate a project-local verification skill that drives your app the way a user does — any language, framework, or platform. Use for /skill:create-verification-skill, \"make a control skill for this repo\", or when a project has no scripted way to prove UI/CLI/service behavior."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create a verification skill
|
|
7
|
+
|
|
8
|
+
Every serious project needs a scripted way to drive the real app and prove behavior: launch it, exercise a feature the way a user would, and capture evidence. This skill generates that as a project-local skill (`.pi/skills/verify-<app>/`) tailored to the repo. You write the generator's output for the next agent, not for a human: it will be read cold, mid-task, by an agent that has never seen the app.
|
|
9
|
+
|
|
10
|
+
## 1. Interview the repo, not the user
|
|
11
|
+
|
|
12
|
+
Answer these from the codebase and only ask the user what you cannot observe:
|
|
13
|
+
|
|
14
|
+
- **Surface:** what does a user actually touch? A web UI, a CLI/TUI, a desktop app, an API, a mobile app, a library? A repo can have several; pick the primary one and note the rest.
|
|
15
|
+
- **Run:** how does the app start locally? Prefer the repo's own documented dev command (package scripts, Makefile, README quickstart). Note ports, env vars, seed data, auth.
|
|
16
|
+
- **Drive:** how can an agent interact with it programmatically? Existing harnesses first — Playwright/Cypress specs, expect scripts, PTY helpers, curl-able endpoints, a debug port. Only then pick a generic recipe: browser/CDP for web and Electron, a tmux/PTY harness for CLI/TUI, plain HTTP for services.
|
|
17
|
+
- **Observe:** what evidence can be captured? Screenshots, terminal transcripts, response bodies, logs, exit codes, DB state.
|
|
18
|
+
- **Isolate:** can two instances run side by side (ports, data dirs, profiles)? If not, say so in the generated skill: refusing to double-drive a shared instance beats corrupting the user's session.
|
|
19
|
+
|
|
20
|
+
If the checkout doesn't build or start as-is, fix that first (or report it precisely) before generating; a skill written against a broken base teaches wrong steps. When an irrelevant missing asset blocks startup (a static dir the API never serves, a sample config), the generated skill may create it, clearly marked as verification scaffolding, and remove it in cleanup.
|
|
21
|
+
|
|
22
|
+
## 2. Generate the skill
|
|
23
|
+
|
|
24
|
+
Write `.pi/skills/verify-<app>/SKILL.md` with YAML frontmatter (`name: verify-<app>` and a `description` that names the app, the surface, and when to reach for it — without frontmatter the skill never registers) and these sections, each grounded in what the interview actually found (no placeholders left):
|
|
25
|
+
|
|
26
|
+
- **Launch:** the exact command that starts the app for verification, and how to tell it's ready (a log line, a port answering, a prompt). Include teardown. For a short-lived CLI or TUI there is no server to keep alive: launch means build the binary (or install deps) once, then start each drive in its own isolated PTY or tmux session.
|
|
27
|
+
- **Doctor:** one read-only check that answers "is this instance worth driving?" — process up, right version/build, port owned by us, auth valid. An agent runs this first whenever anything looks off.
|
|
28
|
+
- **Drive:** the harness recipe with real selectors/commands from this repo, not examples. Prefer stable handles (ARIA labels, data attributes, prompt strings, route paths) over coordinates and tab order.
|
|
29
|
+
- **Evidence:** what to capture for a proof and where it goes. State the proof standards: exercise the real user path, not internal setters or test-only endpoints; capture the action and the resulting state, not just the final screen; verify side effects (files written, rows inserted, messages sent) alongside what's visible; mocks only where a production boundary already isolates the external system. When the safe path is a dry-run or test mode, verify what it actually skips by observing (files, network, git refs) rather than trusting its name: some dry-runs still touch the network or open a browser.
|
|
30
|
+
- **Cleanup:** how to tear down instances the run created. Never kill by process name; kill what you started. Cleanup removes instances and scratch state, never the evidence: proof artifacts survive the teardown, in a location the skill names.
|
|
31
|
+
- **Helpers:** any script the skill ships is executable and its invocation is shown in the skill body. A helper the reader has to reverse-engineer is not a helper.
|
|
32
|
+
|
|
33
|
+
## 3. Seed the feature map
|
|
34
|
+
|
|
35
|
+
Create `.pi/skills/verify-<app>/features/README.md` plus one file per user-facing feature you can identify (aim for the top 3-5 to start, from routes, commands, menus, or docs). Follow the shape in [`references/feature-map-example/`](references/feature-map-example/), with a README index and one file per feature. Each file answers, from the user's point of view: what the feature is, how to reach it, how to drive it with the harness, and what observable end state proves it works. The four H2s are `Sub-features`, `How to get to it (user POV)`, `Driving it with <harness>`, and `Gotchas`. The map is the repo's maintained verification source; a proof that drives one convenient entry point is incomplete when the map lists others.
|
|
36
|
+
|
|
37
|
+
## 4. Prove the generated skill before handing it over
|
|
38
|
+
|
|
39
|
+
Run its own instructions end to end once: launch, doctor, drive ONE mapped feature (one is enough; the map exists so later runs can cover the rest), capture evidence, clean up. After cleanup, confirm the evidence still exists at the named location — a cleanup that eats the proof fails this step. Fix what fails, and run the generated cleanup after every failed iteration too, so broken attempts don't strand processes and ports. A generated skill that was never executed is a draft, not a deliverable.
|
|
40
|
+
|
|
41
|
+
## 5. Offer the maintenance loop
|
|
42
|
+
|
|
43
|
+
Point the user at `/skill:maintain-verification-skill` for keeping the map honest as the app changes. Suggest a cadence only if they ask.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Notes verification map
|
|
2
|
+
|
|
3
|
+
This directory is the maintained source for verifying the user-facing behavior of Notes. Read the index before driving the app, then use the matching feature file as the recipe.
|
|
4
|
+
|
|
5
|
+
## Baseline preconditions
|
|
6
|
+
|
|
7
|
+
- Launch Notes at `http://127.0.0.1:4173` with a disposable data directory.
|
|
8
|
+
- Set `NOTES_DATA_DIR=/tmp/notes-verify-$RUN_ID` so concurrent runs do not share state.
|
|
9
|
+
- Seed notes titled `Quarterly plan` and `Grocery list`.
|
|
10
|
+
- Put `control-notes` and the `notes` CLI on `PATH`.
|
|
11
|
+
- Run `control-notes doctor` and require the expected URL, data directory, and build revision.
|
|
12
|
+
- Never drive an instance that was not started by this verification run.
|
|
13
|
+
|
|
14
|
+
## Driving conventions
|
|
15
|
+
|
|
16
|
+
- Start every recipe from the baseline state unless its preconditions say otherwise.
|
|
17
|
+
- Prefer ARIA roles and accessible names over CSS selectors or DOM position.
|
|
18
|
+
- Treat every command as literal. Keep quoted names and flags unchanged.
|
|
19
|
+
- Run browser actions through `control-notes browser`.
|
|
20
|
+
- Run terminal actions through `control-notes cli -- <command>`.
|
|
21
|
+
- Restore seeded data after a mutation. Do not remove proof artifacts during cleanup.
|
|
22
|
+
|
|
23
|
+
## Proof and skip reporting
|
|
24
|
+
|
|
25
|
+
- Capture the user action and the resulting state, not only the final screen.
|
|
26
|
+
- UI proof includes an ARIA snapshot and a screenshot with the app identity visible.
|
|
27
|
+
- CLI proof includes the command, stdout, stderr, and exit code.
|
|
28
|
+
- Mutation proof includes a read-only second view of the stored value.
|
|
29
|
+
- Record the feature ID and entry point used with every artifact.
|
|
30
|
+
- Report an unreachable path with the attempted command and the unmet precondition.
|
|
31
|
+
- Do not report a skipped entry point as verified through a different path.
|
|
32
|
+
|
|
33
|
+
## Feature entry contract
|
|
34
|
+
|
|
35
|
+
Each feature file starts with an H1 title and one paragraph describing the user-visible behavior. It then uses exactly four H2 sections in this order.
|
|
36
|
+
|
|
37
|
+
1. `Sub-features` lists short IDs with one line for each behavior.
|
|
38
|
+
2. `How to get to it (user POV)` lists every user entry point.
|
|
39
|
+
3. `Driving it with <harness>` starts with `Preconditions:` and uses labeled bullets that pair each user action with an exact command and observable result.
|
|
40
|
+
4. `Gotchas` lists traps that can waste or invalidate a verification run.
|
|
41
|
+
|
|
42
|
+
Keep implementation details out of the map. Name only user paths, stable handles, required state, commands, and observable proof.
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- [Create a note](./create-note.md) covers browser and CLI creation, cancellation, persistence, and cleanup.
|
|
47
|
+
- [Search notes](./search.md) covers toolbar, keyboard, and CLI search with matching, empty, and clear states.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Create a note
|
|
2
|
+
|
|
3
|
+
Create note lets a user save a titled note from the browser or CLI, cancel an unfinished draft, and confirm the saved note from a second user-facing view.
|
|
4
|
+
|
|
5
|
+
## Sub-features
|
|
6
|
+
|
|
7
|
+
- `create-open` opens a blank editor from each browser entry point.
|
|
8
|
+
- `create-save` persists a title and body.
|
|
9
|
+
- `create-cancel` discards an unfinished browser draft.
|
|
10
|
+
- `create-cli` creates the same note shape from the terminal.
|
|
11
|
+
|
|
12
|
+
## How to get to it (user POV)
|
|
13
|
+
|
|
14
|
+
- Choose the `New note` button in the browser toolbar.
|
|
15
|
+
- Press `n` in the browser while focus is outside an editable field.
|
|
16
|
+
- Run `notes create --title <title> --body <body>` in a terminal.
|
|
17
|
+
|
|
18
|
+
## Driving it with control-notes
|
|
19
|
+
|
|
20
|
+
Preconditions:
|
|
21
|
+
|
|
22
|
+
- Notes is healthy at `http://127.0.0.1:4173`.
|
|
23
|
+
- No note is titled `Release checklist`.
|
|
24
|
+
- `control-notes doctor` reports the expected URL and disposable data directory.
|
|
25
|
+
|
|
26
|
+
- **Open editor.** Choose `New note`. Run `control-notes browser click --role button --name "New note"`. A form named `Note editor` appears with focus in the `Title` textbox.
|
|
27
|
+
- **Enter content.** Type the title and body. Run `control-notes browser fill --role textbox --name "Title" --value "Release checklist"` and `control-notes browser fill --role textbox --name "Body" --value "Tag and publish"`. The `Save note` button becomes enabled.
|
|
28
|
+
- **Save note.** Choose `Save note`. Run `control-notes browser click --role button --name "Save note"`. A status named `Note saved` appears and the heading reads `Release checklist`.
|
|
29
|
+
- **Confirm persistence.** Return to the note list and reopen the note. Run `control-notes browser click --role link --name "All notes"` and `control-notes browser click --role link --name "Release checklist"`. The editor shows both saved values.
|
|
30
|
+
- **Cancel draft.** Open a new note, enter `Discard me`, and choose `Cancel`. Run `control-notes browser click --role button --name "New note"`, `control-notes browser fill --role textbox --name "Title" --value "Discard me"`, and `control-notes browser click --role button --name "Cancel"`. The note list returns and has no `Discard me` link.
|
|
31
|
+
- **CLI entry.** Create a second note. Run `control-notes cli -- notes create --title "CLI note" --body "Created from terminal" --format json`. Exit code `0` and stdout contain the new note ID and title.
|
|
32
|
+
- **Proof.** Reopen both saved notes from `All notes`. Run `control-notes browser snapshot --aria --path artifacts/create-note/list.aria.txt` and `control-notes browser screenshot --path artifacts/create-note/list.png`. The artifacts show `Release checklist` and `CLI note`.
|
|
33
|
+
|
|
34
|
+
## Gotchas
|
|
35
|
+
|
|
36
|
+
- Pressing `n` while a textbox has focus types the character instead of opening a new editor.
|
|
37
|
+
- Titles are trimmed on save. Assert the rendered title, not the draft input value.
|
|
38
|
+
- A save status alone is insufficient proof. Reopen the note from the list.
|
|
39
|
+
- Remove `Release checklist` and `CLI note` during fixture cleanup, but retain their proof artifacts.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Search notes
|
|
2
|
+
|
|
3
|
+
Search lets a user find notes by title or body text, inspect a matching note, and distinguish no matches from an unavailable search.
|
|
4
|
+
|
|
5
|
+
## Sub-features
|
|
6
|
+
|
|
7
|
+
- `search-open` opens search from each supported browser entry point.
|
|
8
|
+
- `search-match` returns title and body matches without changing note data.
|
|
9
|
+
- `search-open-result` opens a result in the note editor.
|
|
10
|
+
- `search-empty` shows a complete empty state for a query with no matches.
|
|
11
|
+
- `search-clear` removes the query and restores the recent-notes view.
|
|
12
|
+
- `search-cli` returns the same matching notes from the terminal.
|
|
13
|
+
|
|
14
|
+
## How to get to it (user POV)
|
|
15
|
+
|
|
16
|
+
- Choose the `Search` button in the browser toolbar.
|
|
17
|
+
- Press `/` in the browser while focus is outside an editable field.
|
|
18
|
+
- Run `notes search <query>` in a terminal.
|
|
19
|
+
|
|
20
|
+
## Driving it with control-notes
|
|
21
|
+
|
|
22
|
+
Preconditions:
|
|
23
|
+
|
|
24
|
+
- Notes is healthy at `http://127.0.0.1:4173`.
|
|
25
|
+
- The disposable data directory contains `Quarterly plan` with body text `Draft budget`.
|
|
26
|
+
- `control-notes doctor` reports the expected URL and data directory.
|
|
27
|
+
|
|
28
|
+
- **Toolbar entry.** Choose the `Search` button. Run `control-notes browser click --role button --name "Search"`. A dialog named `Search notes` appears with focus in its searchbox.
|
|
29
|
+
- **Keyboard entry.** Close the dialog, focus the page, and press `/`. Run `control-notes browser press --key "/"`. The same dialog appears and the page does not insert a slash.
|
|
30
|
+
- **Title match.** Type `quarterly`. Run `control-notes browser fill --role searchbox --name "Search notes" --value "quarterly"`. The `Search results` list contains `Quarterly plan` and does not contain `Grocery list`.
|
|
31
|
+
- **Body match.** Replace the query with `budget`. Run `control-notes browser fill --role searchbox --name "Search notes" --value "budget"`. The result `Quarterly plan` remains visible with a body-match excerpt.
|
|
32
|
+
- **Open result.** Choose `Quarterly plan`. Run `control-notes browser click --role link --name "Quarterly plan"`. The dialog closes and the editor heading reads `Quarterly plan`.
|
|
33
|
+
- **Empty state.** Reopen search and enter `volcano`. Run `control-notes browser fill --role searchbox --name "Search notes" --value "volcano"`. A status named `No matching notes` appears after search completes.
|
|
34
|
+
- **Clear query.** Choose `Clear search`. Run `control-notes browser click --role button --name "Clear search"`. The searchbox is empty and the `Recent notes` region replaces the result list.
|
|
35
|
+
- **CLI match.** Search from the terminal. Run `control-notes cli -- notes search "quarterly" --format json`. Exit code `0` and stdout contain one object whose title is `Quarterly plan`.
|
|
36
|
+
- **CLI miss.** Search for an absent value. Run `control-notes cli -- notes search "volcano" --format json`. Exit code `0` and stdout are `[]`.
|
|
37
|
+
- **Proof.** Capture the populated result state. Run `control-notes browser snapshot --aria --path artifacts/search/results.aria.txt` and `control-notes browser screenshot --path artifacts/search/results.png`. Both artifacts identify Notes, the query, and `Quarterly plan`.
|
|
38
|
+
|
|
39
|
+
## Gotchas
|
|
40
|
+
|
|
41
|
+
- Pressing `/` while the editor or searchbox has focus inserts text instead of opening search.
|
|
42
|
+
- Results update after a short debounce. Wait for the results list or empty status, not a fixed sleep.
|
|
43
|
+
- Archived notes are excluded unless the user enables `Include archived`.
|
|
44
|
+
- The CLI defaults to human-readable output. Use `--format json` for stable assertions.
|
|
45
|
+
- Opening a result changes browser state. Reopen search before proving another query.
|