claude-code-autoconfig 1.0.169 โ†’ 1.0.171

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.
@@ -883,11 +883,6 @@
883
883
  <span class="tree-file-icon">๐Ÿ“„</span>
884
884
  <span class="file">enable-retro.md</span>
885
885
  </div>
886
- <div class="tree-item indent-3 hidden" data-info="extract-rules" data-parent="commands">
887
- <span class="tree-spacer"></span>
888
- <span class="tree-file-icon">๐Ÿ“„</span>
889
- <span class="file">extract-rules.md</span>
890
- </div>
891
886
  <div class="tree-item indent-3 hidden" data-info="gls" data-parent="commands">
892
887
  <span class="tree-spacer"></span>
893
888
  <span class="tree-file-icon">๐Ÿ“„</span>
@@ -1268,7 +1263,7 @@
1268
1263
  title: '.claude/ Directory',
1269
1264
  desc: 'Commands, rules, settings, and these docs. Keeps configuration organized as your project grows.'
1270
1265
  },
1271
- 'rules': {
1266
+ 'rules': {
1272
1267
  title: 'rules/',
1273
1268
  desc: 'Path-scoped context that loads when Claude works on matching files.'
1274
1269
  },
@@ -1308,11 +1303,6 @@
1308
1303
  desc: '(Experimental) Enable Claude to log tech debt it encounters into .claude/retro.<div style="margin-top: 12px;"><strong>Parameters</strong><div style="margin-top: 4px; opacity: 0.6;">None</div></div><div style="margin-top: 12px;"><strong>Responses</strong><table style="width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 0.9em; text-align: left;"><tr style="text-align: left; border-bottom: 1px solid var(--border);"><th style="padding: 4px 8px 4px 0;">Status</th><th style="padding: 4px 8px 4px 0;">Description</th></tr><tr style="border-bottom: 1px solid var(--border);"><td style="padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap;"><code>success</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;">Retro enabled โ€” Claude will log tech debt to .claude/retro/ when encountered.</td></tr></table></div><div style="margin-top: 12px;"><strong>Side Effects</strong><div style="margin-top: 4px; font-size: 0.9em;">Creates .claude/retro/README.md, adds agent, updates CLAUDE.md</div></div><div style="margin-top: 12px;"><strong>Examples</strong><div style="margin-top: 6px; background: var(--bg-elevated); border-radius: 6px; padding: 8px 12px; font-family: monospace; font-size: 0.85em;"><div><code>/enable-retro</code> <span style="opacity: 0.6;">โ€” Activate tech debt tracking</span></div></div></div>',
1309
1304
  trigger: '/enable-retro'
1310
1305
  },
