backfill

A command that turns reusable lessons from a completed change into proposed entries for a project knowledge base, a collection of shared technical and business notes.

In plain words
What is it for?
It identifies new evidence-backed knowledge, writes candidate files, and sends them through a review and import process before they enter the formal wiki.
Why use it?
It prevents useful decisions, business understanding, and lessons from being lost after one task, while leaving people to approve what becomes official knowledge.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/alisunstar/opensunstar/backfill
Clone the repo
git clone --depth 1 https://github.com/alisunstar/OpenSunstar
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 450 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00450
Opus 5 $0.00000 $0.00225
Sonnet 5 $0.00000 $0.00090
Haiku 4.5 $0.00000 $0.00045

Measured yesterday against content hash 12e4a015514d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

backfill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rd-protocol/commands/backfill.md · 47 lines

What it actually says

/rd:backfill — 知识回补

阶段 7:把本次需求过程中产生的新知识回补到知识库候选区,闭环最后一环。

先读规则

  1. .specs/<change-id>/IMPLEMENTATION-CHECK.md(对账结果,识别新知识)
  2. knowledge/KNOWLEDGE-RULES.md(回补约定)
  3. knowledge/candidate/(现有候选,避免重复)

执行

  • 识别本次需求产生的新知识(业务理解、技术决策、踩坑经验、模板更新)
  • 每条知识标 source=evidence/confidence,写入候选清单
  • 候选内容写入 knowledge/candidate/ 目录(经候选管道)

回补路径

本命令产 KNOWLEDGE-BACKFILL.md
  → 候选写入 .opensunstar/wiki/candidates/
    → GUI 验收导入候选到正式 wiki
      → 建立知识基线(baseline synced)
        → 下一需求 ROUTING 命中已回补知识

何时澄清

  • 候选与现有正式知识冲突 → 暂停,等 owner 裁决

何时停止

  • 无新知识可回补 → 正常结束(不是所有需求都产回补)

产物

  • .specs/<change-id>/KNOWLEDGE-BACKFILL.md(回补候选清单 + 内容)
  • knowledge/candidate/{candidate-id}.md(候选文件,标 sourceType=backfill)

人工确认

— 产出回补候选后暂停,等 GUI 验收导入后建立基线。

闭环意义

回补是三层资产闭环的最后一环——RD 过程产出的知识回补到 wiki,wiki 的 ROUTING 又指导下一轮 RD,形成复利。

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 47 lines · 0 tokens per session scan A 12e4a015514d

Subscribe to this mod's changes

backfill is a command published in the GitHub repository alisunstar/OpenSunstar (40 stars, last pushed 18d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 450 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.