Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save TheSylvester/29c9f9defad320e6d51f971274f9bf71 to your computer and use it in GitHub Desktop.

Select an option

Save TheSylvester/29c9f9defad320e6d51f971274f9bf71 to your computer and use it in GitHub Desktop.
Your exploration session is the worst one to implement the solution. A field guide that fixes this with fresh context execution. Custom commands included.

Claude Code: A Practical Field Guide

Your exploration session is the worst one to implement the solution.

You've spent an hour exploring a codebase with Claude. You ask it to implement the fix—and it repeats mistakes, forgets what you discussed, or gets confused. LLMs anchor to their own outputs, repeat errors, and degrade at 20% context fill.

The fix: explore in one session, execute in a fresh one.

-- DISCOVER --
You:     "Explore src/api/client.ts. What retry patterns exist?"
Claude:  [reads files, finds no retry logic, suggests axios-retry]
You:     "Plan the implementation. Ask questions, don't assume. Walk me through it."
Claude:  [asks about error handling, walks through approach step by step]

-- DISTILL --
You:     "/handoff-prompt-to add retry logic using axios-retry"
Claude:  → writes .ai-reference/prompts/add-retry.md

-- REFLECT (same window) --
You:     "/reflect"
Claude:  → [reviews prompts, updates with any fixes needed]

-- EXECUTE (new terminal) --
You:     claude → paste entire .ai-reference/prompts/add-retry.md as first message
Claude:  [reads spec, implements, spawns verification sub-agents, fixes issues, reports done]

-- LEARN --
You:     [if agent made mistakes, add to CLAUDE.md: "Use date-fns, not moment"]

That's the whole workflow. Discover messy, execute clean. Prompt files are portable—paste into Claude Code, Cursor, or any agent.


The Workflow

Phase What Commands
Bootstrap Persistent project context loaded at session start CLAUDE.md (auto-loaded)
Discover Explore, plan, discuss; use sub-agents for parallel research Natural language
Distill Generate clean spec(s) for fresh execution /handoff-prompt-to, /pair-prompt-to
Reflect Verify prompts capture discussion + match codebase /reflect
Execute New terminal + claude runs the distilled prompt(s) (paste prompt)
Learn Capture agent mistakes in CLAUDE.md for future sessions Manual

What happens in the fresh window: Paste the entire prompt file as your first message. The agent treats it as a spec—no special formatting needed. It reads the task, implements, spawns verification sub-agents (tests, behavior, code quality), fixes issues, reports done. No hand-holding required.

Setup & First Run

# 1. Install the custom commands (download the 3 command files from this gist)
mkdir -p your-project/.claude/commands
# Copy handoff-prompt-to.md, pair-prompt-to.md, reflect.md to .claude/commands/

# 2. Try it
cd your-project && claude
> /handoff-prompt-to add error logging to auth.ts
→ .ai-reference/prompts/1736345678-add-error-logging.md

> /reflect
→ [reviews and updates prompt if needed]

# 3. Execute in fresh window
# Open new terminal, start claude, paste the ENTIRE prompt file as your first message:
> claude
> [paste entire contents of .ai-reference/prompts/1736345678-add-error-logging.md]
→ Agent treats it as a spec, implements, verifies, reports done

Custom commands from this gist: /handoff-prompt-to, /pair-prompt-to, /reflect Built-in: /compact, /clear, /context, sub-agents


1. Project Foundation (CLAUDE.md)

Workflow phase: Bootstrap — Auto-loaded at session start.

Persistent context that survives across sessions. Primary use: capture agent mistakes so they don't repeat.

~/.claude/CLAUDE.md     # Global
./CLAUDE.md             # Project root (highest priority)
# CLAUDE.md

## Commands
- `pnpm test` — run tests
- `pnpm build` — build project

## Gotchas (learned from agent mistakes)
- Use date-fns, NOT moment.js
- Auth tokens go in headers, not query params
- Run `go generate ./...` after interface changes

Keep it short. Add mistakes as you discover them.


2. Slash Commands

Reusable prompt templates stored as markdown files.

File Locations

.claude/commands/           # Project-scoped (committed to repo)
~/.claude/commands/         # User-scoped (all projects)

The Three Core Commands

Phase Command Purpose Source
Distill /handoff-prompt-to Generate autonomous prompt(s) - auto-splits if large view
Distill /pair-prompt-to Generate collaborative pair programming prompt view
Reflect /reflect Verify prompts capture discussion + match codebase view

When to use each:

START: You have a task to implement

  ├─ Is it trivial? (single file, obvious change, low complexity)
  │    └─ YES → Execute directly, or Plan mode (shift+tab twice → refine plan → auto-accept)
  │
  ├─ Is it high-stakes or do you want step-by-step control?
  │    └─ YES → /pair-prompt-to → /reflect → new window
  │    └─ NO  → /handoff-prompt-to → /reflect → new window
  │
  └─ Is your context full mid-task?
       ├─ Want to preserve exact decisions in a prompt file → /handoff-prompt-to continue
       └─ Want to stay in this session, just need room → /compact (summarizes history)

Key rule: Always /reflect after distilling, before switching to a fresh window.

/handoff-prompt-to <task> — Autonomous Execution

Generates complete spec(s) for a fresh Claude session. Auto-decomposes large tasks.

> /handoff-prompt-to add retry logic to API client
→ Single file: .ai-reference/prompts/1736345678-add-retry.md

> /handoff-prompt-to implement auth system with JWT, refresh tokens, OAuth
→ Task scope requires decomposition. Generating 4 prompt files.
→ .ai-reference/prompts/auth-system/00-index.md
→ .ai-reference/prompts/auth-system/01-jwt-service.md
→ .ai-reference/prompts/auth-system/02-refresh-tokens.md
→ .ai-reference/prompts/auth-system/03-oauth.md

Scope analysis: The command analyzes coupling to decide whether to split:

  • Keep together: Code that shares files, types, or dependencies—shared context improves quality
  • Split apart: Independent concerns that don't need shared context—each gets its own prompt with explicit interface definitions

Rule of thumb: Work stays together unless it touches 20+ files or spans clearly independent features.

Every prompt includes: verification sub-agents, interface definitions for decomposed tasks, definition of done checklist. See command source for full structure.

Parallel execution: For decomposed tasks, the index file shows which prompts can run in parallel. Open multiple terminal windows, start claude in each, and paste independent prompts simultaneously. Serialize only when prerequisites require it.

/pair-prompt-to <task> — Collaborative Execution

Generates a prompt for pair programming—the agent works with you, seeking approval at each step.

> /pair-prompt-to redesign the caching layer
→ .ai-reference/prompts/pairing-caching-redesign.md

Generated prompt enforces: explain before coding, wait for approval at each step, ask don't assume.

/reflect — Pre-Execution Validation

Validates prompts against your conversation and the codebase. Run in the same window after /handoff-prompt-to or /pair-prompt-to.

> /reflect
→ [Reviews and directly updates prompts with any fixes needed]

Checks: Did we capture all decisions? Are file paths accurate? Do decomposed tasks align? Are interfaces consistent across decomposed tasks?

Unlike outputting a verdict, /reflect directly updates the prompt files with any refinements needed—fixing stale paths, adding missing context, correcting interface definitions. Review the changes before executing.

Custom Command Structure

# .claude/commands/fix-issue.md

---

description: Fix a GitHub issue by number
allowed-tools: Read, Write, Bash, Grep

---

Fix GitHub issue: $ARGUMENTS

1. Fetch issue details with `gh issue view $ARGUMENTS`
2. Search codebase for relevant files
3. Implement the fix
4. Write tests

Usage

/fix-issue 1234
/project:fix-issue 1234    # Explicit namespace

Subdirectories create namespaces visible in /help:

.claude/commands/frontend/component.md  → /component (project:frontend)
.claude/commands/backend/test.md        → /test (project:backend)

Slash commands work best for deterministic, repeatable workflows. For exploratory tasks, use natural language.


3. Sub-Agents

Workflow phases: Discover (research) and Execute (verification) — The context firewall.

Sub-agents are isolated instances with their own context windows. Explicitly request parallel work—Claude won't distribute automatically:

"Use 4 parallel sub-agents to explore each directory"
"Have a sub-agent run the tests while I continue"

Each returns results to your main session. Define custom sub-agents or use built-ins (Explore, Plan, Task).

File Locations

.claude/agents/             # Project-scoped
~/.claude/agents/           # User-scoped

Definition

# .claude/agents/code-reviewer.md

---

name: code-reviewer
description: Code quality and security analysis
tools: Read, Grep, Glob, Bash
model: claude-sonnet-4-5-20250929

---

You are an expert code reviewer.

## Priority Order

1. Logic errors and bugs
2. Security vulnerabilities
3. Performance issues
4. Maintainability

## Output

- Severity-ranked summary
- file:line references
- Concrete fixes with code snippets

Invocation

# Automatic (Claude selects based on context)
"Review the auth module for security issues"

# Explicit
"Use the code-reviewer subagent to analyze src/auth/"

Built-in Agents

  • Explore — Fast codebase search
  • Plan — Architecture planning
  • Task — General-purpose execution (underlying mechanism for all sub-agents)

Sub-agents preserve your main context window. Each gets its own fresh context, preventing quality degradation on complex tasks.

Example: Parallel Exploration

Explore this codebase using 4 parallel tasks:
- Task 1: Analyze cmd/ for entrypoint patterns
- Task 2: Review internal/domain/ for business logic
- Task 3: Examine internal/infra/ for external integrations
- Task 4: Check test coverage patterns

Each task should return a summary only.

Constraints

  • Max ~10 concurrent agents
  • Sub-agents cannot spawn sub-agents (no infinite nesting)
  • Serialize write operations to avoid conflicts
  • Claude defaults to sequential—explicitly request parallelization

Sub-agents preserve your main context by returning summaries and discarding intermediate work.


4. Context Maintenance

Between cycles — When distilling is overkill.

When to use /compact instead of distilling: You're mid-exploration, context is filling up, but you haven't reached a decision point worth capturing. You just need more room to keep exploring. Use /compact to summarize and continue in the same session. Use /handoff-prompt-to when you've made decisions worth preserving as artifacts.

/compact

Summarizes conversation history to reclaim context capacity.

/compact                                    # Default
/compact Focus on auth implementation       # Guided
/compact Preserve: DB schema, API contracts # Explicit retention

Related Commands

Command Effect
/compact Summarize and compress
/clear Wipe completely
/context Show current usage
claude -c Continue most recent session
claude -r Resume by session ID

Auto-Compact

Triggers at ~95% utilization. Don't rely on it—manual compaction at logical breakpoints preserves more nuance.

Strategic Pattern

/context                    # Check utilization
/compact Retain: feature scope, test strategy, blockers

When to Compact vs. Handoff

Situation Action
Mid-task, context getting full /compact with explicit retention
Task complete, starting related work /clear or new window
Long collaborative session, context full /handoff-prompt-to or /pair-prompt-to continuation
Need to preserve exact decisions made Distill to prompt file, then fresh window

For complex tasks spanning multiple sessions: use distillation commands to capture decisions as artifacts, then execute in fresh windows. This preserves nuance better than /compact.


Pro Tips

"Skeptically" power word. Adding "skeptically" to any validation request overrides Claude's default agreeable behavior. Without it, Claude tends to validate your assumptions rather than challenge them. The /reflect command includes this by design. Use it elsewhere: "Skeptically review this implementation for edge cases."

Explicit parallelism. Claude defaults to sequential execution. For parallel work, be explicit: "Use 4 parallel sub-agents" or "Launch these 3 tasks concurrently." Think goroutine orchestration—you're the scheduler.

Prompts are portable. Distilled prompts work with any coding agent (Cursor, Windsurf, Copilot). They can also be reviewed by another agent against the codebase to validate the approach before execution.

When to re-run /reflect:

  • After code changes if reusing a saved prompt
  • For prompts from another session or teammate
  • Before parallel execution of decomposed tasks

Continuation prompts. When context fills mid-task: /handoff-prompt-to continue from Phase 3 (storage layer). The command captures prior decisions scoped to remaining work.

Force fresh perspective. For code review, spawn a sub-agent rather than reviewing in the same session. The reviewing agent won't have the author's blind spots.

Verification via sub-agents. Include in your prompts: "Spawn a sub-agent to run tests and fix failures before reporting done." Fresh context catches mistakes the implementing agent is blind to. Works for writing tests too.

Verification is the multiplier. Give Claude a way to prove its work—tests, browser checks, script execution—and quality jumps 2-3x. The handoff prompts bake this in with three verification sub-agents (tests, behavior, code quality). Don't skip it.


Quick Reference

Core Features

Feature Location Trigger
CLAUDE.md ./CLAUDE.md, ~/.claude/CLAUDE.md Auto-loaded
Slash Commands .claude/commands/*.md /command
Sub-Agents .claude/agents/*.md Explicit request required
Parallel Tasks N/A Natural language
Compact Built-in /compact
Context Built-in /context

Advanced features (Browser Control, MCP, --dangerously-skip-permissions): See advanced-features.md


Learning

Workflow phase: Learn — The Execute phase feeds back into Bootstrap.

Before Closing Any Session

  1. Capture lessons learned: Did you discover a new gotcha, edge case, or dependency? A command that always needs to run? A pattern that worked well?

  2. Update CLAUDE.md immediately: Don't trust your memory. The next session—whether yours or a teammate's—should inherit this knowledge automatically.

  3. Discard the session: Once lessons are persisted, the context has served its purpose. Use /clear or close the window.

What to Add to CLAUDE.md

  • Commands that weren't obvious (TEST_DB_URL must be set, go generate after interface changes)
  • Gotchas that caused debugging time
  • Patterns that the agent got wrong and needed correction
  • Dependencies between components that aren't obvious from the code

Team Knowledge

Commit CLAUDE.md to your repo. The whole team contributes—anytime someone sees Claude make a mistake, they add it. This is "Compounding Engineering": every future session starts smarter than the last, for everyone.

For automated enforcement, see GitHub Action (@.claude) in advanced features.


SHAMELESS PLUG: I'm currently in between contracts and looking for new offers. If you are looking for an AI-native software developer who loves Agentic Coding, team-leading and education, and providing LLM-based solutions, please reach out through my LinkedIn

January 2026

Advanced Features

These extend the core workflow but aren't required to get started.


Browser Control

Workflow phase: Verify — Empirical proof through visual validation.

The coding agent thinks it fixed the UI; a browser sub-agent sees it. Never ask Claude "does this look right?"—have it prove correctness through clicks, navigation, and screenshots.

Native Chrome (Recommended)

Claude Code has built-in Chrome control via the "Claude in Chrome" extension.

Setup

  1. Install Claude in Chrome
  2. Launch with --chrome:
claude --chrome

Capabilities

  • Navigate, click, fill forms
  • Take screenshots, record GIFs
  • Read console logs, monitor network
  • Use existing browser login state

Usage

"Open localhost:8080 and test the checkout flow"
"Take a screenshot of the dashboard"
"Check console for errors on /settings"

Permissions

/chrome    # View connection status and permissions

Context cost: Browser tools are always loaded when enabled. Use --chrome only when needed.


MCP (Model Context Protocol)

Extends all phases with external tool servers.

Warning: MCP servers inject tool definitions into every session. 5+ servers can consume 20-40k tokens before you type anything. Enable on-demand, disable after use.

Configuration

.mcp.json                    # Project-scoped
~/.claude/mcp.json           # User-scoped
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-server-postgres"],
      "env": { "DATABASE_URL": "${DATABASE_URL}" }
    }
  }
}

CLI

claude mcp add chrome-devtools npx chrome-devtools-mcp@latest
claude mcp list

Common Servers

Server Purpose
chrome-devtools-mcp DevTools protocol, performance traces
@playwright/mcp Cross-browser, headless, CI
mcp-server-postgres Database queries
mcp-server-github Issues, PRs
mcp-server-slack Messaging

Browser Control Options

Method Best For
Native Chrome (--chrome) General tasks, existing login state
Chrome DevTools MCP Performance analysis, network debugging
Playwright MCP Cross-browser, headless, CI pipelines

On-Demand Activation

/mcp                    # List servers
@postgres enable        # Toggle in conversation
@postgres disable

--dangerously-skip-permissions

Workflow phase: Execute — Uninterrupted flow for trusted prompts.

Bypasses permission prompts for file writes, shell commands, and other tool invocations.

Usage

claude --dangerously-skip-permissions
claude -c --dangerously-skip-permissions

When to Use

  • CI/CD pipelines, batch processing
  • Well-tested slash commands
  • Flow state (when prompts interrupt iteration)

Risk Profile

Concern Reality
Destructive commands Rare—Claude avoids obvious footguns
Runaway loops Possible; monitor long sessions
Credential exposure Same as normal mode

Mitigation

# Isolated environment
docker run -it --rm -v $(pwd):/workspace claude-code --dangerously-skip-permissions

# Expendable branch via worktree
git worktree add ../feature-experiment feature-branch
cd ../feature-experiment
claude --dangerously-skip-permissions

Preferred: Granular Permissions

For daily development, use /permissions to pre-allow specific safe commands instead of skipping all permissions:

/permissions                    # View and manage allowed commands

Allowed commands are stored in .claude/settings.json and can be committed to the repo for team-wide sharing:

{
  "permissions": {
    "allow": [
      "Bash(npm run build)",
      "Bash(npm test)",
      "Bash(git status)",
      "Bash(git diff:*)"
    ]
  }
}

This gives you uninterrupted flow for known-safe operations while keeping guardrails for everything else.

Alternative: Tool Filtering

claude --allowedTools "Read,Write,Grep,Glob"  # Exclude Bash entirely

Reserve --dangerously-skip-permissions for CI/CD, sandboxed environments, or batch processing where the entire environment is expendable.


Hooks

Workflow phase: Execute — Automated responses to agent actions.

Hooks are shell commands that run in response to Claude's actions. Two high-value patterns:

PostToolUse: Auto-Format Code

Run a formatter after every file write to catch the last 10% of formatting issues:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "command": "prettier --write $CLAUDE_FILE_PATH"
      }
    ]
  }
}

Stop: Trigger Verification

Run verification automatically when Claude finishes a task:

{
  "hooks": {
    "Stop": [
      {
        "command": "npm test"
      }
    ]
  }
}

For long-running autonomous sessions, Stop hooks ensure verification happens even when you're not watching.

🔗 Hooks documentation


GitHub Action (@.claude)

Workflow phase: Learn — Automated knowledge capture in code review.

Tag @.claude in PR comments to have Claude respond, including adding lessons to CLAUDE.md. This enables "Compounding Engineering"—the team's knowledge grows with every code review.

Setup

/install-github-action

Usage

In a PR comment:

@.claude add to CLAUDE.md: always run migrations before seeding

Claude will open a commit adding the lesson to your project's CLAUDE.md.

This works for any task: fixing issues, answering questions, or making changes—all triggered from GitHub's UI without opening a terminal.

argument-hint description
task-description
Synthesize implementation prompts for a fresh agent - auto-decomposes if task is too large

Write self-contained prompt(s) to delegate this task to a coding agent with an empty context window: $ARGUMENTS

Cover all relevant insights and specifications from our discussion.

Scope Analysis

Before generating prompts, analyze what work benefits from shared context:

  1. Identify coupling - What code is tightly coupled (same files, shared patterns, mutual dependencies)?
  2. Find natural boundaries - Where can work be cleanly separated without losing context benefits?
  3. Check context fit - Will the grouped work fit comfortably in one context window (~20 files max)?

Decision:

  • Coupled work → Generate a single prompt (shared context improves quality)
  • Independent work → Generate multiple prompts (no context benefit from combining)

If decomposing, announce: "Task splits into [N] independent units. Generating [N] prompt files."


Prompt Structure

Every prompt follows this structure:

1. Task

One paragraph describing exactly what the agent must do and why.

2. Context & Constraints

  • Specifications and goals
  • Success criteria
  • Constraints, key assumptions, and user preferences
  • Decisions already made

3. Inputs & Resources

Files to Create/Modify

  • Absolute paths of files the agent will create or change

Files to Reference (Read-Only)

  • Absolute paths of files for context without modification

Key Code Patterns

  • Inline code snippets showing expected patterns

Build & Test Commands

  • Exact commands to run (e.g., pnpm build && pnpm typecheck && pnpm test)

4. Execution Guidelines

  • Numbered implementation steps
  • Style and code standards to follow

Edge Cases

  • Explicit list of boundary conditions and how to handle them

5. Assumptions

If you make decisions not covered by the spec, document them:

Assumption Reasoning

6. Verification Plan

You are not done until you have proven correctness. Launch these verification sub-agents in parallel:

  1. Test Sub-Agent: Run [test command]. All tests must pass.
  2. Behavioral Sub-Agent: Prove it works end-to-end (browser test, script, or logs).
  3. Code Quality Sub-Agent: Review for complexity, duplication, security. Fix issues directly if safe.

If any sub-agent reports failure, fix the issues and re-run verification. Retry up to 3 times. If still failing, report what you tried.

7. Definition of Done

  • Implementation matches spec
  • All verification steps passed
  • Assumptions documented (if any)
  • No debug code or comments left behind

Multi-Prompt Additions

When decomposing into multiple prompts, add these elements:

Interface-First Planning

Before generating task prompts, define contracts between dependent components:

  • For each integration point, specify the exact interface (types, function signatures, data shapes)
  • Include these interface definitions in ALL tasks that produce or consume them

Output Structure

.ai-reference/prompts/<task-name>/
├── 00-index.md          # Overview, dependency graph, shared interfaces
├── 01-<first-task>.md   # First task prompt
├── 02-<second-task>.md  # Second task prompt
└── ...

Index File (00-index.md)

  1. Overview - What we're building and why
  2. Shared Interfaces - All contract definitions (copy-paste into each task)
  3. Execution Strategy:
    Task Description Prerequisites Can Parallel?

Additional Sections Per Task

Add to section 2 (Context & Constraints):

### Prerequisites
- [ ] Task [X] completed (if applicable)
- None - this task is independent

### Shared Interfaces (CRITICAL)
[Exact interface definitions - copy from index, don't summarize]

Add to section 7 (Definition of Done):

  • Shared interfaces implemented exactly as defined

Output

  • Single prompt: Save to .ai-reference/prompts/<timestamp>-<task-description>.md
  • Multiple prompts: Save to .ai-reference/prompts/<task-name>/ directory

Requirements

  1. Self-contained: Each prompt includes ALL context needed. Fresh agent, empty window.
  2. Interface consistency: Shared interfaces IDENTICAL across all prompts. Copy-paste, don't summarize.
  3. Verification built-in: Every prompt includes verification sub-agents.

Write directly to the new agent (use "you"). Do not mention this conversation. Include all domain knowledge, technical background, design rationale, and insights from our discussion.

Use sub-agents liberally for parallel work. The main agent coordinates and ensures consistency.

argument-hint description
task-description
Synthesize a complete implementation spec for a pair-programming session with a new coding agent to collaboratively build the discussed task

Write a self-contained prompt to delegate this task to a coding agent with an empty context window and frame them as an expert pair programmer and thinking partner: $ARGUMENTS

Cover all relevant insights and specifications from our discussion.

Structure the prompt with these sections:

1. Task

  • One paragraph describing exactly what we're building together, why it matters, and briefly how we will collaborate to build it.

2. Context & Constraints

  • Specifications and goals
  • Success criteria
  • Constraints and key assumptions
  • Decisions already made

3. Inputs & Resources

Files to Modify

  • List files the agent will change

Files to Reference (Read-Only)

  • List files for context without modification

Key Code Patterns

  • Include inline code snippets showing expected patterns

Build & Test Commands

  • Exact commands to run (e.g., pnpm build && pnpm typecheck && pnpm test)

4. Implementation Plan

  • Numbered phases or milestones, each a logical, reviewable unit of work
  • Style and code standards to follow

Edge Cases

  • Explicit list of boundary conditions and how to handle them

5. Collaboration Protocol

  • Strict Step-by-Step Approval: Do NOT proceed to the next step until the user explicitly approves the current one.
  • Work Incrementally: Implement one distinct chunk or file at a time.
  • Explain First: Before writing code, briefly explain what you are about to do.
  • Verify Loop: specificy 'Does this look correct?' or 'Ready to proceed?' after each chunk.
  • Ambiguity Handler: If a decision is ambiguous, ASK the user before deciding.
  • Feedback Integration: If the user provides feedback, acknowledge it, adjust the plan, and wait for approval again.

6. Definition of Done

Use checkbox format:

  • Specific criterion 1
  • Specific criterion 2
  • User has reviewed and approved each phase
  • All existing tests pass
  • pnpm build succeeds
  • pnpm typecheck succeeds
  • pnpm test succeeds

Write directly to the new agent (use "you"). Frame them as an expert pair programmer and thinking partner, not just a task executor. Do not use the word "handoff" or mention this conversation in the prompt. The agent should delegate isolated exploration or implementation tasks to sub-agents when appropriate, but should remain responsible for overall quality and for maintaining the interactive review loop with the user.

Include all domain knowledge, technical background, design rationale, and any insights from our discussion that would materially improve their ability to collaborate effectively.

Output:

  • Save the prompt to a file '/.ai-reference/prompts/-pairing-prompt-.md'
argument-hint description allowed-tools
(optional) [topic, plan, or path to review]
Reflect on conversation + codebase to ensure prompts capture everything before execution
Read, Grep, Glob, Task

Reflect on:

  • Our discussion, and any details and decisions we'd agreed upon on the subject $ARGUMENTS
  • the artifacts, prompt files, and/or other plans we most recently generated for this
  • our conversation and the codebase against the artifacts, plans, or prompts we recently generated to ensure they will succeed.

This is your last chance to catch gaps before a fresh agent executes these tasks with no memory of our discussion. Your goal is to ensure the implementation planned will succeed by providing the best, most accurate context and instructions possible.

Make any refinements to ensure:

  • All design decisions from our conversation are documented
  • Rationale is included (not just "what" but "why")
  • Trade-offs we discussed are noted
  • Domain knowledge I explained is included
  • Edge cases we identified are listed
  • Constraints and preferences are captured
  • Task boundaries match what we agreed
  • Nothing we discussed is missing from the artifacts/plans
  • No scope creep beyond what we decided
  • All referenced files exist at the stated paths
  • File paths haven't been renamed or moved
  • Line number references are still accurate
  • Verify the code actually exists as described
  • Verify the described behavior is accurate
  • Verify types/interfaces match what's stated
  • Commands are correct for this project
  • Test file paths are accurate
  • Interface definitions are IDENTICAL across all task files
  • Prerequisites in each task match what prior tasks deliver
  • Index dependency graph matches task file prerequisites
  • No conflicts between what tasks produce vs consume

Directly update the artifacts, prompt files, and/or other plan file in question with the refinements required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment