Guidelines Command - Centralized Mistake Prevention Consultation
Consults mistake prevention guidelines system for systematic error avoidance during task execution.
/plugin marketplace add jleechanorg/claude-commands/plugin install claude-commands@claude-commands-marketplaceWhen this command is invoked, YOU (Claude) must execute these steps immediately: This is NOT documentation - these are COMMANDS to execute right now. Use TodoWrite to track progress through multi-phase workflows.
Action Steps:
Action Steps:
docs/pr-guidelines/base-guidelines.mdAction Steps:
mcp__memory-server__add_observations - Store guidelines effectiveness and application contextsmcp__memory-server__create_relations - Link guideline success to specific task types and outcomesAction Steps:
Usage: /guidelines - Consult and manage mistake prevention guidelines system
Command Summary: Centralized command for consulting CLAUDE.md, base guidelines, and PR-specific guidelines with automatic creation
Purpose: Provide systematic mistake prevention consultation for all enhanced commands through command composition
Action: Read CLAUDE.md, consult base guidelines, detect PR context, create/update PR-specific guidelines as needed
1. Memory MCP Integration with Query Optimization (MANDATORY):
/memory search "[guidelines query]" for optimized query processing/memory command's automatic compound query transformation/memory search "relevant guidelines and patterns" - Search with automatic optimization/memory recall "historical guidelines applications" - Retrieve specific guideline contexts/memory command's built-in deduplication and scoring2. CLAUDE.md Reading (MANDATORY):
3. Base Guidelines Discovery:
docs/pr-guidelines/base-guidelines.md for general patterns4. PR Context Detection:
pr-1286-feature, fix-1286-bug)docs/branch-guidelines/{BRANCH_NAME}/guidelines.md/guidelines --pr 12865. PR-Specific Guidelines Management:
docs/pr-guidelines/{PR_NUMBER}/guidelines.mdmcp__memory-server__create_entities - Create PR guideline entities with metadatamcp__memory-server__create_relations - Link PR patterns to project and guideline contextsmcp__memory-server__add_observations - Store specific guideline applications and results
# Called by enhanced commands for systematic consultation
/plan [task] ā calls /guidelines ā proceeds with planning
/execute [task] ā calls /guidelines ā proceeds with execution
/review-enhanced ā calls /guidelines ā proceeds with review
/reviewdeep ā calls /guidelines ā proceeds with deep analysis
/guidelines # Consult guidelines for current context
/guidelines --pr 1286 # Consult guidelines for specific PR
/guidelines --create-missing # Create missing PR guidelines template
/guidelines --update # Update PR guidelines with new patterns
When PR-specific guidelines don't exist, automatically create:
# PR #{PR_NUMBER} Guidelines - {PR_TITLE}
**PR**: #{PR_NUMBER} - [Auto-detected PR title]
**Created**: {Current date}
**Purpose**: Specific guidelines for this PR's development and review
## Scope
- This document contains PR-specific deltas, evidence, and decisions for PR #{PR_NUMBER}.
- Canonical, reusable protocols are defined in docs/pr-guidelines/base-guidelines.md.
## šÆ PR-Specific Principles
[To be populated as patterns are discovered]
## š« PR-Specific Anti-Patterns
[To be populated based on review findings and mistakes discovered]
## š Implementation Patterns for This PR
[To be populated with working patterns and successful approaches]
## š§ Specific Implementation Guidelines
[To be populated with actionable guidance for similar future work]
---
**Status**: Template created by /guidelines command - will be enhanced as work progresses
**Last Updated**: {Current date}
Guidelines Consultation Result:
## š Guidelines Consultation Summary
ā
**CLAUDE.md**: Read and applied - Current rules, constraints, and protocols understood
ā
**Base Guidelines**: Consulted docs/pr-guidelines/base-guidelines.md
ā
**PR Context**: Detected PR #{PR_NUMBER} / Branch: {branch_name}
ā
**PR Guidelines**: Found/Created docs/pr-guidelines/{PR_NUMBER}/guidelines.md
ā
**Anti-Patterns**: {count} relevant patterns identified for prevention
ā
**Tool Selection**: Hierarchy validated (Serena MCP ā Read tool ā Bash commands)
## šÆ Key Guidance for Current Task
- {Relevant principle 1}
- {Relevant anti-pattern to avoid}
- {Tool selection recommendation}
- {Quality standard to apply}
**Guidelines Integration**: Complete - Proceed with task execution
Enhanced commands must call /guidelines before proceeding:
## Pre-{Command} Guidelines Check
**Systematic Mistake Prevention**: This command automatically consults the mistake prevention guidelines system through `/guidelines` command composition.
**Execution Flow**:
1. Call `/guidelines` for comprehensive consultation
2. Apply guidelines output to inform {command-specific} approach
3. Proceed with {command-specific} workflow using guidelines context
mcp__memory-server__create_entities - Store guideline patterns as structured entitiesmcp__memory-server__create_relations - Link patterns to contexts, outcomes, and effectiveness/memory search "[relevant patterns]" - Query with automatic optimization during consultationImplementation Method: This command provides centralized guidelines consultation that other enhanced commands (/execute, /plan, /review-enhanced, /reviewdeep) call through command composition for systematic mistake prevention.