Create executable plans for building systems, features, or modules. Use for planning requests, architectural decisions, or when decomposing big ideas into concrete implementation steps.
Use this skill for all planning requests, regardless of size. Discovery transforms ideas into concrete, executable plans.
Triggers:
Also use Discovery when:
Discovery works top-down through five levels:
IDEA "We need better analytics"
↓
OUTCOMES "Users can see trends; Admins can export reports"
↓
CAPABILITIES "Trend visualization; Data aggregation; Export service"
↓
FEATURES "Line chart component; Daily rollup job; CSV export endpoint"
↓
STEPS "1.1 Create chart component; 1.2 Add API route; 1.3 Wire up data"
Each level must be concrete enough that the next level can be derived. The final output is an orchestrator-ready plan with implementation steps.
Get the raw vision from the user. Don't judge scope yet.
Outcomes are user-visible results, not technical deliverables.
Ask:
Output: 2-5 concrete outcome statements.
Example:
Capabilities are system abilities that enable outcomes.
For each outcome, ask:
Output: Capabilities grouped by outcome.
Example:
Features are implementable units of work that deliver capabilities.
For each capability, ask:
Output: Feature list with clear boundaries.
This is critical for "fire and forget" plans. For each feature:
Each feature becomes 2-5 concrete implementation steps. This is what makes the plan orchestrator-ready.
For each feature, ask:
Step characteristics:
Naming convention:
{feature-number}.{step-number} format: 1.1, 1.2, 2.1, etc.Example decomposition:
Feature: "Line chart component"
→ Step 1.1: Create TrendChart.tsx with basic Chart.js setup
→ Step 1.2: Add time range toggle (7d/30d/90d)
→ Step 1.3: Connect to trends API endpoint
→ Step 1.4: Add loading state and error handling
If a plan requires installing dependencies, handle them explicitly:
deps array - otherwise parallel execution or out-of-order execution will fail because dependencies aren't availablenpm install --include=dev, pip install -e ".[test]", or the equivalent for the project's package managerExample:
Step 0.1: Install project dependencies (including test frameworks)
→ deps: []
Step 1.1: Create TrendChart component
→ deps: ["0.1"] ← Must reference the install step!
Step 1.2: Add unit tests for TrendChart
→ deps: ["0.1", "1.1"] ← Also depends on install step
Before producing the plan:
Generate an orchestrator-ready plan file with implementation steps. Each step must be self-contained - an agent should be able to execute it without asking questions.
Use the schema defined in ./schemas/plan-schema.yaml.
Output Location:
First, determine the plans directory by running:
orrery plans-dir
This prints the resolved plans directory (respects ORRERY_WORK_DIR when set).
orrery plans-dir<date>-<plan-name>.yaml2026-01-11)fix-clone-agent-skills)Document Project Context in Notes:
Use the notes field in metadata to capture project-specific context that agents need throughout execution. This is critical because when plans are broken into substeps, agents executing individual steps might not know project conventions.
Include in notes:
uv run pytest, npm test, make test) (check the README, pyproject.toml, package.json, etc. if applicable to understand: project manager, how to run tests, project conventions)uv run build, npm run build)uv run ruff check .)Plans are automatically validated via the PostToolUse hook when written. For manual validation, run:
orrery validate-plan <plans-dir>/<plan>.yaml
This catches common YAML issues like unquoted colons and normalizes formatting.
criteria: Output shows: timestamp valuecriteria: "Output shows: timestamp value"# plan.yaml
metadata:
created_at: "2026-01-11T10:00:00Z"
created_by: "Discovery-Agent"
version: "1.0"
source_idea: "We need better analytics"
outcomes:
- "Users can see usage trends over time"
- "Admins can export reports for stakeholders"
notes: |
This project uses uv for dependency management.
- Run tests: uv run pytest
- Run linting: uv run ruff check .
Always prefix Python commands with 'uv run'.
steps:
# ============================================================================
# Step 0: Setup (Dependencies)
# ============================================================================
- id: "0.1"
description: "Install project dependencies including test frameworks"
status: "pending"
deps: []
parallel: false
context: |
Install all dependencies required for the project. Include dev/test
dependencies since acceptance criteria involve running tests.
requirements:
- "Run npm install (or equivalent for the project)"
- "Include dev dependencies for testing"
criteria:
- "All dependencies install without errors"
- "Test framework is available (e.g., jest, pytest)"
files: []
commands:
- "npm install"
# ============================================================================
# Feature 1: Trends API Endpoint
# ============================================================================
- id: "1.1"
description: "Create trends service with data aggregation logic"
status: "pending"
deps: ["0.1"]
parallel: false
context: |
Stats are currently computed on-demand in statsService.ts. This step
creates a new service that aggregates historical data into time-series
format for the trends endpoint.
requirements:
- "Create src/api/services/trendsService.ts"
- "Function: getTrends(range: '7d' | '30d' | '90d')"
- "Returns { dates: string[], values: number[] }"
- "Query existing stats table, group by date"
criteria:
- "Service exports getTrends function"
- "Returns correctly shaped data for all range values"
- "Unit test with mocked data passes"
files:
- "src/api/services/trendsService.ts"
- "src/api/services/trendsService.test.ts"
context_files:
- "src/api/services/statsService.ts"
- id: "1.2"
description: "Add trends API route with caching"
status: "pending"
deps: ["1.1"]
parallel: false
context: |
Wire up the trends service to an HTTP endpoint. Use existing cache
middleware pattern from other routes.
requirements:
- "GET /api/stats/trends?range=7d|30d|90d"
- "Cache responses for 1 hour"
- "Validate range parameter"
criteria:
- "Endpoint returns 200 with valid JSON"
- "Invalid range returns 400"
- "Response time < 200ms (cached)"
files:
- "src/api/routes/stats.ts"
context_files:
- "src/api/middleware/cache.ts"
# ============================================================================
# Feature 2: Trend Visualization Component
# ============================================================================
- id: "2.1"
description: "Create base TrendChart component with Chart.js"
status: "pending"
deps: ["0.1", "1.2"]
parallel: false
context: |
Users currently see only current-day stats. This adds a line chart
using the existing Chart.js setup in src/components/charts/.
requirements:
- "Create TrendChart.tsx extending BaseChart"
- "Line chart with responsive sizing"
- "Accept data prop: { dates: string[], values: number[] }"
criteria:
- "Component renders with mock data"
- "Chart displays correctly at mobile and desktop widths"
files:
- "src/components/TrendChart.tsx"
context_files:
- "src/components/charts/BaseChart.tsx"
- "src/styles/charts.css"
risk_notes: "Chart.js bundle size - verify no significant increase"
- id: "2.2"
description: "Add time range toggle to TrendChart"
status: "pending"
deps: ["2.1"]
parallel: false
context: |
Add toggle buttons for 7d/30d/90d. Selecting a range should trigger
a data refetch.
requirements:
- "Toggle buttons: 7 days, 30 days, 90 days"
- "Active state styling for selected range"
- "onChange callback when range changes"
criteria:
- "Toggle switches time range"
- "Visual indication of selected range"
files:
- "src/components/TrendChart.tsx"
- id: "2.3"
description: "Connect TrendChart to API and add loading states"
status: "pending"
deps: ["2.2"]
parallel: false
context: |
Wire up the component to fetch from the trends API. Handle loading
and error states gracefully.
requirements:
- "Fetch from GET /api/stats/trends on mount and range change"
- "Loading skeleton while fetching"
- "Error state if API fails"
criteria:
- "Data loads from API on initial render"
- "Range change triggers new API call"
- "Loading skeleton appears during fetch"
- "Error message displays on API failure"
files:
- "src/components/TrendChart.tsx"
- "src/components/TrendChart.test.tsx"
Discovery is complete when:
When the plan is complete and validated, output the plan file path and present the user with their next options:
Plan created: <plans-dir>/<date>-<plan-name>.yaml
Next steps:
- /refine-plan <plans-dir>/<plan-file> — Analyze and improve the plan before execution
- /simulate-plan <plans-dir>/<plan-file> — Explore the plan through dialogue, ask "what if" questions
- orrery exec — (Command run from the terminal) Execute the plan with the orrery orchestrator
This ensures the user knows exactly what they can do next and has the full path to reference the plan.
npm install --include=dev, pip install -e ".[test]").When determining deps for each step, apply these rules:
Installation/Setup First: Any step that creates files depends on the step that installs dependencies or sets up the project structure.
File Creation Before Use: If step B reads or modifies files created by
step A, then B depends on A. Check the files field.
Import Dependencies: If step B's code will import from modules created in step A, then B depends on A.
Test Infrastructure: Steps that include tests depend on the step that sets up test infrastructure (fixtures, mocks, config).
API Before Consumers: Backend API endpoints must exist before frontend components that call them. Frontend steps depend on relevant backend steps.
Schema Before Implementation: Database schema/migrations must exist before repository code. Model definitions before API routes.
Example analysis:
routes/items.pyMark a step as parallel: true ONLY when ALL of these are true:
No file overlap: The step's files do not overlap with any other
parallel-eligible step at the same dependency level.
No logical dependency: The step does not use outputs, types, or patterns established by a peer step.
Independent domain: The step works in a different area of the codebase (e.g., frontend vs backend, different features).
Common parallel-safe patterns:
Common parallel-unsafe patterns:
Default to parallel: false when uncertain. Sequential execution is
always safe; incorrect parallelization causes merge conflicts and bugs.
Plan ordering matters: Even with parallel: true, steps respect plan
order. A serial step earlier in the plan acts as an implicit barrier for
later steps. Place foundational work early in the plan.
Before creating the plan, understand the existing project structure:
Check for existing conventions: If there's an existing src/ or lib/
directory, new code goes there. Don't create parallel structures.
Read configuration files: Check package.json, pyproject.toml, or
similar for project name, paths, and conventions.
Follow existing patterns: If the project has src/components/, new
components go there. Don't create components/ at the root.
Respect monorepo structure: If there's backend/ and frontend/,
keep that separation. Don't create new top-level directories.
Check CLAUDE.md or similar: Project instructions often specify where new code should go.
When the files field lists paths, use paths that match existing structure.
Example: If project has backend/src/, use backend/src/models/ not models/.