Moonspec plan

From MoonLadderStudios/MoonMind · View interactive version

Moonspec plan is an AI agent skill from the GitHub repository MoonLadderStudios/MoonMind. Generate a MoonSpec implementation plan and design artifacts from a single-story spec. Use when the user asks to run or reproduce `/moonspec.plan`, create or update `plan.md`, produce `research.md`, `data-model.md`, `contracts/`, or `quickstart.md`, evaluate repo principles, define separate unit and

How to use this skill

Skill file

MoonSpec Plan

Use this skill after a feature spec exists and the user wants implementation planning artifacts for exactly one independently testable story.

When To Use

Use this skill when the user wants to:

Do not use this skill to create a spec from a request. Use moonspec-specify or moonspec-breakdown first.

Inputs

Pre-Plan Hooks

Before setup, check for extension hooks:

  1. If .specify/extensions.yml exists, read it and look for hooks.before_plan.
  2. If the YAML cannot be parsed or is invalid, skip hook checking silently.
  3. Ignore hooks where enabled is explicitly false; hooks without enabled are enabled.
  4. Do not evaluate non-empty condition expressions. Treat hooks with no condition, null condition, or empty condition as executable. Skip hooks with non-empty conditions.
  5. For each executable hook:
## Extension Hooks

**Optional Pre-Hook**: {extension}
Command: `/{command}`
Description: {description}

Prompt: {prompt}
To execute: `/{command}`
## Extension Hooks

**Automatic Pre-Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}

Wait for the result of the hook command before proceeding to the Outline.

If no hooks are registered or .specify/extensions.yml does not exist, skip silently.

Setup

Run the setup script from the repository root and parse its JSON output:

.specify/scripts/bash/setup-plan.sh --json

Parse:

The setup script creates the feature directory when needed and copies templates/plan-template.md to IMPL_PLAN.

For shell arguments containing single quotes, use shell-safe escaping such as 'I'\''m Groot', or double quotes when possible.

Load Context

Read:

Validate before planning:

Fill plan.md

Follow templates/plan-template.md structure and preserve its headings.

Fill:

Add a ## Requirement Status section after ## Summary with one row per in-scope item that materially affects delivery:

Use this table shape:

| ID | Status | Evidence | Planned Work | Required Tests |

| -------------- | ---------------------- | --------------------------- | ---------------------------- | ------------------------ |

| FR-001 | missing | none found | add code and tests | unit + integration |

| SCN-001 | implemented_unverified | src/..., no scenario test | add verification tests first, with implementation contingency if they fail | integration |

| SC-002 | unverified | reason: GPU unavailable; verifiableBy: GPU CI | disclosure only | none |

| DESIGN-REQ-004 | implemented_verified | src/..., tests/... | no new implementation | none beyond final verify |

When a row originates from a stable source claim, include the claim ID in the ID cell or in the evidence text so /moonspec.tasks can map every implementation task back to stable claim provenance. If no stable source claim applies, write No stable source claim applies: <reason> in the evidence text.

Allowed Status values:

Unverified criteria are disclosure-only. Normalize issue-brief unverifiable and source-matrix UNVERIFIED to unverified, retaining the source ID and nonblank unverified.reason and unverified.verifiableBy (reason and verifiableBy in the plan table). This status takes precedence over implemented_unverified when the check remains outside the verifier's capabilities, access, or time after reasonable attempts. It creates no test, verification, or fallback implementation tasks, even for required criteria. Do not infer missing implementation from unavailable evidence. Observed defects still require remediation; classify those separately as missing, partial, or conflicting implementation work. Actual permission needed to perform an action uses needs_human, never an Unverified evidence waiver.

Rules:

Mark technical unknowns as NEEDS CLARIFICATION only when they block defensible planning and cannot be resolved from the repo, spec, or conventional project patterns.

Principles Check

Evaluate relevant AGENTS.md principles, testing discipline, and repo constraints before Phase 0 research.

Rules:

Phase 0: Research And Repo Gap Analysis

Generate research.md in SPECS_DIR.

Research and resolve:

For each in-scope item, inspect relevant code and tests, then classify it:

Use this format for each topic in research.md:

## [Topic or Requirement ID]

Decision: [choice, status, and/or planned work]
Evidence: [relevant file paths, tests, or contracts]
Rationale: [why this choice or status was chosen]
Alternatives considered: [what else was evaluated]
Test implications: [unit, integration, both, or none beyond final verify]

After research.md is complete:

Phase 1: Design And Contracts

Generate design artifacts in SPECS_DIR:

Contract guidance:

Quickstart guidance:

Agent Context

Keep feature technology and status in plan.md. Routine planning must not change

lasting repository guidance. The agent context script is a no-op by default.

Only when the user explicitly requests a lasting guidance edit, run:

.specify/scripts/bash/update-agent-context.sh --write __AGENT__

Replace __AGENT__ with the active integration key when known. If unknown, omit

the agent argument to update existing agent files. The --write flag records the

explicit request; it is not a routine planning prerequisite.

An authorized update must preserve manual additions, symlink targets and existing

file permissions. The script never creates or updates AGENTS.md from plan data, including through

an alias. Any explicitly requested repository-policy edit belongs in a separate,

intentional guidance change; a plan template cannot supply that policy. Report any update failure rather than claiming the

context was recorded.

Stop Point

This skill stops after planning and design artifacts. Do not generate tasks.md or implementation code.

Report:

Post-Plan Hooks

After reporting, check .specify/extensions.yml for hooks.after_plan using the same parsing, filtering, and condition rules as pre-plan hooks. For each executable hook:

## Extension Hooks

**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}

Prompt: {prompt}
To execute: `/{command}`
## Extension Hooks

**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}

If no hooks are registered or .specify/extensions.yml does not exist, skip silently.

Key Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.