Skip to content

feat: support local skill paths in frontmatter skills: with --from-local - #49115

Merged
pelikhan merged 8 commits into
mainfrom
copilot/add-support-for-local-paths
Jul 30, 2026
Merged

feat: support local skill paths in frontmatter skills: with --from-local#49115
pelikhan merged 8 commits into
mainfrom
copilot/add-support-for-local-paths

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Local skill paths (e.g. skills/rig, .github/skills/my-skill) were rejected by validation and unsupported at runtime, making local skill library development require a full publish-and-pin cycle.

Changes

  • pkg/workflow/skills_frontmatter.go — Added isLocalSkillRef (no @, not ${{) and updated validateSkillSpecValue to accept local paths alongside pinned remote refs
  • actions/setup/js/install_frontmatter_skills.cjs — Added matching isLocalSkillRef; buildSkillInstallCommand now routes local paths through --from-local, deriving the skill name from the last path component
  • pkg/parser/schemas/main_workflow_schema.json — Added local-path oneOf alternative to skills items (string and object forms)
  • add_skill_rewrite.go — Already handles gh aw add rewriting; local refs are promoted to owner/repo/path@sha on publish (no changes needed)

Example

skills:
  - skills/rig            # local path — works during development
  - .github/skills/infra  # also supported

At runtime this emits:

gh skill install skills/rig rig --from-local --agent <agent> --dir <skillDir> --force

On gh aw add, local refs are rewritten to owner/repo/skills/rig@<sha> so the published workflow is fully pinned.


Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 21.4 AIC · ⊞ 6.3K ·
Comment /souschef to run again

Copilot AI and others added 2 commits July 30, 2026 10:21
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan July 30, 2026 10:43
@pelikhan
pelikhan marked this pull request as ready for review July 30, 2026 10:46
Copilot AI review requested due to automatic review settings July 30, 2026 10:46
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot update instructions, documentation about how to handle local skills

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

Adds support for repository-local skill paths in workflow frontmatter.

Changes:

  • Accepts local skill paths in validation and schema.
  • Installs local skills using --from-local.
  • Adds Go and JavaScript coverage.
Show a summary per file
File Description
pkg/workflow/skills_frontmatter.go Recognizes local skill references.
pkg/workflow/skills_frontmatter_test.go Tests local reference validation.
pkg/parser/schemas/main_workflow_schema.json Adds local-path schema alternatives.
actions/setup/js/install_frontmatter_skills.cjs Builds local installation commands.
actions/setup/js/install_frontmatter_skills.test.cjs Tests local runtime installation.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

pkg/parser/schemas/main_workflow_schema.json:105

  • The object form has the same mismatch: skill: ./skills/my-skill is accepted by the Go/runtime implementation but fails schema validation, and traversal components remain allowed. Use the same optional-./, component-based pattern as the string form.
                    "pattern": "^\\.{0,2}[A-Za-z0-9_][A-Za-z0-9_./-]*$",
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment on lines +46 to +50
if (isLocalSkillRef(skillSpec)) {
const skillName = skillSpec.replace(/\\/g, "/").split("/").filter(Boolean).pop() || skillSpec;
return {
displaySpec: skillSpec,
args: ["skill", "install", skillSpec, skillName, "--from-local", ...agentArgs, "--dir", skillsDst, "--force"],
},
{
"type": "string",
"pattern": "^\\.{0,2}[A-Za-z0-9_][A-Za-z0-9_./-]*$",
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update instructions, documentation about how to handle local skills

Updated in 6e61e6b. I added local-skill handling docs to workflow instructions and references, including accepted local skills: paths (skills/name, .github/skills/name), --from-local install behavior, and when external refs must stay SHA-pinned.

@pelikhan

Copy link
Copy Markdown
Collaborator

/review

@pelikhan

Copy link
Copy Markdown
Collaborator

/matt

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

@copilot please run the pr-finisher skill, address the unresolved review feedback below, and rerun checks once updates are pushed.

Unresolved feedback to address (newest first):

Failed checks:

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 21.4 AIC · ⊞ 6.3K ·
Comment /souschef to run again

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

@github-actions

Copy link
Copy Markdown
Contributor

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🧪 Test Quality Sentinel Report

Test Quality Score: 85/100 — Excellent

Analyzed 10 test functions: 9 design, 1 implementation, 0 violation(s).

📊 Metrics (10 test functions)
Metric Value
Analyzed 10 (Go: 2, JS: 8)
✅ Design 9 (90%)
⚠️ Implementation 1 (10%)
Edge/error coverage 7/10 (70%)
Duplicate clusters 0
Inflation No (JS: 1.64:1, Go: 1.22:1)
🚨 Violations 0
📋 Test Breakdown
Test File Classification Notes
splits repo-level and path-level skill specs install_frontmatter_skills.test.cjs:68 design_test 3 assertions covering command building for different skill spec formats
treats specs without @ as local path refs install_frontmatter_skills.test.cjs:108 design_test Core invariant: local refs use --from-local
installs local path reference using --from-local install_frontmatter_skills.test.cjs:114 design_test 3 path variants tested
isLocalSkillRef returns true/false correctly install_frontmatter_skills.test.cjs:131 design_test 6 boundary cases: local, remote, expressions, empty
reads skill specs from env var and installs install_frontmatter_skills.test.cjs:141 design_test 4 assertions: exec call validation, summary output
omits --agent when no gh skill agent name install_frontmatter_skills.test.cjs:159 implementation_test Optional parameter edge case
records failures without throwing install_frontmatter_skills.test.cjs:168 design_test Error path: failure tracking, warnings
installs local path at runtime install_frontmatter_skills.test.cjs:181 design_test Integration-level runtime coverage
TestValidateFrontmatterSkills (15 subtests) skills_frontmatter_test.go:11 design_test Comprehensive schema validation: pinned/local/object forms, SHA/expression/token validation
TestParseRawSkillReferences_ParsesGitHubApp skills_frontmatter_test.go:210 design_test GitHub app parsing with 3 assertions

Verdict

passed. 90% design tests (threshold: ≥70%). No violations. Strong edge/error coverage for new local-path skill feature. Both test files under 2:1 inflation ratio.

🧪 Test quality analysis by Test Quality Sentinel · haiku45 · 22.9 AIC · ⊞ 8.4K ·
Comment /review to run again

@github-actions github-actions Bot 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.

✅ Test Quality Sentinel: 85/100. 90% design tests (threshold: 70%). No violations. Strong edge/error coverage for new local-path skill feature.

@github-actions github-actions Bot 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.

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Skills-Based Review 🧠

Applied /tdd and /codebase-design — requesting changes for a schema-vs-runtime mismatch and an undocumented edge case.

📋 Key Themes & Highlights

Issues Found

  • Schema mismatch: The JSON Schema pattern for local paths rejects ./skills/my-skill but every other layer (Go validation, JS runtime, docs, tests) accepts it. This will cause unexpected LSP/editor validation failures and silent inconsistency.
  • Ambiguous unpinned owner/repo: A bare owner/repo without @ is silently routed to --from-local, which will produce a confusing runtime error rather than a validation failure. The policy ("remote refs must include @") is expressed only as a comment, not enforced.

Positive Highlights

  • ✅ Clean symmetric implementation across Go, JavaScript, and JSON Schema
  • ✅ Good test coverage for isLocalSkillRef — comprehensive case matrix
  • ✅ Backward compatible; existing pinned remote refs are unaffected
  • ✅ Windows backslash normalisation in skill name derivation is a thoughtful touch

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 55.4 AIC · ⊞ 7K
Comment /matt to run again

@github-actions github-actions Bot 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.

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Verdict: Request changes

A security-relevant regression: unpinned remote skill specs (e.g. githubnext/awesome-skills) are now silently treated as local paths and installed with --from-local instead of being rejected for missing the required SHA pin. The schema also rejects the PR's own documented/tested local-path example (./skills/my-skill), so compilation would fail for that exact case despite passing unit tests (which stub the JS/Go functions directly, not the schema).

Themes
  • Correctness (blocking): isLocalSkillRef classifies any unpinned owner/repo string as local, removing the prior hard requirement that remote refs be pinned to a 40-char SHA. Anyone typo-ing @ or omitting the pin gets silent misbehavior instead of a validation error.
  • Correctness (blocking): JSON Schema pattern for local paths doesn't actually allow ./-prefixed paths, contradicting docs, JS tests, and Go tests that all assert ./skills/my-skill is a supported local form.
  • Maintainability (medium): skill name derivation from the last path segment risks silent overwrite collisions between differently-scoped local skills sharing a basename.

Sub-agent (grumpy-coder) did not return results in time; this review reflects independent analysis only.

🔎 Code quality review by PR Code Quality Reviewer · auto · 93.1 AIC · ⊞ 7.8K
Comment /review to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

[!WARNING]
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding....

Addressed both unresolved review threads in commit 409a6cd:

  • activation sparse checkout now includes top-level dirs for validated local skills: paths (so skills/rig exists for --from-local installs)
  • local skill path schema/validation now supports optional ./ and rejects traversal segments like ..

I also ran local validation via make agent-report-progress (including unit tests), plus parallel validation. CI on this new head still needs a maintainer re-trigger.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

@copilot please run the pr-finisher skill, address the failing checks below, and rerun the necessary tests once the branch is up to date.

Failed checks:

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 5.6 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

[!WARNING]
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding....

Addressed in 1bbdb56.

  • Fixed scripts/sync-compat.sh to use a BSD/GNU-compatible sed extractor (removes macOS grep -P failure in Build & Test).
  • Updated cache-dependent CLI tests to set the complete-download marker so they no longer attempt live gh artifact downloads.
  • Regenerated pkg/cli/data/agentic_workflows_fallback_aw_files.json to match .github/aw/*.md.

Validation run locally with make agent-report-progress passed (build, fmt, lint, test-unit, workflow drift checks). CI on this pushed head still needs a maintainer re-trigger.

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

Rationale: Adds local skill path support with schema + compiler + docs updates and tests. Currently has a merge conflict (mergeable: false, dirty) — needs rebase. Reviews are mixed (approved then changes requested, dismissed). Recommend rebasing before deeper review.

Generated by 🔧 PR Triage Agent · auto · 69.5 AIC · ⌖ 8.05 AIC · ⊞ 7.9K ·

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.1

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants