Moonspec align

From MoonLadderStudios/MoonMind · View interactive version

Moonspec align is an AI agent skill from the GitHub repository MoonLadderStudios/MoonMind. Analyze and automatically remediate MoonSpec artifact inconsistencies across spec.md, plan.md, tasks.md, and related design files. Use when the user asks to run `/moonspec.align`, identify uncertainty, weigh tradeoffs in project context, edit artifacts without asking follow-up questions, resolve cov

How to use this skill

Skill file

MoonSpec Align

Use this skill to perform an automated analyze-to-remediate workflow for an active MoonSpec feature.

Scope

This skill edits MoonSpec execution artifacts, not application feature code. Typical targets are:

Alignment edits only temporary execution artifacts, never canonical docs/ files. Preserve explicit task-authorized behavior changes even when existing documentation describes the old behavior; their required in-place documentation corrections belong to implementation, not alignment edits. Otherwise use the adopted source requirements to guide the derived artifacts.

Resolve ordinary artifact uncertainty from project context. Preserve actual needs_human authority decisions for their owner; do not invent approval or convert them into implementation work.

Inputs

Setup

Run the prerequisite script from the repository root:

.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks

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.

Extension Hooks

Before analysis, check .specify/extensions.yml for hooks.before_align. After remediation and reporting, check it for hooks.after_align.

If the YAML cannot be parsed or is invalid, skip hook checking silently. Ignore hooks where enabled is explicitly false; hooks without enabled are enabled. 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.

For executable hooks:

Context Loading

Load enough context to make edits confidently, but do not paste whole artifacts into the final response.

Read:

Also inspect relevant repository files when needed to resolve uncertainty, especially test framework configuration, project layout, existing contracts, and naming conventions.

Analysis Model

Build an internal model before editing:

1. Explicit task-authorized behavior changes.

2. Applicable AGENTS.md requirements.

3. Source design requirements adopted by the task.

4. Original feature input preserved in spec.md.

5. spec.md user-visible behavior and acceptance criteria.

6. plan.md architecture and technical decisions.

7. Design artifacts such as contracts, data model, research, and quickstart.

8. tasks.md execution breakdown.

Detection Passes

Identify high-signal findings. Aggregate related issues instead of creating noisy one-off findings.

Uncertainty And Tradeoff Handling

For ordinary artifact uncertainty, choose a resolution from context; preserve an actual missing authority decision as needs_human.

Use this decision process:

  1. Name the uncertainty precisely.
  2. Gather available evidence from the artifacts and repository.
  3. List 2-3 plausible resolutions.
  4. Weigh pros and cons using project context:
  1. Choose the option that preserves higher-authority artifacts and requires the smallest coherent change.
  2. Record the chosen assumption in the edited artifact when future implementers need to know it.

Default choices:

Remediation Rules

Apply edits after analysis. Do not stop at a report.

Prefer these remediation patterns:

Constraints:

Editing Order

Use a stable top-down order so reruns are predictable:

  1. Principle conflicts.
  2. Source requirement and original-input preservation issues.
  3. Spec requirement, scenario, edge-case, entity, and success-criteria issues.
  4. Plan and design artifact issues.
  5. Task coverage, ordering, and test gaps.
  6. Quickstart and checklist consistency.

After each artifact class is edited, re-check downstream mappings before moving on.

Validation

After editing:

  1. Rerun the prerequisite script.
  2. Rebuild the analysis model.
  3. Verify:
  1. Run lightweight repository tests or formatting commands when the edits touched generated checks, test commands, or machine-readable contracts. If no relevant command exists, say so.

Report

Final response structure:

## MoonSpec Alignment

Updated:
- [artifact path]: [short summary]

Key decisions:
- [uncertainty]: chose [decision] because [project-context rationale]

Remaining risks:
- [risk or "None found"]

Validation:
- [command]: [result]

Keep the report concise. Include exact artifact paths and mention any remediation you intentionally skipped because it would require application code or new product scope.

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.