Skip to content

plugin-quality:audit asserts ${CLAUDE_PLUGIN_DATA} does not substitute in skill markdown; plugins-reference now says it does #1568

Closed

Description

@kyle-sexton

Problem

plugins/plugin-quality/skills/audit/SKILL.md (Evidence packet section) asserts:

The ${CLAUDE_PLUGIN_DATA} token does NOT substitute in skill markdown (it is a hook/monitor/MCP
path substitution), so derive the directory deterministically per the plugins reference…

The current plugins reference (https://code.claude.com/docs/en/plugins-reference, fetched
2026-07-26) contradicts that. Its "Environment variables" section carries a per-component
substitution table introduced by "Which fields substitute them inline depends on the plugin
component:", whose first row is:

Plugin component Fields where placeholders resolve
Skill and agent content Anywhere the placeholder appears

${CLAUDE_PLUGIN_DATA} is one of the three variables that table governs, alongside
${CLAUDE_PLUGIN_ROOT} and ${CLAUDE_PROJECT_DIR}.

Why this is not a trivial doc fix

There is a genuine cross-page tension that needs settling before the skill changes:

So this needs an empirical check in an installed plugin skill, not a doc swap on faith.

Also worth evaluating in the same pass: ${CLAUDE_SKILL_DIR} is documented on the skills page as
the plugin-skill-friendly form ("For plugin skills, this is the skill's subdirectory within the
plugin, not the plugin root") and may be the more portable answer regardless of how the tension
resolves.

Current risk: low, but the reasoning is stale

The skill's manual derivation (~/.claude/plugins/data/<plugin-id>/ with non-[A-Za-z0-9_-]
characters replaced by -) is still correct — plugins-reference documents exactly that path and
mangling rule, so packets land in the right place today. What is wrong is the stated reason, and
a wrong reason propagates: this repo's audit skill is the component other audits copy their
doc-grounding posture from.

Suggested resolution

  1. Empirically verify whether ${CLAUDE_PLUGIN_DATA} expands in an installed plugin skill body.
  2. Update the assertion to match observed behavior, citing the plugins-reference table, and note
    the skills-page omission as a documented tension rather than silently picking a side.
  3. Decide whether to keep the deterministic derivation anyway (defensible as belt-and-braces given
    the tension) or switch to the substitution.

Related

Found while implementing #1565 / #1566 against the same skill; deliberately not folded into that PR
because it needs its own empirical verification and the two doc pages disagree.

