keepfire
CLAUDE.md1 starsChanged 4 months agoMITView on GitHub
Run a single test by name: dist/ is gitignored but is the bin target (keepfire -> ./dist/cli.js). Run npm run build before npm link or before anything invokes the keepfire binary. New store/search behavior ships with a test. Tests use Node's built-in runner (node:test + node:assert/strict) via tsx, and sandbox the library by setting process.env.KEEPFIRE_HOME to a fs.mkdtempSync dir. tsconfig.json excludes test/, so npm run build never typechecks test files — type errors there only surface when npm test runs.
- Reads credentials
In this repository3 other files it gives its agents.
- card-schemaSkill
- releaseSkill
- keepfireSkill
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Run a single test by name:
- Distinctive: line 24
No ESLint, Prettier, or any formatter — this is deliberate.
≈ “Common” is an estimate: at least 1 in 5 of the 28,029 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Commands
npm run build # tsc -> dist/
npm test # tsx --test test/*.test.ts
npm run dev -- <args> # run the CLI from source, e.g. npm run dev -- search "pr review"Run a single test by name:
npx tsx --test --test-name-pattern "listCards rebuilds" test/store-search.test.tsdist/ is gitignored but is the bin target (keepfire -> ./dist/cli.js). Run npm run build before npm link or before anything invokes the keepfire binary.
Style
- Relative imports must carry a
.jsextension, even in.tssources:import { saveDraft } from "./store.js";. This is a NodeNext ESM requirement — omitting it breaks the build. - No ESLint, Prettier, or any formatter — this is deliberate. Do not add one. Match the existing style by hand: 2-space indent, double quotes, semicolons, trailing commas in multiline literals.
- Explicit return types on every function, including private ones. No classes; plain functions plus exported interfaces/type aliases.
console.logis the intended output channel — this is a CLI. (Global TypeScript rules banconsole.login production code; that rule does not apply here.) Likewise, the global rules' Zod and Playwright guidance does not apply: this repo currently has zero runtime dependencies and no browser surface.- Throw plain
Error;main()insrc/cli.tscatches centrally, printsError: <msg>, and setsprocess.exitCode = 1.
Testing
New store/search behavior ships with a test. Tests use Node's built-in runner (node:test + node:assert/strict) via tsx, and sandbox the library by setting process.env.KEEPFIRE_HOME to a fs.mkdtempSync dir.
tsconfig.json excludes test/, so npm run build never typechecks test files — type errors there only surface when npm test runs.
Gotchas
- The version lives in four places.
package.json,VERSIONinsrc/cli.ts,.claude-plugin/plugin.json, and.claude-plugin/marketplace.jsonmust be bumped together; nothing syncs them. Use/release. - Card Markdown headings are a parser contract.
renderCardMarkdownandparseCardMarkdown(src/store.ts) andtemplates/card.mdmust move in lockstep, and card frontmatter must stay flat and inline — it is parsed by a hand-rolledparseSimpleYaml, not a YAML library.rebuildIndexswallows parse failures with a barecatch {}, so a mismatch silently corrupts every card instead of erroring. See thecard-schemaskill before changing any of this. - CJK support in
src/search.tsis a feature, not accidental complexity.tokenize()expands CJK runs into unigrams/bigrams/trigrams andINTENT_ALIASESmaps Chinese keywords to intents. Do not "simplify" the tokenizer — it breaks bilingual recall, which is under test. - Search scoring silently drives auto-apply.
normalizeConfidenceinsrc/cli.tsisscore / 12, compared againstauto_apply_threshold(default0.88). Changing scoring weights insrc/search.tsshifts auto-apply behavior. SKILL.mdat the repo root is a load-bearing product surface, not documentation.keepfire init --linksymlinks (or, when symlinks are blocked — typical on Windows — copies) the whole package root into~/.claude/skills/keepfire,~/.codex/skills/, etc. Adding root-level files changes what agents receive.
Env vars
KEEPFIRE_HOME— overrides the library root (default~/.keepfire). Moststore/searchfunctions also take an explicitrootparam that wins over it.KEEPFIRE_STRICT=1— the only thing that makescapture_mode=confirmactually require--yesonkeepfire keep. Without it,confirmmode does not block saves at the CLI layer, despite what the README's mode table implies.
Docs
User-facing changes to README.md must be mirrored in docs/README.zh-CN.md in the same change.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

