feat: track both entry files in the repo

~/.claude/CLAUDE.md was in no git repo despite heavy editing, and
~/.codex/AGENTS.md was a hand-synced duplicate of it. Both now live in
entry/ and import the shared fragments; RTK.md moves to claude-md/ so
Codex stops carrying its own copy.

Claude's imports are ~/-anchored so they resolve through the symlink.

Also drops kt from the comment rule scope.
This commit is contained in:
naps62
2026-08-01 15:02:28 +00:00
parent 9023ed3ef9
commit 60f39cdcbb
8 changed files with 97 additions and 5 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ git clone https://git.naps.pt/yolo/agent-skills.git ~/tea/yolo/agent-skills
Symlinks each skill into `~/.claude/skills/` and `~/.agents/skills/`, commands into `~/.claude/commands/`, hooks into `~/.claude/hooks/`, `claude-md/` fragments into `~/.claude/`. Idempotent; any pre-existing real dir is moved to `~/.agent-skills-backup/` (outside the discovery path, so it isn't picked up as a duplicate skill). Re-run after adding a skill. Symlinks each skill into `~/.claude/skills/` and `~/.agents/skills/`, commands into `~/.claude/commands/`, hooks into `~/.claude/hooks/`, `claude-md/` fragments into `~/.claude/`. Idempotent; any pre-existing real dir is moved to `~/.agent-skills-backup/` (outside the discovery path, so it isn't picked up as a duplicate skill). Re-run after adding a skill.
Hooks and fragments need one manual step each: the `settings.json` snippet in `hooks/README.md`, and `@writing.md` + `@operating.md` import lines in your `~/.claude/CLAUDE.md` and `~/.codex/AGENTS.md`. Both tools support `@path`, so they import the same fragments — no copy, no drift. Hooks still need one manual step: the `settings.json` snippet in `hooks/README.md`. Entry files are linked automatically — `entry/CLAUDE.md` and `entry/codex-AGENTS.md` hold the machine-local sections and `@import` the shared fragments, so both tools read the same rules with no copy and no drift.
### NixOS machine (home-manager) ### NixOS machine (home-manager)
+5 -2
View File
@@ -64,9 +64,12 @@ done
link "$REPO/claude-md/code-comments.md" "$CLAUDE_RULES/code-comments.md" link "$REPO/claude-md/code-comments.md" "$CLAUDE_RULES/code-comments.md"
rm -f "$CLAUDE_HOME/code-comments.md" "$HOME/.agents/AGENTS.md" rm -f "$CLAUDE_HOME/code-comments.md" "$HOME/.agents/AGENTS.md"
# Codex reads ~/.codex/AGENTS.md and supports @path imports, same as CLAUDE.md, # Entry files: machine-local sections plus @imports of the shared fragments.
# so both tools import the identical fragments — no copy, no drift. # Codex supports @path the same as CLAUDE.md, so neither tool needs a copy.
mkdir -p "$CODEX_HOME" mkdir -p "$CODEX_HOME"
link "$REPO/entry/CLAUDE.md" "$CLAUDE_HOME/CLAUDE.md"
link "$REPO/entry/codex-AGENTS.md" "$CODEX_HOME/AGENTS.md"
rm -f "$CODEX_HOME/RTK.md"
echo "done." echo "done."
echo "hooks still need wiring in ~/.claude/settings.json — see hooks/README.md" echo "hooks still need wiring in ~/.claude/settings.json — see hooks/README.md"
+29
View File
@@ -0,0 +1,29 @@
# RTK - Rust Token Killer
**Usage**: Token-optimized CLI proxy (60-90% savings on dev operations)
## Meta Commands (always use rtk directly)
```bash
rtk gain # Show token savings analytics
rtk gain --history # Show command usage history with savings
rtk discover # Analyze Claude Code history for missed opportunities
rtk proxy <cmd> # Execute raw command without filtering (for debugging)
```
## Installation Verification
```bash
rtk --version # Should show: rtk X.Y.Z
rtk gain # Should work (not "command not found")
which rtk # Verify correct binary
```
⚠️ **Name collision**: If `rtk gain` fails, you may have reachingforthejack/rtk (Rust Type Kit) installed instead.
## Hook-Based Usage
All other commands are automatically rewritten by the Claude Code hook.
Example: `git status``rtk git status` (transparent, 0 tokens overhead)
Refer to CLAUDE.md for full command reference.
+1 -1
View File
@@ -1,6 +1,6 @@
--- ---
paths: paths:
- "**/*.{ts,tsx,js,jsx,mjs,cjs,py,rs,go,sol,sh,bash,zsh,kt,rb,lua,zig,nix,ex,yaml,yml,toml}" - "**/*.{ts,tsx,js,jsx,mjs,cjs,py,rs,go,sol,sh,bash,zsh,rb,lua,zig,nix,ex,yaml,yml,toml}"
--- ---
## Code comments ## Code comments
+26
View File
@@ -0,0 +1,26 @@
# Global Context
## Environment
- Root password: `$SANDBOX_PASSWORD`, already exported from `~/.env.claude` in every shell. Use `printf '%s\n' "$SANDBOX_PASSWORD" | sudo -S <command>`. Never echo or print the value.
- Can install packages as needed using sudo
- This machine communicates with external services — treat it as a networked environment
- **This is a VM accessed from other devices.** When starting any dev server / web service / preview, always bind to `0.0.0.0` (e.g. `vite --host 0.0.0.0`, `--host`, `HOST=0.0.0.0`) — never localhost-only — so it's reachable. Report the LAN-IP URL, not the `localhost` one.
## Persistent Configuration
- Environment file: `~/.env.claude` (auto-loaded in shell sessions)
- For Claude sessions, source it manually if needed: `source ~/.env.claude`
@~/.claude/writing.md
@~/.claude/operating.md
## Crit reviews
- **`crit live` / `crit preview` write comments to a local review FILE, not an API** — there is NO notification and `crit fetch` does NOT apply (it needs a prior `crit share`). `/api/comments` on the daemon is the WRONG place (stays `[]`). If I launched the crit server myself, I must poll the review file myself.
- **Whenever I start a `crit live`/`crit preview` review for the user, immediately arm the watcher so they don't have to babysit it:**
`~/.claude/scripts/crit-watch.sh` — run it via the Bash tool with `run_in_background: true`. It auto-finds the active live/preview review file (`~/.crit/reviews/<id>/review.json`), baselines existing comment IDs, and re-invokes me with any NEW comments once they settle. When it fires: read the comments, address them, **reply to each via `crit comment --reply-to <id> <body>`**, then re-arm the watcher. Keep doing this until the user says they're done.
- Review file shape: comments live under `.files["<path>"].comments[]` (each has `id`, `body`, `dom_anchor.outer_html`, `pin_number`). `crit status` prints the file path + unresolved count. Note multiple review files can exist (one per `crit` invocation); the watcher picks the most-recently-updated live/preview one.
- `crit live <url>` serves TWO ports: the app proxy (target port + 1, e.g. `:41701`) with crit's overlay injected, and the review dashboard at `:<api>/live` (e.g. `:41700/live`) which also renders the proxied app. The user comments on the `/live` dashboard (highlight an element, press `t`).
- crit injects `<script data-crit-route-announcer>` into the proxied app but does NOT forward the query string — so a `?flag` dev toggle won't reach the app under crit; detect the injected marker instead.
- For GitHub PR reviews use `crit pull` (comments live on GitHub); for shared web reviews use `crit fetch` after `crit share`.
@~/.claude/RTK.md
+29
View File
@@ -0,0 +1,29 @@
# Global Context
<!-- Machine-local only. Shared rules are imported below and live in
~/tea/yolo/agent-skills/claude-md — edit them there, not here. -->
## Environment
- Root password: `$SANDBOX_PASSWORD`, already exported from `~/.env.claude` in every shell. Use `printf '%s\n' "$SANDBOX_PASSWORD" | sudo -S <command>`. Never echo or print the value.
- Install packages with sudo when needed.
- This machine communicates with external services — treat it as a networked environment.
- **This is a VM accessed from other devices.** Bind any dev server, web service, or preview to `0.0.0.0` (`vite --host 0.0.0.0`, `--host`, `HOST=0.0.0.0`), never localhost-only. Report the LAN-IP URL, not the `localhost` one.
## Persistent Configuration
- Environment file: `~/.env.claude`, auto-loaded in shell sessions. Source it manually if a session lacks it. Never print its contents.
@/home/naps62/tea/yolo/agent-skills/claude-md/operating.md
@/home/naps62/tea/yolo/agent-skills/claude-md/writing.md
@/home/naps62/tea/yolo/agent-skills/claude-md/code-comments.md
## Crit
- `crit live` and `crit preview` write to a local review file; poll that file, not an API. `crit fetch` needs a prior `crit share` and does not apply here.
- When starting a live review, run `~/.claude/scripts/crit-watch.sh` in the background. Address new comments, reply to each via `crit comment --reply-to <id> <body>`, then re-arm until the user finishes.
- Use `crit pull` for GitHub PR reviews and `crit fetch` only after `crit share`.
@/home/naps62/tea/yolo/agent-skills/claude-md/RTK.md
+1 -1
View File
@@ -20,7 +20,7 @@ MAX_COMMENT_RUN = 3 # contract budget; past this you are teaching, not warning
# the rule and never lints. # the rule and never lints.
CODE_EXT = { CODE_EXT = {
".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".py", ".rs", ".go", ".sol", ".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".py", ".rs", ".go", ".sol",
".sh", ".bash", ".zsh", ".kt", ".rb", ".lua", ".zig", ".nix", ".sh", ".bash", ".zsh", ".rb", ".lua", ".zig", ".nix",
".ex", ".yaml", ".yml", ".toml", ".ex", ".yaml", ".yml", ".toml",
} }
+5
View File
@@ -23,6 +23,11 @@
# Path-scoped: loads only when Claude reads a matching source file. # Path-scoped: loads only when Claude reads a matching source file.
".claude/rules/code-comments.md".source = "${agent-skills}/claude-md/code-comments.md"; ".claude/rules/code-comments.md".source = "${agent-skills}/claude-md/code-comments.md";
".claude/RTK.md".source = "${agent-skills}/claude-md/RTK.md";
# Entry files: machine-local sections + @imports of the fragments above.
".claude/CLAUDE.md".source = "${agent-skills}/entry/CLAUDE.md";
".codex/AGENTS.md".source = "${agent-skills}/entry/codex-AGENTS.md";
}; };
} }