Initialize planning session — multi-select contexts, analyze codebase, select or create a scenario. Accepts a context name or repo path as argument.
Initialize a planning session. This skill lets the user select one or more contexts (markdown files with project knowledge and generation rules), then select or create a scenario. The selected contexts are recorded in manifest.json so all other plan-* skills know what to load.
| Invocation | Behavior |
|---|---|
/plan-init | Show context multi-selector, then scenario selector |
/plan-init devxapps-project | Pre-select the named context, still show full selector for additional picks |
/plan-init C:\MCDC\DevXApps | Use this repo path, show context selector |
plan-* skillsmanifest.json in the scenario directory (with contexts array and scenario metadata)This skill does NOT dispatch sub-agents. It runs interactively in the current session because it requires user input at multiple decision points.
Always present a context selector. Contexts are markdown files that provide project knowledge, generation rules, conventions, or any combination. The user can select multiple — they compose in order.
[workspace-root]/plans/.contexts/ for .md files (excluding index.md)If contexts exist — show multi-select:
=== Select Contexts ===
Select one or more contexts for this plan.
Contexts compose in order — later ones override earlier ones where they conflict.
[x] 1. devxapps-project [project] DevXApps — paths, build, architecture
[ ] 2. metagraph-api [project] Metagraph API — Neo4j, T4, OData
[x] 3. performance-audit [generation-rules] 4 docs, data-driven, Tokyo Night
[ ] 4. feature-planning [generation-rules] Full 7-doc suite, GitHub Dark
[ ] 5. lean [generation-rules] Minimal 2-doc planning
[ ] 6. mcdc-portal-pages [scenario] Portal page inventory, API map, perf baselines
─────────────────────────────────
[c] Create new context (runs /plan-context create)
[i] Import built-in templates
(Space to toggle, Enter to confirm)
Contexts can be at any granularity:
devxapps-project — covers the whole projectmcdc-portal-pages — specific pages, specific APIs, specific perf baselinesperformance-audit — how to generate docsThe more specific the context, the better the LLM's output. Encourage users to create focused contexts for specific scenarios (e.g., a context per page group, per API domain, per feature area).
If no contexts exist:
=== Select Contexts ===
No contexts found in plans/.contexts/
[c] Create new context
[i] Import built-in templates (feature-planning, performance-audit, lean)
A context is required — it tells the planning pipeline about your project
and how documents should be generated.
At least one context must be selected. If the user wants minimal setup, they can import built-in templates and select lean.
After selection: Read all selected .md files. Extract any project paths mentioned (for Step 1). Proceed.
If user chooses [c]: Invoke /plan-context create. After creation, return to the selector with the new context pre-selected.
Determine which repository this scenario targets.
Your contexts reference multiple projects:
1. MicroPortalApp (C:\MCDC\DevXApps)
2. Metagraph API (C:\MCDC\Metagraph_Coral)
Which project is this scenario for? (or "both")
Store the resolved repo root path as repoRoot.
Call the plan_get_context MCP tool to scan the repository:
Use the plan_get_context MCP tool with the repoRoot path.
This returns:
| Field | Description |
|---|---|
projectType | e.g., "node", ".NET", "mixed (.NET + Node)" |
techStack | Array of detected technologies (React, TypeScript, .NET, Neo4j, etc.) |
patterns | Array of architectural patterns (MSBuild traversal, T4 code generation, etc.) |
conventions | Array of project conventions extracted from CLAUDE.md |
structure | Object with top-level dirs, csproj files, README summary |
Call the plan_list_scenarios MCP tool to find all existing scenarios in the workspace:
Use the plan_list_scenarios MCP tool.
Display the results in a formatted table:
Existing Scenarios in [repoName]:
---------------------------------------------------------------------------
# Scenario Name Contexts Documents
1 my-feature devxapps, feature-planning design, test-plan
2 portal-perf-opt devxapps, perf-audit index, analysis, design
---------------------------------------------------------------------------
If selecting an existing scenario:
manifest.json to get metadatamanifest.json with new contexts.If creating a new scenario:
plan_create_scenario MCP tool:Use the plan_create_scenario MCP tool with:
- repoRoot: the resolved repo root path
- scenarioName: the user-provided name
- metadata: { description, workItem, tags }
{repoRoot}/plans/{scenario-name}/manifest.jsonRead manifest.json, add the contexts array, and write it back:
{
"scenario": "portal-perf-opt",
"displayName": "Portal Performance Optimization",
"description": "Optimize portal page load performance",
"workItem": "123456",
"tags": ["performance", "portal"],
"status": "draft",
"createdAt": "2026-04-16T12:00:00Z",
"contexts": ["devxapps-project", "portal-admin-pages", "performance-audit"]
}
The contexts array is an ordered list of context names. Skills resolve these to .md files by scanning plans/.contexts/{name}.md.
That's it. No separate state file. manifest.json is the single source of truth for the scenario.
Print a formatted summary to the user:
=== Plan Initialized ===
Contexts: devxapps-project + performance-audit
Repository: DevXApps
Scenario: portal-perf-opt
Path: C:/MCDC/DevXApps/plans/portal-perf-opt
Description: Optimize portal page load performance
Work Item: ADO#123456
--- From devxapps-project.md ---
Projects: MicroPortalApp (React 18, TypeScript, NX)
Build: npm run build:dev (~2min)
Conventions: Zustand, Fluent UI v9, i18n required
--- From performance-audit.md ---
Documents: index, analysis, design, implementation-plan (4 docs)
Theme: Tokyo Night
Anti-patterns: 7 rules active
--- Codebase Analysis ---
Project Type: mixed (.NET + Node)
Tech Stack: React, TypeScript, .NET/C#, Azure Functions
Patterns: MSBuild traversal, Jest testing
--- Next Steps ---
/plan-gen analysis Collect performance data
/plan-gen design Design optimization strategy
/plan-full Run full planning workflow (4 documents)
The "Next Steps" section only lists skills whose documents are enabled by the selected generation rules context. For example, with performance-audit selected, don't suggest /plan-gen state-machine or /plan-gen test-cases.
All plan-* skills follow this pattern:
1. Read manifest.json → get contexts array
2. For each context name, read plans/.contexts/{name}.md
3. Parse frontmatter (name, description, tags, agents)
4. Filter by current agent role (agents field)
5. Inject matching context content into agent prompt
Three-tier loading (see docs/context-design.md):
agents field| Error | Resolution |
|---|---|
| No contexts directory | Run /plan-context init to create it and import built-in templates |
| No contexts selected | At least one context is required. Show the selector again. |
Context .md file not found for a name in manifest | Warn and skip. Suggest /plan-context to fix. |
| Cannot detect repo from contexts | Ask user to provide the repo path explicitly |
plan_get_context MCP tool not available | Read CLAUDE.md manually from the repo root |
plan_list_scenarios fails | Fall back to scanning {repoRoot}/plans/ directory manually |
plan_create_scenario fails | Create the directory and manifest.json manually using Write tool |
| Skill | Depends On |
|---|---|
/plan-context | Upstream — creates the context .md files |
/plan-gen analysis | manifest.json (reads contexts, enriches with discovered patterns) |
/plan-gen design | manifest.json |
/plan-gen test-plan | manifest.json + design.html |
/plan-gen state-machine | manifest.json + design.html |
/plan-gen test-cases | manifest.json + design.html + test-plan.html |
/plan-gen implementation | manifest.json + design.html |
/plan-review | Any generated plan document |
/plan-full | Calls /plan-init as its first step |