@mrclrchtr/supi-claude-md 0.1.0

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.
Files changed (34) hide show
  1. package/README.md +73 -0
  2. package/node_modules/@mrclrchtr/supi-core/README.md +90 -0
  3. package/node_modules/@mrclrchtr/supi-core/package.json +30 -0
  4. package/node_modules/@mrclrchtr/supi-core/src/config-settings.ts +76 -0
  5. package/node_modules/@mrclrchtr/supi-core/src/config.ts +186 -0
  6. package/node_modules/@mrclrchtr/supi-core/src/context-messages.ts +119 -0
  7. package/node_modules/@mrclrchtr/supi-core/src/context-provider-registry.ts +36 -0
  8. package/node_modules/@mrclrchtr/supi-core/src/context-tag.ts +31 -0
  9. package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
  10. package/node_modules/@mrclrchtr/supi-core/src/index.ts +83 -0
  11. package/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
  12. package/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +54 -0
  13. package/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
  14. package/node_modules/@mrclrchtr/supi-core/src/settings-command.ts +15 -0
  15. package/node_modules/@mrclrchtr/supi-core/src/settings-registry.ts +41 -0
  16. package/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +226 -0
  17. package/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
  18. package/package.json +44 -0
  19. package/skills/claude-md-improver/SKILL.md +253 -0
  20. package/skills/claude-md-improver/references/quality-criteria.md +114 -0
  21. package/skills/claude-md-improver/references/templates.md +300 -0
  22. package/skills/claude-md-improver/references/update-guidelines.md +218 -0
  23. package/skills/claude-md-revision/SKILL.md +126 -0
  24. package/skills/claude-md-revision/evals/evals.json +43 -0
  25. package/skills/claude-md-revision/references/quality-criteria.md +114 -0
  26. package/skills/claude-md-revision/references/templates.md +300 -0
  27. package/skills/claude-md-revision/references/update-guidelines.md +218 -0
  28. package/src/claude-md.ts +163 -0
  29. package/src/config.ts +33 -0
  30. package/src/discovery.ts +133 -0
  31. package/src/index.ts +1 -0
  32. package/src/settings-registration.ts +119 -0
  33. package/src/state.ts +94 -0
  34. package/src/subdirectory.ts +84 -0
