Skip to content

Instantly share code, notes, and snippets.

@nicovalencia
Created February 5, 2026 18:07
Show Gist options
  • Select an option

  • Save nicovalencia/a95b9bbd405229ddde3ba69c5dc39879 to your computer and use it in GitHub Desktop.

Select an option

Save nicovalencia/a95b9bbd405229ddde3ba69c5dc39879 to your computer and use it in GitHub Desktop.
Claude Code /p command - Research and plan implementation tasks

Plan and research implementation for: $ARGUMENTS

Execution Steps

Step 1: Parallel Research Phase

Launch TWO researcher agents simultaneously in a single message:

Agent 1 - Codebase Research: Use Task tool with subagent_type="researcher" with this prompt: "Explore this codebase to understand how to implement: $ARGUMENTS

Research:

  • Check docs/ directory for relevant documentation files
  • Existing patterns, components, and utilities relevant to this task
  • Files that will need modification or serve as references
  • Current conventions and best practices in this codebase
  • Architectural constraints or considerations

Return a concise summary with:

  • Relevant documentation from docs/ if found
  • Related codebase parts with file:line references
  • Best practices observed in existing code
  • Key files and steps to consider for implementation"

Agent 2 - External Research: Use Task tool with subagent_type="researcher" with this prompt: "Research external best practices for implementing: $ARGUMENTS

Use Context7 for library/framework documentation or web search for general best practices, as appropriate for the task. Find:

  • Current industry best practices for this type of feature
  • Relevant library documentation and patterns
  • Common approaches and implementation strategies

Return a concise summary of:

  • Best practices and recommended approach
  • Relevant documentation or examples
  • Key technical considerations"

Step 2: Architecture Phase

After both research agents complete, launch an architect agent using Task tool with subagent_type="architect". Provide:

  • Original task: $ARGUMENTS
  • Codebase research results
  • External research results

Instruct architect to write a markdown implementation plan in the project's plans/ directory (create if needed). The plan filename should be kebab-case based on the feature name.

Plan must include:

  1. Brief Summary - Short overview of what will be built
  2. User Actions Required - Manual steps needed (dependencies, env vars, external setup)
  3. File Change Diagram - ASCII or markdown representation of files to create/modify
  4. Implementation Phases - Detailed step-by-step instructions in logical phases

Plan must NOT include:

  • Timelines or estimates
  • Future considerations
  • Alternative suggestions
  • Possible improvements

Write only the single best definitive implementation approach.

Step 3: Confirm Completion

Report the plan file path to the user when complete.

@nicovalencia
Copy link
Author

Prerequisites:

  1. Claude Code CLI installed and authenticated
  2. Command file saved to ~/.claude/commands/p.md
  3. Custom agent types configured:
    • researcher - Read-only agent with Context7 and web search access
    • architect - Write-enabled agent specialized to your project's tech stack
  4. Project docs/ directory with relevant documentation

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