aboutsummaryrefslogtreecommitdiff
path: root/claude-templates
Commit message (Collapse)AuthorAgeFilesLines
...
* fix(ai): explicit end-of-session placement for new windowsCraig Jennings2026-05-191-1/+1
| | | | | | tmux's default new-window placement chooses the lowest free index, which can land between existing windows when the session's window indexes have gaps. The -a flag plus the :{end} target makes it explicit: insert after the existing last window, every time. The change only touches create_window. The two tmux new-session sites (single_mode and multi_mode first window) create fresh sessions; the first window's position is whatever base-index dictates, and there's nothing to append after.
* feat(ai): per-project opening line with host and project nameCraig Jennings2026-05-181-7/+22
| | | | | | | | | | The ai launcher used to send claude a fixed instruction string ('Read .ai/protocols.org and follow all instructions.'). Every window opened the same way, with no signal in the conversation about which machine or project it belonged to. That's fine when there's one window, less fine when an ai-session has 5+ windows across two machines. The new build_instructions helper formats the opener per project: "This is <host> <name> project. Follow all instructions in .ai/protocols.org." Host comes from uname -n (POSIX, no dependency on the hostname binary which isn't installed by default on Arch). The project name distinguishes windows; the .ai/ prefix on the path stays so claude resolves the file reliably on first read. The three send-keys call sites all use the helper now (create_window, single_mode new-session, multi_mode first-window). Smoke-tested with rulesets, .emacs.d, jr-estate basenames. Also fixes the stale Source/Install header comments. They still pointed at ~/projects/claude-templates/bin/ai, the pre-fold path the subtree merge replaced.
* feat(rules): working-files convention for in-progress task artifactsCraig Jennings2026-05-181-0/+12
| | | | | | I added claude-rules/working-files.md as the canonical convention. In-progress task artifacts live in working/<task-slug>/ under the project root. On task completion the files get renamed individually with a YYYY-MM-DD-<slug>-<descriptor> shape and moved flat into assets/ (or the area-specific assets/). Never rename the directory as a substitute for filing, since that loses the flat-searchable property of assets/. claude-templates/.ai/protocols.org gained a short reference to the rule so it propagates to every project's .ai/protocols.org on the next startup rsync.
* docs(protocols): mechanical primary trigger for session-context writesCraig Jennings2026-05-181-3/+5
| | | | | | | | The "If this session crashed right now..." heuristic was the trigger. It pushes the decision onto the agent every turn, and the agent's bias is to defer when no obvious milestone just happened. Four recent sessions in the work project showed the same drift. The pattern: substantive work, no mid-session writes, a wrap-time reconstruction afterward. The new primary trigger is mechanical. A turn that called any state-modifying tool (Edit, Write, Agent dispatch, MCP write, or Bash that mutates state) writes to the Session Log before the closing user-facing message. Pure-read turns (Read, Glob, Grep, read-only Bash) don't trigger. The existing high-loss bullets stay as elaboration. They aren't the trigger. The 5-turn safety net remains. The judgment heuristic is gone. The primary trigger replaces it.
* feat(lint-org): recognize cj-comment blocks and suppress false-positive warningsCraig Jennings2026-05-162-0/+74
| | | | | | | | | | org-lint emits three warnings for every `#+begin_src cj: comment ... #+end_src` annotation block: suspicious-language-in-src-block (the language `cj:` isn't a known Babel slug), wrong-header-argument (the trailing `comment` looks like a header arg without a colon), and empty-header-argument (that same `comment` has no value). All three are false positives. The cj-comment block is a Craig-specific annotation marker, not Babel src-block syntax. I added a helper `lo--cj-comment-block-opener-p` that pattern-matches the opener line, then a short-circuit branch at the top of `lo--handle-item` that silently drops any of the three checkers when they fire on a cj-comment opener. No fix is counted, no judgment is emitted, and the warnings disappear. Two new tests cover the change. The normal case is a solo cj-comment block, which should produce zero judgments and zero fixes with all three flagged checkers absent from the issue list. The boundary case is a cj-comment block alongside a real `#+begin_src markdown` block. The markdown warning still surfaces, which scopes the suppression to cj openers only — no leak into other src blocks. Test count goes from 22 to 24, all green. I smoke-tested against rulesets/todo.org: judgment count drops from 7 to 1. Six cj-comment false positives at lines 16 and 1291 are gone, and the unrelated misplaced-heading at 2139 still surfaces correctly.
* fix(workflows): default LINT_ORG_FOLLOWUPS to current project inboxCraig Jennings2026-05-161-8/+24
| | | | | | | | | | wrap-it-up's lint-org and date-coverage scans both defaulted LINT_ORG_FOLLOWUPS to `$HOME/projects/work/inbox/lint-followups.org`. The intent was to land findings where the next morning's daily-prep would pick them up. The bug: every project running wrap-up dumped its findings into the work project's inbox regardless of which project's todo.org was scanned. The fallback at `.ai/lint-followups.org` never fired because `$HOME/projects/work/inbox/` exists on every machine. I found this morning that work's inbox/lint-followups.org had accumulated lint output from .emacs.d, rulesets, and work across multiple wrap-up runs on 2026-05-15 and 2026-05-16. I routed the foreign sections back to the right inboxes via inbox-send. The fix changes the default to `./inbox/lint-followups.org` in the current project's cwd, with `.ai/lint-followups.org` as the fallback when the project has no `inbox/` directory. The env var still overrides for projects that want to route somewhere else. I applied the same change to both bash blocks (lint-org sweep at line 137, date-coverage scan at line 173) and rewrote the prose paragraph that documented the old default, with a note explaining why hardcoding a single project's path was wrong.
* docs(workflows): generalize wrap-it-up push parentheticalCraig Jennings2026-05-161-1/+1
| | | | | | The Step 4 "Push to all remotes" parenthetical singled out "github.com + cjennings.net mirrors" as the canonical case. Accurate for rulesets and a few other repos, misleading for the rest. Most projects have git.cjennings.net as their sole remote, and DeepSat lives on deepsat.ghe.com. The push loop itself (for r in $(git remote)) is already remote-agnostic; the prose just needed to catch up. New wording covers both the mirror case and the different-audience-per-remote case without naming any specific host.
* docs(workflows): route triage Action items to todo.org as :quick: tasksCraig Jennings2026-05-161-58/+82
| | | | | | | | Every Action item surfaced by Phase 3 sub-steps 3b/3d/3e/3f (email, Slack, Linear, PR Review) now becomes its own ** TODO in todo.org with :quick: + :reactive: tags plus sharp person/entity tags. The prep doc's * Day's Priorities section references each task as a thin link when it belongs in today's plan; otherwise the task stays in todo.org and surfaces on a later prep via the new sub-step 3a step 4 pull. The grouped ** Email Response / ** Slack Response / ** Linear Response / ** PR Review sub-headings disappear from the prep doc. Source mix lives in the tags on each task. The Recommended Approach Pattern still applies. The analysis and draft response live in the task body, not in the prep doc. Mirrors the convention adopted in the work-side triage-intake workflow on 2026-05-15. Closes the 2026-05-12 follow-up about rewording sub-steps 3b–3f.
* fix(cj-scan): suppress detection inside nested non-cj begin_* blocksCraig Jennings2026-05-152-0/+140
| | | | | | cj-scan.py matched =#+begin_src cj:= / =#+end_src= line-by-line without awareness of enclosing block scopes. A cj fence embedded inside =#+begin_example= (typical when documenting what the <cj yasnippet emits) or =#+begin_src snippet= (the yasnippet definition itself) was misclassified as a live cj annotation. Two false positives surfaced from a /respond-to-cj-comments run against an org file with yasnippet docs. Track an active wrapper_type. When the scanner sees =#+begin_<type>= for any type other than cj: (the cj-open regex is checked first), enter a wrapper state where every line is content until the matching =#+end_<type>= closer fires. Inside a wrapper, both fence patterns and legacy inline cj: lines stay suppressed. Added the TestCjScanNestedFencesIgnored class with 6 tests: nesting inside example, src <other-lang>, and quote; regression guards for clean wrapper close and unclosed-wrapper non-swallow. Canonical pytest: 302 passed, 1 skipped.
* docs(protocols): add startup pull-ordering ruleCraig Jennings2026-05-151-0/+8
| | | | The 2026-05-15 claude-templates fold wired the rulesets-first-then-project ordering into startup.org Phase A.0, but the rule itself never landed in protocols.org. This adds a Startup Pull Ordering subsection under IMPORTANT - MUST DO with the ordering, the ff-only guardrail, and the no-auto-stash / merge / rebase rule. Mechanics stay in startup.org; the rule lives in protocols.org because it governs the first action of every session.
* docs(ai): point template references at in-repo claude-templates/Craig Jennings2026-05-153-17/+19
| | | | | | | | Canonical .ai/ source moved from ~/projects/claude-templates/ to ~/code/rulesets/claude-templates/ via subtree merge. Phase A.0's "Refresh claude-templates" step is now "Refresh rulesets" since there's only one repo to pull. Updates: - startup.org Phase A.0: rsync sources point at the in-repo path - protocols.org and cross-agent-comms.org: workflow-promotion target paths updated
* Merge commit '69c5e4ace81586c05dea6a9a3afd54dafa61a73b' as 'claude-templates'Craig Jennings2026-05-1588-0/+17181