claude-code-autoconfig 1.0.133 → 1.0.135
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/.claude/agents/docs-refresh.md +21 -29
- package/.claude/commands/show-docs.md +9 -29
- package/.claude/docs/autoconfig.docs.html +576 -317
- package/.claude/scripts/sync-docs.js +556 -0
- package/bin/cli.js +7 -1
- package/package.json +1 -1
|
@@ -858,35 +858,20 @@
|
|
|
858
858
|
<span class="tree-folder-icon">📁</span>
|
|
859
859
|
<span class="folder">.claude</span>
|
|
860
860
|
</div>
|
|
861
|
-
<div class="tree-item indent-2 folder-row hidden collapsed" data-info="agents" data-folder="agents" data-parent="claude-dir">
|
|
862
|
-
<span class="tree-chevron">›</span>
|
|
863
|
-
<span class="tree-folder-icon">📁</span>
|
|
864
|
-
<span class="folder">agents</span>
|
|
865
|
-
</div>
|
|
866
|
-
<div class="tree-item indent-3 hidden" data-info="create-retro-item" data-parent="agents">
|
|
867
|
-
<span class="tree-spacer"></span>
|
|
868
|
-
<span class="tree-file-icon">📄</span>
|
|
869
|
-
<span class="file">create-retro-item.md</span>
|
|
870
|
-
</div>
|
|
871
|
-
<div class="tree-item indent-3 hidden" data-info="docs-refresh-agent" data-parent="agents">
|
|
872
|
-
<span class="tree-spacer"></span>
|
|
873
|
-
<span class="tree-file-icon">📄</span>
|
|
874
|
-
<span class="file">docs-refresh.md</span>
|
|
875
|
-
</div>
|
|
876
861
|
<div class="tree-item indent-2 folder-row hidden collapsed" data-info="commands" data-folder="commands" data-parent="claude-dir">
|
|
877
862
|
<span class="tree-chevron">›</span>
|
|
878
863
|
<span class="tree-folder-icon">📁</span>
|
|
879
864
|
<span class="folder">commands</span>
|
|
880
865
|
</div>
|
|
881
|
-
<div class="tree-item indent-3 hidden" data-info="autoconfig" data-parent="commands">
|
|
866
|
+
<div class="tree-item indent-3 hidden" data-info="autoconfig-update" data-parent="commands">
|
|
882
867
|
<span class="tree-spacer"></span>
|
|
883
868
|
<span class="tree-file-icon">📄</span>
|
|
884
|
-
<span class="file">autoconfig.md</span>
|
|
869
|
+
<span class="file">autoconfig-update.md</span>
|
|
885
870
|
</div>
|
|
886
|
-
<div class="tree-item indent-3 hidden" data-info="autoconfig
|
|
871
|
+
<div class="tree-item indent-3 hidden" data-info="autoconfig" data-parent="commands">
|
|
887
872
|
<span class="tree-spacer"></span>
|
|
888
873
|
<span class="tree-file-icon">📄</span>
|
|
889
|
-
<span class="file">autoconfig
|
|
874
|
+
<span class="file">autoconfig.md</span>
|
|
890
875
|
</div>
|
|
891
876
|
<div class="tree-item indent-3 hidden" data-info="commit-and-push" data-parent="commands">
|
|
892
877
|
<span class="tree-spacer"></span>
|
|
@@ -903,12 +888,17 @@
|
|
|
903
888
|
<span class="tree-file-icon">📄</span>
|
|
904
889
|
<span class="file">gls.md</span>
|
|
905
890
|
</div>
|
|
891
|
+
<div class="tree-item indent-3 hidden" data-info="publish" data-parent="commands">
|
|
892
|
+
<span class="tree-spacer"></span>
|
|
893
|
+
<span class="tree-file-icon">📄</span>
|
|
894
|
+
<span class="file">publish.md</span>
|
|
895
|
+
</div>
|
|
906
896
|
<div class="tree-item indent-3 hidden" data-info="recover-context" data-parent="commands">
|
|
907
897
|
<span class="tree-spacer"></span>
|
|
908
898
|
<span class="tree-file-icon">📄</span>
|
|
909
899
|
<span class="file">recover-context.md</span>
|
|
910
900
|
</div>
|
|
911
|
-
<div class="tree-item indent-3 hidden" data-info="docs
|
|
901
|
+
<div class="tree-item indent-3 hidden" data-info="show-docs" data-parent="commands">
|
|
912
902
|
<span class="tree-spacer"></span>
|
|
913
903
|
<span class="tree-file-icon">📄</span>
|
|
914
904
|
<span class="file">show-docs.md</span>
|
|
@@ -923,12 +913,27 @@
|
|
|
923
913
|
<span class="tree-file-icon">📄</span>
|
|
924
914
|
<span class="file">test.md</span>
|
|
925
915
|
</div>
|
|
916
|
+
<div class="tree-item indent-2 folder-row hidden collapsed" data-info="agents" data-folder="agents" data-parent="claude-dir">
|
|
917
|
+
<span class="tree-chevron">›</span>
|
|
918
|
+
<span class="tree-folder-icon">📁</span>
|
|
919
|
+
<span class="folder">agents</span>
|
|
920
|
+
</div>
|
|
921
|
+
<div class="tree-item indent-3 hidden" data-info="create-retro-item-agent" data-parent="agents">
|
|
922
|
+
<span class="tree-spacer"></span>
|
|
923
|
+
<span class="tree-file-icon">📄</span>
|
|
924
|
+
<span class="file">create-retro-item.md</span>
|
|
925
|
+
</div>
|
|
926
|
+
<div class="tree-item indent-3 hidden" data-info="docs-refresh-agent" data-parent="agents">
|
|
927
|
+
<span class="tree-spacer"></span>
|
|
928
|
+
<span class="tree-file-icon">📄</span>
|
|
929
|
+
<span class="file">docs-refresh.md</span>
|
|
930
|
+
</div>
|
|
926
931
|
<div class="tree-item indent-2 folder-row hidden collapsed" data-info="feedback" data-folder="feedback" data-parent="claude-dir">
|
|
927
932
|
<span class="tree-chevron">›</span>
|
|
928
933
|
<span class="tree-folder-icon">📁</span>
|
|
929
934
|
<span class="folder">feedback</span>
|
|
930
935
|
</div>
|
|
931
|
-
<div class="tree-item indent-3 hidden" data-info="feedback-
|
|
936
|
+
<div class="tree-item indent-3 hidden" data-info="feedback-feedback" data-parent="feedback">
|
|
932
937
|
<span class="tree-spacer"></span>
|
|
933
938
|
<span class="tree-file-icon">📄</span>
|
|
934
939
|
<span class="file">FEEDBACK.md</span>
|
|
@@ -938,11 +943,21 @@
|
|
|
938
943
|
<span class="tree-folder-icon">📁</span>
|
|
939
944
|
<span class="folder">hooks</span>
|
|
940
945
|
</div>
|
|
946
|
+
<div class="tree-item indent-3 hidden" data-info="feedback-rule-check-hook" data-parent="hooks">
|
|
947
|
+
<span class="tree-spacer"></span>
|
|
948
|
+
<span class="tree-file-icon">📄</span>
|
|
949
|
+
<span class="file">feedback-rule-check.js</span>
|
|
950
|
+
</div>
|
|
941
951
|
<div class="tree-item indent-3 hidden" data-info="format-hook" data-parent="hooks">
|
|
942
952
|
<span class="tree-spacer"></span>
|
|
943
953
|
<span class="tree-file-icon">📄</span>
|
|
944
954
|
<span class="file">format.js</span>
|
|
945
955
|
</div>
|
|
956
|
+
<div class="tree-item indent-3 hidden" data-info="migrate-feedback-hook" data-parent="hooks">
|
|
957
|
+
<span class="tree-spacer"></span>
|
|
958
|
+
<span class="tree-file-icon">📄</span>
|
|
959
|
+
<span class="file">migrate-feedback.js</span>
|
|
960
|
+
</div>
|
|
946
961
|
<div class="tree-item indent-2 folder-row hidden collapsed" data-info="docs" data-folder="docs-folder" data-parent="claude-dir">
|
|
947
962
|
<span class="tree-chevron">›</span>
|
|
948
963
|
<span class="tree-folder-icon">📁</span>
|
|
@@ -968,13 +983,7 @@
|
|
|
968
983
|
<span class="tree-file-icon">⚙️</span>
|
|
969
984
|
<span class="file">settings.json</span>
|
|
970
985
|
</div>
|
|
971
|
-
<div class="tree-item indent-1" data-info="claude-md" data-parent="root">
|
|
972
|
-
<span class="tree-spacer"></span>
|
|
973
|
-
<span class="tree-file-icon">📄</span>
|
|
974
|
-
<span class="file">CLAUDE.md</span>
|
|
975
986
|
</div>
|
|
976
|
-
</div>
|
|
977
|
-
<div class="tree-footer-hint">Double-click any file to preview contents</div>
|
|
978
987
|
</div>
|
|
979
988
|
<div class="info-side">
|
|
980
989
|
<div class="info-panel" id="infoPanel">
|
|
@@ -1254,101 +1263,121 @@
|
|
|
1254
1263
|
title: '.claude/ Directory',
|
|
1255
1264
|
desc: 'Commands, rules, settings, and these docs. Keeps configuration organized as your project grows.'
|
|
1256
1265
|
},
|
|
1257
|
-
|
|
1258
|
-
title: '
|
|
1259
|
-
desc: '
|
|
1260
|
-
trigger: 'Claude Code loads this automatically at the start of every session'
|
|
1261
|
-
},
|
|
1262
|
-
'mcp': {
|
|
1263
|
-
title: '.mcp.json',
|
|
1264
|
-
desc: 'MCP (Model Context Protocol) server configuration. Add your MCP server configs here when you\'re ready.<br><br>See <a href="https://docs.anthropic.com/en/docs/claude-code/mcp" target="_blank" style="color: var(--accent-cyan);">MCP documentation</a> for setup instructions.'
|
|
1265
|
-
},
|
|
1266
|
-
'agents': {
|
|
1267
|
-
title: 'agents/',
|
|
1268
|
-
desc: 'Custom agent definitions for specialized tasks. Agents are autonomous workers that can be spawned to handle complex operations independently.'
|
|
1269
|
-
},
|
|
1270
|
-
'create-retro-item': {
|
|
1271
|
-
title: 'create-retro-item.md',
|
|
1272
|
-
desc: '(Experimental) Agent that creates structured retro items for tech debt tracking. Used by the /enable-retro feature.'
|
|
1273
|
-
},
|
|
1274
|
-
'docs-refresh-agent': {
|
|
1275
|
-
title: 'docs-refresh.md',
|
|
1276
|
-
desc: 'Agent that refreshes and updates the interactive docs after configuration changes.'
|
|
1266
|
+
'rules': {
|
|
1267
|
+
title: 'rules/',
|
|
1268
|
+
desc: 'Path-scoped context that loads when Claude works on matching files.'
|
|
1277
1269
|
},
|
|
1278
1270
|
'commands': {
|
|
1279
1271
|
title: 'commands/',
|
|
1280
1272
|
desc: 'On-demand workflows you trigger with <code>/name</code>. Each .md file becomes a <a href="https://docs.anthropic.com/en/docs/claude-code/slash-commands" target="_blank" style="color: var(--accent-cyan);">slash command</a>.'
|
|
1281
1273
|
},
|
|
1282
|
-
'
|
|
1283
|
-
title: '
|
|
1284
|
-
desc: '
|
|
1285
|
-
|
|
1274
|
+
'agents': {
|
|
1275
|
+
title: 'agents/',
|
|
1276
|
+
desc: 'Reusable agent definitions that Claude can invoke for specialized tasks.'
|
|
1277
|
+
},
|
|
1278
|
+
'hooks': {
|
|
1279
|
+
title: 'hooks/',
|
|
1280
|
+
desc: 'Executable hook scripts that trigger on Claude Code events like PostToolUse.'
|
|
1286
1281
|
},
|
|
1287
1282
|
'feedback': {
|
|
1288
1283
|
title: 'feedback/',
|
|
1289
1284
|
desc: 'Team-maintained corrections and guidance for Claude. Add notes here when Claude does something wrong — it learns for next time. This directory persists across <code>/autoconfig</code> runs.'
|
|
1290
1285
|
},
|
|
1291
|
-
'
|
|
1292
|
-
title: '
|
|
1293
|
-
desc: '
|
|
1294
|
-
|
|
1295
|
-
'hooks': {
|
|
1296
|
-
title: 'hooks/',
|
|
1297
|
-
desc: 'Executable scripts that run in response to Claude Code events. Unlike commands (which are prompts you invoke), hooks trigger automatically based on tool usage patterns.'
|
|
1298
|
-
},
|
|
1299
|
-
'format-hook': {
|
|
1300
|
-
title: 'format.js',
|
|
1301
|
-
desc: 'Runs the project formatter after Write/Edit operations on source files. Filters by file extension and skips generated directories like node_modules.',
|
|
1302
|
-
trigger: 'PostToolUse on Write|Edit (JS/TS projects only)'
|
|
1286
|
+
'autoconfig-update': {
|
|
1287
|
+
title: 'autoconfig-update.md',
|
|
1288
|
+
desc: 'Manages and installs updates to Claude Code configuration.',
|
|
1289
|
+
trigger: '/autoconfig-update'
|
|
1303
1290
|
},
|
|
1304
1291
|
'autoconfig': {
|
|
1305
1292
|
title: 'autoconfig.md',
|
|
1306
1293
|
desc: 'The command you just ran. Analyzes your project and populates CLAUDE.md with real context. Re-run anytime your stack changes.',
|
|
1307
1294
|
trigger: '/autoconfig'
|
|
1308
1295
|
},
|
|
1309
|
-
'
|
|
1310
|
-
title: '
|
|
1311
|
-
desc: '
|
|
1312
|
-
trigger: '/
|
|
1296
|
+
'commit-and-push': {
|
|
1297
|
+
title: 'commit-and-push.md',
|
|
1298
|
+
desc: 'Runs tests, then stages all changes, generates a conventional commit message, commits, and pushes.',
|
|
1299
|
+
trigger: '/commit-and-push'
|
|
1300
|
+
},
|
|
1301
|
+
'enable-retro': {
|
|
1302
|
+
title: 'enable-retro.md',
|
|
1303
|
+
desc: '(Experimental) Enable Claude to log tech debt it encounters into .claude/retro.',
|
|
1304
|
+
trigger: '/enable-retro'
|
|
1313
1305
|
},
|
|
1314
1306
|
'gls': {
|
|
1315
1307
|
title: 'gls.md',
|
|
1316
|
-
desc: '
|
|
1308
|
+
desc: 'gls.md in commands/',
|
|
1317
1309
|
trigger: '/gls'
|
|
1318
1310
|
},
|
|
1311
|
+
'publish': {
|
|
1312
|
+
title: 'publish.md',
|
|
1313
|
+
desc: 'Runs tests, bumps version, commits, and publishes to npm.',
|
|
1314
|
+
trigger: '/publish'
|
|
1315
|
+
},
|
|
1319
1316
|
'recover-context': {
|
|
1320
1317
|
title: 'recover-context.md',
|
|
1321
|
-
desc: 'Recovers conversation context
|
|
1318
|
+
desc: 'Recovers conversation context from the session transcript after compaction.',
|
|
1322
1319
|
trigger: '/recover-context'
|
|
1323
1320
|
},
|
|
1321
|
+
'show-docs': {
|
|
1322
|
+
title: 'show-docs.md',
|
|
1323
|
+
desc: 'Opens the interactive docs in your browser.',
|
|
1324
|
+
trigger: '/show-docs'
|
|
1325
|
+
},
|
|
1324
1326
|
'sync-claude-md': {
|
|
1325
1327
|
title: 'sync-claude-md.md',
|
|
1326
|
-
desc: 'Re-analyzes your project and updates CLAUDE.md to reflect current state.
|
|
1328
|
+
desc: 'Re-analyzes your project and updates CLAUDE.md to reflect current state.',
|
|
1327
1329
|
trigger: '/sync-claude-md'
|
|
1328
1330
|
},
|
|
1329
|
-
'docs-cmd': {
|
|
1330
|
-
title: 'show-docs.md',
|
|
1331
|
-
desc: 'Opens this interactive docs in your browser. Auto-syncs any changed files before opening.',
|
|
1332
|
-
trigger: '/show-docs'
|
|
1333
|
-
},
|
|
1334
1331
|
'test': {
|
|
1335
1332
|
title: 'test.md',
|
|
1336
1333
|
desc: 'Runs your test suite. Auto-detects Jest, Vitest, Pytest, Go, RSpec, or falls back to npm test.',
|
|
1337
1334
|
trigger: '/test'
|
|
1338
1335
|
},
|
|
1339
|
-
'
|
|
1340
|
-
title: '
|
|
1341
|
-
desc: '
|
|
1342
|
-
trigger: '
|
|
1336
|
+
'create-retro-item-agent': {
|
|
1337
|
+
title: 'create-retro-item.md',
|
|
1338
|
+
desc: 'Creates a formatted retro item when tech debt or improvements are spotted.',
|
|
1339
|
+
trigger: 'Background agent'
|
|
1343
1340
|
},
|
|
1344
|
-
'
|
|
1345
|
-
title: '
|
|
1346
|
-
desc: '
|
|
1341
|
+
'docs-refresh-agent': {
|
|
1342
|
+
title: 'docs-refresh.md',
|
|
1343
|
+
desc: 'Background worker that syncs the docs when .claude/ files change.',
|
|
1344
|
+
trigger: 'Background agent'
|
|
1345
|
+
},
|
|
1346
|
+
'feedback-rule-check-hook': {
|
|
1347
|
+
title: 'feedback-rule-check.js',
|
|
1348
|
+
desc: 'After FEEDBACK.md is edited, notifies Claude to evaluate',
|
|
1349
|
+
trigger: 'PostToolUse on Write|Edit'
|
|
1350
|
+
},
|
|
1351
|
+
'format-hook': {
|
|
1352
|
+
title: 'format.js',
|
|
1353
|
+
desc: 'format.js in hooks/',
|
|
1354
|
+
trigger: 'PostToolUse hook'
|
|
1355
|
+
},
|
|
1356
|
+
'migrate-feedback-hook': {
|
|
1357
|
+
title: 'migrate-feedback.js',
|
|
1358
|
+
desc: 'On session start, migrates custom FEEDBACK.md content to',
|
|
1359
|
+
trigger: 'SessionStart'
|
|
1360
|
+
},
|
|
1361
|
+
'feedback-feedback': {
|
|
1362
|
+
title: 'FEEDBACK.md',
|
|
1363
|
+
desc: 'Human-authored corrections and guidance for Claude. Reserved for team feedback only — Claude must not write here. This directory persists across /autoconfig runs.'
|
|
1347
1364
|
},
|
|
1348
1365
|
'docs': {
|
|
1349
1366
|
title: 'docs/autoconfig.docs.html',
|
|
1350
1367
|
desc: 'This interactive docs. Open it anytime to review what each file does.',
|
|
1351
1368
|
trigger: '/show-docs'
|
|
1369
|
+
},
|
|
1370
|
+
'rules': {
|
|
1371
|
+
title: 'rules/',
|
|
1372
|
+
desc: 'Path-scoped context that loads when Claude works on matching files. Optimized rules are based on your project\'s needs, patterns and practices.<br><br><div style="background: var(--bg-elevated); border: 1px solid var(--accent-cyan); border-radius: 8px; padding: 16px; margin-top: 8px;"><strong style="color: var(--accent-orange);">Want optimized rules for your project?</strong><br>Reach out: <a href="mailto:info@adac1001.com" style="color: var(--accent-cyan);">info@adac1001.com</a></div>'
|
|
1373
|
+
},
|
|
1374
|
+
'mcp': {
|
|
1375
|
+
title: '.mcp.json',
|
|
1376
|
+
desc: 'MCP (Model Context Protocol) server configuration. Add your MCP servers here.'
|
|
1377
|
+
},
|
|
1378
|
+
'settings': {
|
|
1379
|
+
title: 'settings.json',
|
|
1380
|
+
desc: 'Permissions and security settings. Controls what Claude can auto-approve (allow) and what is always blocked (deny).'
|
|
1352
1381
|
}
|
|
1353
1382
|
};
|
|
1354
1383
|
|
|
@@ -1540,229 +1569,282 @@ CRITICAL: A plausible-looking cause from code reading is NOT confirmed evidence.
|
|
|
1540
1569
|
|
|
1541
1570
|
> Run \`/autoconfig\` to populate this based on your project.`
|
|
1542
1571
|
},
|
|
1543
|
-
|
|
1544
|
-
filename: '
|
|
1545
|
-
content:
|
|
1546
|
-
|
|
1547
|
-
"allow": [
|
|
1548
|
-
"Read(./**)",
|
|
1549
|
-
"Edit(./**)",
|
|
1550
|
-
"Write(./**)",
|
|
1551
|
-
"Glob",
|
|
1552
|
-
"Grep",
|
|
1553
|
-
"WebSearch",
|
|
1554
|
-
"WebFetch",
|
|
1555
|
-
"Bash(npm run dev)",
|
|
1556
|
-
"Bash(npm run build)",
|
|
1557
|
-
"Bash(npm run lint)",
|
|
1558
|
-
"Bash(npm run lint:fix)",
|
|
1559
|
-
"Bash(npm run typecheck)",
|
|
1560
|
-
"Bash(npm run test)",
|
|
1561
|
-
"Bash(npm run test:*)",
|
|
1562
|
-
"Bash(npm run validate)",
|
|
1563
|
-
"Bash(git status)",
|
|
1564
|
-
"Bash(git diff:*)",
|
|
1565
|
-
"Bash(git add:*)",
|
|
1566
|
-
"Bash(git commit:*)",
|
|
1567
|
-
"Bash(git push:*)",
|
|
1568
|
-
"Bash(git pull)",
|
|
1569
|
-
"Bash(git checkout:*)",
|
|
1570
|
-
"Bash(git branch:*)",
|
|
1571
|
-
"Bash(ls:*)",
|
|
1572
|
-
"Bash(dir:*)",
|
|
1573
|
-
"Bash(mkdir:*)",
|
|
1574
|
-
"Bash(mkdir -p:*)",
|
|
1575
|
-
"Bash(start:*)",
|
|
1576
|
-
"Bash(start .claude:*)",
|
|
1577
|
-
"Bash(open:*)",
|
|
1578
|
-
"Bash(open .claude:*)",
|
|
1579
|
-
"Bash(xdg-open:*)",
|
|
1580
|
-
"Bash(xdg-open .claude:*)"
|
|
1581
|
-
],
|
|
1582
|
-
"deny": [
|
|
1583
|
-
"Read(./.env)",
|
|
1584
|
-
"Read(./.env.*)",
|
|
1585
|
-
"Read(./secrets/**)",
|
|
1586
|
-
"Read(./**/credentials.*)",
|
|
1587
|
-
"Read(./**/*.pem)",
|
|
1588
|
-
"Read(./**/*.key)",
|
|
1589
|
-
"Write(./nul)",
|
|
1590
|
-
"Edit(./nul)",
|
|
1591
|
-
"Bash(rm -rf:*)",
|
|
1592
|
-
"Bash(curl:*)",
|
|
1593
|
-
"Bash(wget:*)"
|
|
1594
|
-
]
|
|
1595
|
-
}
|
|
1596
|
-
}`
|
|
1597
|
-
},
|
|
1598
|
-
'mcp': {
|
|
1599
|
-
filename: '.mcp.json',
|
|
1600
|
-
content: `{
|
|
1601
|
-
"mcpServers": {}
|
|
1602
|
-
}
|
|
1572
|
+
'autoconfig-update': {
|
|
1573
|
+
filename: 'autoconfig-update.md',
|
|
1574
|
+
content: `<!-- @applied
|
|
1575
|
+
-->
|
|
1603
1576
|
|
|
1604
|
-
|
|
1605
|
-
// See: https://docs.anthropic.com/en/docs/claude-code/mcp`
|
|
1606
|
-
},
|
|
1607
|
-
'create-retro-item': {
|
|
1608
|
-
filename: 'create-retro-item.md',
|
|
1609
|
-
content: `# Create Retro Item Agent
|
|
1577
|
+
# Autoconfig Update
|
|
1610
1578
|
|
|
1611
|
-
|
|
1579
|
+
Check for and install pending updates to your Claude Code configuration.
|
|
1612
1580
|
|
|
1613
|
-
|
|
1581
|
+
**Style guideline**: Work silently through Steps 1-3. Do not narrate internal steps, implementation details, or progress messages (e.g., "Let me check...", "The @applied block is empty..."). The first output the user sees should be the formatted summary in Step 4 (or the "up to date" message).
|
|
1614
1582
|
|
|
1615
|
-
|
|
1616
|
-
- Tech debt that should be addressed later
|
|
1617
|
-
- Code that works but could be improved
|
|
1618
|
-
- Missing tests, documentation, or error handling
|
|
1619
|
-
- Architectural improvements worth tracking
|
|
1583
|
+
## Step 1: Pull Latest Updates
|
|
1620
1584
|
|
|
1621
|
-
|
|
1585
|
+
Run this command via Bash to pull new update files from the latest package:
|
|
1622
1586
|
|
|
1623
|
-
|
|
1624
|
-
-
|
|
1625
|
-
|
|
1626
|
-
- **criteria**: Specific, testable acceptance criteria
|
|
1627
|
-
- **approach**: How to fix it
|
|
1628
|
-
- **priority**: Critical | High | Medium | Low
|
|
1629
|
-
- **effort**: S | M | L | XL
|
|
1630
|
-
- **files**: List of files involved
|
|
1587
|
+
\`\`\`bash
|
|
1588
|
+
npx claude-code-autoconfig@latest --pull-updates
|
|
1589
|
+
\`\`\`
|
|
1631
1590
|
|
|
1632
|
-
|
|
1591
|
+
This copies any new update \`.md\` files into \`.claude/updates/\` and refreshes this command file (preserving the \`@applied\` block above).
|
|
1633
1592
|
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1593
|
+
After the command completes, check \`.claude/updates/\` directory. If it doesn't exist or is empty, output:
|
|
1594
|
+
|
|
1595
|
+
\`\`\`
|
|
1596
|
+
No new updates available. You're up to date.
|
|
1597
|
+
\`\`\`
|
|
1598
|
+
|
|
1599
|
+
Then stop — do not continue to further steps.
|
|
1637
1600
|
|
|
1638
|
-
##
|
|
1601
|
+
## Step 2: Parse Update Files
|
|
1639
1602
|
|
|
1640
|
-
|
|
1641
|
-
- **Be specific**: Include actual file paths and line numbers when relevant
|
|
1642
|
-
- **Don't duplicate**: Check if similar item already exists first
|
|
1643
|
-
- **Don't block**: Create the item and continue with the main task`
|
|
1603
|
+
Read all \`.md\` files in \`.claude/updates/\` matching the pattern \`NNN-*.md\` (e.g., \`001-debug-methodology.md\`).`
|
|
1644
1604
|
},
|
|
1645
|
-
'
|
|
1646
|
-
filename: '
|
|
1647
|
-
content: `#
|
|
1605
|
+
'autoconfig': {
|
|
1606
|
+
filename: 'autoconfig.md',
|
|
1607
|
+
content: `# Autoconfig
|
|
1648
1608
|
|
|
1649
|
-
|
|
1609
|
+
Analyze this project and configure Claude Code with real context.
|
|
1650
1610
|
|
|
1651
|
-
|
|
1611
|
+
**Setup Note**: During autoconfig, prefer Glob/Read/Write tools over Bash commands. This ensures smooth setup without permission prompts. Only use Bash for the bootstrap step and opening the guide at the end.
|
|
1652
1612
|
|
|
1653
|
-
|
|
1613
|
+
## Step 0a: Bootstrap files from latest package
|
|
1654
1614
|
|
|
1655
|
-
|
|
1615
|
+
**MANDATORY: You MUST run this Bash command before doing anything else.** Do not skip it. Do not assume it will fail. It is designed to work inside Claude Code sessions:
|
|
1656
1616
|
|
|
1657
|
-
|
|
1658
|
-
|
|
1617
|
+
\`\`\`bash
|
|
1618
|
+
npx claude-code-autoconfig@latest --bootstrap
|
|
1619
|
+
\`\`\`
|
|
1659
1620
|
|
|
1660
|
-
|
|
1621
|
+
This downloads the latest package and copies slash commands, hooks, agents, docs, and settings into \`.claude/\`. The \`--bootstrap\` flag makes it safe to run inside Claude Code — it copies files and exits silently with code 0. If it fails (e.g., no network), continue anyway — the existing files will still work.
|
|
1622
|
+
|
|
1623
|
+
## Step 0b: Migrate FEEDBACK.md to Discoveries (one-time)
|
|
1661
1624
|
|
|
1662
|
-
|
|
1663
|
-
2. Extract the \`<!-- @description ... -->\` comment from the top
|
|
1664
|
-
3. Find the corresponding entry in the docs's \`treeInfo\` object
|
|
1665
|
-
4. Update only that entry's \`desc\` field
|
|
1666
|
-
5. If file is new, add a new treeInfo entry
|
|
1667
|
-
6. If file was deleted, remove the treeInfo entry
|
|
1625
|
+
Read \`.claude/feedback/FEEDBACK.md\`. If it contains custom content beyond the default template header (sections after the first \`---\`), and \`CLAUDE.md\` does NOT already have a \`## Discoveries\` section:
|
|
1668
1626
|
|
|
1669
|
-
|
|
1627
|
+
1. Read all custom content from FEEDBACK.md (everything after the first \`---\` separator)
|
|
1628
|
+
2. Append a \`## Discoveries\` section to the bottom of CLAUDE.md with that content
|
|
1629
|
+
3. Reset FEEDBACK.md to the clean template:
|
|
1630
|
+
\`\`\`
|
|
1631
|
+
<!-- @description Human-authored corrections and guidance for Claude. Reserved for team feedback only — Claude must not write here. This directory persists across /autoconfig runs. -->
|
|
1670
1632
|
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1633
|
+
# Team Feedback
|
|
1634
|
+
|
|
1635
|
+
**This file is for human-authored corrections and guidance only.**
|
|
1636
|
+
Claude reads this file but must never write to it. When Claude discovers project context, gotchas, or learnings, it should append to the \`## Discoveries\` section in CLAUDE.md instead.`
|
|
1674
1637
|
},
|
|
1675
|
-
'
|
|
1676
|
-
filename: '
|
|
1677
|
-
content: `#
|
|
1638
|
+
'commit-and-push': {
|
|
1639
|
+
filename: 'commit-and-push.md',
|
|
1640
|
+
content: `# Commit and Push
|
|
1678
1641
|
|
|
1679
|
-
|
|
1642
|
+
Run tests, stage all changes, create a commit with a good message, and push to the current branch.
|
|
1680
1643
|
|
|
1681
|
-
|
|
1644
|
+
## Steps
|
|
1682
1645
|
|
|
1683
|
-
|
|
1646
|
+
1. Run the project's test suite (e.g., \`npm test\`)
|
|
1647
|
+
2. **If tests fail, stop here.** Do not commit or push failing code.
|
|
1648
|
+
3. Stage all changes (\`git add -A\`)
|
|
1649
|
+
4. Generate a conventional commit message based on the diff
|
|
1650
|
+
5. Commit the changes
|
|
1651
|
+
6. Push to the current branch
|
|
1684
1652
|
|
|
1685
|
-
|
|
1686
|
-
Check the platform and note it for command syntax:
|
|
1687
|
-
- Windows → use \\\`del\\\`, \\\`rmdir\\\`, backslashes, \\\`.cmd\\\`/\\\`.ps1\\\` scripts
|
|
1688
|
-
- macOS/Linux → use \\\`rm\\\`, \\\`mkdir -p\\\`, forward slashes, \\\`.sh\\\` scripts
|
|
1653
|
+
## Commit Message Format
|
|
1689
1654
|
|
|
1690
|
-
|
|
1655
|
+
Use conventional commits: \`type(scope): description\`
|
|
1691
1656
|
|
|
1692
|
-
|
|
1657
|
+
Types: feat, fix, docs, style, refactor, test, chore
|
|
1693
1658
|
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
-
|
|
1697
|
-
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1659
|
+
Keep the subject line under 50 chars. Add body if the change needs explanation.`
|
|
1660
|
+
},
|
|
1661
|
+
'enable-retro': {
|
|
1662
|
+
filename: 'enable-retro.md',
|
|
1663
|
+
content: `# Enable Retro
|
|
1664
|
+
|
|
1665
|
+
Enable the experimental Retro feature, which lets Claude log tech debt and improvement opportunities as structured story files.
|
|
1666
|
+
|
|
1667
|
+
## What This Does
|
|
1668
|
+
|
|
1669
|
+
1. Creates \`.claude/retro/\` directory with a README
|
|
1670
|
+
2. Creates \`.claude/agents/create-retro-item.md\` agent
|
|
1671
|
+
3. Adds Retro instructions to CLAUDE.md
|
|
1672
|
+
|
|
1673
|
+
## Step 1: Create Retro Directory
|
|
1703
1674
|
|
|
1704
|
-
|
|
1675
|
+
Create \`.claude/retro/README.md\` with:
|
|
1705
1676
|
|
|
1706
|
-
|
|
1677
|
+
\`\`\`markdown
|
|
1678
|
+
# Retro Items
|
|
1707
1679
|
|
|
1708
|
-
|
|
1680
|
+
Tech debt and improvement opportunities identified during development.
|
|
1709
1681
|
|
|
1710
|
-
|
|
1682
|
+
Each item is a structured story file with:
|
|
1683
|
+
- Problem description
|
|
1684
|
+
- Acceptance criteria
|
|
1685
|
+
- Suggested approach
|
|
1686
|
+
- Priority & effort sizing
|
|
1687
|
+
- Files involved
|
|
1688
|
+
|
|
1689
|
+
## Working with Retro Items
|
|
1690
|
+
|
|
1691
|
+
- "Fix retro #001" — Work on a specific item
|
|
1692
|
+
- "What's in the retro backlog?" — List pending items`
|
|
1693
|
+
},
|
|
1694
|
+
'gls': {
|
|
1695
|
+
filename: 'gls.md',
|
|
1696
|
+
content: `Get the latest screenshot(s) and display them.
|
|
1711
1697
|
|
|
1712
|
-
|
|
1698
|
+
Usage:
|
|
1699
|
+
- \`/gls\` - Get and display the most recent screenshot
|
|
1700
|
+
- \`/gls-2\` - Get and display the 2 most recent screenshots
|
|
1701
|
+
- \`/gls-3\` - Get and display the 3 most recent screenshots
|
|
1702
|
+
- \`/gls-N\` - Get and display the N most recent screenshots
|
|
1703
|
+
- \`/gls /path/to/dir\` - Use a specific directory and save it
|
|
1713
1704
|
|
|
1714
|
-
|
|
1715
|
-
**Skip:** File trees, endpoint lists, model lists — Claude discovers these.
|
|
1705
|
+
## Step 1: Check for saved path
|
|
1716
1706
|
|
|
1717
|
-
|
|
1718
|
-
## Step 5: Configure Formatter (JS/Node Projects)
|
|
1719
|
-
## Step 6: Configure Settings
|
|
1720
|
-
## Step 7: Update the Docs
|
|
1707
|
+
Check the \`@screenshotDir\` comment on line 1 of THIS file. If it has a path (not empty), use that path and skip to Step 3.
|
|
1721
1708
|
|
|
1722
|
-
|
|
1709
|
+
If it's empty (i.e., \`<!-- @screenshotDir -->\`), continue to Step 2.
|
|
1723
1710
|
|
|
1724
|
-
|
|
1711
|
+
## Step 2: Detect screenshot directory
|
|
1712
|
+
|
|
1713
|
+
If the user provides a path as an argument (e.g., \`/gls /path/to/dir\`), use that path and skip to Step 2b.
|
|
1714
|
+
|
|
1715
|
+
Otherwise, detect the OS and find the screenshot directory. Run this **single Bash command** which finds all candidate directories and reports the newest screenshot in each:
|
|
1716
|
+
|
|
1717
|
+
\`\`\`bash
|
|
1718
|
+
OS=$(uname -s); echo "OS=$OS"; for d in \\
|
|
1719
|
+
"$HOME/OneDrive/Pictures/Screenshots"* \\
|
|
1720
|
+
"$HOME/Pictures/Screenshots" \\
|
|
1721
|
+
"$HOME/Desktop" \\
|
|
1722
|
+
"$HOME/Pictures" \\
|
|
1723
|
+
"$HOME/Videos/Captures"; do \\
|
|
1724
|
+
[ -d "$d" ] || continue; \\
|
|
1725
|
+
newest=$(ls -t "$d"/*.png "$d"/*.jpg "$d"/*.jpeg "$d"/*.bmp "$d"/*.webp "$d"/*.gif 2>/dev/null | head -1); \\`
|
|
1725
1726
|
},
|
|
1726
|
-
'
|
|
1727
|
-
filename: '
|
|
1728
|
-
content: `#
|
|
1727
|
+
'publish': {
|
|
1728
|
+
filename: 'publish.md',
|
|
1729
|
+
content: `# Publish
|
|
1729
1730
|
|
|
1730
|
-
|
|
1731
|
+
Run tests, bump the patch version, commit, push, and publish to npm.
|
|
1731
1732
|
|
|
1732
1733
|
## Steps
|
|
1733
1734
|
|
|
1734
|
-
1.
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1735
|
+
1. **Sync README.md** — Compare the current README against the actual state of the project (file tree, slash commands, features, settings). If anything is out of date or missing, update the README before proceeding. Check:
|
|
1736
|
+
- File tree matches actual \`.claude/\` directory contents
|
|
1737
|
+
- Slash commands table matches actual \`.claude/commands/\` files
|
|
1738
|
+
- Feature sections reflect current capabilities (update system, MEMORY.md, hooks, etc.)
|
|
1739
|
+
- No references to nonexistent commands or files
|
|
1740
|
+
2. Run the project's test suite (\`npm test\`)
|
|
1741
|
+
3. **If tests fail, stop here.** Do not publish broken code.
|
|
1742
|
+
4. Check for uncommitted changes. If there are any:
|
|
1743
|
+
a. Stage all changes (\`git add -A\`)
|
|
1744
|
+
b. Generate a conventional commit message based on the diff
|
|
1745
|
+
c. Commit the changes
|
|
1746
|
+
5. Bump the version: \`npm version patch\`
|
|
1747
|
+
6. Push the commit and tag: \`git push && git push --tags\`
|
|
1748
|
+
7. Publish to npm: \`npm publish\`
|
|
1749
|
+
8. Output the new version number on success
|
|
1750
|
+
|
|
1751
|
+
## Important
|
|
1752
|
+
|
|
1753
|
+
- Always run tests before publishing — never skip this step
|
|
1754
|
+
- If any step fails, stop immediately and report the error
|
|
1755
|
+
- Do not use \`--force\` on publish unless the user explicitly asks`
|
|
1756
|
+
},
|
|
1757
|
+
'recover-context': {
|
|
1758
|
+
filename: 'recover-context.md',
|
|
1759
|
+
content: `Recover recent conversation context from the raw session transcript on disk.
|
|
1738
1760
|
|
|
1739
|
-
|
|
1761
|
+
Usage:
|
|
1762
|
+
- \`/recover-context -60\` — last 60 minutes of conversation
|
|
1763
|
+
- \`/recover-context -30\` — last 30 minutes
|
|
1764
|
+
- \`/recover-context -120\` — last 2 hours
|
|
1765
|
+
- \`/recover-context -60 --show\` — same as above, but also opens the filtered transcript in default editor
|
|
1740
1766
|
|
|
1741
|
-
|
|
1767
|
+
The negative number means "go back N minutes from now." The minutes argument is **required**.
|
|
1742
1768
|
|
|
1743
|
-
|
|
1769
|
+
## Step 1: Parse the arguments
|
|
1744
1770
|
|
|
1745
|
-
|
|
1771
|
+
The arguments are: $ARGUMENTS
|
|
1772
|
+
|
|
1773
|
+
- If empty or missing, ask the user: "How many minutes back? (e.g., -60)"
|
|
1774
|
+
- Strip the leading \`-\` from the number and treat it as the number of minutes to look back
|
|
1775
|
+
- Check if \`--show\` flag is present
|
|
1776
|
+
|
|
1777
|
+
## Step 2: Find the transcript file
|
|
1778
|
+
|
|
1779
|
+
Find the current session's transcript by looking for the most recently modified \`.jsonl\` file in the Claude projects directory:
|
|
1780
|
+
|
|
1781
|
+
\`\`\`bash
|
|
1782
|
+
ls -t ~/.claude/projects/*/*.jsonl 2>/dev/null | head -1
|
|
1783
|
+
\`\`\`
|
|
1784
|
+
|
|
1785
|
+
If no transcript is found, tell the user and stop.
|
|
1786
|
+
|
|
1787
|
+
## Step 3: Extract conversation context`
|
|
1746
1788
|
},
|
|
1747
|
-
'docs
|
|
1789
|
+
'show-docs': {
|
|
1748
1790
|
filename: 'show-docs.md',
|
|
1749
|
-
content: `# Show
|
|
1791
|
+
content: `# Show Docs
|
|
1792
|
+
|
|
1793
|
+
Open the interactive documentation for Claude Code Autoconfig.
|
|
1750
1794
|
|
|
1751
|
-
|
|
1795
|
+
## Step 1: Sync Docs
|
|
1752
1796
|
|
|
1753
|
-
|
|
1797
|
+
Run the sync script to ensure the docs reflect the current state of \`.claude/\`:
|
|
1754
1798
|
|
|
1755
|
-
|
|
1799
|
+
\`\`\`bash
|
|
1800
|
+
node .claude/scripts/sync-docs.js
|
|
1801
|
+
\`\`\`
|
|
1756
1802
|
|
|
1757
|
-
|
|
1803
|
+
This scans all files in \`.claude/\` (commands, hooks, agents, feedback, updates, settings) and updates the docs HTML file tree, info cards, and content previews automatically. It's fast and idempotent.
|
|
1758
1804
|
|
|
1759
|
-
|
|
1805
|
+
If the script fails (e.g., file not found), skip to Step 2 — the docs will still open with whatever content they have.
|
|
1760
1806
|
|
|
1761
|
-
|
|
1807
|
+
## Step 2: Open Docs
|
|
1762
1808
|
|
|
1763
|
-
|
|
1809
|
+
Open the docs in the default browser. Use the command matching the current OS:
|
|
1764
1810
|
|
|
1765
|
-
|
|
1811
|
+
- **macOS:** \`open .claude/docs/autoconfig.docs.html\`
|
|
1812
|
+
- **Linux:** \`xdg-open .claude/docs/autoconfig.docs.html\`
|
|
1813
|
+
- **Windows:** \`powershell -NoProfile -Command "Start-Process '.claude/docs/autoconfig.docs.html'"\`
|
|
1814
|
+
|
|
1815
|
+
**Important:** If the command exits with a non-zero exit code or produces an error, tell the user the file failed to open and suggest they open it manually. Do NOT report success unless the command completed without error.`
|
|
1816
|
+
},
|
|
1817
|
+
'sync-claude-md': {
|
|
1818
|
+
filename: 'sync-claude-md.md',
|
|
1819
|
+
content: `# Sync CLAUDE.md
|
|
1820
|
+
|
|
1821
|
+
Re-analyze the project and update CLAUDE.md to reflect current state.
|
|
1822
|
+
|
|
1823
|
+
Run this when your project has changed significantly:
|
|
1824
|
+
- Added a major framework or dependency
|
|
1825
|
+
- Changed npm scripts or build commands
|
|
1826
|
+
- Restructured the project
|
|
1827
|
+
- Switched databases or services
|
|
1828
|
+
|
|
1829
|
+
## Step 1: Check for Team Feedback
|
|
1830
|
+
|
|
1831
|
+
Before regenerating, check \`.claude/feedback/FEEDBACK.md\` for any corrections or guidance from the team. Review and incorporate relevant feedback into your regeneration.
|
|
1832
|
+
|
|
1833
|
+
## Step 2: Re-analyze the Project
|
|
1834
|
+
|
|
1835
|
+
Scan for current project indicators:
|
|
1836
|
+
|
|
1837
|
+
**Package/Config Files:**
|
|
1838
|
+
- \`package.json\` → dependencies, scripts
|
|
1839
|
+
- \`requirements.txt\` / \`pyproject.toml\` → Python deps
|
|
1840
|
+
- \`Cargo.toml\`, \`go.mod\`, \`Gemfile\`, etc.
|
|
1841
|
+
|
|
1842
|
+
**Framework Indicators:**
|
|
1843
|
+
- Config files (next.config.*, vite.config.*, etc.)
|
|
1844
|
+
- Directory structure (app/, src/, etc.)
|
|
1845
|
+
|
|
1846
|
+
**Infrastructure:**
|
|
1847
|
+
- Docker, Terraform, CI/CD configs`
|
|
1766
1848
|
},
|
|
1767
1849
|
'test': {
|
|
1768
1850
|
filename: 'test.md',
|
|
@@ -1776,77 +1858,174 @@ If no scope provided, run the full test suite. Otherwise run tests matching the
|
|
|
1776
1858
|
|
|
1777
1859
|
Detect the test command from project config (package.json scripts, pytest, go test, etc.) and execute it.`
|
|
1778
1860
|
},
|
|
1779
|
-
'
|
|
1780
|
-
filename: '
|
|
1781
|
-
content:
|
|
1782
|
-
empty: true,
|
|
1783
|
-
emptyMessage: 'This directory is empty.\n\nAdd .md files here to define rules for specific paths in your codebase.'
|
|
1784
|
-
},
|
|
1785
|
-
'docs': {
|
|
1786
|
-
filename: 'autoconfig.docs.html',
|
|
1787
|
-
content: null,
|
|
1788
|
-
empty: true,
|
|
1789
|
-
emptyMessage: "You're looking at it! 👀"
|
|
1790
|
-
},
|
|
1791
|
-
'enable-retro': {
|
|
1792
|
-
filename: 'enable-retro.md',
|
|
1793
|
-
content: `# Enable Retro
|
|
1861
|
+
'create-retro-item-agent': {
|
|
1862
|
+
filename: 'create-retro-item.md',
|
|
1863
|
+
content: `# Create Retro Item Agent
|
|
1794
1864
|
|
|
1795
|
-
|
|
1865
|
+
Create a fully-scoped story file in \`.claude/retro/\` when tech debt or improvement opportunities are identified.
|
|
1796
1866
|
|
|
1797
|
-
##
|
|
1867
|
+
## When to Trigger
|
|
1798
1868
|
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1869
|
+
Call this agent when you notice:
|
|
1870
|
+
- Tech debt that should be addressed later
|
|
1871
|
+
- Code that works but could be improved
|
|
1872
|
+
- Missing tests, documentation, or error handling
|
|
1873
|
+
- Architectural improvements worth tracking
|
|
1802
1874
|
|
|
1803
|
-
##
|
|
1875
|
+
## Input
|
|
1804
1876
|
|
|
1805
|
-
|
|
1806
|
-
-
|
|
1807
|
-
-
|
|
1808
|
-
-
|
|
1809
|
-
-
|
|
1810
|
-
-
|
|
1877
|
+
Provide these details when calling:
|
|
1878
|
+
- **title**: Short descriptive name (used for filename)
|
|
1879
|
+
- **problem**: What's wrong or what friction was encountered
|
|
1880
|
+
- **criteria**: Specific, testable acceptance criteria
|
|
1881
|
+
- **approach**: How to fix it
|
|
1882
|
+
- **priority**: Critical | High | Medium | Low
|
|
1883
|
+
- **effort**: S | M | L | XL
|
|
1884
|
+
- **files**: List of files involved
|
|
1811
1885
|
|
|
1812
|
-
|
|
1886
|
+
## Behavior
|
|
1887
|
+
|
|
1888
|
+
1. Generate filename from title: \`kebab-case.md\`
|
|
1889
|
+
2. Create story file in \`.claude/retro/\` using this format:
|
|
1890
|
+
|
|
1891
|
+
\`\`\`markdown
|
|
1892
|
+
# [Title]`
|
|
1813
1893
|
},
|
|
1814
|
-
'
|
|
1815
|
-
filename: '
|
|
1816
|
-
content: `#
|
|
1894
|
+
'docs-refresh-agent': {
|
|
1895
|
+
filename: 'docs-refresh.md',
|
|
1896
|
+
content: `# Docs Refresh Agent
|
|
1817
1897
|
|
|
1818
|
-
|
|
1819
|
-
Claude reads this directory and learns for next time.
|
|
1898
|
+
Sync the interactive docs with the current state of \`.claude/\`.
|
|
1820
1899
|
|
|
1821
|
-
|
|
1900
|
+
## How
|
|
1822
1901
|
|
|
1823
|
-
|
|
1902
|
+
Run:
|
|
1824
1903
|
|
|
1825
|
-
|
|
1904
|
+
\`\`\`bash
|
|
1905
|
+
node .claude/scripts/sync-docs.js
|
|
1906
|
+
\`\`\`
|
|
1826
1907
|
|
|
1827
|
-
|
|
1828
|
-
2. **Confirm the root cause** — present findings to the user with evidence
|
|
1829
|
-
3. **Only then propose a fix** — based on what you observed, not what you guessed
|
|
1908
|
+
This scans \`.claude/\` for all files, extracts \`@description\` metadata, and updates the docs HTML (file tree, info cards, and content previews).
|
|
1830
1909
|
|
|
1831
|
-
|
|
1910
|
+
## When to Use
|
|
1911
|
+
|
|
1912
|
+
- After adding, modifying, or deleting files in \`.claude/\`
|
|
1913
|
+
- Before opening docs with \`/show-docs\` (already built in)
|
|
1914
|
+
- As a background task when \`.claude/\` files change`
|
|
1915
|
+
},
|
|
1916
|
+
'feedback-rule-check-hook': {
|
|
1917
|
+
filename: 'feedback-rule-check.js',
|
|
1918
|
+
content: `#!/usr/bin/env node
|
|
1919
|
+
|
|
1920
|
+
/**
|
|
1921
|
+
* @name Feedback Rule Migration Check
|
|
1922
|
+
* @description After FEEDBACK.md is edited, notifies Claude to evaluate
|
|
1923
|
+
* whether any entries would be more reliably delivered as
|
|
1924
|
+
* .claude/rules/ files with glob patterns.
|
|
1925
|
+
* @trigger PostToolUse on Write|Edit
|
|
1926
|
+
*/
|
|
1927
|
+
|
|
1928
|
+
// Read hook input from stdin
|
|
1929
|
+
let input = '';
|
|
1930
|
+
process.stdin.setEncoding('utf8');
|
|
1931
|
+
process.stdin.on('data', chunk => input += chunk);
|
|
1932
|
+
process.stdin.on('end', () => {
|
|
1933
|
+
try {
|
|
1934
|
+
const data = JSON.parse(input);
|
|
1935
|
+
const filePath = data?.tool_input?.file_path || '';
|
|
1936
|
+
|
|
1937
|
+
// Only fire for FEEDBACK.md edits
|
|
1938
|
+
if (!filePath.endsWith('FEEDBACK.md')) {
|
|
1939
|
+
process.exit(0);
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
console.log([
|
|
1943
|
+
'FEEDBACK.md was just modified.',
|
|
1944
|
+
'Review the changes and evaluate whether any entries are tied to specific file types,',
|
|
1945
|
+
'frameworks, or patterns that could be scoped with a glob (e.g., *.py, *.tsx, src/api/**).',
|
|
1946
|
+
'',
|
|
1947
|
+
'If any entries qualify, ask the user:',`
|
|
1948
|
+
},
|
|
1949
|
+
'format-hook': {
|
|
1950
|
+
filename: 'format.js',
|
|
1951
|
+
content: `#!/usr/bin/env node
|
|
1952
|
+
|
|
1953
|
+
/**
|
|
1954
|
+
* @name Format Hook
|
|
1955
|
+
* @description Runs project formatter after Write/Edit operations
|
|
1956
|
+
* @trigger PostToolUse on Write|Edit
|
|
1957
|
+
*/
|
|
1832
1958
|
|
|
1833
|
-
|
|
1959
|
+
const { execSync } = require('child_process');
|
|
1960
|
+
const path = require('path');
|
|
1961
|
+
|
|
1962
|
+
// Read hook input from stdin
|
|
1963
|
+
let input = '';
|
|
1964
|
+
process.stdin.setEncoding('utf8');
|
|
1965
|
+
process.stdin.on('data', chunk => input += chunk);
|
|
1966
|
+
process.stdin.on('end', () => {
|
|
1967
|
+
try {
|
|
1968
|
+
const data = JSON.parse(input);
|
|
1969
|
+
handleHook(data);
|
|
1970
|
+
} catch (err) {
|
|
1971
|
+
// Silent exit if no valid input
|
|
1972
|
+
process.exit(0);
|
|
1973
|
+
}
|
|
1974
|
+
});
|
|
1834
1975
|
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
- Keep cyclomatic complexity under 10 per function
|
|
1976
|
+
function handleHook(data) {
|
|
1977
|
+
const filePath = data?.tool_input?.file_path || '';
|
|
1838
1978
|
|
|
1839
|
-
|
|
1979
|
+
// Skip non-source files
|
|
1980
|
+
if (!filePath.match(/\\.(js|jsx|ts|tsx|json|css|scss|md|html)$/)) {`
|
|
1981
|
+
},
|
|
1982
|
+
'migrate-feedback-hook': {
|
|
1983
|
+
filename: 'migrate-feedback.js',
|
|
1984
|
+
content: `#!/usr/bin/env node
|
|
1985
|
+
|
|
1986
|
+
/**
|
|
1987
|
+
* @name Feedback to Discoveries Migration
|
|
1988
|
+
* @description On session start, migrates custom FEEDBACK.md content to
|
|
1989
|
+
* CLAUDE.md Discoveries section. One-time, idempotent.
|
|
1990
|
+
* @trigger SessionStart
|
|
1991
|
+
*/
|
|
1840
1992
|
|
|
1841
|
-
|
|
1993
|
+
const fs = require('fs');
|
|
1994
|
+
const path = require('path');
|
|
1995
|
+
|
|
1996
|
+
const cwd = process.cwd();
|
|
1997
|
+
const claudeMdPath = path.join(cwd, 'CLAUDE.md');
|
|
1998
|
+
const feedbackPath = path.join(cwd, '.claude', 'feedback', 'FEEDBACK.md');
|
|
1999
|
+
|
|
2000
|
+
// Read hook input from stdin (required by hook protocol)
|
|
2001
|
+
let input = '';
|
|
2002
|
+
process.stdin.setEncoding('utf8');
|
|
2003
|
+
process.stdin.on('data', chunk => input += chunk);
|
|
2004
|
+
process.stdin.on('end', () => {
|
|
2005
|
+
try {
|
|
2006
|
+
migrate();
|
|
2007
|
+
} catch (err) {
|
|
2008
|
+
// Silent exit on any error
|
|
2009
|
+
}
|
|
2010
|
+
process.exit(0);
|
|
2011
|
+
});
|
|
1842
2012
|
|
|
1843
|
-
|
|
1844
|
-
|
|
2013
|
+
function migrate() {`
|
|
2014
|
+
},
|
|
2015
|
+
'feedback-feedback': {
|
|
2016
|
+
filename: 'FEEDBACK.md',
|
|
2017
|
+
content: `# Team Feedback
|
|
1845
2018
|
|
|
1846
|
-
|
|
2019
|
+
**This file is for human-authored corrections and guidance only.**
|
|
2020
|
+
Claude reads this file but must never write to it. When Claude discovers project context, gotchas, or learnings, it should append to the \`## Discoveries\` section in CLAUDE.md instead.
|
|
1847
2021
|
|
|
1848
|
-
|
|
1849
|
-
|
|
2022
|
+
---`
|
|
2023
|
+
},
|
|
2024
|
+
'rules': {
|
|
2025
|
+
filename: 'rules/',
|
|
2026
|
+
content: null,
|
|
2027
|
+
empty: true,
|
|
2028
|
+
emptyMessage: 'Add .md files here to define rules for specific paths in your codebase.'
|
|
1850
2029
|
},
|
|
1851
2030
|
'hooks': {
|
|
1852
2031
|
filename: 'hooks/',
|
|
@@ -1854,23 +2033,103 @@ ANSI escape codes don't count toward visible width.`
|
|
|
1854
2033
|
empty: true,
|
|
1855
2034
|
emptyMessage: 'Contains executable hook scripts that trigger on Claude Code events.'
|
|
1856
2035
|
},
|
|
1857
|
-
'
|
|
1858
|
-
filename: '
|
|
1859
|
-
content:
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
2036
|
+
'docs': {
|
|
2037
|
+
filename: 'autoconfig.docs.html',
|
|
2038
|
+
content: null,
|
|
2039
|
+
empty: true,
|
|
2040
|
+
emptyMessage: "You\'re looking at it! 👀"
|
|
2041
|
+
},
|
|
2042
|
+
'rules': {
|
|
2043
|
+
filename: 'rules/',
|
|
2044
|
+
content: null,
|
|
2045
|
+
empty: true,
|
|
2046
|
+
emptyMessage: 'This directory is empty.\nAdd .md files here to define rules for specific paths in your codebase.'
|
|
2047
|
+
},
|
|
2048
|
+
'settings': {
|
|
2049
|
+
filename: 'settings.json',
|
|
2050
|
+
content: `{
|
|
2051
|
+
"env": {
|
|
2052
|
+
"CLAUDE_CODE_DISABLE_AUTO_MEMORY": "0"
|
|
2053
|
+
},
|
|
2054
|
+
"hooks": {
|
|
2055
|
+
"SessionStart": [
|
|
2056
|
+
{
|
|
2057
|
+
"matcher": "",
|
|
2058
|
+
"hooks": [
|
|
2059
|
+
{
|
|
2060
|
+
"type": "command",
|
|
2061
|
+
"command": "node .claude/hooks/migrate-feedback.js"
|
|
2062
|
+
}
|
|
2063
|
+
]
|
|
2064
|
+
}
|
|
2065
|
+
],
|
|
2066
|
+
"PostToolUse": [
|
|
2067
|
+
{
|
|
2068
|
+
"matcher": "Edit|Write",
|
|
2069
|
+
"hooks": [
|
|
2070
|
+
{
|
|
2071
|
+
"type": "command",
|
|
2072
|
+
"command": "node .claude/hooks/feedback-rule-check.js"
|
|
2073
|
+
}
|
|
2074
|
+
]
|
|
2075
|
+
}
|
|
2076
|
+
]
|
|
2077
|
+
},
|
|
2078
|
+
"permissions": {
|
|
2079
|
+
"allow": [
|
|
2080
|
+
"Read(./**)",
|
|
2081
|
+
"Edit(./**)",
|
|
2082
|
+
"Write(./**)",
|
|
2083
|
+
"Glob",
|
|
2084
|
+
"Grep",
|
|
2085
|
+
"WebSearch",
|
|
2086
|
+
"WebFetch",
|
|
2087
|
+
"Bash(npm run dev)",
|
|
2088
|
+
"Bash(npm run build)",
|
|
2089
|
+
"Bash(npm run lint)",
|
|
2090
|
+
"Bash(npm run lint:fix)",
|
|
2091
|
+
"Bash(npm run typecheck)",
|
|
2092
|
+
"Bash(npm run test)",
|
|
2093
|
+
"Bash(npm run test:*)",
|
|
2094
|
+
"Bash(npm run validate)",
|
|
2095
|
+
"Bash(git status)",
|
|
2096
|
+
"Bash(git diff:*)",
|
|
2097
|
+
"Bash(git add:*)",
|
|
2098
|
+
"Bash(git commit:*)",
|
|
2099
|
+
"Bash(git push:*)",
|
|
2100
|
+
"Bash(git pull)",
|
|
2101
|
+
"Bash(git checkout:*)",
|
|
2102
|
+
"Bash(git branch:*)",
|
|
2103
|
+
"Bash(ls:*)",
|
|
2104
|
+
"Bash(dir:*)",
|
|
2105
|
+
"Bash(mkdir:*)",
|
|
2106
|
+
"Bash(mkdir -p:*)",
|
|
2107
|
+
"Bash(start:*)",
|
|
2108
|
+
"Bash(start .claude:*)",
|
|
2109
|
+
"Bash(open:*)",
|
|
2110
|
+
"Bash(open .claude:*)",
|
|
2111
|
+
"Bash(xdg-open:*)",
|
|
2112
|
+
"Bash(xdg-open .claude:*)"
|
|
2113
|
+
],
|
|
2114
|
+
"deny": [
|
|
2115
|
+
"Read(./.env)",
|
|
2116
|
+
"Read(./.env.*)",
|
|
2117
|
+
"Read(./secrets/**)",
|
|
2118
|
+
"Read(./**/credentials.*)",
|
|
2119
|
+
"Read(./**/*.pem)",
|
|
2120
|
+
"Read(./**/*.key)",
|
|
2121
|
+
"Bash(rm -rf:*)",
|
|
2122
|
+
"Bash(curl:*)",
|
|
2123
|
+
"Bash(wget:*)"
|
|
2124
|
+
]
|
|
2125
|
+
}
|
|
2126
|
+
}`
|
|
2127
|
+
},
|
|
2128
|
+
'mcp': {
|
|
2129
|
+
filename: '.mcp.json',
|
|
2130
|
+
content: `{
|
|
2131
|
+
"mcpServers": {}
|
|
2132
|
+
}`
|
|
1874
2133
|
}
|
|
1875
2134
|
};
|
|
1876
2135
|
|