Agent skill

Extracting Requirements

by prime-radiant-inc in prime-radiant-inc/iterative-development

Reads human-written spec documents and produces per-epic requirement files with proof obligations plus behavior scenarios with stable IDs, using parallel chunked extraction.

Apache-2.0Auto-check passedAgent Workflows

Install Extracting Requirements

skills CLI
$ npx skills add prime-radiant-inc/iterative-development --skill extracting-requirements -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install prime-radiant-inc/iterative-development extracting-requirements --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/prime-radiant-inc/iterative-development.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/extracting-requirements .claude/skills/extracting-requirements && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
extracting-requirements
GitHub stars
181
Token cost
~2.7k tokens
SKILL.md length
1,205 words
Files
8 (incl. scripts)
Skills in repo
6
Repo updated
First seen
Licence
Apache-2.0

At a glance

Reads human-written spec documents and produces per-epic requirement files with proof obligations plus behavior scenarios with stable IDs, using parallel chunked extraction.

  • Works in 11 steps: Inventory → Dispatch extraction subagents → PAR omission review → …
  • Starting an iterative-development run from a folder of human-written specs
  • SKILL.md covers Overview, When to Use, Script Location and Key Concept: Spec Taxonomy, plus 3 more sections
  • Runs Python scripts from its folder; calls python3 and git

What it does

The skill turns spec collateral of any shape into two sets of artifacts: per-epic requirement files with story cards and a proof obligation for each acceptance criterion, and a behavior scenarios file of reusable, observable-behavior contracts with stable IDs. It is called by the iterative-development workflow during bootstrap, or run alone to regenerate requirements.

To keep any single agent from holding the whole spec, `chunk_spec.py` first splits the files into chunks by heading, keeping small files whole. Each chunk is classified by the folder it came from, which sets its default proof level: test-vectors as unit, contracts as integration, domains as integration or app-level, journeys as end-to-end. Extraction subagents get the chunk text inline with a journey or standard prompt, and aggregation, backlink and validation scripts merge and check the results. It handles specs from one page to roughly 100K tokens across dozens of files.

When your agent uses it

  • Starting an iterative-development run from a folder of human-written specs
  • Regenerating requirement files after the specs changed
  • Turning journeys and contracts into stable-ID behavior scenarios

Example prompts

  • “Extract requirements from the specs in ./spec into per-epic files with proof obligations.”
  • “Regenerate the behavior scenarios after I edited the checkout journey spec.”
  • “Chunk the spec folder and tell me how each chunk was classified.”

Requirements

  • Python 3 for the chunking, aggregation and validation scripts
  • A folder of spec files

Workflow steps

11 steps, taken from the step headings in SKILL.md.

  1. Inventory
  2. Dispatch extraction subagents
  3. PAR omission review
  4. Aggregate stories
  5. Aggregate scenarios
  6. Consolidate epics
  7. Back-link scenarios to stories
  8. Coverage ledger
  9. Initialize behavior corpus index
  10. Validate
  11. Commit

What it can do on your machine

Read from SKILL.md and the folder at commit c05889a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 6 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Extracting Requirements loads about 2.7k tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 1,205 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from prime-radiant-inc/iterative-development at commit c05889a, republished under its Apache-2.0 licence (© prime-radiant-inc). 1,205 words, ~2,686 tokens.

Download SKILL.mdSave it as .claude/skills/extracting-requirements/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
extracting-requirements
description
Use when starting an iterative-development run on human spec collateral — reads the spec, produces per-epic requirement files with proof obligations and behavior scenario cards with stable IDs.

Extracting Requirements

Overview

Reads arbitrary human spec collateral and produces two artifact sets:

  1. Per-epic requirement files in docs/superpowers/iterations/requirements/ — story cards with proof obligations per AC
  2. Behavior scenarios in docs/superpowers/iterations/behavior-scenarios.md — reusable observable-behavior contracts with stable IDs

