Repository navigation
Description
Summary
Today, gh-aw makes it possible to verify that skills were installed/restored, but not whether a specific skill was actually invoked by the agent at runtime.
In practice, this makes it hard to answer a basic debugging question for workflows that use APM-imported skills:
Did the agent actually use
docs-check-style, or was the output only loosely similar to that skill?
What the docs currently show
The published docs appear to cover:
- how to import APM dependencies with
shared/apm.md, - how to audit runs with
gh aw auditandgh aw logs, and - observability for jobs, tokens, MCP usage, and network behavior.
But I could not find documentation that shows any of the following for skills:
- a run log entry that a named skill was selected or invoked,
- an audit field listing activated skills,
- an OTEL attribute for skill invocation, or
- a workflow artifact that maps review output back to a specific skill call.
What the runtime currently shows
Using a successful smoke test with:
engine: copilot,- a reusable workflow compiled with
gh-aw v0.79.6, - APM-imported public skills from
elastic/elastic-docs-skills, and - a private caller repo,
we can see all of the following in the logs:
1. APM install/restore is visible
The apm job clearly logs that the skills are resolved and integrated:
[>] Resolving elastic-docs-skills-docs-check-style...
[>] Resolving elastic-docs-skills-flag-jargon-skill...
[>] Resolving elastic-docs-skills-frontmatter-audit...
[>] Resolving elastic-docs-skills-content-type-checker...
...
|-- Skill integrated -> .agents/skills/
The agent job also clearly logs that the APM bundle is restored:
Download APM bundle artifact
Build bundle list
Restore APM packages
2. Inline skill restoration is visible
The runtime also logs inline skill extraction/restoration behavior, for example:
No inline skill markers found, skippingrestore_inline_skills.shsource directory not found — no inline skills to restore
3. But named skill invocation is not visible
What I could not find was a first-class runtime event like:
Invoking skill: docs-check-styleSelected skill: docs-content-type-checkerActivated skills: [docs-check-style, frontmatter-audit]- an audit JSON field showing successful skill calls
- OTEL span attributes for per-skill invocation
So the current debugging story seems to be:
- prove the skill files were present,
- inspect the agent output,
- infer whether the skill was probably used.
That works, but it leaves an observability gap.
Why this matters
This becomes especially important when debugging:
- prompt wording that asks the agent to use certain skills,
- differences between installed skills and actual behavior,
- regressions across gh-aw / engine versions,
- cases where output looks plausible but might only be coming from the base prompt,
- APM packaging vs invocation problems.
Without explicit skill invocation visibility, it is hard to distinguish:
- “the skill was installed but ignored,” from
- “the skill was used but its guidance did not materially change output.”
Related observations
There are already related issues around APM skill behavior, for example:
- Copilot agent ignores exact APM skill invocation form and still emits skill(name) #27555 —
Copilot agent ignores exact APM skill invocation form and still emits skill(name) - PR-context base-branch restore overwrites APM-restored .github/skills before Copilot starts #27566 —
PR-context base-branch restore overwrites APM-restored .github/skills before Copilot starts
Those issues also rely heavily on indirect evidence such as bundle contents, restored skill directories, and output shape.
Request
Could gh-aw expose explicit skill invocation visibility, ideally in one or more of these places?
Option 1: Agent/run logs
Emit a structured log line when a skill is invoked, for example:
[skills] invoked: docs-check-style
[skills] invoked: docs-frontmatter-audit
Option 2: Audit output
Include a field in gh aw audit --json, for example:
{
"skill_usage": [
{ "name": "docs-check-style", "status": "invoked" },
{ "name": "docs-frontmatter-audit", "status": "invoked" }
]
}Option 3: OpenTelemetry
Add span events or attributes for skill activation, such as:
gh-aw.skill.namegh-aw.skill.sourcegh-aw.skill.invoked=true
Option 4: Agent artifact metadata
Include a small machine-readable file in the agent artifact listing skills discovered vs invoked.
Minimum clarification requested
If explicit tracing already exists somewhere, could the docs point to it clearly?
If it does not exist, this issue is requesting that capability.
Thanks — the recent improvements around built-in GITHUB_TOKEN auth and APM packaging made this much easier to test, and this feels like the next missing piece in the debugging story.
Activity
pelikhan commentedon Aug 2, 2026
/scout investigate feasibility of this feature
github-actions commentedon Aug 2, 2026
🔭 Recon complete! Scout has charted the territory. Map ready! 🗺️
github-actions commentedon Aug 2, 2026
🔍 Scout Research Report
Triggered by
@github-actions[bot]Executive Summary
Feasibility is good, and notably better than the issue implies: gh-aw already has the parsing infrastructure needed for skill-invocation visibility, plus an existing precedent for exactly this kind of disambiguation. It just isn't wired up for the
Skilltool specifically. Options 1 (log line) and 2 (gh aw audit --jsonfield) are straightforward extensions of existing code. Option 3 (OTEL) is architecturally sanctioned but needs new instrumentation. Option 4 (artifact) is the most net-new work.Click to expand detailed findings
Research Findings
What exists today for skill installation (not invocation)
Skills are resolved from pinned
owner/repo@sharefs or local paths inpkg/workflow/skills_frontmatter.go, and inline skills are extracted at compile time (pkg/parser/inline_skill_extractor.go). At runtime,actions/setup/sh/restore_inline_skills.shcopies skill files into the engine-specific directory (.claude/skills,.codex/skills,.github/skills— seeGetEngineSkillDir,pkg/workflow/engine_config_dir.go:43). This is purely filesystem staging — it proves presence, never invocation, matching the gap described in the issue.The key enabler: generic tool-call parsing already exists
gh-aw already parses each engine's transcript into a structured
ToolCallInfo{Name, CallCount, MaxInputSize, MaxOutputSize, MaxDuration, OutputSample}model (pkg/workflow/metrics.go:16):pkg/workflow/claude_logs.go:349switches ontool_usecontent blocks, readingname/inputdirectly from the JSONL transcript.pkg/workflow/copilot_logs.go:196parses the sametool_useshape.pkg/workflow/codex_logs.goonly regex-matches free-texttool provider.method(...)lines — no structured JSON event. This is the weak link (see Gotchas).pkg/workflow/pi_logs.gohas a typedToolName/ParametersJSONL event.Critically, there is already a precedent for exactly this disambiguation problem. In
claude_logs.go:365-374,Bashcalls are special-cased: instead of aggregating all bash calls under one generic "bash" bucket, the code pullsinput.commandout and renames the entry to"bash_" + ShortenCommand(command)so each distinct command is trackable. The same pattern —if nameStr == "Skill" { skillName, _ := LookupStringPath(contentMap, "input", "skill"); prettifiedName = "skill_" + skillName }— would give named-skill visibility with a small, well-precedented diff. Today no such case exists;Skillisn't special-cased anywhere, and it isn't inbuiltInToolNames(pkg/workflow/mcp_config_validation.go:32), so it currently just falls into generic tool aggregation with no per-skill breakdown.gh aw audit --jsonis mature and already has an analogous fieldpkg/cli/audit.gosupports--jsonoutput.AuditData(pkg/cli/audit_report.go:27-61) already includesToolUsage []ToolUsageInfoandMCPToolUsage(with per-toolCallCount, servers, etc.). Addingskill_usage: [{name, status}]is a direct extension of an existing, tested pattern rather than new architecture.OTEL exists and is substantial
pkg/workflow/observability_otlp.goplus a versioned spec (specs/otel-observability-spec.md, v0.4.0) already defineobservability.otlpconfig, resource attributes, built-in spans, and GenAI/MCP span attributes. The spec explicitly reserves room for additive, namespaced attributes (§2.4), sogh-aw.skill.name/gh-aw.skill.invokedwould fit the existing convention — but no skill-specific attributes exist yet, and wiring them requires the same detection step as options 1/2.Recommendations
tool_useparsers to special-case theSkilltool the same wayBashis special-cased today, then surface the result both as a log line and as a newskill_usagefield inAuditData. This reuses proven code paths and touches the fewest new subsystems.Key Sources (in-repo)
pkg/workflow/claude_logs.go:349-384— tool_use parsing + existing Bash-command special-case precedentpkg/workflow/copilot_logs.go:196— Copilot tool_use parsingpkg/workflow/codex_logs.go— Codex regex-based log parsing (weaker signal)pkg/workflow/metrics.go:16—ToolCallInfostructpkg/cli/audit_report.go:27-61,pkg/cli/audit.go— existingAuditData/--jsonaudit infrastructurepkg/workflow/observability_otlp.go,specs/otel-observability-spec.md— existing OTEL infra and extension conventionpkg/workflow/skills_frontmatter.go,actions/setup/sh/restore_inline_skills.sh,pkg/workflow/engine_config_dir.go:43— current install/restore-only visibilitySuggested Next Steps
Skilltool special-case inclaude_logs.go(and the Copilot equivalent) mirroring theBashpattern, and confirm against a real Claude/Copilot run that theinputfield actually carries the skill name in the expected shape.SkillUsagetoAuditDataandgh aw audit --json, following the existingMCPToolUsagepattern.gh-aw.skill.name/gh-aw.skill.invokedOTEL span attributes per the existing extension convention in the spec.pelikhan commentedon Aug 2, 2026
@copilot add support for parsing out which skill was used (probably agent specific code) and surface it in a dedicated file, usage artifact, artifact summary file, then in the audit