Skip to content

feat: add FinOps discipline across templates, workflow engine, and CI#2515

Open
duksh wants to merge 2 commits into
github:mainfrom
duksh:main
Open

feat: add FinOps discipline across templates, workflow engine, and CI#2515
duksh wants to merge 2 commits into
github:mainfrom
duksh:main

Conversation

@duksh
Copy link
Copy Markdown

@duksh duksh commented May 11, 2026

Description

Adds FinOps (Cloud Financial Operations) discipline to Spec Kit so that
AI/LLM compute is treated as a first-class cost resource rather than a
zero-cost utility. Changes are purely additive — no existing structure
or APIs are broken.

What's included:

  • spec-template.md: new ## Cost Allocation table (team, cost center,
    approved/actual LLM budget, clarification rounds)
  • plan-template.md: mandatory AI Model Tier and Estimated Token Budget
    fields in Technical Context
  • constitution-template.md: Article VI — Economic Efficiency (haiku default,
    fan-out cap, 80%-spend pause rule)
  • templates/commands/plan.md: errors on unfilled cost placeholders
  • templates/commands/clarify.md: clarification budget guard; pauses when
    session count ≥ budget
  • New budget-gate workflow step type — circuit breaker at 80% (warning)
    and 100% (abort/pause) of approved LLM spend; supports {{ }} expressions
  • FanOutStep: renames max_concurrencymax_parallel (deprecated alias
    kept), default 1 → 3; engine batches iteration in groups of max_parallel
  • New cost-tracker extension (record + report commands, after_implement
    hook) — writes actual spend back to the spec's Cost Allocation table and
    renders a per-feature budget summary
  • cost_profile block in extension manifests; surfaced in
    specify extension list CLI output
  • workflows/speckit/workflow.yml: budget_usd input, cost-review gate,
    spend-check budget-gate step
  • CI: PR path filter, fail-fast: true, uv dependency cache

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest — 324 passed
  • uvx ruff check src/ — no violations
  • markdownlint-cli2 "**/*.md" — no violations
  • Tested with a sample project (if applicable)

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

This contribution was generated with Claude Code (claude-sonnet-4-6) via an
agentic session that performed the FinOps analysis, produced the implementation
plan, wrote all code and templates, addressed CI failures, and responded to
CodeRabbit review comments. All changes were reviewed and approved by the
human contributor before merging.

duksh added 2 commits May 11, 2026 20:29
…#1)

19 files changed, 759 additions, 31 deletions.

- Cost Allocation table in spec-template.md
- AI Model Tier / Estimated Token Budget fields in plan-template.md
- Economic Efficiency principle (Article VI) in constitution-template.md
- Clarification budget guard in clarify.md; cost field validation in plan.md
- budget-gate step type (circuit breaker at 80%/100% LLM spend)
- Fan-out max_parallel rename + batched engine loop
- cost-tracker extension (record + report commands, after_implement hook)
- cost_profile surfaced in specify extension list CLI
- cost-review gate + spend-check step in speckit workflow
- CI: path filter, fail-fast, uv cache

https://claude.ai/code/session_017mzZmq4F57rAFJVsvVpnva
@duksh duksh requested a review from mnriem as a code owner May 11, 2026 16:32
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented May 12, 2026

Please deliver this as an externally hosted extension as per https://github.com/github/spec-kit/blob/main/extensions/EXTENSION-PUBLISHING-GUIDE.md

Copy link
Copy Markdown
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments above

duksh pushed a commit to duksh/gith-spec-kit that referenced this pull request May 12, 2026
Per upstream review feedback (github#2515), deliver cost-tracker
as an externally hosted extension rather than bundled in the core repo.

- Add README.md, LICENSE (MIT), CHANGELOG.md required by the publishing guide
- Update extension.yml repository/homepage to duksh/spec-kit-cost-tracker
- Remove cost-tracker entry from catalog.json (will be submitted to
  catalog.community.json via the issue template instead)

https://claude.ai/code/session_017mzZmq4F57rAFJVsvVpnva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants