Knowledge patch (skill/correction) management CLI for AI coding agents.
| Item | Value |
|---|---|
| Runtime | Bun |
| Language | TypeScript (strict mode) |
| Package Manager | bun |
| Build | bun run build |
| Test | bun test |
| Type Check | tsc --noEmit |
knowpatch handles two kinds of hooks:
| Type | Location | Purpose |
|---|---|---|
| Product hooks | src/hooks/ |
User-facing hooks installed by knowpatch (detect.ts) |
| Dev hooks | .agents/hooks/ |
Quality guardrail hooks for developing this project (Python) |
SKILL.md and corrections/ under skills/knowpatch/ are product files.
Always pass typecheck + tests before modifying skill files.
- TypeScript strict mode — no
any/unknown - ESM modules,
node:prefix,.jsextension imports - Layer separation:
commands/→core/→ui/(core must not import from upper layers) - Never guess versions/packages — verify via package manager
- Details: code-conventions.md
Run after every code change:
tsc --noEmit && bun testDev hooks track dirty state; the Stop hook blocks if not run.
| Directory | Role |
|---|---|
src/commands/ |
CLI commands (install, uninstall) |
src/core/ |
Business logic (parser, paths, hooks) |
src/ui/ |
Terminal output (palette, spinner, interactive) |
src/hooks/ |
Product hooks (detect.ts) |
skills/knowpatch/ |
Product files — SKILL.md + corrections/ |
tests/ |
bun:test tests |
bin/ |
Build output (gitignored) |
.agents/hooks/ |
Dev hooks (Python) |
.agents/conventions/ |
Coding/authoring standards |
.agents/skills/ |
Skill trigger/guardrail rules |
| Convention | File | Key Content |
|---|---|---|
| Code standards | code-conventions.md | TS strict, layer separation, anti-patterns |
| Skill authoring | skill-authoring.md | Prompt principles, correction quality, YAML rules |
| Document standards | document-standards.md | Size limits, TOC, Progressive Disclosure |
| Git workflow | git-workflow.md | Commit rules, branches, pre-push checks |