oh-my-copilot 5.19.2 → 5.19.4
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +70 -67
- package/agents/planner.md +4 -4
- package/bin/oh-my-copilot.js +5 -1
- package/bridge/claude-md-coordinator.cjs +2 -2
- package/bridge/cli.cjs +3043 -2635
- package/bridge/mcp-server.cjs +969 -867
- package/bridge/runtime-cli.cjs +244 -184
- package/bridge/team-bridge.cjs +17 -1
- package/bridge/team-mcp.cjs +208 -140
- package/bridge/team.js +73 -13
- package/copilot/agents/planner.md +4 -4
- package/dist/__tests__/ci-evidence.test.d.ts +2 -0
- package/dist/__tests__/ci-evidence.test.d.ts.map +1 -0
- package/dist/__tests__/ci-evidence.test.js +210 -0
- package/dist/__tests__/ci-evidence.test.js.map +1 -0
- package/dist/__tests__/copilot-hooks-manifest.test.js +1 -0
- package/dist/__tests__/copilot-hooks-manifest.test.js.map +1 -1
- package/dist/__tests__/doctor-conflicts.test.js +6 -5
- package/dist/__tests__/doctor-conflicts.test.js.map +1 -1
- package/dist/__tests__/hud/cli-diagnostic.test.js +4 -3
- package/dist/__tests__/hud/cli-diagnostic.test.js.map +1 -1
- package/dist/__tests__/mnemosyne/detector.test.js +3 -2
- package/dist/__tests__/mnemosyne/detector.test.js.map +1 -1
- package/dist/__tests__/run-cjs-windows-stdio-contract.test.js +50 -10
- package/dist/__tests__/run-cjs-windows-stdio-contract.test.js.map +1 -1
- package/dist/__tests__/session-end-process-exit.test.js +15 -5
- package/dist/__tests__/session-end-process-exit.test.js.map +1 -1
- package/dist/__tests__/session-start-script-context.test.js +1 -1
- package/dist/__tests__/session-start-script-context.test.js.map +1 -1
- package/dist/__tests__/setup/stub-skill-list-probe.d.ts +2 -0
- package/dist/__tests__/setup/stub-skill-list-probe.d.ts.map +1 -0
- package/dist/__tests__/setup/stub-skill-list-probe.js +11 -0
- package/dist/__tests__/setup/stub-skill-list-probe.js.map +1 -0
- package/dist/__tests__/setup-claude-md-script.test.js +7 -4
- package/dist/__tests__/setup-claude-md-script.test.js.map +1 -1
- package/dist/__tests__/setup-config-script.test.d.ts +2 -0
- package/dist/__tests__/setup-config-script.test.d.ts.map +1 -0
- package/dist/__tests__/setup-config-script.test.js +350 -0
- package/dist/__tests__/setup-config-script.test.js.map +1 -0
- package/dist/__tests__/shipyard-seed-locale.test.js +1 -1
- package/dist/__tests__/shipyard-seed-locale.test.js.map +1 -1
- package/dist/__tests__/shipyard-skills.test.js +9 -9
- package/dist/__tests__/shipyard-skills.test.js.map +1 -1
- package/dist/__tests__/tier0-docs-consistency.test.js +5 -5
- package/dist/__tests__/tier0-docs-consistency.test.js.map +1 -1
- package/dist/__tests__/trusted-publishing-contract.test.js +56 -7
- package/dist/__tests__/trusted-publishing-contract.test.js.map +1 -1
- package/dist/__tests__/visual-verdict-skill.test.js +1 -1
- package/dist/__tests__/visual-verdict-skill.test.js.map +1 -1
- package/dist/cli/__tests__/autoresearch.test.js +3 -2
- package/dist/cli/__tests__/autoresearch.test.js.map +1 -1
- package/dist/cli/autoresearch.d.ts +1 -1
- package/dist/cli/autoresearch.d.ts.map +1 -1
- package/dist/cli/autoresearch.js +2 -1
- package/dist/cli/autoresearch.js.map +1 -1
- package/dist/cli/commands/__tests__/factory-init.test.js +2 -1
- package/dist/cli/commands/__tests__/factory-init.test.js.map +1 -1
- package/dist/cli/commands/__tests__/intake.test.js +26 -4
- package/dist/cli/commands/__tests__/intake.test.js.map +1 -1
- package/dist/cli/commands/doctor-conflicts.d.ts.map +1 -1
- package/dist/cli/commands/doctor-conflicts.js +5 -4
- package/dist/cli/commands/doctor-conflicts.js.map +1 -1
- package/dist/cli/commands/factory.d.ts.map +1 -1
- package/dist/cli/commands/factory.js +4 -3
- package/dist/cli/commands/factory.js.map +1 -1
- package/dist/cli/commands/intake.d.ts.map +1 -1
- package/dist/cli/commands/intake.js +13 -4
- package/dist/cli/commands/intake.js.map +1 -1
- package/dist/cli/commands/release.d.ts.map +1 -1
- package/dist/cli/commands/release.js +11 -2
- package/dist/cli/commands/release.js.map +1 -1
- package/dist/cli/commands/ship.d.ts +1 -1
- package/dist/cli/commands/ship.js +1 -1
- package/dist/copilot-run/job.d.ts.map +1 -1
- package/dist/copilot-run/job.js +4 -1
- package/dist/copilot-run/job.js.map +1 -1
- package/dist/copilot-run/sandbox.d.ts +2 -7
- package/dist/copilot-run/sandbox.d.ts.map +1 -1
- package/dist/copilot-run/sandbox.js +2 -26
- package/dist/copilot-run/sandbox.js.map +1 -1
- package/dist/factory/__tests__/listener.test.js +22 -4
- package/dist/factory/__tests__/listener.test.js.map +1 -1
- package/dist/factory/listener.d.ts +2 -2
- package/dist/factory/listener.d.ts.map +1 -1
- package/dist/factory/listener.js +20 -5
- package/dist/factory/listener.js.map +1 -1
- package/dist/factory/run/__tests__/prepare-gates.test.js +7 -1
- package/dist/factory/run/__tests__/prepare-gates.test.js.map +1 -1
- package/dist/factory/run/engine.d.ts.map +1 -1
- package/dist/factory/run/engine.js +1 -0
- package/dist/factory/run/engine.js.map +1 -1
- package/dist/features/continuation-enforcement.d.ts.map +1 -1
- package/dist/features/continuation-enforcement.js +2 -1
- package/dist/features/continuation-enforcement.js.map +1 -1
- package/dist/features/lookout/__tests__/lookout.test.js +9 -6
- package/dist/features/lookout/__tests__/lookout.test.js.map +1 -1
- package/dist/forge/__tests__/gh-argv-baseline.factory.test.js +7 -1
- package/dist/forge/__tests__/gh-argv-baseline.factory.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge.test.js +10 -2
- package/dist/hooks/__tests__/bridge.test.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/pipeline.test.js +2 -1
- package/dist/hooks/autopilot/__tests__/pipeline.test.js.map +1 -1
- package/dist/hooks/autopilot/adapters/execution-adapter.d.ts.map +1 -1
- package/dist/hooks/autopilot/adapters/execution-adapter.js +3 -2
- package/dist/hooks/autopilot/adapters/execution-adapter.js.map +1 -1
- package/dist/hooks/autopilot/adapters/ralplan-adapter.d.ts.map +1 -1
- package/dist/hooks/autopilot/adapters/ralplan-adapter.js +2 -1
- package/dist/hooks/autopilot/adapters/ralplan-adapter.js.map +1 -1
- package/dist/hooks/learner/detector.d.ts.map +1 -1
- package/dist/hooks/learner/detector.js +2 -6
- package/dist/hooks/learner/detector.js.map +1 -1
- package/dist/hooks/mode-registry/index.d.ts.map +1 -1
- package/dist/hooks/mode-registry/index.js +2 -1
- package/dist/hooks/mode-registry/index.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js +7 -0
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts +1 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +6 -5
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/persistent-mode/session-isolation.test.js +23 -14
- package/dist/hooks/persistent-mode/session-isolation.test.js.map +1 -1
- package/dist/hooks/ralph/loop.d.ts +1 -1
- package/dist/hooks/ralph/loop.js +1 -1
- package/dist/hooks/ralph/prd.d.ts.map +1 -1
- package/dist/hooks/ralph/prd.js +2 -1
- package/dist/hooks/ralph/prd.js.map +1 -1
- package/dist/hooks/ralph/stale-prd.d.ts +2 -2
- package/dist/hooks/ralph/stale-prd.js +3 -3
- package/dist/hooks/ralph/stale-prd.js.map +1 -1
- package/dist/hooks/ralph/verifier.d.ts +1 -1
- package/dist/hooks/ralph/verifier.d.ts.map +1 -1
- package/dist/hooks/ralph/verifier.js +4 -3
- package/dist/hooks/ralph/verifier.js.map +1 -1
- package/dist/hooks/session-end/__tests__/spawn-next.test.js +31 -4
- package/dist/hooks/session-end/__tests__/spawn-next.test.js.map +1 -1
- package/dist/hooks/session-end/spawn-next.d.ts +6 -3
- package/dist/hooks/session-end/spawn-next.d.ts.map +1 -1
- package/dist/hooks/session-end/spawn-next.js +19 -6
- package/dist/hooks/session-end/spawn-next.js.map +1 -1
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +3 -2
- package/dist/hud/index.js.map +1 -1
- package/dist/installer/__tests__/hook-templates.test.js +3 -1
- package/dist/installer/__tests__/hook-templates.test.js.map +1 -1
- package/dist/installer/__tests__/session-start-template.test.js +16 -8
- package/dist/installer/__tests__/session-start-template.test.js.map +1 -1
- package/dist/installer/hooks.d.ts +1 -1
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +2 -1
- package/dist/installer/hooks.js.map +1 -1
- package/dist/release/__tests__/checks.test.js +39 -1
- package/dist/release/__tests__/checks.test.js.map +1 -1
- package/dist/release/__tests__/engine.test.js +236 -3
- package/dist/release/__tests__/engine.test.js.map +1 -1
- package/dist/release/checks.d.ts +18 -1
- package/dist/release/checks.d.ts.map +1 -1
- package/dist/release/checks.js +40 -1
- package/dist/release/checks.js.map +1 -1
- package/dist/release/engine.d.ts +14 -2
- package/dist/release/engine.d.ts.map +1 -1
- package/dist/release/engine.js +211 -44
- package/dist/release/engine.js.map +1 -1
- package/dist/ship/__tests__/exec-env.test.d.ts +2 -0
- package/dist/ship/__tests__/exec-env.test.d.ts.map +1 -0
- package/dist/ship/__tests__/exec-env.test.js +26 -0
- package/dist/ship/__tests__/exec-env.test.js.map +1 -0
- package/dist/ship/__tests__/exec-plant.test.d.ts +2 -0
- package/dist/ship/__tests__/exec-plant.test.d.ts.map +1 -0
- package/dist/ship/__tests__/exec-plant.test.js +34 -0
- package/dist/ship/__tests__/exec-plant.test.js.map +1 -0
- package/dist/ship/__tests__/gates.test.js +35 -0
- package/dist/ship/__tests__/gates.test.js.map +1 -1
- package/dist/ship/__tests__/workflow-checks.test.js +34 -5
- package/dist/ship/__tests__/workflow-checks.test.js.map +1 -1
- package/dist/ship/config.js +3 -3
- package/dist/ship/config.js.map +1 -1
- package/dist/ship/exec.d.ts.map +1 -1
- package/dist/ship/exec.js +10 -2
- package/dist/ship/exec.js.map +1 -1
- package/dist/ship/gates.d.ts.map +1 -1
- package/dist/ship/gates.js +3 -1
- package/dist/ship/gates.js.map +1 -1
- package/dist/skills/__tests__/mingw-escape.test.js +0 -35
- package/dist/skills/__tests__/mingw-escape.test.js.map +1 -1
- package/dist/skills/__tests__/omc-setup-optout.test.js +4 -3
- package/dist/skills/__tests__/omc-setup-optout.test.js.map +1 -1
- package/dist/smoke/__tests__/copilot-factory-run-scenario.test.js +7 -1
- package/dist/smoke/__tests__/copilot-factory-run-scenario.test.js.map +1 -1
- package/dist/smoke/__tests__/copilot-sdk-driver.test.js +2 -2
- package/dist/smoke/__tests__/copilot-sdk-driver.test.js.map +1 -1
- package/dist/smoke/copilot-sdk-scenarios.d.ts.map +1 -1
- package/dist/smoke/copilot-sdk-scenarios.js +2 -1
- package/dist/smoke/copilot-sdk-scenarios.js.map +1 -1
- package/dist/team/__tests__/git-worktree.test.js +10 -1
- package/dist/team/__tests__/git-worktree.test.js.map +1 -1
- package/dist/team/__tests__/runtime-cli.test.js +4 -4
- package/dist/team/__tests__/runtime-cli.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +16 -2
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-launch-ack.test.js +14 -0
- package/dist/team/__tests__/worker-launch-ack.test.js.map +1 -1
- package/dist/team/git-worktree.d.ts.map +1 -1
- package/dist/team/git-worktree.js +13 -5
- package/dist/team/git-worktree.js.map +1 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +8 -6
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/ultragoal/goal-record.d.ts.map +1 -1
- package/dist/ultragoal/goal-record.js +2 -1
- package/dist/ultragoal/goal-record.js.map +1 -1
- package/dist/utils/__tests__/skill-slash.test.d.ts +2 -0
- package/dist/utils/__tests__/skill-slash.test.d.ts.map +1 -0
- package/dist/utils/__tests__/skill-slash.test.js +307 -0
- package/dist/utils/__tests__/skill-slash.test.js.map +1 -0
- package/dist/utils/__tests__/windows-search.test.d.ts +2 -0
- package/dist/utils/__tests__/windows-search.test.d.ts.map +1 -0
- package/dist/utils/__tests__/windows-search.test.js +154 -0
- package/dist/utils/__tests__/windows-search.test.js.map +1 -0
- package/dist/utils/skill-registry.d.ts +51 -0
- package/dist/utils/skill-registry.d.ts.map +1 -0
- package/dist/utils/skill-registry.js +168 -0
- package/dist/utils/skill-registry.js.map +1 -0
- package/dist/utils/skill-slash.d.ts +18 -0
- package/dist/utils/skill-slash.d.ts.map +1 -0
- package/dist/utils/skill-slash.js +20 -0
- package/dist/utils/skill-slash.js.map +1 -0
- package/dist/utils/windows-search.d.ts +42 -0
- package/dist/utils/windows-search.d.ts.map +1 -0
- package/dist/utils/windows-search.js +94 -0
- package/dist/utils/windows-search.js.map +1 -0
- package/docs/ARCHITECTURE.md +29 -29
- package/docs/CLAUDE.md +4 -4
- package/docs/FIELD-TESTING.md +563 -0
- package/docs/GETTING-STARTED.md +11 -11
- package/docs/HOOKS.md +8 -8
- package/docs/MIGRATION.md +100 -100
- package/docs/PERFORMANCE-MONITORING.md +2 -2
- package/docs/REFERENCE.md +131 -131
- package/docs/TOOLS.md +1 -1
- package/docs/cancel-skill-active-state-gap.md +2 -2
- package/docs/copilot-instructions.md +3 -3
- package/docs/design/P2-RUN-LEDGER-AND-INTAKE-PLAN.md +1 -1
- package/docs/design/project-session-manager.md +1 -1
- package/docs/field-testing-first-prompt.md +36 -0
- package/docs/shared/features.md +5 -5
- package/docs/shipyard.md +8 -8
- package/package.json +2 -2
- package/plugin.json +1 -1
- package/scripts/build-workflow-stage-prompts.mjs +15 -6
- package/scripts/ci/duration-sequencer.mjs +69 -0
- package/scripts/ci/durations-reporter.mjs +34 -0
- package/scripts/ci/tree-reuse.mjs +166 -0
- package/scripts/ci/update-test-durations.mjs +62 -0
- package/scripts/copilot/dispatch.cjs +3 -0
- package/scripts/find-node.sh +1 -1
- package/scripts/keyword-detector.mjs +5 -4
- package/scripts/lib/copilot-hook-adapter.cjs +3 -0
- package/scripts/lib/hud-wrapper-template.txt +2 -2
- package/scripts/lib/skill-slash.mjs +11 -0
- package/scripts/lib/windows-search.cjs +40 -0
- package/scripts/lib/windows-search.mjs +7 -0
- package/scripts/lib/workflow-stage-prompts.mjs +6 -2
- package/scripts/persistent-mode.cjs +11 -10
- package/scripts/persistent-mode.mjs +16 -11
- package/scripts/plugin-shipping-surface.mjs +1 -0
- package/scripts/pre-tool-enforcer.mjs +1 -1
- package/scripts/session-start.mjs +3 -3
- package/scripts/setup-claude-md.mjs +3 -0
- package/scripts/setup-config.mjs +420 -0
- package/scripts/setup-progress.mjs +3 -0
- package/scripts/shipyard-audit.mjs +2 -1
- package/scripts/stale-run-reporter.mjs +2 -1
- package/skills/AGENTS.md +4 -4
- package/skills/ai-slop-cleaner/SKILL.md +3 -3
- package/skills/ask/SKILL.md +7 -7
- package/skills/ask-navigator/SKILL.md +11 -11
- package/skills/autopilot/SKILL.md +5 -5
- package/skills/cancel/SKILL.md +5 -5
- package/skills/configure-notifications/SKILL.md +10 -10
- package/skills/critique/SKILL.md +1 -1
- package/skills/discover/SKILL.md +1 -1
- package/skills/drydock/SKILL.md +5 -5
- package/skills/external-context/SKILL.md +4 -4
- package/skills/graph/SKILL.md +2 -2
- package/skills/harbor/SKILL.md +7 -7
- package/skills/hud/SKILL.md +10 -10
- package/skills/intent/SKILL.md +1 -1
- package/skills/launch/SKILL.md +13 -13
- package/skills/loft/SKILL.md +2 -2
- package/skills/map/SKILL.md +1 -1
- package/skills/omc-ado-auto-review/SKILL.md +2 -2
- package/skills/omc-ado-review/SKILL.md +2 -2
- package/skills/omc-ado-setup/SKILL.md +1 -1
- package/skills/omc-ado-sprint/SKILL.md +2 -2
- package/skills/omc-ado-triage/SKILL.md +2 -2
- package/skills/omc-doctor/SKILL.md +1 -1
- package/skills/omc-gh-auto-review/SKILL.md +2 -2
- package/skills/omc-gh-project/SKILL.md +2 -2
- package/skills/omc-gh-review/SKILL.md +2 -2
- package/skills/omc-gh-setup/SKILL.md +2 -2
- package/skills/omc-gh-triage/SKILL.md +3 -3
- package/skills/omc-setup/SKILL.md +16 -14
- package/skills/omc-setup/phases/01-install-claude-md.md +1 -18
- package/skills/omc-setup/phases/02-configure.md +10 -30
- package/skills/omc-setup/phases/03-integrations.md +5 -5
- package/skills/omc-setup/phases/04-welcome.md +7 -7
- package/skills/plan/SKILL.md +1 -1
- package/skills/project-session-manager/SKILL.md +1 -1
- package/skills/ralph/SKILL.md +6 -6
- package/skills/ralph-experiment/SKILL.md +3 -3
- package/skills/ralplan/SKILL.md +4 -4
- package/skills/release/SKILL.md +1 -1
- package/skills/self-improve/SKILL.md +1 -1
- package/skills/skill/SKILL.md +12 -12
- package/skills/team/SKILL.md +8 -8
- package/skills/trace/SKILL.md +1 -1
- package/skills/visual-verdict/SKILL.md +1 -1
- package/templates/hooks/keyword-detector.mjs +4 -4
- package/templates/hooks/lib/workflow-stage-prompts.mjs +6 -2
- package/templates/hooks/persistent-mode.mjs +12 -8
- package/templates/hooks/session-start.mjs +1 -1
- package/bridge/__pycache__/gyoshu_bridge.cpython-314.pyc +0 -0
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// setup-config.mjs - config and environment helpers for the omc-setup skill
|
|
3
|
+
// Usage: node setup-config.mjs <command> [args]
|
|
4
|
+
//
|
|
5
|
+
// The setup skill used to carry these as inline `node -e "..."` one-liners. Hosts that
|
|
6
|
+
// refuse inline interpreter code (lean-ctx blocks `node -e` by default) then could not
|
|
7
|
+
// run setup at all, so every one-liner lives here as a plain script file instead.
|
|
8
|
+
//
|
|
9
|
+
// Commands:
|
|
10
|
+
// configured Was setup already completed? (ALREADY_CONFIGURED=true|false)
|
|
11
|
+
// claude-md-enabled Print enabled|disabled for the global CLAUDE.md opt-out
|
|
12
|
+
// resume-boundary Print RESUME_LAST_COMPLETED_STEP and RESUMED_PHASE_TWO_BOUNDARY
|
|
13
|
+
// probe-write Warn when the config dir is not writable
|
|
14
|
+
// update-check Print the installed version and whether a newer one is published
|
|
15
|
+
// clear-retired Remove the retired defaultExecutionMode key
|
|
16
|
+
// cli-installed Print OMC_CLI_INSTALLED=true|false
|
|
17
|
+
// install-cli npm install -g oh-my-copilot
|
|
18
|
+
// detect-task-tools Look for beads (bd) and beads-rust (br)
|
|
19
|
+
// set-task-tool <tool> Store taskTool in .omc-config.json
|
|
20
|
+
// plugin-verify Check that settings.json mentions the plugin
|
|
21
|
+
// show-settings Print settings.json
|
|
22
|
+
// merge-json settings.json <json> Deep-merge a JSON patch into settings.json in the config dir
|
|
23
|
+
// verify-settings Check settings.json parses and agent teams are enabled
|
|
24
|
+
// detect-upgrade Print IS_UPGRADE=true|false (2.x command files present)
|
|
25
|
+
// copy-rules Copy templates/rules/*.md into ./.claude/rules
|
|
26
|
+
// star-repo Star the repository through gh (silent on failure)
|
|
27
|
+
|
|
28
|
+
import { hardenWindowsExeSearch } from './lib/windows-search.mjs';
|
|
29
|
+
import { spawnSync } from 'node:child_process';
|
|
30
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync, renameSync } from 'node:fs';
|
|
31
|
+
import { homedir } from 'node:os';
|
|
32
|
+
import { dirname, join } from 'node:path';
|
|
33
|
+
import process from 'node:process';
|
|
34
|
+
|
|
35
|
+
import { getCopilotConfigDir } from './lib/config-dir.mjs';
|
|
36
|
+
|
|
37
|
+
hardenWindowsExeSearch();
|
|
38
|
+
|
|
39
|
+
const CONFIG_DIR = getCopilotConfigDir();
|
|
40
|
+
const CONFIG_FILE = join(CONFIG_DIR, '.omc-config.json');
|
|
41
|
+
const SETTINGS_FILE = join(CONFIG_DIR, 'settings.json');
|
|
42
|
+
const WINDOWS = process.platform === 'win32';
|
|
43
|
+
const VERSION_PATTERN = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
|
|
44
|
+
const TASK_TOOLS = ['builtin', 'beads', 'beads-rust'];
|
|
45
|
+
const UNSAFE_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
|
|
46
|
+
|
|
47
|
+
function fail(message) {
|
|
48
|
+
process.stderr.write(`${message}\n`);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The child env with every case variant of NoDefaultCurrentDirectoryInExePath replaced by =1. */
|
|
53
|
+
function childEnv() {
|
|
54
|
+
const env = {};
|
|
55
|
+
for (const [key, value] of Object.entries(process.env)) {
|
|
56
|
+
if (key.toLowerCase() !== 'nodefaultcurrentdirectoryinexepath') env[key] = value;
|
|
57
|
+
}
|
|
58
|
+
env.NoDefaultCurrentDirectoryInExePath = '1';
|
|
59
|
+
return env;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Run a PATH command (npm, omg, bd, br, gh) outside the project. cmd.exe searches the cwd
|
|
64
|
+
* before PATH, so with the project as cwd a planted npm.cmd or gh.cmd there would run instead;
|
|
65
|
+
* the home directory as cwd plus NoDefaultCurrentDirectoryInExePath=1 rules that out. Windows
|
|
66
|
+
* needs cmd.exe for .cmd shims, so it gets one command line (every argument here is a fixed
|
|
67
|
+
* literal) rather than shell:true with an args array (DEP0190).
|
|
68
|
+
*/
|
|
69
|
+
function run(command, args, options = {}) {
|
|
70
|
+
const base = { encoding: 'utf8', cwd: homedir(), env: childEnv(), ...options };
|
|
71
|
+
return WINDOWS
|
|
72
|
+
? spawnSync([command, ...args].join(' '), { ...base, shell: true })
|
|
73
|
+
: spawnSync(command, args, base);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function firstLine(result) {
|
|
77
|
+
return (result.stdout || '').split(/\r?\n/)[0];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Parse a JSON file; undefined when it does not exist, throws when it is invalid. */
|
|
81
|
+
function readJson(path) {
|
|
82
|
+
if (!existsSync(path)) return undefined;
|
|
83
|
+
return JSON.parse(readFileSync(path, 'utf8'));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Write through a fresh temp file and rename it over path, so a failure cannot truncate the
|
|
88
|
+
* original and a symlink or hardlink at path is replaced rather than written through.
|
|
89
|
+
*/
|
|
90
|
+
function writeAtomic(path, data) {
|
|
91
|
+
const tmp = `${path}.tmp.${process.pid}`;
|
|
92
|
+
try {
|
|
93
|
+
writeFileSync(tmp, data, { flag: 'wx' });
|
|
94
|
+
renameSync(tmp, path);
|
|
95
|
+
} catch (error) {
|
|
96
|
+
rmSync(tmp, { force: true });
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function writeJsonAtomic(path, value) {
|
|
102
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
103
|
+
writeAtomic(path, JSON.stringify(value, null, 2));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function isPlainObject(value) {
|
|
107
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function readConfigOrFail(path, label) {
|
|
111
|
+
let value;
|
|
112
|
+
try {
|
|
113
|
+
value = readJson(path);
|
|
114
|
+
} catch {
|
|
115
|
+
return fail(`ERROR: ${label} is not valid JSON. Existing file was not modified.`);
|
|
116
|
+
}
|
|
117
|
+
if (value === undefined) return {};
|
|
118
|
+
if (!isPlainObject(value)) fail(`ERROR: ${label} is not a JSON object. Existing file was not modified.`);
|
|
119
|
+
return value;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function cmdConfigured() {
|
|
123
|
+
let config;
|
|
124
|
+
try {
|
|
125
|
+
config = readJson(CONFIG_FILE);
|
|
126
|
+
} catch {
|
|
127
|
+
fail('ERROR: Existing OMC config is invalid JSON. Existing config was not modified.');
|
|
128
|
+
}
|
|
129
|
+
if (config?.setupCompleted) {
|
|
130
|
+
console.log(`OMC setup was already completed on: ${config.setupCompleted}`);
|
|
131
|
+
if (config.setupVersion) console.log(`Setup version: ${config.setupVersion}`);
|
|
132
|
+
console.log('ALREADY_CONFIGURED=true');
|
|
133
|
+
} else {
|
|
134
|
+
console.log('ALREADY_CONFIGURED=false');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function cmdClaudeMdEnabled() {
|
|
139
|
+
try {
|
|
140
|
+
console.log(readJson(CONFIG_FILE)?.claudeMdEnabled === false ? 'disabled' : 'enabled');
|
|
141
|
+
} catch {
|
|
142
|
+
console.log('enabled');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function cmdResumeBoundary() {
|
|
147
|
+
const stateFile = join('.omg', 'state', 'setup-state.json');
|
|
148
|
+
let state = {};
|
|
149
|
+
try {
|
|
150
|
+
state = readJson(stateFile) ?? {};
|
|
151
|
+
} catch {
|
|
152
|
+
fail('ERROR: Setup state is invalid JSON. Existing setup state was not modified.');
|
|
153
|
+
}
|
|
154
|
+
const step = Number.isFinite(state.lastCompletedStep) ? state.lastCompletedStep : 0;
|
|
155
|
+
console.log(`RESUME_LAST_COMPLETED_STEP=${step}`);
|
|
156
|
+
console.log(`RESUMED_PHASE_TWO_BOUNDARY=${step >= 4}`);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function cmdProbeWrite() {
|
|
160
|
+
const probe = join(CONFIG_DIR, '.omc-write-probe');
|
|
161
|
+
try {
|
|
162
|
+
mkdirSync(CONFIG_DIR, { recursive: true });
|
|
163
|
+
writeFileSync(probe, '');
|
|
164
|
+
rmSync(probe, { force: true });
|
|
165
|
+
} catch {
|
|
166
|
+
console.log('WARNING: Config dir is not writable; Ralph state persistence will fail until it is.');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function detectInstalledVersion() {
|
|
171
|
+
const cache = join(CONFIG_DIR, 'plugins', 'cache', 'omc', 'oh-my-copilot');
|
|
172
|
+
try {
|
|
173
|
+
const versions = readdirSync(cache)
|
|
174
|
+
.filter((name) => VERSION_PATTERN.test(name))
|
|
175
|
+
.sort((a, b) => a.localeCompare(b, undefined, { numeric: true }));
|
|
176
|
+
if (versions.length > 0) return versions[versions.length - 1];
|
|
177
|
+
} catch {
|
|
178
|
+
// No plugin cache: fall through to the next source.
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
try {
|
|
182
|
+
const version = JSON.parse(readFileSync('.omc-version.json', 'utf8')).version;
|
|
183
|
+
if (typeof version === 'string' && VERSION_PATTERN.test(version)) return version;
|
|
184
|
+
} catch {
|
|
185
|
+
// No project version file.
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
for (const candidate of [join('.claude', 'CLAUDE.md'), join(CONFIG_DIR, 'CLAUDE.md')]) {
|
|
189
|
+
try {
|
|
190
|
+
const match = readFileSync(candidate, 'utf8').match(/^# oh-my-copilot.*?(v?\d+\.\d+\.\d+)/m);
|
|
191
|
+
if (match) return match[1].replace(/^v/, '');
|
|
192
|
+
} catch {
|
|
193
|
+
// Try the next CLAUDE.md.
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return '';
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function cmdUpdateCheck() {
|
|
200
|
+
const installed = detectInstalledVersion();
|
|
201
|
+
console.log(`Installed: ${installed || '(not found)'}`);
|
|
202
|
+
|
|
203
|
+
const result = run('npm', ['view', 'oh-my-copilot', 'version']);
|
|
204
|
+
const latest = result.status === 0 ? (result.stdout || '').trim() : '';
|
|
205
|
+
if (installed && latest) {
|
|
206
|
+
if (installed === latest) {
|
|
207
|
+
console.log(`You are on the latest version: v${installed}`);
|
|
208
|
+
} else {
|
|
209
|
+
console.log('UPDATE AVAILABLE:');
|
|
210
|
+
console.log(` Installed: v${installed}`);
|
|
211
|
+
console.log(` Latest: v${latest}`);
|
|
212
|
+
console.log('To update, run: claude /install-plugin oh-my-copilot');
|
|
213
|
+
}
|
|
214
|
+
} else if (latest) {
|
|
215
|
+
console.log(`Latest version available: v${latest}`);
|
|
216
|
+
} else {
|
|
217
|
+
console.log('Latest version: (unavailable)');
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function cmdClearRetired() {
|
|
222
|
+
let config;
|
|
223
|
+
try {
|
|
224
|
+
config = readJson(CONFIG_FILE);
|
|
225
|
+
} catch {
|
|
226
|
+
console.log(`WARNING: ${CONFIG_FILE} is not valid JSON. Existing config was not modified.`);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (!isPlainObject(config) || !('defaultExecutionMode' in config)) return;
|
|
230
|
+
|
|
231
|
+
delete config.defaultExecutionMode;
|
|
232
|
+
try {
|
|
233
|
+
writeJsonAtomic(CONFIG_FILE, config);
|
|
234
|
+
console.log('Cleared retired defaultExecutionMode key (ultrawork was removed in 5.0.0)');
|
|
235
|
+
} catch {
|
|
236
|
+
console.log('WARNING: Failed to clear retired defaultExecutionMode. Existing config was not modified.');
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function cmdCliInstalled() {
|
|
241
|
+
const result = run('omg', ['--version']);
|
|
242
|
+
if (result.status === 0) {
|
|
243
|
+
console.log(`OMC CLI already installed: ${firstLine(result) || 'installed'}`);
|
|
244
|
+
console.log('OMC_CLI_INSTALLED=true');
|
|
245
|
+
} else {
|
|
246
|
+
console.log('OMC_CLI_INSTALLED=false');
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function cmdInstallCli() {
|
|
251
|
+
if (run('npm', ['--version']).status !== 0) {
|
|
252
|
+
console.log('WARNING: npm not found. Cannot install OMC CLI automatically.');
|
|
253
|
+
console.log('Install Node.js/npm first, then run: npm install -g oh-my-copilot');
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const install = run('npm', ['install', '-g', 'oh-my-copilot'], { stdio: 'inherit' });
|
|
257
|
+
if (install.status === 0) {
|
|
258
|
+
console.log('OMC CLI installed successfully.');
|
|
259
|
+
const verify = run('omg', ['--version']);
|
|
260
|
+
console.log(verify.status === 0
|
|
261
|
+
? `Verified: omg ${firstLine(verify) || 'installed'}`
|
|
262
|
+
: "Installed but 'omg' not on PATH. You may need to restart your shell.");
|
|
263
|
+
} else {
|
|
264
|
+
console.log('WARNING: Failed to install OMC CLI (permission issue or network error).');
|
|
265
|
+
console.log('You can install manually later: npm install -g oh-my-copilot');
|
|
266
|
+
console.log('On Linux/macOS you may need: sudo npm install -g oh-my-copilot');
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function cmdDetectTaskTools() {
|
|
271
|
+
let found = false;
|
|
272
|
+
for (const [command, label] of [['bd', 'beads (bd)'], ['br', 'beads-rust (br)']]) {
|
|
273
|
+
const result = run(command, ['--version']);
|
|
274
|
+
if (result.status === 0) {
|
|
275
|
+
found = true;
|
|
276
|
+
console.log(`Found ${label}: ${firstLine(result) || 'installed'}`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (!found) console.log('No external task tools found. Using built-in Tasks.');
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function cmdSetTaskTool(tool) {
|
|
283
|
+
if (!TASK_TOOLS.includes(tool)) fail('ERROR: task tool must be builtin, beads, or beads-rust.');
|
|
284
|
+
const config = readConfigOrFail(CONFIG_FILE, CONFIG_FILE);
|
|
285
|
+
config.taskTool = tool;
|
|
286
|
+
config.taskToolConfig = { injectInstructions: true, useMcp: false };
|
|
287
|
+
try {
|
|
288
|
+
writeJsonAtomic(CONFIG_FILE, config);
|
|
289
|
+
} catch {
|
|
290
|
+
fail(`ERROR: Failed to update ${CONFIG_FILE}. Existing config was not modified.`);
|
|
291
|
+
}
|
|
292
|
+
console.log(`Task tool set to: ${tool}`);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function readSettingsText() {
|
|
296
|
+
try {
|
|
297
|
+
return readFileSync(SETTINGS_FILE, 'utf8');
|
|
298
|
+
} catch {
|
|
299
|
+
return '';
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function cmdPluginVerify() {
|
|
304
|
+
console.log(readSettingsText().includes('oh-my-copilot')
|
|
305
|
+
? 'Plugin verified'
|
|
306
|
+
: 'Plugin NOT found - run: claude /install-plugin oh-my-copilot');
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function cmdShowSettings() {
|
|
310
|
+
const text = readSettingsText();
|
|
311
|
+
if (text) process.stdout.write(text);
|
|
312
|
+
else console.log(`(no settings.json at ${SETTINGS_FILE})`);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function mergeInto(target, patch) {
|
|
316
|
+
for (const key of Object.keys(patch)) {
|
|
317
|
+
if (UNSAFE_KEYS.has(key)) continue;
|
|
318
|
+
const value = patch[key];
|
|
319
|
+
target[key] = isPlainObject(value) ? mergeInto(isPlainObject(target[key]) ? target[key] : {}, value) : value;
|
|
320
|
+
}
|
|
321
|
+
return target;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function cmdMergeJson(name, raw) {
|
|
325
|
+
if (!name || raw === undefined) fail('Usage: setup-config.mjs merge-json <file-name> <json-patch>');
|
|
326
|
+
// The skill only ever merges into settings.json; any other name (an ADS suffix, a drive-relative
|
|
327
|
+
// path, a device name, a traversal) is refused before anything is opened.
|
|
328
|
+
if (name !== 'settings.json') fail('ERROR: merge-json only updates settings.json in the config directory.');
|
|
329
|
+
let patch;
|
|
330
|
+
try {
|
|
331
|
+
patch = JSON.parse(raw);
|
|
332
|
+
} catch {
|
|
333
|
+
fail('ERROR: the JSON patch is not valid JSON.');
|
|
334
|
+
}
|
|
335
|
+
if (!isPlainObject(patch)) fail('ERROR: the JSON patch must be an object.');
|
|
336
|
+
|
|
337
|
+
const target = join(CONFIG_DIR, name);
|
|
338
|
+
const current = readConfigOrFail(target, target);
|
|
339
|
+
try {
|
|
340
|
+
writeJsonAtomic(target, mergeInto(current, patch));
|
|
341
|
+
} catch {
|
|
342
|
+
fail(`ERROR: Failed to update ${target}. Existing file was not modified.`);
|
|
343
|
+
}
|
|
344
|
+
console.log(`Updated ${target}`);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function cmdVerifySettings() {
|
|
348
|
+
let settings;
|
|
349
|
+
try {
|
|
350
|
+
settings = JSON.parse(readFileSync(SETTINGS_FILE, 'utf8'));
|
|
351
|
+
} catch {
|
|
352
|
+
fail('ERROR: settings.json is invalid JSON or missing. Restore it from the backup before continuing.');
|
|
353
|
+
}
|
|
354
|
+
console.log('settings.json: valid JSON');
|
|
355
|
+
console.log(settings.env?.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS
|
|
356
|
+
? 'Agent teams: ENABLED'
|
|
357
|
+
: 'WARNING: Agent teams env var not found in settings.json');
|
|
358
|
+
console.log('');
|
|
359
|
+
console.log('Final settings.json:');
|
|
360
|
+
console.log(JSON.stringify(settings, null, 2));
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function cmdDetectUpgrade() {
|
|
364
|
+
console.log(`IS_UPGRADE=${existsSync(join(CONFIG_DIR, 'commands', 'ralph-loop.md'))}`);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/** Refuse to write through a symlink or junction (lstat reports both as links). */
|
|
368
|
+
function refuseLink(path) {
|
|
369
|
+
if (lstatSync(path, { throwIfNoEntry: false })?.isSymbolicLink()) {
|
|
370
|
+
fail(`ERROR: ${path} is a symlink or junction; refusing to write through it.`);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function cmdCopyRules() {
|
|
375
|
+
const root = process.env.OMC_SETUP_PLUGIN_ROOT || process.env.CLAUDE_PLUGIN_ROOT;
|
|
376
|
+
if (!root) fail('ERROR: plugin root is not set');
|
|
377
|
+
const source = join(root, 'templates', 'rules');
|
|
378
|
+
const destination = join('.claude', 'rules');
|
|
379
|
+
refuseLink('.claude');
|
|
380
|
+
refuseLink(destination);
|
|
381
|
+
mkdirSync(destination, { recursive: true });
|
|
382
|
+
for (const name of readdirSync(source).filter((file) => file.endsWith('.md'))) {
|
|
383
|
+
const target = join(destination, name);
|
|
384
|
+
refuseLink(target);
|
|
385
|
+
writeAtomic(target, readFileSync(join(source, name)));
|
|
386
|
+
console.log(`Copied ${name}`);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function cmdStarRepo() {
|
|
391
|
+
const result = run('gh', ['api', '-X', 'PUT', 'user/starred/RobinNorberg/oh-my-copilot']);
|
|
392
|
+
if (result.status === 0) console.log('Thanks for starring');
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
const [command, ...rest] = process.argv.slice(2);
|
|
396
|
+
|
|
397
|
+
const commands = {
|
|
398
|
+
configured: cmdConfigured,
|
|
399
|
+
'claude-md-enabled': cmdClaudeMdEnabled,
|
|
400
|
+
'resume-boundary': cmdResumeBoundary,
|
|
401
|
+
'probe-write': cmdProbeWrite,
|
|
402
|
+
'update-check': cmdUpdateCheck,
|
|
403
|
+
'clear-retired': cmdClearRetired,
|
|
404
|
+
'cli-installed': cmdCliInstalled,
|
|
405
|
+
'install-cli': cmdInstallCli,
|
|
406
|
+
'detect-task-tools': cmdDetectTaskTools,
|
|
407
|
+
'set-task-tool': () => cmdSetTaskTool(rest[0]),
|
|
408
|
+
'plugin-verify': cmdPluginVerify,
|
|
409
|
+
'show-settings': cmdShowSettings,
|
|
410
|
+
'merge-json': () => cmdMergeJson(rest[0], rest[1]),
|
|
411
|
+
'verify-settings': cmdVerifySettings,
|
|
412
|
+
'detect-upgrade': cmdDetectUpgrade,
|
|
413
|
+
'copy-rules': cmdCopyRules,
|
|
414
|
+
'star-repo': cmdStarRepo,
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
if (!Object.hasOwn(commands, command ?? '')) {
|
|
418
|
+
fail(`Usage: setup-config.mjs {${Object.keys(commands).join('|')}}`);
|
|
419
|
+
}
|
|
420
|
+
commands[command]();
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
// `save` and `complete` also resolve their optional argument themselves, so the
|
|
12
12
|
// setup skill no longer needs a jq/grep/sed preamble to compute it.
|
|
13
13
|
|
|
14
|
+
import { hardenWindowsExeSearch } from './lib/windows-search.mjs';
|
|
14
15
|
import { spawnSync } from 'node:child_process';
|
|
15
16
|
import { constants as fsConstants, copyFileSync, existsSync, readFileSync, readdirSync, rmSync, statSync } from 'node:fs';
|
|
16
17
|
import { homedir } from 'node:os';
|
|
@@ -21,6 +22,8 @@ import { atomicWriteFileSync, ensureDirSync } from './lib/atomic-write.mjs';
|
|
|
21
22
|
import { getCopilotConfigDir } from './lib/config-dir.mjs';
|
|
22
23
|
import { resolveOmcStateRoot } from './lib/state-root.mjs';
|
|
23
24
|
|
|
25
|
+
hardenWindowsExeSearch();
|
|
26
|
+
|
|
24
27
|
const CONFIG_DIR = getCopilotConfigDir();
|
|
25
28
|
const STATE_DIR = join(await resolveOmcStateRoot(process.cwd()), 'state');
|
|
26
29
|
const STATE_FILE = join(STATE_DIR, 'setup-state.json');
|
|
@@ -28,6 +28,7 @@ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
|
28
28
|
import { basename, isAbsolute, join, relative, resolve } from 'node:path';
|
|
29
29
|
import { resolveOmcStateRoot } from './lib/state-root.mjs';
|
|
30
30
|
import { stripLeadingUtf8Bom } from './lib/utf8-bom.mjs';
|
|
31
|
+
import { skillSlash } from './lib/skill-slash.mjs';
|
|
31
32
|
|
|
32
33
|
const toPosix = (value) => value.replace(/\\/g, '/');
|
|
33
34
|
|
|
@@ -85,7 +86,7 @@ function checkYardBaseFaces(root) {
|
|
|
85
86
|
'high',
|
|
86
87
|
true,
|
|
87
88
|
missing,
|
|
88
|
-
|
|
89
|
+
`Run \`${skillSlash('drydock')}\` to seed CLAUDE.md and GLOSSARY.md; a recognizable legacy CONTEXT.md glossary is accepted until drydock migrates it.`,
|
|
89
90
|
),
|
|
90
91
|
];
|
|
91
92
|
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { readStdin } from './lib/stdin.mjs';
|
|
17
17
|
import { resolveOmcStateRoot } from './lib/state-root.mjs';
|
|
18
18
|
import { findStaleRuns } from './lib/run-reaper.mjs';
|
|
19
|
+
import { skillSlash } from './lib/skill-slash.mjs';
|
|
19
20
|
|
|
20
21
|
async function main() {
|
|
21
22
|
const raw = await readStdin(3000);
|
|
@@ -56,7 +57,7 @@ async function main() {
|
|
|
56
57
|
(entry) =>
|
|
57
58
|
`- ${entry.mode}${entry.sessionId ? ` (session ${entry.sessionId})` : ''}: active for ~${entry.ageHours}h — ${entry.path}`,
|
|
58
59
|
),
|
|
59
|
-
|
|
60
|
+
`Nothing was changed automatically. To reclaim: run ${skillSlash('cancel')} to clean up the state, or re-enter the mode to resume from its artifacts. Re-kicking is a human decision.`,
|
|
60
61
|
];
|
|
61
62
|
|
|
62
63
|
console.log(
|
package/skills/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
10
|
-
Skills are reusable workflow templates that can be invoked via `/
|
|
10
|
+
Skills are reusable workflow templates that can be invoked via `/skill-name`. Each skill provides:
|
|
11
11
|
- Structured prompts for specific workflows
|
|
12
12
|
- Activation triggers (manual or automatic)
|
|
13
13
|
- Integration with execution modes
|
|
@@ -154,10 +154,10 @@ Any configurable options.
|
|
|
154
154
|
|
|
155
155
|
```bash
|
|
156
156
|
# Manual invocation
|
|
157
|
-
/
|
|
157
|
+
/skill-name
|
|
158
158
|
|
|
159
159
|
# With arguments
|
|
160
|
-
/
|
|
160
|
+
/skill-name arg1 arg2
|
|
161
161
|
|
|
162
162
|
# Auto-detected from keywords
|
|
163
163
|
"autopilot build me a REST API" # Triggers autopilot skill
|
|
@@ -198,7 +198,7 @@ If `pipeline` / `next-skill` metadata is present, OMC appends a standardized **S
|
|
|
198
198
|
### Testing Requirements
|
|
199
199
|
|
|
200
200
|
- Skills are verified via integration tests
|
|
201
|
-
- Test skill invocation with `/
|
|
201
|
+
- Test skill invocation with `/skill-name`
|
|
202
202
|
- Verify trigger keywords activate correct skill
|
|
203
203
|
- For git-related skills, follow `templates/rules/git-workflow.md`
|
|
204
204
|
|
|
@@ -129,9 +129,9 @@ Use these as review prompts, not absolute bans. Keep intentional brand, accessib
|
|
|
129
129
|
|
|
130
130
|
## Usage
|
|
131
131
|
|
|
132
|
-
- `/
|
|
133
|
-
- `/
|
|
134
|
-
- `/
|
|
132
|
+
- `/ai-slop-cleaner <target>`
|
|
133
|
+
- `/ai-slop-cleaner <target> --review`
|
|
134
|
+
- `/ai-slop-cleaner <file-a> <file-b> <file-c>`
|
|
135
135
|
- From Ralph: run the cleaner on the Ralph session's changed files only, then return to Ralph for post-cleanup regression verification
|
|
136
136
|
|
|
137
137
|
## Good Fits
|
package/skills/ask/SKILL.md
CHANGED
|
@@ -10,18 +10,18 @@ Use OMC's canonical advisor skill to route a prompt through the local Claude, Co
|
|
|
10
10
|
## Usage
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
/
|
|
13
|
+
/ask <claude|codex|gemini|antigravity|grok|cursor|muse> <question or task>
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Examples:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
/
|
|
20
|
-
/
|
|
21
|
-
/
|
|
22
|
-
/
|
|
23
|
-
/
|
|
24
|
-
/
|
|
19
|
+
/ask codex "review this patch from a security perspective"
|
|
20
|
+
/ask gemini "suggest UX improvements for this flow"
|
|
21
|
+
/ask antigravity "suggest UX improvements for this flow"
|
|
22
|
+
/ask claude "draft an implementation plan for issue #123"
|
|
23
|
+
/ask cursor "apply this implementation plan"
|
|
24
|
+
/ask muse --agent-prompt critic "review this plan"
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Routing
|
|
@@ -9,7 +9,7 @@ pipeline: [deep-interview, ask-navigator]
|
|
|
9
9
|
|
|
10
10
|
# Ask Navigator
|
|
11
11
|
|
|
12
|
-
Ask-navigator is the shipyard's **navigator**: it takes an effort wrapped in fog — the way from here to the destination isn't visible yet — and charts it as a **map of decision tickets** on the repo's issue tracker, then works the frontier one ticket per session until the route is clear. It produces **decisions, never deliverables**: when the way is clear it hands off, it doesn't build. Delivery belongs to `/
|
|
12
|
+
Ask-navigator is the shipyard's **navigator**: it takes an effort wrapped in fog — the way from here to the destination isn't visible yet — and charts it as a **map of decision tickets** on the repo's issue tracker, then works the frontier one ticket per session until the route is clear. It produces **decisions, never deliverables**: when the way is clear it hands off, it doesn't build. Delivery belongs to `/launch`.
|
|
13
13
|
|
|
14
14
|
**The role contract.** The captain (the human) signs the destination (W1) and the chart (W2); the navigator drafts everything else and **never answers a question that belongs to the captain** — a grilling session in which the agent answers its own questions has broken the role, not just the process. Facts are the navigator's job; decisions are the captain's.
|
|
15
15
|
|
|
@@ -18,11 +18,11 @@ Ask-navigator is the shipyard's **navigator**: it takes an effort wrapped in fog
|
|
|
18
18
|
1. **Q1** — Can the destination be stated in one sentence: the spec, decision, or change this effort is finding its way to?
|
|
19
19
|
2. **Q2** — Can the first three decisions be stated precisely right now, even though none of them can be answered yet?
|
|
20
20
|
|
|
21
|
-
Both yes → no map is needed; run `/
|
|
21
|
+
Both yes → no map is needed; run `/launch` (its fog gate sends efforts here only when an answer is no). Either no → chart first. `ask-navigator` is also reachable directly: invoke it with a loose idea, with residual questions handed over by launch's fog gate, or with no argument to continue the open map.
|
|
22
22
|
|
|
23
23
|
## Map home
|
|
24
24
|
|
|
25
|
-
The map is a **single issue** labelled `navigator:map` on the repo's issue tracker; its decision tickets are child issues of the map. The tracker should have been recorded by `/
|
|
25
|
+
The map is a **single issue** labelled `navigator:map` on the repo's issue tracker; its decision tickets are child issues of the map. The tracker should have been recorded by `/drydock`; if none was recorded, ask once and remember the answer inside the map's Notes.
|
|
26
26
|
|
|
27
27
|
The tracker is the **only map medium** — there is no local fallback: one map issue, child issues per ticket, native blocking/sub-issue relationships. Concurrent sessions and the tracker's own UI render the frontier — the map lives where humans already look. A map written to local files strands decisions where later sessions, the captain, and launch will never find them; do not fall back to local files. If the tracker is unreachable, stop and report the blocker. Create the `navigator:map` label if the tracker doesn't have it yet; each ticket's type lives in its body as a `Type: <type>` line (see Ticket types).
|
|
28
28
|
|
|
@@ -32,19 +32,19 @@ The map is an **index, not a store**: a decision lives in exactly one place —
|
|
|
32
32
|
|
|
33
33
|
## Document language
|
|
34
34
|
|
|
35
|
-
Map and ticket prose follow the same document-language contract as `/
|
|
35
|
+
Map and ticket prose follow the same document-language contract as `/drydock`: read `documentLanguage` from `GLOSSARY.md` frontmatter when present (a legacy yard with only `CONTEXT.md` reads it there and never gets a second glossary; drydock's legacy glossary migration renames it); if the yard is not laid, ask the language question once during charting (W2) and record the resolved tag in the map's Notes so the later launch run inherits it. Paths, labels, slash commands, the `navigator:map` label, ticket-type names (`research`, `loft`, `grilling`, `task`), `HITL`/`AFK`, and `blockedBy` are stable tokens and stay byte-for-byte stable in every language.
|
|
36
36
|
|
|
37
37
|
## Chart the map
|
|
38
38
|
|
|
39
39
|
Invoked with a loose idea (or launch's residual questions). Charting is one session's work; it hand-resolves nothing.
|
|
40
40
|
|
|
41
|
-
1. **Run the audit, defer the findings.** Run the `/
|
|
41
|
+
1. **Run the audit, defer the findings.** Run the `/drydock` `--check` audit in report-only mode — the mechanical subset via `node scripts/shipyard-audit.mjs`, the heuristic classes via the drydock prose audit: findings never block charting (a map produces decisions, not slot landings), but they are recorded verbatim in the map's Notes — launch's yard gate will collect that debt when the effort finally enters delivery. If the yard is not laid at all (no `GLOSSARY.md`, no `docs/adr/`), offer `/drydock` **once**; if the captain declines, proceed in tracker-only mode and defer all sediment (see Sediment).
|
|
42
42
|
2. **W1 — name the destination.** Call the Skill tool with "deep-interview" and pin down what this map is finding its way to: the spec, decision, or change. The destination fixes the scope, so it is settled first. **W1 is a captain signature: present the destination statement and get explicit confirmation.** If the captain cannot state a destination even with the interview's help, that is not an error — present the best candidates ranked and let the captain pick one to chart toward or park the effort.
|
|
43
|
-
3. **Map the frontier.** Grill again with "deep-interview", **breadth-first with frontier rounds** (`--frontier`): fan out across the whole space rather than deep on any one thread — each round asks the whole frontier of decisions whose prerequisites are settled, then recomputes from the answers — surfacing the open decisions and the first steps takeable now. When charting against an existing map (residual questions or a redraw), read its **Out of scope** section before ticketing — ruled-out work never re-enters as a fresh ticket. **If this surfaces no fog** — the way to the destination is already clear and the journey fits one session — no map is needed: stop and recommend `/
|
|
43
|
+
3. **Map the frontier.** Grill again with "deep-interview", **breadth-first with frontier rounds** (`--frontier`): fan out across the whole space rather than deep on any one thread — each round asks the whole frontier of decisions whose prerequisites are settled, then recomputes from the answers — surfacing the open decisions and the first steps takeable now. When charting against an existing map (residual questions or a redraw), read its **Out of scope** section before ticketing — ruled-out work never re-enters as a fresh ticket. **If this surfaces no fog** — the way to the destination is already clear and the journey fits one session — no map is needed: stop and recommend `/launch`.
|
|
44
44
|
4. **W2 — sign the chart.** Present the proposed map: destination, initial tickets with types and blocking edges, and the fog sketch. **W2 is a captain signature**: granularity wrong here wastes every later session. Iterate until signed.
|
|
45
45
|
5. **Create the map and tickets.** Label the map `navigator:map`; create child tickets; wire blocking edges in a second pass (issues need ids before they can reference each other). Everything not yet sharp enough to ticket stays in **Not yet specified**.
|
|
46
46
|
6. **Fire the research subagents.** For each `research` ticket just created, spawn a background subagent to resolve it in parallel (see Ticket types), capturing findings where the ticket can link them.
|
|
47
|
-
7. **Stop** with the session-close pointer: the map link, how many tickets are on the frontier, and "next session, run `/
|
|
47
|
+
7. **Stop** with the session-close pointer: the map link, how many tickets are on the frontier, and "next session, run `/ask-navigator` to work the next decision."
|
|
48
48
|
|
|
49
49
|
## Work through the map
|
|
50
50
|
|
|
@@ -129,20 +129,20 @@ Resolutions land in the shipyard's paper trail the moment they settle — the sa
|
|
|
129
129
|
|
|
130
130
|
**Legacy yards (CONTEXT.md only)**: If the yard has only a recognizable legacy glossary `CONTEXT.md` and no `GLOSSARY.md`, run drydock before writing sediment to migrate the glossary authority to `GLOSSARY.md`. Do not create a fresh `GLOSSARY.md` beside the legacy file; this would split authorities. When drydock's legacy glossary migration completes, glossary writes will target `GLOSSARY.md` automatically. Alternatively, defer this sediment landing in the map's Notes (see below).
|
|
131
131
|
|
|
132
|
-
When the yard is not laid (the captain declined drydock at charting time), **defer, don't skip**: record each pending landing as one line in the map's Notes under a `Deferred sediment` heading. The later `/
|
|
132
|
+
When the yard is not laid (the captain declined drydock at charting time), **defer, don't skip**: record each pending landing as one line in the map's Notes under a `Deferred sediment` heading. The later `/launch` run's yard gate requires the base faces and audits only adopted optional surfaces — an un-adopted optional surface never becomes a finding — and the deferred lines tell the launch run exactly which first-use trigger to fire and what to land there.
|
|
133
133
|
|
|
134
134
|
## Exit — hand off, don't build
|
|
135
135
|
|
|
136
136
|
The map is done when no open tickets remain and **Not yet specified** is empty. Then:
|
|
137
137
|
|
|
138
138
|
1. Collapse **Decisions so far** into a **mission brief** — objective, scope boundary, non-goals — and write it into the map issue body under **Mission brief**. The handoff passes one pointer, the map issue itself; no brief file is created.
|
|
139
|
-
2. Recommend: "The way is clear. Run `/
|
|
139
|
+
2. Recommend: "The way is clear. Run `/launch` with the map issue as the mission brief — the brief pointer is in the map issue body." The map stays as the effort's logbook; launch's yard gate owns every check from there.
|
|
140
140
|
3. Default entry is launch Phase 1 (the paper trail is already half-full; its frontier clears fast). Only when the decisions already read like a spec may a spec be drafted and launch entered at Phase 2, carrying the spec tracker issue reference (the parent spec issue number or link).
|
|
141
141
|
|
|
142
142
|
## Scope and non-goals
|
|
143
143
|
|
|
144
144
|
- No daemon, no mode, no always-on behavior, no runtime state machine: the map is ordinary tracker issues — nothing is written to repo files.
|
|
145
|
-
- Incoming requests that arrive as fog are the harbor's to route: a fuzzy issue handed over by `/
|
|
145
|
+
- Incoming requests that arrive as fog are the harbor's to route: a fuzzy issue handed over by `/harbor` charts like any loose idea, with the original thread and any signed decision links as material.
|
|
146
146
|
- Never mutates Team lifecycle, task statuses, or runtime state; never publishes delivery tickets — vertical-slice build tickets belong to launch's C3, and the navigator must not pre-slice fog into them. Map tickets therefore never carry the factory intake label or a `shipyard-key:` line: delivery tickets reach the factory only as launch's `omg factory enqueue` output.
|
|
147
147
|
- Tracker: GitHub only this cycle, also when launch and the factory run on another forge; on any other tracker, report and stop.
|
|
148
148
|
- Never executes a decision beyond recording it. The one exception is a `task` ticket, which does only what unblocks a decision.
|
|
@@ -150,4 +150,4 @@ The map is done when no open tickets remain and **Not yet specified** is empty.
|
|
|
150
150
|
|
|
151
151
|
## Completion definition
|
|
152
152
|
|
|
153
|
-
A charting session ends with a captain-signed map and fired research tickets. A working session ends with exactly one resolution recorded, the frontier advanced, and the session-close pointer emitted. The effort ends when the way is clear and the mission brief is in the captain's hands with `/
|
|
153
|
+
A charting session ends with a captain-signed map and fired research tickets. A working session ends with exactly one resolution recorded, the frontier advanced, and the session-close pointer emitted. The effort ends when the way is clear and the mission brief is in the captain's hands with `/launch` recommended — every decision the navigator made on the captain's behalf answerable with one pointer to where it was recorded.
|