一键导入
plan-guideline
Create comprehensive implementation plans with detailed file-level changes and test strategies
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create comprehensive implementation plans with detailed file-level changes and test strategies
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | plan-guideline |
| description | Create comprehensive implementation plans with detailed file-level changes and test strategies |
This skill instructs AI agents on how to create comprehensive implementation plans for new features, refactoring, or bug fixes. The plan should be thorough enough to serve as a blueprint for implementation, with concrete file-level details and quantified complexity estimates.
A good plan is:
open-issue skillCRITICAL: All implementation plans MUST follow this strict ordering:
This design-first test-driven development (TDD) style ensures:
The plan-guideline skill takes the following inputs:
The AI agent MUST follow this systematic process when creating a plan:
Objective: Deeply understand what the user wants to achieve.
Actions:
AskUserQuestion if neededOutput signals:
Objective: Thoroughly explore the codebase to understand current implementation.
CRITICAL: The audit happens DURING planning, not as a step IN the plan. The plan must contain audit RESULTS, not "TODO: audit the codebase" steps.
Actions:
Glob to find relevant files by patternGrep to search for related functionalityOutput from this phase:
Example of GOOD audit results in plan:
Files to modify:
- `claude/skills/commit-msg/SKILL.md:15-45` - Add milestone commit logic
- `tests/test_git_commit.sh:23-67` - Update test cases for milestones
Files to create:
- `docs/milestone-workflow.md` - Document milestone commit process
Example of BAD (do not include this):
1. Audit the codebase to find relevant files
2. Determine which files need changes
Objective: Design the public interfaces, APIs, and documentation changes.
Actions:
Output:
Example:
New interfaces:
- Function: `create_milestone_commit(files: list, message: str, test_status: str)`
- Config: Add `milestone.allow_no_verify` to project settings
Modified interfaces:
- Function: `git_commit()` - add optional parameter `is_milestone: bool = False`
Documentation updates:
- `docs/git-msg-tags.md:15-20` - Add milestone tag explanation
- `claude/skills/commit-msg/SKILL.md:40-60` - Add milestone section
Objective: Design comprehensive test coverage before writing implementation code.
CRITICAL: Testing is not an afterthought. Design tests that validate:
Actions:
Output:
Example:
Test modifications:
- `tests/test_git_commit.sh:45-67` - Update to verify milestone flag handling
- Test case: Verify `--no-verify` used only for milestone commits
- Test case: Verify milestone commit message format
New test files:
- `tests/test_milestone_workflow.sh` - Test complete milestone workflow
- Test case: Create milestone commit on dev branch (should succeed)
- Test case: Attempt milestone commit on main (should fail)
- Test case: Verify test status included in commit message
- Estimated complexity: ~80 lines
Objective: Create a step-by-step implementation plan with complexity estimates.
CRITICAL: Use lines of code (LOC) to estimate complexity, NOT time durations.
Complexity guidelines:
MANDATORY ORDERING: Implementation steps MUST follow this sequence:
Phase 1: Documentation (always first)
Phase 2: Test Cases (always second)
Phase 3: Implementation (always last)
Actions:
Understanding Milestone Commits:
Milestone commits are for incremental progress on large features. They allow bypassing pre-commit hooks, but this does NOT mean skipping tests:
Example milestone progression:
Output format:
Step N: [Brief description] (Estimated: X LOC)
- File 1: Specific change description
- File 2: Specific change description
Dependencies: [List steps that must complete first]
Example (following Design-first TDD ordering):
Step 1: Update documentation for milestone commits (Estimated: 60 LOC)
- `docs/git-msg-tags.md:15-20` - Add milestone tag definition and usage
- `claude/skills/commit-msg/SKILL.md:14-20` - Add milestone to inputs section
- `claude/skills/commit-msg/SKILL.md:40-60` - Add milestone commit section with examples
Dependencies: None
Step 2: Create test cases for milestone functionality (Estimated: 90 LOC)
- `tests/test_git_commit.sh:45-67` - Add milestone flag tests
- Test: Verify `--no-verify` used only for milestone commits
- Test: Verify milestone commit message format
- `tests/test_milestone_message.sh` - New test file for message validation
- Test: Validate milestone commit on dev branch succeeds
- Test: Validate milestone commit on main fails
Dependencies: Step 1 (documentation must be complete first)
Step 3: Implement milestone detection and handling logic (Estimated: 100 LOC)
- `claude/skills/commit-msg/SKILL.md:25-35` - Add milestone input handling
- `claude/skills/commit-msg/SKILL.md:85-88` - Add pre-commit bypass logic
Dependencies: Step 2 (tests must exist before implementation)
Total estimated complexity: 250 LOC (Medium-Large feature)
Recommended approach: Implement in single development session
Note: Follows Design-first TDD: Docs (Step 1) → Tests (Step 2) → Implementation (Step 3)
The final plan should be structured as follows:
# Implementation Plan: [Feature/Goal Name]
## Goal
[1-2 sentence problem statement]
**Success criteria:**
- [Criterion 1]
- [Criterion 2]
**Out of scope:**
- [What we're not doing]
## Codebase Analysis
**Files to modify:**
- `path/to/file1:lines` - Purpose
- `path/to/file2:lines` - Purpose
**Files to create:**
- `path/to/new/file1` - Purpose (Estimated: X LOC)
- `path/to/new/file2` - Purpose (Estimated: X LOC)
**Files to delete:**
- `path/to/deprecated/file` - Reason
**Current architecture notes:**
[Key observations about existing code]
## Interface Design
**New interfaces:**
- [Interface signatures and descriptions]
**Modified interfaces:**
- [Before/after comparisons]
**Documentation changes:**
- [Doc files to update with sections]
## Test Strategy
**Test modifications:**
- `test/file1:lines` - What to test
- Test case: Description
- Test case: Description
**New test files:**
- `test/new_file` - Purpose (Estimated: X LOC)
- Test case: Description
- Test case: Description
**Test data required:**
- [Fixtures, sample data, etc.]
## Implementation Steps
**Step 1: [Description]** (Estimated: X LOC)
- File changes
Dependencies: None
**Step 2: [Description]** (Estimated: X LOC)
- File changes
Dependencies: Step 1
...
**Total estimated complexity:** X LOC ([Complexity level])
**Recommended approach:** [Single session / Milestone commits / etc.]
After creating a plan, the AI agent should:
Present to user for approval
Create GitHub issue (once approved)
open-issue skill[plan][tag] prefixBegin implementation (after issue created)
fork-dev-branch skill to create a development branchcommit-msg skill for commits (milestone commits if needed)open-pr skill when implementation is completeUser request: "Add support for milestone commits in the commit-msg skill"
Plan excerpt:
# Implementation Plan: Milestone Commit Support
## Goal
Add milestone commit functionality to allow work-in-progress commits that can
bypass pre-commit hooks on development branches.
**Success criteria:**
- Milestone commits work only on development branches (not main)
- Milestone commits include test status in message
- Pre-commit hooks can be bypassed with explicit milestone flag
**Out of scope:**
- Automatic milestone detection
- Milestone progress tracking UI
## Codebase Analysis
**Files to modify:**
- `claude/skills/commit-msg/SKILL.md:14-20` - Add milestone input handling
- `claude/skills/commit-msg/SKILL.md:40-88` - Add milestone message format
- `tests/test_git_commit.sh:45-67` - Add milestone tests
**Files to create:**
- None required
**Current architecture notes:**
- Commit skill currently supports only delivery commits
- Pre-commit hook validation is mandatory for all commits
- Branch detection logic already exists in workflow
## Implementation Steps
**Step 1: Update documentation** (Estimated: 60 LOC)
- `docs/git-msg-tags.md:15-20` - Add milestone tag definition and usage rules
- `claude/skills/commit-msg/SKILL.md:14-20` - Add milestone to inputs section
- `claude/skills/commit-msg/SKILL.md:40-60` - Add milestone message format section
Dependencies: None
**Step 2: Create test cases** (Estimated: 85 LOC)
- `tests/test_git_commit.sh:45-67` - Add milestone-specific tests
- Test: Milestone commits bypass hooks on dev branches
- Test: Milestone commits fail on main branch
- Test: Milestone message includes test status
- `tests/test_milestone_format.sh` - New test for message validation
Dependencies: Step 1 (documentation must define behavior first)
**Step 3: Implement milestone commit logic** (Estimated: 95 LOC)
- `claude/skills/commit-msg/SKILL.md:25-35` - Add milestone input processing
- `claude/skills/commit-msg/SKILL.md:85-88` - Add pre-commit bypass logic
Dependencies: Step 2 (tests must exist to validate implementation)
**Total estimated complexity:** 240 LOC (Medium feature)
**Recommended approach:** Single development session following Docs → Tests → Implementation
User request: "Refactor the SDK initialization to validate directories"
Plan excerpt:
# Implementation Plan: SDK Init Directory Validation
## Goal
Add comprehensive directory validation to SDK initialization to prevent
initialization in invalid locations and provide clear error messages.
**Success criteria:**
- Validate target directory exists and is writable
- Check for conflicting files before initialization
- Provide actionable error messages
- Support both init and update modes
**Out of scope:**
- Automatic directory creation
- Backup/rollback functionality
## Codebase Analysis
**Files to modify:**
- `Makefile:45-67` - Add validation before template copying
- `docs/OPTIONS.md:25-40` - Document validation behavior
**Files to create:**
- `scripts/validate_target_dir.sh` - Directory validation logic (Est: 120 LOC)
- `tests/test_directory_validation.sh` - Validation tests (Est: 180 LOC)
## Test Strategy
**New test files:**
- `tests/test_directory_validation.sh` (Estimated: 180 LOC)
- Test case: Valid empty directory (should pass)
- Test case: Non-existent directory (should fail with error)
- Test case: Directory with conflicting files (should fail with list)
- Test case: Non-writable directory (should fail with permission error)
- Test case: Init mode vs update mode differences
## Implementation Steps
**Step 1: Update documentation** (Estimated: 60 LOC)
- `docs/OPTIONS.md:25-40` - Document validation behavior and error messages
- `docs/OPTIONS.md:50-65` - Add examples of valid/invalid target directories
Dependencies: None
**Step 2: Create test cases** (Estimated: 180 LOC)
- `tests/test_directory_validation.sh` - New comprehensive validation test suite
- Test: Valid empty directory initialization
- Test: Non-existent directory rejection
- Test: Conflicting files detection
- Test: Permission error handling
- Test: Init vs update mode differences
Dependencies: Step 1 (documentation defines expected behavior)
**Step 3: Implement validation script** (Estimated: 120 LOC)
- `scripts/validate_target_dir.sh` - New validation script with all checks
- Directory existence check
- Write permission validation
- Conflict detection logic
- Mode-specific validation rules
Dependencies: Step 2 (tests define all edge cases)
**Step 4: Integrate validation into Makefile** (Estimated: 60 LOC)
- `Makefile:45-67` - Add validation call before template copying
- `Makefile:70-85` - Add error handling and user feedback
Dependencies: Step 3 (validation script must exist)
**Total estimated complexity:** 420 LOC (Large feature)
**Recommended approach:** Use milestone commits for incremental progress
**Milestone strategy:**
- Milestone 1 (after Step 2): Documentation and tests complete (0/5 tests pass)
- All tests exist but implementation not started yet
- Milestone 2 (after Step 3): Validation script implemented (3/5 tests pass)
- Basic validation working, edge cases still failing
- Delivery commit (after Step 4): Full integration complete (5/5 tests pass)
- All tests pass, ready for PR
**Note:** Follows Design-first TDD strictly: Docs (Step 1) → Tests (Step 2) → Implementation (Steps 3-4)
Tests are run at each milestone; failing tests are accepted temporarily as progress checkpoints.
MANDATORY ordering - Design-first TDD: Implementation steps MUST follow this order:
NEVER put implementation before documentation or tests. This is non-negotiable.
No vague audit steps: The plan must contain concrete file names and line ranges, not "audit the codebase" tasks. Auditing happens during planning.
Quantify with LOC: Always use lines of code estimates, never time-based estimates like "2 hours" or "3 days".
Test-first mindset: Design tests before implementation details. Tests clarify requirements and prevent scope creep. Tests must exist before writing implementation.
Break down large steps: If a single step exceeds 400 LOC, break it into substeps. Consider milestone commits for features exceeding 800 LOC total.
Document interfaces early: Interface design comes before implementation planning. Changes to interfaces affect multiple files and should be designed carefully.
Use existing patterns: During audit, identify and follow existing architectural patterns and naming conventions in the codebase.
Be specific: Prefer "Modify file.py:45-67 to add parameter validation" over
"Update the validation logic". The more specific, the better.
Dependencies reflect ordering: Each step's dependencies should enforce the ordering:
Milestone commits run tests: When planning features that require milestone commits:
Commit the staged changes to git with meaningful messages.
Instructs AI agents on documentation standards for design docs, folder READMEs, source code interfaces, and test cases
Create a development branch for a given GitHub issue with standardized naming
Drive implementation forward incrementally with automatic progress tracking, LOC monitoring, and milestone checkpoint creation
Move or rename a file while automatically updating all references in source code and documentation
Create GitHub issues from conversation context with proper formatting and tag selection