@mrclrchtr/supi-claude-md 1.7.0 → 1.8.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.
- package/node_modules/@mrclrchtr/supi-core/package.json +13 -2
- package/node_modules/@mrclrchtr/supi-core/src/api.ts +26 -92
- package/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
- package/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
- package/node_modules/@mrclrchtr/supi-core/src/index.ts +26 -92
- package/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
- package/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
- package/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
- package/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
- package/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
- package/package.json +2 -2
- package/skills/claude-md-improver/SKILL.md +31 -20
- package/skills/claude-md-improver/references/quality-criteria.md +20 -17
- package/skills/claude-md-improver/references/templates.md +32 -46
- package/skills/claude-md-improver/references/update-guidelines.md +74 -18
- package/skills/claude-md-revision/SKILL.md +15 -5
- package/skills/claude-md-revision/evals/evals.json +2 -1
- package/skills/claude-md-revision/references/quality-criteria.md +20 -17
- package/skills/claude-md-revision/references/templates.md +32 -46
- package/skills/claude-md-revision/references/update-guidelines.md +74 -18
- package/src/config.ts +1 -1
- package/src/discovery.ts +11 -6
- package/src/settings-registration.ts +2 -5
- package/src/subdirectory.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "SuPi core — shared infrastructure for SuPi extensions (XML context tags, config system)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,8 +37,19 @@
|
|
|
37
37
|
"main": "src/api.ts",
|
|
38
38
|
"exports": {
|
|
39
39
|
"./api": "./src/api.ts",
|
|
40
|
+
"./config": "./src/config.ts",
|
|
41
|
+
"./context": "./src/context.ts",
|
|
42
|
+
"./debug": "./src/debug-registry.ts",
|
|
40
43
|
"./extension": "./src/extension.ts",
|
|
41
|
-
"./package.json": "./package.json"
|
|
44
|
+
"./package.json": "./package.json",
|
|
45
|
+
"./path": "./src/path.ts",
|
|
46
|
+
"./project": "./src/project.ts",
|
|
47
|
+
"./session": "./src/session.ts",
|
|
48
|
+
"./settings": "./src/settings.ts",
|
|
49
|
+
"./settings-ui": "./src/settings-ui.ts",
|
|
50
|
+
"./terminal": "./src/terminal.ts",
|
|
51
|
+
"./tool-framework": "./src/tool-framework.ts",
|
|
52
|
+
"./types": "./src/types.ts"
|
|
42
53
|
},
|
|
43
54
|
"pi": {
|
|
44
55
|
"extensions": [
|
|
@@ -1,96 +1,30 @@
|
|
|
1
1
|
// supi-core — shared infrastructure for SuPi extensions.
|
|
2
2
|
// Provides XML context tag wrapping, unified config system, context-message utilities,
|
|
3
3
|
// settings registry for supi-wide TUI settings, and a shared tool-spec/registration framework.
|
|
4
|
+
//
|
|
5
|
+
// Convenience barrel — re-exports all domain entry points.
|
|
6
|
+
// For lighter imports, use one of the domain subpaths directly
|
|
7
|
+
// (e.g. @mrclrchtr/supi-core/config, @mrclrchtr/supi-core/context).
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
registerContextProvider,
|
|
28
|
-
} from "./context/context-provider-registry.ts";
|
|
29
|
-
export { wrapExtensionContext } from "./context/context-tag.ts";
|
|
30
|
-
export type {
|
|
31
|
-
DebugAgentAccess,
|
|
32
|
-
DebugEvent,
|
|
33
|
-
DebugEventInput,
|
|
34
|
-
DebugEventQuery,
|
|
35
|
-
DebugEventQueryResult,
|
|
36
|
-
DebugEventView,
|
|
37
|
-
DebugLevel,
|
|
38
|
-
DebugNotifyLevel,
|
|
39
|
-
DebugRegistryConfig,
|
|
40
|
-
DebugSummary,
|
|
41
|
-
} from "./debug-registry.ts";
|
|
42
|
-
export {
|
|
43
|
-
clearDebugEvents,
|
|
44
|
-
configureDebugRegistry,
|
|
45
|
-
DEBUG_REGISTRY_DEFAULTS,
|
|
46
|
-
getDebugEvents,
|
|
47
|
-
getDebugRegistryConfig,
|
|
48
|
-
getDebugSummary,
|
|
49
|
-
recordDebugEvent,
|
|
50
|
-
redactDebugData,
|
|
51
|
-
resetDebugRegistry,
|
|
52
|
-
} from "./debug-registry.ts";
|
|
53
|
-
export { fileToUri, resolveToolPath, stripToolPathPrefix, uriToFile } from "./path-utils.ts";
|
|
54
|
-
export type { KnownRootEntry } from "./project-roots.ts";
|
|
55
|
-
export {
|
|
56
|
-
buildKnownRootsMap,
|
|
57
|
-
byPathDepth,
|
|
58
|
-
dedupeTopmostRoots,
|
|
59
|
-
findProjectRoot,
|
|
60
|
-
isWithin,
|
|
61
|
-
isWithinOrEqual,
|
|
62
|
-
mergeKnownRoots,
|
|
63
|
-
resolveKnownRoot,
|
|
64
|
-
segmentCount,
|
|
65
|
-
sortRootsBySpecificity,
|
|
66
|
-
walkProject,
|
|
67
|
-
} from "./project-roots.ts";
|
|
68
|
-
export { createRegistry, createSessionStateRegistry } from "./registry-utils.ts";
|
|
69
|
-
export { getActiveBranchEntries } from "./session-utils.ts";
|
|
70
|
-
export { registerSettingsCommand } from "./settings/settings-command.ts";
|
|
71
|
-
export type { SettingsScope, SettingsSection } from "./settings/settings-registry.ts";
|
|
72
|
-
export {
|
|
73
|
-
clearRegisteredSettings,
|
|
74
|
-
getRegisteredSettings,
|
|
75
|
-
registerSettings,
|
|
76
|
-
} from "./settings/settings-registry.ts";
|
|
77
|
-
export { createInputSubmenu, openSettingsOverlay } from "./settings/settings-ui.ts";
|
|
78
|
-
export type { TitleTarget } from "./terminal.ts";
|
|
79
|
-
export {
|
|
80
|
-
DONE_SYMBOL,
|
|
81
|
-
formatTitle,
|
|
82
|
-
signalBell,
|
|
83
|
-
signalDone,
|
|
84
|
-
signalWaiting,
|
|
85
|
-
WAITING_SYMBOL,
|
|
86
|
-
} from "./terminal.ts";
|
|
87
|
-
export type { SuiPiToolPromptSurface, SuiPiToolSpec, ToolExecuteFn } from "./tool-framework.ts";
|
|
88
|
-
export {
|
|
89
|
-
CharacterParam,
|
|
90
|
-
derivePromptSurface,
|
|
91
|
-
FileParam,
|
|
92
|
-
LineParam,
|
|
93
|
-
MaxResultsParam,
|
|
94
|
-
registerSuiPiTools,
|
|
95
|
-
SymbolParam,
|
|
96
|
-
} from "./tool-framework.ts";
|
|
9
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
10
|
+
export * from "./config.ts";
|
|
11
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
12
|
+
export * from "./context.ts";
|
|
13
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
14
|
+
export * from "./debug-registry.ts";
|
|
15
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
16
|
+
export * from "./path.ts";
|
|
17
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
18
|
+
export * from "./project.ts";
|
|
19
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
20
|
+
export * from "./session.ts";
|
|
21
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
22
|
+
export * from "./settings.ts";
|
|
23
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
24
|
+
export * from "./settings-ui.ts";
|
|
25
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
26
|
+
export * from "./terminal.ts";
|
|
27
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
28
|
+
export * from "./tool-framework.ts";
|
|
29
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
30
|
+
export * from "./types.ts";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// supi-core config domain — config loading and config-settings helpers.
|
|
2
|
+
export type { SupiConfigLocation, SupiConfigOptions } from "./config/config.ts";
|
|
3
|
+
export {
|
|
4
|
+
loadSupiConfig,
|
|
5
|
+
loadSupiConfigForScope,
|
|
6
|
+
readJsonFile,
|
|
7
|
+
removeSupiConfigKey,
|
|
8
|
+
writeSupiConfig,
|
|
9
|
+
} from "./config/config.ts";
|
|
10
|
+
export type { ConfigSettingsHelpers, ConfigSettingsOptions } from "./config/config-settings.ts";
|
|
11
|
+
export { registerConfigSettings } from "./config/config-settings.ts";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// supi-core context domain — context messages, providers, and XML tags.
|
|
2
|
+
export type { ContextMessageLike } from "./context/context-messages.ts";
|
|
3
|
+
export {
|
|
4
|
+
findLastUserMessageIndex,
|
|
5
|
+
getContextToken,
|
|
6
|
+
getPromptContent,
|
|
7
|
+
pruneAndReorderContextMessages,
|
|
8
|
+
restorePromptContent,
|
|
9
|
+
} from "./context/context-messages.ts";
|
|
10
|
+
export type { ContextProvider } from "./context/context-provider-registry.ts";
|
|
11
|
+
export {
|
|
12
|
+
clearRegisteredContextProviders,
|
|
13
|
+
getRegisteredContextProviders,
|
|
14
|
+
registerContextProvider,
|
|
15
|
+
} from "./context/context-provider-registry.ts";
|
|
16
|
+
export { wrapExtensionContext } from "./context/context-tag.ts";
|
|
@@ -1,96 +1,30 @@
|
|
|
1
1
|
// supi-core — shared infrastructure for SuPi extensions.
|
|
2
2
|
// Provides XML context tag wrapping, unified config system, context-message utilities,
|
|
3
3
|
// settings registry for supi-wide TUI settings, and a shared tool-spec/registration framework.
|
|
4
|
+
//
|
|
5
|
+
// Convenience barrel — re-exports all domain entry points.
|
|
6
|
+
// For lighter imports, use one of the domain subpaths directly
|
|
7
|
+
// (e.g. @mrclrchtr/supi-core/config, @mrclrchtr/supi-core/context).
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
registerContextProvider,
|
|
28
|
-
} from "./context/context-provider-registry.ts";
|
|
29
|
-
export { wrapExtensionContext } from "./context/context-tag.ts";
|
|
30
|
-
export type {
|
|
31
|
-
DebugAgentAccess,
|
|
32
|
-
DebugEvent,
|
|
33
|
-
DebugEventInput,
|
|
34
|
-
DebugEventQuery,
|
|
35
|
-
DebugEventQueryResult,
|
|
36
|
-
DebugEventView,
|
|
37
|
-
DebugLevel,
|
|
38
|
-
DebugNotifyLevel,
|
|
39
|
-
DebugRegistryConfig,
|
|
40
|
-
DebugSummary,
|
|
41
|
-
} from "./debug-registry.ts";
|
|
42
|
-
export {
|
|
43
|
-
clearDebugEvents,
|
|
44
|
-
configureDebugRegistry,
|
|
45
|
-
DEBUG_REGISTRY_DEFAULTS,
|
|
46
|
-
getDebugEvents,
|
|
47
|
-
getDebugRegistryConfig,
|
|
48
|
-
getDebugSummary,
|
|
49
|
-
recordDebugEvent,
|
|
50
|
-
redactDebugData,
|
|
51
|
-
resetDebugRegistry,
|
|
52
|
-
} from "./debug-registry.ts";
|
|
53
|
-
export { fileToUri, resolveToolPath, stripToolPathPrefix, uriToFile } from "./path-utils.ts";
|
|
54
|
-
export type { KnownRootEntry } from "./project-roots.ts";
|
|
55
|
-
export {
|
|
56
|
-
buildKnownRootsMap,
|
|
57
|
-
byPathDepth,
|
|
58
|
-
dedupeTopmostRoots,
|
|
59
|
-
findProjectRoot,
|
|
60
|
-
isWithin,
|
|
61
|
-
isWithinOrEqual,
|
|
62
|
-
mergeKnownRoots,
|
|
63
|
-
resolveKnownRoot,
|
|
64
|
-
segmentCount,
|
|
65
|
-
sortRootsBySpecificity,
|
|
66
|
-
walkProject,
|
|
67
|
-
} from "./project-roots.ts";
|
|
68
|
-
export { createRegistry, createSessionStateRegistry } from "./registry-utils.ts";
|
|
69
|
-
export { getActiveBranchEntries } from "./session-utils.ts";
|
|
70
|
-
export { registerSettingsCommand } from "./settings/settings-command.ts";
|
|
71
|
-
export type { SettingsScope, SettingsSection } from "./settings/settings-registry.ts";
|
|
72
|
-
export {
|
|
73
|
-
clearRegisteredSettings,
|
|
74
|
-
getRegisteredSettings,
|
|
75
|
-
registerSettings,
|
|
76
|
-
} from "./settings/settings-registry.ts";
|
|
77
|
-
export { createInputSubmenu, openSettingsOverlay } from "./settings/settings-ui.ts";
|
|
78
|
-
export type { TitleTarget } from "./terminal.ts";
|
|
79
|
-
export {
|
|
80
|
-
DONE_SYMBOL,
|
|
81
|
-
formatTitle,
|
|
82
|
-
signalBell,
|
|
83
|
-
signalDone,
|
|
84
|
-
signalWaiting,
|
|
85
|
-
WAITING_SYMBOL,
|
|
86
|
-
} from "./terminal.ts";
|
|
87
|
-
export type { SuiPiToolPromptSurface, SuiPiToolSpec, ToolExecuteFn } from "./tool-framework.ts";
|
|
88
|
-
export {
|
|
89
|
-
CharacterParam,
|
|
90
|
-
derivePromptSurface,
|
|
91
|
-
FileParam,
|
|
92
|
-
LineParam,
|
|
93
|
-
MaxResultsParam,
|
|
94
|
-
registerSuiPiTools,
|
|
95
|
-
SymbolParam,
|
|
96
|
-
} from "./tool-framework.ts";
|
|
9
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
10
|
+
export * from "./config.ts";
|
|
11
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
12
|
+
export * from "./context.ts";
|
|
13
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
14
|
+
export * from "./debug-registry.ts";
|
|
15
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
16
|
+
export * from "./path.ts";
|
|
17
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
18
|
+
export * from "./project.ts";
|
|
19
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
20
|
+
export * from "./session.ts";
|
|
21
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
22
|
+
export * from "./settings.ts";
|
|
23
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
24
|
+
export * from "./settings-ui.ts";
|
|
25
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
26
|
+
export * from "./terminal.ts";
|
|
27
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
28
|
+
export * from "./tool-framework.ts";
|
|
29
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
30
|
+
export * from "./types.ts";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// supi-core project domain — project root discovery and traversal.
|
|
2
|
+
export type { KnownRootEntry } from "./project-roots.ts";
|
|
3
|
+
export {
|
|
4
|
+
buildKnownRootsMap,
|
|
5
|
+
byPathDepth,
|
|
6
|
+
dedupeTopmostRoots,
|
|
7
|
+
findProjectRoot,
|
|
8
|
+
isWithin,
|
|
9
|
+
isWithinOrEqual,
|
|
10
|
+
mergeKnownRoots,
|
|
11
|
+
resolveKnownRoot,
|
|
12
|
+
segmentCount,
|
|
13
|
+
sortRootsBySpecificity,
|
|
14
|
+
walkProject,
|
|
15
|
+
} from "./project-roots.ts";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// supi-core settings domain — settings registry (lightweight, type-only pi-tui import).
|
|
2
|
+
|
|
3
|
+
export { registerSettingsCommand } from "./settings/settings-command.ts";
|
|
4
|
+
export type { SettingsScope, SettingsSection } from "./settings/settings-registry.ts";
|
|
5
|
+
export {
|
|
6
|
+
clearRegisteredSettings,
|
|
7
|
+
getRegisteredSettings,
|
|
8
|
+
registerSettings,
|
|
9
|
+
} from "./settings/settings-registry.ts";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** 0-based position used by LSP and code-intelligence internally. */
|
|
2
|
+
export interface CodePosition {
|
|
3
|
+
line: number;
|
|
4
|
+
character: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** Normalized location — flat replacement for LSP's nested Location/range shape. */
|
|
8
|
+
export interface CodeLocation {
|
|
9
|
+
uri: string;
|
|
10
|
+
range: { start: CodePosition; end: CodePosition };
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-claude-md",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "SuPi claude-md extension — automatic subdirectory context injection for pi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"!__tests__"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@mrclrchtr/supi-core": "1.
|
|
24
|
+
"@mrclrchtr/supi-core": "1.8.0"
|
|
25
25
|
},
|
|
26
26
|
"bundledDependencies": [
|
|
27
27
|
"@mrclrchtr/supi-core"
|
|
@@ -41,6 +41,7 @@ Add rows for any additional categories visible in context.
|
|
|
41
41
|
|
|
42
42
|
- **Root-level high risk** (already auto-delivered; do NOT recommend for root `./CLAUDE.md`):
|
|
43
43
|
- Package/module inventories (from `supi-code-intelligence`)
|
|
44
|
+
- Package layout / project structure sections that just list packages with descriptions (from `supi-code-intelligence`)
|
|
44
45
|
- Root directory trees and file counts (from `supi-code-intelligence`)
|
|
45
46
|
- Dependency graphs from manifests (from `supi-code-intelligence`)
|
|
46
47
|
- High-level architecture without project-specific reasoning (from `supi-code-intelligence`)
|
|
@@ -49,7 +50,7 @@ Add rows for any additional categories visible in context.
|
|
|
49
50
|
- Subdirectory CLAUDE.md/AGENTS.md already injected by `supi-claude-md` during this session
|
|
50
51
|
|
|
51
52
|
- **Low risk** (not auto-delivered; safe to recommend in CLAUDE.md at any scope):
|
|
52
|
-
-
|
|
53
|
+
- Non-obvious commands and workflows (not routine build/test/lint — those are in package.json)
|
|
53
54
|
- Gotchas and non-obvious patterns
|
|
54
55
|
- Cross-package conventions not obvious from manifests
|
|
55
56
|
- Curated "start here" guidance with ownership or boundary reasoning
|
|
@@ -108,7 +109,7 @@ For each CLAUDE.md file found in Phase 2, evaluate against quality criteria, inc
|
|
|
108
109
|
|
|
109
110
|
| Criterion | Weight | Check |
|
|
110
111
|
|-----------|--------|-------|
|
|
111
|
-
| Commands/workflows documented | High | Are build/test
|
|
112
|
+
| Commands/workflows documented | High | Are non-obvious commands/workflows captured (not routine build/test)? |
|
|
112
113
|
| Architecture clarity | High | Can PI understand the codebase structure? |
|
|
113
114
|
| Non-obvious patterns | Medium | Are gotchas and quirks documented? |
|
|
114
115
|
| Conciseness | Medium | No verbose explanations or obvious info? |
|
|
@@ -136,6 +137,9 @@ Format:
|
|
|
136
137
|
- Files found: X
|
|
137
138
|
- Average score: X/100
|
|
138
139
|
- Files needing update: X
|
|
140
|
+
- Potential token savings: ~X (removing redundant/auto-delivered content)
|
|
141
|
+
|
|
142
|
+
**Auto-delivered content overlaps are never "minor" or "not worth the churn."** Content that duplicates what SuPi extensions auto-inject wastes tokens every session and MUST be flagged for removal. A single edit that saves ~200 tokens per session pays for itself within a few sessions.
|
|
139
143
|
|
|
140
144
|
### File-by-File Assessment
|
|
141
145
|
|
|
@@ -147,6 +151,7 @@ Format:
|
|
|
147
151
|
- **Fully redundant (package-specific):** [sections already covered by baseline context — applies to that package's `CLAUDE.md`]
|
|
148
152
|
- **Partially redundant:** [sections with overlap plus human-only value]
|
|
149
153
|
- **Unique:** [sections that should stay]
|
|
154
|
+
- **Estimated waste:** ~X tokens (characters ÷ 4) of existing content duplicate auto-delivered context — should be removed
|
|
150
155
|
|
|
151
156
|
| Criterion | Score | Notes |
|
|
152
157
|
|-----------|-------|-------|
|
|
@@ -161,6 +166,9 @@ Format:
|
|
|
161
166
|
**Issues:**
|
|
162
167
|
- [List specific problems]
|
|
163
168
|
|
|
169
|
+
**Recommended removals (non-negotiable for auto-delivered content):**
|
|
170
|
+
- [List what MUST be removed or compressed, with estimated token savings. Auto-delivered content is never "minor" or "not worth the churn" — it wastes tokens every session and MUST be removed.]
|
|
171
|
+
|
|
164
172
|
**Recommended additions:**
|
|
165
173
|
- [List what should be added]
|
|
166
174
|
|
|
@@ -170,24 +178,33 @@ Format:
|
|
|
170
178
|
|
|
171
179
|
### Phase 5: Targeted Updates
|
|
172
180
|
|
|
181
|
+
**Core principle: every token must earn its place in the instruction file.** If content doesn't save future sessions more time than it costs to read, remove it. No instruction file should exceed 200 lines — above that, every line must fight for its place against removal.
|
|
182
|
+
|
|
173
183
|
After outputting the quality report, ask user for confirmation before updating.
|
|
174
184
|
|
|
175
185
|
**Update Guidelines (Critical):**
|
|
176
186
|
|
|
177
|
-
1. **
|
|
178
|
-
-
|
|
187
|
+
1. **Remove or compress unnecessary content first** — Before adding anything, flag sections that MUST be removed or tightened. Never skip removals because of edit churn — a one-time edit that saves tokens every session pays for itself immediately.
|
|
188
|
+
- Routine command listings (`npm install`, `npm test`, `npm run build`) — remove; they're in package.json
|
|
189
|
+
- Package/module inventories that duplicate what `code_brief` auto-delivers — MUST be removed (these waste hundreds of tokens every session)
|
|
190
|
+
- Package layout / project structure sections that just list packages with descriptions — MUST be removed; `code_intelligence` delivers this. Architecture trees that restate what `code_map` or `code_intelligence` auto-deliver are never acceptable.
|
|
191
|
+
- Verbose explanations where a one-liner suffices — compress
|
|
192
|
+
- Stale or outdated commands, file references, or architecture descriptions — remove
|
|
193
|
+
|
|
194
|
+
2. **Then propose targeted additions** — Add only genuinely useful, non-obvious info:
|
|
195
|
+
- Non-obvious commands or workflows discovered during analysis. Non-obvious means: gotcha flags (`--unsafe`, `--runInBand`), hook behaviors, ordering requirements, cross-tool workflows. Routine commands with scoped paths (`pnpm vitest run packages/<pkg>/path`) are still routine — they're equally discoverable from the file tree.
|
|
179
196
|
- Gotchas or non-obvious patterns found in code
|
|
180
197
|
- Package relationships that weren't clear
|
|
181
198
|
- Testing approaches that work
|
|
182
199
|
- Configuration quirks
|
|
183
200
|
|
|
184
|
-
|
|
201
|
+
3. **Keep it minimal** - Avoid:
|
|
185
202
|
- Restating what's obvious from the code
|
|
186
203
|
- Generic best practices already covered
|
|
187
204
|
- One-off fixes unlikely to recur
|
|
188
205
|
- Verbose explanations when a one-liner suffices
|
|
189
206
|
|
|
190
|
-
|
|
207
|
+
4. **Show diffs** - For each change, show:
|
|
191
208
|
- Which CLAUDE.md file to update
|
|
192
209
|
- The specific addition (as a diff or quoted block)
|
|
193
210
|
- Brief explanation of why this helps future sessions
|
|
@@ -197,15 +214,10 @@ After outputting the quality report, ask user for confirmation before updating.
|
|
|
197
214
|
```markdown
|
|
198
215
|
### Update: ./CLAUDE.md
|
|
199
216
|
|
|
200
|
-
**Why:**
|
|
217
|
+
**Why:** The pre-push hook behavior wasn't documented, causing repeated confusion in CI.
|
|
201
218
|
|
|
202
219
|
```diff
|
|
203
|
-
+
|
|
204
|
-
+
|
|
205
|
-
+ ```bash
|
|
206
|
-
+ npm install
|
|
207
|
-
+ npm run dev # Start development server on port 3000
|
|
208
|
-
+ ```
|
|
220
|
+
+ The pre-push hook runs `pnpm verify` — covers both lint and tests; don't run them separately.
|
|
209
221
|
```
|
|
210
222
|
```
|
|
211
223
|
|
|
@@ -219,19 +231,18 @@ See [references/templates.md](references/templates.md) for CLAUDE.md templates b
|
|
|
219
231
|
|
|
220
232
|
## Common Issues to Flag
|
|
221
233
|
|
|
222
|
-
1. **Stale commands**:
|
|
234
|
+
1. **Stale commands**: Non-obvious commands or flags that no longer work
|
|
223
235
|
2. **Missing dependencies**: Required tools not mentioned
|
|
224
236
|
3. **Outdated architecture**: File structure that's changed
|
|
225
237
|
4. **Missing environment setup**: Required env vars or config
|
|
226
|
-
5. **
|
|
227
|
-
6. **Undocumented gotchas**: Non-obvious patterns not captured
|
|
238
|
+
5. **Undocumented gotchas**: Non-obvious patterns not captured
|
|
228
239
|
|
|
229
240
|
## User Tips to Share
|
|
230
241
|
|
|
231
242
|
When presenting recommendations, remind users:
|
|
232
243
|
|
|
233
244
|
- **Keep it concise**: CLAUDE.md should be human-readable; dense is better than verbose
|
|
234
|
-
- **Actionable commands**: All documented commands should be copy-paste ready
|
|
245
|
+
- **Actionable commands**: All documented commands should be non-obvious and copy-paste ready; skip routine ones
|
|
235
246
|
- **Use `.claude.local.md`**: For personal preferences not shared with team (add to `.gitignore`)
|
|
236
247
|
- **Global defaults**: Put user-wide preferences in `~/.claude/CLAUDE.md`
|
|
237
248
|
|
|
@@ -239,16 +250,16 @@ When presenting recommendations, remind users:
|
|
|
239
250
|
|
|
240
251
|
**Key principles:**
|
|
241
252
|
- Concise and human-readable
|
|
242
|
-
-
|
|
253
|
+
- Non-obvious commands and workflows (gotcha flags, ordering, hooks — not routine build/test)
|
|
243
254
|
- Project-specific patterns, not generic advice
|
|
244
255
|
- Non-obvious gotchas and warnings
|
|
245
256
|
|
|
246
257
|
**Recommended sections** (use only what's relevant):
|
|
247
|
-
- Commands (
|
|
258
|
+
- Non-Obvious Commands & Workflows (gotcha flags, hook behaviors, ordering)
|
|
248
259
|
- Architecture (directory structure)
|
|
249
260
|
- Key Files (entry points, config)
|
|
250
261
|
- Code Style (project conventions)
|
|
251
262
|
- Environment (required vars, setup)
|
|
252
|
-
- Testing (
|
|
263
|
+
- Testing (non-obvious patterns and conventions)
|
|
253
264
|
- Gotchas (quirks, common mistakes)
|
|
254
265
|
- Workflow (when to do what)
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Scoring Rubric
|
|
4
4
|
|
|
5
|
-
### 1. Commands
|
|
5
|
+
### 1. Non-Obvious Commands & Workflows (15 points)
|
|
6
6
|
|
|
7
|
-
**15 points**:
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
7
|
+
**15 points**: Non-obvious commands and workflow patterns captured with context
|
|
8
|
+
- Gotcha commands or required flags documented (e.g. `--unsafe`, `--runInBand`)
|
|
9
|
+
- Hook/pre-push behaviors, ordering requirements, or cross-tool workflows captured
|
|
10
|
+
- Routine install/build/test/lint commands are NOT counted toward this score
|
|
11
11
|
|
|
12
|
-
**12 points**: Most commands present, some missing context
|
|
12
|
+
**12 points**: Most non-obvious commands/workflows present, some missing context
|
|
13
13
|
|
|
14
|
-
**8 points**:
|
|
14
|
+
**8 points**: Only routine commands listed, no non-obvious patterns
|
|
15
15
|
|
|
16
|
-
**4 points**: Few
|
|
16
|
+
**4 points**: Few or irrelevant commands
|
|
17
17
|
|
|
18
|
-
**0 points**: No commands documented
|
|
18
|
+
**0 points**: No commands or workflows documented
|
|
19
19
|
|
|
20
20
|
### 2. Architecture Clarity (15 points)
|
|
21
21
|
|
|
@@ -49,16 +49,19 @@
|
|
|
49
49
|
|
|
50
50
|
### 4. Conciseness (15 points)
|
|
51
51
|
|
|
52
|
-
**15
|
|
53
|
-
- No filler or obvious info
|
|
54
|
-
- Each line adds value
|
|
55
|
-
- No redundancy with code comments
|
|
52
|
+
**Hard cap: no instruction file should exceed 200 lines.** Above 200 lines the score is capped at 5/15 regardless of content quality; above 300 lines the score is 0/15. Every line past 200 must fight for its place against removal.
|
|
56
53
|
|
|
57
|
-
**
|
|
54
|
+
**15 points**: Every token earns its place — file is ≤200 lines
|
|
55
|
+
- No filler, obvious info, or unnecessary content; every token saves more time than it costs to read
|
|
56
|
+
- Each line adds value that isn't trivially discoverable elsewhere
|
|
57
|
+
- No redundancy with code comments, package.json, or README
|
|
58
|
+
- Routine commands already removed or never present
|
|
58
59
|
|
|
59
|
-
**
|
|
60
|
+
**10 points**: Mostly concise, some padding — file is ≤200 lines
|
|
60
61
|
|
|
61
|
-
**
|
|
62
|
+
**5 points**: Over 200 lines, or verbose with significant padding
|
|
63
|
+
|
|
64
|
+
**0 points**: Over 300 lines, or mostly filler / restates obvious code
|
|
62
65
|
|
|
63
66
|
### 5. Currency (15 points)
|
|
64
67
|
|
|
@@ -98,7 +101,7 @@ Score this criterion after a **context baseline review**: compare the CLAUDE.md
|
|
|
98
101
|
|
|
99
102
|
**0 points**: Large sections are almost entirely duplicated generated context (module lists with descriptions, dense dependency tables, long root directory trees).
|
|
100
103
|
|
|
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.
|
|
104
|
+
**What is NOT overlap:** Gotchas specific to a package's behavior; cross-package patterns that aren't discoverable from manifests; non-obvious commands and workflows (gotcha flags, hook behaviors, ordering requirements — not routine npm install/test/build); 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
105
|
|
|
103
106
|
**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_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
107
|
|