plan-mode-gate

GitHub

强制性的计划与代码执行前置检查门控,确保在编码前进行超级技能纪律、代码库分析、问题分解及文档查阅。适用于所有涉及文件修改、外部库使用或复杂逻辑的任务,防止因缺乏上下文导致的错误实现。

skills/plan-mode-gate/SKILL.md AjayIrkal23/agentic-mercy-10x

Trigger Scenarios

调用 EnterPlanMode 之前 用户请求创建、修复、重构或优化功能时 任务涉及超过两个文件的变更 涉及外部库或框架的使用 需要理解现有代码模式的调试或开发任务

Install

npx skills add AjayIrkal23/agentic-mercy-10x --skill plan-mode-gate -g -y
More Options

Use without installing

npx skills use AjayIrkal23/agentic-mercy-10x@plan-mode-gate

指定 Agent (Claude Code)

npx skills add AjayIrkal23/agentic-mercy-10x --skill plan-mode-gate -a claude-code -g -y

安装 repo 全部 skill

npx skills add AjayIrkal23/agentic-mercy-10x --all -g -y

预览 repo 内 skill

npx skills add AjayIrkal23/agentic-mercy-10x --list

SKILL.md

Frontmatter
{
    "name": "plan-mode-gate",
    "schema": 1,
    "license": "MIT",
    "version": "1.0.0",
    "category": "planning",
    "metadata": {
        "tags": [
            "planning",
            "implementation",
            "gate",
            "superpowers",
            "jcodemunch",
            "context7",
            "sequential-thinking"
        ],
        "author": "rohithambar"
    },
    "surfaces": [
        "planning"
    ],
    "triggers": {
        "paths": [],
        "intents": [
            "planning"
        ],
        "keywords": [
            "analysis",
            "both",
            "changes",
            "code",
            "codebase",
            "context7",
            "decomposition",
            "direct",
            "discipline",
            "documentation",
            "enforces",
            "enterplanmode",
            "gate",
            "governs",
            "implementation",
            "jcodemunch",
            "lookup",
            "mandatory",
            "mode",
            "plan",
            "planning",
            "pre-flight",
            "sequential",
            "skill",
            "superpowers",
            "thinking",
            "work",
            "writing"
        ]
    },
    "platforms": [
        "linux",
        "darwin",
        "windows"
    ],
    "token-cost": 2898,
    "description": "Mandatory pre-flight gate for ALL planning and implementation work. Enforces superpowers discipline, jcodemunch codebase analysis, sequential thinking decomposition, and Context7 documentation lookup before any code changes. Use before EnterPlanMode, before writing any plan, and before direct implementation. This skill governs both Plan Mode and Code Mode."
}

Plan Mode & Code Mode Gate

This is a **rigid skill**. Follow it exactly. Do not adapt away from the discipline. Skipping any gate produces incomplete plans, incorrect implementations, and wasted effort.

Cursor adaptation (local port)

  • Canonical first router: read workflow-orchestrator before this gate so lifecycle routing stays single-source.
  • jcodemunch / blast-radius: MANDATORY-first for all code work per ~/.claude/rules/codebase-intel-first.md — run the jcodemunch symbol index + graphify graph BEFORE reading/grepping. Use the MCP tools (plan_turn / assemble_task_context / get_blast_radius), then Superpowers discipline.
  • Automation: a sessionStart hook injects a short reminder via ~/.claude/hooks/session-plan-gate-hint.py. For manual JSON from the repo root: node ~/.claude/skills/plan-mode-gate/scripts/plan-mode-check.js. Optional post-edit reminder (not wired to Cursor preToolUse by default): node ~/.claude/skills/plan-mode-gate/scripts/code-mode-check.js.

Purpose

Every task — whether planned or implemented directly — requires proper context gathering, problem decomposition, and skill discipline. This gate ensures you:

  1. Consult ALL relevant skills before acting
  2. Understand the codebase end-to-end before planning
  3. Decompose complex problems before solving
  4. Verify external library assumptions before using them

When to Apply

MUST apply when:

  • EnterPlanMode is about to be called
  • User asks to "create", "build", "implement", "fix", "refactor", "add", "modify", "optimize", "polish"
  • Any task touching >2 files
  • Any task involving external libraries or frameworks
  • Any task requiring understanding existing code patterns
  • Any bug fix or debugging session

ALSO apply when:

  • User asks a question that requires codebase exploration
  • User requests code review or audit
  • User asks "how should I..." about architecture or design

SKIP only when:

  • Pure conversation with no action (answering a conceptual question)
  • Administrative tasks (checking status, listing files)
  • Reading a single known file with no analysis required

When in doubt: APPLY.

Universal Pre-Flight Gate

Before ANY planning or implementation, announce:

PLAN_GATE: superpowers=[pass|skip:<reason>] jcodemunch=[pass|skip:<reason>] sequential=[pass|skip:<reason>] context7=[pass|skip:<reason>] mutation=open|blocked

You may NOT proceed to mutation=open until all required gates pass.


Gate 1: Superpowers Discipline (using-superpowers)

ALWAYS PASS FIRST.

Before exploring, planning, or implementing:

  1. Read using-superpowers skill to refresh discipline
  2. Scan user request for skill triggers:
    • "design", "UI", "UX", "component", "page" → frontend-design-gate, ui-ux-pro-max, impeccable
    • "test", "tdd", "coverage" → tdd-workflow, test-driven-development
    • "bug", "fix", "error", "failure" → systematic-debugging
    • "plan", "architecture", "design doc" → brainstorming, writing-plans
    • "refactor", "clean up" → refactoring-patterns, code-review
    • "deploy", "CI/CD" → deployment-patterns
    • "security", "auth", "XSS" → security-review
  3. Invoke ALL matching skills BEFORE any action
  4. Process skills first (brainstorming, debugging, writing-plans), then domain skills

Skip only if: The task is a single-file read with no implementation.


Gate 2: Codebase Intelligence (jcodemunch)

REQUIRED when repo is indexed or indexable.

Before planning or implementing:

  1. Check if repo is indexed:

    • Run list_repos or resolve_repo(path=<cwd>)
    • If not indexed → index_folder(path=<cwd>)
  2. Get planning context:

    • Run plan_turn(query=<user task>) → get confidence + recommended symbols/files
    • Run assemble_task_context(task=<user task>) → auto-extract best-fit context
    • Run get_repo_health → understand codebase state (hotspots, dead code, complexity)
  3. If modifying existing code:

    • Run get_blast_radius(symbol=<target symbol>) → find all affected files
    • Run get_impact_preview(symbol_id=<target symbol>) → understand downstream effects
  4. Document findings in your plan or reasoning

Skip only if: The task creates a brand-new file with zero interaction with existing code.


Gate 3: Problem Decomposition (sequentialthinking)

REQUIRED for tasks with:

  • 3 subsystems or components

  • 5 files touched

  • Unclear requirements
  • Architecture decisions needed
  • Complex debugging scenarios

Use sequentialthinking tool:

  • Minimum thoughts: 5
  • Maximum thoughts: Scale to complexity (up to 20 for very complex tasks)
  • Must include: Hypothesis generation + verification
  • Must include: Branching or revision if initial hypothesis fails
  • Output: Clear decomposition into independent sub-tasks

When to use:

  • New feature with multiple moving parts
  • Refactoring that crosses module boundaries
  • Bug with unclear root cause
  • Performance optimization requiring trade-off analysis
  • Integration with external systems

Skip only if: The task is a trivial, isolated change (e.g., fix a typo, change a constant, add a single prop).


Gate 4: Documentation Lookup (Context7)

REQUIRED when task involves external libraries or frameworks.

Before using any external library API:

  1. Identify libraries from:

    • package.json dependencies
    • Import statements in relevant files
    • User mentions of specific libraries
  2. Resolve library IDs:

    • Run resolve-library-id(libraryName=<name>, query=<task>)
    • Select best match based on source reputation and benchmark score
  3. Query documentation:

    • Run query-docs(libraryId=<id>, query=<specific question>)
    • Query for: API patterns, configuration options, examples, best practices
    • Query for: version-specific behavior (check if API changed)
  4. Document findings in your plan or reasoning

Skip only if: The task uses only standard language features with no external libraries.


Plan Mode Workflow (EnterPlanMode → ExitPlanMode)

When EnterPlanMode is called, follow this exact sequence:

Step 1: Universal Pre-Flight Gates

Complete Gates 1–4 above. Announce PLAN_GATE status.

Step 2: Brainstorming (if creative work)

If the task involves creating NEW features, components, UI, or behavior:

  • Invoke brainstorming skill
  • Explore project context first
  • Ask clarifying questions ONE AT A TIME
  • Propose 2-3 approaches with trade-offs
  • Present design sections and get user approval
  • Write design doc to docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md
  • HARD GATE: Do NOT proceed to planning until user approves design

Step 3: Systematic Debugging (if bug fix)

If the task involves fixing a bug or unexpected behavior:

  • Invoke systematic-debugging skill
  • Complete Phase 1: Root Cause Investigation BEFORE proposing fixes
  • Reproduce consistently, check recent changes, gather evidence
  • HARD GATE: Do NOT propose fixes until root cause is identified

Step 4: Plan Writing (writing-plans)

Only after all gates pass and design is approved:

  • Invoke writing-plans skill
  • Map file structure before defining tasks
  • Each step = one action (2-5 minutes)
  • Exact file paths, complete code, exact commands
  • No placeholders ("TBD", "implement later", "add validation")
  • Self-review: spec coverage, placeholder scan, type consistency
  • Visualize the plan: invoke claude-mermaid:mermaid-diagrams (plugin) to render the phase flow and dependency graph with mermaid_preview. Embed the diagram (or its mermaid_save path) into the plan file before exiting plan mode. Required for any plan with >2 phases or cross-surface dependencies.
  • Save plan to two locations (both are mandatory):
    1. Project root (primary): plan-YYYY-MM-DD-<feature-name>.md at the repo/project root (e.g., plan-2026-05-15-feature-name.md) — committed with the project
    2. Docs directory (secondary): docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md — existing convention, kept as archive copy
    • Use the same <feature-name> slug in both paths (kebab-case, 2–5 words)

Step 5: Execution Handoff

  • Offer execution choice: subagent-driven vs inline
  • If subagent-driven → subagent-driven-development
  • If inline → executing-plans
  • If multi-phase → reference strategic-compact for compaction points

Step 6: ExitPlanMode

  • Present plan to user
  • Wait for approval before executing

Code Mode Workflow (Direct Implementation)

When user asks for direct implementation (no EnterPlanMode):

Step 1: Universal Pre-Flight Gates

Complete Gates 1–4 above. Announce PLAN_GATE status.

Step 2: Skill-Specific Execution

Follow the skills identified in Gate 1:

  • Frontend work → frontend-design-gate + design skills
  • Backend work → backend-patterns + relevant domain skills
  • Bug fix → systematic-debugging (root cause first)
  • Testing → tdd-workflow or test-driven-development

Step 3: Tracking

  • Use TodoWrite to track progress
  • Run verifications after each step
  • Stop when blocked, don't guess

Step 4: Completion

  • Run verification-before-completion or verification-loop
  • Use finishing-a-development-branch if applicable

Anti-Patterns (STOP — You Are Rationalizing)

Thought Reality
"I'll explore first, then check skills" Skills tell you HOW to explore. Check first.
"This repo is small, I don't need jcodemunch" Even small repos have hidden dependencies. Index and query.
"I know this library already" Context7 has the latest docs. Verify assumptions.
"Sequential thinking is too slow" Shallow thinking produces broken plans. Spend time upfront.
"The user is in a hurry, skip planning" Rushed plans guarantee rework. Gates exist to prevent this.
"I already brainstormed in my head" Brainstorming skill has structured design doc requirements. Use it.
"jcodemunch tools are extra tokens" Understanding codebase saves more tokens than fixing wrong assumptions.
"I'll just read the main file quickly" assemble_task_context gives you the BEST context, not just the obvious files.
"Context7 is overkill for React" React hooks behavior changes between versions. Verify.
"This is a simple question, no gate needed" Questions about code require codebase context. Run the gate.

