diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-11 15:15:29 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-11 15:15:29 -0500 |
| commit | 1a911d58c4a5e5e9c4e7d3a9712f887ef2743dd8 (patch) | |
| tree | a4ff47475b961c9eeec1f9d9e7148b66390c3a6f | |
| parent | 2b14d262e5e3f5f08bf5593ead39671a9ab812bf (diff) | |
| download | dotemacs-1a911d58c4a5e5e9c4e7d3a9712f887ef2743dd8.tar.gz dotemacs-1a911d58c4a5e5e9c4e7d3a9712f887ef2743dd8.zip | |
chore(claude): sync bundle rule updates
| -rw-r--r-- | .claude/rules/interaction.md | 2 | ||||
| -rw-r--r-- | .claude/rules/knowledge-base.md | 60 |
2 files changed, 62 insertions, 0 deletions
diff --git a/.claude/rules/interaction.md b/.claude/rules/interaction.md index fa09d6d0..1fd0334f 100644 --- a/.claude/rules/interaction.md +++ b/.claude/rules/interaction.md @@ -26,6 +26,8 @@ For pick-one decisions, same shape: numbered list, one-line prompt at the end. For multi-select decisions, say so explicitly: "Pick any combination — reply with the numbers." +**Render-merge guard.** GFM renderers merge adjacent ordered lists and renumber them — a message with a 1-3 content list followed by a 1-3 options list rendered as options 4-6 on the user's screen, and his pick ("4") didn't exist in the author's numbering (work session, 2026-06-10). Numerals belong to the options list only: any other enumeration in the same message uses dashes or prose, and a short prose lead-in line sits directly above the options so no renderer can merge them. When the user picks a number outside the offered range, suspect the render-merge and ask which item text they meant rather than treating it as an error. + Reserve `AskUserQuestion` only when the user explicitly asks for the popup form ("use the popup for this one") or for genuinely free-form input where numbered options don't fit. This rule applies to all three approval gates in the `commits.md` publish flow (commit message, PR description, PR review reply): print the draft inline, then offer numbered approve / changes / edit options inline. Do not switch to the popup form for the gate even though the prior protocol referenced it. diff --git a/.claude/rules/knowledge-base.md b/.claude/rules/knowledge-base.md new file mode 100644 index 00000000..56584987 --- /dev/null +++ b/.claude/rules/knowledge-base.md @@ -0,0 +1,60 @@ +# Agent Knowledge Base (org-roam) + +Applies to: `**/*` + +Craig's org-roam knowledge base is the shared, cross-project store for durable agent knowledge. It lives at `~/org/roam/` — a git repo (origin `git@cjennings.net:roam.git`), auto-synced on Craig's machines by the `roam-sync` systemd timer. Per-project harness memory stays the fast capture layer; durable facts get promoted here. + +## Reading (any project) + +Before relying on a remembered project fact, a prior decision, or reference material, search the KB first. The interface is plain files — never the org-roam SQLite cache: + +```sh +# content/tag search +rg --glob '*.org' --glob '!*sync-conflict*' '<query>' ~/org/roam/ +# follow an [[id:UUID]] link to its node +rg --glob '*.org' --glob '!*sync-conflict*' ':ID:[[:space:]]+<uuid>' ~/org/roam/ +``` + +Pull before querying (`git -C ~/org/roam pull --ff-only`); skip silently if offline. If `~/org/roam/` doesn't exist on this machine, proceed without the KB and say so — never fabricate recall. + +## Writing (personal projects only) + +Classify the project before any write. The source of truth is the work-root denylist below — never inference from remotes, names, or task content: + +- **Work** — project root is, or sits under, a denylisted root. No KB write, ever. Record durable facts per that project's own conventions. +- **Personal** — project root sits under `~/code/`, `~/projects/`, or `~/.emacs.d` and is not denylisted. KB writes allowed. +- **Unknown** — anything else. No KB write. + +Work-root denylist (confirmed by Craig, 2026-06-10): `~/projects/work` + +**Refusal contract** (work and unknown alike): state the classification, name the durable fact in a one-line redacted summary, and say where it was or wasn't written — so Craig can re-route it deliberately instead of losing it silently. + +A write is one node per fact, under `agents/`, roam-valid so Craig's org-roam indexes it: + +``` +~/org/roam/agents/YYYYMMDDHHMMSS-<slug>.org +--- +:PROPERTIES: +:ID: <uuid — generate with uuidgen> +:END: +#+title: <concise title> +#+filetags: :agent:<scope>: + +<the fact, with [[id:...]] links to related nodes> +``` + +Pull before writing, commit and push after (`git -C ~/org/roam add -A && git commit && git push`) — same session discipline as any repo. Never edit Craig's hand-authored nodes; link to them. This write autonomy is scoped to the KB alone — it is not permission to send email, comment on tickets, or post to any public or external channel. + +## What goes in, what stays out + +**In:** durable facts with cross-project or cross-machine value — decisions and their why, environment and tooling gotchas, reference pointers (URLs, dashboards, key paths), lessons that transfer beyond the project that learned them. + +**Out:** anything the repo already records (code structure, git history, CLAUDE.md content), session state, task state (todo.org owns that), high-churn facts that will be stale in a month, secrets and credentials, anything work-confidential. + +## Capture, then promote + +Harness memory (`~/.claude/projects/<enc>/memory/`) remains the per-project capture layer: fast, automatic, allowed to be at-risk. At wrap-up (or a task audit, or an explicit prompt), promote facts that meet the inclusion bar into the KB as nodes. The wrap-up workflow asks; answer it honestly — promotion discipline is what keeps the capture layer from silting up. + +## Inventory + +`rg '#\+filetags:.*:agent:' ~/org/roam/` lists everything agents ever wrote; the git log is the per-write audit trail. Craig prunes at will — deletion or revert of an `:agent:` node is never something to argue with. |
