From harness-claude
Extracts business knowledge from code, diagrams, and connectors; detects drift, gaps, and contradictions; optionally auto-remediates stale findings with a convergence loop.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-claude:harness-knowledge-pipelineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> 4-phase knowledge extraction, reconciliation, drift detection, and remediation with convergence loop. Keeps the business knowledge graph current and identifies coverage gaps.
4-phase knowledge extraction, reconciliation, drift detection, and remediation with convergence loop. Keeps the business knowledge graph current and identifies coverage gaps.
--drift-check is needed in CI to gate on knowledge freshnessdocs/knowledge/ directly)ingest_source MCP tool directly)ask_graph or query_graph)Prompt the human in plain text — every confirmation, drift acknowledgement, and contradiction resolution in this skill is plain text only. Do not elevate to AskUserQuestion: source labels and finding descriptions routinely exceed its 4-option / 12-char caps, rendering the call as ERR.
--fix): Apply safe remediations, convergence loop up to 5 iterationsAuto-remediate stale findings only. Prompt for drifted and contradicting. Never auto-resolve a contradicting finding — the human must decide which source is authoritative.
| Flag | Effect |
|---|---|
--fix | Enable convergence-based auto-remediation (default: detect-only) |
--ci | Non-interactive: apply safe fixes only, report everything else |
--domain <name> | Limit pipeline to specific knowledge domain |
All phases read from and write to a shared KnowledgePipelineContext:
interface KnowledgePipelineContext {
extractionSnapshot: KnowledgeSnapshot;
currentSnapshot: KnowledgeSnapshot;
driftResult: DriftResult;
gapReport: GapReport;
remediationsApplied: string[];
iteration: number;
verdict: 'pass' | 'warn' | 'fail';
}
Extract business knowledge from all available sources into a fresh snapshot.
Code Signal Extractors: Run ExtractionRunner against the project directory.
.harness/knowledge/extracted/Diagram Parsers: Run DiagramParser.ingest() for diagram-as-code files.
.mmd, .mermaid, .d2, .puml, .plantuml filesbusiness_concept nodesConnector Sync (if configured): Trigger connector sync for Jira, Slack, Confluence.
harness.config.jsonSolutions Candidates (if docs/solutions/ exists): Run
BusinessKnowledgeIngestor.ingestSolutions("docs/solutions") to consume
knowledge-track post-mortems written by harness-compound.
docs/solutions/knowledge-track/<category>/*.md files are candidates;
bug-track docs are skipped (they are fix playbooks, not structural facts).SolutionDocFrontmatterSchema from
@harness-engineering/core. Invalid frontmatter is logged and skipped.last_updated (older than configurable threshold; default: not gated
in Phase 7) is the promotion criterion for business_concept graph nodes.business_concept nodes in the snapshot.Build Fresh Snapshot: Collect all extraction results into a KnowledgeSnapshot.
id, type, contentHash, source, namedomain is resolved via path-based inference (packages/<dir>, apps/<dir>, etc.) unless an explicit metadata.domain is set; projects can extend or override via knowledge.domainPatterns and knowledge.domainBlocklist in harness.config.json — see docs/knowledge/graph/node-edge-taxonomy.md for full precedence.Output: context.extractionSnapshot populated.
Compare the fresh extraction against the current graph state.
Build Current Snapshot: Read all business_* nodes from GraphStore.
KnowledgeSnapshotEntryRun Drift Detection: Call StructuralDriftDetector.detect(current, fresh).
DriftResult with findings classified as new, drifted, stale, contradictingdriftScore (0.0 - 1.0)Output: context.currentSnapshot and context.driftResult populated.
Partition drift findings and classify safety.
Partition by classification:
| Classification | Severity | Safety | Action |
|---|---|---|---|
new | low | safe | Stage automatically |
stale | high | probably-safe | Auto-remove (source gone) |
drifted | medium | probably-safe | Prompt for confirmation |
contradicting | critical | unsafe | Never auto-resolve |
Generate Drift Report: Present findings grouped by classification:
KNOWLEDGE PIPELINE -- Drift Detection
Drift Score: 0.23 (12 findings / 52 entries)
NEW (4 findings, safe):
- business_rule:payments:refund-window [extractor]
- business_concept:auth:session-timeout [diagram]
...
STALE (3 findings, probably-safe):
- business_fact:billing:old-rate-limit [extractor] — source file deleted
...
DRIFTED (4 findings, requires confirmation):
- business_rule:checkout:tax-calculation [extractor] — content changed
...
CONTRADICTING (1 finding, requires human decision):
- business_term:Settlement SLA — extractor says 24h, linker says 48h
Generate Gap Report: Run KnowledgeStagingAggregator.generateGapReport().
.harness/knowledge/gaps.mdOutput: Drift report and gap report written. context.gapReport populated.
--fix)Apply safe fixes and converge.
Stage new findings: Write to .harness/knowledge/staged/pipeline-staged.jsonl via KnowledgeStagingAggregator.
Auto-remove stale findings: Remove nodes from graph where source file no longer exists.
Present drifted findings: Ask the human to confirm each update.
--ci mode: skip, report as unresolvedSurface contradicting findings: Never auto-resolve.
--ci mode: report as unresolvedConvergence Check: After remediation:
newCount >= previousCount: STOP (converged or no progress)newCount < previousCount: continue (max 5 iterations)maxIterations = 5
previousCount = findings.length
while iteration < maxIterations:
1. Apply safe remediations (new → stage, stale → remove)
2. Present probably-safe remediations (skip in --ci)
3. Log unsafe findings (never auto-apply)
4. Re-run EXTRACT + RECONCILE + DETECT
5. newCount = remaining findings
6. if newCount >= previousCount: STOP (converged)
7. previousCount = newCount; iteration++
After all phases complete, compute verdict:
| Verdict | Condition |
|---|---|
pass | Zero unresolved findings after pipeline |
warn | Only new findings remain (low severity) |
fail | Any contradicting, stale, or drifted remain |
Present verdict summary:
KNOWLEDGE PIPELINE -- Verdict: WARN
Findings: 2 new (staged), 0 stale, 0 drifted, 0 contradicting
Gap Report: 3 domains, 12 total entries
Drift Score: 0.04
ingest_source -- MCP tool for ingesting diagram sources (source: 'diagrams')ExtractionRunner -- Code signal extraction from @harness-engineering/graphDiagramParser -- Diagram-as-code parsing from @harness-engineering/graphStructuralDriftDetector -- Drift detection from @harness-engineering/graphKnowledgeStagingAggregator -- Staging and gap reporting from @harness-engineering/graphharness validate -- Run after remediation to verify project health--ci mode is fully non-interactive$ harness knowledge-pipeline
KNOWLEDGE PIPELINE -- Verdict: WARN
Drift Score: 0.12
Findings: 3 new, 0 stale, 0 drifted, 0 contradicting
Extraction: 12 code signals, 5 diagrams, 2 linker facts, 4 business knowledge
Gaps: 2 domains, 16 total entries
$ harness knowledge-pipeline --fix
KNOWLEDGE PIPELINE -- Verdict: PASS
Drift Score: 0.00
Findings: 0 new, 0 stale, 0 drifted, 0 contradicting
Extraction: 12 code signals, 5 diagrams, 2 linker facts, 4 business knowledge
Gaps: 2 domains, 19 total entries
Convergence: 2 iterations
Remediations: 3 applied
$ harness knowledge-pipeline --ci --drift-check
# Exits 1 if unresolved drift exists
| Rationalization | Reality |
|---|---|
| "The contradicting findings have an obvious resolution, so I can auto-fix them" | The Iron Law: contradicting findings require human decision. Different sources may have different authority levels that only the human understands. |
| "Drift score is low (0.05), so I can skip the DETECT phase and go straight to PASS" | Every finding must be classified regardless of drift score. A low score with one critical contradiction is still a FAIL. |
| "The stale entries might come back if the source is restored, so I should keep them" | Stale means the source is gone now. If it comes back, the next extraction will find it as NEW. Keeping stale entries pollutes the graph. |
| "I can run the convergence loop more than 5 times to get to zero findings" | The 5-iteration cap is a safety bound. If findings aren't decreasing, more iterations won't help — the remaining issues need human intervention. |
--fix mode, DETECT must run before REMEDIATE.--fix. Default mode is detect-and-report only.npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeOrchestrates 4 documentation skills into a sequential pipeline that detects drift, applies fixes, audits coverage, and fills gaps to produce a documentation health report.
Samples concepts from a knowledge graph and verifies claims against current code, sources, and ground truth. Flags stale concepts to prevent knowledge rot.
Manages persistent knowledge graph for specs by caching agent discoveries, codebase analysis, patterns, components, and APIs. Use to remember findings across sessions, validate task dependencies, and query prior work.