@hone-ai/cli 1.10.0 → 1.11.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.
- package/hone-cli.js +24 -36
- package/lib/refresh-knowledge.js +4 -1
- package/package.json +1 -1
package/hone-cli.js
CHANGED
|
@@ -387,7 +387,12 @@ program
|
|
|
387
387
|
process.exit(1);
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
// ── Phase 1b: Install
|
|
390
|
+
// ── Phase 1b: Install CLAUDE.md ──────────────────────────────────────────
|
|
391
|
+
// HC-019y: removed the install-time .github/agents/ -> .claude/agents/
|
|
392
|
+
// mirror. The bash setup script now writes agents directly to
|
|
393
|
+
// .claude/agents/ (the path Claude Code actually reads). Pre-fix the
|
|
394
|
+
// mirror ran only at install time, so post-install edits to
|
|
395
|
+
// .github/agents/ were silently dropped (OptionsFlow E34-A: 6+ PRs).
|
|
391
396
|
const repoRoot = process.cwd();
|
|
392
397
|
const claudeMdSrc = path.join(tmpDir, 'CLAUDE.md');
|
|
393
398
|
const claudeMdDst = path.join(repoRoot, 'CLAUDE.md');
|
|
@@ -402,20 +407,6 @@ program
|
|
|
402
407
|
}
|
|
403
408
|
}
|
|
404
409
|
|
|
405
|
-
// Create .claude/agents/ with symlinks or copies of .github/agents/
|
|
406
|
-
const ghAgentsDir = path.join(repoRoot, '.github', 'agents');
|
|
407
|
-
const claudeAgentsDir = path.join(repoRoot, '.claude', 'agents');
|
|
408
|
-
if (fs.existsSync(ghAgentsDir)) {
|
|
409
|
-
fs.mkdirSync(claudeAgentsDir, { recursive: true });
|
|
410
|
-
const agentFiles = fs.readdirSync(ghAgentsDir).filter(f => f.endsWith('.agent.md'));
|
|
411
|
-
for (const file of agentFiles) {
|
|
412
|
-
const src = path.join(ghAgentsDir, file);
|
|
413
|
-
const dst = path.join(claudeAgentsDir, file);
|
|
414
|
-
fs.copyFileSync(src, dst);
|
|
415
|
-
}
|
|
416
|
-
console.log(` ✓ .claude/agents/ created (${agentFiles.length} agents mirrored from .github/agents/)`);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
410
|
// ── Phase 1c: Platform grounding (HC-013b-setup) ──────────────────────
|
|
420
411
|
// Runs AFTER bash script writes .pipeline-config.yml.
|
|
421
412
|
// Discovers metadata types, detects MCP, selects doc registry URLs,
|
|
@@ -1505,7 +1496,12 @@ program
|
|
|
1505
1496
|
}
|
|
1506
1497
|
}
|
|
1507
1498
|
|
|
1508
|
-
// ── 2. Sync agent prompts into .
|
|
1499
|
+
// ── 2. Sync agent prompts into .claude/agents/*.agent.md ───────────────
|
|
1500
|
+
// HC-019y: writes directly to .claude/agents/ (the path Claude Code
|
|
1501
|
+
// actually reads). Pre-fix `hone sync` wrote to .github/agents/ and
|
|
1502
|
+
// mirrored to .claude/agents/, but the dual-directory layout caused
|
|
1503
|
+
// OptionsFlow E34-A's silent-drop trap when adopters edited the wrong
|
|
1504
|
+
// path. Mirror eliminated; .github/agents/ is now legacy.
|
|
1509
1505
|
if (!opts.skillsOnly) {
|
|
1510
1506
|
const agents = [
|
|
1511
1507
|
'story-groomer',
|
|
@@ -1520,9 +1516,16 @@ program
|
|
|
1520
1516
|
];
|
|
1521
1517
|
|
|
1522
1518
|
console.log('\nSyncing agent prompts...');
|
|
1523
|
-
const agentsDir = path.join(process.cwd(), '.
|
|
1519
|
+
const agentsDir = path.join(process.cwd(), '.claude', 'agents');
|
|
1524
1520
|
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1525
1521
|
|
|
1522
|
+
// Legacy-path migration warning (one-time, non-destructive).
|
|
1523
|
+
const legacyGhAgents = path.join(process.cwd(), '.github', 'agents');
|
|
1524
|
+
if (fs.existsSync(legacyGhAgents)) {
|
|
1525
|
+
console.log(' ⚠ Legacy .github/agents/ detected — Claude Code reads .claude/agents/');
|
|
1526
|
+
console.log(' Migrate any REPO-SPECIFIC edits then `rm -rf .github/agents/`');
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1526
1529
|
let synced = 0;
|
|
1527
1530
|
for (const agent of agents) {
|
|
1528
1531
|
try {
|
|
@@ -1531,7 +1534,7 @@ program
|
|
|
1531
1534
|
headers: { Accept: 'text/markdown' },
|
|
1532
1535
|
});
|
|
1533
1536
|
const dest = path.join(agentsDir, `${agent}.agent.md`);
|
|
1534
|
-
const rel =
|
|
1537
|
+
const rel = `.claude/agents/${agent}.agent.md`;
|
|
1535
1538
|
const result = safeWrite(dest, rel, r.data);
|
|
1536
1539
|
if (result !== 'skipped') {
|
|
1537
1540
|
console.log(` ✓ ${rel}`);
|
|
@@ -1539,28 +1542,13 @@ program
|
|
|
1539
1542
|
}
|
|
1540
1543
|
} catch (e) {
|
|
1541
1544
|
if (e.response?.status === 404) {
|
|
1542
|
-
console.log(` ⚠ agents/${agent}.agent.md — prompt not seeded yet (run seed-agent-prompts.js)`);
|
|
1545
|
+
console.log(` ⚠ .claude/agents/${agent}.agent.md — prompt not seeded yet (run seed-agent-prompts.js)`);
|
|
1543
1546
|
} else {
|
|
1544
|
-
console.log(` ⚠ agents/${agent}.agent.md — ${e.message}`);
|
|
1547
|
+
console.log(` ⚠ .claude/agents/${agent}.agent.md — ${e.message}`);
|
|
1545
1548
|
}
|
|
1546
1549
|
}
|
|
1547
1550
|
}
|
|
1548
1551
|
if (synced > 0) console.log(`\nSynced ${synced} agent prompts.`);
|
|
1549
|
-
|
|
1550
|
-
// Mirror to .claude/agents/ for Claude Code. This mirror is a derived
|
|
1551
|
-
// copy of .github/agents/, so it's safe to overwrite — local edits
|
|
1552
|
-
// belong in the source-of-truth dir. We still respect skipped files:
|
|
1553
|
-
// if the source was skipped, don't overwrite the mirror either.
|
|
1554
|
-
const claudeAgentsDir = path.join(process.cwd(), '.claude', 'agents');
|
|
1555
|
-
const ghAgentsDir = path.join(process.cwd(), '.github', 'agents');
|
|
1556
|
-
if (fs.existsSync(ghAgentsDir)) {
|
|
1557
|
-
fs.mkdirSync(claudeAgentsDir, { recursive: true });
|
|
1558
|
-
const files = fs.readdirSync(ghAgentsDir).filter(f => f.endsWith('.agent.md'));
|
|
1559
|
-
for (const f of files) {
|
|
1560
|
-
fs.copyFileSync(path.join(ghAgentsDir, f), path.join(claudeAgentsDir, f));
|
|
1561
|
-
}
|
|
1562
|
-
console.log(` ✓ .claude/agents/ mirrored (${files.length} agents)`);
|
|
1563
|
-
}
|
|
1564
1552
|
}
|
|
1565
1553
|
|
|
1566
1554
|
// ── 3. Sync copilot-instructions.md from server ──────────────────────
|
|
@@ -2029,7 +2017,7 @@ program
|
|
|
2029
2017
|
console.log('╚══════════════════════════════════════════════╝');
|
|
2030
2018
|
console.log('');
|
|
2031
2019
|
console.log(' Your repo now has:');
|
|
2032
|
-
console.log(' • 9 agents (.
|
|
2020
|
+
console.log(' • 9 agents (.claude/agents/)');
|
|
2033
2021
|
console.log(' • 11 enterprise skills + domain skills');
|
|
2034
2022
|
console.log(' • CI workflow (ai-review.yml)');
|
|
2035
2023
|
console.log(' • CLAUDE.md + copilot-instructions.md');
|
package/lib/refresh-knowledge.js
CHANGED
|
@@ -26,9 +26,12 @@ const path = require('node:path');
|
|
|
26
26
|
const crypto = require('node:crypto');
|
|
27
27
|
const { execSync } = require('node:child_process');
|
|
28
28
|
|
|
29
|
+
// HC-019y (2026-05-29): removed `.github/agents` from refresh paths.
|
|
30
|
+
// Agents live exclusively at `.claude/agents/` (Claude Code's read path)
|
|
31
|
+
// after the install-time mirror was eliminated. `.github/agents/` is now
|
|
32
|
+
// a legacy directory adopters are expected to manually delete.
|
|
29
33
|
const KNOWLEDGE_DIRS = [
|
|
30
34
|
'.github/skills',
|
|
31
|
-
'.github/agents',
|
|
32
35
|
'.claude/agents',
|
|
33
36
|
'.github/copilot-instructions.md',
|
|
34
37
|
];
|