Skip to content

Commit 8441dd2

Browse files
committed
feat(skills): absorb Matt Pocock's skills into pb-spec — grilling loop, two-axis review, diagnostics, domain modeling
Tier 1 — High impact merges: - pb-brainstorming: absorb grilling loop (model-invoked reusable engine) and domain-modeling discipline (CONTEXT.md glossary, inline ADR creation, fuzzy language sharpening, cross-reference with code). The grilling loop is now the core engine behind brainstorming — one question at a time, recommended answers, stress-test with scenarios. - pb-requesting-code-review: replace single-subagent review with two-axis parallel review — Standards (repo standards + 12 Fowler smell baseline) and Spec (diff vs originating issue/PRD). Both axes run as parallel subagents so they don't pollute each other's context. - pb-systematic-debugging: absorb diagnosing-bugs — Phase 1 feedback-loop construction (10 techniques: failing test, curl, CLI, headless browser, replay trace, throwaway harness, property/fuzz loop, bisection, differential, HITL script), loop tightening discipline, minimization phase, multi-component instrumentation, data flow tracing. Keeps pb-spec's Phase 4 architecture questioning for 3+ failures. Tier 2 — Moderate impact additions: - pb-plan: add Step 1.6 domain-modeling pre-step (read CONTEXT.md, read ADRs, challenge glossary, sharpen terms, update inline, offer ADRs) and deep-module vocabulary (module, interface, depth, seam, adapter, leverage, locality, deletion test, one-adapter-hypothetical / two-real rule). - pb-build: add handoff document generation at context-compaction points — compact progress into markdown, save to OS temp dir, include suggested skills, redact secrets. - pb-merge-conflicts: new skill — systematic 5-step merge/rebase resolution (see state, find primary sources, resolve hunks, run checks, finish merge). - pb-prototype: new skill — throwaway prototypes with two branches: logic (state machine TUI, pure reducer/machine/functions, one command) and UI (N radically different variants, ?variant= switcher, floating bottom bar). - using-pb-spec: update router table with new/changed skills and descriptions. Source material: mattpocock/skills repo (engineering/ and productivity/ buckets). Selected skills via impact analysis; skipped to-spec, to-tickets, wayfinder, triage, teach, research (overlaps with pb-improve or too niche).
1 parent eb654e2 commit 8441dd2

8 files changed

Lines changed: 547 additions & 219 deletions

File tree

skills/pb-brainstorming/SKILL.md

Lines changed: 98 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: pb-brainstorming
3-
description: You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
3+
description: You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation. Contains the reusable grilling loop and domain-modeling discipline.
44
---
55

66
# Brainstorming Ideas Into Designs
@@ -23,7 +23,7 @@ Every project goes through this process. A todo list, a single-function utility,
2323

2424
You MUST complete these items in order:
2525

26-
1. **Explore project context** — check files, docs, recent commits
26+
1. **Explore project context** — check files, docs, recent commits, and `CONTEXT.md` (if it exists)
2727
2. **Assess scope complexity** — classify as well-understood (quick plan) or complex (standard flow):
2828
- **Well-understood:** clear scope, known constraints, few edge cases, single subsystem, straightforward domain → quick plan path
2929
- **Complex:** ambiguous requirements, multi-system interactions, complex domain logic, unclear boundaries → standard flow
@@ -34,11 +34,39 @@ You MUST complete these items in order:
3434
6. **Spec self-review** — quick inline check for placeholders, contradictions, ambiguity, scope
3535
7. **Transition to implementation** — invoke `pb-plan` to create implementation plan
3636

37+
## The Grilling Loop (Core Engine)
38+
39+
The grilling loop is the reusable engine behind brainstorming. Interview the user relentlessly about every aspect of the plan until shared understanding is reached. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one.
40+
41+
### Grilling Rules
42+
43+
1. **One question at a time.** Asking multiple questions at once is bewildering. Wait for feedback on each question before continuing.
44+
2. **Recommended answers.** For each question, provide your recommended answer with reasoning. Don't just ask — guide.
45+
3. **Look up facts, ask about decisions.** If a *fact* can be found by exploring the codebase, look it up rather than asking. The *decisions*, though, belong to the user — put each one to them and wait.
46+
4. **Don't enact until confirmed.** Do not proceed to implementation until the user confirms shared understanding.
47+
5. **Stress-test with scenarios.** When domain relationships are being discussed, invent concrete scenarios that probe edge cases and force precision about boundaries between concepts.
48+
49+
### Grilling Flow
50+
51+
```
52+
User message received
53+
→ Understand the idea (explore codebase, check CONTEXT.md)
54+
→ Assess scope complexity
55+
→ Grilling loop:
56+
→ Ask one question (with recommended answer)
57+
→ Wait for response
58+
→ Update understanding
59+
→ Repeat until all branches resolved
60+
→ Present design
61+
→ Get approval
62+
→ Transition to pb-plan
63+
```
64+
3765
## The Process
3866

3967
**Understanding the idea:**
4068

41-
- Check out the current project state first (files, docs, recent commits)
69+
- Check out the current project state first (files, docs, recent commits, `CONTEXT.md`)
4270
- Before asking detailed questions, assess scope: if the request describes multiple independent subsystems, flag this immediately. Don't spend questions refining details of a project that needs to be decomposed first.
4371
- If the project is too large for a single spec, help the user decompose into sub-projects. Each sub-project gets its own spec → plan → implementation cycle.
4472
- For appropriately-scoped projects, ask questions one at a time to refine the idea
@@ -77,6 +105,71 @@ You MUST complete these items in order:
77105
- Where existing code has problems that affect the work, include targeted improvements as part of the design.
78106
- Don't propose unrelated refactoring. Stay focused on what serves the current goal.
79107

