@valentia-ai-skills/framework 1.0.11 → 1.0.12

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.
Files changed (2) hide show
  1. package/bin/cli.js +49 -8
  2. package/package.json +2 -2
package/bin/cli.js CHANGED
@@ -148,13 +148,36 @@ function detectTools() {
148
148
  return detected;
149
149
  }
150
150
 
151
+ function getProjectName() {
152
+ try {
153
+ const pkgPath = path.join(PROJECT_ROOT, "package.json");
154
+ if (fs.existsSync(pkgPath)) {
155
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
156
+ if (pkg.name) return pkg.name.replace(/^@[^/]+\//, ""); // strip scope
157
+ }
158
+ } catch { /* ignore */ }
159
+ return path.basename(PROJECT_ROOT);
160
+ }
161
+
162
+ function filterSkillsForProject(skills) {
163
+ const projectName = getProjectName();
164
+ return skills.filter((skill) => {
165
+ if (skill.scope !== "project") return true;
166
+ // Only install project skills matching this project
167
+ return skill.project_name === projectName;
168
+ });
169
+ }
170
+
151
171
  function installSkillsForTool(toolKey, skills) {
152
172
  const tool = TOOL_CONFIGS[toolKey];
153
173
  if (!tool) return 0;
154
174
 
175
+ // Filter: only install project-scoped skills that match this project
176
+ const filtered = filterSkillsForProject(skills);
177
+
155
178
  if (tool.format === "skill-folder") {
156
179
  const skillsDir = path.join(PROJECT_ROOT, tool.skillsDir);
157
- for (const skill of skills) {
180
+ for (const skill of filtered) {
158
181
  const dest = path.join(skillsDir, skill.name);
159
182
  mkdirp(dest);
160
183
  fs.writeFileSync(path.join(dest, "SKILL.md"), skill.content);
@@ -168,7 +191,7 @@ function installSkillsForTool(toolKey, skills) {
168
191
  }
169
192
  }
170
193
  }
171
- return skills.length;
194
+ return filtered.length;
172
195
  }
173
196
 
174
197
  if (tool.format === "rules-file") {
@@ -180,7 +203,7 @@ function installSkillsForTool(toolKey, skills) {
180
203
  content += `# Do not edit manually — run 'npx ai-skills update' to refresh\n`;
181
204
  content += `# Last updated: ${new Date().toISOString().split("T")[0]}\n\n`;
182
205
 
183
- for (const skill of skills) {
206
+ for (const skill of filtered) {
184
207
  // Strip YAML frontmatter for rules files
185
208
  const body = skill.content.replace(/^---[\s\S]*?---\n*/m, "").trim();
186
209
  content += `\n${"=".repeat(60)}\n`;
@@ -198,7 +221,7 @@ function installSkillsForTool(toolKey, skills) {
198
221
  }
199
222
 
200
223
  fs.writeFileSync(rulesPath, content);
201
- return skills.length;
224
+ return filtered.length;
202
225
  }
203
226
 
204
227
  return 0;
@@ -354,7 +377,20 @@ async function cmdSetup() {
354
377
  process.exit(1);
355
378
  }
356
379
 
357
- console.log(` ${c("bold", skills.length)} skill(s) to install\n`);
380
+ // Show skill counts with project context
381
+ const projectName = getProjectName();
382
+ const teamSkillCount = skills.filter((s) => s.scope !== "project").length;
383
+ const projectSkillCount = skills.filter((s) => s.scope === "project" && s.project_name === projectName).length;
384
+ const skippedProjectCount = skills.filter((s) => s.scope === "project" && s.project_name !== projectName).length;
385
+
386
+ console.log(` ${c("bold", teamSkillCount)} team skill(s)`);
387
+ if (projectSkillCount > 0) {
388
+ console.log(` ${c("bold", projectSkillCount)} project skill(s) for ${c("green", projectName)}`);
389
+ }
390
+ if (skippedProjectCount > 0) {
391
+ console.log(c("dim", ` ${skippedProjectCount} project skill(s) skipped (different project)`));
392
+ }
393
+ console.log("");
358
394
 
359
395
  } catch (err) {
360
396
  console.log(c("red", `\n✗ Could not complete verification: ${err.message}`));
@@ -367,7 +403,8 @@ async function cmdSetup() {
367
403
  process.exit(1);
368
404
  }
369
405
 
370
- // 5. Install for each tool
406
+ // 5. Install for each tool (project skills are filtered by project name inside)
407
+ const filteredSkills = filterSkillsForProject(skills);
371
408
  for (const toolKey of tools) {
372
409
  const tool = TOOL_CONFIGS[toolKey];
373
410
  if (!tool) continue;
@@ -375,7 +412,10 @@ async function cmdSetup() {
375
412
  const count = installSkillsForTool(toolKey, skills);
376
413
 
377
414
  if (tool.format === "skill-folder") {
378
- for (const s of skills) console.log(` ${c("green", "✓")} ${s.name}`);
415
+ for (const s of filteredSkills) {
416
+ const label = s.scope === "project" ? `${s.name} ${c("dim", "(project)")}` : s.name;
417
+ console.log(` ${c("green", "✓")} ${label}`);
418
+ }
379
419
  } else {
380
420
  console.log(` ${c("green", "✓")} ${tool.rulesFile} (${count} skills merged)`);
381
421
  }
@@ -387,11 +427,12 @@ async function cmdSetup() {
387
427
  version: require(path.join(__dirname, "..", "package.json")).version,
388
428
  email,
389
429
  team: teamName,
430
+ project: getProjectName(),
390
431
  source: "supabase",
391
432
  analyzeUrl: ANALYZE_FUNCTION_URL,
392
433
  scanUrl: SCAN_FUNCTION_URL,
393
434
  tools,
394
- skills: skills.map((s) => ({ name: s.name, scope: s.scope, version: s.version })),
435
+ skills: filteredSkills.map((s) => ({ name: s.name, scope: s.scope, version: s.version, ...(s.project_name ? { project_name: s.project_name } : {}) })),
395
436
  installedAt: new Date().toISOString(),
396
437
  };
397
438
  saveConfig(config);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valentia-ai-skills/framework",
3
- "version": "1.0.11",
4
- "description": "AI development skills framework — centralized coding standards, security patterns, and SOPs for AI-assisted development. Works with Claude Code, Cursor, Copilot, Windsurf, and any AI coding tool.",
3
+ "version": "1.0.12",
4
+ "description": "AI development skills framework — centralized coding standards, security patterns, and SOPs for AI-assisted development. Works with Claude Code, Cursor, Copilot, Windsurf, and any AI coding tool.",
5
5
  "keywords": [
6
6
  "ai-skills",
7
7
  "claude-code",