Skip to content

[refactoring] Extract standard repo-memory configuration into parametrized shared component #24076

@github-actions

Description

@github-actions

Skill Overview

20 workflows share a near-identical repo-memory configuration pattern for persisting historical analysis data in a memory/ branch. The configuration is boilerplate (same file-glob extensions, same max-file-size: 102400) with only the branch-name and description varying. Extracting this into a parametrized shared component (shared/repo-memory-standard.md) would eliminate ~7–8 lines per workflow and establish a consistent standard for historical memory branches.

Current Pattern

Every affected workflow manually repeats this block:

tools:
  repo-memory:
    branch-name: memory/<unique-slug>
    description: "Historical <analysis-type> data"
    file-glob:
      - "memory/<unique-slug>/*.json"
      - "memory/<unique-slug>/*.jsonl"
      - "memory/<unique-slug>/*.csv"
      - "memory/<unique-slug>/*.md"
    max-file-size: 102400  # 100KB

Current Usage

This skill appears in the following workflows:

  • agent-performance-analyzer.md (memory/agent-performance)
  • audit-workflows.md
  • code-scanning-fixer.md
  • copilot-agent-analysis.md (memory/agent-analysis)
  • copilot-cli-deep-research.md
  • copilot-pr-nlp-analysis.md (memory/nlp-analysis)
  • copilot-pr-prompt-analysis.md
  • copilot-session-insights.md (memory/session-insights)
  • daily-cli-performance.md
  • daily-copilot-token-report.md (memory/token-metrics)
  • daily-news.md
  • daily-testify-uber-super-expert.md (memory/testify-expert)
  • deep-report.md
  • delight.md
  • discussion-task-miner.md
  • firewall-escape.md
  • metrics-collector.md
  • pr-triage-agent.md
  • security-compliance.md
  • workflow-health-manager.md

Proposed Shared Component

File: .github/workflows/shared/repo-memory-standard.md

---
# Standard Repo-Memory Configuration
# Provides a standardized repo-memory setup for workflows that need historical data persistence.
#
# Usage:
#   imports:
#     - uses: shared/repo-memory-standard.md
#       with:
#         branch-name: "memory/my-workflow"
#         description: "Historical my-workflow analysis results"

import-schema:
  branch-name:
    type: string
    required: true
    description: "Branch name for repo-memory storage (e.g. memory/my-workflow)"
  description:
    type: string
    required: true
    description: "Human-readable description of what is stored"
  max-file-size:
    type: integer
    default: 102400
    description: "Max file size in bytes (default: 100KB)"

tools:
  repo-memory:
    branch-name: $\{\{ github.aw.import-inputs.branch-name }}
    description: $\{\{ github.aw.import-inputs.description }}
    file-glob:
      - "$\{\{ github.aw.import-inputs.branch-name }}/*.json"
      - "$\{\{ github.aw.import-inputs.branch-name }}/*.jsonl"
      - "$\{\{ github.aw.import-inputs.branch-name }}/*.csv"
      - "$\{\{ github.aw.import-inputs.branch-name }}/*.md"
    max-file-size: $\{\{ github.aw.import-inputs.max-file-size }}
---

Usage Example:

# In copilot-pr-nlp-analysis.md
imports:
  - uses: shared/repo-memory-standard.md
    with:
      branch-name: "memory/nlp-analysis"
      description: "Historical NLP analysis results"

Impact

  • Workflows affected: 20 workflows
  • Lines saved: ~140–160 lines (7–8 lines per workflow)
  • Maintenance benefit: Ensures consistent file-glob extensions (json, jsonl, csv, md) across all workflows. Prevents drift where some workflows forget to include .jsonl or .csv in their glob patterns.

Implementation Plan

  1. Create shared component at .github/workflows/shared/repo-memory-standard.md
  2. Verify import-schema supports the file-glob interpolation syntax needed
  3. Migrate workflows with simple memory/<slug> pattern first (10 workflows)
  4. Migrate remaining 10 workflows
  5. Recompile all affected workflows with make recompile
  6. Test 2–3 affected workflows

Related Analysis

This recommendation comes from the Workflow Skill Extractor analysis run on 2026-04-02. See full analysis report in the discussions for details.

Generated by Workflow Skill Extractor ·

  • expires on Apr 4, 2026, 11:40 AM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions