/harlan-agent-kit:unit-tests [file or directory to test or review]from harlan-agent-kit
Guides writing unit tests that verify exported behavior rather than internal implementation. Helps avoid brittle fact-check assertions and maintain valuable test suites.
Ships in harlan-agent-kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A unit test exercises an API. Input goes in, output gets asserted. Everything else is a fact check against the source file and should be deleted.
Before writing or deleting tests, read and follow the worktree isolation contract.
Keep mutation in a task-owned wt worktree with a live claim. Keep the primary checkout read only.
Fact-check tests restate what the file already says. They pass by construction, break on harmless refactors, and prove nothing.
// all of these are fact checks, not tests
expect(Object.keys(config)).toEqual(['name', 'hooks', 'setup'])
expect(source).toContain('export function resolvePath')
expect(module.default.name).toBe('my-module')
expect(handlers).toHaveLength(3)
expect(typeof createClient).toBe('function')
They feel productive because the file goes green. The suite grows, review cost grows, and no bug is ever caught.
Before keeping any assertion:
An assertion that survives both is testing behaviour. Anything else is ballast.
Every test is three lines of intent: build an input, call an export, assert the result.
it('rejects a path outside the root', () => {
const result = resolvePath('/srv/app', '../../etc/passwd')
expect(result).toEqual({ _tag: 'Err', reason: 'escapes-root' })
})
exports, not through a deep internal import.it.each.Cheap to write, cheap to throw away. Deleting a test is a normal outcome, not a regression.
dist/ output, or source text as a stringErr or the thrown error with the right discriminant.Read the file and bucket every expect into fact check, behaviour, or unclear. Report the counts, list the fact checks with line numbers, and propose deletions. Do not rewrite a fact check into a behaviour test unless the underlying behaviour is genuinely worth covering; usually the right patch is a deletion.
Report in this shape:
resolve-path.test.ts — 14 expects: 9 fact check, 4 behaviour, 1 unclear
Delete (fact check):
L12 expect(Object.keys(opts)).toEqual([...]) restates the options type
L27 expect(typeof resolvePath).toBe('function') passes by construction
L31-38 snapshot of the internal config object
Unclear:
L44 asserts cache.size === 1 — internal state; is the caching itself a documented guarantee?
Keep: L52, L58, L63, L70 (input to output, incl. two error paths)
What SKILL.md sets; muted values are Claude Code's defaults
35 skills in this plugin
/adversarial-reviewReview one pull request adversarially, hand permitted defects to Repair, verify the remote head, and publish the Harlan Agent Kit bot status. Use for rigorous pre-merge PR review./agent-feedbackImprove one Agent skill from explicit Review feedback. Use only for the agent-feedback Routine./agent-retroWeekly retro of Harlan GitHub Agent sessions. Group transcripts by goal, find repeated and wasted work, and rank fixes to the controller, prompts, skills, or model. Use for agent retro, session review, agent efficiency, or self-improvement runs.npx claudepluginhub harlan-zw/harlan-agent-kit --plugin harlan-agent-kitOther plugins' skills for the same job