Skip to content

[Extension]: Add Spec Inventory (speckit-inventory) #4226

Description

@Yash-Chindam

Extension ID

speckit-inventory

Extension Name

Spec Inventory

Version

0.1.0

Description

Read-only inventory of live requirement and task IDs, with focused per-task context packs instead of whole-file dumps.

Author

Yash Chindam

Repository URL

https://github.com/Yash-Chindam/spec-kit-inventory-alignment

Download URL

https://github.com/Yash-Chindam/spec-kit-inventory-alignment/releases/download/v0.1.0/speckit-inventory.zip

License

MIT

Homepage (optional)

https://github.com/Yash-Chindam/spec-kit-inventory-alignment

Documentation URL (optional)

https://github.com/Yash-Chindam/spec-kit-inventory-alignment/blob/main/speckit-inventory/README.md

Changelog URL (optional)

https://github.com/Yash-Chindam/spec-kit-inventory-alignment/blob/main/speckit-inventory/CHANGELOG.md

Required Spec Kit Version

=0.9.0

Required Tools (optional)

None. Python 3.11+ only, no third-party dependencies.

Number of Commands

2

Number of Hooks (optional)

2

Tags

inventory, requirements, context, traceability, alignment

Key Features

Filed at @mnriem's request in #4164 — this is the read-only primitive half of the extension + preset pair proposed in #4164 (comment). The companion preset inventory-alignment is submitted separately.

  • Regenerates every live ID on each run. Extracts all FR-, NFR-, SC-, AC-, and T- IDs from the existing spec.md and tasks.md and prints JSON. Nothing is persisted, so there is no sidecar and no second source of truth that can drift out of sync with the Markdown.
  • Read-only. The script contains no write calls. It never edits spec.md, tasks.md, or creates files.
  • Focused context packs. speckit.speckit-inventory.context returns one task plus only the requirements that task covers, instead of loading whole artifacts into context.
  • Dangling-reference detection. Each record reports its source artifact. spec.md is scanned first and wins as the definition site, so any ID whose source is tasks.md is a reference to a requirement that was never defined.
  • Lenient task-ID matching. T014, T14, t14, and TASK-14 all resolve to the same record.
  • Optional hooks. before_specify and before_analyze, both optional: true, so they prompt rather than fire automatically.
  • No embeddings. Deliberately out of scope; that was Phase 2 of the original proposal.

Testing Checklist

  • Extension installs successfully via download URL
  • All commands execute without errors
  • Documentation is complete and accurate
  • No security vulnerabilities identified
  • Tested on at least one real project

Submission Requirements

  • Valid extension.yml manifest included
  • README.md with installation and usage instructions
  • LICENSE file included
  • GitHub release created with version tag
  • All command files exist and are properly formatted
  • Extension ID follows naming conventions (lowercase-with-hyphens)

Testing Details

Tested on: Windows 11 with Spec Kit 0.16.5.dev0 (built from main), Python 3.11.14

Test project: a project scaffolded with specify init --integration copilot, plus a synthetic checkout feature under specs/001-checkout/ defining FR-001, FR-002, NFR-001, SC-001 and four tasks. To be precise about the scope of this claim: this is a purpose-built test project, not a long-running production one.

Test scenarios, all run against the published release archive rather than a local checkout:

  1. Installed via specify extension add speckit-inventory --from <download-url>. Both commands registered; 2 agent skills auto-registered.
  2. Verified both hooks were written to .specify/extensions.yml with optional: true.
  3. Ran inventory.py --feature-dir specs/001-checkout — returned all 4 defined requirements plus the 4 tasks with their covers: links, and correctly parsed a completed [X] task.
  4. Ran the context pack for a linked task (--task T002 → task plus FR-001, NFR-001, i.e. 2 of 5 requirements) and for an unlinked task (--task T001 → empty requirement list, which is the documented valid case).
  5. Verified --task T2, T14, t14, and TASK-14 all resolve, and that unknown (T999) and malformed (Txx) IDs fail with distinct, non-crashing errors.
  6. Verified dangling-reference reporting: a task covering an undefined FR-009 surfaces it with "source": "tasks.md".
  7. Confirmed the download URL returns HTTP 200 and the downloaded bytes match the sha256 in the proposed catalog entry below.
  8. Unit tests: 9/9 pass.

Security note for the "no vulnerabilities" box: the script is dependency-free, uses no eval, exec, pickle, subprocess, or network access, and performs no writes. It only reads two Markdown files under a caller-supplied feature directory and prints JSON.