1311
- 'extract-rules': {
1312
- title: 'extract-rules.md',
1313
- desc: 'Scan Claude artifacts and propose structured rules for .claude/rules/<div style="margin-top: 12px;"><strong>Parameters</strong><table style="width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 0.9em; text-align: left;"><tr style="text-align: left; border-bottom: 1px solid var(--border);"><th style="padding: 4px 8px 4px 0;">Name</th><th style="padding: 4px 8px 4px 0;">Type</th><th style="padding: 4px 8px 4px 0;">Required</th><th style="padding: 4px 8px 4px 0;">Description</th></tr><tr style="border-bottom: 1px solid var(--border);"><td style="padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap;"><code>mode</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;"><code>string</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;">optional</td><td style="padding: 4px 8px 4px 0; vertical-align: top;">"preview" (default) shows proposals, "apply" writes and cleans sources</td></tr></table></div><div style="margin-top: 12px;"><strong>Responses</strong><table style="width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 0.9em; text-align: left;"><tr style="text-align: left; border-bottom: 1px solid var(--border);"><th style="padding: 4px 8px 4px 0;">Status</th><th style="padding: 4px 8px 4px 0;">Description</th></tr><tr style="border-bottom: 1px solid var(--border);"><td style="padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap;"><code>success</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;">Rules extracted and optionally applied with source cleanup.</td></tr><tr style="border-bottom: 1px solid var(--border);"><td style="padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap;"><code>no-rules</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;">No extractable rules found in scanned sources.</td></tr></table></div><div style="margin-top: 12px;"><strong>Side Effects</strong><div style="margin-top: 4px; font-size: 0.9em;">May create .claude/rules/ files and remove extracted content from source files</div></div><div style="margin-top: 12px;"><strong>Examples</strong><div style="margin-top: 6px; background: var(--bg-elevated); border-radius: 6px; padding: 8px 12px; font-family: monospace; font-size: 0.85em;"><div><code>/extract-rules</code> <span style="opacity: 0.6;">โ€” Preview proposed rules without writing</span></div><div><code>/extract-rules --apply</code> <span style="opacity: 0.6;">โ€” Write rules and clean up sources</span></div></div></div>',
1314
- trigger: '/extract-rules'
1315
- },
1316
1306
  'gls': {
1317
1307
  title: 'gls.md',
1318
1308
  desc: 'Get the latest screenshot(s) and display them.<div style="margin-top: 12px;"><strong>Parameters</strong><table style="width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 0.9em; text-align: left;"><tr style="text-align: left; border-bottom: 1px solid var(--border);"><th style="padding: 4px 8px 4px 0;">Name</th><th style="padding: 4px 8px 4px 0;">Type</th><th style="padding: 4px 8px 4px 0;">Required</th><th style="padding: 4px 8px 4px 0;">Description</th></tr><tr style="border-bottom: 1px solid var(--border);"><td style="padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap;"><code>count</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;"><code>integer</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;">optional</td><td style="padding: 4px 8px 4px 0; vertical-align: top;">Number of screenshots to display. Use /gls-N syntax. Default: 1. Min: 1.</td></tr><tr style="border-bottom: 1px solid var(--border);"><td style="padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap;"><code>path</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;"><code>string</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;">optional</td><td style="padding: 4px 8px 4px 0; vertical-align: top;">Screenshot directory path. Saved for future use. Auto-detected if omitted.</td></tr></table></div><div style="margin-top: 12px;"><strong>Responses</strong><table style="width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 0.9em; text-align: left;"><tr style="text-align: left; border-bottom: 1px solid var(--border);"><th style="padding: 4px 8px 4px 0;">Status</th><th style="padding: 4px 8px 4px 0;">Description</th></tr><tr style="border-bottom: 1px solid var(--border);"><td style="padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap;"><code>success</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;">Displays requested screenshot(s) from newest to oldest.</td></tr><tr style="border-bottom: 1px solid var(--border);"><td style="padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap;"><code>no-screenshots</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;">Directory exists but contains no image files.</td></tr><tr style="border-bottom: 1px solid var(--border);"><td style="padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap;"><code>no-directory</code></td><td style="padding: 4px 8px 4px 0; vertical-align: top;">Unable to detect screenshot directory โ€” prompts for path.</td></tr></table></div><div style="margin-top: 12px;"><strong>Side Effects</strong><div style="margin-top: 4px; font-size: 0.9em;">Saves detected screenshot path to .claude/cca.config.json on first run</div></div><div style="margin-top: 12px;"><strong>Examples</strong><div style="margin-top: 6px; background: var(--bg-elevated); border-radius: 6px; padding: 8px 12px; font-family: monospace; font-size: 0.85em;"><div><code>/gls</code> <span style="opacity: 0.6;">โ€” Display the most recent screenshot</span></div><div><code>/gls-3</code> <span style="opacity: 0.6;">โ€” Display the 3 most recent screenshots</span></div><div><code>/gls /path/to/dir</code> <span style="opacity: 0.6;">โ€” Use a specific screenshot directory</span></div></div></div>',
@@ -1579,7 +1569,7 @@ CRITICAL: A plausible-looking cause from code reading is NOT confirmed evidence.
1579
1569
 
1580
1570
  > Run \`/autoconfig\` to populate this based on your project.`
1581
1571
  },
