@overscore/cli 0.11.10 → 0.11.11

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/dist/index.js +13 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1262,16 +1262,6 @@ async function uploadKnowledgeBase(targetDir, baseUrl, projectSlug, apiKey) {
1262
1262
  // Non-fatal
1263
1263
  }
1264
1264
  }
1265
- /**
1266
- * Fetch the latest platform-owned Claude Code rules from the Hub and write
1267
- * them into the project's .claude/ directory. This keeps rules like
1268
- * data-fetching.md, query-performance.md, and skills up to date even in
1269
- * projects that were scaffolded months ago.
1270
- *
1271
- * Called from `deploy` (before uploading) and `pull` (after extracting).
1272
- * User-owned files (company-context.md, this-dashboard.md, knowledge/)
1273
- * are NOT touched — those sync via separate mechanisms.
1274
- */
1275
1265
  const DASHBOARD_IMPORTS = [
1276
1266
  "@.claude/rules/this-dashboard.md",
1277
1267
  "@.claude/knowledge/INDEX.md",
@@ -1284,16 +1274,19 @@ const ANALYSIS_IMPORTS = [
1284
1274
  ];
1285
1275
  /**
1286
1276
  * Ensures the project's CLAUDE.md has the standard @import lines at the top.
1287
- * Detects dashboard vs analysis by file presence. Injects only what's missing —
1288
- * never overwrites existing content. Returns true if CLAUDE.md was modified.
1277
+ * Detects dashboard vs analysis by reading the CLAUDE.md heading. Injects only
1278
+ * what's missing — never overwrites existing content. Returns true if modified.
1289
1279
  */
1290
1280
  function syncClaudeMdImports(targetDir) {
1291
1281
  const claudeMdPath = path.join(targetDir, ".claude", "CLAUDE.md");
1292
1282
  if (!fs.existsSync(claudeMdPath))
1293
1283
  return false;
1294
- const isAnalysis = fs.existsSync(path.join(targetDir, "analysis-log.md"));
1284
+ const content = fs.readFileSync(claudeMdPath, "utf-8");
1285
+ const firstHeading = content.match(/^#\s+Overscore\s+(Dashboard|Analysis)/im);
1286
+ if (!firstHeading)
1287
+ return false;
1288
+ const isAnalysis = firstHeading[1].toLowerCase() === "analysis";
1295
1289
  const requiredImports = isAnalysis ? ANALYSIS_IMPORTS : DASHBOARD_IMPORTS;
1296
- let content = fs.readFileSync(claudeMdPath, "utf-8");
1297
1290
  const missing = requiredImports.filter((imp) => !content.includes(imp));
1298
1291
  if (missing.length === 0)
1299
1292
  return false;
@@ -1307,6 +1300,12 @@ function syncClaudeMdImports(targetDir) {
1307
1300
  fs.writeFileSync(claudeMdPath, updated);
1308
1301
  return true;
1309
1302
  }
1303
+ /**
1304
+ * Fetch the latest platform-owned Claude Code rules from the Hub and write
1305
+ * them into the project's .claude/ directory. Called from `deploy` (before
1306
+ * uploading), `pull` (after extracting), and `syncHubManagedRules` (analysis
1307
+ * paths). User-owned files (knowledge/, this-dashboard.md) are NOT touched.
1308
+ */
1310
1309
  async function syncPlatformRules(targetDir, baseUrl, apiKey) {
1311
1310
  try {
1312
1311
  const res = await fetch(`${baseUrl}/api/projects/platform-rules`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overscore/cli",
3
- "version": "0.11.10",
3
+ "version": "0.11.11",
4
4
  "description": "CLI for deploying Overscore dashboards and publishing analyses",
5
5
  "bin": {
6
6
  "overscore": "dist/index.js"