@@ -0,0 +1,114 @@
1
+ # CLAUDE.md Quality Criteria
2
+
3
+ ## Scoring Rubric
4
+
5
+ ### 1. Commands/Workflows (15 points)
6
+
7
+ **15 points**: All essential commands documented with context
8
+ - Build, test, lint, deploy commands present
9
+ - Development workflow clear
10
+ - Common operations documented
11
+
12
+ **12 points**: Most commands present, some missing context
13
+
14
+ **8 points**: Basic commands only, no workflow
15
+
16
+ **4 points**: Few commands, many missing
17
+
18
+ **0 points**: No commands documented
19
+
20
+ ### 2. Architecture Clarity (15 points)
21
+
22
+ **15 points**: Clear codebase map
23
+ - Key directories explained
24
+ - Module relationships documented
25
+ - Entry points identified
26
+ - Data flow described where relevant
27
+
28
+ **12 points**: Good structure overview, minor gaps
29
+
30
+ **8 points**: Basic directory listing only
31
+
32
+ **4 points**: Vague or incomplete
33
+
34
+ **0 points**: No architecture info
35
+
36
+ ### 3. Non-Obvious Patterns (15 points)
37
+
38
+ **15 points**: Gotchas and quirks captured
39
+ - Known issues documented
40
+ - Workarounds explained
41
+ - Edge cases noted
42
+ - "Why we do it this way" for unusual patterns
43
+
44
+ **10 points**: Some patterns documented
45
+
46
+ **5 points**: Minimal pattern documentation
47
+
48
+ **0 points**: No patterns or gotchas
49
+
50
+ ### 4. Conciseness (15 points)
51
+
52
+ **15 points**: Dense, valuable content
53
+ - No filler or obvious info
54
+ - Each line adds value
55
+ - No redundancy with code comments
56
+
57
+ **10 points**: Mostly concise, some padding
58
+
59
+ **5 points**: Verbose in places
60
+
61
+ **0 points**: Mostly filler or restates obvious code
62
+
63
+ ### 5. Currency (15 points)
64
+
65
+ **15 points**: Reflects current codebase
66
+ - Commands work as documented
67
+ - File references accurate
68
+ - Tech stack current
69
+
70
+ **10 points**: Mostly current, minor staleness
71
+
72
+ **5 points**: Several outdated references
73
+
74
+ **0 points**: Severely outdated
75
+
76
+ ### 6. Actionability (15 points)
77
+
78
+ **15 points**: Instructions are executable
79
+ - Commands can be copy-pasted
80
+ - Steps are concrete
81
+ - Paths are real
82
+
83
+ **10 points**: Mostly actionable
84
+
85
+ **5 points**: Some vague instructions
86
+
87
+ **0 points**: Vague or theoretical
88
+
89
+ ### 7. Auto-Delivered Overlap (10 points)
90
+
91
+ Score this criterion after a **context baseline review**: compare the CLAUDE.md against what a SuPi-enabled PI session likely already has from `code_intel brief` and other known injected context.
92
+
93
+ **10 points**: Almost no overlap. Any overlap is tiny and clearly justified by human-only reasoning.
94
+
95
+ **7 points**: Some overlap, but the file still adds meaningful unique guidance (for example, a partially redundant structure section that keeps ownership rules or a concise "start here" note).
96
+
97
+ **4 points**: Significant overlap — package tables, root project-structure trees, architecture overviews, or dependency graphs duplicate the baseline context and should be compressed.
98
+
99
+ **0 points**: Large sections are almost entirely duplicated generated context (module lists with descriptions, dense dependency tables, long root directory trees).
100
+
101
+ **What is NOT overlap:** Gotchas specific to a package's behavior; cross-package patterns that aren't discoverable from manifests; commands and workflows; human-curated "Start Here" guidance with reasoning; concise structure notes that explain boundaries, ownership, initialization order, or important exceptions; and sections classified as **unique** during the baseline review.
102
+
103
+ **What IS overlap:** Monorepo package tables where every row is `{name, description, path}`; root-level "Modules" or "Packages" sections with >5 entries; the **fully redundant** portion of a section during baseline review; root `## Project structure` / `## Architecture` trees that mostly restate folders, packages, or module layout already visible from `code_intel brief`; high-level architecture overviews that don't add relationships, gotchas, conventions, or exceptions beyond what's in `package.json`; and dependency graphs that could be generated from `pnpm-workspace.yaml`.
104
+
105
+ ## Assessment Process
106
+
107
+ 1. Read the CLAUDE.md file completely.
108
+ 2. If SuPi is active, perform a **context baseline review** first: compare against `code_intel brief` and other known injected context, then classify sections as **fully redundant**, **partially redundant**, or **unique**.
109
+ 3. Cross-reference with the actual codebase: run documented commands (mentally or actually), check that referenced files exist, and verify architecture descriptions.
110
+ 4. Score each criterion, calculate the total, assign the grade, list the specific issues, and propose concrete improvements.
111
+
112
+ ## Red Flags
113
+
114
+ Watch for commands that would fail (wrong paths, missing deps), references to deleted files or folders, outdated tech versions, template copy without customization, generic advice, stale `TODO` items, duplicate info across multiple CLAUDE.md files, sections that duplicate `code_intel brief` output, and structure sections where the redundant tree/inventory portion should be separated from the unique guidance portion.
@@ -0,0 +1,300 @@
1
+ # CLAUDE.md Templates
2
+
3
+ ## Key Principles
4
+
5
+ - **Concise**: Dense, human-readable content; one line per concept when possible
6
+ - **Actionable**: Commands should be copy-paste ready
7
+ - **Project-specific**: Document patterns unique to this project, not generic advice
8
+ - **Current**: All info should reflect actual codebase state
9
+
10
+ ---
11
+
12
+ ## Recommended Sections
13
+
14
+ Use only the sections relevant to the project. Not all sections are needed.
15
+
16
+ ### Commands
17
+
18
+ Document the essential commands for working with the project.
19
+
20
+ ```markdown
21
+ ## Commands
22
+
23
+ | Command | Description |
24
+ |---------|-------------|
25
+ | `<install command>` | Install dependencies |
26
+ | `<dev command>` | Start development server |
27
+ | `<build command>` | Production build |
28
+ | `<test command>` | Run tests |
29
+ | `<lint command>` | Lint/format code |
30
+ ```
31
+
32
+ ### Architecture
33
+
34
+ Describe the project structure so Claude understands where things live.
35
+
36
+ ```markdown
37
+ ## Architecture
38
+
39
+ ```
40
+ <root>/
41
+ <dir>/ # <purpose>
42
+ <dir>/ # <purpose>
43
+ <dir>/ # <purpose>
44
+ ```
45
+ ```
46
+
47
+ ### Key Files
48
+
49
+ List important files that Claude should know about.
50
+
51
+ ```markdown
52
+ ## Key Files
53
+
54
+ - `<path>` - <purpose>
55
+ - `<path>` - <purpose>
56
+ ```
57
+
58
+ ### Code Style
59
+
60
+ Document project-specific coding conventions.
61
+
62
+ ```markdown
63
+ ## Code Style
64
+
65
+ - <convention>
66
+ - <convention>
67
+ - <preference over alternative>
68
+ ```
69
+
70
+ ### Environment
71
+
72
+ Document required environment variables and setup.
73
+
74
+ ```markdown
75
+ ## Environment
76
+
77
+ Required:
78
+ - `<VAR_NAME>` - <purpose>
79
+ - `<VAR_NAME>` - <purpose>
80
+
81
+ Setup:
82
+ - <setup step>
83
+ ```
84
+
85
+ ### Testing
86
+
87
+ Document testing approach and commands.
88
+
89
+ ```markdown
90
+ ## Testing
91
+
92
+ - `<test command>` - <what it tests>
93
+ - <testing convention or pattern>
94
+ ```
95
+
96
+ ### Gotchas
97
+
98
+ Document non-obvious patterns, quirks, and warnings.
99
+
100
+ ```markdown
101
+ ## Gotchas
102
+
103
+ - <non-obvious thing that causes issues>
104
+ - <ordering dependency or prerequisite>
105
+ - <common mistake to avoid>
106
+ ```
107
+
108
+ ### Workflow
109
+
110
+ Document development workflow patterns.
111
+
112
+ ```markdown
113
+ ## Workflow
114
+
115
+ - <when to do X>
116
+ - <preferred approach for Y>
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Template: Project Root (Minimal)
122
+
123
+ ```markdown
124
+ # <Project Name>
125
+
126
+ <One-line description>
127
+
128
+ ## Commands
129
+
130
+ | Command | Description |
131
+ |---------|-------------|
132
+ | `<command>` | <description> |
133
+
134
+ ## Architecture
135
+
136
+ ```
137
+ <structure>
138
+ ```
139
+
140
+ ## Gotchas
141
+
142
+ - <gotcha>
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Template: Project Root (Comprehensive)
148
+
149
+ ```markdown
150
+ # <Project Name>
151
+
152
+ <One-line description>
153
+
154
+ ## Commands
155
+
156
+ | Command | Description |
157
+ |---------|-------------|
158
+ | `<command>` | <description> |
159
+
160
+ ## Architecture
161
+
162
+ ```
163
+ <structure with descriptions>
164
+ ```
165
+
166
+ ## Key Files
167
+
168
+ - `<path>` - <purpose>
169
+
170
+ ## Code Style
171
+
172
+ - <convention>
173
+
174
+ ## Environment
175
+
176
+ - `<VAR>` - <purpose>
177
+
178
+ ## Testing
179
+
180
+ - `<command>` - <scope>
181
+
182
+ ## Gotchas
183
+
184
+ - <gotcha>
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Template: Package/Module
190
+
191
+ For packages within a monorepo or distinct modules.
192
+
193
+ ```markdown
194
+ # <Package Name>
195
+
196
+ <Purpose of this package>
197
+
198
+ ## Usage
199
+
200
+ ```
201
+ <import/usage example>
202
+ ```
203
+
204
+ ## Key Exports
205
+
206
+ - `<export>` - <purpose>
207
+
208
+ ## Dependencies
209
+
210
+ - `<dependency>` - <why needed>
211
+
212
+ ## Notes
213
+
214
+ - <important note>
215
+ ```
216
+
217
+ ---
218
+
219
+ ## Template: Monorepo Root
220
+
221
+ ```markdown
222
+ # <Monorepo Name>
223
+
224
+ <Description>
225
+
226
+ ## Packages
227
+
228
+ | Package | Description | Path |
229
+ |---------|-------------|------|
230
+ | `<name>` | <purpose> | `<path>` |
231
+
232
+ ## Commands
233
+
234
+ | Command | Description |
235
+ |---------|-------------|
236
+ | `<command>` | <description> |
237
+
238
+ ## Cross-Package Patterns
239
+
240
+ - <shared pattern>
241
+ - <generation/sync pattern>
242
+ ```
243
+
244
+ > ⚠️ **When SuPi is active:** The `## Packages` table in this template is auto-generated by `code_intel brief` on the first turn. Consider omitting it or replacing it with `## Start Here` and `## Cross-Package Patterns` sections that capture conventions not visible in manifests.
245
+
246
+ ---
247
+
248
+ ## Template: SuPi-Optimized Project Root
249
+
250
+ For projects using SuPi extensions (`code-intelligence`, `claude-md`). Omits sections that extensions auto-deliver and favors compressed human-only guidance after a baseline overlap review.
251
+
252
+ ```markdown
253
+ # <Project Name>
254
+
255
+ <One-line description — what makes this project unique>
256
+
257
+ ## Commands
258
+
259
+ | Command | Description |
260
+ |---------|-------------|
261
+ | `<command>` | <description> |
262
+
263
+ ## Start Here
264
+
265
+ - <where to begin for the most common task>
266
+ - <entry point or file to read first>
267
+
268
+ ## Cross-Package Patterns
269
+
270
+ - <pattern that isn't obvious from code>
271
+ - <convention that required a decision>
272
+
273
+ ## Gotchas
274
+
275
+ - <non-obvious thing that causes issues>
276
+ - <ordering dependency or prerequisite>
277
+
278
+ ## Workflow
279
+
280
+ - <when to do X>
281
+ - <preferred approach for Y>
282
+ ```
283
+
284
+ **What's intentionally absent:**
285
+ - `## Modules` / `## Packages` — `code_intel brief` generates this
286
+ - Large root `## Project structure` / `## Architecture` directory trees that just restate the workspace layout
287
+ - `## Dependencies` table — derivable from `package.json`
288
+
289
+ If you keep any structure section in a SuPi-enabled root doc, make it short and opinionated: explain where to start, why boundaries exist, or which exception matters. After the baseline review, split the redundant tree/inventory portion from the unique guidance portion instead of keeping both together. Do not paste the tree unless the tree itself carries human-only meaning.
290
+
291
+ ---
292
+
293
+ ## Update Principles
294
+
295
+ When updating any CLAUDE.md:
296
+
297
+ 1. **Be specific**: Use actual file paths, real commands from this project
298
+ 2. **Be current**: Verify info against the actual codebase
299
+ 3. **Be brief**: One line per concept when possible
300
+ 4. **Be useful**: Would this help a new Claude session understand the project?
@@ -0,0 +1,218 @@
1
+ # CLAUDE.md Update Guidelines
2
+
3
+ ## Core Principle
4
+
5
+ Only add information that will genuinely help future Claude sessions. The context window is precious - every line must earn its place.
6
+
7
+ ## What TO Add
8
+
9
+ ### 1. Commands/Workflows Discovered
10
+
11
+ ```markdown
12
+ ## Build
13
+
14
+ `npm run build:prod` - Full production build with optimization
15
+ `npm run build:dev` - Fast dev build (no minification)
16
+ ```
17
+
18
+ Why: Saves future sessions from discovering these again.
19
+
20
+ ### 2. Gotchas and Non-Obvious Patterns
21
+
22
+ ```markdown
23
+ ## Gotchas
24
+
25
+ - Tests must run sequentially (`--runInBand`) due to shared DB state
26
+ - `yarn.lock` is authoritative; delete `node_modules` if deps mismatch
27
+ ```
28
+
29
+ Why: Prevents repeating debugging sessions.
30
+
31
+ ### 3. Package Relationships
32
+
33
+ ```markdown
34
+ ## Dependencies
35
+
36
+ The `auth` module depends on `crypto` being initialized first.
37
+ Import order matters in `src/bootstrap.ts`.
38
+ ```
39
+
40
+ Why: Architecture knowledge that isn't obvious from code.
41
+
42
+ ### 4. Testing Approaches That Worked
43
+
44
+ ```markdown
45
+ ## Testing
46
+
47
+ For API endpoints: Use `supertest` with the test helper in `tests/setup.ts`
48
+ Mocking: Factory functions in `tests/factories/` (not inline mocks)
49
+ ```
50
+
51
+ Why: Establishes patterns that work.
52
+
53
+ ### 5. Configuration Quirks
54
+
55
+ ```markdown
56
+ ## Config
57
+
58
+ - `NEXT_PUBLIC_*` vars must be set at build time, not runtime
59
+ - Redis connection requires `?family=0` suffix for IPv6
60
+ ```
61
+
62
+ Why: Environment-specific knowledge.
63
+
64
+ ## What SuPi Extensions Already Deliver
65
+
66
+ When auditing or updating CLAUDE.md in a project using SuPi extensions, these sections are redundant because they're auto-injected on every session:
67
+
68
+ | Extension | What It Injects | When |
69
+ |-----------|----------------|------|
70
+ | `supi-code-intelligence` | Workspace module graph (names, descriptions, paths, dependency edges) | First `before_agent_start` per session |
71
+ | `supi-claude-md` | Subdirectory `CLAUDE.md` files wrapped in `<extension-context>` | On `read`/`edit`/`lsp`/`tree_sitter` to subdirectories |
72
+ | `supi-core` | `findProjectRoot`, `walkProject`, XML `<extension-context>` tagging | Available to all extensions |
73
+
74
+ **Implication:** A root CLAUDE.md doesn't need to document what `code_intel brief` would say. Focus instead on:
75
+ - Commands and workflows
76
+ - Cross-package conventions and patterns
77
+ - Gotchas that aren't in code
78
+ - Human-curated guidance ("start here for X")
79
+
80
+ When SuPi is active, do a quick baseline review first: compare the CLAUDE.md against `code_intel brief` and other known injected context, then separate each section into overlap vs unique value. If a root `## Project structure` / `## Architecture` section mostly restates the workspace tree, treat that portion as redundant and keep only the orientation, boundary rules, or exceptions that the generated overview cannot supply.
81
+
82
+ ## What NOT to Add
83
+
84
+ ### 1. Obvious Code Info
85
+
86
+ Bad:
87
+ ```markdown
88
+ The `UserService` class handles user operations.
89
+ ```
90
+
91
+ The class name already tells us this.
92
+
93
+ ### 2. Generic Best Practices
94
+
95
+ Bad:
96
+ ```markdown
97
+ Always write tests for new features.
98
+ Use meaningful variable names.
99
+ ```
100
+
101
+ This is universal advice, not project-specific.
102
+
103
+ ### 3. One-Off Fixes
104
+
105
+ Bad:
106
+ ```markdown
107
+ We fixed a bug in commit abc123 where the login button didn't work.
108
+ ```
109
+
110
+ Won't recur; clutters the file.
111
+
112
+ ### 4. Verbose Explanations
113
+
114
+ Bad:
115
+ ```markdown
116
+ The authentication system uses JWT tokens. JWT (JSON Web Tokens) are
117
+ an open standard (RFC 7519) that defines a compact and self-contained
118
+ way for securely transmitting information between parties as a JSON
119
+ object. In our implementation, we use the HS256 algorithm which...
120
+ ```
121
+
122
+ Good:
123
+ ```markdown
124
+ Auth: JWT with HS256, tokens in `Authorization: Bearer <token>` header.
125
+ ```
126
+
127
+ ## Diff Format for Updates
128
+
129
+ For each suggested change:
130
+
131
+ ### 1. Identify the File
132
+
133
+ ```
134
+ File: ./CLAUDE.md
135
+ Section: Commands (new section after ## Architecture)
136
+ ```
137
+
138
+ ### 2. Show the Change
139
+
140
+ ```diff
141
+ ## Architecture
142
+ ...
143
+
144
+ +## Commands
145
+ +
146
+ +| Command | Purpose |
147
+ +|---------|---------|
148
+ +| `npm run dev` | Dev server with HMR |
149
+ +| `npm run build` | Production build |
150
+ +| `npm test` | Run test suite |
151
+ ```
152
+
153
+ ### 3. Explain Why
154
+
155
+ > **Why this helps:** The build commands weren't documented, causing
156
+ > confusion about how to run the project. This saves future sessions
157
+ > from needing to inspect `package.json`.
158
+
159
+ ## What NOT to Add (SuPi Projects)
160
+
161
+ In addition to the existing guidelines, avoid these when SuPi is active:
162
+
163
+ **Redundant: Package/module inventory**
164
+ ```markdown
165
+ Bad:
166
+ ## Packages
167
+ | Package | Description | Path |
168
+ |---------|-------------|------|
169
+ | `api` | REST API | `packages/api/` |
170
+
171
+ Better: Skip entirely, or if relationships are non-obvious:
172
+ ## Cross-Package Patterns
173
+ The `api` package must be initialized before `worker` due to shared DB migrations.
174
+ ```
175
+
176
+ **Redundant: High-level dependency graph**
177
+ ```markdown
178
+ Bad:
179
+ ## Dependencies
180
+ - `api` depends on `db`, `auth`
181
+ - `web` depends on `api`
182
+
183
+ Better: Skip — `code_intel brief` shows this live.
184
+ ```
185
+
186
+ **Partially redundant: Root project structure section with both overlap and unique value**
187
+ ```markdown
188
+ Overlap portion:
189
+ ## Project structure
190
+ - `apps/web` — frontend
191
+ - `apps/api` — backend
192
+ - `packages/db` — shared database code
193
+ - `packages/ui` — shared components
194
+
195
+ Keep portion:
196
+ - `packages/db` owns schema changes; app packages consume generated clients only
197
+ - API request flow starts at `apps/api/src/routes/` and drops into `packages/db/`
198
+
199
+ Better rewrite:
200
+ ## Start Here
201
+ - Web changes usually start in `apps/web/src/app/`
202
+ - API request flow starts at `apps/api/src/routes/` and drops into `packages/db/`
203
+
204
+ ## Cross-Package Patterns
205
+ - `packages/db` owns schema changes; app packages consume generated clients only
206
+ ```
207
+
208
+ ## Validation Checklist
209
+
210
+ Before finalizing an update, verify:
211
+
212
+ - [ ] Each addition is project-specific
213
+ - [ ] No generic advice or obvious info
214
+ - [ ] Commands are tested and work
215
+ - [ ] File paths are accurate
216
+ - [ ] Would a new Claude session find this helpful?
217
+ - [ ] Is this the most concise way to express the info?
218
+ - [ ] No overlap with SuPi auto-delivered content (when SuPi is active)