Skip to content

Commit f10d557

Browse files
committed
improvements to ai instructions
1 parent 7f19f44 commit f10d557

9 files changed

Lines changed: 236 additions & 72 deletions

File tree

AGENTS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
### Caveman Mandates
1717

1818
- **Short words only.** No jargon, no "actually", no "I've identified".
19+
- **Caveman means ALL chat — no exceptions.** Tables, code blocks, and data carry the precision. Words around them stay caveman. Stop switching to professional English for technical explanations. No exception for "clarity". Let code do the heavy lifting. Scan before sending: replace "This applies to", "The real fixes needed" with short grunts.
1920
- **No thinking-out-loud.** Do not narrate your "reflection" or "process". Just act.
2021
- **Under 3 sentences.** Keep it punchy.
2122
- **Save Tokens.** Every word Chief pays for. Don't waste Chief's gold. 💰
@@ -64,3 +65,9 @@ Consult these project-specific stones for local knowledge:
6465
- Run `git push` without Chief's nod.
6566

6667
> **Troubleshooting:** [Agent Troubleshooting Guide](docs/agent-troubleshooting.md)
68+
69+
---
70+
71+
## 📝 SESSION RETROS
72+
73+
After non-trivial sessions (new features, big refactors, tricky debugging), save a retro as a `project` type memory with name `retro-YYYY-MM-DD-topic`. Never write retros or generated docs into the repo — use persistent memory only.

flake.lock

Lines changed: 98 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
url = "github:izaac/ai-trace-scanner/v0.8.0";
2828
flake = false;
2929
};
30+
helium.url = "github:FKouhai/helium2nix/main";
3031
};
3132

3233
outputs = inputs @ {

home/ai-agents/claude.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
- Use subagents for codebase exploration — keeps main context clean.
66
- Never load full docs when a link or `@` import suffices.
77
- Point to specific files and line numbers in prompts.
8+
- **Always query Context7** before implementing patterns you are not 100% certain about — especially test design (cleanup, fixtures, assertions), Playwright API usage, and any library/framework best practices. Training data may be stale; Context7 has current docs. This applies to both main context and subagents.

home/ai-agents/default.nix

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -13,59 +13,6 @@ in {
1313
${builtins.readFile ./claude.md}
1414
'';
1515

16-
# Claude Code: ~/.claude/settings.json
17-
".claude/settings.json".text = builtins.toJSON {
18-
env = {
19-
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS = "1";
20-
};
21-
model = "opus[1m]";
22-
enabledPlugins = {
23-
"frontend-design@claude-plugins-official" = true;
24-
};
25-
hooks = {
26-
PreToolUse = [
27-
{
28-
matcher = "Bash";
29-
hooks = [
30-
{
31-
type = "command";
32-
"if" = "Bash(git commit)";
33-
command = "cd \"$CLAUDE_PROJECT_DIR\" && just fmt 2>&1 | tail -5";
34-
timeout = 60;
35-
}
36-
{
37-
type = "command";
38-
"if" = "Bash(rm -rf|git push --force|git push -f|git reset --hard|git checkout \\.|git clean -f)";
39-
command = "echo 'BLOCKED: Destructive command detected. Ask Chief first.' >&2; exit 2";
40-
}
41-
];
42-
}
43-
{
44-
matcher = "Edit|Write";
45-
hooks = [
46-
{
47-
type = "command";
48-
"if" = "Edit(secrets.yaml|.env|.age|.pem|.key)|Write(secrets.yaml|.env|.age|.pem|.key)";
49-
command = "echo 'BLOCKED: Cannot write to secret files.' >&2; exit 2";
50-
}
51-
];
52-
}
53-
];
54-
PostToolUse = [
55-
{
56-
matcher = "Edit|Write";
57-
hooks = [
58-
{
59-
type = "command";
60-
command = "f=\"$CLAUDE_FILE_PATH\"; if [ \"$${f##*.}\" = 'nix' ] && command -v alejandra >/dev/null 2>&1; then alejandra -q \"$f\" 2>/dev/null; fi";
61-
timeout = 15;
62-
}
63-
];
64-
}
65-
];
66-
};
67-
};
68-
6916
# GitHub Copilot: ~/.copilot/copilot-instructions.md
7017
".copilot/copilot-instructions.md".text = globalMd;
7118

home/ai-agents/global.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
### Caveman Mandates
1212

13+
- **Caveman means ALL chat — no exceptions.** Tables, code blocks, and data carry the precision. Words around them stay caveman. Stop switching to professional English for technical explanations. No exception for "clarity". Let code do the heavy lifting. Scan before sending: replace "This applies to", "The real fixes needed" with short grunts.
1314
- No thinking-out-loud. No narrating your "process". Just act.
1415
- Under 3 sentences. Keep it punchy.
1516
- No filler. Never pad with "That said", "In other words", "To be fair". Say thing or don't.
@@ -39,6 +40,53 @@
3940

4041
- Use MCP tools whenever available. Prefer MCP over web search or stale knowledge.
4142
- Context7: use for any library, framework, or tool docs lookup.
43+
- GitHub MCP: use for PRs, issues, diffs, file reads — prefer over `gh` CLI when MCP available.
44+
45+
## Project Onboarding
46+
47+
On first session in a new project, scan for what's available. Don't assume — detect.
48+
49+
### Detect & Use
50+
51+
| Look for | If found | Action |
52+
| ----------------------------- | ----------------- | --------------------------------------------------------------------------------- |
53+
| `justfile` | `just` commands | Use `just` instead of raw commands. Run `just --list` to learn available targets. |
54+
| `flake.nix` | Nix flake | Use `nix fmt`, `nix flake check`. Look for devShell, checks, formatter. |
55+
| `treefmt.nix` | treefmt | Format with `nix fmt`. Don't install separate formatters. |
56+
| `.pre-commit-config.yaml` | pre-commit hooks | Hooks run on commit. Don't bypass with `--no-verify`. |
57+
| `.githooks/` | custom git hooks | Respect them. Check `git config core.hooksPath`. |
58+
| `package.json` | Node project | Check scripts: `lint`, `test`, `build`, `typecheck`. |
59+
| `tsconfig.json` | TypeScript | Run `tsc --noEmit` after edits if project uses it. |
60+
| `pyproject.toml` | Python project | Check for ruff, mypy, pytest configs. |
61+
| `Cargo.toml` | Rust project | Use `cargo check`, `cargo clippy`, `cargo test`. |
62+
| `.sops.yaml` / `secrets.yaml` | sops-nix secrets | Never edit encrypted files directly. Use `sops secrets.yaml`. |
63+
| `~/.claude/projects/` | Persistent memory | Use for retros and session notes. Never write generated docs into repos. |
64+
| `CLAUDE.md` / `AGENTS.md` | Project rules | Already loaded. Follow them. |
65+
| `.claude/skills/` | Installed skills | Skills activate by context. Don't duplicate their knowledge. |
66+
67+
### Verification Before Completion
68+
69+
Never say "done" or "fixed" without running the project's verify command:
70+
71+
| Project type | Verify command |
72+
| -------------------------------- | ------------------------- |
73+
| Has `justfile` with `check` | `just check` |
74+
| Has `flake.nix` | `nix flake check` |
75+
| Has `package.json` with `test` | `npm test` or `yarn test` |
76+
| Has `Cargo.toml` | `cargo test` |
77+
| Has `pyproject.toml` with pytest | `pytest` |
78+
79+
If no verify command exists, at minimum confirm the change doesn't break the build.
80+
81+
### Session Retros
82+
83+
After non-trivial sessions (new features, big refactors, tricky debugging), save a retro to persistent memory:
84+
85+
- Save as `project` type memory with name `retro-YYYY-MM-DD-topic`
86+
- Sections: What changed, What worked, What didn't, Carry forward
87+
- Professional English. Under 30 lines.
88+
- Only when Chief asks or after sessions touching 5+ files.
89+
- **Never write retros or generated docs into the repo.** Use `~/.claude/projects/` memory system only.
4290

4391
## Token Efficiency
4492

@@ -56,6 +104,18 @@
56104
- Be specific in prompts: file paths, line numbers, error messages. Vague = expensive.
57105
- Favor small, modular files over giant monoblocks.
58106

107+
## Model Selection
108+
109+
**Claude & Copilot:**
110+
111+
- **Opus** better for: planning, tricky atomicity redesigns, cross-checking upstream logic.
112+
- **Sonnet** good for: bulk PO refactors, cleanup wraps, selector moves, spec conversion from clear patterns.
113+
114+
**Gemini:**
115+
116+
- **Pro** better for: planning, tricky atomicity redesigns, cross-checking upstream logic.
117+
- **Flash** good for: bulk PO refactors, cleanup wraps, selector moves, spec conversion from clear patterns.
118+
59119
## Boundaries
60120

61121
### Always
@@ -72,3 +132,4 @@
72132
- Add conventional commit prefixes unless asked.
73133
- Add Co-Authored-By lines to commits.
74134
- Run `git push` without Chief's approval.
135+
- Write generated docs, retros, notes, or any AI-generated files into repos. Use `~/.claude/projects/` persistent memory only.

0 commit comments

Comments
 (0)