/open-skills:audit-coupled-constantfrom open-skills
Globally greps a constant's value to verify every call site moved together before declaring an edit complete. Use before raising retry budgets, timeouts, page sizes, magic numbers, or feature flags, especially when SEE ALSO cross-references exist.
Ships in open-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Before declaring an edit to a coupled constant complete, grep the constant's value globally to verify every site moved together. The author-maintained SEE ALSO trail is a maintenance contract, not enforcement — when one site is missed, the trail silently lies in the other sites.
Origin. This skill emerged from a cold-review finding. A 60s retry budget was raised to 180s across 3 of 4 call sites; the 4th (
packages/<pkg>/src/flows/rename.ts:297) was missed because the SEE ALSO comments in the 3 known sites never mentioned it. Two independent cold reviewers caught it via global grep; the original diagnosis trusted the SEE ALSO trail. The lesson generalizes far beyond retry budgets.
Use audit-coupled-constant when you are about to declare done on an edit that touches a constant whose value is duplicated across multiple files, OR whose comments name other files via "SEE ALSO" / "keep in sync" / "matches" / "mirrors" cross-references. Common shapes:
240 × 250ms, 60_000, 60s)PAGE_SIZE = 25)Do NOT use for constants that are truly local to one file, for purely-imported constants where only the import site moved (the named symbol is the single source), or for constants enforced by the type system (e.g., a TypeScript as const literal imported everywhere — the compiler is your audit).
An audit request authorizes inspection and a chat report, not code, comment or artifact writes. In audit-only mode, Steps 3–4 identify proposed repairs and the report records them as pending. Apply repairs or save a report only where current authorization already covers the exact effects and scope; reuse that authorization without another prompt. Do not claim an audit is a completed repair.
A coupled constant appears in code under multiple shapes. List every shape you might find before grepping:
240, 60_000, 0.5, "warn"RETRY_BUDGET_MS, MAX_PAGE_SIZE// 60s budget, /* 240 × 250ms */60s, 60000ms, 1min60 * 1000, 1000 * 60 * 60Write the list of shapes down before grepping. Missing a shape is the most common cause of a missed site.
Run a separate grep for each shape. Use Grep / ripgrep, not find or recursive Read. Examples:
# Choose the actual justified scope; these rg examples do not imply a type filter.
rg -n '\b240\b' <scope>
rg -n -i -F '60s' <scope>
rg -n '240\s*\*\s*250' <scope>
rg -n -F 'RETRY_BUDGET_MS' <scope>
For every shape, record the actual command, searched scope, exit status, hits and any failed/unrun search. An unavailable or unrun search remains a coverage gap; do not declare the audit complete. Explain any file-type exclusions, including docs/fixtures/scripts, against the actual affected invariant.
Set the scope to the package or repo level — coupled constants often span src + tests + scripts. For monorepos, audit each affected package.
Group hits into three categories:
// Intentionally different from registry-reset.ts: tests need 3× the budget for singleFork load. This prevents the next auditor from misclassifying it.If you cannot tell which category a site belongs in, halt the edit and ask the author or git blame the comment that introduced the value.
Apply this step only for authorized repairs; otherwise report the proposed trail changes.
For any newly-found coupled site, add bidirectional SEE ALSO comments so the next auditor doesn't have to re-discover the relationship:
// SEE ALSO: <other-file-1>.ts <function> — keep budgets in sync (180s).
// SEE ALSO: <other-file-2>.ts <function> — keep budgets in sync (180s).
Critically: also UPDATE the SEE ALSO comments in the EXISTING sites to mention the newly-found site. The trail must be bidirectional, or the next person to touch any one site won't know to look at the new one.
Brief, structured. One section per scope swept:
audit-coupled-constant report
constant: <name or value>
shapes searched: 240, 60_000, 60s, RETRY_BUDGET_MS
scope: packages/<pkg>
sites found: 4
src/flows/registry-reset.ts:90 moved together ✓
src/scaffold/delete.ts:42 moved together ✓
tests/_helpers/fs-retry.ts:47 moved together ✓
src/flows/rename.ts:297 MISSED — update + add SEE ALSO trail
intentionally-different sites: 0
SEE ALSO trail updated: no (audit-only; propose adding rename.ts to the 3 existing sites)
/cold-review for high-stakes coupled-constant edits (retry budgets that ship to users, schema versions, feature flags wired into rollouts).240 matches 1240, 2403, etc. without \\b. Always use word-boundary for digit-only constants under 1000.// 60s budget) even when the code uses a named symbol. Comments don't move with code refactors and are the silent-drift source.as const exported from one file. If all consumers import the symbol (not the value), the compiler enforces the invariant — no audit needed. But if any consumer copy-pasted the value as a literal (often in test fixtures or JSON), grep the raw value to catch those.isWindows ? 240 : 1). Audit each branch separately. The Windows branch and the POSIX branch are two coupled invariants, not one.// Intentionally different from <other-site>: <reason> comments when repair is authorized./cold-review: the audit closes the most common Critical finding category ("missed coupled site"). Run audit first; cold-review confirms the audit was thorough./handoff-execute Phase 4 (Execute): when the brief involves a budget / timeout / threshold raise, invoke this audit as part of the execute phase, not as an afterthought.improve-codebase-architecture job (extract-constant refactor).as const extraction when it's feasible. Prefer language-level enforcement when the constant is purely internal; this skill handles the cases where extraction isn't practical (external interfaces, cross-package fixtures, comment-embedded values).Human output. This skill's handler-facing output obeys the human-output contract (
human-output/SKILL.md).
Self-improvement. On completion, run the Self-Improvement Protocol (
self-improve/SKILL.md): apply its signal taxonomy and threshold to this run; surface any surviving proposal for handler approval. Conservative — silent otherwise. Never auto-apply.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub allemaar/open-skills --plugin open-skills93 skills in this plugin
/agent-mailboxTwo or more agents — any harness, any vendor — collaborate through any shared folder: share a folder, load the skill, point at it.
/agent-outputCompact agent-to-agent communication contract for worker reports, handoffs, status, blockers, and review findings. Trigger phrases: "/agent-output", "brief the worker", "make agent reports terse". Not a transport; use /agent-mailbox for delivery.
/ask-gateThe Ask-Gate Protocol (AGP). Before surfacing an AskUserQuestion, triage whether the question is genuinely the handler's call (anti-nag); ask routine questions directly after a quality checklist, but escalate high-stakes / branching / irreversible ones through /insight-critique then /insight-assess first. Trigger via /ask-gate, or automatically before any handler-facing question. Not /caller-options (routes a skill's venue/mode) or /next-skills (recommends successors) — AGP governs the question itself.
Other plugins' skills for the same job