Skip to content

Compress checklist command template (27% fewer tokens, same semantics)#2944

Open
Xopoko wants to merge 2 commits into
github:mainfrom
Xopoko:chore/2943-compress-checklist-template
Open

Compress checklist command template (27% fewer tokens, same semantics)#2944
Xopoko wants to merge 2 commits into
github:mainfrom
Xopoko:chore/2943-compress-checklist-template

Conversation

@Xopoko

@Xopoko Xopoko commented Jun 11, 2026

Copy link
Copy Markdown

Description

Proof of concept for #2943: editorial compression of templates/commands/checklist.md — the largest command template — from 4,460 to 3,257 tokens (-27%, o200k_base). The template body is rendered into every agent integration and loaded into the model's context on every /speckit.checklist invocation, so this is a per-use saving for every Spec Kit user.

This is a wording change, not a behavior change. Invariants held (mechanically checked against origin/main):

  • frontmatter byte-identical;
  • every fenced block containing commands or literal output templates byte-identical — including both extension-hook EXECUTE_COMMAND: blocks;
  • all placeholder tokens and .specify/ paths preserved;
  • every numbered step and MUST/NEVER/"do not" rule preserved with full semantics; only boilerplate prose, restatements, and surplus examples were cut (at least one example per concept retained);
  • rule lists keep one-rule-per-bullet structure (restored after the Copilot review — compression comes from prose removal, not from collapsing structure).

The full per-template methodology, measurements for all nine templates, and the discussion this PR is a starting point for live in #2943. The remaining eight templates are ready on chore/2943-compress-command-templates and I'm happy to submit them in whatever granularity the maintainers prefer.

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest (all pass)
  • Tested with a sample project: uv run specify init --integration claude from this branch renders all skills correctly (rendered output diffed against the template — only the expected {SCRIPT}/path substitutions differ); we also run the compressed templates in a production multi-repo SDD workspace where a full specify→plan→tasks→implement cycle behaved identically to the verbose originals

AI Disclosure

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

The compression draft was produced with LLM assistance under the hard invariants above, then verified by a deterministic invariant script (frontmatter equality; placeholder, path, and fenced-block inventory diff) and an adversarial line-by-line semantic review; violations found by review were restored before submission. I personally reviewed and tested the result (pytest, rendered init, and the production workspace run described above).

Editorial compression of templates/commands/checklist.md: 4,460 -> 3,183
tokens (o200k_base) for the body rendered into every agent integration
and loaded on every /speckit.checklist invocation.

Invariants: frontmatter byte-identical; fenced command and literal
output-template blocks (incl. both extension-hook EXECUTE_COMMAND blocks)
byte-identical; all placeholders and .specify/ paths preserved; every
numbered step and MUST/NEVER rule preserved with full semantics. Only
boilerplate prose, restatements, and surplus examples were cut.

Proof of concept for the proposal in github#2943.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR streamlines the checklist command template by collapsing many multi-line guideline sections into shorter, more compact paragraphs, while emphasizing that checklists validate requirement quality (not implementation behavior).

Changes:

  • Condensed introductory “unit tests for English” explanation and examples.
  • Simplified extension hook instructions and clarifying-question guidance into fewer, denser bullets/paragraphs.
  • Compressed checklist generation rules (naming, append behavior, item structure) and domain examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread templates/commands/checklist.md Outdated
Comment thread templates/commands/checklist.md Outdated
Comment thread templates/commands/checklist.md Outdated
Comment thread templates/commands/checklist.md Outdated
Comment thread templates/commands/checklist.md Outdated
Re-split the collapsed multi-clause sentences into discrete bullets:
labeled NOT/FOR example blocks, clarifying-question MUST rules and
formatting rules, context-loading strategy, file create/append/preserve
rules, core-principle quality dimensions, and item-structure rules.
Compression now comes from removing redundant prose only, not from
collapsing rule structure. 4,460 -> 3,257 tokens (-27%).
Xopoko added a commit to Xopoko/spec-kit that referenced this pull request Jun 11, 2026
Mirror of the review-feedback restructuring on the proof-of-concept
branch (github#2944): discrete bullets for all rule lists; compression from
prose removal only. 4,460 -> 3,257 tokens (-27%).
@Xopoko

Xopoko commented Jun 11, 2026

Copy link
Copy Markdown
Author

Addressed the review in 509bba5: all collapsed rule chains are back to one-rule-per-bullet structure (labeled NOT/FOR blocks, question rules, context-loading strategy, file create/append/preserve rules, quality dimensions, item structure). That was the right call — the structure costs only 74 tokens. Updated numbers: 4,460 → 3,257 tokens (-27%). Invariant checks still pass; same restructuring mirrored on the full nine-template branch.

@Xopoko Xopoko changed the title Compress checklist command template (29% fewer tokens, same semantics) Compress checklist command template (27% fewer tokens, same semantics) Jun 11, 2026
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