Pedagogical pair coding mode — technical framing before TDD, numbered roadmap, systematic review after each step, re-framing when the user gets lost. Trigger when the user says "let's pair code", "pedagogical mode", "I want to learn by coding", or starts a dev ticket with intention of active learning (understanding each line, not vibe coding). Invoke with `/pair-coding [[ticket]]`. Do not trigger in pure agentic mode where {USER_NAME} delegates entirely.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Pair Coding?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/zoomma1-pair-coding)
---
name: pair-coding
description: Pedagogical pair coding mode — technical framing before TDD, numbered roadmap, systematic review after each step, re-framing when the user gets lost. Trigger when the user says "let's pair code", "pedagogical mode", "I want to learn by coding", or starts a dev ticket with intention of active learning (understanding each line, not vibe coding). Invoke with `/pair-coding [[ticket]]`. Do not trigger in pure agentic mode where {USER_NAME} delegates entirely.
---
# Skill /pair-coding — pedagogical pair coding
Session mode where **{USER_NAME} codes, Claude guides**. No copy-paste-ready code except on explicit request. The goal is for {USER_NAME} to understand every line produced.
---
## Invocation contract
When opening the mode, announce in 2 lines:
> *Pedagogical pair coding mode activated on [[ticket]]. I frame, you code — I don't generate full code unless you ask. Systematic review after each step.*
---
## Step 0 — Framing before code (mandatory)
Before writing a single line, pose and validate **5 technical decisions** with {USER_NAME}:
1. **MVP Scope** — what is strictly necessary for this step? What is out of scope?
2. **Conventions** — routing, naming, response format, server-side error handling
3. **Error strategy** — which HTTP codes, which error cases to handle explicitly vs let propagate
4. **Testing approach** — TDD (test first) or test after? What level of isolation (unit vs integration)?
5. **Response format** — expected JSON shape, success codes, body or no body
**Framing deliverable**: a numbered roadmap (Step 1 → N) that {USER_NAME} validates before starting. Each step = one coherent unit that compiles and tests independently.
*Why: an explicit roadmap lets you cleanly cut at any point and resume without friction 2-3 days later. Validated on [example-project]: 3 clean cuts, 0 friction on resume.*
---
## Format of each roadmap step
Present each step with this structure:
```
**Step N — [step name, scoped to one complete handler]**
What we do: [short description, language-agnostic]
Approach: TDD per handler ([example-project] pattern by default)
a) Write **all the handler's tests at once** (happy path + main error cases) — all red in block
b) Make tests pass **one by one**, in order: structures/types → handler → route wiring if needed
c) Run the full suite and verify all handler tests are green
What you'll learn: [2-3 concrete points]
Pedagogical note: [expected friction to name, ex: "Docker must be ON for this test"]
Fallback: "if you hit X, ask"
```
The *Fallback* is important: it reduces psychological friction to asking for help.
**Why the pattern "all tests red at once, then green per handler"**: {USER_NAME} consistently prefers this rhythm on [example-project] (Rust/Axum). Writing tests one by one fragments the handler's vision — writing the full block first forces designing the contract (DTOs, error codes, signature) before implementation, and passing to green becomes mechanical handler by handler. Pattern validated [example-project]-06 and [example-project]-07. Don't revert to "one test at a time" unless {USER_NAME} explicitly asks (exploratory step, isolated test refacto).
---
## TDD discipline — fixed rules
### Mandatory review after each step
Even if the test is green, **re-read the modified files before moving to the next one**. This is the pattern that pays off the most.
On [example-project], 5 real bugs caught in review:
- Step 2: variable created but unused → false green
- Step 3: wrong method signature (`Docker::connect` vs `docker.ping()`)
- Step 5: variable `project` never defined + `query!` instead of `query_as!`
- Step 9: test URL `/api/project` without final `s`
- Step 10: wrong handler and wrong URL in the 404 test
### 🚨 False greens on error tests (404 / NotFound)
Recurring pattern: a test asserting 404 passes **by accident** because the route doesn't match, not because the handler returns `NotFound`.
**Verification rule**: if you comment/remove the handler, the test must fail. If it still passes, that's a false green.
**Always use a URL that matches the route but with a non-existent id** (ex: `/api/projects/99999`), never a URL that doesn't route at all.
### Signal explicitly red→green
Verify that the test fails before writing production code. If the first run isn't a failure that matches what we expect, the test doesn't measure the right thing.
### `.ok()` on cleanup masks bugs silently
When cleanup uses a calculated formula (ex: `example-project_{project_id}` instead of `example-project_{name}`), `.ok()` eats the "not found" error → cleanup inoperant, orphaned resources. Always verify that the cleanup formula exactly matches the creation logic on the server side.
---
## Re-framing when the user gets lost
### "Compile first, test after"
When {USER_NAME} gets lost in the complexity of a test (DTOs + handler + Router + cleanup all at once): **temporarily drop the test**, just make the production code compile by isolating blockers, then come back to the test once the code is stable. Avoids the spiral of "I don't know where I am anymore".
### 3 design options when a choice is structural
Present **(a) minimal / (b) balanced / (c) robust** with explicit trade-offs. The user decides consciously, not by default.
*Validated step 10 [example-project] (DELETE idempotence): {USER_NAME} decided option (c) in 1 message instead of an open debate.*
### Honest estimate + 3 options when the user wants to continue while tired
If the user says "wiped", "tired", "it's late":
> **(A)** Stop here — clean break, resume without friction tomorrow
> **(B)** One thing only that secures a real risk (~20min) — recommended
> **(C)** Finish everything now — not recommended (+30% duration, false greens likely)
Argue the quality risk of C. Never let {USER_NAME} choose C without hearing the argument.
### Opportunistic refacto "while it's small"
When a move is trivial now (5-10 lines) but costly later, propose the refacto immediately with the argument "clean the kitchen before cooking".
*Validated 2x [example-project]: `AppState → state.rs` (step 4) and test output `→ projects/tests.rs` (step 9, file at 320 lines).*
### "Look at the code" ≠ full review
"Look at the code" / "take a look" = give **1-2 signals to investigate**, not a full review. Full review only if {USER_NAME} explicitly asks for it.
---
## Continuity between sessions
At each clean cut (end of session or fatigue), write a **structured recap**:
```
### Accomplished
### Files modified
### Decisions made
### Next concrete step (numbered)
### Status
```
Serves as a safety net even if context is preserved. Resume in < 1 min even 2-3 days later.
*Validated 2x [example-project]: resume 30/04 on recap 28/04, 01/05 on recap 30/04. Zero friction.*
---
## Catalog of concepts to name in passing
Name these concepts explicitly whenever they appear — the beginner stumbles over them without always knowing how to call them.
**Rust reference (enrich with other stacks as sessions progress):**
| Concept | What to say |
|---|---|
| Constructor vs instance method | `Type::method()` creates, `var.method()` uses |
| `&str` vs `&String` | Prefer `&str` (auto-deref accepts `&String` too) |
| `?` vs `.map(\|_\| ())` | `?` = early return, `.map` = transform the success value |
| `Result::ok()` | Silently throws E — intentional for cleanup, dangerous elsewhere |
| `fetch_optional` + `match` | Mandatory pattern for any endpoint that can return 404 |
| Pattern matching on lib error | `Err(SomeError { status_code: 404, .. }) => ...` — `..` ignores unused fields |
| Destructuring in signature | `State(state): State<AppState>` directly extracts the inner field |
| Rust 2018+ modules | `mod foo;` loads `src/foo.rs` or `src/foo/mod.rs` — combinable with subfolder |
| `Router::clone()` | Cheap (Arc internally) — needed in tests with `oneshot()` |
| `StatusCode` alone as return | axum converts it to a complete response with no body |
---
## Idempotence pattern — destructive operations (REST)
For any handler that modifies external state (DELETE, UPDATE):
- **DELETE must be idempotent**: retry of the same DELETE = same result
- **Docker → DB order on DELETE**: if Docker fails, DB row stays, retry possible
- **"Already deleted" on external dependency = success**, not error
- **Any other error** propagates as 502 (external dependency) or 500 (DB)
*Validated step 10 [example-project] — option (c) idempotence on `delete_project`.*