Skip to content

refactor: tighten repo architecture (dev/CI infra, plugins/ hygiene, dedup config loader) - #18

Merged
JoshuaOliphant merged 4 commits into
mainfrom
claude/architecture-refactor-1xbheh
Jun 25, 2026
Merged

refactor: tighten repo architecture (dev/CI infra, plugins/ hygiene, dedup config loader)#18
JoshuaOliphant merged 4 commits into
mainfrom
claude/architecture-refactor-1xbheh

Conversation

@JoshuaOliphant

Copy link
Copy Markdown
Owner

Four focused architectural refactors, each live-tested, autoreviewed, and committed separately. Baseline (98 tests) preserved throughout.

Why

A sweep surfaced concrete structural debt:

  • the tests' framework (pytest) was undeclared, so the suite only ran after a manual install, and nothing ran the guard scripts together or in CI;
  • plugins/trigger-eval-workspace/ wasn't a plugin (eval fixtures) yet lived under plugins/;
  • the marketplace check only validated catalog→plugin, so an unregistered or non-plugin directory could sit under plugins/ undetected;
  • the two .claude/<name>.local.md resolvers each carried an identical copy of the config parser.

What changed

  1. build: reproducible dev/test infra + one-command check + CI (539658b)

    • Root pyproject.toml gets a dev dependency-group (pytest, ruff), package = false, and pytest config so uv run --group dev pytest discovers every plugin's suite from the root.
    • New scripts/check_all.py: single entrypoint running version check + shared-sync check + tests with a combined pass/fail.
    • New .github/workflows/ci.yml: runs check_all plus review-diff's 100% coverage gate.
  2. refactor: move trigger-eval-workspace out of plugins/evals/ (d527691)

    • The nine *-eval.json skill-trigger fixtures move to a top-level evals/ (with a README). plugins/ now holds exactly the nine registered plugins. CLAUDE.md tree updated.
  3. feat: bidirectional marketplace check (9ff0857)

    • check_marketplace_versions.py now also fails when a plugins/* directory has no catalog entry, distinguishing "unregistered plugin" from "not a plugin (move it out)". All three branches live-verified.
  4. refactor: extract shared .local.md config loader (b945b3c)

    • The duplicated _KV/_parse_config/_find_config/argv scaffolding becomes a canonical scripts/shared/config_loader.py, synced byte-identically into compound-knowledge and understand via the existing sync_shared.py mechanism. Both resolvers keep only their own typing/defaults and call the shared loader; both still work run-as-script and under pytest. Versions bumped (compound-knowledge 0.8.3, understand 0.1.2) and marketplace synced. Adversarial review confirmed exact behavioral parity.

Deliberately out of scope

Merging sdlc_state.py (autonomous-sdlc) and session_state.py (stick-shift): stick-shift is an intentional trimmed fork with a different state graph — merging would fight the documented design intent.

Validation

  • uv run --group dev python scripts/check_all.py → green (versions, shared-sync, 98 tests).
  • review-diff suite → green with 100% coverage.
  • Ignore hygiene clean; nothing stray tracked.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LCdtWgMHgeoqErt6s2NR3i


Generated by Claude Code

claude added 4 commits June 24, 2026 23:59
The root pyproject was still the `uv init` stub and pytest — required by every
plugin's test suite — was undeclared, so the tests only ran after a manual
install. Bring the root up to the standard review-diff already sets:

- declare a `dev` dependency-group (pytest, ruff) and `package = false`
- add `[tool.pytest.ini_options]` so `uv run --group dev pytest` discovers
  every plugin's suite from the repo root
- add `scripts/check_all.py`: a single entrypoint that runs the marketplace
  version check, the shared-artifact sync check, and the full test suite,
  reporting a combined pass/fail
- add a CI workflow running check_all plus review-diff's 100% coverage gate

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LCdtWgMHgeoqErt6s2NR3i
plugins/trigger-eval-workspace/ was not a plugin — it holds skill-trigger eval
datasets (query → should_trigger fixtures), is not registered in
marketplace.json, and is referenced by nothing. Keeping it under plugins/ (the
directory meant to hold only shippable plugins) was misleading.

Move the nine *-eval.json files to a top-level evals/ directory with a README
explaining the format, so plugins/ now contains exactly the nine registered
plugins. Update CLAUDE.md's structure tree to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LCdtWgMHgeoqErt6s2NR3i
…dirs)

check_marketplace_versions.py only validated marketplace entries against their
plugin.json — it could not catch the inverse: a plugin directory added but
never registered in the catalog, or a non-plugin directory living under
plugins/ (the exact problem trigger-eval-workspace had). Both slipped through.

Add a reverse pass over plugins/* that fails when a directory has no marketplace
entry, distinguishing "unregistered plugin" (has plugin.json) from "not a plugin"
(no plugin.json, belongs elsewhere). Document the now-bidirectional contract in
CLAUDE.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LCdtWgMHgeoqErt6s2NR3i
compound-knowledge's resolve_paths.py and understand's resolve_config.py each
carried an identical copy of the `.claude/<name>.local.md` reader: the same _KV
regex, _parse_config, _find_config (project>user>default precedence), and argv
handling. Two copies of one parser meant two places to fix a config-format bug.

Extract that scaffolding into a canonical scripts/shared/config_loader.py
(parse_config / find_config / cli_roots), synced byte-identically into each
plugin's scripts/ via sync_shared.py — the same mechanism already used for
feedback_manager.py. Each resolver keeps only its own typing/defaults/path
normalization and calls the shared loader. Both still work run-as-script
(sibling import via sys.path[0]) and under pytest.

Bump compound-knowledge 0.8.2 -> 0.8.3 and understand 0.1.1 -> 0.1.2, sync
marketplace.json, and document the new shared artifact in CLAUDE.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LCdtWgMHgeoqErt6s2NR3i
@JoshuaOliphant
JoshuaOliphant marked this pull request as ready for review June 25, 2026 00:32
@JoshuaOliphant
JoshuaOliphant merged commit a8c8c0a into main Jun 25, 2026
2 checks passed
@JoshuaOliphant
JoshuaOliphant deleted the claude/architecture-refactor-1xbheh branch June 25, 2026 00:32
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