@zedtech/zedkit-ai 0.0.0-stage → 0.0.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.
Files changed (95) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +175 -2
  3. package/kit/AGENTS.template.md +96 -0
  4. package/kit/THIRD_PARTY_NOTICES.md +63 -0
  5. package/kit/agents/architect.md +48 -0
  6. package/kit/agents/explorer.md +33 -0
  7. package/kit/agents/improver.md +34 -0
  8. package/kit/agents/plan-challenger.md +50 -0
  9. package/kit/agents/security-reviewer.md +33 -0
  10. package/kit/agents/verifier.md +39 -0
  11. package/kit/commands/challenge.md +5 -0
  12. package/kit/commands/handoff.md +5 -0
  13. package/kit/commands/implement.md +5 -0
  14. package/kit/commands/plan.md +5 -0
  15. package/kit/commands/pr.md +5 -0
  16. package/kit/commands/review.md +5 -0
  17. package/kit/commands/setup-ai.md +5 -0
  18. package/kit/kit.json +47 -0
  19. package/kit/skills/LICENSE-humanlayer-Apache-2.0 +202 -0
  20. package/kit/skills/LICENSE-mattpocock-skills-MIT +21 -0
  21. package/kit/skills/LICENSE-ponytail-MIT +21 -0
  22. package/kit/skills/adversarial-tests/SKILL.md +64 -0
  23. package/kit/skills/challenge/SKILL.md +18 -0
  24. package/kit/skills/code-review/SKILL.md +74 -0
  25. package/kit/skills/code-review/agents/openai.yaml +3 -0
  26. package/kit/skills/codebase-design/DEEPENING.md +37 -0
  27. package/kit/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  28. package/kit/skills/codebase-design/SKILL.md +114 -0
  29. package/kit/skills/codebase-design/agents/openai.yaml +3 -0
  30. package/kit/skills/definition-of-done/SKILL.md +53 -0
  31. package/kit/skills/diagnosing-bugs/SKILL.md +138 -0
  32. package/kit/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  33. package/kit/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
  34. package/kit/skills/domain-modeling/ADR-FORMAT.md +47 -0
  35. package/kit/skills/domain-modeling/GLOSSARY-FORMAT.md +60 -0
  36. package/kit/skills/domain-modeling/SKILL.md +74 -0
  37. package/kit/skills/domain-modeling/agents/openai.yaml +3 -0
  38. package/kit/skills/ground-truth/SKILL.md +50 -0
  39. package/kit/skills/handoff/SKILL.md +16 -0
  40. package/kit/skills/handoff/agents/openai.yaml +5 -0
  41. package/kit/skills/implement/SKILL.md +25 -0
  42. package/kit/skills/implement/agents/openai.yaml +5 -0
  43. package/kit/skills/implement-spec/SKILL.md +42 -0
  44. package/kit/skills/implement-spec/agents/openai.yaml +5 -0
  45. package/kit/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  46. package/kit/skills/improve-codebase-architecture/SKILL.md +71 -0
  47. package/kit/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  48. package/kit/skills/parallel-work/SKILL.md +61 -0
  49. package/kit/skills/persona-review/SKILL.md +38 -0
  50. package/kit/skills/plan/SKILL.md +38 -0
  51. package/kit/skills/ponytail/SKILL.md +53 -0
  52. package/kit/skills/ponytail-audit/SKILL.md +103 -0
  53. package/kit/skills/ponytail-debt/SKILL.md +44 -0
  54. package/kit/skills/ponytail-gain/SKILL.md +52 -0
  55. package/kit/skills/ponytail-help/SKILL.md +76 -0
  56. package/kit/skills/ponytail-review/SKILL.md +119 -0
  57. package/kit/skills/pr/CREDITS.md +3 -0
  58. package/kit/skills/pr/SKILL.md +170 -0
  59. package/kit/skills/pr/agents/openai.yaml +3 -0
  60. package/kit/skills/research/SKILL.md +12 -0
  61. package/kit/skills/research/agents/openai.yaml +3 -0
  62. package/kit/skills/retro/SKILL.md +44 -0
  63. package/kit/skills/retro/agents/openai.yaml +5 -0
  64. package/kit/skills/review/SKILL.md +37 -0
  65. package/kit/skills/rules-upkeep/SKILL.md +55 -0
  66. package/kit/skills/setup-ai/SKILL.md +139 -0
  67. package/kit/skills/setup-matt-pocock-skills/SKILL.md +118 -0
  68. package/kit/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  69. package/kit/skills/setup-matt-pocock-skills/domain.md +51 -0
  70. package/kit/skills/setup-matt-pocock-skills/issue-tracker-github.md +46 -0
  71. package/kit/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  72. package/kit/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  73. package/kit/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  74. package/kit/skills/setup-ts-deep-modules/SKILL.md +102 -0
  75. package/kit/skills/setup-ts-deep-modules/agents/openai.yaml +5 -0
  76. package/kit/skills/setup-ts-deep-modules/dependency-cruiser.config.cjs +95 -0
  77. package/kit/skills/tdd/SKILL.md +38 -0
  78. package/kit/skills/tdd/agents/openai.yaml +3 -0
  79. package/kit/skills/tdd/mocking.md +59 -0
  80. package/kit/skills/tdd/tests.md +77 -0
  81. package/kit/skills/to-spec/SKILL.md +75 -0
  82. package/kit/skills/to-spec/agents/openai.yaml +5 -0
  83. package/kit/skills/to-tickets/SKILL.md +105 -0
  84. package/kit/skills/to-tickets/agents/openai.yaml +5 -0
  85. package/kit/skills/triage/AGENT-BRIEF.md +207 -0
  86. package/kit/skills/triage/OUT-OF-SCOPE.md +105 -0
  87. package/kit/skills/triage/SKILL.md +112 -0
  88. package/kit/skills/triage/agents/openai.yaml +5 -0
  89. package/kit/skills/use-zedkit/SKILL.md +32 -0
  90. package/kit/skills/wayfinder/SKILL.md +128 -0
  91. package/kit/skills/wayfinder/agents/openai.yaml +5 -0
  92. package/kit/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  93. package/kit/skills/writing-for-agents/SKILL.md +81 -0
  94. package/kit/skills/writing-for-agents/agents/openai.yaml +3 -0
  95. package/package.json +48 -3
