You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #129 introduced SKILLIFY_COMMANDS in src/cli/skillify-spec.ts — the single source of truth for the hivemind skillify ... command list. As part of #129 we centralized all TypeScript-side consumers of that list:
These can't be solved the same way as the TS callers because SKILL.md is shipped Markdown — it can't import TypeScript at runtime. We need a build-step generator.
Proposed approach
Markers in each SKILL.md — wrap the command block in HTML-comment markers so the generator can locate it deterministically without ambiguity:
<!-- SKILLIFY_COMMANDS_START -->-`hivemind skillify` — show current scope...
...
<!-- SKILLIFY_COMMANDS_END -->
Imports the compiled SKILLIFY_COMMANDS from bundle/cli.js (or dist/skillify-spec.js)
Renders the block in the same bullet format the SKILL.md files use today
Rewrites the content between <!-- SKILLIFY_COMMANDS_START --> / END in all 3 files
Wire into npm run build — append node scripts/sync-md-commands.mjs to the build pipeline so the markdown can't drift in CI.
Drift detection test — under tests/, mirror the structure of tests/pi/skillify-spec-drift.test.ts: read each SKILL.md, parse the block between markers, assert it matches what renderSkillifyCommands() would produce. Fails CI if a developer edits the markdown by hand and skips the build.
Same pattern for ORG_COMMANDS(optional, can be a separate sub-task) — the org/auth command list (hivemind login, whoami, org list, …) is hand-typed in the same 3 SKILL.md files plus the per-agent SessionStart hooks. Extracting an ORG_COMMANDS constant and applying the same generator closes the symmetric debt.
Risk surface: A scripts/sync-md-commands.mjs + npm run build change touches CI and can break the release flow. Worth landing on its own branch where it's the focus.
Independence: This change has zero behavior impact on the mine-local feature — it's pure documentation upkeep.
Acceptance criteria
All 3 SKILL.md files have the skillify command block generated from SKILLIFY_COMMANDS
npm run build regenerates the blocks deterministically
Drift test fails if a SKILL.md block is edited by hand and not regenerated
Optionally: same applied to org/auth commands via ORG_COMMANDS
Context
PR #129 introduced
SKILLIFY_COMMANDSinsrc/cli/skillify-spec.ts— the single source of truth for thehivemind skillify ...command list. As part of #129 we centralized all TypeScript-side consumers of that list:renderSkillifyCommands()pi/extension-source/hivemind.ts(guarded by a drift test intests/pi/skillify-spec-drift.test.ts)hivemind --helptop-level output insrc/cli/index.ts(centralized in feat(skillify): one-shot local skill mining for non-auth users (mine-local) #129 as part of the kaghni feedback)hivemind skillify --helpusage()insrc/commands/skillify.ts(centralized in feat(skillify): one-shot local skill mining for non-auth users (mine-local) #129)What remains hand-typed are the 3 shipped SKILL.md files:
claude-code/skills/hivemind-memory/SKILL.md—## Skill Management (skillify)sectioncodex/skills/deeplake-memory/SKILL.md— same blockopenclaw/skills/SKILL.md— same block (pre-dates feat(skillify): one-shot local skill mining for non-auth users (mine-local) #129, onmainsince April)These can't be solved the same way as the TS callers because SKILL.md is shipped Markdown — it can't
importTypeScript at runtime. We need a build-step generator.Proposed approach
Markers in each SKILL.md — wrap the command block in HTML-comment markers so the generator can locate it deterministically without ambiguity:
Generator script — add
scripts/sync-md-commands.mjsthat:SKILLIFY_COMMANDSfrombundle/cli.js(ordist/skillify-spec.js)<!-- SKILLIFY_COMMANDS_START -->/ENDin all 3 filesWire into
npm run build— appendnode scripts/sync-md-commands.mjsto the build pipeline so the markdown can't drift in CI.Drift detection test — under
tests/, mirror the structure oftests/pi/skillify-spec-drift.test.ts: read each SKILL.md, parse the block between markers, assert it matches whatrenderSkillifyCommands()would produce. Fails CI if a developer edits the markdown by hand and skips the build.Same pattern for
ORG_COMMANDS(optional, can be a separate sub-task) — the org/auth command list (hivemind login,whoami,org list, …) is hand-typed in the same 3 SKILL.md files plus the per-agent SessionStart hooks. Extracting anORG_COMMANDSconstant and applying the same generator closes the symmetric debt.Why a separate PR
mine-local) #129 ships thehivemind skillify mine-localuser-facing feature. Wiring a Markdown generator + drift test would tangle the build pipeline with the feature work and expand the review surface significantly.scripts/sync-md-commands.mjs+npm run buildchange touches CI and can break the release flow. Worth landing on its own branch where it's the focus.Acceptance criteria
SKILLIFY_COMMANDSnpm run buildregenerates the blocks deterministicallyORG_COMMANDSReference