plan-gate
Use when reviewing a plan before implementation begins. Not for autonomous plan analysis — use plan-review agent instead. Challenges scope, walks through architecture/quality/tests/performance interactively with mandatory user checkpoints and opinionated recommendations.
What this skill does
# Plan Gate **Audience:** Engineers about to start implementation. **Goal:** Catch scope creep, missing coverage, and design flaws interactively before writing code. ## Priority Hierarchy If running low on context or user asks to compress: Step 0 > Test diagram > Opinionated recommendations > Everything else. Never skip Step 0 or the test diagram. ## Engineering Principles These guide all recommendations: - DRY — flag repetition aggressively - Well-tested — rather too many tests than too few - Engineered enough — not under-engineered (fragile) or over-engineered (premature abstraction) - Handle more edge cases, not fewer — thoughtfulness > speed - Explicit over clever - Minimal diff — achieve the goal with fewest new abstractions and files touched - Complexity proportional to the problem ## Diagrams - Use ASCII diagrams liberally for data flow, state machines, dependency graphs, pipelines, decision trees - When modifying code with existing ASCII diagrams nearby, verify accuracy and update in the same commit - Stale diagrams are worse than no diagrams — they actively mislead ## Step 0: Scope Challenge (Mandatory) Before reviewing anything, answer: 1. **What existing code already solves each sub-problem?** Can we capture outputs from existing flows rather than building parallel ones? 2. **What is the minimum set of changes that achieves the stated goal?** Flag work that could be deferred without blocking the core objective. Be ruthless about scope creep. 3. **Complexity check:** If plan touches >8 files or introduces >2 new classes/services, treat as a smell and challenge whether the same goal can be achieved with fewer moving parts. Then AskUserQuestion with three tracks: 1. **SCOPE REDUCTION** — Plan is overbuilt. Propose a minimal version that achieves the core goal, then review that. 2. **BIG CHANGE** — Work through interactively, one section at a time (Architecture > Code Quality > Tests > Performance) with at most 4 top issues per section. 3. **SMALL CHANGE** — Compressed review: Step 0 + one combined pass covering all 4 sections. Pick the single most important issue per section. Present as a single numbered list with lettered options + mandatory test diagram + completion summary. One AskUserQuestion round at the end. **If user does not select SCOPE REDUCTION, respect that decision fully.** Raise scope concerns once in Step 0 — after that, commit to the chosen scope and optimize within it. Do not silently reduce scope, skip planned components, or re-argue for less work. ## Review Sections (After Scope Is Agreed) ### 1. Architecture Review Evaluate: - System design and component boundaries - Dependency graph and coupling concerns - Data flow patterns and potential bottlenecks - Scaling characteristics and single points of failure - Security architecture (auth, data access, API boundaries) - Whether key flows deserve ASCII diagrams in the plan or code comments - For each new codepath or integration point: one realistic production failure scenario and whether the plan accounts for it **STOP.** Call AskUserQuestion with findings. Do NOT proceed until user responds. ### 2. Code Quality Review Evaluate: - Code organization and module structure - DRY violations — be aggressive - Error handling patterns and missing edge cases (call out explicitly) - Technical debt hotspots - Over-engineered or under-engineered areas - Existing ASCII diagrams in touched files — still accurate after this change? **STOP.** Call AskUserQuestion with findings. Do NOT proceed until user responds. ### 3. Test Review Make a diagram of all new UX, new data flow, new codepaths, and new branching outcomes. For each, note what is new. Then for each new item, verify a test exists. **STOP.** Call AskUserQuestion with findings. Do NOT proceed until user responds. ### 4. Performance Review Evaluate: - N+1 queries and database access patterns - Memory-usage concerns - Caching opportunities - Slow or high-complexity code paths **STOP.** Call AskUserQuestion with findings. Do NOT proceed until user responds. ## Issue Presentation Format For every issue found: 1. Describe the problem concretely with file and line references 2. Present 2-3 options including "do nothing" where reasonable 3. For each option: effort, risk, maintenance burden (one line) 4. **Lead with recommendation as directive:** "Do B. Here's why:" — not "Option B might be worth considering" 5. Map reasoning to a specific engineering principle above AskUserQuestion format: - Start: "We recommend [LETTER]: [one-line reason]" - List: `A) ... B) ... C) ...` - Label: issue NUMBER + option LETTER (e.g., "3B") - Recommended option listed first - One sentence max per option ## Required Outputs ### NOT In Scope List work considered and explicitly deferred, with one-line rationale per item. ### What Already Exists List existing code/flows that partially solve sub-problems. Note whether plan reuses them or unnecessarily rebuilds. ### TODOS.md Updates Deferred work that would meaningfully improve the system. Each entry: - **What:** One-line description - **Why:** Concrete problem it solves (not "nice to have") - **Context:** Enough detail for someone in 3 months to understand motivation, current state, where to start - **Depends on / blocked by:** Prerequisites or ordering constraints Ask user which deferred items to capture before writing. A TODO without context is worse than no TODO. ### Failure Modes For each new codepath from the test diagram, list one realistic failure (timeout, nil reference, race condition, stale data) and whether: 1. A test covers that failure 2. Error handling exists 3. User sees a clear error or silent failure If any failure mode has no test AND no error handling AND would be silent: flag as **critical gap**. ### Completion Summary ``` - Step 0: Scope Challenge (user chose: ___) - Architecture Review: ___ issues found - Code Quality Review: ___ issues found - Test Review: diagram produced, ___ gaps identified - Performance Review: ___ issues found - NOT in scope: written - What already exists: written - TODOS.md updates: ___ items proposed - Failure modes: ___ critical gaps flagged ``` ## Retrospective Learning Check git log for the branch. If prior commits suggest a previous review cycle (review-driven refactors, reverted changes), note what changed and whether the current plan touches the same areas. Be more aggressive reviewing previously problematic areas. ## Unresolved Decisions If user does not respond to an AskUserQuestion or interrupts to move on, note which decisions were left unresolved. At the end, list as "Unresolved decisions that may bite you later" — never silently default to an option.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.