agentleFS
ljf06853ljf06853/keepfire/SKILL.md

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.

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
  1. Very specific:

    Prefer the keepfire CLI when available.

    line 30
  2. Very specific:

    Read ~/.keepfire/config.json if present:

    line 34
  3. Distinctive:

    If config is missing, assume defaults above.

    line 41
  4. Very specific:

    When auto_suggest is not false, watch the session for sparks and suggest keeping them.

    line 56
  5. Distinctive:

    If the user declines, drop it silently.

    line 68
  6. Distinctive:

    When the user explicitly asks to keep something, or when they accept a proactive suggestion (above).

    line 73
  7. Very specific:

    If CLI is unavailable, write a Markdown card under ~/.keepfire/cards/ using the template in templates/card.md and update …

    line 124
  8. Distinctive:

    Never paste an old prompt blindly: Always adapt:

    line 149
  9. Distinctive:

    keep the recipe's structure, constraints, and quality signals

    line 152
  10. Very specific:

    After a successful run, if the user says the result was better, offer /keep improve.

    line 164
  11. Very specific:

    If the user's environment journals prompts (via a UserPromptSubmit hook running keepfire journal --from-hook, or manual keepfire journal …

    line 192
  12. Distinctive:

    Never bulk-save the whole journal — harvest is curation, not import.

    line 206
  13. Distinctive:

    When a reuse improves the pattern:

    line 210
  14. Distinctive:

    Prefer recipes that encode process, not one-off content:

    line 223
  15. Very specific:

    When skeletonizing, replace secrets, absolute paths, proprietary names, and temporary values with {{placeholders}}.

    line 228
  16. Distinctive:

    Do not capture secrets, tokens, private keys, or credentials into recipes.

    line 233
  17. Distinctive:

    Keep frontmatter fields compatible with the CLI parser

    line 241
  18. Very specific:

    Ask the user to run keepfire reindex

    line 242
  19. Distinctive:

    Use the 🔥 marker when a spark is kept successfully.

    line 247

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

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

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/keepfire then /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) | auto
  • use_mode: always_ask | ask_if_low_confidence (default) | auto
  • auto_suggest: true (default) | false — proactive spark detection (see below)
  • auto_apply_threshold: number 0..1 (default 0.75)

If config is missing, assume defaults above.

Commands the user may say

User intentWhat 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_suggest automates 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:

  1. Final effective user prompt (not the first rough draft if later refined)
  2. Intent: one of
    implement | debug | review | refactor | test | explain | design | git-pr | perf | security | other
  3. Skeleton: same prompt with project-specific names removed and placeholders like {{task}}, {{diff}}, {{files}}, {{error}}, {{stack}}
  4. Constraints: hard rules that made it good
  5. Output contract: checklist / diff / steps / severity format...
  6. Why it worked (good_signals): 1–3 bullets
  7. Anti-patterns: what to avoid
  8. Stack hints: e.g. ts, react, go, postgres
  9. 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

  1. Parse the user's new task.
  2. Search the library:
npx --yes keepfire search "user task keywords" --top 5
  1. Present top 1–3 candidates with id, intent, score reasons.
  2. Selection policy:
    • always_ask: always let user pick
    • ask_if_low_confidence: auto-apply only if confidence is high
    • auto: apply best match
  3. 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
  4. 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.

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

  1. Run:
npx --yes keepfire harvest --limit 20
  1. Entries marked NEW have no similar recipe yet; covered-by:<id> means one exists.
  2. Review the NEW entries and propose the 1–3 strongest as draft cards (same quality bar as /keep: encode process, not one-off content).
  3. On approval, run the normal /keep capture flow for each.
  4. 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:

  1. Read/write ~/.keepfire/cards/*.md
  2. Keep frontmatter fields compatible with the CLI parser
  3. Ask the user to run keepfire reindex

Response style

Be concise, concrete, and developer-toned. Use the 🔥 marker when a spark is kept successfully.

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.