Skip to content

refactor(unic-archon-dlc)!: delete lib/ and test/ — take the plugin to zero code - #398

Open
orioltf wants to merge 5 commits into
developfrom
feature/unic-archon-dlc/381-delete-lib-and-test
Open

refactor(unic-archon-dlc)!: delete lib/ and test/ — take the plugin to zero code#398
orioltf wants to merge 5 commits into
developfrom
feature/unic-archon-dlc/381-delete-lib-and-test

Conversation

@orioltf

@orioltf orioltf commented Aug 19, 2026

Copy link
Copy Markdown
Member

Closes #381. Closes #380. Refs #373, #379, #382, #383.

Why

The plugin shipped seven commands that could not run. Measured on 0.22.0 in DXP-DesignSystem,
installed through the marketplace by #390: all seven load and none runs past Step 1. Two causes,
one fix.

$CLAUDE_PLUGIN_ROOT is not set inside the Bash tool, so every Step 1 halted while printing advice
the operator had already followed. And lib/config-schema.mjs, lib/methods-bundle.mjs and
lib/schema-traps.mjs imported bare yaml, declared "yaml": "catalog:" — the pnpm workspace
protocol, unresolvable outside this monorepo whether or not node_modules is present. An installed
plugin ships no node_modules, so shipping the directory would have moved the failure to
Cannot find package 'yaml' rather than fixing it.

Both disappear when a command reads config, the tracker contract and its Methods with its own tools —
which is what the four Archon Boxes already did, and why they were unaffected. So lib/ and test/
are deleted, 6413 lines, and every Step 1 is prose. #379 and decision 17's ten-day goal sit behind
this.

What changed

lib/    12 modules   deleted
test/   19 suites    deleted
        tsconfig.json, the yaml dependency, the test and typecheck scripts
7 commands           every Step 1 rewritten as prose

verify:changelog stays — CI runs it on every PR. The four Box YAMLs are untouched: git diff over
.archon/ is empty, which is how the "the four Boxes still run" criterion is met.

Three decisions, grilled with the maintainer

  • The dependency list is prose. The table under README.md § Dependencies is the list itself, no
    longer a mirror of providedTo in lib/methods-manifest.mjs. Nothing generates it and nothing
    checks it, so edit it by hand in the same commit as the command or Box whose Methods changed. The
    pins and provenance stay in vendor/mattpocock-skills/README.md.
  • No config key is mandatory. A command stops only when .archon/unic-dlc.config.yaml is absent
    or unreadable. project.branching was the one entry in MANDATORY_PATHS, and /build's bootstrap
    node already defaulted it — so the old refusal stopped a command over a key a Box was happy to
    default. Every key now carries its default in the command's own Step 1 table.
  • A Method resolves at one path, .archon/methods/<name>/SKILL.md. The config and local
    override tiers are retired, and with them the resolution order and the tier line. Those tiers only
    ever reached the command half — an Archon node cannot import resolveMethod — so retiring them
    makes the two halves agree, which is what ADR-0023 §5's own constraint had been asking for.

Two silent breakages found while rewriting

Neither is in #381's criteria, and the first would have shipped a green PR with seven still-broken
commands.

  • setup.md and archon-upgrade.md declared allowed-tools: ['Bash']. A command that reads a
    file in prose needs Read. The criterion "no commands/*.md file imports a plugin module" passes
    while the command cannot open a file at all. setup.md gains Read, Write, Edit, Glob;
    archon-upgrade.md gains Read and Glob and deliberately no Write, which makes its read-only
    claim a fact about its frontmatter rather than a promise in its prose.
  • /archon-upgrade Step 5 read the plugin's own directory, not the Boxes installed where it runs.
    It now reads .archon/workflows/unic-dlc-*.yaml in the repository it is invoked in — the copies a
    run would actually use — and checks ADR-0011's four conventions itself. A file it cannot read is a
    FAIL, never a silent PASS.

#380 — the quality bar for a prose Box

#381 was natively blocked by #380, "what replaces a test as the quality bar for a prose Box?", and
this PR answers it, because this PR is what created the question. The passage is
#### The quality bar for a prose Box, nested inside the existing ### Acceptance criteria are prose
in the root AGENTS.md — no new document, and no new section at the same level. It also repoints that
section's worked example, which cited lib/slopcheck.mjs, a file this PR deletes.

Both hard cases get an explicit verdict, and both are losses:

  • test/box-staging-and-repo-pinning.test.mjs grepped every Box YAML for git add -A and for a
    repository derived from a remote URL. Nothing replaces it. Both rules stay stated inline in
    every prompt that must honour them, and both patterns are visible on the page — but an unread diff
    now merges them green.
  • test/command-methods.test.mjs was the upstream-rename tripwire. Nothing replaces it either.
    It compared two hand-written surfaces inside this repository and never watched upstream, so it could
    not have caught the v1.1.0 rename wave it was written for. The bar names the moment instead:
    upgrading a vendored Method Bundle means diffing the vendored tree against the new upstream tag by
    hand, in the commit that moves the pin.

Verification

root pnpm ci:check                    exit 0  (Biome 246 files, 5 infos; Prettier clean)
pnpm --filter unic-archon-dlc verify:changelog   ok
commands/ · node heredocs · process.env · await import        0
git diff de0d643..HEAD -- .archon/                            empty

pnpm test and pnpm typecheck no longer exist for this plugin, by design — CI runs both with
--if-present, so no workflow edit was needed.

The one criterion this PR does not prove: the Consumer run. #381's new criterion asks that every
command run past Step 1 in a Consumer where the plugin is installed through the marketplace. That
needs 0.23.0 released and a run in DXP-DesignSystem, so it cannot be met from a feature branch. What
is proven here is structural: no command runs Node, imports a module, or reads an environment
variable, so neither measured failure mode can recur. #390's AC-3 — /triage resolving a state role
through docs/agents/triage-labels.md — completes on that same run.

Amended ADRs

None deleted, four amended, each with the trade named: ADR-0023 §5 (the rule now covers the commands,
not only the Archon nodes), ADR-0031 (one tier; integrity checked by reading), ADR-0036 (the install
rules stand, the module does not), ADR-0018 (the deterministic core reached zero; the default PRD
scaffold moves to commands/specs.md).

What this leaves open

🤖 Generated with Claude Code

… zero code

The plugin shipped seven commands that could not run. Measured on 0.22.0 in
DXP-DesignSystem, installed through the marketplace: all seven load and none
runs past Step 1. Two causes, one fix.

$CLAUDE_PLUGIN_ROOT is not set inside the Bash tool, so every Step 1 halted
while printing advice the operator had already followed. And three lib/ modules
imported bare `yaml`, declared "yaml": "catalog:" — the pnpm workspace protocol,
unresolvable outside this monorepo whether or not node_modules is present. An
installed plugin ships no node_modules, so shipping lib/ would not have helped.

Both go away when the commands read config, the tracker contract and their
Methods with their own tools, which is what the four Archon Boxes already did
and why they were unaffected. So lib/ and test/ are deleted — 6413 lines — and
every Step 1 is prose.

Three decisions this settles, grilled with the maintainer:

- The dependency list is the table under README § Dependencies itself, no
  longer a mirror of lib/methods-manifest.mjs. Nothing generates it and nothing
  checks it.
- No config key is mandatory. Only an absent or unreadable
  .archon/unic-dlc.config.yaml stops a command; every key has a stated default.
- A Method resolves at one path, .archon/methods/<name>/SKILL.md. The config
  and .local override tiers are retired, and with them the tier line.

Also fixes a second silent breakage found while rewriting: setup.md and
archon-upgrade.md declared allowed-tools: ['Bash'], which would have blocked
the file reads their new prose needs.

Refs #381
… code

Six live surfaces still pointed at lib/ and test/ after the deletion. Each was
found by reading, which is the bar this PR sets.

- vendor/mattpocock-skills/README.md called lib/methods-resolver.mjs the reader,
  named lib/methods-manifest.mjs "the source of truth in code" for the tag and
  commit, and cited a closure test in test/. That file is now the ONLY home of
  the pin, so it cannot point at deleted code — the table is the provenance and
  re-vendoring means diffing this tree against upstream by hand.
- README.md claimed /setup verifies "the vendored licence hash and the manifest
  closure". It verifies neither now: it stops on a missing LICENSE and an
  incomplete copy. Reworded to what the prose actually checks.
- AGENTS.md listed `pnpm test` and `pnpm typecheck`, kept the "tested lib only
  for deterministic IP" doctrine, forbade "bespoke lib" while permitting a
  tested one, and still advertised .archon/methods.local/ in the Consumer
  CLAUDE.md block.

The two Box YAML comments are a deliberate exception to the ticket's
"do not touch the Boxes": both named a deleted file, which is misleading
context rather than behaviour. unic-dlc-build.yaml said its inline slopcheck
"mirrors lib/slopcheck.mjs" — that module is gone and the node is now the only
copy of the gate. unic-dlc-qa.yaml pointed at lib/methods-manifest.mjs for why
`qa` has no entry; it points at the README table instead. No node body, gate,
`when` clause or `always_run` changed, so the criterion that the four Boxes
still run is untouched.

Refs #381

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the unic-archon-dlc Claude Code plugin to “zero code” by deleting all runtime .mjs modules and the entire test suite, rewriting command Boxes so they no longer rely on $CLAUDE_PLUGIN_ROOT, Node heredocs, or workspace-only dependencies (e.g. yaml via catalog:). This aligns the plugin with the repo doctrine that the product is primarily prose and that Boxes should be validated by “a run and a read”.

Changes:

  • Delete apps/claude-code/unic-archon-dlc/lib/ and apps/claude-code/unic-archon-dlc/test/, plus related tsconfig.json, scripts, and dependencies.
  • Rewrite multiple commands/*.md Step 1 flows to read config/Methods directly by path (no Node snippets, no env var dependency).
  • Update docs/ADRs and release metadata (README, CHANGELOG, plugin/marketplace versions, and root doctrine in AGENTS.md) to reflect the new “prose-only” posture and quality bar.

Reviewed changes

Copilot reviewed 54 out of 56 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
AGENTS.md Adds/updates doctrine: “quality bar for a prose Box” and explains tradeoffs after removing tests/modules.
pnpm-lock.yaml Removes yaml and other plugin-specific entries now that the plugin ships no runtime deps/code.
apps/claude-code/unic-archon-dlc/.claude-plugin/marketplace.json Bumps marketplace version to 0.23.0.
apps/claude-code/unic-archon-dlc/.claude-plugin/plugin.json Bumps plugin version to 0.23.0.
apps/claude-code/unic-archon-dlc/CHANGELOG.md Adds 0.23.0 entry describing the breaking shift to prose-only and related behavior changes.
apps/claude-code/unic-archon-dlc/CONTEXT.md Updates domain vocabulary/relationships to reflect one-path Method resolution and removal of Local Method tier.
apps/claude-code/unic-archon-dlc/README.md Reframes dependency list as authoritative prose; updates Method bundle/integrity and removes retired config key docs.
apps/claude-code/unic-archon-dlc/package.json Removes yaml dependency, drops test/typecheck scripts, removes TS tooling, bumps version.
apps/claude-code/unic-archon-dlc/tsconfig.json Deleted (no longer any .mjs to typecheck for this plugin).
apps/claude-code/unic-archon-dlc/commands/archon-upgrade.md Updates allowed-tools and rewrites to read installed workflows/config without plugin modules.
apps/claude-code/unic-archon-dlc/commands/cleanup.md Removes Node/heredoc-based config loading; replaces with prose instructions and defaults table.
apps/claude-code/unic-archon-dlc/commands/improve-architecture.md Removes Node/heredoc-based config+method resolution; replaces with direct path reads and defaults.
apps/claude-code/unic-archon-dlc/commands/specs.md Removes Node/heredoc-based config/method handling; adds default PRD scaffold in prose and direct file-path method reads.
apps/claude-code/unic-archon-dlc/commands/tickets.md Removes Node/heredoc-based config and issues.json writing logic; replaces with prose validation/order/write guidance.
apps/claude-code/unic-archon-dlc/commands/triage.md Removes Node/heredoc-based config/method resolution; replaces with prose config defaults + fixed method paths.
apps/claude-code/unic-archon-dlc/docs/adr/README.md Updates ADR index rows to reflect the new “zero code / one-path method resolution” state.
apps/claude-code/unic-archon-dlc/docs/adr/0018-generic-core-config-compose.md Amends ADR to document the deterministic core reaching zero and PRD default scaffold moving to prose.
apps/claude-code/unic-archon-dlc/docs/adr/0023-build-generic-red-green-refactor-loop.md Amends ADR to apply “no plugin module imports / no $CLAUDE_PLUGIN_ROOT” rule to command Boxes too.
apps/claude-code/unic-archon-dlc/docs/adr/0031-methods-bundled-three-tier-resolution.md Amends ADR to retire tiers and move to a single .archon/methods/<name>/SKILL.md resolution path.
apps/claude-code/unic-archon-dlc/docs/adr/0036-setup-owns-a-named-install-set.md Amends ADR to keep install-set rules while removing the modules that previously implemented them.
apps/claude-code/unic-archon-dlc/lib/archon-check.mjs Deleted (part of removing plugin code).
apps/claude-code/unic-archon-dlc/lib/issues-schema.mjs Deleted (part of removing plugin code).
apps/claude-code/unic-archon-dlc/lib/labels-config.mjs Deleted (part of removing plugin code).
apps/claude-code/unic-archon-dlc/lib/methods-bundle.mjs Deleted (part of removing plugin code).
apps/claude-code/unic-archon-dlc/lib/methods-manifest.mjs Deleted (part of removing plugin code).
apps/claude-code/unic-archon-dlc/lib/methods-resolver.mjs Deleted (part of removing plugin code).
apps/claude-code/unic-archon-dlc/lib/prd-writer.mjs Deleted (part of removing plugin code).
apps/claude-code/unic-archon-dlc/lib/schema-traps.mjs Deleted (part of removing plugin code).
apps/claude-code/unic-archon-dlc/lib/slopcheck.mjs Deleted (part of removing plugin code).
apps/claude-code/unic-archon-dlc/lib/stub-detector.mjs Deleted (part of removing plugin code).
apps/claude-code/unic-archon-dlc/test/archon-check.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/archon-upgrade-command.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/build-qa-evidence-and-always-run.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/box-workflow-node-refs.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/command-methods.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/issues-schema.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/labels-config.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/methods-bundle.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/methods-manifest.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/methods-resolver.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/prd-writer.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/schema-traps.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/slopcheck.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/stub-detector.test.mjs Deleted (part of removing plugin test suite).
apps/claude-code/unic-archon-dlc/test/test-enumeration.test.mjs Deleted (part of removing plugin test suite).
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +168 to +169
`PRD_TEMPLATE` must appear in the content. When `PRD_TEMPLATE` is unset, these seven are the required
headings, and this scaffold is the default PRD shape:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed, and fixed in ee06ae2.

The contradiction was real: Step 1's table said templates.prd defaults to "the scaffold in Step 7", which makes Step 7's When PRD_TEMPLATE is unset branch unreachable — so the scaffold was simultaneously the default value and the fallback for that value being absent.

Step 1 now records the key as unset — Step 7 owns the default. One place decides which heading set is enforced: if config declares templates.prd, its ## headings are the required set; if it does not, the seven in Step 7 are.

This came out of moving DEFAULT_PRD_TEMPLATE from the deleted lib/config-schema.mjs into the one Box that writes a PRD. The Step 1 table row was written as though the default were resolved at load time, the way mergeConfig used to resolve it, and that is no longer where it happens.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 54 out of 56 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (1)

apps/claude-code/unic-archon-dlc/docs/adr/0023-build-generic-red-green-refactor-loop.md:8

  • The ADR status line says it was amended on 2026-08-20, which is in the future relative to this PR date (2026-08-19). Also, plugin ADR amendments are documented to be recorded as a > **Amended (YYYY-MM-DD):** blockquote immediately below the status line (see apps/claude-code/unic-archon-dlc/docs/adr/README.md).
**Status:** Accepted (2026-07-02); amended 2026-08-20 — §5's rule now covers the command Boxes too,
not only the Archon nodes; see the amendment at the end of §5. Amended 2026-08-04 — refactor left the loop and moved to
`/pr-review`'s `code-review` Fowler smells, and the loop's procedure is now the `tdd` and `implement`
Methods rather than prose written here (#281). See §7. The filename keeps its original slug; five
sibling documents link to it by name, and renaming it would buy nothing behavioural.

… and amend two more

Copilot's one finding on PR #398 holds. specs.md Step 1 defaulted
`templates.prd` to "the scaffold in Step 7", which made Step 7's "when
PRD_TEMPLATE is unset" branch unreachable and left it ambiguous which heading
set is enforced. Step 1 now records the key as unset by default and says Step 7
owns the scaffold, so exactly one place decides.

Checking that finding surfaced a convention violation of my own. Four ADR
amendments used the ROOT format — a `## Amendment` section in the body — which
docs/adr/README.md explicitly forbids for a plugin ADR, naming ADR-0024 as the
worked example: a dated `> **Amended (YYYY-MM-DD):**` blockquote below the
status line, the amendment named in an extended status line, and the index
Status column. 8502ec7 rejected the same mistake for #389. All four are
converted, oldest amendment first where an ADR already had one.

Two more ADRs needed amending, both found by reading rather than by grep:

- ADR-0032 defines `Local Method` as vocabulary. That term named the retired
  middle resolution tier, and CONTEXT.md no longer carries it, so an ADR was
  defining a word with no referent. Titles keep it — an ADR filename is an
  address and four documents link here by name.
- ADR-0019 keeps "exactly one thin tested lib" for idempotent config
  merge-and-validate. That lib is deleted. Its invariants are now Step 5 prose,
  and the amendment says plainly what that costs: no automated proof that a
  re-run cannot clobber a partial config.

Refs #381
Copilot AI review requested due to automatic review settings August 19, 2026 23:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Delete lib/ and test/ — take the plugin to zero code What replaces a test as the quality bar for a prose Box?

2 participants