From harness-claude
Distills solved non-trivial problems into structured post-mortem docs at docs/solutions/<track>/<category>/<slug>.md via 5-phase process including classification and overlap checks for reusable playbooks.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> 5-phase post-mortem capture. When a problem is solved, distill it into a structured doc at `docs/solutions/<track>/<category>/<slug>.md` so the next person (or agent) finds the playbook before re-deriving it.
Coordinates parallel subagents to document recently solved problems into searchable YAML-frontmatter Markdown files in docs/solutions/. Offers full research/cross-reference mode or lightweight single-pass.
Coordinates parallel subagents to document recent problem solutions as structured Markdown with YAML frontmatter in docs/solutions/ for team knowledge retention.
Coordinates subagents to document recently solved problems into searchable YAML-frontmatter Markdown files in docs/solutions/ while context is fresh.
Share bugs, ideas, or general feedback.
5-phase post-mortem capture. When a problem is solved, distill it into a structured doc at
docs/solutions/<track>/<category>/<slug>.mdso the next person (or agent) finds the playbook before re-deriving it.
compound-candidates scanner surfaces a candidate (deferred until Phase 5)docs/knowledge/ (use harness-knowledge-pipeline; the boundary is: knowledge-pipeline extracts structural facts FROM CODE; compound captures post-mortem playbooks WRITTEN AFTER A FIX).harness/learnings.md still exists for that)One problem, one canonical doc. Phase 3 (overlap-check) is mandatory. If overlap is high, UPDATE the existing doc (bump last_updated, append to relevant section). Do not create a duplicate.
Extract the problem and the solution from available context:
.harness/debug/active/*.md if present, and recent git log --oneline -20.module (package name or area, e.g. orchestrator, cli/validate).Output: { problem, solution, module, candidateTags }.
Read docs/solutions/references/schema.yaml for the authoritative track/category enum and docs/solutions/references/category-mapping.md for examples of which problems land in which category.
track:
bug-track — a thing was broken; you fixed it. Concrete failure, concrete cause.knowledge-track — a pattern, convention, or decision worth preserving as guidance, not a fix.category from the enum for that track. If nothing fits, stop and escalate — adding categories requires a PR (Decision 8).Output: { track, category }.
docs/solutions/<track>/<category>/*.md.# <Title> heading and the first 200 chars of the ## Problem (bug-track) or ## Context (knowledge-track) section.module, shared problem_type, similar problem statement (Jaccard on bag-of-words >= 0.5 is a reasonable threshold; the agent uses judgment).## Solution or ## Guidance describing the new instance, bump last_updated).Copy docs/solutions/assets/resolution-template.md to a working buffer.
Fill the frontmatter:
---
module: <from Phase 1>
tags: [<from Phase 1 candidateTags, lowercase, hyphenated>]
problem_type: <short noun phrase, e.g. 'race-condition'>
last_updated: '<YYYY-MM-DD, today>'
track: <bug-track | knowledge-track>
category: <from Phase 2>
---
Replace the # <Title> placeholder with a concise problem statement.
For bug-track: fill ## Problem, ## Root cause, ## Solution, ## Prevention. Delete the knowledge-track sections (## Context, ## Guidance, ## Applicability).
For knowledge-track: fill ## Context, ## Guidance, ## Applicability. Delete the bug-track sections.
Cite commit SHAs and file:line where helpful.
-2, -3, etc.acquireCompoundLock from @harness-engineering/core, holds the handle while you write the doc, then releases it. Example: node -e "import('@harness-engineering/core').then(({ acquireCompoundLock }) => { const h = acquireCompoundLock('<category>'); /* write the doc here */ h.release(); }).catch(err => { console.error(err.message); process.exit(1); })". Lock path: .harness/locks/compound-<category>.lock. The MCP tool acquire_compound_lock is planned for a later phase — do not attempt to call it yet; the shell-out is the only supported path right now.
CompoundLockHeldError: report "compound lock for category <category> is held by pid <N> — wait for it to release or run /harness:compound for a different category" and stop. Do not retry automatically. A second invocation on the same problem after release will go through Phase 3 and find the doc the first invocation produced.docs/solutions/<track>/<category>/<slug>.md.SolutionDocFrontmatterSchema by running harness validate (which runs validateSolutionsDir).harness validate — Run after writing the doc; the solutions validator catches frontmatter errors before commit.harness check-deps — Not required (no new module imports introduced by writing a doc).@harness-engineering/core lock primitive — acquireCompoundLock(category, { cwd }) returns a release handle; throws CompoundLockHeldError on contention. See packages/core/src/locks/compound-lock.ts.packages/core/src/solutions/schema.ts is the single source of truth for tracks and categories. docs/solutions/references/schema.yaml mirrors it for human reading.harness-knowledge-pipeline — Knowledge-pipeline extracts structural facts FROM CODE. Compound captures post-mortem playbooks WRITTEN AFTER A FIX. Compound's knowledge-track output is a candidate input to the pipeline (Phase 7 of the spec wires this)..harness/learnings.md — The file remains for ephemeral session notes. It is no longer the canonical sink for compounding knowledge — that's docs/solutions/.docs/solutions/<track>/<category>/<slug>.md with valid frontmatter (passes validateSolutionsDir).CompoundLockHeldError.Input: "Stalled lease cleanup in orchestrator caused stuck issues. Fix was to add a 5-minute lease TTL with a sweep at startup. Took 4 commits, debugged via harness-debugging."
module=orchestrator, problem="stuck issues from stalled leases", solution="lease TTL + startup sweep".track=bug-track, category=integration-issues (lease coordination is integration-shaped).docs/solutions/bug-track/integration-issues/stalled-lease-cleanup.md under lock.Input: "We standardized on Result<T, E> returns for all I/O paths in packages/core. Document the convention and when not to use it."
module=core, problem="when to use Result vs throwing", solution="convention doc".track=knowledge-track, category=conventions.docs/solutions/knowledge-track/conventions/result-type-for-io.md under lock.Input: "Hit the same stalled-lease bug today on a different code path."
bug-track/integration-issues target.stalled-lease-cleanup.md with high overlap.## Solution describing the new instance, bump last_updated, do not create a new file.packages/core/src/solutions/schema.ts. Escalate.harness validate must pass before exit. Frontmatter errors silently break the corpus.validateSolutionsDir rejects the doc: Show the validator error, fix the frontmatter, re-validate. Do not commit a doc that fails validation.