spec-implementation-hygiene

spec-implementation-hygiene is a cursor rule for Cursor from zotoio/CRUX-Compress. It costs 866 tokens per session, scanned A, original, MIT.

A set of coding rules for keeping temporary specification details out of production code. Required database or data migrations are stored as runnable upgrade files beside the specification.

In plain words
What is it for?
Use it when implementing engineering specifications or running planned upgrades. It helps decide where migration logic belongs and what comments, messages, and identifiers should contain.
Why use it?
It prevents old task names, phase numbers, and compatibility workarounds from cluttering code after the related work is finished. The migration steps remain available without mixing project coordination details into the application.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/zotoio/crux-compress/spec-implementation-hygiene
Clone the repo
git clone --depth 1 https://github.com/zotoio/CRUX-Compress

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spec-implementation-hygiene

README.md
[![agentmods](https://agentmods.dev/badge/rules/zotoio/crux-compress/spec-implementation-hygiene.svg)](https://agentmods.dev/rules/zotoio/crux-compress/spec-implementation-hygiene)
Your own site
<a href="https://agentmods.dev/rules/zotoio/crux-compress/spec-implementation-hygiene"><img src="https://agentmods.dev/badge/rules/zotoio/crux-compress/spec-implementation-hygiene.svg" alt="Measured on agentmods" height="20"></a>
Per session 866 This file is loaded in full into every session.
When invoked 866 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00866 $0.00866
Opus 5 $0.00433 $0.00433
Sonnet 5 $0.00173 $0.00173
Haiku 4.5 $0.00087 $0.00087

Measured 5d ago against content hash 5ba6e2caed14, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

spec-implementation-hygiene scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/spec-implementation-hygiene.mdc · 52 lines

How it starts

The opening of the file, as written. The whole thing — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spec Implementation Hygiene

When implementing or executing engineering specs (anything under specs/ or .ai-ignored/executed/), keep production code clean of coordination metadata and avoid backwards-compatibility shims. Capture any required migration logic in an executable upgrade file inside the spec directory.

Rules

1. No spec, subtask, or phase references in code

Do not add code comments, docstrings, log messages, error messages, or identifiers that reference spec files, subtask IDs, phase numbers, status pairs, or execution-report sections. Examples to avoid:

# Per subtask-05-meditate-decomp-skills-extraction-20260517.md
# Phase 3: rebalance trigger
# Implements spec 20260523-meditate-richness, Subtask 04
# TODO(spec-meditate-richness): tighten coordinator gate

These comments become stale the moment a spec is archived, leak ephemeral coordination metadata into long-lived code, and obscure the actual intent of the line. Comments must explain why the code exists — not which spec or phase authored it. The spec, its subtasks, and its status files are the durable record of authorship and rationale; production code does not need to repeat them.

2. No backwards-compatibility shims

Do not add adapters, wrappers, deprecated aliases, fallback branches, dual-path readers, or v1/v2 parallel surfaces to preserve old behavior alongside new behavior. This repository is a single coordinated distribution — producer code, consumer code, agents, hooks, skills, evals, and docs all ship together.

Replace, do not layer. When a function, file, frontmatter field, command surface, or schema changes, change every caller in the same change set and delete the old form. If you find yourself reaching for a shim, that is the signal to either:

  • expand the change set to cover all callers in one go, or
  • write an upgrade file (see Rule 3) so installed users can move forward without the shim.

3. Capture migrations in a spec-local upgrade file

Read the full file on GitHub · 52 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 52 lines · 866 tokens per session scan A 5ba6e2caed14

Subscribe to this mod's changes

spec-implementation-hygiene is a cursor rule published in the GitHub repository zotoio/CRUX-Compress (8 stars, last pushed 1mo ago), licensed MIT. It adds 866 tokens to every session, about $0.0043 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.