/harness-claude:harness:naming-craft runs instead · from harness-claude
Critiques identifier names (variables, functions, types, files) for clarity, concreteness, weight, and predictive power using a curated rubric. Useful during PR review, onboarding, or refactoring.
This skill never runs in Claude Code
It ships in harness-claude at agents/, but /harness-claude:harness:naming-craft (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
LLM-judgment skill that critiques identifier names — variables, functions, types, and files — for clarity, concreteness, weight, and predictive power. First member of the craft-pipeline initiative. Uses a curated rubric catalog seeded from Martin / Beck / Karlton. Emits 3-axis findings (tier × impact × confidence per ADR 0019).
align-naming ships the fix path)packages/cli/src/shared/craft/) — LlmProvider + finding/axes schema + run store — shared across all *-craft skills. This skill implements, and does not own, that contract.packages/cli/src/naming-craft/).craft-fleet (the craft-pipeline elevation sweep) and the harness natural-language router, which invoke every *-craft provider uniformly through the shared critique/finding shapeRead project configuration. Check harness.config.json for:
craft.naming.enabled — gate (default true)craft.naming.maxFiles — file count cap (default 100)craft.naming.maxIdentifiersPerFile — per-file sampling cap (default 15)Walk project files (.ts / .tsx / .js / .jsx). Skip node_modules, dist, build, coverage, dotdirs.
Extract identifiers per file via TS Compiler API:
const x =, let x =, destructuring bindersfunction x(), const x = () =>, class methods, arrow functions assigned to a nametype X, interface X, class Xshort = body ≤10 lines; long = otherwise), and ±2 context lines for LLM prompt construction.For each identifier kind, sample up to N=500 identifiers across the project and infer the dominant convention via majority-rule:
>50% majority threshold per kind. Below threshold → null (no dominant convention) and the convention-conformance rubric silently skips.
For each file:
Sample identifiers weighted by importance:
maxIdentifiersPerFile per file (default 15).For each (identifier, rubric) in the cross-product:
null (rubric doesn't apply / name is fine) or { tier, impact, confidence, message }.NamingFinding with cite.rubricId populated for ADR 0020 traceability.v1 rubric catalog (6 seed rubrics):
NAME-R001 predictive power (Martin) — does the name predict the contract?NAME-R002 concreteness (Martin / Beck) — concrete > vagueNAME-R003 verb/noun honesty (Beck) — verb for functions; noun for types; questions for booleansNAME-R004 convention conformance (Karlton) — matches project conventionNAME-R005 scope match (Beck) — length proportional to scopeNAME-R006 encoded measure (Pragmatic Programmer) — silent units cause real bugsEmit NamingCraftOutput:
{
findings: NamingFinding[];
summary: {
phaseRun: ['critique'];
durationMs: number;
llmCalls: { provider, model, count, costUsd };
catalog: { rubricsApplied: string[] };
convention: { variables, functions, types, files };
runId: string;
}
}
harness naming-craft — CLI entry. --files <glob> / --kinds <variable|function|type|file> / --max-files <n> / --max-identifiers-per-file <n> / --json / --verbose.mcp__harness__naming_craft — MCP tool. Two modes (see "In-session flow" below).mcp__harness__naming_craft_finalize — MCP tool that completes the in-session flow.critiqueNamesInFile(file, opts) exported from packages/cli/src/naming-craft/index.ts. Future craft skills (docs-craft, test-craft, code-craft) import and invoke this when they want naming critique on a file they're already processing — no project re-walk needed.harness.config.json. The shared selector in packages/cli/src/shared/craft/llm/provider.ts reads two blocks:
agent.backends — named backend definitions, shared with the orchestrator. Supported types: claude, anthropic, openai, local, pi, mock. (local and pi are OpenAI-compatible — point them at Ollama / LM Studio / vLLM / LiteLLM / any compliant server.)craft.llm — either { "backend": "<name>" } to route through one of the entries above, or { "mode": "in-session" | "mock" } for the non-backend modes. Default when nothing is set: in-session (host chat answers prompts via the two-step MCP flow).HARNESS_CRAFT_LLM env var overrides the file. Accepts in-session, mock, or the name of any entry in agent.backends.harness.orchestrator.mdIf you already declared agent.backends in harness.orchestrator.md, the craft selector reads from it as a fallback and emits a one-time warning on first run. Run harness migrate backends (preview with --dry-run) to copy the entries into harness.config.json so both files share a single source of truth.
Example config snippet for routing craft skills to a local Ollama:
{
"agent": {
"backends": {
"ollama": {
"type": "local",
"endpoint": "http://localhost:11434/v1",
"model": ["deepseek-coder-v2", "qwen3:8b"],
},
},
},
"craft": { "llm": { "backend": "ollama" } },
}
naming-craft auto-activates as an advisory review hook whenever a diff touches the surface it
owns — harness-autopilot at after:REVIEW / after:FINAL_REVIEW, and harness-code-review at
after:mechanical. The domain table is CRAFT_REVIEW_DOMAINS and the per-host events are
CRAFT_REVIEW_EVENTS_BY_HOST, both in packages/core/src/hooks/craft-review-hooks.ts. The host
forwards the subset of the diff this domain owns:
files — this domain's owned subset of the changed files, as ABSOLUTE paths. The host
reads it from plan.files["naming-craft"], which holds repo-relative POSIX paths, and resolves each
entry against the project root before calling mcp__harness__naming_craft. Absolute is the
recommended form, not a correctness requirement for this domain: its collector resolves a
relative entry against the tool's path (never the process CWD), so a repo-relative entry
forwarded unresolved still reads the in-diff file (pinned by
packages/cli/tests/shared/craft/relative-files-scope.test.ts). Only
mcp__harness__design_craft still requires absolute paths.promptBudget — accepted; raises the prompt ceiling for the forwarded scope when the diff subset is large.Findings from a hook-triggered run are advisory: reported, never blocking, never counted toward review severity, and never entered into a host's mechanical exclusion set. A hook-triggered run that fails is a missing opinion, not a broken gate.
When HARNESS_CRAFT_LLM is unset (or set to in-session), the MCP tool does not call any LLM. Instead it returns a list of prompts for the calling agent to answer with its own model. This is a two-step protocol:
Step 1 — mcp__harness__naming_craft({ path, ... }) returns:
{
"status": "collected",
"runId": "<uuid>",
"pendingPrompts": [
{ "promptId": "p1", "systemPrompt": "...", "userPrompt": "..." },
...
],
"projection": { "promptCount": N, "budget": 100 }
}
If projection.promptCount > budget, status is "budget-exceeded" and pendingPrompts is empty — re-invoke with smaller maxFiles / maxIdentifiersPerFile, or pass promptBudget to raise the ceiling.
Step 2 — for each pending prompt, generate the fenced-JSON response as if you were a senior engineer applying the rubric to the identifier. The required response shape (per prompt) is:
```json
null
```
if the rubric does not apply or the name is fine, OR:
```json
{
"tier": "foundational|polish|aspirational",
"impact": "small|medium|large",
"confidence": "high|medium|low",
"message": "<critique with suggested rename when possible>"
}
```
Step 3 — mcp__harness__naming_craft_finalize({ path, runId, responses: [{ promptId, raw }, ...] }) parses the responses, applies the same validation the inline path uses, and returns the standard NamingCraftOutput.
If you want the inline behavior (skill calls an LLM directly), pass mode: 'inline' to step 1 and set HARNESS_CRAFT_LLM to a non-in-session provider.
See docs/changes/craft-pipeline/naming-craft/proposal.md for the full 34 success criteria. Highlights:
catalog/rubrics/<id>.ts (file-per-rubric matches design-craft pattern)cite.rubricId populated on every finding per ADR 0020null when no dominant convention (>50% threshold)critiqueNamesInFile API exported for future craft skillsThese are common rationalizations that sound reasonable but lead to incorrect results. When you catch yourself thinking any of these, stop and follow the documented process instead.
| Rationalization | Why It Is Wrong |
|---|---|
| "This name is camelCase and matches the project convention, so it's fine." | Convention conformance (NAME-R004) is one rubric of six. A perfectly-cased processData still fails predictive-power (R001) and concreteness (R002) — cased correctly, says nothing. |
"timeout reads clearly in context, so NAME-R006 (encoded measure) doesn't apply." | Encoded-measure asks whether the unit is silent — timeout could be ms or seconds. Reads-fine-in-context is exactly how silent-unit bugs ship. Suggest timeoutMs. |
| "The convention sampler returned null, so I'll infer the dominant style and flag it." | Below the >50% threshold the sampler returns null and NAME-R004 silently skips by design. Guessing a convention on a mid-migration project manufactures wrong findings. |
"A one-letter loop variable x is lazy naming, so I'll flag it foundational." | NAME-R005 is scope-match: length proportional to scope. x in a ≤10-line body is appropriate; the same name at file scope is not. Scope size decides the verdict, not brevity alone. |
| "This is a judgment call I'm unsure about, so I'll emit it high confidence to be safe." | Confidence is an honesty axis, not a safety lever. Unsure means low/medium so derivePriority de-emphasizes it. Inflating confidence to hedge pollutes the report with false urgency. |
Input: src/orders/processor.ts:
export function processData(orders: Order[]) { ... }
Output (mock LLM):
NAME-R002 [polish/medium/low] function processData:14
"processData" is a vague verb-pair where the operation and subject
are both unstated. Consider `applyDiscountsToOrders` or
`convertOrdersToInvoices` depending on the actual transform.
NAME-R001 [polish/medium/medium] function processData:14
The name predicts neither the input shape (orders) nor the operation.
(Real LLM responses vary; mock provider returns deterministic low-confidence findings for test determinism.)
Input:
const timeout = 5000;
Output:
NAME-R006 [foundational/medium/high] variable timeout:1
"timeout" implies a time measure but the unit is silent. Use
`timeoutMs` so the call site can't be misread as seconds.
Input: A project with 60% camelCase, 30% snake_case, 10% PascalCase variables. No >50% camelCase majority (60% IS >50%, so convention=camelCase). But with 45/40/15 split: no convention.
Output: convention-conformance rubric (NAME-R004) silently skips for the variables kind. Other rubrics still run.
align-naming may add safe-rename codemods.maxIdentifiersPerFile to 10 or maxFiles to 50. Cost = files × identifiers × rubrics × per-call cost.craft.naming.disabledRubrics: ['NAME-R005']. Until then: filter findings by cite.rubricId in your consumer.--files <glob> or call critiqueNamesInFile() via the cross-cutting API.v1 — in implementation. See:
docs/changes/craft-pipeline/naming-craft/proposal.mdcraft-pipeline initiative (the first member)harness-design-craft (design-pipeline — the LLM-judgment template this follows)critiqueNamesInFile() for their domain-specific naming critique.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claude793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job