Skip to content

[refactoring] Extract Copilot PR Analysis Base Setup into shared component #17748

@github-actions

Description

@github-actions

Skill Overview

Four workflows perform Copilot PR analysis using an identical combination of tools: shared/copilot-pr-data-fetch.md (already shared), repo-memory with standardized config structure, github: toolsets: [default], edit:, and bash: ["*"]. The repo-memory configuration is particularly repetitive — each workflow has the same 102400 max-file-size and ["*.json", "*.jsonl", "*.csv", "*.md"] file-glob pattern. A shared base component would bundle these common elements.

Current Usage

This skill appears in the following workflows:

  • copilot-pr-nlp-analysis.md (repo-memory branch: memory/nlp-analysis)
  • copilot-pr-prompt-analysis.md (repo-memory branch: memory/prompt-analysis)
  • copilot-agent-analysis.md (repo-memory branch: memory/copilot-agent-analysis)
  • copilot-pr-merged-report.md (imports shared/copilot-pr-data-fetch.md)

Proposed Shared Component

File: .github/workflows/shared/copilot-pr-analysis-base.md

Configuration:

---
tools:
  github:
    toolsets: [default]
  edit:
  bash: ["*"]

imports:
  - shared/jqschema.md
  - shared/reporting.md
  - shared/copilot-pr-data-fetch.md
---

Markdown body (prompt guidance):

## Copilot PR Analysis Base

Pre-fetched Copilot PR data is available at `/tmp/gh-aw/pr-data/copilot-prs.json` (last 30 days, up to 1000 PRs from `copilot/*` branches).

### Historical Data with repo-memory

Each analysis workflow should store historical results in `repo-memory` for trend tracking.
Recommended repo-memory configuration (add inline to your workflow's frontmatter):

```yaml
tools:
  repo-memory:
    branch-name: memory/(your-analysis-name)
    description: "Historical (analysis type) results"
    file-glob: ["memory/(your-analysis-name)/*.json", "memory/(your-analysis-name)/*.jsonl",
                "memory/(your-analysis-name)/*.csv", "memory/(your-analysis-name)/*.md"]
    max-file-size: 102400  # 100KB

Common jq Queries

# Count total PRs
jq 'length' /tmp/gh-aw/pr-data/copilot-prs.json

# PRs from last 7 days
jq '[.[] | select(.createdAt >= "'"$(date -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v-7d '+%Y-%m-%dT%H:%M:%SZ')"'")]' /tmp/gh-aw/pr-data/copilot-prs.json

# Merged vs closed stats
jq 'group_by(.state) | map({state: .[0].state, count: length})' /tmp/gh-aw/pr-data/copilot-prs.json

**Usage Example**:

```yaml
imports:
  - shared/copilot-pr-analysis-base.md  # Replaces jqschema.md + reporting.md + copilot-pr-data-fetch.md

Impact

  • Workflows affected: 4 workflows
  • Lines saved: ~15–20 lines of repeated imports and tool config per workflow = ~60–80 lines total
  • Maintenance benefit: When copilot-pr-data-fetch.md is updated, all 4 analysis workflows automatically benefit through a single import change in copilot-pr-analysis-base.md; consistent tooling across all PR analysis workflows

Implementation Plan

  1. Create .github/workflows/shared/copilot-pr-analysis-base.md with bundled imports and prompt guidance
  2. Update copilot-pr-nlp-analysis.md to use the new shared component
  3. Update copilot-pr-prompt-analysis.md to use the new shared component
  4. Update copilot-agent-analysis.md to use the new shared component
  5. Update copilot-pr-merged-report.md to use the new shared component
  6. Run make recompile to regenerate all lock files
  7. Verify all workflows compile and run correctly

Related Analysis

This recommendation comes from the Workflow Skill Extractor analysis run on 2026-02-22.

See full analysis report in the linked discussion.

Generated by Workflow Skill Extractor

  • expires on Feb 24, 2026, 4:19 PM UTC

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions