agent-skill-doctor 0.1.0 → 0.2.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.
@@ -13,7 +13,18 @@ const { DEFAULT_CONFLICT_RULES } = require('../src/doctor/rules');
13
13
  const phase2 = require('../src/doctor/phase2');
14
14
  const { t, dictionaries } = require('../src/doctor/i18n');
15
15
 
16
- const SKIP_DIRS = new Set(['.git', 'node_modules', 'target', 'dist', 'build', '.cache', '.tmp', '.DS_Store']);
16
+ const SKIP_DIRS = new Set([
17
+ '.git', 'node_modules', 'target', 'dist', 'build', '.tmp', '.DS_Store',
18
+ // Agent-specific non-skill directories
19
+ 'sessions', 'backups', 'shell-snapshots', 'session-env',
20
+ 'debug', 'file-history', 'paste-cache', 'plans',
21
+ 'daemon', 'ide', 'hooks', 'logs', 'log', 'errors',
22
+ 'archived_sessions', 'worktrees', 'sqlite',
23
+ 'accounts', 'memories', 'rules', 'docs', 'vendor_imports',
24
+ 'process_manager', 'node_repl', 'ambient-suggestions',
25
+ 'automations', 'codexmate', 'computer-use', 'computer-use-turn-ended',
26
+ 'browser', 'pets',
27
+ ]);
17
28
 
18
29
  function sha256(input) {
19
30
  return crypto.createHash('sha256').update(input).digest('hex');
@@ -34,6 +45,10 @@ function normalizePath(p) {
34
45
  return path.resolve(expandHome(p)).replace(/\\/g, '/');
35
46
  }
36
47
 
48
+ function isDir(p) {
49
+ try { return fs.existsSync(p) && fs.statSync(p).isDirectory(); } catch { return false; }
50
+ }
51
+
37
52
  function ensureDir(dir) {
38
53
  fs.mkdirSync(dir, { recursive: true });
39
54
  }
@@ -106,34 +121,76 @@ function loadConfig() {
106
121
  const home = doctorHome();
107
122
  ensureDir(home);
108
123
  ensureDir(path.join(home, 'reports'));
109
- const candidates = [
110
- // Central library
111
- '~/.skills-manager/skills',
124
+
125
+ // Agent root directories (global)
126
+ const agentRoots = [
112
127
  '~/.skills-manager',
113
- // Agent global skill directories requested by users.
114
- '~/.agent/skills',
115
- '~/.agents/skills',
116
- '~/.agents/skills-core',
117
- '~/.codex/skills',
118
- '~/.claude/skills',
119
- '~/.cursor/skills',
120
- '~/.opencode/skills',
121
- // Project-local skill directories
122
- path.join(process.cwd(), '.agent/skills'),
123
- path.join(process.cwd(), '.agents/skills'),
124
- path.join(process.cwd(), '.codex/skills'),
125
- path.join(process.cwd(), '.claude/skills'),
126
- path.join(process.cwd(), '.cursor/skills'),
127
- path.join(process.cwd(), '.opencode/skills'),
128
- ].map(expandHome).filter(p => {
129
- try { return fs.existsSync(p) && fs.statSync(p).isDirectory(); } catch { return false; }
130
- });
128
+ '~/.agent',
129
+ '~/.agents',
130
+ '~/.codex',
131
+ '~/.claude',
132
+ '~/.cursor',
133
+ '~/.opencode',
134
+ '~/.windsurf',
135
+ '~/.aider',
136
+ '~/.continue',
137
+ '~/.cody',
138
+ '~/.copilot',
139
+ ];
140
+
141
+ // Project-local agent directories
142
+ const projectAgents = [
143
+ '.agent',
144
+ '.agents',
145
+ '.codex',
146
+ '.claude',
147
+ '.cursor',
148
+ '.opencode',
149
+ '.windsurf',
150
+ '.aider',
151
+ '.continue',
152
+ '.cody',
153
+ '.copilot',
154
+ ];
155
+
156
+ const candidates = [];
157
+
158
+ // For each agent root, discover skill directories automatically
159
+ for (const root of agentRoots) {
160
+ const expanded = expandHome(root);
161
+ if (!isDir(expanded)) continue;
162
+
163
+ // Add the root itself (for ~/.skills-manager pattern)
164
+ candidates.push(expanded);
165
+
166
+ // Add skills/ subdirectory if exists
167
+ const skillsDir = path.join(expanded, 'skills');
168
+ if (isDir(skillsDir)) candidates.push(skillsDir);
169
+
170
+ // Add skills-core/ subdirectory if exists (for ~/.agents/skills-core)
171
+ const skillsCoreDir = path.join(expanded, 'skills-core');
172
+ if (isDir(skillsCoreDir)) candidates.push(skillsCoreDir);
173
+
174
+ // Add plugins/ subdirectory if exists (for plugin cache/marketplace)
175
+ const pluginsDir = path.join(expanded, 'plugins');
176
+ if (isDir(pluginsDir)) candidates.push(pluginsDir);
177
+ }
178
+
179
+ // For project-local directories
180
+ for (const agent of projectAgents) {
181
+ const expanded = path.join(process.cwd(), agent);
182
+ if (!isDir(expanded)) continue;
183
+
184
+ const skillsDir = path.join(expanded, 'skills');
185
+ if (isDir(skillsDir)) candidates.push(skillsDir);
186
+ }
187
+
131
188
  return {
132
189
  home,
133
190
  dbPath: path.join(home, 'doctor.db'),
134
191
  reportsDir: path.join(home, 'reports'),
135
192
  scan: { maxDepth: 6 },
136
- roots: candidates,
193
+ roots: [...new Set(candidates)], // deduplicate
137
194
  };
138
195
  }
139
196
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-skill-doctor",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Diagnostic and governance CLI for AI agent skills",
5
5
  "type": "commonjs",
6
6
  "main": "./src/doctor/index.js",