keepfire
Skill1 starsChanged 4 months agoMITView on GitHub
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.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- card-schemaSkill
- releaseSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 11 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Prefer the keepfire CLI when available.
- Very specific: line 34
Read ~/.keepfire/config.json if present:
- Distinctive: line 41
If config is missing, assume defaults above.
- Very specific: line 56
When auto_suggest is not false, watch the session for sparks and suggest keeping them.
- Distinctive: line 68
If the user declines, drop it silently.
- Distinctive: line 73
When the user explicitly asks to keep something, or when they accept a proactive suggestion (above).
- Very specific: line 124
If CLI is unavailable, write a Markdown card under ~/.keepfire/cards/ using the template in templates/card.md and update …
- Distinctive: line 149
Never paste an old prompt blindly: Always adapt:
- Distinctive: line 152
keep the recipe's structure, constraints, and quality signals
- Very specific: line 164
After a successful run, if the user says the result was better, offer /keep improve.
- Very specific: line 192
If the user's environment journals prompts (via a UserPromptSubmit hook running keepfire journal --from-hook, or manual keepfire journal …
- Distinctive: line 206
Never bulk-save the whole journal — harvest is curation, not import.
- Distinctive: line 210
When a reuse improves the pattern:
- Distinctive: line 223
Prefer recipes that encode process, not one-off content:
- Very specific: line 228
When skeletonizing, replace secrets, absolute paths, proprietary names, and temporary values with {{placeholders}}.
- Distinctive: line 233
Do not capture secrets, tokens, private keys, or credentials into recipes.
- Distinctive: line 241
Keep frontmatter fields compatible with the CLI parser
- Very specific: line 242
Ask the user to run keepfire reindex
- Distinctive: line 247
Use the 🔥 marker when a spark is kept successfully.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill 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
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 \
--yesIf 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 — TitleStill 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.
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.