108+
## Domain Modeling (Inline Discipline)
109+
110+
During brainstorming, actively build and sharpen the project's domain model. This is not a separate phase — it happens inline as decisions crystallize.
111+
112+
### Challenge against the glossary
113+
114+
When the user uses a term that conflicts with the existing language in `CONTEXT.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
115+
116+
### Sharpen fuzzy language
117+
118+
When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."
119+
120+
### Cross-reference with code
121+
122+
When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
123+
124+
### Update CONTEXT.md inline
125+
126+
When a term is resolved, update `CONTEXT.md` right there. Don't batch these up — capture them as they happen.
127+
128+
`CONTEXT.md` format:
129+
130+
```md
131+
# {Context Name}
132+
133+
{One or two sentence description of what this context is and why it exists.}
134+
135+
## Language
136+
137+
**Order**:
138+
{A one or two sentence description of the term}
139+
_Avoid_: Purchase, transaction
140+
141+
**Invoice**:
142+
A request for payment sent to a customer after delivery.
143+
_Avoid_: Bill, payment request
144+
```
145+
146+
Rules:
147+
148+
- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
149+
- **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
150+
- **Only include terms specific to this project's context.** General programming concepts don't belong.
151+
- Create `CONTEXT.md` lazily — only when the first term is resolved.
152+
153+
### Offer ADRs sparingly
154+
155+
Only offer to create an ADR when all three are true:
156+
157+
1. **Hard to reverse** — the cost of changing your mind later is meaningful
158+
2. **Surprising without context** — a future reader will wonder "why did they do it this way?"
159+
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
160+
161+
If any of the three is missing, skip the ADR.
162+
163+
ADR format — lives in `docs/adr/`, sequential numbering (`0001-slug.md`):
164+
165+
```md
166+
# {Short title of the decision}
167+
168+
{1-3 sentences: what's the context, what did we decide, and why.}
169+
```
170+
171+
That's it. An ADR can be a single paragraph. Create the `docs/adr/` directory lazily — only when the first ADR is needed.
172+
80173
## Quick Plan Flow
81174

82175
When scope assessment classifies a feature as well-understood, use this fast-track path instead of the standard multi-step flow. Quick plan generates all artifacts in one pass with minimal questions.
@@ -180,9 +273,11 @@ Please review each section. I'll proceed to the next after your approval.
180273
- **Incremental validation** - Present design, get approval before moving on
181274
- **Speed where it helps, depth where it matters** - Quick plan for well-understood scope, full process for complex features
182275
- **Be flexible** - Go back and clarify when something doesn't make sense
276+
- **Domain model stays current** — Update CONTEXT.md and ADRs inline as decisions land
183277

184278
## Integration with pb-spec
185279

186280
- **Pre-pb-plan:** Use this skill before `/pb-plan` to ensure requirements are clear
187281
- **Pre-pb-build:** Use when requirements are ambiguous and need clarification
188282
- **Standalone:** Use for any design brainstorming need
283+
- **Model-invoked:** Other skills can invoke the grilling loop when they need to walk a decision tree with the user

skills/pb-build/SKILL.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,38 @@ After updating `tasks.md`, **verify the mark actually took effect** before proce
428428
3. **If verification fails** — apply the mark immediately and re-verify.
429429

430430
> **⚠️ Context Reset:** After completing all tasks (or when context grows large), output: "Recommend starting a fresh session. Run `/pb-build <feature-name>` again to continue from where you left off." The progress ledger ensures no completed work is lost.
431+
>
432+
> **Handoff Document:** When recommending a fresh session, generate a handoff document summarizing the current state so the next agent can continue without re-reading the entire conversation. Save to the OS temp directory (`$TMPDIR` or `/tmp`):
433+
>
434+
> ```markdown
435+
> # Handoff: <feature-name>
436+
>
437+
> ## What's done
438+
>
439+
> - Task X.Y: [name] — DONE (commits abc1234..def5678)
440+
> - Task X.Z: [name] — DONE (commits ...)
441+
>
442+
> ## What's next
443+
>
444+
> - Task A.B: [name] — TODO (next in queue)
445+
> - Dependencies: [what it depends on]
446+
>
447+
> ## Key context
448+
>
449+
> - Spec dir: specs/<spec-dir>/
450+
> - Design decisions: [1-2 bullets of non-obvious choices]
451+
> - Watch out for: [any gotchas discovered during build]
452+
>
453+
> ## Suggested skills
454+
>
455+
> - `/pb-build <feature-name>` — to continue from where we left off
456+
> - `/pb-systematic-debugging` — if tasks fail repeatedly
457+
>
458+
> ## Progress ledger
459+
> See specs/<spec-dir>/progress.md for full task-by-task record.
460+
> ```
461+
>
462+
> Redact any secrets or API keys from the handoff document.
431463
432464
### Step 4: Handle Failures (The Recovery Loop with Escalation)
433465

skills/pb-merge-conflicts/SKILL.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: pb-merge-conflicts
3+
description: Use when you need to resolve an in-progress git merge/rebase conflict. Guides systematic resolution preserving both intents where possible.
4+
---
5+
6+
# pb-merge-conflicts
7+
8+
Resolve merge/rebase conflicts systematically. Always resolve; never `--abort`.
9+
10+
## Process
11+
12+
### 1. See the current state
13+
14+
Check git history, and the conflicting files:
15+
16+
```bash
17+
git status
18+
git log --oneline -5
19+
```
20+
21+
Identify whether this is a merge or a rebase, and which files have conflicts.
22+
23+
### 2. Find the primary sources for each conflict
24+
25+
For each conflicting file, understand deeply why each change was made:
26+
27+
- Read the commit messages from both sides
28+
- Check PRs or issue references if available
29+
- Understand the original intent behind each change
30+
31+
### 3. Resolve each hunk
32+
33+
For each conflict marker (`<<<<<<<`, `=======`, `>>>>>>>`):
34+
35+
- Preserve both intents where possible
36+
- Where incompatible, pick the one matching the merge's stated goal and note the trade-off
37+
- Do **not** invent new behaviour
38+
- Always resolve; never `--abort`
39+
40+
### 4. Run automated checks
41+
42+
Discover the project's automated checks and run them — typically typecheck, then tests, then format:
43+
44+
```bash
45+
uv run ruff check
46+
uv run ty check
47+
uv run pytest
48+
```
49+
50+
Fix anything the merge broke.
51+
52+
### 5. Finish the merge/rebase
53+
54+
Stage everything and commit. If rebasing, continue the rebase process until all commits are rebased:
55+
56+
```bash
57+
git add -A
58+
git commit # or git rebase --continue
59+
```
60+
61+
## Red Flags
62+
63+
- `git merge --abort` or `git rebase --abort` without trying to resolve
64+
- Picking one side without understanding the other's intent
65+
- Skipping automated checks after resolving
66+
- Inventing new behavior that neither side intended
67+
68+
## Integration with pb-spec
69+
70+
- **During pb-build:** If a task causes merge conflicts with concurrent work, use this skill
71+
- **Standalone:** Use for any merge/rebase conflict

skills/pb-plan/SKILL.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,31 @@ When abductive refinement reveals missing error paths or prerequisites, add them
166166

167167
Non-compliant requirements are rewritten inline in the ledger before proceeding to design. The clarification log records every rewrite with its reason.
168168

169+
### Step 1.6: Domain Modeling Pre-Step
170+
171+
Before collecting project context, check and update the project's domain model. This grounds all subsequent planning in precise vocabulary.
172+
173+
1. **Read `CONTEXT.md`** (if it exists at project root) — capture the project's canonical domain terms and their definitions. Use this vocabulary throughout the spec.
174+
2. **Read ADRs in `docs/adr/`** (if they exist) — capture existing architectural decisions. Do not re-litigate decided items.
175+
3. **Challenge against the glossary.** As requirements are parsed, check whether the user's terms conflict with `CONTEXT.md`. If "cancellation" means something different in the requirement vs the glossary, flag it.
176+
4. **Sharpen fuzzy language.** When requirements use vague or overloaded terms, propose precise canonical terms. "You're saying 'account' — do you mean the Customer or the User?"
177+
5. **Update `CONTEXT.md` inline.** When a new term is resolved during planning, add it to `CONTEXT.md` right there. Don't batch. Create `CONTEXT.md` lazily if it doesn't exist.
178+
6. **Offer ADRs for hard decisions.** When a planning decision is (a) hard to reverse, (b) surprising without context, and (c) the result of a real trade-off, create an ADR in `docs/adr/` with sequential numbering. Otherwise skip.
179+
180+
**CONTEXT.md format:**
181+
182+
```md
183+
# {Context Name}
184+
185+
{One or two sentence description.}
186+
187+
## Language
188+
189+
**Term**:
190+
{Definition — one or two sentences. What it IS, not what it does.}
191+
_Avoid_: synonym1, synonym2
192+
```
193+
169194
### Step 2: Collect Project Context
170195

171196
Gather context to inform the design. **Always perform live codebase analysis** — do not rely on any static file.
@@ -211,6 +236,16 @@ Subagent rules:
211236
- Reuse existing repo decisions when available; add new decisions only when the requirement creates a genuine gap.
212237
- **Apply the ponytail ladder** when evaluating patterns: prefer stdlib/native solutions over custom implementations. An interface with one implementation is a factory for one product — skip it. A config for a value that never changes is a constant — hardcode it.
213238
- **Performance impact assessment:** For any architectural decision that touches data access, API boundaries, or hot paths, briefly note the expected performance characteristic (e.g., "O(n) queries acceptable for n<100" or "requires lazy loading to avoid N+1"). Do not write full performance specs — just flag the obvious wins and risks.
239+
- **Deep-module vocabulary** (use these terms in architecture sections):
240+
- **Module** — anything with an interface and an implementation (function, class, package). Avoid: component, service.
241+
- **Interface** — everything a caller must know: type signature, invariants, ordering, error modes, config, perf characteristics. Avoid: API (too narrow).
242+
- **Depth** — leverage at the interface: lots of behavior behind a small interface = deep; interface nearly as complex as implementation = shallow.
243+
- **Seam** — where you can alter behavior without editing in that place. Avoid: boundary (overloaded).
244+
- **Adapter** — a concrete thing that satisfies an interface at a seam.
245+
- **Leverage** — what callers get from depth: more capability per unit of interface learned.
246+
- **Locality** — what maintainers get from depth: change, bugs, and verification concentrate in one place.
247+
- **The deletion test:** When evaluating whether a module earns its place, imagine deleting it. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.
248+
- **One adapter = hypothetical seam. Two = real.** Don't introduce a seam unless something actually varies across it.
214249

215250
7. **Audit coding standards and simplification boundaries** — determine which style and maintainability rules the eventual implementation must follow:
216251
- Infer language- and framework-specific standards from `AGENTS.md`, `CLAUDE.md`, and the live codebase. Only apply standards that are relevant to the current repo; do not copy unrelated JavaScript or React rules into Python work.

0 commit comments

Comments
 (0)