github / github/spec-kit

[Extension]: Add spec-kit-cost

オープン
#3,566 コメント 3 件 リアクション 0 件 担当者 2 名 @rnoap が担当を希望しています GitHub で見る
enhancement extension-submission validation-failed
主要言語
Python
スター
137k
フォーク
12.3k
平均マージ
2日 12時間
マージ済み PR(30日)
159

説明

### Extension ID

cost

### Extension Name

spec-kit-cost

### Version

1.4.0

### Description

Tracks LLM token cost per spec-kit workflow step, showing a running per-step cost and total spec implementation cost, with cache-aware pricing and measured usage on supported hosts.

### Author

Raúl Noa Pedroso

### Repository URL

https://github.com/rnoap/spec-kit-cost

### Download URL

https://github.com/rnoap/spec-kit-cost/archive/refs/tags/v1.4.0.zip

### License

MIT

### Homepage (optional)

https://github.com/rnoap/spec-kit-cost

### Documentation URL (optional)

https://github.com/rnoap/spec-kit-cost/blob/main/README.md

### Changelog URL (optional)

https://github.com/rnoap/spec-kit-cost/blob/main/CHANGELOG.md

### Required Spec Kit Version

>=0.4.0

### Required Tools (optional)

```markdown
None — pure POSIX bash (awk/grep/sed/cut/date), no external runtime dependencies.
```

### Number of Commands

3

### Number of Hooks (optional)

7

### Tags

cost, tokens, budget, observability, ledger, token-usage

### Key Features

- Per-step inline cost summary after each of 7 spec-kit lifecycle events (specify, clarify, plan, tasks, analyze, checklist, implement)
- Cumulative cost report shown automatically after `implement`, or on demand via speckit.cost.report
- Append-only USD ledger (JSON Lines) — entries are never modified, only appended
- Zero-config — works out of the box with sensible defaults and a built-in model-price catalog (Claude, OpenAI, Google Gemini)
- Measured token usage — on hosts exposing a session-store query tool (currently VS Code Copilot), records real token/cache counts instead of chars÷4 estimates
- Cache-aware pricing — prices cache-read/cache-write tokens at their own rates instead of the full input rate (verified case: 6.8x cost overstatement avoided)
- Pluggable providers — self-report (default), manual, log-file (planned)

### Testing Checklist

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

### Submission Requirements

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

### Testing Details

**Tested on:**
- Windows 11 with Git Bash (bats-core via npm) — spec-kit CLI 0.12.18.dev0
- Dogfooded within this repository across specs 001-004 (real per-step cost tracking)

**Test project:** this repository itself (rnoap/spec-kit-cost), specs/001-004

**Test scenarios:**
1. Installed extension from GitHub release archive URL (v1.4.0) into a fresh spec-kit project — succeeded, no errors
2. Ran full bats suite (record.bats, report.bats, reset.bats) covering record/report/reset commands, cache-aware pricing, measured vs. estimated sourcing, and byte-identity regression against legacy behavior
3. Verified hooks fire correctly across all 7 lifecycle events during real spec-kit workflow runs
4. Verified ledger append-only behavior and cumulative report output

### Example Usage

```markdown
# Install extension
specify extension add cost --from https://github.com/rnoap/spec-kit-cost/archive/refs/tags/v1.4.0.zip

# Use a command
/speckit.cost.report
```

### Proposed Catalog Entry

```json
{
"spec-kit-cost": {
"name": "spec-kit-cost",
"id": "cost",
"description": "Tracks LLM token cost per spec-kit workflow step, showing a running per-step cost and total spec implementation cost, with cache-aware pricing and measured usage on supported hosts.",
"author": "Raúl Noa Pedroso",
"version": "1.4.0",
"download_url": "https://github.com/rnoap/spec-kit-cost/archive/refs/tags/v1.4.0.zip",
"sha256": "7c3cc3e4f215339eb185ebc7d73addfd948dfbfb2b2d7a671612c0a05e32d538",
"repository": "https://github.com/rnoap/spec-kit-cost",
"homepage": "https://github.com/rnoap/spec-kit-cost",
"documentation": "https://github.com/rnoap/spec-kit-cost/blob/main/README.md",
"changelog": "https://github.com/rnoap/spec-kit-cost/blob/main/CHANGELOG.md",
"license": "MIT",
"requires": {
"speckit_version": ">=0.4.0",
"tools": []
},
"provides": {
"commands": 3,
"hooks": 7
},
"tags": ["cost", "tokens", "budget", "observability", "ledger", "token-usage"],
"verified": false
}
}
```

### Additional Context

_No response_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。