Knowledge craft

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

Knowledge craft is an AI agent skill from the GitHub repository Intense-Visions/harness-engineering. > LLM-judgment critique of knowledge-entry quality. Critiques `docs/knowledge/` entries (EXCLUDING `decisions/` — that's spec-craft's territory) against a curated rubric catalog: does this state a loa

How to use this skill

Skill file

Knowledge Craft

LLM-judgment critique of knowledge-entry quality. Critiques docs/knowledge/ entries (EXCLUDING decisions/ — that's spec-craft's territory) against a curated rubric catalog: does this state a load-bearing FACT or paraphrase the code? Would deleting it lose specific signal? Does it earn its place in the knowledge graph as business_fact / business_rule / business_concept / business_decision? Fifth non-design member of the craft-pipeline initiative. 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: DISCOVER — Find knowledge entries

  1. Read project configuration. Check harness.config.json for:
  1. Walk docs/knowledge/ recursively:

Phase 2: CRITIQUE — Per (file, rubric) loop

7 seed rubrics:

| Rubric | Title |

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

| KNOW-R001 | States a load-bearing fact (not paraphrase) |

| KNOW-R002 | Truth a code reader could not derive |

| KNOW-R003 | Earns a place in the knowledge graph taxonomy |

| KNOW-R004 | Carries forward a decision that would erode |

| KNOW-R005 | Deleting would lose specific knowledge |

| KNOW-R006 | Concrete and operationally defined |

| KNOW-R007 | A stranger could pick it up six months from now |

For each (file, rubric) pair:

  1. Build prompt with rubric description + file path + relative-to-knowledge-root path + entry contents (truncated to 4000 chars for cost).
  2. LLM returns fenced JSON: null (rubric doesn't apply / entry is fine) OR { tier, impact, confidence, message }.
  3. On non-null: emit a KnowledgeFinding with cite.rubricId populated for ADR 0020 traceability.

KNOW-R003 is the rubric that references the graph taxonomy (business_fact, business_rule, business_concept, business_decision) inside its description — the LLM critiques against the taxonomy without knowledge-craft ever reading the graph.

Phase 3: REPORT — Aggregate + cost telemetry

Emit KnowledgeCraftOutput:

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

Harness Integration

Invoked as a review hook

knowledge-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["knowledge-craft"], which holds repo-relative POSIX paths, and resolves each

entry against the project root before calling mcp__harness__knowledge_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/craft-pipeline/knowledge-craft/proposal.md for the full 25 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 entry is well-written and accurate, so KNOW-R001 passes." | Accuracy is not the bar. KNOW-R001 asks whether it states a load-bearing FACT a code reader could not derive. A polished, correct paraphrase of the implementation still fails. |

| "It lives under docs/knowledge/, so it earns a graph node — KNOW-R003 passes." | Location does not confer membership. KNOW-R003 asks whether it maps to business_fact / business_rule / business_concept / business_decision. A how-the-code-works note fits none. |

| "I personally would keep this entry, so KNOW-R005 (deleting loses something) passes." | The test is whether deletion loses knowledge a reader could not reconstruct from the source. If the code already conveys it, deletion loses nothing — your preference to keep it is irrelevant. |

| "This entry sits in decisions/ and bears a decision, so I'll critique it here." | decisions/ is hard-excluded — it is spec-craft's territory. Critiquing it here produces double-critique noise on the same file. Refuse to walk it. |

| "The entry explains the WHY, so KNOW-R004 (carries forward a decision) passes." | Carrying forward a decision that would erode requires the rejected alternative AND the reason. The WHY alone, without the option that was turned down, leaves the choice reconstructible as arbitrary. |

Examples

Example: Paraphrase entry

Input: docs/knowledge/auth/email-validator.md:

# Email Validator

The user service validates emails via the EmailValidator class, which
applies the standard regex pattern and rejects malformed addresses.

Output (mock LLM):

KNOW-R001 [foundational/large/medium] auth/email-validator.md
  This entry restates what a reader would learn from opening
  EmailValidator.ts. It states no load-bearing fact about the domain:
  no upstream constraint, no historical reason for the choice, no business
  rule that necessitated validation. Either rewrite to capture the WHY
  (e.g., "emails must round-trip through Postmark within 30s for
  deliverability tracking") or delete — the code already speaks.
KNOW-R005 [polish/medium/medium] auth/email-validator.md
  Deleting this entry would lose nothing the code doesn't already convey.

Example: Decision-bearing entry

Input: docs/knowledge/storage/postgres-over-dynamo.md:

# Why Postgres over DynamoDB

We chose Postgres over DynamoDB because our access patterns are
relational (frequent multi-table joins on tenant + user) and our team's
ops muscle is in SQL. DynamoDB's single-table design was rejected
because the modeling overhead of GSIs outweighs the latency win for
our request profile.

Output:

(no findings)

This entry carries forward a decision with the alternative AND the reason — KNOW-R004 passes, KNOW-R001 passes (load-bearing fact: the rejected option + the WHY), KNOW-R005 passes (deleting loses knowledge a reader couldn't reconstruct from the schema alone).

Example: Empty project — no knowledge entries

Input: Project has no docs/knowledge/ directory.

Output:

No knowledge-entry findings.

Summary: 0 findings across 0 entries (0 skipped, 7 rubrics, 0 LLM calls, $0.0000, 2ms)

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.