role-promote

A command that reconciles a role's stored memory by combining pending and recent learnings into its ROLE.md file. It removes duplicates and unnecessary clutter, with no human review step described.

In plain words
What is it for?
It helps validate a role, read its existing memory and pending learnings, and rewrite ROLE.md with consolidated lessons, patterns, gotchas, and tools.
Why use it?
It keeps long-lived role information current and more focused when new notes have accumulated.

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/hdk10/orgkit/role-promote
Clone the repo
git clone --depth 1 https://github.com/hdk10/orgkit
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,728 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.00044 $0.01728
Opus 5 $0.00022 $0.00864
Sonnet 5 $0.00009 $0.00346
Haiku 4.5 $0.00004 $0.00173

Measured 2d ago against content hash 8631805ea1a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

role-promote 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 2d ago.

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.

commands/role-promote.md · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are the autonomous reconciler for the $ARGUMENTS role's memory. No human review gate — you both decide and write. Do it carefully: ROLE.md is a long-lived org brain injected into every session in this role, so signal density matters more than volume.

This is a full RECONCILE, not an append. You are rewriting the brain to be better than you found it.

Steps

  1. Validate role. Read .org/roles.json. If $ARGUMENTS is empty or not listed under roles, print the valid role names and stop. The roles.json lives at .org/roles.json (relative to repo root, which is your cwd).

  2. Delegate the rewrite to a sonnet subagent (keep the main thread lean). Pass it this exact task:

    You are rewriting the role brain for $ARGUMENTS. Read these files:

    • $ARGUMENTS/memory/ROLE.md — the current brain (what we already know).
    • $ARGUMENTS/memory/_pending.md — two kinds of content live here:
      1. Stub-queue lines ("N files changed (paths)") — tell you WHICH files changed; read those files directly to extract insight.
      2. Tagged bullets already written by /capture ([LESSON]/[PATTERN]/[GOTCHA]/[TOOL]) — these are ready to integrate; still dedupe against ROLE.md.
      3. Transcript pointers ("session transcript at <path>") — the Stop hook records where each session's conversation lives.
    • For each changed project path listed in the stub queue: read <path>/memory/PROJECT.md and the referenced changed files.
    • For each transcript pointer: run python3 .org/transcript.py "<path>" to get the clean conversation, and mine it for the reasoning a diff can't show — decisions and why, trade-offs, approaches tried and abandoned, gotchas hit, constraints the user stated. This is often the richest source.
    • Run git log --oneline --since="14 days ago" -- $ARGUMENTS/ and read any project files touched in recent commits that weren't already covered above.
    • Mine for new lessons — don't wait for pre-written tags. As you read changed files, PROJECT.md files, and the conversation, actively ask: what concrete, non-obvious decisions were made? What gotchas are baked in? What patterns emerge? What tools were chosen and why? Surface the insights the author didn't tag.

    Produce a SINGLE fully rewritten ROLE.md that:

    • Integrates genuinely new, concrete, role-worthy lessons mapped to the right section: [LESSON] → Best practices | [PATTERN] → Patterns | [GOTCHA] → Gotchas | [TOOL] → Tools / stacks. Each promoted bullet ends with _(from $ARGUMENTS/<path>)_.
    • Dedupes: collapse near-duplicate bullets into one sharper line. Never two bullets saying essentially the same thing.
    • Declutters: delete stale, superseded, contradicted, vague, or bloated entries. Tighten wordy bullets. If a new lesson supersedes an old one, replace it — don't stack.
    • Preserves every UNIQUE piece of substantive knowledge. Do not drop a real lesson just to shorten.
    • Keeps section order and the "How to contribute" footer intact.
    • Refreshes the Last reconciled: header date to today.

    Rebuild the Index of where everything lives (the section after "Open questions"):

    Walk every project directory under $ARGUMENTS/ that has a memory/PROJECT.md. For each project:

    • Read its memory/PROJECT.md.

    • Identify the 1–3 most important entry-point files (e.g. main.py, service.py, scrape.py, the primary config, the key notebook).

    • Write one row per "task a future session might need to do" that traces to a specific file:

      If you need to... Look at Why
      do X $ARGUMENTS/<project>/<file> one-line reason — what makes this file the answer
    • Also write a Key files across projects list:

      - `$ARGUMENTS/<project>/` — one-sentence description of the project
        - `<entry-point-file>` — what it does
        - `<config-or-memory-file>` — what it does
      

    Aim for completeness over brevity: every active project under $ARGUMENTS/ should appear. Remove rows for projects whose folders no longer exist on disk. Keep the section compact — one row per useful "find it" task, not one row per file.

    Before writing: copy old $ARGUMENTS/memory/ROLE.md$ARGUMENTS/memory/ROLE.md.bak (overwrite any prior bak). Then write the rewritten content to $ARGUMENTS/memory/ROLE.md.

    Return exactly one line: added=<N> merged=<M> removed=<R> old_lines=<L1> new_lines=<L2>

Read the full file on GitHub · 87 lines

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. 2d ago First seen · 87 lines · 44 tokens per session scan A 8631805ea1a4

Subscribe to this mod's changes

role-promote is a command published in the GitHub repository hdk10/orgkit (2 stars, last pushed 2mo ago), licensed MIT. It adds 44 tokens to every session and 1,728 once invoked, about $0.0002 per session on Opus 5. 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-31.