Copy craft

From Intense-Visions/harness-engineering · View interactive version

Copy craft is an AI agent skill from the GitHub repository Intense-Visions/harness-engineering. > LLM-judgment critique of prose-in-code across six surfaces: error messages, log lines, CLI output strings, commit subjects, PR descriptions, and code comments. Primary domain is error messages (univ

How to use this skill

Skill file

Copy Craft

LLM-judgment critique of prose-in-code across six surfaces: error messages, log lines, CLI output strings, commit subjects, PR descriptions, and code comments. Primary domain is error messages (universally bad in most codebases). Third member of the craft-pipeline initiative. NO rule-based floor exists — pure ceiling. Emits 3-axis findings (tier × impact × confidence per ADR 0019).

When to Use

Capability Roles

<!-- Capability seam: this skill participates in a real extension point whose three roles are named and concrete. A seam with only one role filled is accidental single-implementation lock-in. See harness-skill-authoring Phase 1C. -->

Process

Phase 1: EXTRACT — Six surfaces, three infrastructures

  1. Read project configuration. Check harness.config.json for:
  1. Source-side surfaces (errors / logs / CLI output / comments): single TS Compiler API walk per source file. Amortizes parse cost across surfaces.
  1. Git surface (commits): shell-out to git log --pretty=format:'%H%x09%s' --since=.... Skip silently when not in a git repo.
  1. GitHub surface (PR descriptions): shell-out to gh pr list --json number,title,body. Skip silently when gh binary missing or gh auth status fails.
  1. Skipped surfaces recorded in summary.skippedSurfaces with the reason — visible in the report, not a failure.

Phase 2: CRITIQUE — Per (item, rubric) loop, surface-filtered

8 seed rubrics, each declares which surfaces it applies to:

| Rubric | Surfaces |

| ------------------------------------- | ------------------------------- |

| COPY-R001 WHAT/WHY/HOW-TO-FIX | error |

| COPY-R002 calm-not-panicky | error, log |

| COPY-R003 specific-not-generic | error, log, cli-output |

| COPY-R004 signal-not-noise | log |

| COPY-R005 grep-survives | log, cli-output |

| COPY-R006 describes-change-not-work | commit, pr-description |

| COPY-R007 stranger-in-6-months | commit, pr-description, comment |

| COPY-R008 WHY-not-WHAT | comment |

For each (item, rubric) where the rubric applies to the item's surface:

  1. Build prompt with rubric description + surface + context (errorType / logLevel / ref) + snippet (truncated to 1500 chars).
  2. LLM returns fenced JSON: null (rubric doesn't apply / copy is fine) OR { tier, impact, confidence, message }.
  3. On non-null: emit CopyFinding with cite.rubricId for ADR 0020 traceability.

Phase 3: REPORT — Aggregate + cost telemetry

Emit CopyCraftOutput:

{
  findings: CopyFinding[];
  summary: {
    phaseRun: ['critique'];
    durationMs: number;
    llmCalls: { provider, model, count, costUsd };
    catalog: { rubricsApplied: string[]; surfacesScanned: CopySurface[] };
    counts: Record<CopySurface, number>;
    skippedSurfaces: Array<{ surface, reason }>;
    runId: string;
  }
}

Harness Integration

Success Criteria

See docs/changes/craft-pipeline/copy-craft/proposal.md for the full 39 success criteria. Highlights:

Rationalizations to Reject

These 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 error message is a clean, grammatical sentence, so it passes COPY-R001." | Grammar is not the rubric. COPY-R001 asks for WHAT failed, WHY, and HOW to fix. A fluent sentence that names no artifact and offers no recovery path still fails — emit the finding. |

| "It's just a debug-level log, so COPY-R004 (signal-not-noise) doesn't really apply." | signal-not-noise applies to every log line regardless of level. A debug log that fires on every invocation carrying no state or decision is exactly the noise the rubric exists for. |

| "The commit subject accurately describes what the author did, so COPY-R006 passes." | COPY-R006 is describes-change-not-work. "update tests" describes the activity, not the behaviour that changed. Describing the work performed IS the failure mode, not the pass. |

| "The git/gh surface was skipped, so I'll infer commit or PR quality from the diff." | Skipped surfaces are recorded in summary.skippedSurfaces with a reason — never backfilled by inference. Fabricating findings for a surface that did not execute corrupts the report. |

| "This copy is clearly bad, so I'll mark it high confidence and foundational." | tier, impact, and confidence are three independent axes (ADR 0019). A genuinely bad string can be low-impact, and you may only be medium-confident. Collapsing the axes defeats derivePriority. |

Examples

Example: Generic error message

Input: src/parse.ts:

throw new Error('parse error');

Output (mock LLM):

[error]
  COPY-R001 [foundational/large/medium] src/parse.ts:14 error
    "parse error"
    Doesn't tell WHAT was being parsed, WHY it failed, or HOW the user can
    recover. Try: "Failed to parse design-system/tokens.json at line 12: ..."
  COPY-R003 [polish/medium/high] src/parse.ts:14 error
    "parse error"
    Generic — no operation, no artifact. Name the file being parsed and the
    specific failure mode.

Example: Noisy log line

Input:

console.log('entered function');

Output:

[log]
  COPY-R004 [foundational/medium/high] src/handler.ts:23 log
    "entered function"
    Pure noise — fires on every invocation; carries no state or decision.
    Either remove or replace with a state-transition log at the relevant
    boundary.

Example: Work-not-change commit subject

Input: A commit with subject "update tests".

Output:

[commit]
  COPY-R006 [polish/medium/medium] git:abc1234 commit
    "update tests"
    Describes the work, not the change. A reader six months from now needs
    to know what behaviour changed. Try: "ratchet drift threshold to 0.5%
    after Hermes Phase 4 baseline reset" or similar.

Example: Missing prerequisites — graceful skip

When not in a git repo OR gh is missing/unauthenticated, those surfaces silently skip and the report shows:

Skipped surfaces:
  - commit: not a git repo
  - pr-description: gh binary not found

Gates

Escalation

Status

v1 — in implementation. See:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.