Skip to content

[Extension]: Add Token Economy #3048

@formin

Description

@formin

Extension ID

token-economy

Extension Name

Token Economy

Version

1.0.0

Description

Token routing, measured savings, and context audit workflows.

Author

formin

Repository URL

https://github.com/formin/spec-kit-token-economy

Download URL

https://github.com/formin/spec-kit-token-economy/archive/refs/tags/v1.0.0.zip

License

MIT

Homepage (optional)

https://github.com/formin/spec-kit-token-economy

Documentation URL (optional)

https://github.com/formin/spec-kit-token-economy/blob/main/README.md

Changelog URL (optional)

https://github.com/formin/spec-kit-token-economy/blob/main/CHANGELOG.md

Required Spec Kit Version

=0.10.0

Required Tools (optional)

  • rtk - optional, measured shell-output savings via rtk gain
  • headroom - optional, measured context savings via headroom perf
  • token-router - optional, raw evidence line routing workflow
  • ollama - optional, local model runtime for token-router
  • python >=3.10 - optional, needed for token-router and helper workflows

Number of Commands

3

Number of Hooks (optional)

2

Tags

tokens, routing, reporting, context

Key Features

  • Route large logs, source files, and routeable agent-context references into raw evidence slices using the token-router pattern.
  • Report RTK and Headroom savings separately, with measured-only output and no estimates.
  • Audit Spec Kit projects for oversized specs, logs, generated outputs, and always-on agent instruction files.
  • Provide optional after_tasks and after_implement hooks for context audit and savings reporting.
  • Include Bash and PowerShell helper scripts for tool availability and measured savings checks.

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:

Test scenarios:

  1. Validated extension.yml with Python/YAML checks for ID format, version, tags, command namespace, and command file existence.
  2. Syntax-checked the Bash helper with bash -n.
  3. Executed the Bash helper from source and from an installed extension copy.
  4. Executed the PowerShell helper from source and from an installed extension copy.
  5. Installed locally with specify extension add /k/dev/github/spec-kit-token-economy --dev --force in a temporary Spec Kit Claude project.
  6. Verified specify extension list reports Token Economy v1.0.0 with 3 commands and 2 hooks.
  7. Verified Claude skill registration generated:
    • .claude/skills/speckit-token-economy-route-evidence/SKILL.md
    • .claude/skills/speckit-token-economy-report-savings/SKILL.md
    • .claude/skills/speckit-token-economy-audit-context/SKILL.md
  8. Installed from the release ZIP with specify extension add token-economy --from https://github.com/formin/spec-kit-token-economy/archive/refs/tags/v1.0.0.zip --force.
  9. Verified the release ZIP install registered the same three Claude skills and extension registry entries.

The commands are Spec Kit prompt commands. Runtime verification covered manifest validation, installation, command registration, hooks registration, and the packaged helper scripts referenced by the commands.

Example Usage

specify extension add token-economy --from https://github.com/formin/spec-kit-token-economy/archive/refs/tags/v1.0.0.zip

/speckit.token-economy.route-evidence error_log logs/ci.log --query "timeout"
/speckit.token-economy.audit-context
/speckit.token-economy.report-savings --hours 168

Proposed Catalog Entry

{
  "token-economy": {
    "name": "Token Economy",
    "id": "token-economy",
    "description": "Token routing, measured savings, and context audit workflows.",
    "author": "formin",
    "version": "1.0.0",
    "download_url": "https://github.com/formin/spec-kit-token-economy/archive/refs/tags/v1.0.0.zip",
    "repository": "https://github.com/formin/spec-kit-token-economy",
    "homepage": "https://github.com/formin/spec-kit-token-economy",
    "documentation": "https://github.com/formin/spec-kit-token-economy/blob/main/README.md",
    "changelog": "https://github.com/formin/spec-kit-token-economy/blob/main/CHANGELOG.md",
    "license": "MIT",
    "category": "process",
    "effect": "read-write",
    "requires": {
      "speckit_version": ">=0.10.0",
      "tools": [
        { "name": "rtk", "required": false },
        { "name": "headroom", "required": false },
        { "name": "token-router", "required": false },
        { "name": "ollama", "required": false },
        { "name": "python", "version": ">=3.10", "required": false }
      ]
    },
    "provides": {
      "commands": 3,
      "hooks": 2
    },
    "tags": ["tokens", "routing", "reporting", "context"],
    "verified": false,
    "downloads": 0,
    "stars": 0,
    "created_at": "2026-06-17T23:10:00Z",
    "updated_at": "2026-06-17T23:10:00Z"
  }
}

Additional Context

This extension adapts two existing token-efficiency projects for Spec Kit workflows without vendoring their code:

The extension policy is that only RTK and Headroom may be reported as measured token savings. token-router and local Ollama are treated as evidence-routing tools, not as token-savings metrics.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions