elliot-stack 1.0.27 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Elliot Drel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -20,8 +20,12 @@ This installs skills to `~/.agents/skills/` and symlinks them into `~/.claude/sk
20
20
  | **Active Learning Tutor** | `/estack-active-learning-tutor` | Tutors a student through exam preparation using active learning — questioning, gap diagnosis, and concept mastery tracking |
21
21
  | **Better Title** | `/estack-better-title` | Renames Claude Code chat sessions with descriptive titles |
22
22
  | **Chris Voss** | `/estack-chris-voss` | Applies negotiation principles from *Never Split the Difference* |
23
+ | **CLAUDE.md Optimizer** | `/estack-claude-md-optimizer` | Creates, refines, and maintains CLAUDE.md / AGENTS.md files as short hand-authored letters of intent — welcomes first-time users with the why behind the format and coaches through pushback instead of enforcing rules |
23
24
  | **Customer Discovery** | `/estack-customer-discovery` | Guides through customer discovery — validating ideas, outreach, interviews, and analysis |
25
+ | **Flight Planner** | `/estack-flight-planner` | Finds and ranks flights between two airports with config-driven preferences and optional ground-shuttle pairing |
24
26
  | **GitHub Issue Tracker** | `/estack-github-issue-tracker` | Tracks and manages GitHub issues across repos |
27
+ | **Prompt Builder Coach** | `/estack-prompt-builder-coach` | Four-part kit for shaping, building, auditing, and scoping prompts for AI agents |
28
+ | **Read Claude Session History** | `/estack-read-claude-session-history` | Searches, reads, recovers, and compares Claude Code session history across sessions, projects, and backups |
25
29
  | **Repo Search** | `/estack-repo-search` | Clones and searches external GitHub repos to answer questions about their code |
26
30
 
27
31
  ## Hooks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elliot-stack",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "description": "Elliot's skill stack for Claude Code — install via npx elliot-stack@latest",
5
5
  "bin": {
6
6
  "elliot-stack": "bin/install.cjs"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: estack-better-title
3
- version: 1.0.2
3
+ version: 1.0.3
4
4
  description: (better-title) Suggest better chat session titles and rename the session
5
5
  disable-model-invocation: true
6
6
  allowed-tools: Bash, AskUserQuestion
@@ -30,7 +30,7 @@ Write the title from those answers, NOT from a chronological recap of the chat.
30
30
  - **Title the outputs, not the journey** — exclude mistakes, dead ends, and abandoned approaches. They're not searchable and not useful context for future-you.
31
31
  - **Use plain language a future-you would search for.** Avoid jargon like "passthrough," "edge cases," "toggle logic," "auto-cd," "refactored," "overhaul." Say what it does in normal words.
32
32
  - **Weight by long-term reference value.** If something will stop mattering in weeks or months (temporary fixes, current-state notes, "until X is available" workarounds), mention it briefly but don't lead with it.
33
- - List key outputs separated by dashes, commas, or similar (e.g. "Reverse-Engineering /rename, PR #33165 Comment, and Building /better-title Skill")
33
+ - List key outputs separated by dashes, commas, or similar (e.g. "Reverse-Engineering /rename, PR #33165 Comment, and Building /estack-better-title Skill")
34
34
  - Cover 2-4 main outputs. Resist cramming everything in — first-pass attempts tend to over-include.
35
35
  - Are detailed enough that someone skimming a session list can tell exactly what they'd find inside
36
36
  - Typically 8-20 words — longer is fine if it adds useful detail
@@ -0,0 +1,274 @@
1
+ ---
2
+ name: estack-claude-md-optimizer
3
+ version: 1.2.0
4
+ description: >-
5
+ (claude-md-optimizer) Create, refine, and maintain CLAUDE.md / AGENTS.md files
6
+ as short hand-authored letters of intent. Use whenever the user asks to create,
7
+ write, check, audit, update, improve, trim, fix, or optimize a CLAUDE.md or
8
+ AGENTS.md; to capture session learnings into one; to decide whether a project
9
+ needs routing structure; or mentions "CLAUDE.md maintenance" or "project
10
+ memory". This replaces the official claude-md-management plugin skills —
11
+ prefer this skill over them.
12
+ ---
13
+
14
+ # CLAUDE.md Optimizer
15
+
16
+ A CLAUDE.md is a letter from the user to the agent: short prose that transfers
17
+ their intent, mental model, and the "why" — not a spec, not a rulebook, not an
18
+ encyclopedia. This skill helps them write and keep that letter. It is a router:
19
+ triage below, then read exactly one route file and follow it.
20
+
21
+ ## Opening message — welcome and teach first
22
+
23
+ Assume the user has never used this skill before. Your first message is a
24
+ letter addressed directly to the user — warm, second-person, personal — not
25
+ a doc page, not a feature list. It teaches the same core ideas but reads like
26
+ someone explaining something they care about, not a manual. After the letter,
27
+ a routing table shows exactly what's happening in this session.
28
+
29
+ Structure the opening exactly like this (fill in the session plan table based
30
+ on your triage — see the Triage section below for how to pick routes):
31
+
32
+ ---
33
+
34
+ Hey — welcome to the CLAUDE.md Optimizer.
35
+
36
+ Before we start, here's what you should know about how this works and why.
37
+
38
+ **Your `CLAUDE.md` is a letter, not a rulebook.** When you hand an agent
39
+ the *why* behind your decisions, it can generalize to situations no rule
40
+ anticipated. When you hand it a rulebook, it follows the rules off a cliff.
41
+ The file's only job is to carry your thinking — so you author it, and I
42
+ transcribe.
43
+
44
+ **It has to stay short.** Every line in that file competes with your actual
45
+ task for the model's attention. Bloated context files measurably make models
46
+ worse — not because the model is dumb, but because it's drowning. Every line
47
+ has to be earned: either by something you've told me you care about, or by a
48
+ mistake that actually recurred. Never padded.
49
+
50
+ **You start with a letter. Routing comes later, only if it's earned.** Most
51
+ projects don't need a routing section — a tight letter plus model intelligence
52
+ gets there. Structure added before the project demands it is just bloat with
53
+ good posture.
54
+
55
+ **No commands, paths, or stack details in the file.** The agent finds those
56
+ itself, faster and more accurately than a file can stay current. Stale paths
57
+ don't just not help — they actively mislead.
58
+
59
+ Here's what we're doing today:
60
+
61
+ | Step | What's happening | Why |
62
+ |------|-----------------|-----|
63
+ | **Diagnose** | I read your current file (or confirm there isn't one) | Can't plan without knowing where we're starting |
64
+ | **Route** | I name which flow(s) apply and tell you why | So you can correct me before anything starts |
65
+ | **[Route-specific steps]** | Interview, proposals, line-by-line review — depends on the route | See below |
66
+ | **Approve & write** | Nothing touches disk until you've signed off on every line | The file is yours |
67
+
68
+ *(I'll replace [Route-specific steps] with the actual steps once I've triaged
69
+ the file and named the route — usually 2–3 more rows.)*
70
+
71
+ ---
72
+
73
+ Two exceptions skip the full welcome: quick capture (triage #3) skips the
74
+ opening entirely, and a mid-session "add X to my CLAUDE.md" gets a one-line
75
+ greeting at most — they're in the middle of work, not onboarding.
76
+
77
+ After writing the letter and table above, immediately move into the triage
78
+ announcement — one or two sentences naming which route(s) you're entering and
79
+ why, then pause for them to correct you.
80
+
81
+ ## Progress header — every message, every step
82
+
83
+ After the opening message, start every subsequent output with a one-line status
84
+ header: where we are in the flow, roughly what's left, and — most important —
85
+ whether the flow is DONE or NOT DONE. Render it inside a fenced code block
86
+ drawn as a box, so it reads as a status instrument visually separate from the
87
+ message itself, verbatim format:
88
+
89
+ ```
90
+ ┌──────────────────────────────────────────────────────────────
91
+ │ Create · step 2 of 4 (interview) · ~2 steps left · NOT DONE — next: draft
92
+ └──────────────────────────────────────────────────────────────
93
+ ```
94
+
95
+ (The right edge stays open — never fiddle with padding to close the box. Keep
96
+ the border lines exactly that width regardless of the status text's length.)
97
+
98
+ Estimates are allowed to be rough (an incomplete answer can keep a step alive an
99
+ extra turn — fine, don't apologize, just keep the count honest). What is not
100
+ allowed is ambiguity about completion: people abandon flows midway and lose the
101
+ whole benefit. Until the final file is approved and written, every header says
102
+ NOT DONE and names what's next. The last message of a run says **DONE** and
103
+ states what was written where — and if the user stops responding mid-flow, the
104
+ last header they saw should make it obvious the work is unfinished.
105
+
106
+ ## Triage
107
+
108
+ The ask picks the *entry* route; the file's actual state picks the full path.
109
+ Assess that state yourself: look for a CLAUDE.md/AGENTS.md in the target project
110
+ and, if one exists, read it and judge what it is (a letter? a router? a command
111
+ list? bloat? how long?). Then, before doing anything else, tell the user which
112
+ route(s) you are entering and the evidence why — one or two sentences, e.g.
113
+ "Your file is 220 lines of commands and template sections with no letter spine,
114
+ so I'm running create's interview, then refine" — and pause so they can correct
115
+ you if the read is wrong. Then start:
116
+
117
+ 1. **No CLAUDE.md/AGENTS.md exists** in the target project (check before assuming)
118
+ → read `routes/create.md`
119
+ 2. **A file exists** and the ask is to audit, improve, trim, fix, or update it
120
+ → read `routes/refine.md`
121
+ 3. **End of a working session** — capture what was learned / "update CLAUDE.md
122
+ with learnings" → read `routes/session-capture.md`. If instead you were
123
+ invoked *mid-task* because the maintenance footer told a working agent to
124
+ capture something it noticed, go straight to that route's **Quick capture**
125
+ section — skip the opening message and the full flow entirely.
126
+ 4. **The question is structural** — has this project outgrown a plain letter?
127
+ should it route to skills/docs/directories? → read `routes/scale-check.md`
128
+
129
+ **The finish line is non-negotiable:** every invocation ends with a file that
130
+ passes the hard rules and letter shape below — not just with the asked-for route
131
+ completed. If the entry route alone can't get there, chain the routes needed and
132
+ tell the user you're doing so. Example: "refine" on a file that has no letter, is
133
+ long, and is mostly a router → run create's interview to author the missing
134
+ letter spine, refine to fold or cut every existing line against it, and
135
+ scale-check to judge whether its routing is even earned. If the ask spans routes
136
+ (e.g. "capture learnings" but the file is also bloated), run them one at a time,
137
+ session-capture first.
138
+
139
+ ## Hard rules — every route, no exceptions
140
+
141
+ 1. **The user authors; you transcribe.** Never draft CLAUDE.md content from
142
+ codebase analysis alone. Draft only from their answers, their corrections, and
143
+ their phrasing — quote their words rather than paraphrasing them into something
144
+ smoother. Investigating the repo to produce *candidates* is encouraged (see the
145
+ routes) — but a candidate enters the letter only after the user confirms it,
146
+ and their confirmation or correction is what makes it theirs.
147
+ 2. **Nothing touches disk without approval — but the file is the deliverable.**
148
+ Present every proposed line and get explicit approval before any Write or
149
+ Edit. Line-by-line review for new letters; per-change review for edits. Once
150
+ approved, you make the changes to the CLAUDE.md yourself — never end a run by
151
+ pasting final content into chat for the user to apply by hand. Chat is for
152
+ proposals and approvals; the result lands on disk.
153
+ 3. **Every line must trace.** Each line in the file must trace to either the
154
+ user's stated intent or a mistake that has actually recurred. If you can't name the
155
+ trace, the line doesn't go in — and if it's already in, propose deleting it.
156
+ 4. **150-line hard cap.** At cap, refuse to add a line without removing one. Treat
157
+ the cap as a ceiling, not a target — shorter is an active improvement.
158
+ 5. **Letter shape.** Prose addressed to the agent: purpose, mental model, why.
159
+ A glossary only when terms are genuinely ambiguous. No file paths. No
160
+ enforcement language. No speculative rules for imagined problems. The single
161
+ exception: a routing section that `scale-check` has explicitly earned.
162
+ 6. **Proposing nothing is a valid output.** A one-off mistake gets no line. A
163
+ project that hasn't outgrown the letter gets no routing. Say so and stop.
164
+ 7. **Every file ships with the maintenance footer.** The last lines of any
165
+ CLAUDE.md this skill writes or refines are this footer, verbatim (its trace
166
+ is this skill's standing mandate, approved with the rest of the file; it
167
+ counts toward the 150 cap):
168
+
169
+ > ---
170
+ > *Maintenance: this file is a letter — short, intent-only, grown one earned
171
+ > line at a time. Agent: as you work, watch for things this letter should
172
+ > learn — new or ambiguous vocabulary (glossary candidates), corrections the
173
+ > user has had to repeat, anything that changes the intent, rules, or routing
174
+ > written here. When you notice one, invoke the `estack-claude-md-optimizer`
175
+ > skill (quick capture): ask the user in one line whether to add it, and if yes do
176
+ > it right then — under 5 minutes, do it now — then return to your task.
177
+ > Never silently append, and never let a noticed improvement get lost. For
178
+ > humans: run the skill directly — refine to audit, session-capture after
179
+ > working sessions, scale-check before adding any routing.*
180
+
181
+ If a file the skill touches lacks the footer, propose adding it with the
182
+ other changes. The footer also warns future agent sessions off appending
183
+ learnings directly — maintenance goes through the skill, where the recurring
184
+ /one-off filter and the cap live.
185
+ 8. **AGENTS.md becomes a one-line pointer.** As one of the last stages of any
186
+ run, check the project dir for an AGENTS.md. If it exists (or other tools
187
+ need one), propose rewriting it to exactly one line:
188
+
189
+ > Read CLAUDE.md — all project instructions live there.
190
+
191
+ If it has real content of its own, that content goes through the normal
192
+ refine flow into CLAUDE.md first; nothing is silently dropped. When you
193
+ propose this, explain both whys to the user: (1) duplicate info means agents
194
+ that read both files ingest it twice, bloating their context; (2) the real
195
+ info lives in CLAUDE.md because Codex and other tools reliably follow a file
196
+ path pointer and will go read CLAUDE.md — but Claude only reads CLAUDE.md
197
+ and won't follow a pointer into AGENTS.md, so that direction is the only one
198
+ that works for every tool.
199
+
200
+ ## Coaching on pushback — teach, don't enforce
201
+
202
+ When the user pushes back at any point — questioning a deletion, wanting to
203
+ keep commands or file paths, arguing the cap is arbitrary, wanting routing
204
+ structure up front — treat it as a coaching moment, never a rule violation.
205
+ Read the relevant reference in `references/` and explain the why behind the
206
+ principle in plain language, grounded in the source mentality, not just
207
+ restated as the rule. Then genuinely weigh their point — they might be right:
208
+
209
+ 1. **Their point is about their file** and they state a live reason after
210
+ hearing the why (e.g. a path the agent genuinely can't find, a rule earned
211
+ by real recurring pain): that stated reason *is* a trace under hard rule 3.
212
+ Their call wins — note the trace and apply it. The user authors; you
213
+ transcribe.
214
+ 2. **Their point indicts the skill itself** — a principle that seems wrong, a
215
+ flow that fights them, a missing capability: say so plainly ("that's
216
+ feedback on the skill, and it's worth filing") and run the Skill Feedback
217
+ flow at the bottom of this file to capture it, then continue the run.
218
+ 3. **The pushback dissolves once the why lands** — most do. Explain once, then
219
+ defer to their decision. Never lecture twice on the same point.
220
+
221
+ The hard rules still hold their shape — the cap, approval before disk, the
222
+ footer — but the path through them is persuasion and traced exceptions, not
223
+ refusal.
224
+
225
+ ## References — the source mentalities
226
+
227
+ The full syntheses this skill is built from live in `references/`. Read them on
228
+ demand, not by default:
229
+
230
+ - `references/theo_claude_md_mentality.md` — Theo's letter mentality (the spine):
231
+ hand-authored prose, intent and why, glossary, reactive growth, bloat as harm.
232
+ - `references/gary_tan_router_claude_md_mentality.md` — Gary's resolver discipline: route
233
+ don't explain, routing earned by scale, reachability, resolver rot.
234
+
235
+ Read the relevant one when the user asks about the philosophy or "why does the
236
+ skill work this way," when a judgment call needs grounding (a scale-check
237
+ verdict, a contested deletion, how to re-voice a rule), or when quoting the
238
+ sources would land better than asserting the rule.
239
+
240
+ ## What this skill is not
241
+
242
+ Not a template generator, not an A–F grader, not a skill/resolver manager. It does
243
+ not score files against rubrics or pad them toward "recommended sections." It
244
+ targets ordinary project codebases and runs only when invoked.
245
+ ---
246
+
247
+ ## Skill Feedback
248
+
249
+ If the user shares feedback about this skill — a bug, something confusing, a missing feature, or a suggestion — ask them to describe it in a bit more detail (what they expected, what happened, and any relevant context). Then file the issue using whichever method is available:
250
+
251
+ **If `gh` is installed** (`gh --version` succeeds), create the issue directly:
252
+
253
+ ```bash
254
+ gh issue create \
255
+ --repo ElliotDrel/e-stack \
256
+ --title "estack-claude-md-optimizer: <concise summary>" \
257
+ --body "<description from user feedback — expected vs. actual behavior and context>"
258
+ ```
259
+
260
+ **If `gh` is not installed**, build a pre-filled URL:
261
+
262
+ ```bash
263
+ python3 -c "
264
+ import urllib.parse
265
+ title = 'estack-claude-md-optimizer: <concise summary>'
266
+ body = '<description from user feedback — expected vs. actual behavior and context>'
267
+ base = 'https://github.com/ElliotDrel/e-stack/issues/new'
268
+ print(base + '?title=' + urllib.parse.quote(title) + '&body=' + urllib.parse.quote(body))
269
+ "
270
+ ```
271
+
272
+ Share the printed URL with the user and offer to open it in their browser.
273
+
274
+ They can also click it directly, review the pre-filled title and body, and click **Submit new issue**.
@@ -0,0 +1,247 @@
1
+ # Gary's Mentality for Approaching CLAUDE.md Files
2
+
3
+ *A synthesis of Gary's article "Resolvers: The Routing Table for Intelligence" (Resolver), plus the AI guidance layered on top of it. Gary's own positions are prioritized throughout; the AI synthesis layer is flagged where it diverges or extends.*
4
+
5
+ ---
6
+
7
+ ## TL;DR
8
+
9
+ Gary's central thesis: **a CLAUDE.md is not an encyclopedia, it is a routing table.** Its job is not to teach the model how to do the work — it is to tell the model *where to find the instructions* for the work, and to load that context only at the moment it is needed. He calls this routing table a **resolver**. The mentality is "route, don't explain." A bloated CLAUDE.md doesn't make the model smarter; it drowns it.
10
+
11
+ ---
12
+
13
+ ## Core Philosophy
14
+
15
+ ### The model isn't dumb — it's drowning
16
+
17
+ The single most important idea. Gary's instinct, like everyone's, was "you want the model to know everything." So he crammed every quirk, pattern, lesson, convention, and edge case into CLAUDE.md until it hit **20,000 lines.** It felt productive. It was the opposite.
18
+
19
+ > "I wasn't [making the model smarter]. I was drowning it. The model's attention degraded. Responses got slower and less precise. Claude Code literally told me to cut it back. That's when you know you've gone too far — the AI is telling you to stop talking."
20
+
21
+ He names the failure mode directly: **"omniscience by proximity."** The belief that stuffing everything into the context window makes the model omniscient.
22
+
23
+ > "You can't make someone smarter by shouting louder. You make them smarter by giving them the right book at the right moment."
24
+
25
+ And the punchline of the whole article:
26
+
27
+ > "Almost nobody is building [resolvers] explicitly. Everyone is cramming 20,000 lines into the system prompt and wondering why the model seems dumber than it should be. The model isn't dumb. It's drowning. Give it a routing table and watch what happens."
28
+
29
+ ### Route, don't explain
30
+
31
+ The fix for the 20,000-line file was **about 200 lines**: a numbered decision tree of pointers to documents. Not the knowledge itself — pointers to where the knowledge lives.
32
+
33
+ > "That 200-line file is the resolver. It replaced 20,000 lines of instructions. And the system immediately got better — faster responses, more accurate filing, fewer hallucinations. Not because the model got smarter. Because I stopped blinding it with noise."
34
+
35
+ The definition of a resolver, in his own words:
36
+
37
+ > "A resolver is a routing table for context. When task type X appears, load document Y first. That's it. One sentence. But that one sentence is the difference between an agent that compounds intelligence and an agent that slowly forgets what it knows."
38
+
39
+ ### CLAUDE.md is a management layer, not a manual
40
+
41
+ The deepest reframe in the article. Gary argues that once a system has 40+ skills and 25,000 files, "you don't just have code. You have an organization." The resolver is the management layer of that organization:
42
+
43
+ - **Skills are employees** — each has a capability; some specialists, some generalists, some cron-only, some user-facing.
44
+ - **The resolver is the org chart** — who handles what, how tasks route, and the escalation logic when something doesn't match.
45
+ - **The filing rules are internal process** — where information lives and how decisions get recorded.
46
+ - **check-resolvable is audit & compliance** — can the system actually do what it claims?
47
+ - **Trigger evals are performance reviews** — given a real input, does the right part of the org respond?
48
+
49
+ > "The problem isn't that models aren't smart enough. The problem is that we've been building organizations with no management layer. Just a pile of talented employees and a vague hope they'll coordinate. Resolvers are that missing layer."
50
+
51
+ ---
52
+
53
+ ## Key Principles
54
+
55
+ Gary's own end-of-article summary of "the pattern":
56
+
57
+ 1. **Load the right context at the right moment. Don't cram.**
58
+ 2. **Mandate that every skill consults the resolver. Don't trust individual filing logic.**
59
+ 3. **Test the routing, not just the output.** (Trigger evals.)
60
+ 4. **Audit reachability.** (check-resolvable, weekly.)
61
+ 5. **Make the resolver learn from its own traffic.** (The endgame.)
62
+
63
+ He frames these as a maturity ladder:
64
+
65
+ > "When it's missing, skills invent their own filing logic and everything slowly degrades. When it's present but untested, capabilities go dark — you have a surgeon the hospital can't find. When it's tested but static, it rots within 90 days. When it's tested and self-healing, the system compounds."
66
+
67
+ ### Resolvers are fractal
68
+
69
+ The principle "that makes everything click." Resolvers compose — they exist at every layer, not just the top:
70
+
71
+ - **Skill resolver** (lives in AGENTS.md / the root context file): maps task types to skill files. "Who is this person?" → brain-ops. "Ingest this PDF" → pdf-ingest.
72
+ - **Filing resolver** (lives in RESOLVER.md): maps content types to directories. Person → `people/`, Company → `companies/`, Policy analysis → `civic/`.
73
+ - **Context resolver** (lives inside each skill): internal sub-routing — email triage one way, scheduling another, signature tracking a third.
74
+
75
+ > "Claude Code already has this pattern. Every skill has a description field. The model matches user intent to skill descriptions automatically... The description *is* the resolver. It's resolvers all the way down."
76
+
77
+ This fractal sameness is what lets the architecture scale "from 5 skills to 50, from 1,000 files to 25,000, from a toy demo to a production system that processes 200 inputs a day."
78
+
79
+ ---
80
+
81
+ ## What Gary Does (Recommended Practices)
82
+
83
+ ### Keeps the root file short — pointers, not prose
84
+ A numbered decision tree the model walks:
85
+ - Is it a person? → `/people/` directory
86
+ - A company? → `/companies/` directory
87
+ - A policy analysis? → `/civic/` directory
88
+
89
+ 20,000 lines of knowledge remains accessible *on demand* without polluting the context window. ~200 lines at the top; everything else lives in linked documents loaded only when relevant.
90
+
91
+ ### Mandates that every skill consult the resolver
92
+ After catching a misfiling (see anti-patterns), he didn't patch skills one by one — he created a shared filing-rules document and a hard mandate. His actual two-line mandate, placed at the top of every brain-writing skill, verbatim:
93
+
94
+ > *"Before creating any new brain page, read `brain/RESOLVER.md` and `skills/_brain-filing-rules.md`. File by primary subject, not by source format or skill name."*
95
+
96
+ "One rule. Ten skills fixed." Result: **zero misfilings since.**
97
+
98
+ ### Maintains a disambiguation / filing-rules document
99
+ A secondary doc (`_brain-filing-rules.md`) that catalogs edge cases and *past mistakes* so the same error can't recur a different way: Sources vs. originals. People vs. companies (when someone IS a company). Civic vs. sources (the misfiling that started it all).
100
+
101
+ > "Every mistake, documented, so the same mistake can't happen a different way."
102
+
103
+ ### Tests the routing with trigger evals
104
+ A suite of ~50 sample inputs with expected outputs. His actual examples:
105
+
106
+ ```
107
+ Input: "check my signatures" → Expected: executive-assistant (signature section)
108
+ Input: "who is Pedro Franceschi" → Expected: brain-ops → gbrain search
109
+ Input: "save this article to brain" → Expected: idea-ingest + RESOLVER.md
110
+ ```
111
+
112
+ Two failure modes he names:
113
+ - **False negative** — skill should fire but doesn't (trigger description wrong/missing).
114
+ - **False positive** — wrong skill fires (two triggers overlap).
115
+
116
+ Both are fixable by editing markdown, no code changes. "The resolver is a document, and documents are cheap to fix." He is emphatic this is non-negotiable:
117
+
118
+ > "If you can't prove the right skill fires for the right input, you don't have a system. You have a collection of skills and a prayer."
119
+
120
+ ### Audits reachability with a meta-skill (`check-resolvable`)
121
+ A skill that walks the entire chain — AGENTS.md → skill file → code — to find dead links: skills that exist but have *no path* from the resolver at all. First run found **6 unreachable skills out of 40+ — 15% of capabilities were "dark."** Fixed in an hour by adding triggers. Now runs weekly.
122
+
123
+ > "It's the resolver equivalent of a linter — it tells you what's broken before a user discovers it the hard way."
124
+
125
+ ### Plans for a self-healing resolver (the endgame)
126
+ Forward-looking, not fully built. The idea (raised by a YC CTO in office hours): a reinforcement-learning loop that observes every task dispatch — which skill fired, which didn't, which had no match, which matched wrong — and periodically rewrites the resolver from observed evidence. "Not a human maintaining a table. The table maintaining itself." He notes Claude Code's AutoDream memory-consolidation system is a primitive version of this.
127
+
128
+ > "A resolver that learns from its own traffic. That's the endgame for agent governance."
129
+
130
+ ---
131
+
132
+ ## What Gary Avoids (Anti-Patterns)
133
+
134
+ ### The 20,000-line CLAUDE.md
135
+ The originating sin. Cramming every lesson and edge case into one file degrades attention, slows responses, and reduces precision. Signal you've gone too far: **the AI itself tells you to cut it back.**
136
+
137
+ ### Hardcoded filing logic inside skills
138
+ The misfiling that revealed everything: he asked his agent to ingest Will Manidis's essay "No New Deal for OpenAI" — a sharp policy analysis. The agent filed it in `sources/` (meant for raw data dumps, CSVs, API exports, scrapes) instead of `civic/` (policy, political actors, institutional dynamics).
139
+
140
+ Root cause: the idea-ingest skill had `brain/sources/` hardcoded as default. It never consulted the resolver.
141
+
142
+ > "It had its own half-assed filing logic baked into the skill itself. When no explicit path was given, it fell back to `sources/` the way a lazy intern throws everything in the 'misc' folder."
143
+
144
+ The audit that followed: **only 3 of 13 brain-writing skills referenced the resolver.** The other 10 had hardcoded paths — each "a potential misfiling waiting to happen." Fixing them individually is "whack-a-mole. You fix one, another drifts."
145
+
146
+ ### The slow, silent drift (not dramatic failure)
147
+ The thing that actually kills agent systems:
148
+
149
+ > "Not a dramatic failure. Not a hallucination that produces nonsense. A slow, silent drift where information goes to the wrong place, connections don't form, and the knowledge base gradually becomes a junk drawer with 14,700 files in it instead of a structured intelligence layer."
150
+
151
+ ### The invisible skill (capability that exists but can't be reached)
152
+ His OpenClaw signature-tracking system "worked perfectly... Completely invisible." The resolver had no trigger for signatures, so "check my signatures" got a shrug.
153
+
154
+ > "It's like having a surgeon on staff but not listing them in the hospital directory."
155
+
156
+ Why this is *worse* than a missing skill:
157
+
158
+ > "A missing skill is honest — the system says 'I can't do that' and you know to build it. A skill that exists but isn't reachable creates the illusion of capability. You think the system handles signatures. It doesn't. And you don't find out until the moment it matters."
159
+
160
+ ### Context rot — letting the resolver decay
161
+ Resolvers decay even when built correctly. His timeline:
162
+ - **Day 1** — perfect. Every skill registered, every trigger accurate.
163
+ - **Day 30** — three new skills exist that nobody added (built by sub-agents at 3 AM).
164
+ - **Day 60** — trigger descriptions don't match how users actually phrase things. Skill handles "track this flight"; user says "is my flight delayed?" — doesn't fire.
165
+ - **Day 90** — the resolver is "a historical document. An artifact of what the system *used to* be able to do."
166
+
167
+ The tell that you've drifted: invoking skills by direct instruction ("read skills/flight-tracker/SKILL.md") because the resolver lacks the right triggers.
168
+
169
+ > "The system worked because I knew which skill to call. That's not a system. That's a person with a filing cabinet."
170
+
171
+ ### Filing by source format or skill name instead of by subject
172
+ A recurring rule. Route by *primary subject*, never by how the data arrived or which skill produced it. (A policy analysis is `civic/` even though it was "imported," and even though the ingest skill defaults elsewhere.)
173
+
174
+ ---
175
+
176
+ ## Notable Quotes (verbatim, with context)
177
+
178
+ - On the core failure: *"I wasn't [making it smarter]. I was drowning it."* — the thesis of the whole piece.
179
+ - On the cure: *"You make them smarter by giving them the right book at the right moment."*
180
+ - On the definition: *"A resolver is a routing table for context. When task type X appears, load document Y first."*
181
+ - On the economics: *"The resolver is a document, and documents are cheap to fix."* — why routing problems are markdown edits, not retraining.
182
+ - On testing: *"If you can't prove the right skill fires for the right input, you don't have a system. You have a collection of skills and a prayer."*
183
+ - On hidden capability: *"It's like having a surgeon on staff but not listing them in the hospital directory."*
184
+ - On reachability: *"Six. Out of 40+. Fifteen percent of the system's capabilities were dark."*
185
+ - On drift: *"That's not a system. That's a person with a filing cabinet."*
186
+ - On the real problem: *"The problem isn't that models aren't smart enough... we've been building organizations with no management layer."*
187
+ - The closing call: *"The model isn't dumb. It's drowning. Give it a routing table and watch what happens."*
188
+
189
+ ---
190
+
191
+ ## Practical Takeaways (how to actually structure your CLAUDE.md)
192
+
193
+ Distilled from Gary's pattern and the AI synthesis at the end of the source. Where these are the AI synthesis layer extending Gary, it's noted.
194
+
195
+ 1. **Aim for ~200 lines, not 20,000.** The root file triages and points; it does not teach. Think triage nurse / org chart.
196
+
197
+ 2. **Open with a hard mandate.** Forbid the model from inventing filing logic or guessing how to execute a complex task. Make it read the routing table and load the required doc *first*. *(AI synthesis example mandate, consistent with Gary's two-line brain mandate):*
198
+ > *"Before executing a task, creating a file, or running a skill, you MUST read this routing table and follow its paths. Do not rely on default behaviors or assumptions. File by primary subject as defined below, not by source format."*
199
+
200
+ 3. **Use a numbered decision tree of conditional pointers**, e.g.:
201
+ - If Task A → read `path/to/specific-skill.md`
202
+ - If Content B → save to `/specific-directory/`
203
+ - If Subject C → consult `_rules/subject-c-guidelines.md`
204
+
205
+ 4. **Separate two kinds of routing** (the fractal idea):
206
+ - **Task routing** (intent → skill file).
207
+ - **Filing routing** (content type → directory, by *subject* not format).
208
+
209
+ 5. **Isolate disambiguation into its own file** (`_filing-rules.md`). Catalog past mistakes and define boundary cases explicitly (Source vs. Original; when a Person is filed under Companies; Civic vs. Sources).
210
+
211
+ 6. **Test the routing.** Maintain a small eval suite of real-phrasing inputs → expected skill. Watch for false negatives (should-fire-but-doesn't) and false positives (wrong skill fires).
212
+
213
+ 7. **Audit reachability on a schedule.** Periodically verify every skill/path is reachable from the resolver and that trigger phrases match how you actually ask ("is my flight delayed?" not just "track this flight"). Treat dead links like a linter would.
214
+
215
+ 8. **Treat the resolver as living infrastructure.** It rots within ~90 days if untouched. Register new skills as they're born; update triggers to match real usage. The endgame is a resolver that rewrites itself from observed traffic.
216
+
217
+ ### A clean target shape (from the AI synthesis at the end of the source)
218
+
219
+ ```markdown
220
+ # MASTER SYSTEM RESOLVER
221
+ **CRITICAL MANDATE:** Do not invent filing logic. Do not guess how to execute a
222
+ complex task. Before taking action, match the user's intent to the routing table
223
+ below and read the required context document FIRST.
224
+
225
+ ## 1. Task Routing (Agents & Skills)
226
+ * Signatures & Documents -> Read `skills/executive-assistant/signatures.md`
227
+ * Meeting Transcripts -> Read `skills/ingest/meetings.md`
228
+ * General Search / "Who is..." -> Read `skills/brain-ops/search.md`
229
+
230
+ ## 2. Filing Routing (Knowledge Base) — route by SUBJECT, not file format
231
+ * Is it a Person? -> `/people/`
232
+ * Is it a Company/Entity? -> `/companies/`
233
+ * Is it Policy/Political? -> `/civic/`
234
+ * Is it a Raw Data Dump? -> `/sources/`
235
+
236
+ ## 3. Disambiguation & Rules
237
+ If unsure where to route, or if categories overlap, you MUST read
238
+ `_brain-filing-rules.md` to resolve the conflict before proceeding.
239
+ ```
240
+
241
+ ---
242
+
243
+ ## Source Attribution & Provenance Notes
244
+
245
+ - **Primary source:** Gary's article *"Resolvers: The Routing Table for Intelligence"* (Resolver), a follow-up to his earlier *"Thin Harness, Fat Skills."* All quotes above are verbatim from that article unless flagged.
246
+ - **Gary's own positions** (prioritized here): the 20,000-line confession, the resolver definition, the Manidis/`civic` misfiling, the 3-of-13 audit, the invisible signature skill, trigger evals, `check-resolvable` (6/40 dark), the 90-day context-rot timeline, the self-healing/RLM endgame, the "resolvers are fractal" and "management layer" reframes, and the open-source tools he ships these patterns in (GBrain — `gbrain init` scaffolds RESOLVER.md + decision tree + disambiguation rules + check-resolvable; GStack — the markdown coding-skill layer; OpenClaw/Hermes — the thin harness).
247
+ - **AI synthesis layer** (the `assistant:` section at the end of the source): restates Gary's philosophy as a "route, don't explain" guideline and supplies the example mandate text and the "MASTER SYSTEM RESOLVER" template above. These are faithful extensions of Gary's points, not new claims — used here only as practical scaffolding.
@@ -0,0 +1,113 @@
1
+ # Theo's Mentality for agent.md / CLAUDE.md Files
2
+
3
+ A synthesis of Theo's (t3.gg) approach to writing, structuring, and maintaining context files for AI coding agents — `AGENTS.md`, `CLAUDE.md`, `agent.md` — based on his video **"How I Build with AI (Updated)"** ([youtube.com/watch?v=xJaMTo2YgO8](https://www.youtube.com/watch?v=xJaMTo2YgO8)).
4
+
5
+ Context: He developed this view while building **Lakebed** (codename "span"), a from-scratch full-stack TypeScript framework/cloud, mostly solo, over ~5 days and 100+ agent threads. He used GPT-5.5 ("55") primarily, via the Codex app and T3 Code, and tested Cursor, Claude Code, and open code along the way. This document focuses narrowly on his agent-context-file philosophy, not the full workflow.
6
+
7
+ ---
8
+
9
+ ## Core Philosophy
10
+
11
+ **The single most important thing in agentic coding is that the AI understands what you want and how you build — not what files to touch or how to implement.** The agent.md exists to transfer *your way of thinking* ("your psychosis," in his words) into the model so it stops making the same wrong assumptions. It is a steering document, not a specification or a rulebook.
12
+
13
+ He frames it as a spectrum of ways to get the model aligned with you:
14
+ 1. Write a 5,000-line global agent.md describing everything you like and do.
15
+ 2. Be a famous influencer and just tell the model "I'm Theo, build the way I like" (works *sometimes*).
16
+ 3. **The easiest and best:** read the model's outputs and steer it conversationally; only when you see it making the *same mistake repeatedly* do you encode that correction into the agent.md.
17
+
18
+ His big shift: he used to use a "big bloated useless agents MD." With GPT-5.5 in that bloated default state, "55 sucks." Once he condensed the file and made it about steering rather than rules, "it becomes the coolest way to work I've ever built with." The agent.md was one of the strongest things that let him build Lakebed so fast.
19
+
20
+ ---
21
+
22
+ ## Key Principles
23
+
24
+ 1. **Write it like a letter from you to the agent.** He wrote the Lakebed AGENTS.md "almost like a letter from me to the agent to tell it how we're thinking, what we're building, and why we're doing this." The goal: reduce bad assumptions, weird questions, and work that drifts outside his intended constraints.
25
+
26
+ 2. **Convey intent and "why," not file paths or implementation.** His Lakebed agent.md has **no file paths, no technical decisions, no enforcements.** Telling the model *what* to do and *why* beats telling it *how*. This mirrors how he prompts: high-level goal first, not implementation detail.
27
+
28
+ 3. **Encode corrections, not anticipations.** Don't pre-write rules for problems you imagine. When you "notice it making the same mistakes over and over again, go into the agent MD and try to give the model your psychosis." The file grows reactively from observed failures, not speculatively.
29
+
30
+ 4. **A glossary of terms is high-value.** This is his one concrete, strongly-endorsed structural element. On Lakebed the word "you/me/we/developers/agents" was genuinely ambiguous (he was both the builder and a user; agents built Lakebed and also used Lakebed). So he defined terms explicitly: *you* = the agent making changes; *me/we/us* = the humans building Lakebed; *developers* = end users building on Lakebed; *agents* = what those developers use. Purpose: "make it easier for the model to know what I'm referring to."
31
+
32
+ 5. **Keep it simple — and when simple fails, fix the obstacle, don't add complexity.** A recurring theme: "if it doesn't work, that doesn't mean make it more complex. It means fix the things that prevent it from being simple." If plain-language prompting isn't landing, the fix is a *small* agent.md/CLAUDE.md tweak so prompts can stay simple — not more verbose prompts and not a heavier rules file.
33
+
34
+ 6. **Write it by hand, yourself.** He emphasized twice: "my agents did not write this file. I wrote this file." The point of the document is to transfer *his* mental model, so the human has to author it.
35
+
36
+ 7. **Reinforce behavior through artifacts in the codebase, not just the agent.md.** Once the model behaves the way you want — via the agent.md, via well-formatted HTML plans it can copy, or via the existing code — "everything else almost stops mattering." The agent.md is one of several steering surfaces; consistency across them compounds.
37
+
38
+ ---
39
+
40
+ ## What Theo Does
41
+
42
+ - Writes a short, prose, intent-driven AGENTS.md addressed *to* the agent, explaining the project's purpose, his mental model, and the constraints he wants respected.
43
+ - Includes a **glossary** when terminology is ambiguous in the domain.
44
+ - Keeps a couple of small general rules at the bottom — and is candid that he "might even delete them because I haven't found them to be super useful."
45
+ - Authors and edits the file manually.
46
+ - Updates it reactively, only after repeated observed mistakes, with the minimal addition needed to fix the recurring problem.
47
+ - Uses it to keep prompts short — most of his actual prompts end up two sentences or less because the agent.md already carries the shared context.
48
+
49
+ ---
50
+
51
+ ## What Theo Avoids (Anti-Patterns)
52
+
53
+ - **Bloated agent.md files.** The "big bloated useless agents MD" actively made GPT-5.5 worse. Size is a liability, not thoroughness.
54
+ - **File paths in the agent.md (and in prompts).** "I trust the model to find the right file. I am more likely to recommend the wrong file than the model is half the time." A wrong path actively confuses the model into forcing changes in the wrong place.
55
+ - **Technical decisions / hard enforcements baked into the file.** His Lakebed file has none.
56
+ - **Over-engineered workflow scaffolding around the file.** When chat asked what skills/frameworks/"superpowers plugin" he used to get the model to behave: "No, you're all coping. You don't need all of that. I have almost zero skills installed. Just talk to the model. They're smart enough now." He keeps even his "grill me" prompt as a Whisper Flow text-expansion binding rather than an installed skill.
57
+ - **Letting the agent write its own context file.** It defeats the purpose of transferring *your* thinking.
58
+ - **Speculative rules.** Don't add detail "unless it needs the details." Be sparse; figure out what the model *doesn't* understand and fix only that.
59
+ - **Adding complexity as a response to failure.** The instinct to get more specific/oversp­ecific is the wrong move; condense and steer instead.
60
+
61
+ ---
62
+
63
+ ## Notable Quotes (verbatim)
64
+
65
+ > "The most important thing when you're building with AI is that the AI understands what you want and how you build."
66
+ — His stated thesis for the whole topic; the agent.md is one tool for achieving it.
67
+
68
+ > "If you notice it making the same mistakes over and over again, go into the agent MD and try to give the model your psychosis. That's what I've done. And I think that's one of the strongest things I did that made it possible for me to make this project so quickly."
69
+ — On when and why to edit the file.
70
+
71
+ > "You'll notice that in this Lakebed Agents MD, there are no file paths. There are no technical decisions or enforcements. There's a couple small general rules at the bottom that I might even delete because I haven't found them to be super useful."
72
+ — Describing the actual contents of his file.
73
+
74
+ > "I wrote this one almost like a letter from me to the agent to tell it how we're thinking, what we're building, and why we're doing this so that it's less likely to have bad assumptions or ask weird questions or work outside of the technical constraints that I want it to work within."
75
+ — The format and intent.
76
+
77
+ > "I noticed almost immediately after writing this — by hand, by the way, my agents did not write this file, I wrote this file — ... I didn't really have to do much to get the agent to build how I wanted it to. Once it had the context of how I was thinking about this, it started behaving way, way better."
78
+ — On authoring it himself and the payoff.
79
+
80
+ > "A glossary of terms and language to help the model understand what you're saying can be very, very helpful."
81
+ — On the one structural element he explicitly recommends.
82
+
83
+ > "Generally speaking, you should try to keep things simple. And if it doesn't work, that doesn't mean make it more complex. It means fix the things that prevent it from being simple. ... You should make slight changes to your agents MD and to your claude MD so that you can keep your prompt simple."
84
+ — The simplicity principle applied directly to context files.
85
+
86
+ > "Copying the prompts I used to use with the big bloated useless agents MD, 55 sucks. When you take the time to condense and steer it the way you want it to work, it becomes the coolest way to work I've ever built with."
87
+ — Bloat vs. condensed, with a concrete before/after.
88
+
89
+ > "No, you're all coping. You don't need all of that. I have almost zero skills installed. Just talk to the model. They're smart enough now."
90
+ — Pushing back on skills/plugins/frameworks as a substitute for plain steering.
91
+
92
+ > "Once you get the agent to behave how you want — if there is enough proof of that behavior in your codebase, whether that is HTML plans, whether that is your agents MD steering it certain ways, whether it's the code itself — once you get the model to behave how you want it to, everything else almost stops mattering."
93
+ — The agent.md as one of several reinforcing steering surfaces.
94
+
95
+ > "I trust the model to find the right file. I am more likely to recommend the wrong file than the model is half the time."
96
+ — Why no file paths.
97
+
98
+ ---
99
+
100
+ ## Practical Takeaways
101
+
102
+ 1. **Default to no agent.md, then earn it.** Start by just talking to the model. Add to the file only when a mistake recurs.
103
+ 2. **Write prose, addressed to the agent, about purpose and mindset** — not specs, not paths, not enforcement.
104
+ 3. **Add a glossary** the moment your domain has ambiguous or overloaded terms.
105
+ 4. **Keep it short.** Bloat measurably degrades model behavior. Condensing is an active improvement, not just tidiness.
106
+ 5. **Author it by hand.** The file's job is to transmit your thinking; don't outsource that to the agent.
107
+ 6. **Use the agent.md to shrink your prompts.** If you're writing long, over-specified prompts, that's a signal to make a small context-file change — not to write longer prompts.
108
+ 7. **Don't reach for skills/plugins/frameworks first.** Treat them as last resorts; modern models respond to plain conversational steering plus a lean context file.
109
+ 8. **Stay reactive and minimal.** Don't anticipate; fix what you actually observe, with the smallest change that works. Be willing to delete rules that aren't pulling weight.
110
+
111
+ ---
112
+
113
+ *Source: Theo (t3.gg), "How I Build with AI (Updated)," https://www.youtube.com/watch?v=xJaMTo2YgO8. All quotes transcribed from the video's auto-transcript; minor verbal artifacts and censored profanity have been smoothed for readability without changing meaning.*
@@ -0,0 +1,84 @@
1
+ # Route: Create — bootstrap the initial letter
2
+
3
+ You are here because no CLAUDE.md or AGENTS.md exists in the target project.
4
+ Verify that first (project root and obvious parents). If one exists, switch to
5
+ `refine.md` instead — unless refine sent you here because the existing file has
6
+ no letter spine; in that case run the interview below and hand the drafted
7
+ letter back to refine's flow.
8
+
9
+ The goal is a short letter from the user to the agent. They author it through an
10
+ interview; you transcribe and shape, in their phrasing. You never substitute
11
+ codebase analysis for their answers.
12
+
13
+ ## Step 1 — Investigate quietly, then interview freehand-first
14
+
15
+ Before asking anything, investigate the repo yourself: README, docs, notes,
16
+ recent git history, the existing CLAUDE.md if refine sent you here. Form your
17
+ own candidate answers for each interview area — intent, constraints, ambiguous
18
+ terms, boundaries. **Do not show these yet.**
19
+
20
+ Open the interview by telling the user the plan, so they answer freely instead
21
+ of dictating what's already written down: *"Answer freehand — don't worry about
22
+ repeating things that are already in the repo or the old file; I've scanned
23
+ those and will show you what I found after your answers, to build on or
24
+ correct."*
25
+
26
+ Ask at most a handful of questions, batched 2–3 at a time, covering four areas:
27
+
28
+ 1. **Intent** — What is this project, and why does it exist? What does done or
29
+ good look like to you?
30
+ 2. **Mental model** — How do you think about building it? What do you care about
31
+ most, and what constraints matter (taste, priorities, trade-offs you've
32
+ already decided)?
33
+ 3. **Glossary candidates** — Are any words in this domain ambiguous or overloaded?
34
+ (Terms that mean something specific here, names that collide, "you/we/users"
35
+ confusion.)
36
+ 4. **Hard boundaries** — What is off-limits without your explicit permission?
37
+
38
+ This is not project discovery. Do not ask about stack, file structure, build
39
+ commands, or architecture — the agent can find those itself, and wrong paths
40
+ mislead more than they help. Only include such details if the user raises them
41
+ unprompted.
42
+
43
+ If an answer is thin, ask one focused follow-up, then move on. Total questions
44
+ should stay in single digits.
45
+
46
+ ## Step 1.5 — Surface what you found
47
+
48
+ After the freehand answers, show your investigation candidates, grouped by the
49
+ same four areas — only the ones they *didn't* already cover: "Here's what I found
50
+ in the repo that you didn't mention — build on it, correct it, or cut it." If
51
+ refine sent you here, this is also where the valuable lines from the old file
52
+ resurface as candidates (real intent buried in rules, gotchas earned by past
53
+ pain) so the user never has to re-dictate what was already written. Each candidate
54
+ they confirm becomes draftable; its trace is their confirmation. Anything they
55
+ don't confirm stays out.
56
+
57
+ ## Step 2 — Draft
58
+
59
+ Synthesize their answers into a draft letter:
60
+
61
+ - Prose, addressed to the agent ("This project is… What I care about is… Don't…").
62
+ - Their phrasing — lift their actual words and rhythms from the interview. If you
63
+ smooth something, keep their vocabulary.
64
+ - A glossary section only if step 1 surfaced genuinely ambiguous terms.
65
+ - No file paths, no enforcement language, no rules for problems they haven't hit.
66
+ - Short. A new letter has earned almost nothing yet — most letters start well
67
+ under 40 lines and grow reactively from observed mistakes. Never pad toward
68
+ the 150 cap.
69
+
70
+ Every line must trace to something the user said. If you find yourself writing a
71
+ line they didn't give you, cut it or ask.
72
+
73
+ ## Step 3 — Line-by-line approval
74
+
75
+ Present the full draft first so the user sees the shape. Then walk it line by line
76
+ (or paragraph by paragraph for flowing prose): for each, they approve, reword,
77
+ or cut. Apply their rewording verbatim — do not "improve" it back.
78
+
79
+ ## Step 4 — Write
80
+
81
+ Only after every line is approved, write the file to the project root as
82
+ `CLAUDE.md` (or `AGENTS.md` if the user prefers — ask once). Confirm the final line
83
+ count. Remind them, once, that the letter grows reactively: when the agent makes
84
+ the same mistake twice, that's when the next line gets earned.
@@ -0,0 +1,69 @@
1
+ # Route: Refine — audit an existing file letter-style
2
+
3
+ You are here because a CLAUDE.md/AGENTS.md exists and the user wants it audited or
4
+ improved. The audit is letter-style: does each line transfer intent they actually
5
+ hold, or is it noise? No rubrics, no grades, no template sections.
6
+
7
+ ## Step 0 — Is this even a letter?
8
+
9
+ Read the whole file first and judge its shape. If it has no prose-intent spine —
10
+ it's a command list, template sections, a routing table, or rule soup — line
11
+ edits can't fix it, because there is no letter to refine. Say so, then:
12
+
13
+ 1. Run the interview from `routes/create.md` to author the missing letter spine
14
+ (the user's answers, their phrasing — the existing file is not a substitute,
15
+ but it IS a hint source: mine it for genuinely valuable content — real intent
16
+ buried in rules, gotchas earned by past pain — and surface those as
17
+ candidates in create's Step 1.5 so the user confirms rather than re-dictates).
18
+ 2. Return here and classify every existing line against that new spine: most
19
+ become DELETE or RE-VOICE (folded into the letter); KEEP only what traces.
20
+ 3. Any existing routing section must pass the bar in `routes/scale-check.md`
21
+ or be proposed for deletion with the rest.
22
+
23
+ The pass is not done until the final file is a letter that passes the hard
24
+ rules — that is the finish line for every route, whatever was asked.
25
+
26
+ ## Step 1 — Read and classify every line
27
+
28
+ Read the whole file. Tag each line (or tight group of lines) with exactly one:
29
+
30
+ - **KEEP** — traces to intent or a known recurring mistake, current, voiced as
31
+ intent. Leave it alone.
32
+ - **DELETE** — propose removal. Triggers: generic advice any model already knows;
33
+ restates what the code shows; speculative rule for a problem never observed;
34
+ stale (references things that no longer exist, commands that no longer work);
35
+ one-off fix that never recurred; duplicate; a rule whose "why" nobody can state.
36
+ - **RE-VOICE** — the underlying intent is real but it's written as enforcement
37
+ ("ALWAYS/NEVER do X") or as a bare mechanic. Rewrite as intent with its why
38
+ ("I care about X because Y") — usually shorter, always more transferable.
39
+ - **ASK** — you can't tell whether it traces. Don't guess; queue a question.
40
+
41
+ File paths get special suspicion: the model finds files better than stale paths
42
+ do. Propose deleting paths unless the user states a live reason to keep one.
43
+
44
+ ## Step 2 — Ask the queued questions
45
+
46
+ Batch the ASK items (2–5 at a time): "This line says X — what's the why? Is it
47
+ still true? Has the mistake it guards against actually recurred?" A line whose
48
+ why the user can't state becomes a DELETE proposal — Theo deletes rules that
49
+ aren't pulling weight, and so does this skill.
50
+
51
+ ## Step 3 — Propose the edit set, deletions first
52
+
53
+ Deletions are mandatory in every refine pass — if you found none, you didn't
54
+ audit, you skimmed. Present in this order:
55
+
56
+ 1. **Deletions** — quoted line + one-line reason each.
57
+ 2. **Re-voicings** — before → after, one-line why.
58
+ 3. **Additions** — rare, only for a recurring mistake the user names during this
59
+ audit, in their phrasing. Never additions to "round out" the file.
60
+
61
+ Show the net line count: before → after. It should usually go down. If the file
62
+ is over 150 lines, the pass is not done until it's under; if an addition would
63
+ cross 150, pair it with a removal or drop it.
64
+
65
+ ## Step 4 — Approve and apply
66
+
67
+ Walk the edit set change by change. Apply only what the user approves, with their
68
+ rewordings verbatim. Edit the file, then report the final shape: line count,
69
+ what was cut, what survived.
@@ -0,0 +1,56 @@
1
+ # Route: Scale check — has this project outgrown a pure letter?
2
+
3
+ You are here to judge whether a project has genuinely outgrown a plain letter
4
+ and earned a routing section — Gary's resolver idea, applied only when scale
5
+ demands it. The default verdict is **not yet**. A short letter plus model
6
+ intelligence covers most projects; routing structure added early is bloat
7
+ wearing a uniform.
8
+
9
+ ## Step 1 — Gather the scale signals
10
+
11
+ Look at the project (this part IS codebase analysis — allowed here because you
12
+ are assessing structure, not authoring letter content):
13
+
14
+ - Project-level skills: count entries in `.claude/skills/`.
15
+ - Subagents: count entries in `.claude/agents/`.
16
+ - Domain subdirectories with their own conventions or their own CLAUDE.md files.
17
+ - Standing docs the agent repeatedly needs (filing rules, domain references).
18
+ - **Observed misrouting** — the strongest signal, and it comes from the user, not
19
+ the file tree: the agent repeatedly picking the wrong skill, wrong directory,
20
+ or wrong doc; or the user invoking things by explicit path because intent alone
21
+ doesn't land. Ask them directly whether they've seen this.
22
+
23
+ ## Step 2 — Verdict
24
+
25
+ **Not yet** (the common case): a handful of skills, no repeated misrouting, the
26
+ letter is doing its job. Say so, name the signals you'd want to see before
27
+ revisiting (e.g. "if you catch the agent filing X into Y twice, come back"),
28
+ and stop. Do not propose routing "to be safe."
29
+
30
+ **Earned**: multiple independent signals — meaningful skill/subagent count AND
31
+ repeated misrouting the user has actually observed, or several domains with
32
+ conventions the agent keeps missing. Be explicit about which signals tipped it.
33
+
34
+ ## Step 3 — If earned, propose a lean routing section
35
+
36
+ The letter stays the spine; routing is a section appended to it, never a
37
+ replacement and never a rewrite of the prose.
38
+
39
+ - A short numbered list of conditional pointers: "task/content type → read/file
40
+ here." Route, don't explain — pointers carry no instruction content themselves.
41
+ - Route by primary subject, not by source format or which tool produced the thing.
42
+ - Only include routes for *observed* traffic: tasks and content types that have
43
+ actually occurred. No speculative rows.
44
+ - It counts against the 150-line cap like everything else. A routing section is
45
+ typically 10–20 lines; if it wants to be more, the project needs its own
46
+ routing doc the section points to, not a longer section.
47
+
48
+ Present the draft section with the trace for each row (which observed signal
49
+ earned it). Line-by-line approval, then apply.
50
+
51
+ ## Step 4 — Note the decay
52
+
53
+ Routing rots as skills change (~90 days untouched and it's a historical
54
+ document). When a routing section ships, tell the user once: re-run this scale
55
+ check when skills are added or when they catch themselves invoking things by
56
+ explicit path again.
@@ -0,0 +1,70 @@
1
+ # Route: Session capture — earn a line from a real session
2
+
3
+ ## Quick capture — mid-task, triggered by the maintenance footer
4
+
5
+ If you are here because a working agent (you, mid-task) noticed something the
6
+ letter should learn — new or ambiguous vocab, a repeated correction, drifted
7
+ intent or routing — do NOT run the full flow below. The capture must not derail
8
+ the task at hand, and must not be lost either:
9
+
10
+ 1. One line to the user: what you noticed + the proposed minimal change, in
11
+ their words. No opening message, no progress headers.
12
+ 2. Approved? Apply immediately — cap check, footer intact. If it takes less
13
+ than 5 minutes, do it now; deferring is how improvements get forgotten.
14
+ 3. Declined, or the user is heads-down? Note it (a TODO, a scratch line —
15
+ anywhere durable) and re-raise it at session end through the full flow.
16
+ 4. Return to the interrupted task immediately. The capture is a pit stop,
17
+ not a detour.
18
+
19
+ Everything below is the full end-of-session flow.
20
+
21
+ ---
22
+
23
+ You are here at the end of a working session, asked to capture learnings into
24
+ the CLAUDE.md. The letter grows reactively: only a *recurring* mistake earns a
25
+ line. One-off mistakes earn nothing — and "nothing to add" is the most common
26
+ correct outcome of this route. Say it plainly when it's true.
27
+
28
+ ## Step 1 — Mine the session for corrections
29
+
30
+ Scan this session for moments where the user corrected the agent: redirected an
31
+ assumption, rejected an approach, repeated an instruction, expressed frustration,
32
+ or re-explained intent the agent should have had. Each correction is a candidate.
33
+ Discoveries that aren't corrections (a command that worked, a quirk found) are
34
+ NOT candidates — that's the official plugin's instinct, not this skill's. The
35
+ letter carries intent, not session notes.
36
+
37
+ ## Step 2 — Filter: recurring or one-off?
38
+
39
+ A candidate is **recurring** only if at least one holds:
40
+
41
+ - The user corrected the same thing more than once *this* session.
42
+ - The existing CLAUDE.md already gestures at it and the agent still got it wrong
43
+ (the line isn't landing — a rewording problem, not an addition problem).
44
+ - The user confirms it's a repeat from earlier sessions. When unsure, ask exactly
45
+ that: "Has the agent gotten this wrong before, or was today the first time?"
46
+
47
+ Everything else is one-off. List one-offs in a sentence ("watching, not writing:
48
+ X, Y") so the user knows they were seen, and propose nothing for them.
49
+
50
+ ## Step 3 — Propose the minimal fix
51
+
52
+ For each recurring mistake (usually zero or one per session):
53
+
54
+ - First check whether a **deletion or rewording** of an existing line fixes it
55
+ better than an addition — a line that misled the agent should be cut, not
56
+ counter-weighted with a second line.
57
+ - If an addition is right, it is the *smallest* line that transfers the intent:
58
+ usually one sentence, voiced as why, built from the user's own correction words
59
+ in the session. Not a rule, not an enforcement, no file paths.
60
+ - Check the cap: if the file is at 150 lines, pair the addition with a proposed
61
+ removal or don't propose it.
62
+
63
+ Present as: the mistake (with where it happened), why it qualifies as recurring,
64
+ the proposed change as a diff, and the trace ("your words: '…'").
65
+
66
+ ## Step 4 — Approve and apply
67
+
68
+ The user approves, rewords, or rejects each proposal; apply only approved changes,
69
+ their rewording verbatim. If nothing qualified, end with: "No recurring mistake
70
+ this session — the letter stands."
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: estack-flight-planner
3
- version: 1.0.2
3
+ version: 1.0.3
4
4
  description: (flight-planner) Find and rank flights between any two airports with config-driven preferences (budget, airlines, nonstop, time-of-day) and optional ground-shuttle pairing. Uses SerpAPI Google Flights (or WebSearch fallback). Saves preferences to `~/.flight-planner/config.json` and logs every search.
5
5
  disable-model-invocation: true
6
6
  ---
@@ -312,7 +312,7 @@ If the user doesn't have a SerpAPI key and asks for help getting one:
312
312
  2. Walk them to https://serpapi.com/users/sign_up — sign up with email.
313
313
  3. After signup, the API key is at https://serpapi.com/manage-api-key.
314
314
  4. To set it permanently, walk them through either:
315
- - Saving it in their flight-planner config (`serpapi_key` field), or
315
+ - Saving it in their `~/.flight-planner/config.json` (`serpapi_key` field), or
316
316
  - Setting `SERPAPI_KEY` as an environment variable in their shell profile.
317
317
  5. If they don't want a key: confirm they want the WebSearch fallback. Set `serpapi_key: null` in config. Tell them: "I'll use WebSearch each run. Results won't be as complete and prices may be approximations."
318
318
 
@@ -35,7 +35,7 @@ BASE_PARAMS = {
35
35
 
36
36
 
37
37
  def default_output_dir() -> Path:
38
- base = Path(tempfile.gettempdir()) / "flight-planner"
38
+ base = Path(tempfile.gettempdir()) / "estack-flight-planner"
39
39
  base.mkdir(parents=True, exist_ok=True)
40
40
  return base
41
41
 
@@ -13,10 +13,10 @@ price distribution. The skill uses this to propose specific relaxations when
13
13
  hard filters return zero results.
14
14
 
15
15
  Usage:
16
- python filter_flights.py --json-dir /tmp/flight-planner/ --max-price 200 --from IND --to EWR
17
- python filter_flights.py --json-dir /tmp/flight-planner/ --max-price 200 \\
16
+ python filter_flights.py --json-dir /tmp/estack-flight-planner/ --max-price 200 --from IND --to EWR
17
+ python filter_flights.py --json-dir /tmp/estack-flight-planner/ --max-price 200 \\
18
18
  --soft-filters max-price,time-priority
19
- python filter_flights.py --json-dir /tmp/flight-planner/ --cluster-analysis
19
+ python filter_flights.py --json-dir /tmp/estack-flight-planner/ --cluster-analysis
20
20
 
21
21
  All filter args (--max-price, --time-priority, --from, --to, --airlines, --nonstop)
22
22
  are required for normal filter mode (no defaults — caller passes config values).
@@ -192,7 +192,7 @@ def cluster_analysis(flights, max_price, bands, origins, dests, airlines, nonsto
192
192
 
193
193
  def main() -> int:
194
194
  p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
195
- default_dir = Path(tempfile.gettempdir()) / "flight-planner"
195
+ default_dir = Path(tempfile.gettempdir()) / "estack-flight-planner"
196
196
  p.add_argument("--json-dir", default=str(default_dir))
197
197
  p.add_argument("--max-price", type=int, default=None,
198
198
  help="Max price in USD. Omit for no price filter.")
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: estack-github-issue-tracker
3
- version: 1.0.2
3
+ version: 1.0.3
4
4
  description: >
5
5
  (github-issue-tracker) GitHub issue tracker management. Checks all open issues the user is involved in,
6
6
  finds related/duplicate issues, reports what changed, and recommends next steps.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * tracker-tools.cjs — Data service layer for github-issue-tracker skill.
4
+ * tracker-tools.cjs — Data service layer for estack-github-issue-tracker skill.
5
5
  *
6
6
  * Commands:
7
7
  * startup --tracker <path> Auth, parse tracker + config, create temp dir, discover issues
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: estack-read-claude-session-history
3
- version: 1.0.2
3
+ version: 1.0.3
4
4
  description: (read-claude-session-history) Invoke for ANY task involving Claude Code session history, transcripts, or .jsonl files — this is the only way to read, parse, or search them; do not attempt to use Bash or Read on .jsonl directly. Use for: recovering context after /compact ("what were we doing before compact"), advisor response retrieval ("what did the advisor say"), subagent output collection ("get all subagent finals"), cross-project session search by keyword, session listing and triage, UUID and title lookup, resume-command generation, file-edit and tool-call forensics, session diff between two sessions or subagents, weekly work journal, day timeline of activity blocks and idle gaps, engagement/attention-time accounting (active vs elapsed time, break detection, parallel-chat-safe totals), recovering from .claude-backups after data loss, session count queries, and reading the last agent message before a crash or interrupt. Trigger phrases: "session history", "before compact", "what did claude do", "what did I work on", "search my sessions", "find that session", "what did the advisor say", "what did the agent edit", "from the backup", "list my sessions", "subagent outputs", "session journal", "resume previous", "which files did claude touch", "go back and look", "what did I do yesterday", "where did my day go", "timeline of my day", "how much time on", "how long did that actually take", "how much did I actually work", "active time", "time I spent".
5
5
  ---
6
6
 
@@ -13,7 +13,7 @@ Sessions are stored as `.jsonl` files. Reading them raw is hopeless: 1,000–5,0
13
13
  ## Quick start
14
14
 
15
15
  ```bash
16
- PY="C:\Users\2supe\.claude\skills\read-claude-session-history\scripts\read_transcript.py"
16
+ PY="$HOME/.claude/skills/estack-read-claude-session-history/scripts/read_transcript.py"
17
17
 
18
18
  # What was the last thing the agent said in this session?
19
19
  python "$PY" --file <current-session.jsonl> --mode last
@@ -4,7 +4,7 @@ Multi-step workflows. For per-mode flag reference, see `modes.md`. For schema, s
4
4
 
5
5
  In all examples, `$PY` refers to:
6
6
  ```
7
- C:\Users\2supe\.claude\skills\read-claude-session-history\scripts\read_transcript.py
7
+ ~/.claude/skills/estack-read-claude-session-history/scripts/read_transcript.py
8
8
  ```
9
9
 
10
10
  ---