Skip to content

fix(cli): enable cross-domain referencing for installed knowledges - #94

Open
MajorLift wants to merge 1 commit into
mainfrom
jongsun/fix/cross-domain-knowledge
Open

fix(cli): enable cross-domain referencing for installed knowledges#94
MajorLift wants to merge 1 commit into
mainfrom
jongsun/fix/cross-domain-knowledge

Conversation

@MajorLift

Copy link
Copy Markdown
Contributor

Closes #88.

The defect

Knowledge is copied per domain, so a skill could only ever cite its own domain's files. Four skills cite testing-layers.md, which lives in domains/testing/knowledge/:

Skill Its domain Cites from
coding-guidelines (mobile overlay, ×3 sites) coding testing
pr-guidelines (mobile overlay) pr-workflow testing
pr-readiness-check (mobile overlay) pr-workflow testing
perps-review-pr perps testing

Six citation sites, none of which could resolve for any consumer on any operator. The skill installed fine and the reference dangled — no error, the agent simply could not open what the body pointed at.

The fix

The installer scans a skill for knowledge/<file>.md citations its own domain does not satisfy, and copies the file in from whichever domain owns it.

Existing citations start working unchanged — no new syntax to learn, and nothing is declared in frontmatter, so the context an agent must load stays bounded. A cross-domain reference remains a body link the agent chooses to follow.

Overlays are scanned too. The repo overlay is merged into the emitted body, so a citation there is just as load-bearing — and three of the four cases cite from repos/metamask-mobile.md rather than skill.md. Scanning only the base fixed one of four, which is how I found it.

Ambiguity fails loudly. Resolution is by filename, which is unambiguous today — ten knowledge files, no name shared across domains. If that stops being true the reference is genuinely ambiguous, so the install exits non-zero and names the candidates rather than silently picking one.

Evidence

Real corpus, installing coding,perps,pr-workflow,testing for metamask-mobile:

before   9/15 knowledge citations resolve
after   15/15

Three tests, all failing against main's installer and passing here:

main    ℹ pass 12   ℹ fail 2
branch  ℹ pass 14   ℹ fail 0
  • a skill receives knowledge it cites from another domain, on all three operator outputs
  • the owning domain still gets its own knowledge
  • an ambiguous filename fails rather than picking one

Notes

  • No CHANGELOG.md entry — this is install behavior, so say the word if you want one and which release it lands under.
  • Complements test(ci): Enforce that knowledge/ installations resolve #87, which guards that knowledge/ citations resolve after install. That guard is what makes this class visible; this closes the remaining cases it surfaced.

Knowledge is copied per domain, so a skill could only ever cite its own domain's
files. Four skills cite `testing-layers.md`, which lives in `testing`:
`coding-guidelines`, `pr-guidelines`, `pr-readiness-check`, and
`perps-review-pr`. Six citation sites in total, none of which could resolve for
any consumer on any operator — the skill installed fine and the reference
dangled.

The installer now scans a skill for `knowledge/<file>.md` citations its own
domain does not satisfy, and copies the file in from whichever domain owns it.
Existing citations start working unchanged; no new syntax, and nothing declares
a dependency in frontmatter, so the context an agent must load stays bounded.

Both the base skill and the applicable repo overlay are scanned. The overlay is
merged into the emitted body, and three of the four cases cite from an overlay
rather than from `skill.md` — scanning only the base fixed one of four.

Resolution is by filename, which is unambiguous today: ten knowledge files, no
name shared across domains. If that stops being true the reference is genuinely
ambiguous, so the install fails and names the candidates rather than picking one.

Verified against the real corpus: 15/15 knowledge citations resolve after
install, from 9/15. Both new tests fail against main's installer.
@MajorLift MajorLift changed the title fix(cli): deliver knowledge a skill cites from another domain fix(cli): enable cross-domain knowledge references Jul 30, 2026
@MajorLift MajorLift changed the title fix(cli): enable cross-domain knowledge references fix(cli): enable cross-domain referencing for installed knowledges Jul 30, 2026
@MajorLift
MajorLift requested a review from abretonc7s August 3, 2026 10:12
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.

Skills cite knowledge files their domain does not ship (cross-domain knowledge is unsupported)

1 participant