Agent skill

Speckit Opsmill Extract

by opsmill in opsmill/infrahub

Extract knowledge, guidelines, and ADRs from one or more completed spec directories into the project documentation system.

Apache-2.0Auto-check passedDevelopment

Install Speckit Opsmill Extract

skills CLI
$ npx skills add opsmill/infrahub --skill speckit-opsmill-extract -a claude-code

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

GitHub CLI
$ gh skill install opsmill/infrahub speckit-opsmill-extract --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/opsmill/infrahub.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/speckit-opsmill-extract .claude/skills/speckit-opsmill-extract && 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
speckit-opsmill-extract
GitHub stars
531
Token cost
~3.4k tokens
SKILL.md length
1,403 words
Files
1
Skills in repo
32
Repo updated
First seen
Licence
Apache-2.0

At a glance

Extract knowledge, guidelines, and ADRs from one or more completed spec directories into the project documentation system.

  • Works in 5 steps: Setup & Validation → Analysis & Classification → Interactive Review → …
  • Tasks that involve Architecture decision records
  • SKILL.md covers User Input, Outline, Phase 0: Setup & Validation and Phase 1: Analysis &…, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Speckit Opsmill Extract is an agent skill from opsmill/infrahub. Extract knowledge, guidelines, and ADRs from one or more completed spec directories into the project documentation system.

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Requires spec-kit project structure with .specify/ directory

It sits in Development, covering Architecture decision records and Spec-driven development. The repository describes itself as: Infrahub is a graph-based data management platform with built-in version control, CI workflows, peer review, and API access. It’s purpose-built to power reliable infrastructure… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Architecture decision records
  • Tasks that involve Spec-driven development

Example prompts

  • “/speckit-opsmill-extract”

Requirements

  • Compatibility (from SKILL.md): Requires spec-kit project structure with .specify/ directory

Workflow steps

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

  1. Setup & Validation
  2. Analysis & Classification
  3. Interactive Review
  4. Write Extractions
  5. Cleanup & Report

What it can do on your machine

Read from SKILL.md and the folder at commit 460d724. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown and bash).

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

  • Network

    No URLs in SKILL.md.

    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.

  • Compatibility

    Requires spec-kit project structure with .specify/ directory

    From compatibility in the SKILL.md frontmatter.

Context cost

Speckit Opsmill Extract loads about 3.4k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 1,403 words of instructions outside code blocks.

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

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from opsmill/infrahub at commit 460d724, republished under its Apache-2.0 licence (© opsmill). 1,403 words, ~3,449 tokens.

Download SKILL.mdSave it as .claude/skills/speckit-opsmill-extract/SKILL.md (or your agent's skills folder).
name
speckit-opsmill-extract
description
Extract knowledge, guidelines, and ADRs from one or more completed spec directories into the project documentation system.
compatibility
Requires spec-kit project structure with .specify/ directory
metadata.author
github-spec-kit
metadata.source
opsmill:commands/extract.md

User Input

text
$ARGUMENTS

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

Outline

Goal: Analyze one or more completed spec directories and extract durable knowledge into the project's documentation system (dev/knowledge/, dev/guidelines/, dev/adr/), then mark each spec as extracted.

This command accepts multiple specs as input (space-separated) and processes them sequentially. It operationalizes the documentation lifecycle: specs/ → knowledge/ or guidelines/ (see dev/guidelines/markdown.md).

Phase 0: Setup & Validation

<thinking>
First, resolve all spec directories from the user's arguments and validate each one contains the expected artifacts.
</thinking>
  1. Parse arguments — split $ARGUMENTS into individual spec identifiers (space-separated). If $ARGUMENTS is empty, list available spec directories and ask the user to pick one or more.

  2. Resolve each spec directory:

    • For each identifier in the arguments:
      • If it matches specs/NNN-* or NNN-*, resolve to REPO_ROOT/specs/NNN-*
      • If it is a bare name like graphql-name-lookup, search specs/ for a matching directory
      • If no match found for an identifier, report it and continue resolving the rest
    • If no identifiers could be resolved, list available spec directories and ask the user to pick
  3. Validate each resolved spec:

    • spec.md MUST exist — skip that spec with an error if missing
    • research.md SHOULD exist — warn if missing ("No ADRs can be extracted without research.md") but continue
  4. Check extraction status for each spec:

    • If EXTRACTED.md exists in the spec directory, warn the user that this spec was previously extracted
    • Also check if the spec already lives under specs/archive/ — if so, it was previously extracted and archived
    • Ask for confirmation before re-extracting — default is abort
    • The user can choose to skip individual specs from the batch
  5. Summarize resolved specs — before proceeding, print the list of specs that will be processed:

    Processing N spec(s):
    1. specs/<spec-name-1>
    2. specs/<spec-name-2>
    ...
  6. Load existing documentation index (once, shared across all specs):

    • List all files in dev/knowledge/ (recursively)
    • List all files in dev/guidelines/ (recursively)
    • List all files in dev/adr/ to determine the next ADR number
    • Read the first 20 lines of each knowledge and guidelines file to build a topic index (title + overview section)
  7. Load spec artifacts — for each spec, read all available files from its directory:

    • research.md (primary source for ADRs)
    • spec.md (context, scope decisions)
    • data-model.md (schema changes, new methods — if exists)
    • All files in contracts/ (API changes — if exists)
    • plan.md (architectural context — if exists)

Phase 1: Analysis & Classification

<thinking>
For each spec, I need to parse each source and classify content into three buckets: ADR, Knowledge, Guideline. I should also identify content to skip with a clear reason. I'll process specs sequentially and tag each finding with its source spec.
</thinking>

Repeat the following steps for each resolved spec directory. Tag every finding with the source spec name so the extraction plan in Phase 2 groups items by spec.

Step 1: Extract ADR candidates from research.md

Parse each ## R# section in research.md. For each entry:

  1. Extract: Decision, Rationale, Alternatives considered, Implementation pattern
  2. Determine if it is ADR-worthy using this heuristic:
    • ADR-worthy: Affects system structure, API contracts, data models, error handling strategy, or establishes a pattern used across multiple components
    • Not ADR-worthy: One-off implementation detail with no broader implications (e.g., a local variable naming choice, a single method signature)
  3. Draft an ADR title (concise, decision-focused — e.g., "Dual identifier resolution via service-layer helpers")

Also scan spec.md for scope decisions or trade-offs in the Clarifications or Assumptions sections that represent architectural choices worth recording.

Step 2: Extract knowledge candidates

Scan for content that describes how the system works after the feature:

SourceWhat to look forTarget file
data-model.mdNew entities, fields, relationships, constraintsdev/knowledge/backend/data-models.md
contracts/New or changed GraphQL queries, mutations, typesdev/knowledge/backend/api.md
research.mdNew service patterns, architectural patternsdev/knowledge/backend/services.md or relevant file
spec.mdNew concepts or domain terminologydev/knowledge/backend/overview.md or relevant file

For each finding, map it to a specific existing knowledge file and section. If no existing file fits, propose a new file with a name following kebab-case.md convention.

Step 3: Extract guideline candidates

Scan research.md for implementation patterns that establish repeatable, prescriptive conventions for future code:

  • New parameter patterns → dev/guidelines/backend/python.md or dev/guidelines/cyclopts.md
  • New error handling conventions → dev/guidelines/backend/exceptions.md
  • New API design conventions → dev/guidelines/backend/graphql.md (create if needed)
  • New testing patterns → relevant guidelines file

These targets are routing examples, not a fixed map — content moves as files split, so confirm the section still lives in the named file before writing to it.

Only extract patterns that are prescriptive (should be followed in future code). Do NOT extract patterns that are merely descriptive of how this specific feature works — those belong in knowledge.

Step 4: Identify skipped content

For each piece of spec content not classified above, note it with a reason:

  • Execution artifacts (plan.md, quickstart.md) — no durable knowledge
  • Implementation details already captured in code — no need to duplicate
  • One-off decisions with no broader applicability
Show full SKILL.md (632 more words)Show less

Phase 2: Interactive Review

Present findings in a structured extraction plan. When processing multiple specs, group the plan by spec. Use a global numbering scheme across all specs so that item numbers are unique (e.g., spec 1 items are 1–4, spec 2 items are 5–8).

Use this format:

markdown
## Extraction Plan

### specs/<spec-name-1>

#### ADRs to Create (<count>)

| # | Source | Title | Target File |
|---|--------|-------|-------------|
| 1 | R1 | <title> | dev/adr/nnnn-<slug>.md |
| 2 | R2 | <title> | dev/adr/nnnn-<slug>.md |

#### Knowledge Updates (<count>)

| # | Target File | Section | Change | Summary |
|---|-------------|---------|--------|---------|
| 3 | dev/knowledge/backend/api.md | Queries | UPDATE | <what changes> |

#### Guidelines Updates (<count>)

| # | Target File | Section | Change | Summary |
|---|-------------|---------|--------|---------|
| 4 | dev/guidelines/backend/exceptions.md | Error Handling | UPDATE | <what changes> |

#### Skipped (with reasons)

| Source | Reason |
|--------|--------|
| plan.md | Execution artifact — no durable knowledge |

---

### specs/<spec-name-2>

#### ADRs to Create (<count>)

| # | Source | Title | Target File |
|---|--------|-------|-------------|
| 5 | R1 | <title> | dev/adr/nnnn-<slug>.md |

...

When processing a single spec, omit the per-spec grouping headers and use the simpler flat format (same as the multi-spec table structure but without the ### specs/<name> wrapper).

After presenting, tell the user:

Actions:

  • approve all — proceed with all extractions across all specs
  • approve spec <name> — approve all items for a specific spec
  • approve adrs / approve knowledge / approve guidelines — approve by category (across all specs)
  • skip N — skip a specific numbered item
  • edit N — modify a specific item before writing
  • group N,M — merge multiple ADR items into a single ADR

Wait for user response before proceeding. Do NOT write any files until the user approves.

Phase 3: Write Extractions

For each approved item across all specs, write the content. ADR numbering is sequential across all specs (i.e., if spec 1 creates 0005 and 0006, spec 2 starts at 0007).

ADRs

Create new files in dev/adr/ using this format:

markdown
# N. <Title>

**Status**: Accepted
**Date**: <today's date YYYY-MM-DD>
**Source**: specs/archive/<spec-name>/research.md (R#)

## Context

<What is the issue that motivates this decision? Derive from the feature context in spec.md and the specific problem the R# entry addresses.>

## Decision

<What was decided. Taken from the Decision field of the R# entry.>

## Consequences

<What becomes easier or harder as a result. Synthesize from the Rationale and any implementation notes.>

## Alternatives Considered

<What other options were evaluated and why they were rejected. Taken from the Alternatives considered field.>

Numbering: Read existing files in dev/adr/ to find the highest existing ADR number. Start new ADRs at the next sequential number. Zero-pad the filename sequence to 4 digits (e.g., 0001, 0012); the H1 heading uses the un-padded number (e.g., # 1., # 12.).

File naming: canonical MADR nnnn-kebab-case-short-title.md — 4-digit zero-padded sequence, lowercase kebab title, no adr-/ADR- prefix (e.g., 0001-schema-changes-without-migrations.md).

Knowledge updates

For each knowledge update:

  1. Read the full target file
  2. Find the appropriate section (match by heading)
  3. Add or update content within that section
  4. If the section does not exist, create it in a logical position
  5. Add a source marker: <!-- Extracted from specs/<spec-name> on YYYY-MM-DD -->
Guidelines updates

Same approach as knowledge updates:

  1. Read the full target file (or create a new one if needed)
  2. Find the appropriate section
  3. Add the prescriptive pattern with code examples where relevant
  4. Add a source marker: <!-- Extracted from specs/<spec-name> on YYYY-MM-DD -->

If creating a new guidelines file, follow the standard structure:

markdown
# <Topic> Guidelines

## Overview

<Brief description of what this document covers.>

## <Sections...>

Phase 4: Cleanup & Report

Perform the following steps for each spec that had approved extractions.

1. Create extraction record

Write EXTRACTED.md in each spec directory:

markdown
# Extraction Record

**Extracted on**: <YYYY-MM-DD>
**Extracted by**: speckit.opsmill.extract

## ADRs Created

- <path to ADR file> (from R#)
- ...

## Knowledge Updated

- <path to knowledge file> (<section name>)
- ...

## Guidelines Updated

- <path to guidelines file> (<section name>)
- ...

## Archive

Spec directory moved to `specs/archive/<spec-name>/` as a historical record.
2. Update spec status and archive

For each spec:

  1. In spec.md, update or add the status field to: **Status**: Extracted
  2. Move the entire spec directory into specs/archive/:
    bash
    mkdir -p specs/archive
    mv specs/<spec-name> specs/archive/<spec-name>
    This makes it immediately clear which specs have been processed and which are still active.
3. Update dev/README.md

After all specs have been processed, update dev/README.md once with all new files:

  • If any new files were created in dev/knowledge/, dev/guidelines/, or dev/adr/:
    • Read dev/README.md
    • Add new entries to the appropriate section (Current Guidelines, Current Knowledge, or a new Current ADRs section)
    • Follow the existing link format: - [filename.md](path/to/filename.md) - Brief description
  • If dev/adr/ now has content and there is no "Current ADRs" section in the README, create one following the pattern of the existing sections.
4. Report

Print a combined summary covering all processed specs:

markdown
## Extraction Complete

**Date**: YYYY-MM-DD
**Specs processed**: N

### Per-Spec Summary

| Spec | ADRs | Knowledge | Guidelines | Status |
|------|------|-----------|------------|--------|
| specs/<spec-name-1> | N | N | N | archived |
| specs/<spec-name-2> | N | N | N | archived |

### Totals
- N ADR(s) created in dev/adr/
- N knowledge file(s) updated
- N guideline file(s) updated

### Archived
- specs/<spec-name-1> → specs/archive/<spec-name-1>
- specs/<spec-name-2> → specs/archive/<spec-name-2>

### Files Created/Modified
- <list each file path>

### Next Steps
- Review the created ADRs for accuracy
- Verify knowledge and guideline updates read well in context

Behavior Rules

  • Never write files without user approval in Phase 2
  • If analysis finds nothing to extract (empty across all categories), report cleanly: "No extractable content found in this spec." and skip the review phase
  • If a knowledge file section already contains similar content, flag it for user review rather than duplicating
  • Do not reformat or restructure existing content in knowledge/guidelines files beyond the specific additions
  • Always create specs/archive/ before moving if it does not exist
  • ADR Source paths must reference the archive location (specs/archive/<spec-name>/) since the spec will be moved there
  • For single quotes in bash args, use escape syntax: e.g. 'I'\''m Groot' (or double-quote if possible: "I'm Groot")

© opsmill, 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

Just SKILL.md in .agents/skills/speckit-opsmill-extract of opsmill/infrahub.

Open the folder on GitHubat commit 460d724

Compare with similar skills

Speckit Opsmill Extract 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.

Speckit Opsmill Extract compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Speckit Opsmill Extract this skillopsmill/infrahub531—~3.4kAutomated safety check: PassApache-2.0
Task Workflowikarenkov/Modo343—~2.4kAutomated safety check: PassNone
Architecture Reviewowainlewis/blueprint412—~1.2kAutomated safety check: PassMIT
Architect Build Specsjsmastery-pro/skills1.4k—~7kAutomated safety check: NotesMIT
OpenSpec Bulk Change ArchiverFission-AI/OpenSpec71k3 repos~5.6kAutomated safety check: PassMIT
PR Design DocOpenHands/OpenHands90k—~2.4kAutomated safety check: PassMIT

Similar skills

  • Task Workflow

    ikarenkov/Modo

    Spec-driven workflow for non-trivial work. An agent skill from ikarenkov/Modo.

    343 GitHub stars~2.4k tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Architecture Review

    owainlewis/blueprint

    Reviews a technical proposal before implementation through an independent subagent, returning findings, open questions and a verdict without rewriting it.

    412 GitHub stars~1.2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Architect Build Specs

    jsmastery-pro/skills

    Runs a structured design conversation on a feature, tech stack or enhancement, recommends an answer and records it as a build spec in docs/specs.

    1.4k GitHub stars~7k tokensUpdated 1 mo ago
    DevelopmentAuto-check: notes
  • Archives several completed OpenSpec changes in one operation, checking the codebase to resolve spec conflicts rather than archiving blindly.

    71k GitHub starsUsed in 3 repos~5.6k tokens
    DevelopmentAuto-check passed
  • PR Design Doc

    OpenHands/OpenHands

    For a non-trivial pull request, write a self-contained HTML design doc under the temporary .pr/ directory and link a visibility-appropriate preview in the PR description, so maintainers grasp the…

    90k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Speckit Constitution

    WeihanLi/WeihanLi.Common

    Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.

    242 GitHub starsUsed in 11 repos~2.1k tokens
    DevelopmentAuto-check passed

More from opsmill/infrahub

All 32 skills in this repo
  • Analyzing CI Flakiness

    opsmill/infrahub

    Analyzes recent CI failures on pull requests to identify flaky tests, using retry outcomes (failed attempt → green re-run) and cross-PR recurrence as evidence, and maintains a local longitudinal…

    531 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Audit Docs

    opsmill/infrahub

    Audits internal (dev/) and external (docs/) documentation completeness for a feature, subject, or set of existing docs, maps changes indicated by the user, across Infrahub's documentation layers…

    531 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Commit

    opsmill/infrahub

    Stages and commits the current changes onto a safe working branch, enforcing branch discipline and optionally pushing upstream.

    531 GitHub stars~2.8k tokensUpdated today
    Auto-check: notes
  • A skill your agent uses when you've fixed a bug, added a feature, or made any user-facing change in a project that uses Towncrier and need to record it for the changelog — before committing or…

    531 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Creating Issues

    opsmill/infrahub

    Turns a single feature idea, improvement, or bug into ONE well-structured GitHub issue.

    531 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Creating Prd

    opsmill/infrahub

    Synthesises the current conversation context into a Product Requirements Document and publishes it to GitHub (as a comment on a referenced issue, or a new issue).

    531 GitHub stars~4k tokensUpdated today
    Auto-check passed

Categories

Questions about Speckit Opsmill Extract

What does Speckit Opsmill Extract do?

Extract knowledge, guidelines, and ADRs from one or more completed spec directories into the project documentation system. Speckit Opsmill Extract is an agent skill from opsmill/infrahub. Extract knowledge, guidelines, and ADRs from one or more completed spec directories into the project documentation system.

When should I use Speckit Opsmill Extract?

Speckit Opsmill Extract fits situations like: tasks that involve Architecture decision records; tasks that involve Spec-driven development.

How do I install Speckit Opsmill Extract in Claude Code?

Run `npx skills add opsmill/infrahub --skill speckit-opsmill-extract -a claude-code`. Or copy the skill folder (.agents/skills/speckit-opsmill-extract in opsmill/infrahub) into .claude/skills/speckit-opsmill-extract in your project. Claude Code loads it when a task matches its description.

How do I install Speckit Opsmill Extract in Codex?

Run `npx skills add opsmill/infrahub --skill speckit-opsmill-extract -a codex`. Or copy the skill folder (.agents/skills/speckit-opsmill-extract in opsmill/infrahub) into .agents/skills/speckit-opsmill-extract in your project. Codex loads it when a task matches its description.

Can I use Speckit Opsmill Extract 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 opsmill/infrahub --skill speckit-opsmill-extract -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/speckit-opsmill-extract, .gemini/skills/speckit-opsmill-extract, .github/skills/speckit-opsmill-extract and .opencode/skills/speckit-opsmill-extract in your project.

What does Speckit Opsmill Extract need to run?

SKILL.md names no scripts, command-line tools or credentials: Speckit Opsmill Extract is instructions for the agent only. Compatibility (from SKILL.md): Requires spec-kit project structure with .specify/ directory.

Does Speckit Opsmill Extract access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Speckit Opsmill Extract 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. Review the folder before installing.

What licence does Speckit Opsmill Extract use?

Speckit Opsmill Extract 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 Speckit Opsmill Extract use?

About 3.4k tokens (SKILL.md is roughly 14k 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 Speckit Opsmill Extract?

Skills that share tags, products or a category with Speckit Opsmill Extract: Task Workflow (ikarenkov/Modo, 343 stars), Architecture Review (owainlewis/blueprint, 412 stars), Architect Build Specs (jsmastery-pro/skills, 1.4k stars) and OpenSpec Bulk Change Archiver (Fission-AI/OpenSpec, 71k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Speckit Opsmill Extract?

opsmill (a GitHub organization) maintains it in opsmill/infrahub, which has 531 GitHub stars. The repository holds 32 skills in this directory. The repository was last updated on October 8, 2026.

Source: opsmill/infrahub on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.