Skip to content

feat(kaizen-ops): core/ops split plan and S1 — plugin skeleton with the core CLI resolver - #36

Merged
Lingelo merged 4 commits into
mainfrom
ccr-8ab01603-apdrcp
Oct 20, 2026
Merged

Lingelo merged 4 commits into
mainfrom
ccr-8ab01603-apdrcp

Conversation

@Lingelo

@Lingelo Lingelo commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

First slice of splitting Kaizen's production commands into a kaizen-ops plugin. Nothing user-facing changes yet: kaizen-ops is not registered in marketplace.json, and Kaizen core is untouched.

  • Plan — docs/plans/2026-10-20-1515-refactor-kaizen-core-ops-split-plan.md (kaizen-plan/v1, implementation-ready, plan check green): measured coupling, options compared (skills-and-docs split chosen; CLI, hooks and every gate stay in core), session decisions (name kaizen-ops, postmortem moves, Kaizen 4.0.0 + kaizen-ops 1.0.0 together, deprecation stubs until 4.1.0), 7 KTDs, threats, rollout/rollback, 8 units in 3 slices.
  • S1 / U1 — resolver plugins/kaizen-ops/scripts/kaizen.mjs: the moved skills will keep K="${CLAUDE_PLUGIN_ROOT}/scripts/kaizen.mjs"; this script finds Kaizen core in the git hooks' order (git config kaizen.cli, KAIZEN_CLI) plus the sibling checkout ../kaizen and the newest kaizen of the dojo plugin cache, each candidate checked to be named kaizen. An explicit pointer to something else is refused, not replaced. A core older than scripts/requires.json (4.0.0) is refused naming both versions. Otherwise it forwards arguments, stdin, stdout, stderr and the exit code; core-root and --version are answered locally.
  • S1 / U2 — skeleton and CI: plugin.json (1.0.0), README (how the resolver works, not yet published), CHANGELOG, contract tests for the skills to come (frontmatter, ${CLAUDE_PLUGIN_ROOT} paths in this plugin and core-root paths in core, /kaizen-ops: and kaizen: references, one guide per skill, links, no absolute paths). .github/workflows/kaizen.yml now triggers on plugins/kaizen-ops/**, syntax-checks and tests it on the 6-job matrix. Root CLAUDE.md mentions the unpublished plugin.

Test plan

  • node --test plugins/kaizen/tests/*.test.mjs plugins/kaizen-ops/tests/*.test.mjs — 190/190, incl. resolver.test.mjs run in a fake world under a folder with a space: forwarding (args, stdin, exit code), full resolution order with a newest-semver cache and a non-Kaizen entry skipped, core-root/--version, older core refused before running, nothing found / explicit pointer to something else refused.
  • Resolver run through a symlinked path (macOS /var → /private/var case): runs, finds the sibling core and refuses 3.10.0 as expected until S2 bumps core to 4.0.0.

Generated by Claude Code

Requirements-stage kaizen-plan/v1: measured coupling of the production
commands (scripts, hooks, plans, tests, docs), four options compared, the
skills-and-docs split recommended (CLI and hooks stay in core, so no gate
depends on the ops plugin), a decision gate, rollout and rollback, and five
open questions with defaults to settle before planning the units.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iZk6aQ3fhJy4jrZhfWtaf
Session defaults accepted: go, plugin `kaizen-ops`, postmortem moves,
Kaizen 4.0.0 + kaizen-ops 1.0.0 together, deprecation stubs until 4.1.0.
Adds the planning contract (7 KTDs: CLI resolver forwarding to core,
git-hook resolution order, version gate, core-root, stubs, docs placement,
doctor via settings), threats, 8 units in 3 slices, verification contract
and definition of done.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iZk6aQ3fhJy4jrZhfWtaf
Slice S1 of the core/ops split plan, not registered in the marketplace.
scripts/kaizen.mjs finds Kaizen core (git config kaizen.cli, KAIZEN_CLI,
sibling ../kaizen, newest kaizen of the dojo plugin cache, each checked to
be named kaizen; an explicit pointer to something else is refused), refuses
a core older than scripts/requires.json (4.0.0) naming both versions, and
forwards arguments, stdin, stdout, stderr and exit code; it answers
core-root and --version itself. Contract tests for the skills to come;
CI runs both plugins on the 6-job matrix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iZk6aQ3fhJy4jrZhfWtaf
On macOS the tmp dir is a symlink (/var -> /private/var) and Node locates
the resolver, hence its sibling checkout, by its real path: the sibling
was found, but the test compared /var/... with /private/var/.... Paths are
now compared with realpathSync (also covers Windows 8.3 short names).
Reproduced locally with TMPDIR behind a symlink, green after the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iZk6aQ3fhJy4jrZhfWtaf
@Lingelo
Lingelo merged commit b8b9536 into main Oct 20, 2026
6 checks passed
Lingelo pushed a commit that referenced this pull request Oct 20, 2026
Learning from the Kaizen core/ops split (PRs #36-#38): a resolver shim at
the path the moved skills already use, its resolution order and refusals,
the version gate, core-root for shared docs, gates kept with the CLI and
hooks, doctor as the migration signal; pitfalls hit (macOS realpath,
cross-plugin contracts, stubs vs git rename detection, allowed-tools in
stubs, repeatable --plugin-dir). Plan definition of done updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iZk6aQ3fhJy4jrZhfWtaf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants