@mccune1224/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 +142 -0
- package/agents/comment-sicko.md +37 -0
- package/agents/poteto-agent.md +16 -0
- package/docs/guide/01-setup.md +49 -0
- package/docs/guide/02-poteto-mode.md +98 -0
- package/docs/guide/03-understand.md +61 -0
- package/docs/guide/04-design.md +81 -0
- package/docs/guide/05-build-and-clean.md +75 -0
- package/docs/guide/06-verify-and-ship.md +87 -0
- package/docs/guide/07-overnight.md +81 -0
- package/docs/guide/08-principles.md +69 -0
- package/docs/guide/09-make-it-yours.md +67 -0
- package/docs/guide/10-recipes-and-pitfalls.md +94 -0
- package/docs/guide/README.md +30 -0
- package/docs/guide/images/design.jpg +0 -0
- package/docs/guide/images/overnight.jpg +0 -0
- package/docs/guide/images/recipes.jpg +0 -0
- package/docs/guide/images/router.jpg +0 -0
- package/docs/guide/images/understanding.jpg +0 -0
- package/docs/guide/images/verification.jpg +0 -0
- package/extensions/index.ts +358 -0
- package/extensions/settings.test.ts +110 -0
- package/extensions/settings.ts +240 -0
- package/package.json +77 -0
- package/skills/architect/SKILL.md +83 -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 +71 -0
- package/skills/automate-me/SKILL.md +109 -0
- package/skills/blast-radius/SKILL.md +50 -0
- package/skills/bro/SKILL.md +7 -0
- package/skills/control-cli/SKILL.md +109 -0
- package/skills/control-ui/SKILL.md +109 -0
- package/skills/create-skill/SKILL.md +69 -0
- package/skills/create-verification-skill/SKILL.md +44 -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/deslop/SKILL.md +22 -0
- package/skills/figure-it-out/SKILL.md +55 -0
- package/skills/how/SKILL.md +130 -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 +112 -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 +39 -0
- package/skills/no-comments/SKILL.md +24 -0
- package/skills/poteto-mode/SKILL.md +142 -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 +16 -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 +155 -0
- package/skills/poteto-mode/playbooks/opening-a-pr.md +29 -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 +20 -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/scripts/bootstrap.ts +62 -0
- package/skills/poteto-mode/scripts/bun.lock +67 -0
- package/skills/poteto-mode/scripts/check-plan.mjs +186 -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.mjs +178 -0
- package/skills/principle-boundary-discipline/SKILL.md +34 -0
- package/skills/principle-build-the-lever/SKILL.md +23 -0
- package/skills/principle-encode-lessons-in-structure/SKILL.md +31 -0
- package/skills/principle-exhaust-the-design-space/SKILL.md +21 -0
- package/skills/principle-experience-first/SKILL.md +19 -0
- package/skills/principle-fix-root-causes/SKILL.md +23 -0
- package/skills/principle-foundational-thinking/SKILL.md +21 -0
- package/skills/principle-guard-the-context-window/SKILL.md +17 -0
- package/skills/principle-laziness-protocol/SKILL.md +18 -0
- package/skills/principle-make-operations-idempotent/SKILL.md +24 -0
- package/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +22 -0
- package/skills/principle-minimize-reader-load/SKILL.md +23 -0
- package/skills/principle-model-the-domain/SKILL.md +26 -0
- package/skills/principle-never-block-on-the-human/SKILL.md +23 -0
- package/skills/principle-outcome-oriented-execution/SKILL.md +22 -0
- package/skills/principle-prove-it-works/SKILL.md +33 -0
- package/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
- package/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
- package/skills/principle-sequence-verifiable-units/SKILL.md +22 -0
- package/skills/principle-subtract-before-you-add/SKILL.md +22 -0
- package/skills/principle-type-system-discipline/SKILL.md +31 -0
- package/skills/recall/SKILL.md +35 -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 +92 -0
- package/skills/show-me-your-work/SKILL.md +82 -0
- package/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/skills/show-me-your-work/scripts/log.mjs +30 -0
- package/skills/swarm/SKILL.md +46 -0
- package/skills/tdd/SKILL.md +44 -0
- package/skills/teach/SKILL.md +21 -0
- package/skills/technical-writing/SKILL.md +130 -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,109 @@
|
|
|
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 create-skill + unslop, optionally pulling fresh evidence from recent transcripts."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Automate me
|
|
8
|
+
|
|
9
|
+
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`).
|
|
10
|
+
|
|
11
|
+
This skill orchestrates three others: an inline mining pass (see step 1), the `create-skill` skill (authoring, ships with this plugin), and the **unslop** skill (prose discipline). It sequences them; it doesn't replace them.
|
|
12
|
+
|
|
13
|
+
## Flow
|
|
14
|
+
|
|
15
|
+
### 0. Check for an existing skill
|
|
16
|
+
|
|
17
|
+
Look recursively for `*-mode/SKILL.md` matching the user's handle in Pi's skill locations (`~/.pi/agent/skills/`, project `.pi/skills/`). Mode skills can live in a personal category directory (`~/.pi/agent/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):
|
|
18
|
+
|
|
19
|
+
- Update the existing skill (default for repeat runs)
|
|
20
|
+
- Start fresh (rare; ask why before doing it)
|
|
21
|
+
|
|
22
|
+
Update mode changes the rest of the flow:
|
|
23
|
+
- Step 1 mines only history since the skill was last edited (`git log -1 --format=%cI <path>`).
|
|
24
|
+
- Step 2 asks what's changed or missing, not what to capture from zero.
|
|
25
|
+
- 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.
|
|
26
|
+
|
|
27
|
+
### 1. Mine their history
|
|
28
|
+
|
|
29
|
+
Locate the active workspace's sessions before fanning out. Pi stores sessions under `~/.pi/agent/sessions/`, one subdirectory per working directory (cwd path with each `/` replaced by `-`). Use the active cwd's subdir only, ordered by modification time. Don't glob across other working-directory subdirs. That crosses workspaces and reads private sessions from unrelated projects.
|
|
30
|
+
|
|
31
|
+
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:
|
|
32
|
+
|
|
33
|
+
- Response preferences (length, tone, format, "dumb it down" corrections)
|
|
34
|
+
- Delegation habits (subagents, models, specialized workflows, parallelism)
|
|
35
|
+
- Verification posture (what "done" means; unit tests vs live repro; reviewers)
|
|
36
|
+
- Code and prose discipline (style, principles cited, lint/format tools)
|
|
37
|
+
- Process conventions (worktrees, commits, PRs, review/merge tooling)
|
|
38
|
+
- Meta preferences (fixing skills mid-task, proposing new ones)
|
|
39
|
+
|
|
40
|
+
Cross-check across slices before elevating a signal. Patterns seen in 2+ slices are high-confidence; lone signals are weak and usually get dropped.
|
|
41
|
+
|
|
42
|
+
### 2. Ask the user directly
|
|
43
|
+
|
|
44
|
+
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.
|
|
45
|
+
|
|
46
|
+
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.
|
|
47
|
+
|
|
48
|
+
Don't dump 20 questions. Two structured rounds plus one open question is usually enough.
|
|
49
|
+
|
|
50
|
+
### 3. Cluster findings
|
|
51
|
+
|
|
52
|
+
Group the combined signals into sections. Common ones (use only what applies):
|
|
53
|
+
|
|
54
|
+
- **Response style**: length, tone, format.
|
|
55
|
+
- **Autonomy**: how much to do without asking; MCP tool use.
|
|
56
|
+
- **Understand first**: which skills to reach for when scoping or investigating a change.
|
|
57
|
+
- **Subagents**: default, parallelism, model-to-task, specialized workflows.
|
|
58
|
+
- **Prose / code discipline**: principles, lint tools, style guides.
|
|
59
|
+
- **Review and verify**: repro posture, verification skills, live-testing tools.
|
|
60
|
+
- **Process**: git worktrees, commits, PRs, review/merge tooling.
|
|
61
|
+
- **Skills**: skill-authoring habits, fix-the-skill-first, proposing new skills.
|
|
62
|
+
|
|
63
|
+
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.
|
|
64
|
+
|
|
65
|
+
### 4. Draft the skill
|
|
66
|
+
|
|
67
|
+
Use the `create-skill` skill (ships with this plugin) to author the skill. Placement:
|
|
68
|
+
|
|
69
|
+
- Path: preserve an existing mode skill's category. For a new mode, use `~/.pi/agent/skills/<handle>/<handle>-mode/SKILL.md` when there is an established personal category for that handle; otherwise default to `.pi/skills/<handle>-mode/SKILL.md` in the project (or `~/.pi/agent/skills/<handle>-mode/` if the user prefers a personal skill).
|
|
70
|
+
- Handle: the user's first name or chosen identifier.
|
|
71
|
+
- Frontmatter `description`: trigger on their name + `/<handle>-mode` + "work in their style", not on generic keywords like "write code" or "review PR".
|
|
72
|
+
- Frontmatter formatting: follow `create-skill`'s YAML rules. Keep `description` as one YAML scalar; quote it or use `description: >-` with indented continuation lines when punctuation or wrapping requires it.
|
|
73
|
+
- Frontmatter `disable-model-invocation: true` by default. Mode skills are heavy and opinionated; they should only apply when the user explicitly invokes them (by name or slash command), not auto-trigger on description matching. Opt out only if the user explicitly wants their mode to apply on every turn.
|
|
74
|
+
|
|
75
|
+
### 5. Iterate on prose
|
|
76
|
+
|
|
77
|
+
Apply the **unslop** skill and `create-skill`'s writing guidelines to every line. Both apply to any agent-read prose, not just skills.
|
|
78
|
+
|
|
79
|
+
Show the draft to the user and take feedback. Expect multiple iterations. Cut ruthlessly; a mode skill is not a manual.
|
|
80
|
+
|
|
81
|
+
### 6. Land it
|
|
82
|
+
|
|
83
|
+
Work in a worktree off main. Commit and open a PR so the user can review it. Don't push to main directly.
|
|
84
|
+
|
|
85
|
+
## Guardrails
|
|
86
|
+
|
|
87
|
+
- **Don't overfit to one conversation.** A preference stated once and contradicted another time is noise. Require multiple instances before codifying it.
|
|
88
|
+
- **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.
|
|
89
|
+
- **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.
|
|
90
|
+
- **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.
|
|
91
|
+
- **Name conventions generic.** Use "the user" or "the human" in imperatives, not the author's first name. Others may read or adopt the skill.
|
|
92
|
+
- **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.
|
|
93
|
+
|
|
94
|
+
## Evaluation
|
|
95
|
+
|
|
96
|
+
A `-mode` skill is subjective output. A `create-skill`-style test/iterate benchmark loop isn't useful here. Vibe-check with the user: does it read like them? Did it miss anything? Then ship.
|
|
97
|
+
|
|
98
|
+
Run a description-optimization loop only if the skill's trigger accuracy turns out to be a problem in practice.
|
|
99
|
+
|
|
100
|
+
## When not to use
|
|
101
|
+
|
|
102
|
+
- User wants a task-specific skill (not working conventions): `create-skill` alone, no mining required.
|
|
103
|
+
- User wants to capture one narrow workflow (e.g. "how I write commit messages"): that's a regular skill, not a mode skill.
|
|
104
|
+
|
|
105
|
+
## Reference files
|
|
106
|
+
|
|
107
|
+
- The **poteto-mode** skill: example of the output shape.
|
|
108
|
+
- The **unslop** skill: prose discipline for every line.
|
|
109
|
+
- The `create-skill` skill (ships with this plugin): skill authoring process and writing guidelines.
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Blast radius
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
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.
|
|
12
|
+
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
## Don't trust your own writeup
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
|
|
19
|
+
### How sure are you
|
|
20
|
+
|
|
21
|
+
For each fact the change's safety depends on, get it as far down this list as is cheap, and say where it stopped.
|
|
22
|
+
|
|
23
|
+
1. You said so. Worthless on its own.
|
|
24
|
+
2. You pointed at the line. A real `file:line`, or the library's own source.
|
|
25
|
+
3. You showed the bad case can't happen. You walked the failure step by step and it doesn't reach.
|
|
26
|
+
4. You ran it. A script or test that calls the real code and fails loud if you're wrong.
|
|
27
|
+
5. You reproduced it in the running app.
|
|
28
|
+
|
|
29
|
+
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.
|
|
30
|
+
|
|
31
|
+
## Steps
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
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.
|
|
35
|
+
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.
|
|
36
|
+
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.
|
|
37
|
+
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.
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+
## What to hand back
|
|
41
|
+
|
|
42
|
+
- **What it does.** What changed, including the part that isn't obvious.
|
|
43
|
+
- **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.
|
|
44
|
+
- **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.
|
|
45
|
+
- **Cleared.** What you checked and why it's fine.
|
|
46
|
+
- **Before you merge.** The cheapest test or repro that catches the real bug, including the script you wrote.
|
|
47
|
+
|
|
48
|
+
Write it through `unslop`, cite real code, and strip anything private before it goes anywhere public.
|
|
49
|
+
|
|
50
|
+
**Reply:** the writeup above, with the one safety fact either proven or marked unproven.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bro
|
|
3
|
+
description: Restate the last message in plain human language, with no jargon.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Restate your last message. Stop using jargon and speak coherently. State it more simply and concisely, like one human talking to another.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: control-cli
|
|
3
|
+
description: Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services. Use for CLI UX checks, startup regressions, memory leaks, hangs, prompt flows, or terminal demos.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Control CLI
|
|
7
|
+
|
|
8
|
+
Use a repeatable local harness to exercise an interactive CLI instead of poking at it manually. First reuse the repo's own test/demo harness if it exists; otherwise assemble a temporary harness from standard local tools.
|
|
9
|
+
|
|
10
|
+
## What It Is Used For
|
|
11
|
+
|
|
12
|
+
- Reproducing CLI/TUI bugs with deterministic input.
|
|
13
|
+
- Verifying keyboard flows, prompts, interrupts, resize behavior, and terminal layout.
|
|
14
|
+
- Capturing before/after transcripts for bug fixes.
|
|
15
|
+
- Profiling startup time, slow operations, hangs, or memory growth.
|
|
16
|
+
- Recording a short terminal demo when output is easier to show than explain.
|
|
17
|
+
|
|
18
|
+
## Harness Loop
|
|
19
|
+
|
|
20
|
+
1. Identify the command under test and the smallest reproducible workspace.
|
|
21
|
+
2. Discover existing local harnesses: package scripts, e2e tests, demo recorders, expect scripts, or PTY helpers.
|
|
22
|
+
3. If no harness exists, launch the CLI in an isolated terminal session with deterministic env vars.
|
|
23
|
+
4. Capture the current screen before interacting.
|
|
24
|
+
5. Send one action at a time: text, Enter, arrows, Escape, Ctrl-C, resize.
|
|
25
|
+
6. Wait for a concrete screen pattern or prompt before the next action.
|
|
26
|
+
7. Save the transcript and any profile artifacts.
|
|
27
|
+
8. Kill the session cleanly.
|
|
28
|
+
|
|
29
|
+
## Harness Options
|
|
30
|
+
|
|
31
|
+
- Repo-native harness: prefer checked-in scripts because they know the app's startup, env, and prompts.
|
|
32
|
+
- `tmux`: managed sessions, `capture-pane`, `send-keys`, attach/detach.
|
|
33
|
+
- PTY probe: use a short Python, Node, or Expect script when tmux is unavailable.
|
|
34
|
+
- Runtime inspector: use Node or Bun inspector for CPU profiles, heap snapshots, and live evaluation.
|
|
35
|
+
- Terminal recorder: use repo-local demo tools or asciinema-compatible tools when the user asks for a demo.
|
|
36
|
+
|
|
37
|
+
## Minimal tmux Harness
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
SESSION="cli-harness-$(date +%s)"
|
|
41
|
+
tmux new-session -d -s "$SESSION" -- <command-under-test>
|
|
42
|
+
tmux capture-pane -pt "$SESSION"
|
|
43
|
+
tmux send-keys -t "$SESSION" "help" Enter
|
|
44
|
+
tmux capture-pane -pt "$SESSION"
|
|
45
|
+
tmux kill-session -t "$SESSION"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For Node CLIs:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
NODE_OPTIONS="--inspect=127.0.0.1:0" tmux new-session -d -s "$SESSION" -- <node-cli-command>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Read the terminal output to find the inspector URL, then use Chrome DevTools-compatible tooling if profiling is needed.
|
|
55
|
+
|
|
56
|
+
## Minimal PTY Harness
|
|
57
|
+
|
|
58
|
+
Use a PTY script when you need deterministic waits in a repo that does not have tmux or a demo harness. Keep it temporary unless the user asks to add a reusable test.
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
import os
|
|
62
|
+
import pty
|
|
63
|
+
import select
|
|
64
|
+
import subprocess
|
|
65
|
+
import time
|
|
66
|
+
|
|
67
|
+
master_fd, slave_fd = pty.openpty()
|
|
68
|
+
proc = subprocess.Popen(
|
|
69
|
+
["<command>", "<arg>"],
|
|
70
|
+
stdin=slave_fd,
|
|
71
|
+
stdout=slave_fd,
|
|
72
|
+
stderr=slave_fd,
|
|
73
|
+
close_fds=True,
|
|
74
|
+
)
|
|
75
|
+
os.close(slave_fd)
|
|
76
|
+
|
|
77
|
+
deadline = time.time() + 30
|
|
78
|
+
buffer = b""
|
|
79
|
+
while time.time() < deadline:
|
|
80
|
+
ready, _, _ = select.select([master_fd], [], [], 0.25)
|
|
81
|
+
if not ready:
|
|
82
|
+
continue
|
|
83
|
+
chunk = os.read(master_fd, 4096)
|
|
84
|
+
buffer += chunk
|
|
85
|
+
if b"<ready text>" in buffer:
|
|
86
|
+
os.write(master_fd, b"help\n")
|
|
87
|
+
break
|
|
88
|
+
|
|
89
|
+
print(buffer.decode(errors="replace"))
|
|
90
|
+
proc.terminate()
|
|
91
|
+
os.close(master_fd)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
If the CLI needs richer terminal control, use `pty.fork()` or an existing PTY library.
|
|
95
|
+
|
|
96
|
+
## Profiling Recipes
|
|
97
|
+
|
|
98
|
+
- Startup regression: capture baseline and treatment startup timings under the same machine, env, and command.
|
|
99
|
+
- Slow operation: start a CPU profile, perform the operation, stop the profile, and compare top self-time functions.
|
|
100
|
+
- Memory leak: force GC if available, take a heap snapshot, perform the operation repeatedly, force GC again, and take another snapshot.
|
|
101
|
+
- Hang: capture the screen, active handles/resources, and a stack/CPU sample before interrupting.
|
|
102
|
+
|
|
103
|
+
## Guardrails
|
|
104
|
+
|
|
105
|
+
- Prefer deterministic waits over sleeps. If you must sleep, explain why.
|
|
106
|
+
- Do not send credentials or destructive commands into a controlled session.
|
|
107
|
+
- Keep the harness in `/tmp` unless the repo already has a testing/demo harness.
|
|
108
|
+
- Do not hard-code paths from another repository. Adapt commands to the current repo's scripts and runtime.
|
|
109
|
+
- Clean up tmux sessions, temp dirs, inspector processes, and demo artifacts unless the user asks to keep them.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: control-ui
|
|
3
|
+
description: Build or adapt a local browser/CDP harness to drive and inspect a web, IDE, or Electron UI. Use for local UI verification, screenshots, accessibility snapshots, perf profiles, visual diffs, or reproducing UI bugs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Control UI
|
|
7
|
+
|
|
8
|
+
Use local browser automation to verify UI behavior with evidence. First reuse the repo's own Playwright, browser, or Electron harness if it exists; otherwise assemble a temporary local harness around the app's dev server or Chromium debug port.
|
|
9
|
+
|
|
10
|
+
## What It Is Used For
|
|
11
|
+
|
|
12
|
+
- Reproducing UI bugs that depend on real browser focus, keyboard input, scrolling, resizing, or rendering.
|
|
13
|
+
- Verifying visual or accessibility changes with screenshots and snapshots.
|
|
14
|
+
- Checking local web, IDE, or Electron behavior before shipping.
|
|
15
|
+
- Capturing console logs, network logs, CPU profiles, traces, or heap snapshots.
|
|
16
|
+
- Creating before/after evidence for the bundled verification skills (create-verification-skill, maintain-verification-skill).
|
|
17
|
+
|
|
18
|
+
## Setup Pattern
|
|
19
|
+
|
|
20
|
+
1. Start the app locally using the repo's documented dev command.
|
|
21
|
+
2. Discover existing local harnesses: Playwright tests, Cypress specs, Storybook, browser scripts, Electron launch scripts, or snapshot tools.
|
|
22
|
+
3. For a web app, connect to the local URL with the existing browser tooling.
|
|
23
|
+
4. For Electron/Chromium, enable a remote debugging port when supported.
|
|
24
|
+
5. Select the correct page by stable app markers, not by tab order alone.
|
|
25
|
+
6. Prefer accessibility roles, labels, and stable `data-*` selectors over coordinates.
|
|
26
|
+
|
|
27
|
+
## Generic Web Harness
|
|
28
|
+
|
|
29
|
+
Use the repo's installed browser tooling when possible. If the repo already has Playwright, a minimal one-off probe looks like:
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
import { chromium } from "playwright";
|
|
33
|
+
|
|
34
|
+
const browser = await chromium.launch();
|
|
35
|
+
const page = await browser.newPage({ viewport: { width: 1280, height: 800 } });
|
|
36
|
+
await page.goto("http://127.0.0.1:<port>");
|
|
37
|
+
await page.getByRole("button", { name: /submit/i }).click();
|
|
38
|
+
await page.screenshot({ path: "/tmp/ui-harness-after.png", fullPage: true });
|
|
39
|
+
await browser.close();
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Do not add Playwright as a project dependency just for this probe unless the user asks. Prefer existing dev dependencies or external browser tools already available in the environment.
|
|
43
|
+
|
|
44
|
+
## Generic CDP Harness
|
|
45
|
+
|
|
46
|
+
For Electron or a Chromium app launched with `--remote-debugging-port=<port>`, connect over CDP:
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
import { chromium } from "playwright";
|
|
50
|
+
|
|
51
|
+
const browser = await chromium.connectOverCDP("http://127.0.0.1:<debug-port>");
|
|
52
|
+
const pages = browser.contexts().flatMap((context) => context.pages());
|
|
53
|
+
let page;
|
|
54
|
+
for (const candidate of pages) {
|
|
55
|
+
if (await candidate.locator("<app-root-selector>").count()) {
|
|
56
|
+
page = candidate;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!page) {
|
|
62
|
+
console.log(await Promise.all(pages.map(async (p) => ({
|
|
63
|
+
title: await p.title(),
|
|
64
|
+
url: p.url(),
|
|
65
|
+
}))));
|
|
66
|
+
throw new Error("No matching app page found");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
await page.screenshot({ path: "/tmp/ui-harness-cdp.png", fullPage: true });
|
|
70
|
+
await browser.close();
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Replace `<app-root-selector>` with a stable marker from the current repo, such as a root app node, landmark, or product-specific `data-*` attribute.
|
|
74
|
+
|
|
75
|
+
## Interaction Loop
|
|
76
|
+
|
|
77
|
+
1. Capture a page snapshot or screenshot before acting.
|
|
78
|
+
2. Choose a target from the latest page structure.
|
|
79
|
+
3. Perform exactly one structural action: click, type, keypress, drag, scroll, navigate, or resize.
|
|
80
|
+
4. Capture a fresh snapshot/screenshot.
|
|
81
|
+
5. Verify the expected state change.
|
|
82
|
+
6. Save artifacts for before/after comparisons when the user asked for proof.
|
|
83
|
+
|
|
84
|
+
## CDP Capabilities
|
|
85
|
+
|
|
86
|
+
Use raw CDP only when higher-level browser APIs are insufficient:
|
|
87
|
+
|
|
88
|
+
- Performance: CPU profiles, traces, paint flashing, FPS meter, layout shift inspection.
|
|
89
|
+
- Memory: heap snapshots and forced GC for leak investigations.
|
|
90
|
+
- Network: request blocking, throttling, cache disablement, request/response logs.
|
|
91
|
+
- Rendering: viewport changes, color scheme emulation, reduced motion, accessibility checks.
|
|
92
|
+
- Debugging: console streaming, exception capture, DOM snapshots.
|
|
93
|
+
|
|
94
|
+
## Page Selection
|
|
95
|
+
|
|
96
|
+
When multiple app windows/tabs share a debug port:
|
|
97
|
+
|
|
98
|
+
- Prefer a positive marker for the surface under test, such as an app root selector.
|
|
99
|
+
- Use a negative marker to avoid the wrong surface when necessary.
|
|
100
|
+
- If no page matches, list available page titles and URLs instead of guessing.
|
|
101
|
+
|
|
102
|
+
## Guardrails
|
|
103
|
+
|
|
104
|
+
- Do not rely on stale element references after navigation or structural changes.
|
|
105
|
+
- Avoid coordinate clicks unless a fresh screenshot was captured immediately before the click.
|
|
106
|
+
- Keep test data local and disposable.
|
|
107
|
+
- Do not store screenshots or heap snapshots from privacy-sensitive workspaces unless the user explicitly agrees.
|
|
108
|
+
- Do not hard-code selectors, ports, or script paths from another repository. Discover the current repo's local app markers.
|
|
109
|
+
- Clean up dev servers, debug sessions, and temp profiles when done.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-skill
|
|
3
|
+
description: Author or edit a SKILL.md for an agent skill. Use before writing or modifying any SKILL.md file.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create skill
|
|
7
|
+
|
|
8
|
+
Write agent skills the agent can actually follow. This page covers the SKILL.md contract, structure, and prose rules. Follow it before authoring or editing any SKILL.md.
|
|
9
|
+
|
|
10
|
+
## Frontmatter
|
|
11
|
+
|
|
12
|
+
SKILL.md starts with YAML frontmatter. Two fields are required.
|
|
13
|
+
|
|
14
|
+
| Field | Rule |
|
|
15
|
+
|---|---|
|
|
16
|
+
| `name` | Lowercase letters, numbers, hyphens. 1-64 characters. Prefer a name that matches the parent directory. |
|
|
17
|
+
| `description` | What the skill does and when to use it. Be specific. Under 1024 characters. This is the only part the agent sees up front, so make it load-bearing. |
|
|
18
|
+
|
|
19
|
+
Pi honors two optional fields. `disable-model-invocation: true` hides the skill from the system prompt; only `/skill:name` invokes it. `mode: true` makes the skill a sticky mode that stays on across turns.
|
|
20
|
+
|
|
21
|
+
## Structure
|
|
22
|
+
|
|
23
|
+
A skill is a directory with a SKILL.md file. Everything else is freeform.
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
my-skill/
|
|
27
|
+
├── SKILL.md
|
|
28
|
+
├── scripts/
|
|
29
|
+
│ └── run.sh
|
|
30
|
+
└── references/
|
|
31
|
+
└── details.md
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Reference files with relative paths from the skill directory. Load detailed material on demand instead of inlining it. The agent sees only the description until it reads the file.
|
|
35
|
+
|
|
36
|
+
## Progressive disclosure
|
|
37
|
+
|
|
38
|
+
The description is always in context. The rest of the SKILL.md loads on demand. Keep the first page load-bearing. Put step-by-step workflows in the SKILL.md body and depth in the references.
|
|
39
|
+
|
|
40
|
+
## Prose rules
|
|
41
|
+
|
|
42
|
+
- Write concise Simplified Technical English. Short declarative sentences.
|
|
43
|
+
- Imperative mood. Tell the agent what to do.
|
|
44
|
+
- Example first, explanation second. A runnable snippet beats a paragraph.
|
|
45
|
+
- No AI tells or filler. No "delve", "leverage", "comprehensive".
|
|
46
|
+
- No narrating comments in script examples. The assertion or command output is the doc.
|
|
47
|
+
- One name per concept. One spelling per concept across the skill.
|
|
48
|
+
|
|
49
|
+
## Example
|
|
50
|
+
|
|
51
|
+
~~~markdown
|
|
52
|
+
---
|
|
53
|
+
name: pdf-merge
|
|
54
|
+
description: Merge multiple PDFs in order. Use when the user asks to combine PDF files.
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
# PDF merge
|
|
58
|
+
|
|
59
|
+
Merge PDFs with the system `pdfunite` tool.
|
|
60
|
+
|
|
61
|
+
pdfunite a.pdf b.pdf out.pdf
|
|
62
|
+
|
|
63
|
+
Verify the output page count matches the sum of the inputs.
|
|
64
|
+
~~~
|
|
65
|
+
|
|
66
|
+
## References
|
|
67
|
+
|
|
68
|
+
- Agent Skills specification: https://agentskills.io/specification
|
|
69
|
+
- Pi skills documentation: docs/skills.md in the pi-coding-agent package
|
|
@@ -0,0 +1,44 @@
|
|
|
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 /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
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Create a verification skill
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
## 1. Interview the repo, not the user
|
|
12
|
+
|
|
13
|
+
Answer these from the codebase and only ask the user what you cannot observe:
|
|
14
|
+
|
|
15
|
+
- **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.
|
|
16
|
+
- **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.
|
|
17
|
+
- **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.
|
|
18
|
+
- **Observe:** what evidence can be captured? Screenshots, terminal transcripts, response bodies, logs, exit codes, DB state.
|
|
19
|
+
- **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.
|
|
20
|
+
|
|
21
|
+
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.
|
|
22
|
+
|
|
23
|
+
## 2. Generate the skill
|
|
24
|
+
|
|
25
|
+
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):
|
|
26
|
+
|
|
27
|
+
- **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.
|
|
28
|
+
- **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.
|
|
29
|
+
- **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.
|
|
30
|
+
- **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.
|
|
31
|
+
- **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.
|
|
32
|
+
- **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.
|
|
33
|
+
|
|
34
|
+
## 3. Seed the feature map
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
## 4. Prove the generated skill before handing it over
|
|
39
|
+
|
|
40
|
+
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.
|
|
41
|
+
|
|
42
|
+
## 5. Offer the maintenance loop
|
|
43
|
+
|
|
44
|
+
Point the user at `/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.
|