Activity

  1. added
    needs-triage
    on Jul 26, 2026
  2. kyle-sexton commented on Jul 26, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Triage: verified → briefed, decision-defaulted

    Category: Bug (a correct practice justified by a false stated reason), plugin-quality.

    Verification — the contradiction is CONFIRMED STILL LIVE, re-fetched this session. I did not
    take the item's citation on trust; this repository's fresh-docs mandate covers documented harness
    behavior, so I re-fetched the plugins reference during triage. The per-component substitution table
    is still present, still introduced by "Which fields substitute them inline depends on the plugin
    component:", and its first row still reads:

    Plugin component Fields where placeholders resolve
    Skill and agent content Anywhere the placeholder appears

    The table still governs all three variables, ${CLAUDE_PLUGIN_DATA} among them. So the audit
    skill's assertion that the token "does NOT substitute in skill markdown (it is a hook/monitor/MCP
    path substitution)" is contradicted by current upstream documentation, and the item is not
    already-resolved by upstream drift since it was filed.

    The cross-page tension is real and is why this is not a doc swap. The skills page's own
    substitutions table does not list ${CLAUDE_PLUGIN_DATA} or ${CLAUDE_PLUGIN_ROOT} at all. Two
    official pages therefore disagree about the same surface, which is exactly the situation where
    picking a side from documentation alone would repeat the original error in the opposite direction.

    Redundancy check. Searched by domain concept — plugin data-directory resolution — across the
    plugin surface for an already-corrected statement or an existing empirical determination: none. The
    audit skill is the only component asserting the negative claim, and it is, per the item, the
    component other audits copy their doc-grounding posture from, which is what makes a wrong stated
    reason propagate. No docs/out-of-scope/ ledger in this repo.

    Current behavior is correct; only the justification is wrong. The manual derivation the skill
    performs still lands packets in the right place, because the reference documents that same path and
    character-mangling rule. Nothing is broken for users today. The defect is epistemic.

    Decision defaulted: keep the deterministic derivation, correct the stated reason — veto before merge

    The item leaves one question open: keep the manual derivation as belt-and-braces, or switch to
    relying on the substitution.

    RECOMMENDED — keep the deterministic derivation, and fix only the reason given for it. Two
    official pages disagree about whether the token expands in skill content. A derivation that does not
    depend on the answer is correct under either resolution, so it is the choice that survives the
    tension being settled either way. Switching to substitution would make the skill's behavior depend
    on the very question this item records as unsettled.

    Alternative, and why it is merely vetoable: switch to the substitution (or to the
    skill-directory variable the item flags as possibly more portable). This is reversible — it is a
    one-line change to how one path is computed inside one skill, with no consumer-visible contract and
    no data migration, so a maintainer who prefers it can say so before merge at no cost. That
    reversibility is what makes this decision-defaulted rather than human-gated.

    Brief

    Behavioral contract. The audit skill must not justify its data-directory derivation with a claim
    that current official documentation contradicts, and must not silently pick a winner between two
    disagreeing official pages.

    Acceptance:

    1. The assertion that the token does not substitute in skill markdown is removed or corrected to
      match observed behavior.
    2. The behavior is determined empirically, not from documentation. Verify in an installed plugin
      skill body whether the token actually expands, and let the observation govern. This is the step
      that distinguishes a real fix from swapping one unverified claim for another.
    3. The cross-page disagreement is recorded as a documented tension — the reference's per-component
      table versus the skills page's omission — rather than resolved by silently citing whichever page
      supports the chosen behavior.
    4. The derivation itself is retained per the defaulted decision above unless a maintainer vetoes,
      with its rationale restated as "independent of the unsettled substitution question" rather than
      as the current false claim.
    5. The skill-directory variable the item flags is evaluated in the same pass and the outcome
      recorded, so the question is not reopened later.
    6. Citations are re-fetched at implementation time per the fresh-docs mandate; the fetch recorded in
      this comment establishes the contradiction is live as of triage, not that it will still be live at
      implementation.

    Labels applied: priority: medium, agent-ready, status: ready; raw marker cleared.

  3. added
    agent-ready
    status: ready
    and removed
    needs-triage
    on Jul 26, 2026
  4. kyle-sexton commented on Jul 26, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Admission gate: carries agent-ready but no work-class: label and no body-recorded class trailer — unclassified → fail-closed human-gated per the work-loop lane's admission table (a role label alone is not classification evidence). Routed to human-gated; not dispatched.

  5. added
    needs-human
    and removed
    agent-ready
    on Jul 26, 2026
  6. kyle-sexton commented on Aug 11, 2026

    @kyle-sexton
    MemberAuthor

    Evidence from a validation pass over handoff-inbox item
    20260811-021645-plugin-audit-four-components-and-guard-deadlock-ownership, verified against repo
    HEAD 685dd381. Facts only — no disposition recommended for this issue.

    1. This issue's own subject appears to be corrected in tree already.
    plugins/plugin-quality/skills/audit/SKILL.md:123-131 now states that the placeholder DOES resolve,
    cites plugins-reference §Environment variables with a fetch date of 2026-07-31, and keeps the
    deterministic derivation as a fallback. plugins/plugin-quality/CHANGELOG.md:147 records that
    correction, crediting #1808 — which is a CLOSED issue, not a PR.

    2. architecture is the last surviving carrier of the live claim in this repo, and now has its
    own issue: #2207.
    A repo-wide sweep for both phrasings returns exactly three hits:

    • plugins/architecture/skills/improve/SKILL.md:71 — the live false claim ("That token does not
      substitute in skill markdown content (it is a hook/monitor/MCP path substitution only)")
    • plugins/architecture/CHANGELOG.md:112-115 — the same mechanism as the stated reason in the 0.3.6
      "Fixed" entry, promoted to a permanent Gotcha at :74 in 0.4.1
    • plugins/plugin-quality/CHANGELOG.md:147 — the record of the correction, not the claim

    The sweep matched two phrasings only; a paraphrase ("only hooks can use it", "not available to
    skills") would not have been found, so three is a lower bound, not a census.

    3. The contradiction is still live at HEAD. https://code.claude.com/docs/en/plugins-reference,
    "Environment variables", re-fetched 2026-08-11: "Which fields substitute them inline depends on
    the plugin component:" introduces a table whose first row is | Skill and agent content | Anywhere the placeholder appears |, with Hook and monitor commands as a separate row and no version
    qualifier
    . The cross-page tension this issue names is also still live — the skills page's own
    substitutions table still omits ${CLAUDE_PLUGIN_DATA} and ${CLAUDE_PLUGIN_ROOT}.

    4. A third instance of the family, running in the opposite direction. The same validation pass
    found claude-config asserting that the token's use is undocumented — the inverse error about the
    same token, from the same cross-page ambiguity. Recorded in the ledger below as CC-F9; not this
    issue's scope, noted because it shows the ambiguity produces errors in both directions.

    5. Adjacent, same failure class, different variable: #1824 (${CLAUDE_SKILL_DIR} used in
    pre-compute but not documented as harness-substituted).

    6. An open alternative explanation nobody has closed. A Read of a skill line may return the
    token literal while skill-loading expands it; the architecture symptom that started this family
    originated in a Read-loaded actions/deepening.md, not a SKILL.md body. If true, the historical
    symptoms were real and only the mechanism was wrong. It does not soften the doc contradiction. A
    throwaway plugin carrying the token in both a SKILL.md body and an actions/*.md file would settle
    it.

    Ledger: .work/handoff-inbox-batch-4/ledgers/I9-021645-four-components.md § Lane E — architecture
    / improve (rows A-F1–A-F4).

  7. kyle-sexton commented on Aug 12, 2026

    @kyle-sexton
    MemberAuthor

    Batch-4 filing note — two adjacent rows deliberately routed here rather than filed separately, so this issue stays the single owner of the substitution-scope question:

    1. The reference/*.md extent is the one leg still unconfirmed. Filed as part of fix(claude-config): audit-pass specifies 1,547 lines of runtime mechanism and ships no scripts, so the lease, the partial, and the resume path are prose only #2280 (audit-pass F8), but the row explicitly defers to this issue: the plugins reference's row is | Skill and agent content | Anywhere the placeholder appears |, and the docs do not state whether "skill content" extends to bundled reference/*.md loaded on demand via Read. fix(claude-config): audit-pass specifies 1,547 lines of runtime mechanism and ships no scripts, so the lease, the partial, and the resume path are prose only #2280 does not re-litigate it. For ${CLAUDE_PROJECT_DIR} specifically both pages agree it substitutes in skill content, so audit-pass's SKILL.md:42-43 row stands independently.

    2. One member of the false-claim family is closed, not filed. claude-config:audit-prompting-postures was reported as using ${CLAUDE_PLUGIN_DATA} in a skill body "undocumented-but-working". That is falsified — plugins-reference documents it with no version qualifier, and this repo already states the correct answer at plugins/plugin-quality/skills/audit/SKILL.md:123-131. Recorded in fix(claude-config): audit-prompting-postures' contract disagrees with itself in eight places #2281's "not filed, on purpose" section so nobody hardens a working, documented mechanism. Same family as fix(architecture): improve's Gotcha asserts ${CLAUDE_PLUGIN_DATA} does not substitute in skill content — plugins-reference says it does #2207.

  8. kyle-sexton commented on Aug 12, 2026

    @kyle-sexton
    MemberAuthor

    Closing as already fixed on main: plugin-quality:audit SKILL.md now states that ${CLAUDE_PLUGIN_DATA} DOES resolve in skill/agent content per the plugins reference (fetched 2026-07-31), with deterministic fallback when unexpanded. No further in-repo change needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-humanstatus: ready

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions