extract

extract is a command for coding agents from fistasolutions/fista-spec-kit. It costs 16 tokens per session (900 once invoked), scanned A, original, MIT.

A codebase-extraction command scans an existing project and turns its routes, components, and APIs into structured SpecKit documents. These documents describe the current system so it can be reused or extended.

In plain words
What is it for?
Use it when onboarding a legacy project, merging an external repository, or creating a baseline specification for future work.
Why use it?
It reduces the manual work of understanding an unfamiliar or older codebase before adding features or combining projects.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/fistasolutions/fista-spec-kit/extract
Clone the repo
git clone --depth 1 https://github.com/fistasolutions/fista-spec-kit

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for extract

README.md
[![agentmods](https://agentmods.dev/badge/commands/fistasolutions/fista-spec-kit/extract.svg)](https://agentmods.dev/commands/fistasolutions/fista-spec-kit/extract)
Your own site
<a href="https://agentmods.dev/commands/fistasolutions/fista-spec-kit/extract"><img src="https://agentmods.dev/badge/commands/fistasolutions/fista-spec-kit/extract.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 900 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.00900
Opus 5 $0.00008 $0.00450
Sonnet 5 $0.00003 $0.00180
Haiku 4.5 $0.00002 $0.00090

Measured 4d ago against content hash 8980e40577bc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

extract scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl http://localhost:8000/openapi.json > apps/api/openapi.json
templates/commands/extract.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

User Input

$ARGUMENTS

If provided, treat $ARGUMENTS as a path (e.g., ./src, ./apps/web, ./apps/api); otherwise default to ./src.

Goal

Convert an existing codebase into structured SpecKit artifacts by automatically scanning its components, routes, and APIs.
This creates a reusable baseline specification that can be extended through /specify, analyzed via /analyze, and executed with /implement.

Use this command when onboarding legacy projects, merging external repos, or preparing for feature expansion.


Inputs

  • path (string, default: ./src) — Root folder to analyze.
  • openapi (optional string) — Path to OpenAPI JSON if not in common locations.

Steps

  1. Resolve Path

    • Verify the provided $ARGUMENTS path exists.
    • Normalize slashes for cross-platform support.
  2. Discover Web Routes

    • Glob: app/**/{page,route}.{ts,tsx,js,jsx}
    • Extract friendly URLs:
      • Strip /app/ prefix and filename.
      • Normalize /index to /.
      • Keep dynamic [id] segments.
  3. Detect UI Components

    • Search under components/, ui/, and shared/ directories.
    • Identify component names from filenames.
  4. Collect API Endpoints

    • Try loading OpenAPI JSON from:
      • apps/api/openapi.json
      • public/openapi.json
      • <path>/openapi.json
    • Parse endpoint method, path, and summary.
  5. Generate Artifacts (Non-Destructive)

    • Create or update:
      • packages/specs/active/extracted/spec.yaml
      • packages/specs/active/extracted/inventory.md
      • packages/specs/active/extracted/tasks.md
    • Append rather than overwrite.
    • Include a timestamp for traceability.
  6. Summarize Findings

    • Count total routes, components, and API endpoints.
    • Display summary in output:
      ✅ Extracted 18 routes, 7 components, 5 API endpoints.
      📝 Wrote: packages/specs/active/extracted/spec.yaml
      📝 Wrote: packages/specs/active/extracted/inventory.md
      📝 Updated: packages/specs/active/extracted/tasks.md
      

Read the full file on GitHub · 122 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 122 lines · 16 tokens per session scan A 8980e40577bc

Subscribe to this mod's changes

extract is a command published in the GitHub repository fistasolutions/fista-spec-kit (2 stars, last pushed 10mo ago), licensed MIT. It adds 16 tokens to every session and 900 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.