Moonspec tasks

From MoonLadderStudios/MoonMind · View interactive version

Moonspec tasks is an AI agent skill from the GitHub repository MoonLadderStudios/MoonMind. Generate a one-story, TDD-first MoonSpec `tasks.md` from `spec.md`, `plan.md`, and design artifacts. Use when the user asks to run or reproduce `/moonspec.tasks`, create or update an executable task breakdown, map one MoonSpec story to implementation tasks, require unit and integration tests before

How to use this skill

Skill file

MoonSpec Tasks

Use this skill to generate an executable tasks.md for one MoonSpec story.

Scope

Generate task artifacts only. Do not implement application code, run the implementation, create issues, or split broad designs. Use moonspec-breakdown for broad technical or declarative designs, moonspec-specify for creating a one-story spec, and moonspec-plan for planning artifacts.

The generated task list must:

tasks.md is an imperative, temporary execution artifact (see docs/Workflows/MoonSpecDocumentModel.md). Never copy its content into canonical docs/ files.

Inputs

Stop if spec.md is missing, plan.md is missing, or the spec contains more than one user story. Tell the user to run /moonspec.breakdown for broad designs or /moonspec.specify for a one-story replacement.

Pre-Tasks Hooks

Before generating tasks, check for extension hooks:

  1. If .specify/extensions.yml exists, read it and look for hooks.before_tasks.
  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 task generation.

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

Setup

Run the prerequisite script from the repository root:

.specify/scripts/bash/check-prerequisites.sh --json

Parse FEATURE_DIR and AVAILABLE_DOCS, then derive:

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

Load Context

Read:

Source Acceptance Coverage

Use the matching assessment and plan to separate executable work from disclosure-only rows before generating tasks. Missing, partial, or conflicting implementation needs tests and remediation. Apply the status rules below to all source rows, including negative constraints.

Build a traceability inventory before writing tasks:

For each row, carry forward the matching ## Requirement Status entry from plan.md when present. Allowed statuses are needs_human, missing, partial, unverified, implemented_unverified, and implemented_verified; apply assessment disclosure precedence before treating an otherwise unclassified row as missing.

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. When every row is unverified, retain disclosures and the final report verification task only; do not create setup, test-tool installation, red-first, implementation, or polish work. 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.

Status handling:

Each executable inventory row needs task coverage appropriate to its status and either unit or integration test coverage unless it is implemented_verified with strong existing evidence. For executable rows, acceptance scenarios, external boundaries, workflows, persistence, contracts, CLI/API/UI behavior, and service interactions require integration test coverage unless the spec clearly makes integration irrelevant or the row is already implemented_verified by existing integration evidence.

Generate tasks.md

Create or replace FEATURE_DIR/tasks.md using templates/tasks-template.md. Preserve the template's headings. Remove unused sample tasks; populate only work required by executable rows and final report verification.

Fill:

When plan.md includes ## Requirement Status, reflect those statuses in the source traceability summary and implementation strategy. The task list must distinguish code-and-test work, verification-only work, contingency implementation work, already-verified rows, and disclosure-only rows.

The output must be immediately executable by an LLM without extra context.

Task Format

Every generated task must use this exact checklist shape:

- [ ] [TaskID] [P?] Description with file path

Rules:

Good examples:

- [ ] T001 Create project structure in src/ and tests/ per implementation plan
- [ ] T012 [P] Add failing unit test for validation FR-001 in tests/unit/test_user.py
- [ ] T013 [P] Add failing integration test for signup scenario SCN-001 in tests/integration/test_signup.py
- [ ] T014 Implement UserService for FR-001 in src/services/user_service.py

Bad examples:

- [ ] Create User model
T001 Create model
- [ ] [US1] Create User model
- [ ] T010 Write tests later if needed

Task Organization

Use these phase headings, leaving phases with no executable work empty or marked N/A.

Phase 1: Setup

Include project initialization or tool configuration only when executable work needs it:

Phase 2: Foundational

Include only blocking prerequisites for the story:

No story implementation work can begin until this phase is complete.

Phase 3: Story

Create exactly one story phase. Include its summary and disclosures; include the following work items only when required by executable rows:

Order applicable executable story work as follows; omit inapplicable steps:

  1. Unit tests.
  2. Integration tests.
  3. Red-first confirmation.
  4. Fallback implementation tasks for implemented_unverified rows, explicitly conditional on verification failure.
  5. Models or entities.
  6. Services or domain logic.
  7. Endpoints, UI, CLI, public API, or contracts.
  8. Integration wiring.
  9. Story validation.

Unit and integration tests must be written and confirmed failing before implementation tasks for missing and partial rows. For implemented_unverified rows, verification tests should be run before fallback implementation tasks; if they pass, the fallback implementation tasks are skipped and final verification preserves traceability.

Final Phase: Polish And Verification

Include only work that strengthens the completed story without adding hidden scope:

Coverage Rules

Coverage rules below apply only to executable rows. unverified and needs_human rows of every kind, including acceptance scenarios, public boundaries, negative constraints, contracts, and required checks, remain non-executable; preserve disclosures or authority handoffs rather than generating task coverage or fallback work.

Do not generate tasks for future stories, broad refactors, speculative infrastructure, or implementation layers that are not needed by the single story.

Parallelization Rules

Mark a task [P] only when:

Safe parallel candidates often include:

Do not mark tasks [P] when they modify the same file, share generated artifacts, require ordered red-first confirmation, or depend on a common uncompleted fixture.

Validation

Before reporting, verify:

If validation fails, update tasks.md and validate again before reporting.

Report

Report:

Post-Tasks Hooks

After reporting, check .specify/extensions.yml for hooks.after_tasks using the same parsing, filtering, and condition rules as pre-tasks 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.