Skip to content

feat: a packaged project reads the reference docs from the plugin (decision 0019) - #33

Merged
mauricios merged 2 commits into
mainfrom
feat/plugin-reference-docs
Oct 6, 2026
Merged

mauricios merged 2 commits into
mainfrom
feat/plugin-reference-docs

Conversation

@mauricios

Copy link
Copy Markdown
Contributor

The four reference docs — COST-MODEL.md, MCP-INTEGRATION.md, MEMORY-STRATEGY.md, SPEC-MODEL.md, about 950 lines — are generic, never edited by a project, and /upgrade already overwrites them verbatim. A packaged project no longer commits them: the aplyca-adf plugin carries them in docs/, generated from skeleton/docs/ (decision 0019, amending 0016).

TRACKER-INTEGRATION.md and PARALLEL-AGENTS.md stay in the project, because they hold its settings. The committed install is unchanged.

What sessions decided

Headless sessions on Claude Code 2.1.286 shaped the design (report):

Finding So
${CLAUDE_PLUGIN_ROOT} is filled in for skills and agents They name the plugin's copy, ${CLAUDE_PLUGIN_ROOT}/docs/<doc>.md
…but not for workflow scripts (an agent got the literal text, and a template literal threw) deep-spec-analysis's plugin copy carries the spec model's text, through one SPEC_MODEL constant the build fills in
Reading any file outside the project asks first: the plugin's docs/, a skill's own folder, the installed copy in ~/.claude/plugins/cache/ A packaged project commits Read(~/.claude/plugins/cache/aplyca/aplyca-adf/**) in permissions.allow. Checked: with it, the session and a plugin agent read the cache without asking
An agent on Haiku read docs/SPEC-MODEL.md in the project although its instructions gave the plugin's full path Plugin skills and agents that name a reference doc open with one line: those are the plugin's copies, outside the project

The plugin's SessionStart hook also tells a packaged session where the docs are, so Claude reads them locally instead of fetching the GitHub links.

The project's files

  • Links: the project's files link the docs at the pinned release on GitHub. The new scripts/link-reference-docs.py rewrites them:
    • /adopt runs it;
    • /upgrade runs it to move the links with each pin, and back on a switch to committed.
    • It only touches the skeleton's own files, and lists any other file that names a doc.
  • Older releases: /adopt and /upgrade leave the docs out only when the release carries them in plugins/aplyca-adf/docs/, so adopting from an older tag still works.
  • Spec model: customizing it now takes the committed install. Customizing it already meant editing /write-spec, which a packaged project can't do.

Upgrade impact

  • Committed projects: overwrite session-context.sh and deep-spec-analysis.js. Both behave as before.
  • Packaged projects: /aplyca-adf:upgrade does four steps after moving the pin:
    1. delete the unchanged docs;
    2. run the link script;
    3. add the read rule;
    4. add the names note's new sentence.

Evals

  • Static, all passing: check-skills 158, test-hooks 82, test-modules 45, test-plugin 18. New in this PR:
    • the link script's round trip on the whole skeleton (packaged and back gives identical files), pin moves, idempotence, and tag validation;
    • the session-context line in a packaged project, and its absence when the project keeps its own copies;
    • the plugin's generated workflows parsed with node --check.
  • check-packaged.sh: gains the reference-doc checks. On a correct packaged layout all 10 pass; with a doc put back and the rule removed, those two fail.
  • New session suite, plugin-docs (Haiku, default permission mode, no extra directories). Run 1 found the path-shortening issue above. Runs 2 and 3 passed after the fix (run 3: 7 of 7, $0.58).
    • agent-spec-model: a plugin agent reads the plugin's spec model.
    • session-docs: the session finds a doc through the session context.
    • without-rule: the control, where the same read is denied.
    • Each check was also run against a session where it should fail, and failed there.

🤖 Generated with Claude Code

mauricios and others added 2 commits October 5, 2026 20:47
…cision 0019)

The four reference docs (COST-MODEL, MCP-INTEGRATION, MEMORY-STRATEGY, SPEC-MODEL) are generic,
never edited by a project, and overwritten verbatim by every upgrade. The aplyca-adf plugin now
carries them in docs/, generated from skeleton/docs/, and a packaged project commits none of them.

What sessions showed (Claude Code 2.1.286) decided how each part reaches them:
- Skills and agents get ${CLAUDE_PLUGIN_ROOT} filled in: they name the plugin's copy, and open with
  a line saying it's outside the project. Without it, an agent on Haiku read docs/SPEC-MODEL.md in
  the project instead.
- Workflow scripts don't: deep-spec-analysis's plugin copy carries the spec model's text, through
  one SPEC_MODEL constant the build fills in.
- Reading any file outside the project asks first, the plugin's own folder and its installed copy
  included: a packaged project commits Read(~/.claude/plugins/cache/aplyca/aplyca-adf/**).
- The plugin's SessionStart hook tells a packaged session where the docs are.

The project's files link the docs at the pinned release on GitHub. scripts/link-reference-docs.py
rewrites the links; /adopt runs it, /upgrade moves them with the pin and back on a switch to
committed. The committed install is unchanged. TRACKER-INTEGRATION and PARALLEL-AGENTS stay in the
project: they hold its settings.

Evals: link-script tests in test-plugin.sh, the plugin's session-context line in test-hooks.sh,
the plugin's workflows parsed by check-skills.sh, check-packaged.sh's reference-doc checks, and the
new plugin-docs session suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The experiments behind decision 0019 (what a plugin's own files allow in Claude Code 2.1.286) and the
new plugin-docs suite: run 1 found an agent on Haiku reading docs/SPEC-MODEL.md in the project
instead of the plugin's copy; with the outside-the-project line, runs 2 and 3 passed (7/7, $0.58).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mauricios
mauricios marked this pull request as ready for review October 6, 2026 03:52
@mauricios
mauricios merged commit 0828e8c into main Oct 6, 2026
1 check passed
@mauricios
mauricios deleted the feat/plugin-reference-docs branch October 6, 2026 03:52
mauricios added a commit that referenced this pull request Oct 6, 2026
A minor release: a packaged project no longer commits the framework's four reference docs; it reads
them from the pinned plugin (#33, decision 0019). Unreleased becomes v1.2.0, with the upgrade from
v1.1.x: /aplyca-adf:upgrade moves the pin and, in a packaged project, removes the unchanged copies,
rewrites the links, adds the read rule, and extends the names note.

plugin.json 1.2.0; both READMEs name the release.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant