Docs craft

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

Docs craft is an AI agent skill from the GitHub repository Intense-Visions/harness-engineering. > LLM-judgment critique of documentation quality — the ceiling counterpart to the rule-based documentation floor (harness-detect-doc-drift / harness-check-docs / harness-docs-pipeline, which enforce e

How to use this skill

Skill file

Docs Craft

LLM-judgment critique of documentation quality — the ceiling counterpart to the rule-based documentation floor (harness-detect-doc-drift / harness-check-docs / harness-docs-pipeline, which enforce existence, link freshness, and coverage). The direct structural twin of harness-design-craft: the floor keeps docs from being broken; docs-craft asks whether they are any good. 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

B' precondition check (every invocation)

docs-craft is the ceiling; it runs regardless of setup, but its critique sharpens when a project declares its documentation intent. Before critiquing, note the state:

| Precondition | Source | If missing |

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

| docStyleDeclared | a project doc style guide (e.g. docs/**/DOCS.md) | Run with the generic seed rubrics; note in the summary that a style guide would sharpen critique and offer to seed one (progressive upgrade — the same posture as design-craft's B'). |

When no style guide exists, docs-craft still runs with the seed rubrics (degraded, not blocked). It never refuses to critique just because a project has not written its style down.

Phase 1: DISCOVER — Find teaching documentation

  1. Read project configuration. Shared craft config under craft.llm.* selects the judgment backend. maxFiles (default 60) caps the doc count.
  1. Walk the docs tree + root README. Discover *.md under docs/ plus the root README.md. Classify each doc by a cheap path heuristic into one of: reference, guide, readme, prose — used to filter rubrics and shape the prompt.
  1. Exclude sibling-owned and non-teaching surfaces. docs/knowledge/ (knowledge-craft), docs/changes/ + docs/decisions/ + docs/adr/ (spec-craft), and generated / non-teaching dirs (roadmap.d, plans, solutions, blueprint, agent-setup). Caller-supplied --files overrides discovery; --exclude-dirs adds skips.

Phase 2: CRITIQUE — Per (doc, rubric) loop, kind-filtered

7 seed rubrics, each declaring which doc kinds it applies to:

| Rubric | Title | Applies to |

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

| DOCS-R001 | Teaches a mental model (not a feature enumeration) | all |

| DOCS-R002 | Order matches the reader's mental model | all |

| DOCS-R003 | Examples earn their place (concrete, runnable, non-redundant) | reference, guide, readme |

| DOCS-R004 | Prose is alive, not bureaucratic | all |

| DOCS-R005 | API/reference docs let the reader predict the response shape | reference |

| DOCS-R006 | A stranger walks away with the same understanding | all |

| DOCS-R007 | Scannable and navigable (a reader finds the answer fast) | all |

For each (doc, rubric) where the rubric applies to the doc's kind:

  1. Build a prompt with the rubric description + doc kind + contents (truncated to 6000 chars for cost).
  2. The LLM returns fenced JSON: null (rubric doesn't apply / the doc already clears the bar) OR { tier, impact, confidence, message }.
  3. On non-null: emit a DocsFinding with cite.rubricId populated for ADR 0020 traceability, and a derived priority for sorting.

A small curated exemplar set anchors the catalog — Stripe Docs, Vercel, MDN, Linear, Tailwind — each a public reference point for one craft dimension (Stripe for runnable examples + response prediction, MDN for no-shared-context, Linear/Tailwind for scannability, Vercel for voice). The exemplars ground the rubric sources today and seed a future BENCHMARK phase, the direct analogue of design-craft's exemplar corpus.

Phase 3: REPORT — Aggregate + cost telemetry

Emit DocsCraftOutput:

{
  findings: DocsFinding[];
  summary: {
    phaseRun: ['critique'];
    mode: 'fast';
    durationMs: number;
    llmCalls: { provider, model, count, costUsd };
    catalog: { rubricsApplied: string[]; exemplarsAvailable: number };
    counts: { filesScanned, filesSkipped };
    runId: string;
  }
}

Harness Integration

Invoked as a review hook

docs-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:

reads it from plan.files["docs-craft"], which holds repo-relative POSIX paths, and resolves each

entry against the project root before calling mcp__harness__docs_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.

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.

Success Criteria

See docs/changes/docs-craft/proposal.md for the full 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 |

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

| "The doc exists and its links resolve, so the documentation is in good shape." | Existence, link freshness, and coverage are the floor (harness-check-docs). docs-craft asks whether the doc TEACHES — does a stranger walk away with the same mental model (DOCS-R006), or does it just enumerate features it happens to have. |

| "This reference page lists every field, so the reader knows the response." | DOCS-R005 wants the reader to PREDICT the response shape — a concrete example response plus the errors the endpoint can raise, not a bare field table. A field list without a worked example still leaves the reader guessing. |

| "It is a knowledge fact entry / an ADR, but it is still markdown, so I will critique it." | docs/knowledge/ (knowledge-craft) and docs/changes/ + ADRs (spec-craft) are hard-excluded from discovery so the same file is never double-critiqued. Reaching into a sibling's tree is a boundary violation, not thoroughness. |

| "The prose is grammatically correct, so DOCS-R004 passes." | DOCS-R004 asks whether the prose is ALIVE, not merely correct. Grammatically clean, bureaucratic boilerplate fails it — voice and momentum are the bar, not the absence of typos. |

| "The intro paragraph is muddy, so I will rewrite it to fix the finding." | docs-craft is judgment-only. It emits a finding; a future align-docs sibling owns safe rewrites. Rewriting the prose here is out of scope and hides the finding from the author who owns the doc. |

Examples

Example: A guide that describes but never teaches

Input: docs/guides/webhooks.md:

# Webhooks

The system supports webhooks. Webhooks can be created, updated, and deleted.
Each webhook has a URL, a set of events, and a status.

Output (mock LLM):

docs/guides/webhooks.md (guide)
  DOCS-R001 [foundational/large/high] docs/guides/webhooks.md
    Enumerates what a webhook HAS but never teaches what it is FOR or when to
    reach for one. A reader can't predict behavior the doc didn't spell out.
    Open by naming the problem ("get notified when an event happens without
    polling") and the shape of the solution, then drill into fields.
  DOCS-R003 [polish/medium/high] docs/guides/webhooks.md
    No example. Show a real registration request and the exact payload the
    endpoint will POST to the reader's URL.

Example: A reference page that hides the response shape

Input: docs/reference/create-order.md documenting a POST /orders endpoint with only the request body listed.

Output:

docs/reference/create-order.md (reference)
  DOCS-R005 [foundational/large/high] docs/reference/create-order.md
    The reader can't predict what comes back: no example response, no field
    list, no error/status enumeration. Pair the request with a concrete
    example response and the errors POST /orders can raise (the bar Stripe's
    API reference sets).

Example: A clean doc — no findings

Input: A README that opens with the problem it solves, shows one runnable example paired with its output, and uses descriptive headings.

Output:

No documentation-craft findings.

Summary: 0 findings across 1 docs (0 skipped, 6 rubrics, 5 exemplars, 6 LLM calls, $0.0000, 3ms)

Gates

Escalation

Status

v1 — CRITIQUE phase. 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.