Agent skill

Speckit Token Budget Compact

by haru in haru/redmine_ai_helper

Compact one or more Spec-Driven Development artifacts in place to reduce token cost on subsequent /speckit.

MITAuto-check passedDevelopment

Install Speckit Token Budget Compact

skills CLI
$ npx skills add haru/redmine_ai_helper --skill speckit-token-budget-compact -a claude-code

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

GitHub CLI
$ gh skill install haru/redmine_ai_helper speckit-token-budget-compact --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/haru/redmine_ai_helper.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/speckit-token-budget-compact .claude/skills/speckit-token-budget-compact && 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-token-budget-compact
GitHub stars
106
Token cost
~1.8k tokens
SKILL.md length
781 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

Compact one or more Spec-Driven Development artifacts in place to reduce token cost on subsequent /speckit.

  • Works in 7 steps: Backup → Lossless strips (every level) → Medium level (default) → …
  • Tasks that involve Spec-driven development
  • SKILL.md covers Your task, Inputs, Algorithm — apply in order,… and Output, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Speckit Token Budget Compact is an agent skill from haru/redmine_ai_helper. Compact one or more Spec-Driven Development artifacts in place to reduce token cost on subsequent /speckit. commands. Lossless on requirements, decisions, contracts, IDs; strips template scaffolding, examples, and prose padding. The original is preserved as <artifact.full.md the first time an artifact is compacted.

Its SKILL.md is about 1.8k 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 Spec-driven development and LLM cost and token optimization. The repository describes itself as: A Redmine plugin that adds AI agents, MCP Server, smart completion, and vector search. The licence is MIT.

When your agent uses it

  • Tasks that involve Spec-driven development
  • Tasks that involve LLM cost and token optimization

Example prompts

  • “/speckit-token-budget-compact”

Requirements

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

Workflow steps

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

  1. Backup
  2. Lossless strips (every level)
  3. Medium level (default)
  4. Aggressive level
  5. Hard preservation guardrails (every level)
  6. Re-anchor headings
  7. Stamp

What it can do on your machine

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

    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 Token Budget Compact loads about 1.8k tokens when it runs. Until then it costs about 87 tokens; SKILL.md has 781 words of instructions outside code blocks.

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

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 haru/redmine_ai_helper at commit 3cd87d6, republished under its MIT licence (© haru). 781 words, ~1,766 tokens.

Download SKILL.mdSave it as .claude/skills/speckit-token-budget-compact/SKILL.md (or your agent's skills folder).
name
speckit-token-budget-compact
description
Compact one or more Spec-Driven Development artifacts in place to reduce token cost on subsequent /speckit.* commands. Lossless on requirements, decisions, contracts, IDs; strips template scaffolding, examples, and prose padding. The original is preserved as <artifact>.full.md the first time an artifact is compacted.
compatibility
Requires spec-kit project structure with .specify/ directory
metadata.author
Tinesoft
metadata.source
extension:token-budget
user-invocable
true
disable-model-invocation
false

Token Budget Compact Skill

/speckit.token-budget.compact

The user has invoked /speckit.token-budget.compact with arguments: $ARGUMENTS.

Your task

Compact one or more SDD artifacts in the active feature so that downstream spec-kit commands consume fewer tokens, without losing any requirement, decision, contract, ID, user story, or acceptance criterion.

Inputs

  1. Resolve the active feature directory (typically specs/<NNN-feature-name>/) from the current git branch using the existing spec-kit conventions. If the user is not on a feature branch, ask which feature to operate on and stop.

  2. Parse $ARGUMENTS:

    • empty → compact every artifact in the active feature directory.
    • spec | plan | tasks | research | data-model | contracts | quickstart | constitution → compact only that one (or that group, in the case of contracts).
    • a relative or absolute path → compact that file.
    • --level=light|medium|aggressive → override the configured level for this run only.
    • --dry-run → report what would change, write nothing.
  3. Load token-budget-config.yml from the extension directory if present, otherwise use the template defaults. The keys you care about are: compact.level, compact.preserve_sections, compact.drop_sections, compact.preserve_code_blocks, compact.preserve_id_patterns, compact.keep_full_backup.

Algorithm — apply in order, per artifact

Step 1 — Backup

If keep_full_backup is true and <artifact>.full.md does not yet exist, copy the current artifact to <artifact>.full.md. Never overwrite an existing backup. The backup is the source of truth for re-compaction at a different level later.

Step 2 — Lossless strips (every level)
  • Remove HTML comments left over from templates (<!-- ... -->), except the spec-kit machine-readable markers (e.g. <!-- INSERT_STATUS_BELOW -->) if present.
  • Remove sections whose heading prefix-matches any entry in compact.drop_sections.
  • Collapse runs of 3+ blank lines into a single blank line.
  • Remove decorative ASCII separators (---, ===, repeated * or _ runs) that are not Markdown horizontal rules between meaningful sections.
  • Strip repeated cross-reference reminders that the same artifact already states (e.g. "see spec.md FR-001" appearing in three sibling sections — keep the first occurrence per section, drop the rest).
  • Strip phrase-level filler: "Note that", "It should be noted that", "As mentioned above", "For your reference", "Please be aware that", "It is important to understand that", and similar leading hedges. Keep the substantive clause that follows.
Step 3 — Medium level (default)

In addition to Step 2:

  • Convert prose paragraphs that enumerate items into bullet lists when the prose contains "first ... second ... third", "as well as", or comma- separated noun clauses. Only when conversion is lossless — if in doubt, leave the prose alone.
  • Collapse multi-sentence paragraphs that restate a single requirement into one sentence per requirement.
  • For tables that have an "Example" or "Notes" column with prose larger than 20 words, condense to ≤ 12 words per cell.
Step 4 — Aggressive level

In addition to Steps 2–3:

  • Drop sections titled "Rationale", "Alternatives Considered", "Background", "Motivation" — these are valuable for humans but the decision they justify is captured elsewhere in the artifact.
  • Drop the leading framing paragraph of each top-level section if a structured list immediately follows that conveys the same information.
  • Replace prose in "Research" findings with a one-line conclusion plus a bulleted evidence list.
Show full SKILL.md (308 more words)Show less
Step 5 — Hard preservation guardrails (every level)

Never modify, paraphrase, or remove:

  • Any line containing a token that matches compact.preserve_id_patterns (FR-001, NFR-002, T015, US-003, AC-007, etc.) — keep the line verbatim.
  • Any heading that prefix-matches compact.preserve_sections.
  • Any fenced code block when preserve_code_blocks is true (default).
  • The contents of contracts/* schema files (OpenAPI, JSON Schema, GraphQL SDL). You may strip surrounding markdown prose but the schema bytes must be identical.
  • The Constitution check matrix in plan.md.
  • The acceptance test expectations in tasks.md.
  • File path references (anything that looks like a path: src/..., ./..., /...).

If at any point you are uncertain whether a transformation is lossless, do not apply it. Compaction must never invent, summarize away, or merge distinct requirements.

Step 6 — Re-anchor headings

After stripping, ensure heading levels are still contiguous (no jump from # to ###). Promote orphan subheadings as needed. The artifact must still parse as a valid spec-kit document of its kind.

Step 7 — Stamp

Append a single line at the very bottom of the compacted file:

<!-- token-budget: compacted (level=<level>) on <ISO-8601-date>; original at <basename>.full.md -->

This marker lets usage and re-runs detect already-compacted files and skip no-op work.

Output

For each artifact processed, run the helper script to get character/token counts before and after, then report:

spec.md           4,820 → 2,310 tokens   (-52.1%)   [backup: spec.full.md]
plan.md           6,140 → 3,580 tokens   (-41.7%)   [backup: plan.full.md]
research.md       3,200 → 1,180 tokens   (-63.1%)   [backup: research.full.md]
─────────────────────────────────────────────────
total            14,160 → 7,070 tokens   (-50.1%)

Then end the response. Do not narrate the steps you took — the file diff is the deliverable.

Scripts

The helper script .specify/extensions/token-budget/scripts/bash/compact_helper.sh provides:

  • snapshot <file> — prints the current token count.
  • backup_if_needed <file> — copies to .full.md if no backup exists yet.
  • summarize <before_path> <after_path> — prints the one-line report row.
  • has_marker <file> — exit 0 if file is already compacted.
  • stamp <file> <level> — append the compaction marker.

Use it to keep your edits auditable and the output consistent. You do the content rewriting; the script does the bookkeeping.

Re-running

If an artifact already carries the <!-- token-budget: compacted --> marker, re-compaction works against the .full.md backup, not the current compacted version. This prevents lossy compounding across runs.

© haru, MIT. 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 .claude/skills/speckit-token-budget-compact of haru/redmine_ai_helper.

Open the folder on GitHubat commit 3cd87d6

Compare with similar skills

Speckit Token Budget Compact 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 Token Budget Compact compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Speckit Token Budget Compact this skillharu/redmine_ai_helper106—~1.8kAutomated safety check: PassMIT
LobeHub Alint Rule Set Maintenancelobehub/lobehub83k—~1.9kAutomated safety check: PassCustom licence
Levyra Context EfficiencyLUC4N3X/Levyra-deepsound591—~1.3kAutomated safety check: NotesGPL-3.0
Docs Impact Classifiermicrosoft/apm4k—~1.8kAutomated safety check: PassMIT
CostHouseofmvps/ultraship123—~1.1kAutomated safety check: NotesMIT
Token Efficiencyrohitg00/pro-workflow2.9k—~1kAutomated safety check: PassNone

Similar skills

  • Maintains LobeHub's model-backed alint rule set: writing rules, removing false positives against real code, deciding warn versus error and tracking token cost.

    83k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Levyra Context Efficiency

    LUC4N3X/Levyra-deepsound

    A skill your agent uses for genuinely high-volume Levyra work such as builds, tests, lint, logs, broad searches, dependency output, Git/GitHub or CodeRabbit inspection, CI diagnostics, agent setup…

    591 GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check: notes
  • Official

    A skill your agent uses to classify the documentation impact of a pull request diff, returning one of three verdicts -- no-change, in-place edit, or structural change -- with bounded LLM cost.

    4k GitHub stars~1.8k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Cost

    Houseofmvps/ultraship

    AI Build Cost Tracker — track how much AI is costing you per feature.

    123 GitHub stars~1.1k tokensUpdated 3 mo ago
    DevelopmentAuto-check: notes
  • Token Efficiency

    rohitg00/pro-workflow

    Reduce token waste by 40-60% through anti-sycophancy rules, tool-call budgets, one-pass coding, task profiles, and read-before-write enforcement.

    2.9k GitHub stars~1k tokensUpdated 12 days ago
    DevelopmentAuto-check passed
  • Skill Reviewer

    microsoft/GitHub-Copilot-for-Azure

    Official

    Review skill PRs with structured severity-rated feedback covering token budgets, routing conflicts, and repo conventions.

    255 GitHub stars~482 tokensUpdated yesterday
    DevelopmentAuto-check passed

More from haru/redmine_ai_helper

All 23 skills in this repo
  • Commit

    haru/redmine_ai_helper

    Stage the current changes and create a git commit with a properly formatted English message.

    106 GitHub stars~1.1k tokensUpdated today
    Auto-check: notes
  • Create Pull Request

    haru/redmine_ai_helper

    Create a pull request from the current branch. An agent skill from haru/redmine_ai_helper.

    106 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Create Release Branch

    haru/redmine_ai_helper

    Create a release branch for a given version. An agent skill from haru/redmine_ai_helper.

    106 GitHub stars~599 tokensUpdated today
    Auto-check passed
  • Record Code Review Feedback

    haru/redmine_ai_helper

    Record code review findings (GitHub Copilot PR review or a local AI review) that led to a code change in docs/code-review-feedback/ as append-only entries with root-cause analysis.

    106 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Record Spec Feedback

    haru/redmine_ai_helper

    Record a user's correction of an AI-written specification in docs/spec-feedback/ as an append-only entry with root-cause analysis.

    106 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Qlty Check

    haru/redmine_ai_helper

    Code quality checks, formatting, and metrics via qlty CLI. An agent skill from haru/redmine_ai_helper.

    106 GitHub starsUsed in 2 repos~628 tokens
    Auto-check passed

Questions about Speckit Token Budget Compact

What does Speckit Token Budget Compact do?

Compact one or more Spec-Driven Development artifacts in place to reduce token cost on subsequent /speckit. Speckit Token Budget Compact is an agent skill from haru/redmine_ai_helper. Compact one or more Spec-Driven Development artifacts in place to reduce token cost on subsequent /speckit.

When should I use Speckit Token Budget Compact?

Speckit Token Budget Compact fits situations like: tasks that involve Spec-driven development; tasks that involve LLM cost and token optimization.

How do I install Speckit Token Budget Compact in Claude Code?

Run `npx skills add haru/redmine_ai_helper --skill speckit-token-budget-compact -a claude-code`. Or copy the skill folder (.claude/skills/speckit-token-budget-compact in haru/redmine_ai_helper) into .claude/skills/speckit-token-budget-compact in your project. Claude Code loads it when a task matches its description.

How do I install Speckit Token Budget Compact in Codex?

Run `npx skills add haru/redmine_ai_helper --skill speckit-token-budget-compact -a codex`. Or copy the skill folder (.claude/skills/speckit-token-budget-compact in haru/redmine_ai_helper) into .agents/skills/speckit-token-budget-compact in your project. Codex loads it when a task matches its description.

Can I use Speckit Token Budget Compact 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 haru/redmine_ai_helper --skill speckit-token-budget-compact -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-token-budget-compact, .gemini/skills/speckit-token-budget-compact, .github/skills/speckit-token-budget-compact and .opencode/skills/speckit-token-budget-compact in your project.

What does Speckit Token Budget Compact need to run?

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

Does Speckit Token Budget Compact 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 Token Budget Compact 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 Token Budget Compact use?

Speckit Token Budget Compact is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Speckit Token Budget Compact use?

About 1.8k tokens (SKILL.md is roughly 7.1k 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 Token Budget Compact?

Skills that share tags, products or a category with Speckit Token Budget Compact: LobeHub Alint Rule Set Maintenance (lobehub/lobehub, 83k stars), Levyra Context Efficiency (LUC4N3X/Levyra-deepsound, 591 stars), Docs Impact Classifier (microsoft/apm, 4k stars) and Cost (Houseofmvps/ultraship, 123 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Speckit Token Budget Compact?

haru (a GitHub user) maintains it in haru/redmine_ai_helper, which has 106 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 10, 2026.

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