agentleFS
ljf06853ljf06853/keepfire/CLAUDE.md

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

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
  1. Distinctive:

    Run a single test by name:

    line 13
  2. Distinctive:

    No ESLint, Prettier, or any formatter — this is deliberate.

    line 24

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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.ts

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.

Style

  • Relative imports must carry a .js extension, even in .ts sources: 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.log is the intended output channel — this is a CLI. (Global TypeScript rules ban console.log in 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() in src/cli.ts catches centrally, prints Error: <msg>, and sets process.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, VERSION in src/cli.ts, .claude-plugin/plugin.json, and .claude-plugin/marketplace.json must be bumped together; nothing syncs them. Use /release.
  • Card Markdown headings are a parser contract. renderCardMarkdown and parseCardMarkdown (src/store.ts) and templates/card.md must move in lockstep, and card frontmatter must stay flat and inline — it is parsed by a hand-rolled parseSimpleYaml, not a YAML library. rebuildIndex swallows parse failures with a bare catch {}, so a mismatch silently corrupts every card instead of erroring. See the card-schema skill before changing any of this.
  • CJK support in src/search.ts is a feature, not accidental complexity. tokenize() expands CJK runs into unigrams/bigrams/trigrams and INTENT_ALIASES maps Chinese keywords to intents. Do not "simplify" the tokenizer — it breaks bilingual recall, which is under test.
  • Search scoring silently drives auto-apply. normalizeConfidence in src/cli.ts is score / 12, compared against auto_apply_threshold (default 0.88). Changing scoring weights in src/search.ts shifts auto-apply behavior.
  • SKILL.md at the repo root is a load-bearing product surface, not documentation. keepfire init --link symlinks (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). Most store/search functions also take an explicit root param that wins over it.
  • KEEPFIRE_STRICT=1 — the only thing that makes capture_mode=confirm actually require --yes on keepfire keep. Without it, confirm mode 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.