1582
- 'autoconfig-update': {
1572
+ 'autoconfig-update': {
1583
1573
  filename: 'autoconfig-update.md',
1584
1574
  content: `<!-- @applied
1585
1575
  -->
@@ -1699,38 +1689,6 @@ Each item is a structured story file with:
1699
1689
 
1700
1690
  - "Fix retro #001" โ€” Work on a specific item
1701
1691
  - "What's in the retro backlog?" โ€” List pending items`
1702
- },
1703
- 'extract-rules': {
1704
- filename: 'extract-rules.md',
1705
- content: `# Extract Rules
1706
-
1707
- Scan all Claude configuration artifacts and propose structured rules for \`.claude/rules/\`.
1708
-
1709
- ## Step 0: Git safety check
1710
-
1711
- Before doing anything else, check for uncommitted changes:
1712
-
1713
- \`\`\`bash
1714
- git status --porcelain
1715
- \`\`\`
1716
-
1717
- If there are uncommitted changes, show this warning and wait for confirmation:
1718
-
1719
- > **Warning:** This command will modify files (extract rules from sources and optionally clean up originals). You have uncommitted changes.
1720
- >
1721
- > Commit your work before proceeding, or type "continue" to proceed anyway.
1722
-
1723
- If the working tree is clean, proceed silently.
1724
-
1725
- ## Step 1: Discover sources
1726
-
1727
- Scan these locations for \`.md\` files containing potential rules. **Skip any that don't exist** โ€” not all projects have all of these:
1728
-
1729
- 1. \`CLAUDE.md\` (project root)
1730
- 2. \`CLAUDE.local.md\` (project root, if present)
1731
- 3. All \`.md\` files in \`.claude/\` recursively (feedback, commands, etc.) โ€” **excluding** \`.claude/rules/\` and \`.claude/commands/extract-rules.md\`
1732
- 4. Any nested \`CLAUDE.md\` files in subdirectories (e.g., \`src/CLAUDE.md\`)
1733
- 5. \`.claude/settings.json\` (hooks section โ€” behavioral rules implied by hooks)`
1734
1692
  },
1735
1693
  'gls': {
1736
1694
  filename: 'gls.md',
@@ -0,0 +1,8 @@
1
+ ---
2
+ paths:
3
+ - "bin/cli.js"
4
+ - ".claude/commands/*.md"
5
+ - "package.json"
6
+ ---
7
+
8
+ Do not publish new commands or features to npm without explicit user approval. Adding a file to the project repo is not the same as approving it for deploy. Wait for explicit "deploy", "publish", or "push it out" before running npm version + publish.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.0.171
4
+ - feat: /extract-rules v3 โ€” automatic flow, --keep-sources, changelog summary
5
+
6
+ ## v1.0.170
7
+ - revert: remove /extract-rules from deployed build
8
+
3
9
  ## v1.0.169
4
10
  - feat: add /extract-rules command
5
11
 
@@ -141,9 +147,3 @@
141
147
  ## v1.0.122
142
148
  - feat: /autoconfig pulls latest package before configuring
143
149
 
144
- ## v1.0.121
145
- - feat: add feedback-to-discoveries migration update (004)
146
-
147
- ## v1.0.120
148
- - feat: separate Claude discoveries from human feedback
149
-
package/README.md CHANGED
@@ -49,7 +49,6 @@ your-project/
49
49
  โ”‚ โ”œโ”€โ”€ autoconfig-update.md # /autoconfig-update - install updates
50
50
  โ”‚ โ”œโ”€โ”€ commit-and-push.md # /commit-and-push - git workflow
51
51
  โ”‚ โ”œโ”€โ”€ enable-retro.md # /enable-retro - opt-in tech debt tracking
52
- โ”‚ โ”œโ”€โ”€ extract-rules.md # /extract-rules - extract rules from artifacts
53
52
  โ”‚ โ”œโ”€โ”€ gls.md # /gls - view latest screenshot
54
53
  โ”‚ โ”œโ”€โ”€ recover-context.md # /recover-context - restore context after compaction
55
54
  โ”‚ โ”œโ”€โ”€ show-docs.md # /show-docs - interactive walkthrough
@@ -102,7 +101,6 @@ Autoconfig is **self-configuring**. Run `/autoconfig` and Claude:
102
101
  | `/show-docs` | Opens interactive docs in browser |
103
102
  | `/test` | Runs your test suite (auto-detects framework) |
104
103
  | `/commit-and-push` | Stages, commits with good message, and pushes |
105
- | `/extract-rules` | Scan artifacts and propose structured rules for `.claude/rules/` |
106
104
  | `/recover-context` | Recovers conversation context after compaction |
107
105
  | `/gls` | Views latest screenshot for visual context |
108
106
  | `/validate-cca-install` | Validates installation against latest published version |
package/bin/cli.js CHANGED
@@ -327,7 +327,7 @@ const hooksSrc = path.join(packageDir, '.claude', 'hooks');
327
327
  const scriptsSrc = path.join(packageDir, '.claude', 'scripts');
328
328
 
329
329
  // Files that exist in the dev repo but should never be installed to user projects
330
- const DEV_ONLY_FILES = ['publish.md'];
330
+ const DEV_ONLY_FILES = ['publish.md', 'extract-rules.md'];
331
331
 
332
332
  function copyDir(src, dest) {
333
333
  fs.mkdirSync(dest, { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-autoconfig",
3
- "version": "1.0.169",
3
+ "version": "1.0.171",
4
4
  "description": "Intelligent, self-configuring setup for Claude Code. One command analyzes your project, configures Claude, and shows you what it did.",
5
5
  "author": "ADAC 1001 <info@adac1001.com>",
6
6
  "license": "MIT",
@@ -38,6 +38,7 @@
38
38
  "!.claude/cca.config.json",
39
39
  "!.claude/.autoconfig-version",
40
40
  "!.claude/commands/publish.md",
41
+ "!.claude/commands/extract-rules.md",
41
42
  "!.claude/plans",
42
43
  "CLAUDE.md",
43
44
  "CHANGELOG.md"
@@ -1,128 +0,0 @@
1
- <!-- @description Scan Claude artifacts and propose structured rules for .claude/rules/ -->
2
- <!-- @version 1 -->
3
- <!-- @param mode | string | optional | "preview" (default) shows proposals, "apply" writes and cleans sources -->
4
- <!-- @response success | Rules extracted and optionally applied with source cleanup. -->
5
- <!-- @response no-rules | No extractable rules found in scanned sources. -->
6
- <!-- @sideeffect May create .claude/rules/ files and remove extracted content from source files -->
7
- <!-- @example /extract-rules | Preview proposed rules without writing -->
8
- <!-- @example /extract-rules --apply | Write rules and clean up sources -->
9
-
10
- # Extract Rules
11
-
12
- Scan all Claude configuration artifacts and propose structured rules for `.claude/rules/`.
13
-
14
- ## Step 0: Git safety check
15
-
16
- Before doing anything else, check for uncommitted changes:
17
-
18
- ```bash
19
- git status --porcelain
20
- ```
21
-
22
- If there are uncommitted changes, show this warning and wait for confirmation:
23
-
24
- > **Warning:** This command will modify files (extract rules from sources and optionally clean up originals). You have uncommitted changes.
25
- >
26
- > Commit your work before proceeding, or type "continue" to proceed anyway.
27
-
28
- If the working tree is clean, proceed silently.
29
-
30
- ## Step 1: Discover sources
31
-
32
- Scan these locations for `.md` files containing potential rules. **Skip any that don't exist** โ€” not all projects have all of these:
33
-
34
- 1. `CLAUDE.md` (project root)
35
- 2. `CLAUDE.local.md` (project root, if present)
36
- 3. All `.md` files in `.claude/` recursively (feedback, commands, etc.) โ€” **excluding** `.claude/rules/` and `.claude/commands/extract-rules.md`
37
- 4. Any nested `CLAUDE.md` files in subdirectories (e.g., `src/CLAUDE.md`)
38
- 5. `.claude/settings.json` (hooks section โ€” behavioral rules implied by hooks)
39
-
40
- Also read all existing `.claude/rules/` files to avoid proposing duplicates.
41
-
42
- ## Step 2: Extract candidate rules
43
-
44
- A rule is a **deterministic behavioral instruction** that Claude should follow when working on specific files or file patterns. Good rules are:
45
-
46
- - **Actionable**: "Do X" or "Never do Y" โ€” not background context
47
- - **Scoped**: Applies to specific files, directories, or file patterns
48
- - **Not already enforced**: Skip anything already handled by hooks, settings, or linting
49
- - **Not ephemeral**: Skip project status, session notes, debugging histories
50
-
51
- **Skip these** (they belong in other artifacts):
52
- - Domain knowledge / business logic explanations โ†’ stay in their source doc
53
- - Slash command definitions โ†’ stay in `commands/`
54
- - Session-specific debugging notes โ†’ stay in memory
55
- - Deployment / operational procedures โ†’ stay in their source doc
56
-
57
- ## Step 3: Deduplicate
58
-
59
- - If a candidate rule already exists in `.claude/rules/` (same intent, even if worded differently), skip it
60
- - If the same guidance appears in multiple sources, note all sources but propose one rule
61
- - Group related rules into single files when they share the same `paths` scope. If two imperatives apply to the same files, they belong in one rule file. If they target different files, keep them separate โ€” even if topically related.
62
-
63
- ## Step 4: Rate confidence
64
-
65
- For each proposed rule, assign a confidence level:
66
-
67
- - **HIGH** โ€” Explicit imperative instruction ("never do X", "always do Y", "must use Z", "prefer X over Y"). The source text literally contains an imperative. Extract these.
68
- - **SKIP** โ€” Everything else: inferred conventions, contextual guidance, implementation details derivable from the code. Do not propose these.
69
-
70
- ## Step 5: Output proposals
71
-
72
- For each HIGH-confidence rule, output:
73
-
74
- ```
75
- ### Rule: <short name>
76
- **Source**: <file(s) it was extracted from>
77
- **Paths**: <e.g., `src/background.ts`, `src/**/*.ts`, `*.ts`>
78
- **File name**: <proposed .claude/rules/ filename, e.g., `linkedin-selectors.md`>
79
-
80
- --- file content ---
81
- ---
82
- paths:
83
- - "src/background.ts"
84
- - "src/**/*.ts"
85
- ---
86
-
87
- <rule content here>
88
- --- end file content ---
89
- ```
90
-
91
- The file content block must include proper YAML frontmatter with `paths` as an array. This is the exact format Claude Code expects.
92
-
93
- **Validate paths**: Before proposing a rule, use Glob to verify that at least one `paths` pattern matches existing files in the project. If no files match, flag it with `โš ๏ธ no matching files` and exclude it from the proposal. Dead rules erode trust.
94
-
95
- At the end, show a summary table:
96
-
97
- | # | Rule file | Paths | Source(s) | Status |
98
- |---|-----------|-------|-----------|--------|
99
-
100
- Status column: `NEW` if no prior rule exists, `UPDATE` if it would merge with/extend an existing rule, `SKIP` if already covered.
101
-
102
- After the table, show a stats line:
103
-
104
- > Scanned **N** sources ยท Extracted **X** rules ยท Skipped **Y** candidates
105
-
106
- ## Step 6: Apply or wait
107
-
108
- - **Default (preview mode)**: Do NOT create any files. Wait for user approval.
109
- - **If `--apply` argument is passed**: Write all proposed rules directly, then proceed to Step 7.
110
-
111
- After user approves in preview mode, write the rule files and proceed to Step 7.
112
-
113
- ## Step 7: Source cleanup
114
-
115
- After writing rules, remove the extracted content from the original source files:
116
-
117
- 1. For each written rule, locate the original text in the source file(s)
118
- 2. Remove the extracted lines from the source โ€” do not leave comments or placeholders
119
- 3. If removing content leaves an empty section (e.g., a `## Discoveries` section with no remaining entries), remove the section heading too
120
- 4. Preserve all non-extracted content in the source file
121
-
122
- Show what was cleaned:
123
-
124
- ```
125
- Cleaned sources:
126
- CLAUDE.md โ€” removed 3 lines (2 rules extracted)
127
- .claude/feedback/FEEDBACK.md โ€” removed 1 line (1 rule extracted)
128
- ```