aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-11 07:38:07 -0500
committerCraig Jennings <c@cjennings.net>2026-05-11 07:38:07 -0500
commitc62aa7af377e74d617ba09fe97b9df4718c6f1c4 (patch)
treea9acfc2e38c38716722726ee1555daf4ae745ffb
parentc462a13acd893f16e6e9b9358071435adf439c86 (diff)
downloadrulesets-c62aa7af377e74d617ba09fe97b9df4718c6f1c4.tar.gz
rulesets-c62aa7af377e74d617ba09fe97b9df4718c6f1c4.zip
chore(ai): sync template updates from claude-templates
Pull in the latest maildir-flag-manager.py and cross-agent-comms doc updates from the claude-templates source.
-rw-r--r--.ai/scripts/cross-agent-comms/cross-agent-send.md4
-rw-r--r--.ai/scripts/cross-agent-comms/cross-agent-status.md2
-rw-r--r--.ai/scripts/cross-agent-comms/cross-agent-watch.md2
-rwxr-xr-x.ai/scripts/maildir-flag-manager.py38
-rw-r--r--.ai/sessions/2026-05-11-07-33-make-audit-and-claude-templates-todos.org59
5 files changed, 85 insertions, 20 deletions
diff --git a/.ai/scripts/cross-agent-comms/cross-agent-send.md b/.ai/scripts/cross-agent-comms/cross-agent-send.md
index b06dbce..29bfb24 100644
--- a/.ai/scripts/cross-agent-comms/cross-agent-send.md
+++ b/.ai/scripts/cross-agent-comms/cross-agent-send.md
@@ -123,8 +123,8 @@ host = "velox.local"
ssh_user = "cjennings"
# Optional: per-project inbox-path overrides for non-default layouts.
-[projects.career]
-inbox_path = "~/projects/career/inbox/from-agents"
+[projects.work]
+inbox_path = "~/projects/work/inbox/from-agents"
[projects.homelab]
inbox_path = "~/projects/homelab/inbox/from-agents"
diff --git a/.ai/scripts/cross-agent-comms/cross-agent-status.md b/.ai/scripts/cross-agent-comms/cross-agent-status.md
index e700919..070330c 100644
--- a/.ai/scripts/cross-agent-comms/cross-agent-status.md
+++ b/.ai/scripts/cross-agent-comms/cross-agent-status.md
@@ -129,7 +129,7 @@ cross-agent-status
cross-agent-status --json | jq '.projects[] | select(.pending_count > 0)'
# Single-project query
-cross-agent-status --projects-glob ~/projects/career/inbox/from-agents/
+cross-agent-status --projects-glob ~/projects/work/inbox/from-agents/
```
## See also
diff --git a/.ai/scripts/cross-agent-comms/cross-agent-watch.md b/.ai/scripts/cross-agent-comms/cross-agent-watch.md
index 7192f46..dd8afc1 100644
--- a/.ai/scripts/cross-agent-comms/cross-agent-watch.md
+++ b/.ai/scripts/cross-agent-comms/cross-agent-watch.md
@@ -114,7 +114,7 @@ cross-agent-watch
# Test against a single project, no notifications, verbose
cross-agent-watch \
- --projects-glob "$HOME/projects/career/inbox/from-agents/" \
+ --projects-glob "$HOME/projects/work/inbox/from-agents/" \
--no-notify
# Production-style: quiet stdout, log only
diff --git a/.ai/scripts/maildir-flag-manager.py b/.ai/scripts/maildir-flag-manager.py
index 9c4a59c..97ed1d8 100755
--- a/.ai/scripts/maildir-flag-manager.py
+++ b/.ai/scripts/maildir-flag-manager.py
@@ -119,28 +119,34 @@ def process_maildir(maildir_path, flag, dry_run=False):
print(f" Skipping {maildir_path} (not found)", file=sys.stderr)
return 0, 0, 0
- changed = 0
- skipped = 0
- errors = 0
-
+ # Snapshot the file list before any rename. Adding S to a new/ file
+ # moves it to cur/ via rename_with_flag; without a snapshot, the
+ # moved file gets re-encountered during the cur/ scan and inflates
+ # the skipped count.
+ file_paths = []
for subdir in ('new', 'cur'):
subdir_path = os.path.join(maildir_path, subdir)
if not os.path.isdir(subdir_path):
continue
-
for filename in os.listdir(subdir_path):
file_path = os.path.join(subdir_path, filename)
- if not os.path.isfile(file_path):
- continue
-
- try:
- if rename_with_flag(file_path, flag, dry_run):
- changed += 1
- else:
- skipped += 1
- except Exception as e:
- print(f" Error on {filename}: {e}", file=sys.stderr)
- errors += 1
+ if os.path.isfile(file_path):
+ file_paths.append(file_path)
+
+ changed = 0
+ skipped = 0
+ errors = 0
+
+ for file_path in file_paths:
+ try:
+ if rename_with_flag(file_path, flag, dry_run):
+ changed += 1
+ else:
+ skipped += 1
+ except Exception as e:
+ print(f" Error on {os.path.basename(file_path)}: {e}",
+ file=sys.stderr)
+ errors += 1
return changed, skipped, errors
diff --git a/.ai/sessions/2026-05-11-07-33-make-audit-and-claude-templates-todos.org b/.ai/sessions/2026-05-11-07-33-make-audit-and-claude-templates-todos.org
new file mode 100644
index 0000000..e5e4a52
--- /dev/null
+++ b/.ai/sessions/2026-05-11-07-33-make-audit-and-claude-templates-todos.org
@@ -0,0 +1,59 @@
+#+TITLE: Session Context — make audit + claude-templates fold TODOs
+#+AUTHOR: Craig Jennings & Claude
+#+DATE: 2026-05-09 → 2026-05-11
+
+* Summary
+
+** Active Goal
+
+Scope-and-capture session. Craig floated two tooling ideas — a =make audit= target and folding the standalone =claude-templates= repo into rulesets — and after working through the design for each, asked for both to be written up as =todo.org= tasks rather than built now. No code shipped; two TODO entries added.
+
+** Decisions
+
+- =make doctor= stays single-machine scope (checks =~/.claude/= against rulesets). A cross-project drift checker is a separate target, =make audit=, not an extension of =doctor= — mixing them would muddy =doctor='s exit-code meaning.
+- Folding =claude-templates= into rulesets is worth doing (one repo to clone, one place to edit templates, no second pull at startup / push at wrap-up). Recommended approach: =git subtree add --prefix=claude-templates=, land it at =rulesets/claude-templates/=, bridge the path change with a symlink at =~/projects/claude-templates/= until every project has rsync'd the updated =startup.org=. Both written into the TODO as the proposed plan; not executed.
+- Both tasks filed at =[#B]=.
+
+** Data Collected / Findings
+
+- =claude-templates= is a small standalone repo (84 commits, =git@cjennings.net:git/claude-templates.git=). Contents: =.ai/= (the canonical template — protocols.org, workflows/, scripts/, references/, retrospectives/, notes.org), =bin/ai= (12 KB session launcher, symlinked into =~/.local/bin/ai=), a tiny Makefile (install/uninstall/list/test-scripts).
+- Three rulesets files reference the =~/projects/claude-templates/= path: =.ai/protocols.org= (line 163), =.ai/workflows/cross-agent-comms.org= (line 8), =.ai/workflows/startup.org= (lines 22, 96-98 — Phase A.0 pull + Phase A rsync sources).
+- Bootstrap gap for the fold: every project on the machine has a =.ai/workflows/startup.org= that rsyncs from =~/projects/claude-templates/=. The path only updates once each project rsyncs the new startup.org — which needs the old path to still resolve. A symlink at the old path bridges the transition.
+- Working tree at session start already carried uncommitted template-sync deltas (=.ai/scripts/cross-agent-comms/{send,status,watch}.md=) plus a staged 393-line restructure of =todo.org= (adds a =* Rulesets Open Work= umbrella heading, demotes every sub-heading one level). The startup rsync this session added one more delta: =.ai/scripts/maildir-flag-manager.py= (38-line update from claude-templates).
+
+** Files Modified
+
+- =todo.org= — added two TODO entries before the =* Rulesets Resolved= section:
+ - =[#B] Fold =claude-templates= into rulesets= — motivation, open design choices (history via subtree vs plain copy, layout, bin/ai handling), five mechanical steps, bootstrap-gap explanation.
+ - =[#B] Add =make audit= — drift detector across all =.ai/=-using projects= — scope (template-sync drift), source-path dependency on the fold task, project-discovery shape, output/exit-code semantics, rationale for keeping it separate from =doctor=.
+- =.ai/scripts/maildir-flag-manager.py=, =.ai/scripts/cross-agent-comms/{send,status,watch}.md= — template-sync deltas pulled in by the startup rsync (not hand-edited this session).
+
+** Next Steps
+
+- Both new TODOs are dormant by Craig's call ("hold off"). When picked up: do the =claude-templates= fold first — =make audit='s source path depends on where the templates land.
+- Pre-existing staged =todo.org= restructure (393 lines) is Craig's in-flight work, separate from this session. Surfaced at wrap-up for him to decide commit scope.
+- Carryover from the prior arc still open: =/update-skills= skill, =create-documentation= skill, the 2026-05-04 audit review pass.
+
+* Session Log
+
+** Startup
+
+Ran the startup workflow. Phase A.0 refreshes: claude-templates already up to date; project repo had nothing to fast-forward. Phase A: time = Saturday 2026-05-09 11:06 CDT; =session-context.org= absent (prior session wrapped cleanly); template rsyncs ran; sessions/ has one recent file (=2026-05-07-10-06-mcp-tokens-doctor-and-voice.org=); inbox empty; cross-agent status 0 pending; notes.org has no reminders or pending decisions; no project-workflows/startup-extras.org. Phase B: read the prior session's Summary. Surfaced findings — including that the Phase A rsync brought in template-sync deltas to =.ai/scripts/= — and asked Craig for priorities.
+
+** =make audit= question → clarification
+
+Craig asked whether we could create a =make audit= target that "performs =make doctor= on all the .ai project repositories." Read =scripts/doctor.sh= and the Makefile target. =doctor= is single-machine scope — it checks symlinks/MCP/plugins under =~/.claude/= against the rulesets repo, which is a once-per-machine thing, not per-project. Laid out four interpretations of what =audit= might mean (template-sync drift checker across all =.ai/=-using projects; per-project health check; alias for =doctor=; something else) and asked which one he wanted. Flagged the template-sync-drift flavor as the most useful.
+
+** Diversion: make claude-templates "official" inside rulesets
+
+Before answering the audit question, Craig pivoted: "it seems like we're pulling in the claude-templates into this project ... how would we make it official so the claude templates actually live within this project?" Investigated — listed =~/projects/claude-templates/= (=.ai/=, =bin/ai=, Makefile, 84 commits, cjennings.net remote), read its Makefile, grepped rulesets for references to the path (three files). Laid out the design: where it lands (=rulesets/claude-templates/= recommended), history (subtree merge vs plain copy), the bootstrap gap (other projects' startup.org still points at the old path), Phase A.0 needing to pull rulesets instead of claude-templates, =bin/ai= folding into the rulesets Makefile. Proposed a five-step plan ending with a transitional symlink at the old path. Asked Craig to confirm or adjust.
+
+** "Write a task ... hold off" ×2
+
+Craig: "let's write a task in todo.org that covers this. we'll hold off on that now." Checked todo.org structure (1846 lines, =** TODO [#priority]= headings clustered by topic, =*** = subsections for design notes). Added =[#B] Fold =claude-templates= into rulesets= just before the =* Rulesets Resolved= section, capturing the motivation, the three open design choices, the mechanical steps, and the bootstrap-gap note.
+
+Then Craig (referring back to the =make audit= idea): "let's write a task in todo.org that covers this. we'll hold off on that now." Added =[#B] Add =make audit= — drift detector across all =.ai/=-using projects= immediately after the fold task — scope, the source-path dependency on the fold landing first, project-discovery shape, output/exit-code semantics, and why it shouldn't be folded into =doctor=.
+
+** Wrap-up
+
+Craig: "let's wrap it up." Read wrap-it-up.org. No =session-context.org= existed (never created this session — should have been on first Log-worthy event), so wrote this record directly into =.ai/sessions/=. Checked git state: my contribution is the 39-line todo.org addition (two new TODOs, unstaged) plus this session file. Pre-existing and not from this session: the 393-line staged todo.org restructure (umbrella heading + level demotion — Craig's WIP), the cross-agent-comms .md template-sync deltas (in the tree before startup), and the maildir-flag-manager.py delta (from this session's startup rsync). Surfaced the commit-scope question to Craig before committing.