Skip to content

Commit 6db2e55

Browse files
Copilotpelikhangithub-actions[bot]claude
authored
Add frontmatter skills support with activation-time gh skill install and engine wiring (#42426)
* Add frontmatter skills support with activation install and aw_info wiring Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Polish skills install logging and aw_info parse warnings Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Allow skills frontmatter GitHub Actions expressions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Tighten skills expression regex acceptance Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * docs(adr): add draft ADR-42426 for frontmatter skills support Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix skills frontmatter review follow-ups Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Document runtime skill detection alignment Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
1 parent 642165e commit 6db2e55

19 files changed

Lines changed: 686 additions & 43 deletions

.github/workflows/mattpocock-skills-reviewer.lock.yml

Lines changed: 100 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/mattpocock-skills-reviewer.md

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ permissions:
1313
contents: read
1414
pull-requests: read
1515
copilot-requests: write
16+
skills:
17+
- mattpocock/skills/diagnosing-bugs@801dca688564c529fa84f247f64472520d9ebe28
18+
- mattpocock/skills/tdd@801dca688564c529fa84f247f64472520d9ebe28
19+
- mattpocock/skills/improve-codebase-architecture@801dca688564c529fa84f247f64472520d9ebe28
20+
- mattpocock/skills/grill-with-docs@801dca688564c529fa84f247f64472520d9ebe28
21+
- mattpocock/skills/to-prd@801dca688564c529fa84f247f64472520d9ebe28
22+
- mattpocock/skills/codebase-design@801dca688564c529fa84f247f64472520d9ebe28
23+
- mattpocock/skills/domain-modeling@801dca688564c529fa84f247f64472520d9ebe28
1624

1725
sandbox:
1826
agent:
@@ -28,35 +36,6 @@ imports:
2836
min-integrity: approved
2937
- shared/otlp.md
3038
pre-agent-steps:
31-
- name: Upgrade gh CLI
32-
run: |
33-
bash "${RUNNER_TEMP}/gh-aw/actions/install_gh_cli.sh"
34-
GH_VERSION=$(gh --version | head -1 | grep -oP '\d+\.\d+\.\d+')
35-
echo "gh version: ${GH_VERSION}"
36-
REQUIRED="2.90.0"
37-
if ! printf '%s\n%s\n' "$REQUIRED" "$GH_VERSION" | sort -V -C; then
38-
echo "::error::gh ${GH_VERSION} is older than required ${REQUIRED} (gh skill support requires v2.90+)"
39-
exit 1
40-
fi
41-
- name: Install Matt Pocock skills
42-
env:
43-
GH_TOKEN: ${{ github.token }}
44-
run: |
45-
set -euo pipefail
46-
SKILLS_DST="${RUNNER_TEMP}/gh-aw/mattpocock-skills"
47-
mkdir -p "${SKILLS_DST}"
48-
# Install only the skills referenced in this workflow's prompt, rather than
49-
# all published skills, to reduce install time and network overhead.
50-
for skill in diagnosing-bugs tdd improve-codebase-architecture grill-with-docs to-prd codebase-design domain-modeling; do
51-
gh skill install mattpocock/skills "${skill}" --dir "${SKILLS_DST}" --force
52-
done
53-
SKILL_COUNT=$(find "${SKILLS_DST}" -name "SKILL.md" | wc -l)
54-
echo "Installed ${SKILL_COUNT} skill(s):"
55-
find "${SKILLS_DST}" -name "SKILL.md" | head -20
56-
if [ "${SKILL_COUNT}" -eq 0 ]; then
57-
echo "::error::No SKILL.md files found after installing mattpocock/skills"
58-
exit 1
59-
fi
6039
- name: Pre-fetch PR diff
6140
env:
6241
GH_TOKEN: ${{ github.token }}

actions/setup/js/generate_aw_info.cjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ async function main(core, ctx) {
128128
awInfo.features = features;
129129
}
130130

131+
const skills = parseSkillsFromEnv(core);
132+
if (skills) {
133+
awInfo.skills = skills;
134+
core.info(`Configured frontmatter skills (${skills.length}): ${skills.join(", ")}`);
135+
}
136+
131137
// Include aw_context when the workflow was triggered by a caller that relayed
132138
// orchestration context via workflow inputs or repository_dispatch client payload.
133139
// Validates JSON format and structure before populating the context key in aw_info.json.
@@ -218,6 +224,38 @@ async function main(core, ctx) {
218224
}
219225
}
220226

227+
/**
228+
* Parse optional skills list from GH_AW_INFO_SKILLS.
229+
* @param {typeof import('@actions/core')} core
230+
* @returns {string[] | null}
231+
*/
232+
function parseSkillsFromEnv(core) {
233+
const skillsEnv = process.env.GH_AW_INFO_SKILLS;
234+
if (!skillsEnv) {
235+
return null;
236+
}
237+
try {
238+
const parsed = JSON.parse(skillsEnv);
239+
if (!Array.isArray(parsed)) {
240+
core.warning("GH_AW_INFO_SKILLS must be a JSON array, ignoring");
241+
return null;
242+
}
243+
const skills = [];
244+
for (const [index, value] of parsed.entries()) {
245+
if (typeof value === "string" && value.length > 0) {
246+
skills.push(value);
247+
continue;
248+
}
249+
core.warning(`Ignoring invalid GH_AW_INFO_SKILLS[${index}] value: ${JSON.stringify(value)}`);
250+
}
251+
return skills.length > 0 ? skills : null;
252+
} catch (err) {
253+
const message = err instanceof Error ? err.message : String(err);
254+
core.warning(`Failed to parse GH_AW_INFO_SKILLS: ${skillsEnv} (${message})`);
255+
return null;
256+
}
257+
}
258+
221259
core.info("Generated aw_info.json at: " + tmpPath);
222260
core.info(JSON.stringify(awInfo, null, 2));
223261

0 commit comments

Comments
 (0)