Keepfire
Skill ljf06853/keepfire
Capture, organize, and reuse high-quality coding prompts as versioned recipes. Use when the user says keep/save this prompt, /keep, /use, /garden, "收藏这个问法", "用我以前那种方式", "keep this spark", or wants to reuse a past successful coding prompt pattern for implement/debug/review/refactor/test/design/security tasks. Do not use for general project memory unrelated to prompt reuse.From its SKILL.md
npx -y skills add ljf06853/keepfireAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
8.2 KB, ~2.0k tokens by cl100k_base, as published. Nobody here has run it
Keepfire — Compound Your Coding Sparks
Claude Code users: prefer the plugin instead of this single-file skill — it installs four granular auto-triggering skills plus the journal hook:
/plugin marketplace add ljf06853/keepfirethen/plugin install keepfire@keepfire. This file remains the surface for Codex / Gemini CLI / other Agent-Skills-standard tools.
You are running the keepfire skill: a personal coding-prompt recipe system.
Sparks (great prompts) should not die in chat history. Turn them into recipes, then recall + adapt them on the next similar task.
Mental model
- Spark: a prompt (or prompt pattern) that clearly worked well for coding.
- Recipe: structured card with skeleton, constraints, output contract, and why it worked.
- Compounding: each reuse can improve the recipe (v1 → v2).
Storage is local Markdown under ~/.keepfire/ (override with KEEPFIRE_HOME).
Prefer the keepfire CLI when available; otherwise read/write the same files directly.
Modes
Read ~/.keepfire/config.json if present:
capture_mode:confirm(default) |autouse_mode:always_ask|ask_if_low_confidence(default) |autoauto_suggest:true(default) |false— proactive spark detection (see below)auto_apply_threshold: number 0..1 (default0.75)
If config is missing, assume defaults above.
Commands the user may say
| User intent | What you do |
|---|---|
| "收藏/keep/save this prompt" | Capture flow (/keep) |
| "用我以前那种方式 /use ..." | Recall + adapt flow (/use) |
| "列出/搜索配方 /garden /list" | Browse library |
| "挖掘/回顾最近的 prompt /harvest" | Mine the journal (/harvest) |
| "改成 auto/confirm" | Update capture/use mode |
| "这次更好,升级配方" | Improve version |
Proactive spark detection (auto_suggest)
When auto_suggest is not false, watch the session for sparks and suggest keeping them.
Signals that a spark just happened:
- The user praises a result tied to a specific prompt ("perfect", "exactly", "完美", "就是这样", "这个好").
- A prompt was refined 2+ times and the final version clearly produced the desired result.
- A prompt encodes a reusable process (e.g. "reproduce → smallest failing test → minimal fix → verify"), not one-off content.
Rules:
- Suggest with one short line, e.g.
🔥 这条 prompt 很出彩,要 keep 吗?— never interrupt mid-task; wait for a natural pause. - At most one suggestion per session unless the user engages.
- Never save without the user's yes.
auto_suggestautomates recognition, not persistence; saving still follows capture_mode. - If the user declines, drop it silently. Do not re-suggest the same prompt.
/keep — capture a spark
When to capture
When the user explicitly asks to keep something, or when they accept a proactive suggestion (above). Never save otherwise.
What to extract
From the conversation, identify:
- Final effective user prompt (not the first rough draft if later refined)
- Intent: one of
implement | debug | review | refactor | test | explain | design | git-pr | perf | security | other - Skeleton: same prompt with project-specific names removed and placeholders like
{{task}},{{diff}},{{files}},{{error}},{{stack}} - Constraints: hard rules that made it good
- Output contract: checklist / diff / steps / severity format...
- Why it worked (
good_signals): 1–3 bullets - Anti-patterns: what to avoid
- Stack hints: e.g.
ts,react,go,postgres - Trigger phrases: short phrases that should recall this later
Confirm mode (default)
Show a short draft card:
🔥 Keepfire draft
Title: ...
Intent: ...
Skeleton:
...
Constraints:
- ...
Why it worked:
- ...
[save] [edit] [cancel]
On save approval, persist via CLI:
npx --yes keepfire keep \
--title "..." \
--intent review \
--prompt "RAW_PROMPT" \
--skeleton "SKELETON" \
--stack ts,node \
--tags pr,security \
--triggers "审PR|security review" \
--constraints "c1|c2" \
--output "severity with Critical/Warning/Suggestion" \
--why "signal1|signal2" \
--avoid "drive-by refactors" \
--source claude-code \
--yes
If CLI is unavailable, write a Markdown card under ~/.keepfire/cards/ using the template in templates/card.md and update ~/.keepfire/index.json consistently (or tell the user to run keepfire reindex).
Auto mode
Save immediately after extraction, then report:
🔥 Kept #id — Title
Still allow undo via keepfire delete <id> --yes.
/use — recall and adapt
- Parse the user's new task.
- Search the library:
npx --yes keepfire search "user task keywords" --top 5
- Present top 1–3 candidates with id, intent, score reasons.
- Selection policy:
always_ask: always let user pickask_if_low_confidence: auto-apply only if confidence is highauto: apply best match
- Never paste an old prompt blindly. Always adapt:
- fill placeholders from current task/repo context
- drop stale file names / dead constraints
- keep the recipe's structure, constraints, and quality signals
- Apply with:
npx --yes keepfire use --id <id> "current task text"
--id accepts any unique id fragment (e.g. --id 4zri). After listing candidates you can
also apply the Nth one directly: keepfire use --pick 2 "current task text".
Or use the CLI output as the working instruction and execute the coding task accordingly.
- After a successful run, if the user says the result was better, offer
/keep improve.
/garden — manage
Support natural language for:
- list recipes
- search
- show one card
- delete
- export/import
- switch modes
CLI:
npx --yes keepfire list
npx --yes keepfire show <id>
npx --yes keepfire delete <id> --yes
npx --yes keepfire mode capture auto
npx --yes keepfire mode use ask_if_low_confidence
npx --yes keepfire mode suggest on
npx --yes keepfire stats
npx --yes keepfire export
/harvest — mine the journal for missed sparks
If the user's environment journals prompts (via a UserPromptSubmit hook running
keepfire journal --from-hook, or manual keepfire journal --text "..."), old sparks
can be recovered retroactively:
- Run:
npx --yes keepfire harvest --limit 20
- Entries marked
NEWhave no similar recipe yet;covered-by:<id>means one exists. - Review the
NEWentries and propose the 1–3 strongest as draft cards (same quality bar as/keep: encode process, not one-off content). - On approval, run the normal
/keepcapture flow for each. - Never bulk-save the whole journal — harvest is curation, not import.
/keep improve — evolve a recipe
When a reuse improves the pattern:
npx --yes keepfire improve <id> \
--note "Added reproduce-first step" \
--skeleton "NEW_SKELETON" \
--why "repro first|minimal fix"
Creates vN+1 linked via parent_id.
Quality bar for coding recipes
Prefer recipes that encode process, not one-off content:
- good: "reproduce → smallest failing test → minimal fix → verify"
- bad: a prompt that only works for one private file path and one bug string
When skeletonizing, replace secrets, absolute paths, proprietary names, and temporary values with {{placeholders}}.
Privacy
- Local-first: do not upload the library anywhere.
- Do not capture secrets, tokens, private keys, or credentials into recipes.
- Redact if the user accidentally includes them.
If tools fail
Fall back to:
- Read/write
~/.keepfire/cards/*.md - Keep frontmatter fields compatible with the CLI parser
- Ask the user to run
keepfire reindex
Response style
Be concise, concrete, and developer-toned. Use the 🔥 marker when a spark is kept successfully.
What ships with it: 25 files
98.1 KB alongside SKILL.md, 10 of them executable
.claude/
- hooks/typecheck.shruns1.1 KB
- settings.json313 B
.claude-plugin/
- marketplace.json441 B
- plugin.json453 B
agents/
- openai.yaml437 B
assets/
- banner.svg2.5 KB
docs/
- README.zh-CN.md10.3 KB
examples/
- sample-recipes.json2.1 KB
hooks/
- hooks.json259 B
- journal-hook.mjsruns1.2 KB
templates/
- card.md1.0 KB
test/
- confidence-recall.test.tsruns3.4 KB
- store-search.test.tsruns2.9 KB
- CLAUDE.md3.9 KB
- .gitignore115 B
- install.shruns1.6 KB
- LICENSE1.0 KB
- package.json1.3 KB
- README.md10.6 KB
- tsconfig.json411 B