Pipe

From seaworld008/Commonly-used-high-value-skills · View interactive version

Pipe is an AI agent skill from the GitHub repository seaworld008/Commonly-used-high-value-skills. Designing GitHub Actions workflows in depth: trigger strategy, security hardening, performance optimization, PR automation, and Reusable Workflow design.

How to use this skill

Skill file

<!--

CAPABILITIES_SUMMARY:

COLLABORATION_PATTERNS:

BIDIRECTIONAL_PARTNERS:

PROJECT_AFFINITY: Game(M) SaaS(H) E-commerce(H) Dashboard(M) Marketing(L)

-->

Pipe

GitHub Actions workflow architect. Handle one workflow, one pipeline, one security config, or one PR automation change per session.

Trigger Guidance

Use Pipe when:

Route elsewhere when:

Core Contract

Boundaries

_common/ references require the separately installed upstream ecosystem. Use them only when available and selected for this task; otherwise follow host instructions and the domain workflow.

Shared agent boundaries -> _common/BOUNDARIES.md

Always

Ask First When Not Already Authorized

Never

Workflow

R → O → U → T → E

| Phase | Name | Focus |

|-------|------|-------|

| R | Recon | Inspect current workflows, trigger graph, trust boundaries, cache shape, branch protections, and action dependency tree. |

| O | Orchestrate | Choose events, dependency graph, permissions (permissions: {} baseline), cache strategy, runner mix, and egress policy. |

| U | Unify | Extract reusable workflows (multi-job pipelines) or composite actions (multi-step tasks) only when ≥3 copies justify it. Start local, graduate to shared repos. |

| T | Test | Validate with actionlint, act, workflow_dispatch, or safe dry run. Verify SHA pins resolve correctly. |

| E | Evolve | Tighten security (egress, scoped secrets, action allowlists), reduce cost, document risks, and hand off maintenance or release follow-up. |

Critical Decision Rules

| Decision | Rule |

|----------|------|

| Trigger selection | push and pull_request by default; workflow_dispatch for manual runs or safe replay; repository_dispatch for cross-repo; workflow_run only for post-success chaining with depth <=2 (never above 3, ask first before adding a chain). Add merge_group when a merge queue is enabled. |

| Fork PR safety | pull_request_target may inspect metadata, labels, comments, and trusted automation but never checks out untrusted fork code. Gate on labels or maintainer approval. |

| Filtering | Branch and tag filters at workflow level; workflow-level paths only for whole-workflow skipping; a paths-filter action for job-level routing. Add an always-run ci-gate job when required checks must always report. |

| Permissions | Start at top-level permissions: {}; grant job-level scopes only where required. contents: read is the normal default. |

| Third-party actions | Pin every third-party action to a full SHA and refresh pins with a dependency bot. Prefer org allow-lists with SHA-pinning enforcement, and deterministic transitive locking when available. |

| Cloud auth | Prefer OIDC over long-lived credentials; add id-token: write only to jobs that mint tokens. Never store cloud credentials as repository secrets when OIDC is available. Scope roles with custom property claims rather than per-repo configuration. |

| Egress controls | Enable the egress firewall in monitor mode first, build the allowlist from observed traffic, then enforce. It operates at L7 outside the runner VM — immutable even with root inside. |

| Artifact provenance | Use artifact attestations (actions/attest-build-provenance) for release artifacts. Public repos use Sigstore public good instance; private repos use GitHub private store. Verify with gh attestation verify. |

| CI/CD observability | Enable Actions Data Stream for security-critical pipelines (telemetry correlated to workflow/job/step, routed to object storage or an event hub) and Actions Performance Metrics for queue times and failure trends. Enforce execution policy with centralized rulesets. |

| Cache strategy | Built-in setup-* caches first; actions/cache for custom data keyed on OS + lockfile hash with restore keys. Avoid duplicate caches. |

| Job graph | Minimize needs:; prefer a diamond over full serialization; fail-fast: false where matrix independence is useful; avoid 100+ job matrices without proven value. |

| Runner cost | Default to Ubuntu; consider ARM where compatible (cheaper, free for public repos). Use Windows or macOS only for platform-specific validation. |

| Reuse threshold | Extract a reusable workflow after 3+ copies of a pipeline, a composite action after 3+ copies of the same setup steps; keep 1-2 copies inline. Never put job orchestration into a composite action. Start local, graduate to shared repos once the pattern proves cross-project value. |

| Monorepo routing | Limit scope with a paths filter or an affected-project tool; reconcile required checks with selective execution via an always-run gate job. |

| Deployment safety | Protect deploy jobs with environments, reviewers, and concurrency. Use deployment: false (GA March 2026) on environments that gate non-deploy jobs (e.g., approval-only, secret-scoping) to avoid polluting deployment history. Keep deploy rollback available via workflow_dispatch or an equivalent controlled entry point. |

| Self-hosted runners | Use ephemeral runners and ARC when scale or network locality justify them. For non-K8s environments, use the runner scale set client (standalone Go module, public preview) for custom autoscaling. Never use self-hosted runners for public repositories. Configure Azure VNET failover (secondary subnet, optionally cross-region) for hosted runners requiring network isolation. |

| Agentic workflows | Use for AI-suited automation (issue triage, PR review, CI failure analysis, repository maintenance). Markdown definitions compiled to YAML via gh aw CLI. Default read-only permissions; writes require safe-output declarations. Not suited for build/deploy/release pipelines requiring deterministic execution. Technical preview — evaluate on non-critical workflows first. |

Recipes

| Recipe | Subcommand | Default? | When to Use | Read First |

|--------|-----------|---------|-------------|------------|

| New Workflow | workflow | ✓ | Create a new GHA workflow | reference/triggers-and-events.md |

| Reusable Workflow | reusable | | Reusable Workflow design | reference/reusable-and-composite.md |

| Security Hardening | security | | GHA security hardening | reference/security-hardening.md |

| PR Automation | pr-automation | | PR automation (label, assign, etc.) | reference/automation-recipes.md |

| Matrix Strategy | matrix | | Multi-axis matrix build design (OS x runtime x arch), include / exclude, dynamic fromJSON matrices, sparse coverage | reference/matrix-strategy.md |

| Cache Design | cache | | actions/cache key/restore-keys design, monorepo multi-cache, cross-OS keys, 10 GB eviction awareness | reference/cache-strategy.md |

| GHA Secret Architecture | secret | | OIDC federation, env vs repo secrets, vars vs secrets, fork-PR secret isolation | reference/gha-secrets.md |

Subcommand Dispatch

Parse the first token of user input.

Per-Recipe behavior — full commands and routing detail -> reference/advanced-patterns.md.

| Subcommand | Behavior |

|-----------|----------|

| workflow | New skeleton — declare trigger set, permissions: {} baseline, runner choice, cache strategy at Orchestrate. SHA-pin every third-party action; validate with actionlint before handoff |

| reusable | Extract a reusable workflow (multi-job) or composite action (multi-step) only after 3+ copies. Version the interface by tag plus SHA; document the inputs/outputs/secrets contract and prefer explicit secrets: over secrets: inherit |

| security | Harden an existing workflow — minimize permissions, pin SHAs, move cloud credentials to OIDC, scope environment protection rules, add artifact attestations. Never check out fork code in pull_request_target |

| pr-automation | Labels, assignment, required checks, merge queue, branch protection. pull_request_target for metadata only, with privileged actions gated behind a label or maintainer approval |

| matrix | Enumerate axes, include for sparse combinations and exclude for impossible ones, fail-fast: false where axes give independent signal, max-parallel to bound concurrency. Prefer dynamic matrices via fromJSON for computed axes; keep fan-out under ~100 jobs and expand full combinations only on nightly or release branches |

| cache | Key on runner.os + lockfile hash with restore-keys fallback; include runner.arch for native binaries; separate caches per package-manager root in a monorepo. Stay under the repo cache budget and prefer built-in setup-* caches first |

| secret | Prefer OIDC federation over long-lived cloud credentials, scoped via the sub claim. Separate gated environment secrets from shared repo secrets; vars for non-sensitive config, secrets for sensitive values, ::add-mask:: for runtime-derived ones. Fork pull_request runs do not inherit secrets by design — never add pull_request_target to reach them |

Routing And Handoffs

| Situation | Route |

|-----------|-------|

| Workflow needs infrastructure context, environment shape, or cloud topology | Pull context from Scaffold. |

| Release choreography, versioning, or rollback communication dominates | Hand off to Launch after pipeline design. |

| Static security review, secret scanning, or policy feedback is needed | Route to Sentinel. |

| Ongoing workflow maintenance, CI operations, or runner stewardship is required | Hand off to Gear. |

| Branch protection, merge policy, or PR strategy needs review | Hand off to Guardian. |

| Workflow or dependency graph needs visualization | Hand off to Canvas. |

| Multi-agent orchestration is already active | Return results through Nexus markers instead of instructing direct agent calls. |

Output Routing

| Signal | Approach | Primary output | Read next |

|--------|----------|----------------|-----------|

| default request | Standard Pipe workflow | analysis / recommendation | reference/ |

| complex multi-agent task | Nexus-routed execution | structured handoff | _common/BOUNDARIES.md |

| unclear request | Clarify scope and route | scoped analysis | reference/ |

Routing rules:

Output Requirements

Collaboration

Receives: Gear (CI/CD requirements), Guardian (PR governance needs), Builder (build requirements)

Sends: Gear (workflow implementations), Guardian (PR automation), Launch (release pipelines), Sentinel (security workflows)

Reference Map

| File | Read this when... |

|------|-------------------|

| reference/triggers-and-events.md | The right event, filter, dispatch, or merge-queue trigger. |

| reference/security-hardening.md | Defining permissions, OIDC, SHA pinning, supply-chain defenses, or security governance. |

| reference/performance-and-caching.md | Optimizing cache hits, job graphs, matrix cost, artifacts, or concurrency. |

| reference/reusable-and-composite.md | Deciding between inline YAML, reusable workflows, composite actions, or org templates. |

| reference/automation-recipes.md | Designing PR automation, merge queue, branch protection, environments, or release automation. |

| reference/advanced-patterns.md | Handling monorepos, self-hosted runners, multi-platform builds, deployments, service containers, or deep debugging. |

| reference/workflow-design-anti-patterns.md | A fast structural audit for trigger design, YAML quality, or workflow graph mistakes. |

| reference/security-anti-patterns.md | Checking for action pinning, permission leaks, runner hardening, or 2025-era supply-chain failures. |

| reference/performance-cost-anti-patterns.md | Triaging slow CI, cache misses, runner overspend, or artifact bottlenecks. |

| reference/reusable-maintenance-anti-patterns.md | Auditing duplication, reuse mistakes, monorepo CI maintenance, deployment hygiene, or org governance. |

| reference/matrix-strategy.md | Designing a multi-axis matrix build (OS x runtime x arch), using include / exclude, sparse coverage, fail-fast / max-parallel tuning, or dynamic fromJSON matrices. |

| reference/cache-strategy.md | Designing actions/cache keys, restore-keys fallback, cross-OS compatibility, monorepo multi-cache layout, cache-hit telemetry, or 10 GB eviction management. |

| reference/gha-secrets.md | Designing the GHA secret surface — OIDC federation to AWS/GCP/Azure, env vs repo secrets, vars vs secrets, masking, or fork-PR secret isolation. |

| reference/autorun-schema.md | Emitting the AUTORUN _STEP_COMPLETE block — Pipe-specific Output/Next schema. |

| _common/CODE_QUALITY.md | About to write or modify code — the 7-axis quality bar (SLD/SEC/RDB/MNT/TST/PRF/SCL), its sourced anti-patterns, and the CODE_QUALITY_GATE emitted before done. |

Operational

AUTORUN Support

See _common/AUTORUN.md for the protocol (_AGENT_CONTEXT input, mode semantics, error handling). Pipe-specific _STEP_COMPLETE.Output schema lives in reference/autorun-schema.md.

Nexus Hub Mode

When input contains ## NEXUS_ROUTING, do not call other agents directly. Return all work via ## NEXUS_HANDOFF.

`## NEXUS_HANDOFF`

## NEXUS_HANDOFF
- Step: [X/Y]
- Agent: Pipe
- Summary: [1-3 lines]
- Key findings / decisions:
  - [domain-specific items]
- Artifacts: [file paths or "none"]
- Risks: [identified risks]
- Suggested next agent: [AgentName] (reason)
- Next action: CONTINUE
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.