Uses a chunking + parallel-dispatch + aggregation pipeline so that no single agent holds the entire spec in context. Handles specs from a single page up to ~100K tokens across dozens of files.

When to Use

Invoked by iterative-development during bootstrap, or standalone when you need to regenerate requirements from human spec collateral.

Script Location

All scripts referenced below live in this skill's scripts/ directory, next to this SKILL.md file.

Key Concept: Spec Taxonomy

The spec directory structure drives proof seam classification. See skills/shared/behavior-evidence-formats.md for the full taxonomy. Summary:

Spec directoryDefault proof seam
test-vectors/unit
contracts/integration
domains/integration or app-level
journeys/e2e

Extraction subagents use the appropriate prompt variant based on source file location.

Pipeline

1. Inventory

Enumerate the spec files without reading full contents:

bash
python3 "scripts/chunk_spec.py" <spec-path>

This produces a JSON array of chunks. Each chunk has source_file, heading, start_line, end_line, content, and estimated_tokens. Small files (< 4K tokens) are kept whole. Larger files are split by ## headings, or ### if sections are still too large.

Classify each chunk by spec taxonomy: note whether the source file is under journeys/, contracts/, domains/, or test-vectors/. This determines which extraction prompt variant to use.

2. Dispatch extraction subagents

For each chunk (or batch of small chunks), dispatch an extraction subagent using the appropriate template from extraction-subagent-prompt.md:

  • Chunks from journeys/ → use the Journey Extraction prompt variant
  • All other chunks → use the Standard Extraction prompt variant

Pass the chunk content inline — do NOT make the subagent read the file.

Payload integrity: If your platform has output token limits that could truncate the chunk before it reaches the subagent prompt, stage each chunk individually and verify the subagent received the complete content (e.g., by checking that the extracted stories reference lines from the full range of the chunk). Partial payloads are easy to miss and cause silent under-extraction.

Dispatch strategy:

  • Dispatch subagents in waves of 3-5 (runtime agent thread limits are typically 6; keep headroom). Do not fan out all chunks at once.
  • Persist immediately: as soon as each subagent returns, write its output to a temp file (e.g., a scratch directory under the project root) before dispatching more work. Subagent results that only exist in conversation state can be lost if the session fails.
  • Wait semantics: if your runtime's wait primitive returns on the first completed agent (not all), loop until every dispatched agent in the wave has reached a final state. Persist each result as it arrives.
  • Close completed agents promptly to free thread slots for the next wave.
  • Track completion: maintain a checklist of chunk-to-agent mappings. After all waves finish, verify every chunk produced a persisted output file. Re-dispatch any missing chunks before proceeding.
3. PAR omission review

Before aggregation, run a PAR omission review. The sole job of this review is to find requirements AND scenarios that the extraction subagents dropped.

For each chunk (or batch of chunks), dispatch two reviewers in parallel following skills/shared/parallel-adversarial-review.md:

  1. Give each reviewer the original chunk text and the extracted stories + scenarios for that chunk
  2. Prompt: "Compare the source text against the extracted stories and scenarios. Find every requirement, acceptance criterion, behavioral constraint, or observable behavior in the source that is NOT represented by any extracted story or scenario. Score 5 points for each omission found. Pay special attention to: (a) ACs missing proof obligations, (b) observable behavior with no scenario, (c) journey steps that were summarized or skipped."
  3. Aggregate findings across both reviewers
  4. For each confirmed omission: either add a new story/scenario to the extraction output or document why it's intentionally excluded

This pass is required, not optional. Extraction subagents optimize for what they notice; omission reviewers optimize for what's missing.

4. Aggregate stories

Run the story aggregation script on all extracted story JSONs (including any added by the omission review):

bash
python3 "scripts/aggregate_stories.py" -o docs/superpowers/iterations/requirements/ <json-file-1> <json-file-2> ...

The script combines, deduplicates by title, groups into epics, assigns stable STORY/EPIC IDs, and outputs per-epic files with proof obligations preserved.