@@ -0,0 +1,123 @@
1
+ # HTML Report Format
2
+
3
+ The architectural review is rendered as a single self-contained HTML file in the OS temp directory. Tailwind and Mermaid both come from CDNs. Mermaid handles graph-shaped diagrams reliably; hand-built divs and inline SVG handle the more editorial visuals (mass diagrams, cross-sections). Mix the two: don't lean on Mermaid for everything, it'll start to look generic.
4
+
5
+ ## Scaffold
6
+
7
+ ```html
8
+ <!doctype html>
9
+ <html lang="en">
10
+ <head>
11
+ <meta charset="utf-8" />
12
+ <title>Architecture review for {{repo name}}</title>
13
+ <script src="https://cdn.tailwindcss.com"></script>
14
+ <script type="module">
15
+ import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs";
16
+ mermaid.initialize({ startOnLoad: true, theme: "neutral", securityLevel: "loose" });
17
+ </script>
18
+ <style>
19
+ /* small custom layer for things Tailwind doesn't cover cleanly:
20
+ dashed seam lines, hand-drawn-feeling arrow heads, etc. */
21
+ .seam { stroke-dasharray: 4 4; }
22
+ .leak { stroke: #dc2626; }
23
+ .deep { background: linear-gradient(135deg, #0f172a, #1e293b); }
24
+ </style>
25
+ </head>
26
+ <body class="bg-stone-50 text-slate-900 font-sans">
27
+ <main class="max-w-5xl mx-auto px-6 py-12 space-y-12">
28
+ <header>...</header>
29
+ <section id="candidates" class="space-y-10">...</section>
30
+ <section id="top-recommendation">...</section>
31
+ </main>
32
+ </body>
33
+ </html>
34
+ ```
35
+
36
+ ## Header
37
+
38
+ Repo name, date, and a compact legend: solid box = module, dashed line = seam, red arrow = leakage, thick dark box = deep module. No introduction paragraph. Straight into the candidates.
39
+
40
+ ## Candidate card
41
+
42
+ The diagrams carry the weight. Prose is sparse, plain, and uses the glossary terms (from the `/codebase-design` skill) without ceremony.
43
+
44
+ Each candidate is one `<article>`:
45
+
46
+ - **Title**: short, names the deepening (e.g. "Collapse the Order intake pipeline").
47
+ - **Badge row**: recommendation strength (`Strong` = emerald, `Worth exploring` = amber, `Speculative` = slate), plus a tag for the dependency category (`in-process`, `local-substitutable`, `ports & adapters`, `mock`).
48
+ - **Files**: monospaced list, `font-mono text-sm`.
49
+ - **Before / After diagram**: the centrepiece. Two columns, side by side. See patterns below.
50
+ - **Problem**: one sentence. What hurts.
51
+ - **Solution**: one sentence. What changes.
52
+ - **Wins**: bullets, ≤6 words each. e.g. "Tests hit one interface", "Pricing logic stops leaking", "Delete 4 shallow wrappers".
53
+ - **ADR callout** (if applicable): one line in an amber-tinted box.
54
+
55
+ No paragraphs of explanation. If the diagram needs a paragraph to be understood, redraw the diagram.
56
+
57
+ ## Diagram patterns
58
+
59
+ Pick the pattern that fits the candidate. Mix them. Don't make every diagram look the same. Variety is part of the point.
60
+
61
+ ### Mermaid graph (the workhorse for dependencies / call flow)
62
+
63
+ Use a Mermaid `flowchart` or `graph` when the point is "X calls Y calls Z, and look at the mess." Wrap it in a Tailwind-styled card so it doesn't feel parachuted in. Style with classDef to colour leakage edges red and the deep module dark. Sequence diagrams work well for "before: 6 round-trips; after: 1."
64
+
65
+ ```html
66
+ <div class="rounded-lg border border-slate-200 bg-white p-4">
67
+ <pre class="mermaid">
68
+ flowchart LR
69
+ A[OrderHandler] --> B[OrderValidator]
70
+ B --> C[OrderRepo]
71
+ C -.leak.-> D[PricingClient]
72
+ classDef leak stroke:#dc2626,stroke-width:2px;
73
+ class C,D leak
74
+ </pre>
75
+ </div>
76
+ ```
77
+
78
+ ### Hand-built boxes-and-arrows (when Mermaid's layout fights you)
79
+
80
+ Modules as `<div>`s with borders and labels. Arrows as inline SVG `<line>` or `<path>` elements positioned absolutely over a relative container. Reach for this when you want the "after" diagram to feel like one thick-bordered deep module with greyed-out internals, since Mermaid won't render that with the right weight.
81
+
82
+ ### Cross-section (good for layered shallowness)
83
+
84
+ Stack horizontal bands (`h-12 border-l-4`) to show layers a call passes through. Before: 6 thin layers each doing nothing. After: 1 thick band labelled with the consolidated responsibility.
85
+
86
+ ### Mass diagram (good for "interface as wide as implementation")
87
+
88
+ Two rectangles per module: one for interface surface area, one for implementation. Before: interface rectangle is nearly as tall as the implementation rectangle (shallow). After: interface rectangle is short, implementation rectangle is tall (deep).
89
+
90
+ ### Call-graph collapse
91
+
92
+ Before: a tree of function calls rendered as nested boxes. After: the same tree collapsed into one box, with the now-internal calls shown faded inside it.
93
+
94
+ ## Style guidance
95
+
96
+ - Lean editorial, not corporate-dashboard. Generous whitespace. Serif optional for headings (`font-serif` works well with stone/slate).
97
+ - Colour sparingly: one accent (emerald or indigo) plus red for leakage and amber for warnings.
98
+ - Keep diagrams ~320px tall so before/after sits comfortably side by side without scrolling.
99
+ - Use `text-xs uppercase tracking-wider` for module labels inside diagrams, so they read as schematic, not as UI.
100
+ - The only scripts are the Tailwind CDN and the Mermaid ESM import. The report is otherwise static: no app code, no interactivity beyond Mermaid's own rendering.
101
+
102
+ ## Top recommendation section
103
+
104
+ One larger card. Candidate name, one sentence on why, anchor link to its card. That's it.
105
+
106
+ ## Tone
107
+
108
+ Plain English, concise, but the architectural nouns and verbs come straight from the `/codebase-design` skill. Concision is not an excuse to drift.
109
+
110
+ **Use exactly:** module, interface, implementation, depth, deep, shallow, seam, adapter, leverage, locality.
111
+
112
+ **Never substitute:** component, service, unit (for module) · API, signature (for interface) · boundary (for seam) · layer, wrapper (for module, when you mean module).
113
+
114
+ **Phrasings that fit the style:**
115
+
116
+ - "Order intake module is shallow: interface nearly matches the implementation."
117
+ - "Pricing leaks across the seam."
118
+ - "Deepen: one interface, one place to test."
119
+ - "Two adapters justify the seam: HTTP in prod, in-memory in tests."
120
+
121
+ **Wins bullets** name the gain in glossary terms: *"locality: bugs concentrate in one module"*, *"leverage: one interface, N call sites"*, *"interface shrinks; implementation absorbs the wrappers"*. Don't write *"easier to maintain"* or *"cleaner code"*, because those terms aren't in the glossary and don't earn their place.
122
+
123
+ No hedging, no throat-clearing, no "it's worth noting that…". If a sentence could be a bullet, make it a bullet. If a bullet could be cut, cut it. If a term isn't in the `/codebase-design` glossary, reach for one that is before inventing a new one.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: improve-codebase-architecture
3
+ description: Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Improve Codebase Architecture
8
+
9
+ Surface architectural friction and propose **deepening opportunities**: refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
10
+
11
+ This command is _informed_ by the project's domain model and built on a shared design vocabulary:
12
+
13
+ - Call the Skill tool with "codebase-design" for the architecture vocabulary (**module**, **interface**, **depth**, **seam**, **adapter**, **leverage**, **locality**) and its principles (the deletion test, "the interface is the test surface", "one adapter = hypothetical seam, two = real"). Use these terms exactly in every suggestion, and don't drift into "component," "service," "API," or "boundary."
14
+ - The domain language in `GLOSSARY.md` gives names to good seams; ADRs in `docs/adr/` record decisions this command should not re-litigate.
15
+
16
+ ## Process
17
+
18
+ ### 1. Explore
19
+
20
+ **Scope before you scan: YAGNI.** Deepening a module pays off by making future changes to it easier, so put extra weight on the parts of the codebase that have recently changed. Decide *where* to look before you look:
21
+
22
+ - If the user named a direction (a module, a subsystem, a pain point), take it, and skip the inference below.
23
+ - Otherwise, walk back a good stretch of the commit history (`git log --oneline`) to find the codebase's hot spots, the files and areas that keep coming up, and let those paths pull your attention first. If the changes are scattered with no clear hot spot, widen the net.
24
+
25
+ Read the project's domain glossary (`GLOSSARY.md`) and any ADRs in the area you're touching first.
26
+
27
+ Then spawn a sub-agent to walk the codebase. Don't follow rigid heuristics; explore organically and note where you experience friction:
28
+
29
+ - Where does understanding one concept require bouncing between many small modules?
30
+ - Where are modules **shallow**, with an interface nearly as complex as the implementation?
31
+ - Where have pure functions been extracted just for testability, but the real bugs hide in how they're called (no **locality**)?
32
+ - Where do tightly-coupled modules leak across their seams?
33
+ - Which parts of the codebase are untested, or hard to test through their current interface?
34
+
35
+ Apply the **deletion test** to anything you suspect is shallow: would deleting it concentrate complexity, or just move it? A "yes, concentrates" is the signal you want.
36
+
37
+ ### 2. Present candidates as an HTML report
38
+
39
+ Write a self-contained HTML file to the OS temp directory so nothing lands in the repo. Resolve the temp dir from `$TMPDIR`, falling back to `/tmp` (or `%TEMP%` on Windows), and write to `<tmpdir>/architecture-review-<timestamp>.html` so each run gets a fresh file. Open it for the user (`xdg-open <path>` on Linux, `open <path>` on macOS, `start <path>` on Windows) and tell them the absolute path.
40
+
41
+ The report uses **Tailwind via CDN** for layout and styling, and **Mermaid via CDN** for diagrams where a graph/flow/sequence reliably communicates the structure. Mix Mermaid with hand-crafted CSS/SVG visuals: use Mermaid when relationships are graph-shaped (call graphs, dependencies, sequences), and hand-built divs/SVG when you want something more editorial (mass diagrams, cross-sections, collapse animations). Each candidate gets a **before/after visualisation**. Be visual.
42
+
43
+ For each candidate, render a card with:
44
+
45
+ - **Files**: which files/modules are involved
46
+ - **Problem**: why the current architecture is causing friction
47
+ - **Solution**: plain English description of what would change
48
+ - **Benefits**: explained in terms of locality and leverage, and how tests would improve
49
+ - **Before / After diagram**: side-by-side, custom-drawn, illustrating the shallowness and the deepening
50
+ - **Recommendation strength**: one of `Strong`, `Worth exploring`, `Speculative`, rendered as a badge
51
+
52
+ End the report with a **Top recommendation** section: which candidate you'd tackle first and why.
53
+
54
+ **Use GLOSSARY.md vocabulary for the domain, and the `/codebase-design` vocabulary for the architecture.** If `GLOSSARY.md` defines "Order," talk about "the Order intake module," not "the FooBarHandler," and not "the Order service."
55
+
56
+ **ADR conflicts**: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly in the card (e.g. a warning callout: _"contradicts ADR-0007, but worth reopening because…"_). Don't list every theoretical refactor an ADR forbids.
57
+
58
+ See [HTML-REPORT.md](HTML-REPORT.md) for the full HTML scaffold, diagram patterns, and styling guidance.
59
+
60
+ Do NOT propose interfaces yet. After the file is written, ask the user: "Which of these would you like to explore?"
61
+
62
+ ### 3. Grilling loop
63
+
64
+ Once the user picks a candidate, call the Skill tool with "grilling" to walk the decision tree with them: constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive.
65
+
66
+ Side effects happen inline as decisions crystallize; call the Skill tool with "domain-modeling" to keep the domain model current as you go:
67
+
68
+ - **Naming a deepened module after a concept not in `GLOSSARY.md`?** Add the term to `GLOSSARY.md`. Create the file lazily if it doesn't exist.
69
+ - **Sharpening a fuzzy term during the conversation?** Update `GLOSSARY.md` right there.
70
+ - **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _"Want me to record this as an ADR so future architecture reviews don't re-suggest it?"_ Only offer when the reason would actually be needed by a future explorer to avoid re-suggesting the same thing; skip ephemeral reasons ("not worth it right now") and self-evident ones.
71
+ - **Want to explore alternative interfaces for the deepened module?** Call the Skill tool with "codebase-design" and use its design-it-twice parallel sub-agent pattern.
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "Improve Codebase Architecture"
3
+ short_description: "Find and grill architecture improvements"
4
+ policy:
5
+ allow_implicit_invocation: false
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: parallel-work
3
+ description: "Split work across subagents in parallel without losing context or colliding. Use when a task has independent parts: broad codebase exploration, several review lenses, per-package changes, separable implementation tracks. Skip it when the task is small or strictly sequential."
4
+ ---
5
+
6
+ # Parallel work
7
+
8
+ Parallel agents are for **independent** work. Each one starts with an empty context: it knows only what you write in its brief.
9
+
10
+ ## When to fan out
11
+
12
+ Fan out when all hold:
13
+
14
+ - Two or more parts do not need each other's output.
15
+ - Each part is big enough that doing it inline would flood your context or take long.
16
+ - Writers touch disjoint files.
17
+
18
+ Do not fan out for a small task, one file, or a chain where step 2 needs step 1. One agent that understands the whole task beats three that each see a slice.
19
+
20
+ ## Three safe shapes
21
+
22
+ 1. **Explore in parallel.** Read-only agents, one question each ("where is X produced and consumed?", "which tests cover Y?"). Safe by default. Launch them in one batch.
23
+ 2. **Review in parallel.** One agent per lens or per unit (security, tests, YAGNI, requirement fit; or one per PR or package). Same input, independent verdicts. You merge.
24
+ 3. **Implement in parallel.** Only after the shared contract is fixed (types, interfaces, schemas, API shape). Then one track per area with disjoint files.
25
+
26
+ ## Implementation tracks
27
+
28
+ Agree and write down the contract first. Then a table, in the plan:
29
+
30
+ | Track | Does | Starts after | Must not touch | Done when |
31
+ |---|---|---|---|---|
32
+ | A | storage layer + its tests | contract agreed | B, C files | tests T1..T3 green |
33
+ | B | API layer + its tests | contract agreed | A, C files | tests T4..T6 green |
34
+ | C | integration tests | A and B done | production code | T7 green |
35
+
36
+ Sequential by nature: the contract, wiring that needs all pieces, integration tests, anything that edits a shared file.
37
+
38
+ ## The brief
39
+
40
+ A subagent has no memory of this conversation. Every brief states:
41
+
42
+ 1. **Goal** in one sentence, and why it matters.
43
+ 2. **Scope**: files or area it may read, files it may write (or "read-only").
44
+ 3. **Context it needs**: decisions already made, constraints, the contract. Paste them; do not say "as discussed".
45
+ 4. **Deliverable**: the exact output shape. Findings as `file:line`, a diff, a table, a verdict.
46
+ 5. **Stop rule**: what to do when blocked or unsure (report, do not guess).
47
+
48
+ Delegate the question, not the thinking: do not hand off understanding. Say what you already know so it is not rediscovered.
49
+
50
+ ## After they return
51
+
52
+ - Read the reports. A report is a claim: open the cited lines before acting on it (see `ground-truth`).
53
+ - Merge: deduplicate, resolve conflicts between agents, note disagreements.
54
+ - Run the integration check yourself. Parallel parts that each pass can still fail together.
55
+ - If two writers touched the same file, stop and reconcile before continuing.
56
+
57
+ ## Cost and context
58
+
59
+ - Pick the cheapest agent that can do the job: exploration and lookups need less capability than design or release decisions. Pin a model only after listing what the tool offers.
60
+ - Background agents free you to continue; foreground ones block. Use background for long read-only work you do not need right now.
61
+ - More agents is not better. Two or three well-briefed ones usually beat eight.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: persona-review
3
+ description: "Review a deliverable from the point of view of the people who will use or run it, with evidence. Use before shipping an API, feature, doc or tool, when asked for a persona or acceptance review, or to check a change serves its real audience."
4
+ ---
5
+
6
+ # Persona review
7
+
8
+ A change can be correct and still useless to the person it is for. Name the audience, run their real task, report what you observed.
9
+
10
+ ## Steps
11
+
12
+ 1. **Name the recipient** of the deliverable and the task they are trying to do. If the repo's docs do not say, ask.
13
+ 2. **Pick 2 to 4 personas** whose view differs. Common ones:
14
+
15
+ | Persona | Question |
16
+ |---|---|
17
+ | New user | Can I do the task from the README and examples alone? |
18
+ | Integrating developer or coding agent | Are the contract, errors and failure semantics clear without reading the implementation? |
19
+ | Operator or maintainer | Can I see what happened, repair it, and replay it without losing data? |
20
+ | Security reviewer | Can I verify isolation, authorization and secret handling from tests and code? |
21
+ | Business owner | Does it solve the stated problem, and what does it cost to adopt? |
22
+
23
+ 3. **Run the task as each persona.** Follow the real path: copy the quickstart, call the endpoint, read the error, break the input. Do not reason from the diff alone.
24
+ 4. **Back each verdict with evidence**: a command and its output, a test name, a file and line, a screenshot. No evidence, no verdict.
25
+ 5. **Report per persona**: Pass, Pass with a rough edge, or Fail. Name the rough edge and the owner or next step. State honest gaps instead of hiding them.
26
+
27
+ ## In parallel
28
+
29
+ Personas are independent. Give each to a subagent with the brief from `parallel-work` (deliverable, task, how to run it, output shape), then merge. Pair persona review with deterministic tests: personas find what tests do not think of, tests keep it from regressing.
30
+
31
+ ## Output
32
+
33
+ ```
34
+ Persona: <name> — task: <what they try>
35
+ Verdict: Pass | Pass with rough edge | Fail
36
+ Evidence: <command/test/file:line>
37
+ Gap: <what is missing, and next step>
38
+ ```
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: plan
3
+ description: "Single entry point for planning work: verifies the starting facts, writes the spec and tickets at the right size, then challenges the result. Use before implementing anything non-trivial."
4
+ ---
5
+
6
+ One command for "plan this". Research first, write the plan at the right
7
+ size, then attack it before anyone codes.
8
+
9
+ ## 1. Research
10
+
11
+ Apply `ground-truth`: open the code, docs, CI and history the plan will rely
12
+ on; every claimed fact cites its source. Unverified items stay labelled, never
13
+ assumed.
14
+
15
+ ## 2. Write it down
16
+
17
+ Small task: a short spec via `to-spec`. Multi-step work: `to-spec`, then
18
+ `to-tickets` for the ticket list with blocking edges. Work bigger than one
19
+ session: map it with `wayfinder` and resolve the decision tickets first.
20
+
21
+ ## 3. Ladder per planned piece (mandatory)
22
+
23
+ For every file, module, dependency, or script in the plan, add one table
24
+ row with the answers to the 7 ladder questions (`ponytail-review`) and
25
+ the rung chosen. Stop at the first rung that holds.
26
+
27
+ | Piece | 1 Need to exist? | 2 In this codebase? | 3 Standard library? | 4 Native platform feature or a standard tool? | 5 Installed dependency? | 6 One line? | Rung |
28
+ |---|---|---|---|---|---|---|---|
29
+ | `auth/refresh.ts` | yes | no | no | no | no — a token library is overkill | no | 7 |
30
+
31
+ A piece hand-made while rung 3–5 could cover it is rewritten, or justified
32
+ in one line. Rung 7 is the minimum code that works. A plan without this
33
+ table is a draft.
34
+
35
+ ## 4. Challenge
36
+
37
+ Run `challenge` on the finished plan. A plan that has not survived a challenge
38
+ is a draft: fix what it finds, then re-plan only the parts that changed.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: ponytail
3
+ description: >
4
+ Lazy senior dev mode: the smallest change that fully solves the task, and a
5
+ reply a busy human understands in one read. Use on any coding task (writing,
6
+ fixing, refactoring, reviewing, choosing dependencies) and when the user says
7
+ "ponytail", "be lazy", "simplest solution", "yagni", or complains about
8
+ over-engineering or bloat. Levels: lite, full (default), ultra.
9
+ argument-hint: "[lite|full|ultra|off]"
10
+ license: MIT
11
+ ---
12
+
13
+ # Ponytail
14
+
15
+ You are a lazy senior developer. The best code is the code never written. You solve the whole problem with the least new code. End your reply with one or two lines: what you skipped or did not check, and any risk the user must know.
16
+
17
+ Active for the whole session until the user says "stop ponytail" or "normal mode". Switch level: `/ponytail lite|full|ultra`.
18
+
19
+ ## Before you write
20
+
21
+ Read the task and the code it touches. List every place your change must reach: callers, tests, fixtures, config, exports. Check what your change could break for users: data it would destroy or expose, callers that stop working. That is scope. Extra features are not.
22
+
23
+ ## The smallest complete change
24
+
25
+ Take the first option that fully works:
26
+
27
+ 1. Does it need to exist? Skip features, options and flexibility nobody asked for, and name them in one line. A vague request ("build me X") gets the smallest version that does the core job.
28
+ 2. Already in this codebase (a helper, component, service, pattern)? Use it the way the surrounding code does.
29
+ 3. Does the standard library do it? Use it, unless the project has its own.
30
+ 4. Does a native platform feature or a standard tool cover it? A DB constraint beats app code; a CLI generator beats hand-written files. A house component beats a native widget.
31
+ 5. An installed dependency? Use it. Never add a dependency for a few lines.
32
+ 6. Can it be one line a reader gets at a glance? One line.
33
+ 7. Otherwise: the minimum code that works.
34
+
35
+ - Be lazy about the solution, never about the change itself: finish every part the task needs, including the callers, tests and fixtures your change breaks.
36
+ - No abstraction, wrapper, type conversion, option, config, boilerplate or "for later" code nobody asked for. Keep values in the form the platform already gives you. Deletion beats addition. Keep the structure the codebase already has: its layers, interfaces and conventions.
37
+ - The shortest working diff wins, once you know everything it must touch. A one-liner that needs decoding is not short.
38
+ - Comment only the why the code cannot show, in one line.
39
+ - Bug fix: before you edit, grep every caller of the function you touch, then fix the root cause once in the shared code.
40
+ - Code you move or merge keeps its error handling and validation.
41
+ - Between options of equal size, take the one that is correct on edge cases.
42
+ - Lazy code without its check is unfinished: new non-trivial logic (a branch, a loop, a parser, money or security, or a whole new script or app) leaves one small test or an assert-based self-check. Trivial changes need none.
43
+ - A shortcut with a known limit gets a code comment in this form: `shortcut: <the limit>, <when to upgrade>`.
44
+
45
+ Never cut: validation at trust boundaries, error handling that prevents data loss, security, accessibility, the calibration real hardware needs, anything the user asked for.
46
+
47
+ ## Levels
48
+
49
+ | Level | Behavior |
50
+ |-------|----------|
51
+ | **lite** | Build what was asked. Name the smaller option in one line and let the user pick. |
52
+ | **full** | The rules above. Default. |
53
+ | **ultra** | Also question the request: before building, push back on any part the need does not justify. |
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: ponytail-audit
3
+ description: >
4
+ Quality audit of a whole repo: bugs, security holes, what breaks under real
5
+ load, risky code without tests, slow paths, and what to delete, merge or
6
+ split. Ranked, each finding explained in plain English. One-shot report,
7
+ changes nothing. Use for "audit this codebase", "review the whole repo",
8
+ "find bloat", "what can I delete", /ponytail-audit.
9
+ ---
10
+
11
+ Audit the whole repo like the senior developer who just inherited it and
12
+ will be paged when it breaks. Order of importance: correct, safe, holds under
13
+ load, tested, fast, lean. Lean still matters: every extra line must be read,
14
+ tested and fixed later. This is a report the user asked for, so give it in full.
15
+
16
+ ## 1. Map first
17
+
18
+ - Audit what the user names: a folder, a package, or the whole repo.
19
+ Nothing named: the whole repo.
20
+ - Read the README, the deploy and build config, the dependency list, the
21
+ entry points (main, routes, handlers, jobs, CLI commands) and the tests.
22
+ - Find the expected load: one person running a script, or many users and
23
+ processes at once. Judge scale against that, and say which load you assumed.
24
+ - Trace the main flows end to end: where data comes in, what is stored,
25
+ what goes out. Read those paths fully: input from users, money, auth,
26
+ data writes, background jobs, anything shared between processes.
27
+ - Big repo: go deep where a mistake costs the most, not file by file. Say
28
+ which parts you did not read.
29
+
30
+ ## 2. Look for
31
+
32
+ 1. **Bug:** wrong result, crash, missed edge case (empty, zero, last item,
33
+ rounding, time zones), callers that disagree with what a function returns,
34
+ the same rule applied differently in two places.
35
+ 2. **Risk:** security holes (injection, weak randomness, secrets in code,
36
+ missing checks on input from users), data loss (errors swallowed, writes
37
+ in the wrong order, no transaction).
38
+ 3. **Scale:** fine for one user, wrong for many: check-then-write races, the
39
+ same work done by every process, memory or lists that only grow, a query
40
+ per item, O(n^2) on big input, per-process state that must be shared.
41
+ 4. **Missing test:** risky logic (a branch, a parser, money, security, data
42
+ writes) with no test that fails when it breaks. One good test, not coverage.
43
+ 5. **Speed:** big slowdowns are problems. Small wins (work repeated in a hot
44
+ loop) are suggestions; some software counts every millisecond.
45
+ 6. **Lean:** code that should not exist or should be smaller.
46
+ - delete: dead code, unused options, flags and config, speculative features
47
+ - reuse: two helpers doing the same thing (keep one, name the path)
48
+ - stdlib / native: the standard library or platform already does it;
49
+ a dependency doing what a few lines or the platform can do
50
+ - yagni: interface with one implementation, factory with one product,
51
+ wrapper that only passes calls through
52
+ - merge: near-copies that must change together
53
+ - split: one function or class doing several unrelated jobs, so it is
54
+ hard to read or test. Split by job, never by line count, and never into
55
+ helpers that exist only to make a function shorter.
56
+
57
+ ## 3. Check before you report
58
+
59
+ - Every finding needs a concrete case: "this input or situation leads to this
60
+ wrong result". No case, no finding.
61
+ - Before calling code unused, grep the whole tree for it, including tests,
62
+ fixtures, config, and string or dynamic references.
63
+ - A shortcut marked with a `shortcut:` (or older `ponytail:`) comment that names its limit is a
64
+ decision, not a finding, unless the expected load already crosses it.
65
+ - Propose the smallest fix that works. Prefer fixes that delete code. Never
66
+ add layers, frameworks or config the problem does not need.
67
+ - No style taste, no "consider", no vague worries.
68
+
69
+ ## 4. Output
70
+
71
+ Very simple English: short sentences, everyday words. Explain a technical
72
+ term the first time you use it. The reader may never have seen this code.
73
+
74
+ Start with `What this repo does:` in two or three sentences, and the load
75
+ you assumed.
76
+
77
+ Then the findings in three groups, most important first, skip empty groups:
78
+ - **Must fix:** bug, security, data loss, breaks at the expected load.
79
+ - **Should fix:** risky code without a test, real slowness, duplication, a
80
+ function that mixes jobs, code that should not exist.
81
+ - **Nice to have:** small speed-ups, shorter forms.
82
+
83
+ Number findings across all groups, so the user can say "fix 2 and 5". At
84
+ most 20 findings; if you left smaller ones out, say how many.
85
+ Every finding has all four parts, each one or two short sentences:
86
+
87
+ 2. **Orders land on the wrong day** (`billing/close_day.py:L40-52`)
88
+ - **What this is:** At midnight this job closes the day and bills all orders of that day.
89
+ - **Problem:** It takes "today" from the server clock, which runs in UTC. An order placed
90
+ at 00:30 in Berlin is billed on the day before.
91
+ - **Fix:** Compute the day once in the shop's time zone:
92
+ `datetime.now(ZoneInfo("Europe/Berlin")).date()`. One line, nothing else changes.
93
+ - **If we skip it:** Late orders show the wrong date, and accounting fixes them by hand.
94
+
95
+ End with:
96
+ - `Verdict:` one line: healthy, or what to fix first.
97
+ - `Lean: -<N> lines, -<M> dependencies possible.` when lean findings exist.
98
+ - `Not checked:` the parts you did not read or could not run.
99
+
100
+ Nothing found: `What this repo does:`, then `Healthy. Nothing to fix.` and
101
+ one line on what you checked.
102
+
103
+ One-shot report, changes no code.
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: ponytail-debt
3
+ description: >
4
+ List every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report,
5
+ changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the
6
+ shortcuts", /ponytail-debt.
7
+ ---
8
+
9
+ Every deliberate ponytail shortcut is marked with a `shortcut:` comment naming
10
+ its ceiling and upgrade path (older code may say `ponytail:`). This collects them into one ledger so a deferral
11
+ can't quietly become permanent.
12
+
13
+ ## Scan
14
+
15
+ Grep the repo for comment markers, skipping `.git` and everything the
16
+ `.gitignore` files ignore (dependencies, build output, caches, in any stack):
17
+
18
+ `git grep --no-index --exclude-standard -nE '(#|//|/[*]) ?(shortcut|ponytail):'` (add other comment prefixes if your stack uses them)
19
+
20
+ If the user names their own marker word (`/ponytail-debt TODO`), grep for that word instead.
21
+
22
+ Each hit is one ledger row. The comment prefix keeps prose that merely mentions
23
+ the convention out of the ledger. Skip hits that are not a deferral, like a note
24
+ about a keyboard shortcut.
25
+
26
+ ## Output
27
+
28
+ One row per marker, grouped by file:
29
+
30
+ `<file>:<line>, <what was simplified>. ceiling: <the limit named>. upgrade: <the trigger to revisit>.`
31
+
32
+ The convention is `shortcut: <ceiling>, <upgrade path>`, so pull the ceiling
33
+ and the trigger straight from the comment. Want an owner per row too? add
34
+ `git blame -L<line>,<line>`.
35
+
36
+ Flag the rot risk: any marker comment that names no upgrade path or
37
+ trigger gets a `no-trigger` tag, those are the ones that silently rot.
38
+
39
+ End with `<N> markers, <M> with no trigger.` Nothing found: `No shortcut debt. Clean ledger.`
40
+
41
+ ## Boundaries
42
+
43
+ Reads and reports only, changes nothing. To persist it, ask and it writes the
44
+ ledger to a file (e.g. `PONYTAIL-DEBT.md`). One-shot.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: ponytail-gain
3
+ description: >
4
+ Show ponytail's measured savings (code, cost, speed) from the benchmark.
5
+ One-shot display. Use for /ponytail-gain, "what does ponytail save",
6
+ "ponytail impact".
7
+ ---
8
+
9
+ # Ponytail Gain
10
+
11
+ Display this scoreboard when invoked. One-shot: do NOT change mode, write flag
12
+ files, or persist anything.
13
+
14
+ The figures are the published agentic benchmark of Ponytail 5: headless Claude
15
+ Code (Opus 5.5, default effort) on 39 tasks (feature tickets in a real FastAPI +
16
+ React repo, bug fixes, security and privacy cases, small apps), 5 runs each,
17
+ against the same agent without the skill. 18 of the tasks have hidden checks
18
+ for correctness and safety. Each figure is the geometric mean of the per-task
19
+ medians. They are measured, not computed from the current repo.
20
+ Source: `benchmarks/results/2026-10-07-agentic.md` and the README.
21
+
22
+ ## Scoreboard
23
+
24
+ Render plain ASCII bars. The bar length shows ponytail as a share of the
25
+ no-skill baseline; the label carries the exact figure:
26
+
27
+ ```
28
+ ponytail gain benchmark · 39 tasks × 5 runs · Opus 5.5
29
+
30
+ no-skill ████████████████████ 100%
31
+ Lines of code █████████··········· 47% ▼ 53%
32
+ Output tokens ███████████········· 55% ▼ 45%
33
+ Cost ███████████████····· 74% ▼ 26%
34
+ Time ████████████········ 59% ▼ 41%
35
+ Hidden checks passed 97% (no-skill 96%)
36
+ Tests where the logic needs one 98% (no-skill 68%)
37
+
38
+ This repo: /ponytail-debt (shortcuts you deferred)
39
+ /ponytail-audit (what's still cuttable)
40
+ ```
41
+
42
+ ## Honesty boundary
43
+
44
+ These are benchmark averages, not this repo. NEVER print a per-repo savings
45
+ number ("you saved X lines/tokens here"): the unbuilt version was never
46
+ written, so there is no real baseline to subtract from in a live repo. The
47
+ only real per-repo figures come from `/ponytail-debt` (a counted ledger), and
48
+ this card points there instead of inventing one.
49
+
50
+ ## Boundaries
51
+
52
+ One-shot display. Edits nothing, changes no mode.