Speckit analyze

From Anantys-oss/koan · View interactive version

Speckit analyze is an AI agent skill from the GitHub repository Anantys-oss/koan. Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.

How to use this skill

Skill file

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty).

Pre-Execution Checks

Check for extension hooks (before analysis):

```

## 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 Goal.

```

After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal {command} id shown above, e.g. a skills-mode agent runs it as /skill:speckit-... or $speckit-...). Emitting the block alone does not run the hook.

Goal

Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (spec.md, plan.md, tasks.md) before implementation. This command MUST run only after /speckit-tasks has successfully produced a complete tasks.md.

Operating Constraints

STRICTLY READ-ONLY: Do not modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).

Constitution Authority: The project constitution (.specify/memory/constitution.md) is non-negotiable within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside /speckit-analyze.

Execution Steps

1. Initialize Analysis Context

Run .specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:

Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).

For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").

2. Load Artifacts (Progressive Disclosure)

Load only the minimal necessary context from each artifact:

From spec.md:

From plan.md:

From tasks.md:

From constitution:

3. Build Semantic Models

Create internal representations (do not include raw artifacts in output):

4. Detection Passes (Token-Efficient Analysis)

Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.

A. Duplication Detection
B. Ambiguity Detection
C. Underspecification
D. Constitution Alignment
E. Coverage Gaps
F. Inconsistency

5. Severity Assignment

Use this heuristic to prioritize findings:

6. Produce Compact Analysis Report

Output a Markdown report (no file writes) with the following structure:

Specification Analysis Report

| ID | Category | Severity | Location(s) | Summary | Recommendation |

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

| A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |

(Add one row per finding; generate stable IDs prefixed by category initial.)

Coverage Summary Table:

| Requirement Key | Has Task? | Task IDs | Notes |

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

Constitution Alignment Issues: (if any)

Unmapped Tasks: (if any)

Metrics:

7. Provide Next Actions

At end of report, output a concise Next Actions block:

8. Offer Remediation

Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)

9. Check for extension hooks

After reporting, check if .specify/extensions.yml exists in the project root.

```

## Extension Hooks

Optional Hook: {extension}

Command: /{command}

Description: {description}

Prompt: {prompt}

To execute: /{command}

```

```

## Extension Hooks

Automatic Hook: {extension}

Executing: /{command}

EXECUTE_COMMAND: {command}

```

After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal {command} id shown above, e.g. a skills-mode agent runs it as /skill:speckit-... or $speckit-...). Emitting the block alone does not run the hook.

Operating Principles

Context Efficiency

Analysis Guidelines

Context

$ARGUMENTS

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.