Skip to content

feat(skills): auto-bundle skills referenced in a skill's prose for cloud runs#3400

Merged
tatoalo merged 1 commit into
mainfrom
posthog-code/auto-bundle-prose-skill-references
Jul 13, 2026
Merged

feat(skills): auto-bundle skills referenced in a skill's prose for cloud runs#3400
tatoalo merged 1 commit into
mainfrom
posthog-code/auto-bundle-prose-skill-references

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Problem

Cloud runs can't follow skill-to-skill references unless every dependency is declared by hand. Dependency auto-bundling (#3057) only reads the frontmatter dependencies: list, but most skills reference each other in prose — "run /other-skill next" or [[other-skill]]. A referenced skill that was never declared stays on the user's machine, so in the sandbox the parent skill points at something that doesn't exist. This is half of the reported "cloud tasks only see the first skill; skills referenced inside it can't be found" behavior (the adapter half is #3399).

Changes

  • add parseSkillReferences(content, knownNames) to detect /skill-name and [[skill-name]] references in SKILL.md files. Only known local skill names are accepted, preventing false matches such as paths, URLs, or unrelated slash-prefixed text.

  • extend dependency resolution to include skill references found in documentation alongside declared dependencies: before transitive expansion. Existing cycle protection, bundled-skill deduplication, and the 50-skill limit remain unchanged across both initial and follow-up uploads.

@trunk-io

trunk-io Bot commented Jul 13, 2026

Copy link
Copy Markdown

😎 Merged manually by @tatoalo - details.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 5db545b.

@tatoalo tatoalo self-assigned this Jul 13, 2026
@tatoalo tatoalo marked this pull request as ready for review July 13, 2026 16:38
@tatoalo tatoalo added the Stamphog This will request an autostamp by stamphog on small changes label Jul 13, 2026
github-actions[bot]
github-actions Bot previously approved these changes Jul 13, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Additive, well-tested change: prose-based skill references are matched only against the pre-built set of known skill names, preventing false positives from paths or arbitrary prose. Logic is correct, allSkills is available before knownSkillNames is constructed, and the tests cover the key edge cases.

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Security Review

A prose reference can resolve to a same-named skill from a broader skill root, which can upload unintended local skill files into the cloud run.

Reviews (1): Last reviewed commit: "feat(skills): auto-bundle skills referen..." | Re-trigger Greptile

Comment thread packages/workspace-server/src/services/skills/skills.ts
Comment thread packages/workspace-server/src/services/skills/parse-skill-references.ts Outdated
…oud runs

Dependency auto-bundling (#3057) only follows the frontmatter
dependencies: list, but most skills point at each other in prose —
"run /other-skill next" or [[other-skill]]. A referenced skill that was
never declared stayed on the user's machine, so the sandbox agent
couldn't load it when the parent skill invoked it.

resolveSkillBundleDependencies now also scans each SKILL.md body for
/skill-name and [[skill-name]] tokens. Matches are filtered against the
known local skill names, resolution prefers a skill beside the
referencing one (then same source) so a repo skill referencing /helper
gets its sibling, and uppercase frontmatter names are recognized. The
transitive expansion, bundled-skill skip, cycle guard, and 50-skill
ceiling apply unchanged.
@tatoalo tatoalo force-pushed the posthog-code/auto-bundle-prose-skill-references branch from 3aaeb2b to 5db545b Compare July 13, 2026 16:47
@github-actions github-actions Bot dismissed their stale review July 13, 2026 16:47

New commits pushed (delta classified non_linear_history) — stamphog approval dismissed; re-review running automatically.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Additive feature in the right layer (workspace-server), well-tested, and both bot concerns raised on older commits are addressed in this diff: the scoping fix (directory-then-source priority) resolves the name-collision issue, and the test suite covers prose references, URL/path false-positives, and same-named skills across sources.

@tatoalo

tatoalo commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

/trunk merge

@tatoalo tatoalo merged commit 53a3ce1 into main Jul 13, 2026
26 checks passed
@tatoalo tatoalo deleted the posthog-code/auto-bundle-prose-skill-references branch July 13, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant