Agent skill

matrix-distribution

Parallelize operations across dynamic target lists using GitHub Actions matrix strategies with failure isolation, rate limiting, and conditional logic.

Stars 1
Forks 2

Install this agent skill to your Project

npx add-skill https://github.com/adaptive-enforcement-lab/claude-skills/tree/main/plugins/patterns/skills/matrix-distribution

SKILL.md

Matrix Distribution

When to Use This Skill

Poor Fit

  • Sequential operations where order matters
  • Operations with shared state between targets
  • When total job count would exceed GitHub Actions limits (256)

Implementation

Dynamic Matrix

Generate the target list in a discovery stage:

See examples.md for detailed code examples.

Failure Isolation

Prevent one failure from canceling other jobs:

yaml
strategy:
  matrix:
    target: ${{ fromJson(needs.discover.outputs.targets) }}
  fail-fast: false  # Critical: continue processing other targets

Rate Limiting

Control concurrency to avoid API rate limits:

yaml
strategy:
  matrix:
    target: ${{ fromJson(needs.discover.outputs.targets) }}
  max-parallel: 10  # Limit concurrent jobs

Examples

See examples.md for code examples.

References

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results