extract-spec

extract-spec is a skill for Claude Code, Codex from lukasrepublic/agentic-foundry. It costs 113 tokens per session (1,363 once invoked), scanned A, original, MIT.

A read-only process for turning existing code into a proposed functional specification. It describes what the code currently does without treating that behavior as approved requirements.

In plain words
What is it for?
Use it to survey a codebase, map its behavior, and prepare a candidate specification for later review and approval.
Why use it?
It separates observed behavior from intended behavior, reducing the risk of documenting bugs or guesses as official rules.

Skill for Claude CodeCodex

Part of the foundry plugin — 80 skills, 8 agents, 8 hooks, 1 MCP server shipped together

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 skills/lukasrepublic/agentic-foundry/extract-spec
Any agent
npx skills add lukasrepublic/agentic-foundry --skill extract-spec
Clone the repo
git clone --depth 1 https://github.com/lukasrepublic/agentic-foundry

Made for: Claude Code, Codex.

Or install foundry, the plugin that ships this one along with the rest of its 80 skills, 8 agents, 8 hooks, 1 MCP server.

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-spec

README.md
[![agentmods](https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/extract-spec.svg)](https://agentmods.dev/skills/lukasrepublic/agentic-foundry/extract-spec)
Your own site
<a href="https://agentmods.dev/skills/lukasrepublic/agentic-foundry/extract-spec"><img src="https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/extract-spec.svg" alt="Measured on agentmods" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,363 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00113 $0.01363
Opus 5 $0.00056 $0.00681
Sonnet 5 $0.00023 $0.00273
Haiku 4.5 $0.00011 $0.00136

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

Security

Grade A, and why

extract-spec scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/extract-spec/SKILL.md · 88 lines

How it starts

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

/foundry:extract-spec

Turn existing code into functional specifications. You survey a codebase, mine the behavior it actually enforces, and produce a candidate atomic spec — which then flows through the normal front door (/foundry:intake/foundry:spec-review/foundry:authorize). You are read-heavy and write only a candidate draft; you never authorize, merge, or baseline.

The load-bearing discipline (read first)

  • Extracted ≠ authorized, and extracted ≠ desired. The code may encode bugs; a snapshot of current behavior is a characterization, not a specification of intent. Therefore the output is an un-authorized candidate draft that MUST be routed through /foundry:intake (→ /foundry:spec-review/foundry:authorize). Never emit an authorized or "baseline truth" spec, and never freeze a contract from extraction. The front-authorization floor is preserved: extracted behavior becomes normative only after the operator authorizes it.
  • Never invent behavior. If the code does not clearly express a contract, record it as a [NEEDS CLARIFICATION: <question>] marker — do not fabricate a requirement (Example Mapping's Question card).
  • Cross-validate against callers. The real contract is what callers rely on, not what a docstring claims (characterization-test discipline — capture ACTUAL, not intended, behavior; note it can pin existing bugs, so surface anything surprising as an uncertainty rather than "correcting" it).

Prior art / industry grounding

Grounded in prior-art research on the code-to-spec mechanism (how brownfield code is safely mined into a candidate spec) and on the emit shape (the template a mined capability is promoted into). Sources: Feathers, Working Effectively with Legacy Code (characterization testing); Adzic Specification by Example + Wynne's Example Mapping (flag uncertainty, don't invent); EARS/ISO-29148 (the Requirement/Invariant, measurable shape). Comparable prior art in other spec-driven tooling (e.g. spec-mining features) is one corroborating datapoint, not the source.

Read the full file on GitHub · 88 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 · 88 lines · 113 tokens per session scan A 9cb4f4f9c4de

Subscribe to this mod's changes

extract-spec is a skill published in the GitHub repository lukasrepublic/agentic-foundry (1 stars, last pushed 2d ago), licensed MIT. It adds 113 tokens to every session and 1,363 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

create-site

Creates a new Power Pages code site (SPA) using React, Angular, Vue, or Astro. Guides through the full process from initial concept to deployed site: requirements discovery, scaffolding, component planning, design, implementation, validation, and deployment. Use when the user wants to create, build, or scaffold a new…

microsoft/power-platform-skills · 73 tokens

google-ads-audit

Google Ads account audit and business context setup. Run this first — it gathers business information, analyzes account health, and saves context that all other ads skills reuse. Trigger on "audit my ads", "ads audit", "set up my ads", "onboard", "account overview", "how's my account", "ads health check", "what should…

nowork-studio/notfair-plugin · 114 tokens

review

5-pass structured code review — correctness, security, performance, readability, consistency.

SethGammon/Citadel · 17 tokens

alive:system-upgrade

Upgrade ALIVE to the current version. Handles v1/v2/v3.x source states, multi-surface aware (alive-mcp / Hermes / Codex), retroactive version detection, partial-failure resume, dry-run previews, and rollback inspection.

alivecontext/alive · 57 tokens

codex-test-gen

Generate unit tests for specified functions using Codex MCP.

sd0xdev/sd0x-harness · 15 tokens

ensure-pipelines-host

Ensures the tenant has a usable Power Platform Pipelines host environment before any pipeline operation runs. Detects host state via the same resolution order as the Power Apps UI (org-db setting → BAP env metadata → default-custom-host setting); if any existing host (Platform or Custom) is found, uses it. If no host…

microsoft/power-platform-skills · 222 tokens