5. Aggregate scenarios

Run the scenario aggregation script:

bash
python3 "scripts/aggregate_scenarios.py" \
  -o docs/superpowers/iterations/behavior-scenarios.md \
  --stories-dir docs/superpowers/iterations/requirements/ \
  <json-file-1> <json-file-2> ...

The script combines, deduplicates by title, assigns stable SCENARIO/JOURNEY IDs, resolves story title references to STORY-IDs, and outputs behavior-scenarios.md.

Show full SKILL.md (494 more words)Show less
6. Consolidate epics

Same as before: review the epic list, merge near-duplicates, re-run aggregation. See the consolidation rules in the original extraction skill documentation.

Additional consolidation check: after merging, verify that scenario owning_story_titles still resolve correctly. If stories were deduplicated during re-aggregation, re-run scenario aggregation to update resolved refs.

After both aggregations complete, run the back-linking script to update per-epic story files with scenario references:

bash
python3 "scripts/backlink_scenarios.py" \
  docs/superpowers/iterations/behavior-scenarios.md \
  docs/superpowers/iterations/requirements/

The script reads scenario → owning-story mappings from behavior-scenarios.md and appends scenario:SCENARIO-NNNN or scenario:JOURNEY-NNNN to AC lines in the epic files that have observable behavioral impact. AC lines that already have scenario refs are skipped.

This creates the bidirectional link: stories → scenarios (via AC lines) and scenarios → stories (via owning_stories field).

8. Coverage ledger

Build a coverage ledger that maps every spec chunk to its extracted stories AND scenarios. This is the traceable proof that extraction is complete.

For each chunk from the inventory (step 1):

  1. List the chunk: source_file, heading, start_line–end_line
  2. List every story ID whose **Sources:** field cites overlapping lines in that file
  3. List every scenario ID whose **Sources:** field cites overlapping lines in that file
  4. Classify the chunk:
    • covered — stories with ACs that correspond to normative content AND scenarios for observable behavior
    • story-only — stories exist but observable behavior has no scenario (needs scenario)
    • non-normative — chunk contains only meta-commentary, table of contents, or boilerplate (explain why)
    • duplicate — chunk's requirements are covered by stories citing a different source
    • gap — normative content with no corresponding story

Hard gates:

  • If any chunk is classified as gap, extraction is incomplete. Re-extract and repeat.
  • If any chunk is classified as story-only and contains observable behavior, extraction is incomplete. Add scenarios for the missing observable behavior.

Journey coverage check: every journey spec file MUST produce at least one JOURNEY-NNNN scenario that preserves the complete step sequence. If a journey file only produced stories (no journey scenario), that is a gap.

9. Initialize behavior corpus index

Create the initial docs/superpowers/iterations/behavior-corpus.md from the scenario list:

markdown
# Behavior Corpus

| Scenario ID | Title | Proof seam | Run cadence | Command | Owning stories |
|---|---|---|---|---|---|

Populate with all scenarios. Set run cadence:

  • Journey scenarios → sentinel (they run every iteration)
  • Surface scenarios → iteration (default, refined during scoping)

Set command to TBD — the implementing iterations will fill these in.

10. Validate
bash
python3 "scripts/validate_requirements_index.py" docs/superpowers/iterations/requirements/
python3 "scripts/validate_scenarios.py" docs/superpowers/iterations/behavior-scenarios.md docs/superpowers/iterations/requirements/

If validation fails, inspect the output, fix formatting issues, and re-validate.

11. Commit
bash
git add docs/superpowers/iterations/requirements/
git add docs/superpowers/iterations/behavior-scenarios.md
git add docs/superpowers/iterations/behavior-corpus.md
git commit -m "docs: add requirements with proof obligations, behavior scenarios, and corpus index"

Quick Reference

StepToolInputOutput
Chunkscripts/chunk_spec.pyspec pathJSON chunks (stdout)
ExtractSubagent + extraction-subagent-prompt.mdchunk contentJSON stories + scenarios (per subagent)
Omission reviewPAR (source text vs. stories + scenarios)chunks + stories + scenariosMissing requirements and scenarios
Aggregate storiesscripts/aggregate_stories.py -o <dir>JSON filesPer-epic .md files with proof obligations
Aggregate scenariosscripts/aggregate_scenarios.py -o <file>JSON files + stories dirbehavior-scenarios.md
Back-linkscripts/backlink_scenarios.pyscenarios + storiesUpdated AC lines with scenario refs
Coverage ledgerMap chunks → story IDs + scenario IDschunk list, stories, scenariosGap/covered/story-only per chunk
Init corpusWrite corpus indexscenario listbehavior-corpus.md
Validatescripts/validate_requirements_index.py + scripts/validate_scenarios.py.md filesOK or errors

Deferred to later plans

Hierarchical reduce (specs > 1M tokens), huge-spec decomposition, incremental re-extraction.

© prime-radiant-inc, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts) in skills/extracting-requirements of prime-radiant-inc/iterative-development.

  • SKILL.md
  • extraction-subagent-prompt.md
  • scripts/aggregate_scenarios.py
  • scripts/aggregate_stories.py
  • scripts/backlink_scenarios.py
  • scripts/chunk_spec.py
  • scripts/validate_requirements_index.py
  • scripts/validate_scenarios.py

Open the folder on GitHubat commit c05889a

Compare with similar skills

Extracting Requirements next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Extracting Requirements compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Extracting Requirements this skillprime-radiant-inc/iterative-development181—~2.7kAutomated safety check: PassApache-2.0
Interview-Driven Spec Writerposhan0126/dotclaude870—~804Automated safety check: PassMIT
Deep InterviewYeachan-Heo/oh-my-claudecode40k—~12kAutomated safety check: PassMIT
CCPM Project Managementautomazeio/ccpm8.4k—~1.1kAutomated safety check: PassMIT
Tbdjlevy/strif131—~3.5kAutomated safety check: PassMIT
User Alignment and Agent-Ready PRDstryproduck/produck-skills511—~5.3kAutomated safety check: PassApache-2.0

Similar skills

  • Interview-Driven Spec Writer

    poshan0126/dotclaude

    Interviews you about scope, behavior, edge cases and verification, then writes a self-contained SPEC.md that a fresh session can implement without this conversation.

    870 GitHub stars~804 tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Deep Interview

    Yeachan-Heo/oh-my-claudecode

    Interviews you with Socratic questions and an ambiguity score until a vague idea becomes a clear spec, then holds execution until you approve.

    40k GitHub stars~12k tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Runs a spec-driven workflow from PRD to epic to GitHub issues to parallel agents, with status, standup and blocked-work reports from bundled scripts.

    8.4k GitHub stars~1.1k tokensUpdated 6 mo ago
    Product & Project ManagementAuto-check passed
  • Tbd

    jlevy/strif

    Git-native issue tracking (beads), coding guidelines, knowledge injection, and spec-driven planning for AI agents.

    131 GitHub stars~3.5k tokensUpdated 4 mo ago
    DevelopmentAuto-check passed
  • User Alignment and Agent-Ready PRDs

    tryproduck/produck-skills

    Turns a vague feature request into a written spec with scope, phases, acceptance criteria and do-not-do limits that a coding agent can follow without guessing.

    511 GitHub stars~5.3k tokensUpdated 1 mo ago
    Product & Project ManagementAuto-check passed
  • GSD Phase Discussion

    open-gsd/gsd-core

    Asks adaptive questions about a project phase and records the decisions in a CONTEXT.md that later research and planning agents can act on without asking again.

    10k GitHub starsUsed in 1 repo~1.5k tokens
    Agent WorkflowsAuto-check: warnings

More from prime-radiant-inc/iterative-development

  • Walking Skeleton Roadmap Scoping

    prime-radiant-inc/iterative-development

    Turns extracted requirements into a roadmap by choosing a walking skeleton iteration with its first journey scenario and ordering the remaining work into follow-on iterations.

    181 GitHub stars~1.7k tokensUpdated 4 mo ago
    Auto-check passed
  • Iterative Development Orchestrator

    prime-radiant-inc/iterative-development

    Runs an autonomous loop that extracts requirements with proof obligations, builds a walking skeleton, then audits sprint by sprint against real behavior evidence.

    181 GitHub stars~2.7k tokensUpdated 4 mo ago
    Auto-check passed
  • Running An Iteration

    prime-radiant-inc/iterative-development

    A skill your agent uses when executing the next pending iteration from an iterative-development roadmap — picks the iteration, decomposes into code and evidence tasks, runs sentinel corpus baseline…

    181 GitHub stars~1.9k tokensUpdated 4 mo ago
    Auto-check passed
  • Iteration Progress Audit

    prime-radiant-inc/iterative-development

    Checks the quality of behavior evidence after each iteration in three tiers, using two auditor subagents in parallel to review the same work and find gaps.

    181 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Implementing Tasks with Subagent Review

    prime-radiant-inc/iterative-development

    Runs a batch of TDD-sized tasks by dispatching an implementer subagent per task, followed by two-stage parallel adversarial review and fix loops.

    181 GitHub stars~1.2k tokensUpdated 4 mo ago
    Auto-check passed

Works with

Questions about Extracting Requirements

What does Extracting Requirements do?

Reads human-written spec documents and produces per-epic requirement files with proof obligations plus behavior scenarios with stable IDs, using parallel chunked extraction. The skill turns spec collateral of any shape into two sets of artifacts: per-epic requirement files with story cards and a proof obligation for each acceptance criterion, and a behavior scenarios file of reusable, observable-behavior contracts with stable IDs. It is called by the iterative-development workflow during bootstrap, or run alone to regenerate requirements.

When should I use Extracting Requirements?

Extracting Requirements fits situations like: starting an iterative-development run from a folder of human-written specs; regenerating requirement files after the specs changed; turning journeys and contracts into stable-ID behavior scenarios.

How do I install Extracting Requirements in Claude Code?

Run `npx skills add prime-radiant-inc/iterative-development --skill extracting-requirements -a claude-code`. Or copy the skill folder (skills/extracting-requirements in prime-radiant-inc/iterative-development) into .claude/skills/extracting-requirements in your project. Claude Code loads it when a task matches its description.

How do I install Extracting Requirements in Codex?

Run `npx skills add prime-radiant-inc/iterative-development --skill extracting-requirements -a codex`. Or copy the skill folder (skills/extracting-requirements in prime-radiant-inc/iterative-development) into .agents/skills/extracting-requirements in your project. Codex loads it when a task matches its description.

Can I use Extracting Requirements in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add prime-radiant-inc/iterative-development --skill extracting-requirements -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/extracting-requirements, .gemini/skills/extracting-requirements, .github/skills/extracting-requirements and .opencode/skills/extracting-requirements in your project.

What does Extracting Requirements need to run?

Going by SKILL.md and its folder, Extracting Requirements needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and git). Our summary lists: Python 3 for the chunking, aggregation and validation scripts; A folder of spec files.

Does Extracting Requirements access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Extracting Requirements safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Extracting Requirements use?

Extracting Requirements is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Extracting Requirements use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Extracting Requirements?

Skills that share tags, products or a category with Extracting Requirements: Interview-Driven Spec Writer (poshan0126/dotclaude, 870 stars), Deep Interview (Yeachan-Heo/oh-my-claudecode, 40k stars), CCPM Project Management (automazeio/ccpm, 8.4k stars) and Tbd (jlevy/strif, 131 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Extracting Requirements?

prime-radiant-inc (a GitHub organization) maintains it in prime-radiant-inc/iterative-development, which has 181 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on June 6, 2026.

Source: prime-radiant-inc/iterative-development on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.