claude-code-autoconfig 1.0.115 → 1.0.116

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.
@@ -1,5 +1,5 @@
1
1
  <!-- @description The command you just ran. Analyzes your project and populates CLAUDE.md with real context. Re-run anytime your stack changes. -->
2
- <!-- @version 1 -->
2
+ <!-- @version 2 -->
3
3
 
4
4
  # Autoconfig
5
5
 
@@ -151,10 +151,11 @@ Place this section near the top (after Tech Stack, before Commands) since versio
151
151
  **Always end with:**
152
152
  ```markdown
153
153
  ## Team Feedback
154
- See `.claude/feedback/` for corrections and guidance from the team.
154
+ The contents of `.claude/feedback/FEEDBACK.md` are an extension of this file.
155
+ Read it at the start of every session before taking any action.
155
156
  ```
156
157
 
157
- This pointer persists across autoconfig runs and directs Claude to team-maintained content.
158
+ This pointer persists across autoconfig runs and ensures FEEDBACK.md guidance is reliably loaded every session.
158
159
 
159
160
  ## Step 4: Create Rules Directory
160
161
 
@@ -1,4 +1,4 @@
1
- <!-- @screenshotDir -->
1
+ <!-- @screenshotDir /c/Users/andre/OneDrive/Pictures/Screenshots 1 -->
2
2
  <!-- @version 1 -->
3
3
  Get the latest screenshot(s) and display them.
4
4
 
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @name Feedback Rule Migration Check
5
+ * @description After FEEDBACK.md is edited, scans for entries that could be
6
+ * more reliably delivered as .claude/rules/ files with glob patterns.
7
+ * @trigger PostToolUse on Write|Edit
8
+ */
9
+
10
+ const fs = require('fs');
11
+ const path = require('path');
12
+
13
+ // File extension patterns that suggest rule-eligible content
14
+ const FILE_PATTERNS = [
15
+ { regex: /\*\.py\b/i, ext: '*.py', lang: 'Python' },
16
+ { regex: /\*\.js\b/i, ext: '*.js', lang: 'JavaScript' },
17
+ { regex: /\*\.jsx\b/i, ext: '*.jsx', lang: 'JSX' },
18
+ { regex: /\*\.ts\b/i, ext: '*.ts', lang: 'TypeScript' },
19
+ { regex: /\*\.tsx\b/i, ext: '*.tsx', lang: 'TSX' },
20
+ { regex: /\*\.go\b/i, ext: '*.go', lang: 'Go' },
21
+ { regex: /\*\.rs\b/i, ext: '*.rs', lang: 'Rust' },
22
+ { regex: /\*\.rb\b/i, ext: '*.rb', lang: 'Ruby' },
23
+ { regex: /\*\.java\b/i, ext: '*.java', lang: 'Java' },
24
+ { regex: /\*\.cpp\b|\.c\b|\.h\b/i, ext: '*.cpp', lang: 'C/C++' },
25
+ { regex: /\*\.css\b|\.scss\b/i, ext: '*.css', lang: 'CSS' },
26
+ { regex: /\*\.sql\b/i, ext: '*.sql', lang: 'SQL' },
27
+ { regex: /\.vue\b/i, ext: '*.vue', lang: 'Vue' },
28
+ { regex: /\.swift\b/i, ext: '*.swift', lang: 'Swift' },
29
+ { regex: /\.kt\b|\.kotlin\b/i, ext: '*.kt', lang: 'Kotlin' },
30
+ ];
31
+
32
+ // Read hook input from stdin
33
+ let input = '';
34
+ process.stdin.setEncoding('utf8');
35
+ process.stdin.on('data', chunk => input += chunk);
36
+ process.stdin.on('end', () => {
37
+ try {
38
+ const data = JSON.parse(input);
39
+ handleHook(data);
40
+ } catch (err) {
41
+ process.exit(0);
42
+ }
43
+ });
44
+
45
+ function handleHook(data) {
46
+ const filePath = data?.tool_input?.file_path || '';
47
+
48
+ // Only fire for FEEDBACK.md edits
49
+ if (!filePath.endsWith('FEEDBACK.md')) {
50
+ process.exit(0);
51
+ }
52
+
53
+ // Read the updated FEEDBACK.md
54
+ let content;
55
+ try {
56
+ content = fs.readFileSync(filePath, 'utf8');
57
+ } catch (err) {
58
+ process.exit(0);
59
+ }
60
+
61
+ // Scan for file-type patterns
62
+ const candidates = [];
63
+ const lines = content.split('\n');
64
+
65
+ for (let i = 0; i < lines.length; i++) {
66
+ const line = lines[i];
67
+ for (const pattern of FILE_PATTERNS) {
68
+ if (pattern.regex.test(line)) {
69
+ // Get surrounding context (the section this line belongs to)
70
+ let sectionStart = i;
71
+ while (sectionStart > 0 && !lines[sectionStart - 1].startsWith('##')) {
72
+ sectionStart--;
73
+ }
74
+ const sectionHeader = lines[sectionStart].startsWith('##')
75
+ ? lines[sectionStart].replace(/^#+\s*/, '')
76
+ : 'Unknown section';
77
+
78
+ candidates.push({
79
+ lang: pattern.lang,
80
+ ext: pattern.ext,
81
+ line: i + 1,
82
+ section: sectionHeader,
83
+ text: line.trim()
84
+ });
85
+ break; // One match per line is enough
86
+ }
87
+ }
88
+ }
89
+
90
+ if (candidates.length === 0) {
91
+ process.exit(0);
92
+ }
93
+
94
+ // Deduplicate by language
95
+ const uniqueLangs = [...new Set(candidates.map(c => c.lang))];
96
+
97
+ // Output suggestion for Claude to relay to user
98
+ const suggestions = uniqueLangs.map(lang => {
99
+ const matches = candidates.filter(c => c.lang === lang);
100
+ const ext = matches[0].ext;
101
+ return ` - ${lang} (${ext}): ${matches.length} mention${matches.length > 1 ? 's' : ''} found`;
102
+ }).join('\n');
103
+
104
+ console.log(`FEEDBACK.md contains guidance that references specific file types.`);
105
+ console.log(`These entries may be more reliably delivered as .claude/rules/ files:\n`);
106
+ console.log(suggestions);
107
+ console.log(`\nConsider asking the user if they'd like to migrate these to rules.`);
108
+ console.log(`Rules auto-inject when matching files are touched — more deterministic than FEEDBACK.md.`);
109
+
110
+ process.exit(0);
111
+ }
@@ -2,6 +2,19 @@
2
2
  "env": {
3
3
  "CLAUDE_CODE_DISABLE_AUTO_MEMORY": "0"
4
4
  },
5
+ "hooks": {
6
+ "PostToolUse": [
7
+ {
8
+ "matcher": "Edit|Write",
9
+ "hooks": [
10
+ {
11
+ "type": "command",
12
+ "command": "node .claude/hooks/feedback-rule-check.js"
13
+ }
14
+ ]
15
+ }
16
+ ]
17
+ },
5
18
  "permissions": {
6
19
  "allow": [
7
20
  "Read(./**)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-autoconfig",
3
- "version": "1.0.115",
3
+ "version": "1.0.116",
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",