Not covered: the two commands were verified by running the script they invoke and by confirming registration, but /speckit.speckit-inventory.list and .context were not invoked as slash commands inside a live coding-agent session. Happy to run that and post results if you want that evidence before vetting.

Example Usage

# Load every live requirement and task ID for a feature
speckit.speckit-inventory.list feature=specs/001-checkout

# Load only what one task needs
speckit.speckit-inventory.context feature=specs/001-checkout task=T002

The context pack keeps the payload proportional to the task rather than the spec:

{
  "schema_version": "1",
  "feature_dir": "specs/001-checkout",
  "task": {
    "id": "T002",
    "source": "tasks.md",
    "line": 4,
    "text": "[P] [US1] Implement the charge call in src/payments/charge.ts (covers: FR-001, NFR-001)",
    "covers": ["FR-001", "NFR-001"]
  },
  "requirements": [
    { "id": "FR-001", "source": "spec.md", "line": 5, "text": "- FR-001: The system MUST charge the card when the user presses Pay." },
    { "id": "NFR-001", "source": "spec.md", "line": 7, "text": "- NFR-001: Checkout MUST complete within 2 seconds at p95." }
  ]
}

Proposed Catalog Entry

"speckit-inventory": {
  "name": "Spec Inventory",
  "id": "speckit-inventory",
  "description": "Read-only inventory of live requirement and task IDs, with focused per-task context packs instead of whole-file dumps.",
  "author": "Yash Chindam",
  "version": "0.1.0",
  "download_url": "https://github.com/Yash-Chindam/spec-kit-inventory-alignment/releases/download/v0.1.0/speckit-inventory.zip",
  "sha256": "9ebf004ef6494323f6dccfab2554a04898c9e92bc7f25e0638b5aee916566e7f",
  "repository": "https://github.com/Yash-Chindam/spec-kit-inventory-alignment",
  "homepage": "https://github.com/Yash-Chindam/spec-kit-inventory-alignment",
  "documentation": "https://github.com/Yash-Chindam/spec-kit-inventory-alignment/blob/main/speckit-inventory/README.md",
  "changelog": "https://github.com/Yash-Chindam/spec-kit-inventory-alignment/blob/main/speckit-inventory/CHANGELOG.md",
  "license": "MIT",
  "category": "visibility",
  "effect": "read-only",
  "requires": {
    "speckit_version": ">=0.9.0"
  },
  "provides": {
    "commands": 2,
    "hooks": 2
  },
  "tags": [
    "inventory",
    "requirements",
    "context",
    "traceability",
    "alignment"
  ],
  "verified": false,
  "downloads": 0,
  "stars": 0,
  "created_at": "2026-08-20T00:00:00Z",
  "updated_at": "2026-08-20T00:00:00Z"
}

Suggested docs row for docs/community/extensions.md, alphabetically between Spec Diagram and Spec Kit Discovery Extension:

| Spec Inventory | Read-only inventory of live requirement and task IDs, with focused per-task context packs instead of whole-file dumps | `visibility` | Read-only | [spec-kit-inventory-alignment](https://github.com/Yash-Chindam/spec-kit-inventory-alignment) |

Additional Context

Naming deviation worth flagging. The issue comment asked for speckit.inv.context, but that name cannot coexist with the extension id speckit-inventory that the same comment specifies — the extension loader requires a command's namespace segment to equal the manifest id, so installing that combination fails:

Validation Error: Command 'speckit.inv.context' must use extension namespace 'speckit-inventory'

I kept the id and named the commands speckit.speckit-inventory.list / .context. If the shorter invocation is preferred, renaming the extension id to inv gets there — one manifest line plus new release assets. Happy to do that.

Supersedes a PR. I originally opened #4220 editing the catalog directly, because the issue asked for a PR. @mnriem redirected me here, which also matches EXTENSION-PUBLISHING-GUIDE.md. That PR is being closed in favor of this submission.

AI disclosure. Filed on behalf of @Yash-Chindam by Claude Code (model: Claude Opus 5). Per CONTRIBUTING, this contribution used substantial AI assistance for code generation, not just documentation. The extension was first drafted with ChatGPT (Codex, model: GPT-5). It was then reviewed and corrected with Claude Code (model: Claude Opus 5), acting autonomously on my behalf, which found and fixed real defects in that draft — requirement IDs were harvested from spec.md only rather than both artifacts, and the CLI rejected unpadded task IDs so --task T14 failed on a task literally written as T14 — and which added the list command, the hooks, expanded the tests from 2 to 9, and wrote this submission. Every check in Testing Details was executed by Claude Code on my machine at my direction and the results reviewed by me; I am not claiming I re-ran each command by hand. Repository commits carry Assisted-by: trailers accordingly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions