| name | plan-and-execute |
| description | Plan & Execute โ spawn CTO/Architect/Coder/QA/PM sub-agents to create or rewrite a comprehensive plan, review it, then implement it fully. Asks 3 intake questions to fill placeholders before running. |
| user-invocable | true |
/plan-and-execute โ Multi-Agent Plan & Execute Pipeline
Language: Communicate with the user in Hebrew. All code, comments, and technical artifacts in English.
Authority: Context Governance framework (see ~/.claude/docs/GOVERNANCE-AGENT-GUIDE.md ยง9, ยง12). This skill orchestrates multi-agent planning and execution for any governed project. It is the most complex governance skill โ errors here cascade into every plan created.
This skill works on ANY project that has been initialized with /init-governance.
All paths are discovered dynamically from the project's docs/context/CONTEXT-MANIFEST.md.
Path Resolution (Dynamic)
Before any operation:
- Find the project root: use CWD, or walk up to the nearest directory containing
CLAUDE.md.
- Check for
docs/context/CONTEXT-MANIFEST.md at the project root.
- If found: Read the manifest to discover all canonical file paths. Proceed.
- If NOT found: The project is NOT governed. Suggest
/init-governance to the user. Produce a minimal briefing from CLAUDE.md alone (skip Steps 1.2+). Note the missing governance in the briefing.
- All paths in this skill are expressed RELATIVE to the detected project root. The manifest is the single source of truth for where files live.
When to invoke
- Manual:
/plan-and-execute when a user wants to create or revise a comprehensive plan
- Manual: when a complex multi-step task needs architecture + QA + implementation planning
- After: receiving user approval to start a large feature or refactor
- NOT for: small fixes, single-file changes, or documentation-only edits (use
/impact-safe-executor instead)
Inputs
ACTION โ "create" or "rewrite" (new plan vs. revising an existing one)
TOPIC โ the central theme of the plan (feature, module, architecture change, bug fix)
GOAL โ what the plan should achieve (the desired outcome)
These inputs are collected via Phase 0 intake questions if not already known from the user's invoking message.
Phase 0 โ Intake Questions (MANDATORY FIRST STEP)
Skip condition: If the user's invoking message already contains clear answers for all 3 inputs (ACTION, TOPIC, GOAL), extract them directly and skip to Phase 1. For example, if the user writes /plan-and-execute create a new caching layer to reduce LLM API calls by 50%, then ACTION=create, TOPIC=caching layer, GOAL=reduce LLM API calls by 50%.
Otherwise, ask the user the 3 questions below in a SINGLE message:
Question 1 โ Action Type:
- "ืืืฆืืจ ืชืื ืืช ืืืฉื ืื ืืฉืืชื ืชืื ืืช ืงืืืืช?"
- Options: "ืืืฆืืจ" (new plan from scratch) / "ืืฉืืชื" (update/rewrite an existing plan)
Question 2 โ Topic:
- "ืืื ืื ืืฉื ืืืจืืื ืฉื ืืชืื ืืช?"
- Let the user type freely. Provide examples like: "Feature ืืืฉ", "ืืจืืืืงืืืจื", "Bug Fix", "ืฉืืจืื ืืืืื"
Question 3 โ Goal:
- "ืืื ืืืจืช ืืชืื ืืช? (ืื ืื ืื ื ืจืืฆืื ืืืฉืื?)"
- Let the user type freely. Provide examples like: "ืฉืืคืืจ ืืืฆืืขืื", "ืืืกืคืช ืืืืืช ืืืฉื", "ืชืืงืื ืืขืื ืงืจืืืืช"
Once you receive the 3 answers, substitute them into the placeholders below and proceed to Phase 1.
Phase 1 โ Governance-Aware Context Loading
1.1 Read Orchestration Tier (mandatory)
Read these files IN ORDER. They form the mandatory baseline (~25K tokens):
| # | File | Role | How to read |
|---|
| 1 | docs/context/CONTEXT-MANIFEST.md | Meta-index โ lists every canonical file with path, role, authority, status | Read in full. This is the entry point for all context discovery. |
| 2 | CLAUDE.md | Project orchestration โ architecture, deployment topology, key concepts | Read in full (should be <500 lines). |
| 3 | Plans/PLAN.md | Active sub-plan router โ what is currently being worked on | Read in full. Check which sub-plans are IN_PROGRESS. |
| 4 | docs/context/HANDOFF.md | Active session bridge (may be a pointer to another file) | Read. If type: pointer, follow points_to and read the target file. |
| 5 | docs/context/OPEN-PROBLEMS.md | Unresolved work tracker (may be a pointer) | Read first 80 lines (P1 + start of P2). Follow pointer if needed. |
| 6 | version.json | Version SSOT | Read โ version number is authoritative here, not in CLAUDE.md. |
1.2 Selective Context Loading (scoped to TOPIC + GOAL)
Use the CONTEXT-MANIFEST's "Canonical Files" table to match the plan's topic against available context. Load ONLY what is relevant:
| File | When to load | How to load |
|---|
docs/context/CONVENTIONS.md | Always (code style, security rules, operational patterns) | Read in full (~100-200 lines). |
docs/context/GOTCHAS.md | Always | NEVER read in full (can be >80KB). Grep by TOPIC + GOAL keywords only. |
docs/context/SCHEMAS-INDEX.md | When touching APIs, data models, config, DB schemas | Read relevant sections only. |
docs/context/MEMORY.md | When making architectural decisions or debugging repeated failures | Read in full (~100 lines). Contains durable decisions + lessons + pitfalls. |
User-level memory ~/.claude/projects/<project>/memory/MEMORY.md | Always (workflow rules, feedback, user preferences) | Read in full. |
Token budget for Steps 1.1 + 1.2: ~55K tokens maximum. Do NOT read archived files, full MDs/ directories, or all plan files.
1.3 Create Shared Folder
Create a dedicated shared folder for inter-agent communication:
Plans/Shared-Folder/{plan-topic-slug}_{YYYY-MM-DD_HH-mm}/
Create the main plan file inside it: PLAN.md
1.4 Spawn Sub-Agents
Using the Agent tool, spawn the following specialized sub-agents. Each agent receives a focused context brief (NOT the full context dump โ summarize what you learned in 1.1-1.2 into a concise brief per agent). Each agent writes its section directly into the shared PLAN.md file.
| Role | Responsibility | Key context to include in brief |
|---|
| CTO | High-level architecture decisions, technology choices, risk assessment | Architecture from CLAUDE.md, deployment topology, active sub-plans from PLAN.md |
| Software Architect | Detailed system design, module boundaries, data flow, API contracts | SCHEMAS-INDEX sections, CONVENTIONS, relevant GOTCHAS grep results |
| Expert Coder | Implementation feasibility, code structure, patterns, edge cases | CONVENTIONS, relevant GOTCHAS, file roles from CLAUDE.md |
| QA Expert | Test strategy, test cases, E2E scenarios, regression risks | OPEN-PROBLEMS (to avoid re-introducing resolved bugs), GOTCHAS |
| PM | Task breakdown, dependencies, milestones, acceptance criteria | PLAN.md (current state), HANDOFF (remaining items), OPEN-PROBLEMS |
1.5 Build the Plan
The plan document (PLAN.md) must include:
- Executive Summary โ what we're doing and why
- Architecture & Design (Architect + CTO)
- Implementation Steps โ numbered, ordered, with file paths (Coder + Architect)
- QA Strategy โ tests, E2E, validation steps embedded IN EVERY implementation step (QA)
- Risk Assessment โ what could go wrong and mitigations (CTO + PM)
- Task Breakdown & Dependencies (PM)
- Acceptance Criteria โ how we know we're done (PM + QA)
- Governance Integration โ which canonical files need updating after implementation (from CONTEXT-MANIFEST)
The ACTION is: {{ACTION}} (ืืืฆืืจ / ืืฉืืชื)
The TOPIC is: {{TOPIC}}
The GOAL is: {{GOAL}}
Phase 2 โ Plan Review & Enrichment
2.1 Contradiction Check
Cross-reference the plan against the Source-of-Truth Hierarchy (from ~/.claude/docs/GOVERNANCE-AGENT-GUIDE.md ยง3):
| Priority | Source |
|---|
| 1 (highest) | Runtime code + tests |
| 2 | version.json |
| 3 | Plans/PLAN.md |
| 4 | docs/context/OPEN-PROBLEMS.md |
| 5 | docs/context/HANDOFF.md |
| 6 | docs/context/MEMORY.md |
| 7 | docs/context/CONVENTIONS.md |
| 8 | CLAUDE.md |
Look specifically for:
- Facts that CONTRADICT anything in the plan (higher-priority source wins)
- Existing implementations that the plan overlaps with (read actual code, don't trust docs alone)
- Relevant gotchas: grep
docs/context/GOTCHAS.md for every file path and module name mentioned in the plan
- Security considerations from
docs/context/CONVENTIONS.md (security section)
- Durable decisions from
docs/context/MEMORY.md that constrain the plan
2.2 Update the Plan
For every update, addition, or correction โ add a timestamp:
[YYYY-MM-DD HH:MM] Updated: <description of change>
Improvements to apply:
- Cross-reference with gotchas (grep by file paths + module names in the plan)
- Verify no architectural violations per CONVENTIONS
- Ensure QA + Tests + E2E are embedded in EVERY step
- Add missing edge cases
- Strengthen security considerations
- Validate all file paths and module references ACTUALLY EXIST on disk (use Glob/Grep)
2.3 Final Review
Run one final review pass with the QA agent to verify:
- Every step has a verification method
- No circular dependencies
- All acceptance criteria are testable
- The plan is implementable in sequence
- No conflict with OPEN-PROBLEMS entries
Phase 3 โ Full Implementation
3.1 Execute the Plan
Implement ALL steps in the plan, continuously, until completion:
- Follow the exact order defined in the plan
- Before each code-changing step, apply
/impact-safe-executor principles:
- Identify files that will be modified and their dependents (impact map)
- Verify the step stays within the approved plan scope
- If the step would touch files outside the plan's scope -> STOP and ask the user
- Prefer minimal edits โ don't refactor surrounding code
- Grep
docs/context/GOTCHAS.md for the specific files being modified (by filename)
- After each step, run the QA checks defined for that step
- If a step fails QA โ fix before proceeding
- Update the plan file with completion timestamps:
[YYYY-MM-DD HH:MM] COMPLETED: Step X โ <description>
- Use the Agent tool for parallel implementation where steps are independent
3.2 Post-Implementation Verification
After ALL steps are complete:
- Run full QA suite (server-side + client-side)
- Verify no regressions introduced
- Confirm all acceptance criteria are met
- Update plan status to COMPLETED
3.3 Governance State Update
MANDATORY FIRST STEP: Invoke /pre-close-check before any governance write. If verdict is not clean, STOP and resolve parallel-session drift before proceeding. See ~/.claude/skills/pre-close-check/SKILL.md for details.
After the pre-close check passes, invoke /live-state-orchestrator to update the governance layer. The orchestrator will handle:
Plans/PLAN.md โ add milestone log entry with completion date and summary
docs/context/OPEN-PROBLEMS.md โ mark any resolved items, add any new issues discovered
docs/context/MEMORY.md โ add durable decisions or lessons learned (if any)
docs/context/GOTCHAS.md โ append new gotchas discovered during implementation
docs/context/CONVENTIONS.md โ update if new patterns were established
docs/context/SCHEMAS-INDEX.md โ update if new schemas/APIs were added
CLAUDE.md โ update if architecture changed (keep <500 lines)
docs/context/CONTEXT-MANIFEST.md โ update verified_on dates for modified files
If /live-state-orchestrator is not available (ungoverned project), perform these updates manually following the same checklist.
3.4 Finish
Ask the user if they want to run /full-finish for the full release pipeline. Do NOT invoke it automatically.
Behavior contract
- Discover project paths dynamically from
docs/context/CONTEXT-MANIFEST.md. Do NOT hardcode paths.
- Project-agnostic. Works with ANY governed project. All paths resolved from manifest.
- Source-of-Truth Hierarchy. When files disagree, higher-priority source wins (code > version.json > PLAN > OPEN-PROBLEMS > HANDOFF > MEMORY > CONVENTIONS > CLAUDE.md).
- Selective Context Loading. Load ONLY files relevant to the plan's topic. Never read all MDs or all Plans.
- GOTCHAS.md is grep-only. Never read the full file (can be >80KB). Always grep by keywords.
- Every implementation step MUST have QA embedded. No exceptions.
- Timestamps on everything. Plan changes, completions, issues found.
- Shared folder is the single source of truth for inter-agent communication during planning.
- Hebrew for communication, English for code.
- Verification Gate. Never mark work as DONE without external evidence (test output, build log, docker logs, HTTP probe). "Looked correct" is NOT evidence.
- Concurrency safe. Check for
.lock files before writing shared governance files.
- Token budget. Phase 1: ~55K tokens. Total skill execution: depends on plan scope.
Stop conditions
The skill stops and asks the user when:
Plans/PLAN.md has multiple sub-plans IN_PROGRESS simultaneously (ambiguous focus)
- A fact in the plan CONTRADICTS a higher-priority source and auto-resolution is unsafe
- Two sources at the same hierarchy level disagree (Stop-Report Protocol)
- A planned write would touch files outside the declared plan scope
- Evidence collection fails โ cannot verify a completed step
- A gotcha attached to a target file warns against the exact planned change
- The project is not governed (no CONTEXT-MANIFEST.md) and
CLAUDE.md is also absent
/full-finish would be triggered โ always ask user first, never auto-invoke
Reference
~/.claude/docs/GOVERNANCE-AGENT-GUIDE.md ยง3 (Source-of-Truth Hierarchy)
~/.claude/docs/GOVERNANCE-AGENT-GUIDE.md ยง5 (Selective Context Loading)
~/.claude/docs/GOVERNANCE-AGENT-GUIDE.md ยง7 (Stop-Report Protocol)
~/.claude/docs/GOVERNANCE-AGENT-GUIDE.md ยง8 (Verification Gate)
~/.claude/docs/GOVERNANCE-AGENT-GUIDE.md ยง9 (Skills Reference)
~/.claude/docs/GOVERNANCE-AGENT-GUIDE.md ยง10 (File Mutation Rules)
~/.claude/docs/GOVERNANCE-AGENT-GUIDE.md ยง12 (Dynamic Path Detection)