audit-coupled-constant

Audits every call site of a duplicated constant to verify all sites moved together.

14|1|Updated Jun 14, 2026
One-click install
npx skills add https://github.com/allemaar/open-skills --skill audit-coupled-constant-allemaar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audit-coupled-constant
Source: https://github.com/allemaar/open-skills/tree/main/skills/audit-coupled-constant
Command: npx skills add https://github.com/allemaar/open-skills --skill audit-coupled-constant-allemaar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a constant value (retry budget, timeout, page size, magic number) is duplicated across multiple files, updating it in some sites but missing others creates silent drift. Author-maintained SEE ALSO comments are documentation, not enforcement, so they decay and lie when a site is missed. ## Core Features & Use Cases - Multi-shape grep audit: Enumerates every shape a constant can take (raw value, named symbol, unit-suffixed comment, composite expression, string tokens) and greps each shape separately across the repo. - Hit classification: Groups every match into moved-together, missed, or intentionally-different, halting the edit when a site cannot be classified confidently. - Bidirectional SEE ALSO repair: Adds cross-reference comments to newly found sites and updates existing sites so the trail stays accurate in both directions. - Use Case: Before merging a PR that raises a retry budget from 60s to 180s, run the audit to confirm all four call sites moved, catch the missed one in rename.ts, and emit a structured audit report. ## Quick Start Ask the agent to audit all sites of the constant you just changed, for example: run /audit-coupled-constant to verify every site of the 180s retry budget moved together before committing.

Frequently Asked Questions about audit-coupled-constant

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find all call sites of a duplicated constant before changing it?

List every shape the constant can appear in (raw value, named symbol, unit-suffixed comment, composite expression, string tokens), then run a separate grep for each shape across the repo. Group the hits into moved-together, missed, and intentionally-different sites.

How to check retry budget consistency across multiple files?

Grep each shape of the budget value (e.g., 240, 60_000, 60s, RETRY_BUDGET_MS) separately with word boundaries, then classify each hit. Update any missed site and add bidirectional SEE ALSO comments so future edits stay synchronized.

Can I trust SEE ALSO comments to track coupled constants?

No. SEE ALSO comments are documentation, not enforcement, and they decay when a site is missed. Always grep the constant's value globally first and treat the comment trail as a secondary hint, not proof of completeness.

When should I skip auditing a constant?

Skip the audit when the constant is truly local to one file, when only an imported named symbol moved, or when the type system enforces it (e.g., a TypeScript as const literal imported everywhere). The compiler is the audit in those cases.

Why does grep miss sites when searching for short numeric constants?

Short numbers like 240 match inside larger numbers such as 1240 or 2403 without word boundaries. Always use word-boundary patterns (\b240\b) for digit-only constants under 1000, and also grep comment shapes like 60s that code-only searches miss.