Skill Priority During Planning

When multiple skills apply, use this order:

  1. plan-mode-gate (this skill) — Always first
  2. using-superpowers — Skill discipline
  3. Process skills — How to approach (brainstorming, systematic-debugging, writing-plans)
  4. claude-mermaid:mermaid-diagrams (plugin) — Visualize the plan. Render the phase / dependency / architecture diagram for any plan that touches multiple surfaces or >2 phases. Plugin path: ~/.claude/plugins/marketplaces/claude-mermaid/skills/mermaid-diagrams/SKILL.md.
  5. Domain skills — What to build (frontend-design-gate, backend-patterns, tdd-workflow)
  6. Execution skills — How to execute (executing-plans, subagent-driven-development)
  7. Finishing skills — How to complete (finishing-a-development-branch, verification-before-completion)

Integration with frontend-design-gate

If the task involves frontend/UI work:

  1. Complete plan-mode-gate first (this skill)
  2. Then follow frontend-design-gate for design-specific workflow
  3. The two gates are complementary: plan-mode-gate ensures proper planning process; frontend-design-gate ensures proper design skills

Version History

  • 581d130 Current 2026-07-19 09:13

Same Skill Collection

attic/2026-07-09/skills-pre-update/taste-skill/SKILL.md
attic/2026-07-09/skills-pre-update/ui-ux-pro-max/SKILL.md
skills/agent-development/SKILL.md
skills/api-and-interface-design/SKILL.md
skills/api-contract-standards/SKILL.md
skills/architect-system-design/SKILL.md
skills/backend-api-standards/SKILL.md
skills/backend-code-review/SKILL.md
skills/backend-error-handling/SKILL.md
skills/backend-performance-standards/SKILL.md
skills/backend-standards-always-follow/SKILL.md
skills/canary-playwright/SKILL.md
skills/caveman/SKILL.md
skills/ci-cd-and-automation/SKILL.md
skills/code-execution-standard/SKILL.md
skills/code-review-and-quality/SKILL.md
skills/code-simplification/SKILL.md
skills/codebase-design/SKILL.md
skills/codebase-start-point-guide/SKILL.md
skills/command-development/SKILL.md
skills/composition-patterns/SKILL.md
skills/context-engineering/SKILL.md
skills/dead-code-and-change-audit/SKILL.md
skills/debug-investigation/SKILL.md
skills/debugging-and-error-recovery/SKILL.md
skills/deprecation-and-migration/SKILL.md
skills/design-extract/SKILL.md
skills/design-review-playwright/SKILL.md
skills/diagnose/SKILL.md
skills/documentation-and-adrs/SKILL.md
skills/domain-modeling/SKILL.md
skills/domain-scaffold-patterns/SKILL.md
skills/doubt-driven-development/SKILL.md
skills/dox-doc-tree/SKILL.md
skills/eval-harness/SKILL.md
skills/fix-lint-format/SKILL.md
skills/forensic-change-coupling/SKILL.md
skills/forensic-complexity-trends/SKILL.md
skills/forensic-debt-quantification/SKILL.md
skills/forensic-hotspot-finder/SKILL.md
skills/frontend-api-standards/SKILL.md
skills/frontend-code-review/SKILL.md
skills/frontend-response-handling/SKILL.md
skills/frontend-server-data-patterns/SKILL.md
skills/frontend-standards-always-follow/SKILL.md
skills/frontend-structure-standards/SKILL.md
skills/frontend-ui-engineering/SKILL.md
skills/git-workflow-and-versioning/SKILL.md
skills/golang-patterns/SKILL.md
skills/golang-testing/SKILL.md
skills/graphify/SKILL.md
skills/gsd-add-tests/SKILL.md
skills/gsd-ai-integration-phase/SKILL.md
skills/gsd-audit-fix/SKILL.md
skills/gsd-audit-milestone/SKILL.md
skills/gsd-audit-uat/SKILL.md
skills/gsd-autonomous/SKILL.md
skills/gsd-capture/SKILL.md
skills/gsd-cleanup/SKILL.md
skills/gsd-code-review/SKILL.md
skills/gsd-complete-milestone/SKILL.md
skills/gsd-config/SKILL.md
skills/gsd-debug/SKILL.md
skills/gsd-discuss-phase/SKILL.md
skills/gsd-docs-update/SKILL.md
skills/gsd-eval-review/SKILL.md
skills/gsd-execute-phase/SKILL.md
skills/gsd-explore/SKILL.md
skills/gsd-extract-learnings/SKILL.md
skills/gsd-fast/SKILL.md
skills/gsd-forensics/SKILL.md
skills/gsd-graphify/SKILL.md
skills/gsd-health/SKILL.md
skills/gsd-import/SKILL.md
skills/gsd-inbox/SKILL.md
skills/gsd-ingest-docs/SKILL.md
skills/gsd-manager/SKILL.md
skills/gsd-map-codebase/SKILL.md
skills/gsd-milestone-summary/SKILL.md
skills/gsd-mvp-phase/SKILL.md
skills/gsd-new-milestone/SKILL.md
skills/gsd-new-project/SKILL.md
skills/gsd-ns-context/SKILL.md
skills/gsd-ns-ideate/SKILL.md
skills/gsd-ns-manage/SKILL.md
skills/gsd-ns-review/SKILL.md
skills/gsd-ns-workflow/SKILL.md
skills/gsd-pause-work/SKILL.md
skills/gsd-phase/SKILL.md
skills/gsd-plan-phase/SKILL.md
skills/gsd-plan-review-convergence/SKILL.md
skills/gsd-pr-branch/SKILL.md
skills/gsd-profile-user/SKILL.md
skills/gsd-progress/SKILL.md
skills/gsd-quick/SKILL.md
skills/gsd-resume-work/SKILL.md
skills/gsd-review-backlog/SKILL.md
skills/gsd-review/SKILL.md
skills/gsd-secure-phase/SKILL.md
skills/gsd-ship/SKILL.md
skills/gsd-sketch/SKILL.md
skills/gsd-spec-phase/SKILL.md
skills/gsd-spike/SKILL.md
skills/gsd-stats/SKILL.md
skills/gsd-surface/SKILL.md
skills/gsd-thread/SKILL.md
skills/gsd-ui-phase/SKILL.md
skills/gsd-ui-review/SKILL.md
skills/gsd-ultraplan-phase/SKILL.md
skills/gsd-undo/SKILL.md
skills/gsd-update/SKILL.md
skills/gsd-validate-phase/SKILL.md
skills/gsd-verify-work/SKILL.md
skills/gsd-workspace/SKILL.md
skills/gsd-workstreams/SKILL.md
skills/huashu-design/SKILL.md
skills/improve-codebase-architecture/SKILL.md
skills/incremental-implementation/SKILL.md
skills/iterative-retrieval/SKILL.md
skills/lean-ctx/SKILL.md
skills/mcp-builder/SKILL.md
skills/mcp-usage-standards/SKILL.md
skills/mmx-cli/SKILL.md
skills/owasp-security/SKILL.md
skills/pdf/SKILL.md
skills/performance-optimization/SKILL.md
skills/plan-exec-stack-guide/SKILL.md
skills/planning-and-task-breakdown/SKILL.md
skills/postgres-patterns/SKILL.md
skills/project-reference-linkage/SKILL.md
skills/project-structure-map/SKILL.md
skills/qa-playwright/SKILL.md
skills/react-hooks-patterns/SKILL.md
skills/resolving-merge-conflicts/SKILL.md
skills/santa-review/SKILL.md
skills/scaffold-standards/SKILL.md
skills/security-and-hardening/SKILL.md
skills/service-layer-standards/SKILL.md
skills/shadcn/SKILL.md
skills/shipping-and-launch/SKILL.md
skills/skill-linkage-story/SKILL.md
skills/source-driven-development/SKILL.md
skills/spec-driven-development/SKILL.md
skills/strategic-compact/SKILL.md
skills/tailwind-design-system/SKILL.md
skills/taste-skill/SKILL.md
skills/tdd/SKILL.md
skills/tech-debt-audit/SKILL.md
skills/test-driven-development/SKILL.md
skills/tool-and-doc-selection/SKILL.md
skills/using-agent-skills/SKILL.md
skills/verification-loop/SKILL.md
skills/vite-react-best-practices/SKILL.md
skills/web-design-guidelines/SKILL.md
skills/webapp-testing/SKILL.md
skills/workflow-orchestrator/SKILL.md
skills/zoom-out/SKILL.md
attic/2026-07-09/skills-pre-update/huashu-design/SKILL.md
attic/2026-07-09/skills-pre-update/impeccable/SKILL.md
skills/browser-testing-with-devtools/SKILL.md
skills/codebase-intel-first/SKILL.md
skills/docx/SKILL.md
skills/find-skills/SKILL.md
skills/gsd-help/SKILL.md
skills/gsd-ns-project/SKILL.md
skills/gsd-settings/SKILL.md
skills/higgsfield-generate/SKILL.md
skills/higgsfield-marketplace-cards/SKILL.md
skills/higgsfield-product-photoshoot/SKILL.md
skills/higgsfield-soul-id/SKILL.md
skills/higgsfield-websites/SKILL.md
skills/impeccable/SKILL.md
skills/jcodemunch-token-saver/SKILL.md
skills/pptx/SKILL.md
skills/tdd-auto-init/SKILL.md
skills/ui-ux-pro-max/SKILL.md
skills/update-docs/SKILL.md
skills/xlsx/SKILL.md
skills/autoplan/SKILL.md
skills/benchmark/SKILL.md
skills/browse/SKILL.md
skills/careful/SKILL.md
skills/connect-chrome/SKILL.md
skills/context-restore/SKILL.md
skills/design-consultation/SKILL.md
skills/design-html/SKILL.md
skills/design-review/SKILL.md
skills/design-shotgun/SKILL.md
skills/diagram/SKILL.md
skills/document-generate/SKILL.md
skills/freeze/SKILL.md
skills/guard/SKILL.md
skills/investigate/SKILL.md
skills/ios-clean/SKILL.md
skills/ios-design-review/SKILL.md
skills/ios-sync/SKILL.md
skills/landing-report/SKILL.md
skills/make-pdf/SKILL.md
skills/open-gstack-browser/SKILL.md
skills/pair-agent/SKILL.md
skills/plan-design-review/SKILL.md
skills/plan-devex-review/SKILL.md
skills/plan-tune/SKILL.md
skills/qa/SKILL.md
skills/setup-browser-cookies/SKILL.md
skills/setup-deploy/SKILL.md
skills/setup-gbrain/SKILL.md
skills/ship/SKILL.md
skills/skillify/SKILL.md
skills/spec/SKILL.md
skills/sync-gbrain/SKILL.md
skills/unfreeze/SKILL.md
skills/benchmark-models/SKILL.md
skills/canary/SKILL.md
skills/codex/SKILL.md
skills/context-save/SKILL.md
skills/cso/SKILL.md
skills/devex-review/SKILL.md
skills/document-release/SKILL.md
skills/gstack-upgrade/SKILL.md
skills/health/SKILL.md
skills/ios-fix/SKILL.md
skills/ios-qa/SKILL.md
skills/land-and-deploy/SKILL.md
skills/learn/SKILL.md
skills/office-hours/SKILL.md
skills/plan-ceo-review/SKILL.md
skills/plan-eng-review/SKILL.md
skills/qa-only/SKILL.md
skills/retro/SKILL.md
skills/review/SKILL.md
skills/scrape/SKILL.md

Metadata

Files
0
Version
581d130
Hash
abd0b893
Indexed
2026-07-19 09:13

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-22 03:33
浙ICP备14020137号-1 $Carte des visiteurs$