Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Apply the AI FIRST principle: never accept first-pass quality. Minimum 2 iterations. Read all output, improve every section. No shortcuts.
📋 Purpose
Master GitHub Agentic Workflows - the revolutionary approach to repository automation using AI-powered coding agents hosted in GitHub Actions. This skill provides comprehensive expertise in creating, securing, and operating agentic workflows that combine deterministic GitHub Actions infrastructure with AI-driven decision-making.
🎯 Core Concepts
What Are Agentic Workflows?
Agentic workflows are AI-powered workflows that can reason, make decisions, and take autonomous actions using natural language instructions. Unlike traditional workflows with fixed if/then rules, agentic workflows interpret context and adapt their behavior based on the situation they encounter.
Key Characteristics:
📝 Natural Language: Written in markdown instead of complex YAML
🧠 AI Understanding: Use AI to understand repository context (issues, PRs, code)
🎯 Context-Aware: Make decisions without explicit conditionals
🔄 Adaptive: Respond differently to different situations
Analyze this issue and provide helpful context based on the content and situation.
Continuous AI Pattern
Agentic workflows enable Continuous AI - systematic, automated application of AI to software collaboration:
✅ Keep documentation current automatically
✅ Improve code quality incrementally
✅ Intelligently triage issues and PRs
✅ Automate code review with context
✅ Generate insights from repository activity
🏗️ Workflow Structure
Anatomy of an Agentic Workflow
---
# YAML Frontmatter - Configuration
on: issues
permissions: read-all
tools:
github:
engine: copilot
---# Markdown Body - Natural Language Instructions
Analyze this issue and provide helpful triage information.
Consider:
- Issue content and context
- Related issues and PRs
- Historical patterns
- Repository conventions
Provide actionable recommendations.
Agent files: Interactive Copilot Chat agents for workflow creation
🔧 Tools and Model Context Protocol (MCP)
What is MCP?
Model Context Protocol (MCP) is a standardized protocol for connecting AI agents to external tools, databases, and services. It enables secure, controlled access to capabilities like GitHub APIs, file systems, and custom integrations.
The MCP Gateway is a transparent proxy that enables unified HTTP access to multiple MCP servers using different transport mechanisms (stdio, HTTP):
🔌 Protocol translation between transports
🔒 Server isolation and authentication
❤️ Health monitoring and error handling
🌐 Single HTTP endpoint for multiple backends
��️ Security Architecture
Defense-in-Depth Layers
flowchart TD
A["📝 Input"] --> B["🔍 Compile-Time Validation"]
B --> C["🏃 Runtime Isolation"]
C --> D["🔐 Permission Separation"]
D --> E["🌐 Network Controls"]
E --> F["🧹 Output Sanitization"]
F --> G["✅ Safe Actions"]
style A fill:#e1f5ff
style B fill:#fff3cd
style C fill:#f8d7da
style D fill:#d4edda
style E fill:#d1ecf1
style F fill:#f8d7da
style G fill:#d4edda
Security Principles
1. Minimal Permissions (Least Privilege)
Workflows run with read-only permissions by default. Write operations require explicit safe outputs:
permissions:contents:read# Read codeissues:read# Read issuespull-requests:read# Read PRs# No write permissions for AI job
2. Safe Outputs (Pre-Approved Actions)
AI generates structured output describing what it wants to create. Separate, permission-controlled jobs process these requests:
safe-outputs:create-issue:max:5# Limit: 5 issues per runcreate-comment:max:10create-pull-request:max:1
How It Works:
AI job runs with read-only permissions
AI generates JSON describing desired actions
Separate job with write permissions processes safe outputs
Human approval can be required for critical actions
3. Tool Allowlists
Explicitly declare which tools the AI can use:
tools:github:toolsets: [issues] # Only issue operationsedit:# Only file editing, no creation# web-fetch excluded - no web access
4. Network Restrictions
Control external network access:
network:defaults:true# Common development infrastructure# Or custom allowlist:allow:-github.com-api.github.com
---on:workflow_dispatchtools:github:steps:-name:GatherDatarun:|
gh api /repos/$REPO/issues > issues.json
---
Analyze the collected issue data and generate insights:-Identifytrends-Detectpatterns-Suggestimprovements-Createsummaryreport
Use Cases:
API data aggregation
Log analysis
Trend reporting
Audit workflows
4. DispatchOps - On-Demand Tasks
Trigger: Manual execution
---on:workflow_dispatch:inputs:scope:type:choiceoptions: [full, incremental]
---
Perform maintenance tasks based on scope:${{inputs.scope}}
---on:issues:types: [labeled]
pull_request:types: [labeled]
---
Thelabel"${{ github.event.label.name }}"wasadded.Take appropriate action based on the label:-priority:critical→Notifyteamimmediately-needs-review→Requestreviewers-breaking-change→Updatechangelog
Use Cases:
Priority-based workflows
Stage transitions
Specialized processing
Team coordination
7. MemoryOps - Stateful Workflows
Persistent storage between runs:
---on:dailytools:github:cache-memory:id:metrics-tracking---
Track metrics over time using memory:1.Loadpreviousmetricsfrommemory2.Collectcurrentmetrics3.Calculatetrendsandchanges4.Storeupdatedmetrics5.Generatetrendreport
Memory Types:
cache-memory: Configurable retention via retention-days (GitHub Actions cache, eviction-dependent availability)
---on:issues:types: [opened]
tools:github:toolsets: [projects, issues]
safe-outputs:update-project:github-token:${{secrets.GH_AW_PROJECT_GITHUB_TOKEN}}---
Analyze this issue and update the project board:1.Determineappropriateproject2.Setstatusfield(Backlog/Todo/InProgress)3.Setpriorityfield(Critical/High/Medium/Low)4.Setteamfieldbasedoncontent5.Addcustomfieldvalues
Use Cases:
Content-based routing
AI-driven priority estimation
Automated status transitions
Team assignment
10. SideRepoOps - Separate Automation
Run workflows from a separate repository targeting your main codebase:
---on:push:paths: [specs/**.md]
tools:github:edit:---
Update specifications and sync to implementations:1.ValidateRFC2119 keywords(MUST,SHALL,SHOULD,MAY)2.Checkforbreakingchanges3.Updateconsumingimplementations4.CreatesynchronizationPRs
12. TaskOps - Scaffolded Improvements
Three-phase improvement strategy:
# Phase 1: Research Agent---on:workflow_dispatch---Investigatethecodebaseandreportfindings.
# Phase 3: Implementation (developer assigns to Copilot)# Developer assigns approved issues to @copilot
13. TrialOps - Isolated Testing
Test workflows in temporary repositories:
---on:workflow_dispatchtools:github:---
Create a trial repository and test the workflow:1.Createtemporaryprivaterepo2.Runworkflowsafely3.Captureresults4.Reportfindings5.Deletetrialrepo
🔄 Orchestration Patterns
Orchestrator/Worker Design
Coordinate multiple workflows toward a shared goal:
# orchestrator.md - Dispatcher---on:weeklytools:github:---
Decide what work needs to be done and dispatch workers:1.Analyzerepositorystate2.Identifytasks3.DispatchworkerworkflowswithtrackerID4.Monitorprogress5.Aggregateresults
Paths are resolved relative to the workflow file. At compile time gh aw compile rewrites each import as a {{#runtime-import <path>}} directive in the generated .lock.yml, which is then inlined into the prompt at run-time. Imports are the preferred way to factor shared rules out of individual workflows — see this repo's .github/prompts/README.md for a bounded-context example with 8 modules + a Tier-C extension.
Labels (Organization)
labels: [automation, ci, diagnostics]
Use with CLI:
gh aw status --label automation
Strict Mode (Enhanced Validation)
strict:true# Enforce additional security checks
🎨 AI Engines
Choose your AI coding agent:
GitHub Copilot (Default)
engine:copilot
Setup:
gh auth token # Requires PAT with copilot access
Claude by Anthropic
engine:claude
Setup:
gh secret set ANTHROPIC_API_KEY
Codex
engine:codex
Setup:
gh secret set OPENAI_API_KEY
🛠️ CLI Commands
Installation
gh extension install github/gh-aw
Workflow Management
# Compile workflow (generate .lock.yml)
gh aw compile
# Watch for changes and auto-compile
gh aw compile --watch
# Compile with strict validation
gh aw compile --strict
# Validate without compiling
gh aw compile --validate-only
Running Workflows
# Trigger workflow run
gh aw run issue-triage
# With inputs
gh aw run my-workflow --input organization=github
# Dry run (simulate without making changes)
gh aw run my-workflow --dry-run
Monitoring
# Check workflow status
gh aw status
# Filter by label
gh aw status --label automation
# Download and analyze logs
gh aw logs issue-triage --latest
# Check costs
gh aw logs --costs
Adding Workflows
# Interactive wizard
gh aw add-wizard github/repo/workflow.md
# Short form (for workflows/ directory)
gh aw add-wizard org/repo/workflow-name
# Direct add
gh aw add https://github.com/org/repo/blob/main/workflows/daily-status.md
Repository Initialization
# Initialize repository for agentic workflows
gh aw init
# Adds:# - VSCode settings and prompts# - Copilot agent files# - Workflow management helpers
Project Management
# Create GitHub Projects v2
gh aw project create "My Project"# Add field
gh aw project field add --name Priority --type single-select
# List projects
gh aw project list
📚 Workflow Creation Guide
Method 1: Coding Agent
In VS Code or CLI:
Create a workflow for GitHub Agentic Workflows using
https://raw.githubusercontent.com/github/gh-aw/main/create.md
The purpose of the workflow is to triage issues.
The agent will:
Create workflow markdown in .github/workflows/
Generate appropriate frontmatter
Write natural language instructions
Create pull request with changes
Method 2: AI Chatbot
Use agentic-chat assistant to structure task descriptions:
Copy agentic-chat instructions
Paste into AI chat interface
Describe your workflow goal
Get structured task description
Use in workflow
Method 3: Manual Creation
# 1. Create workflow file
vim .github/workflows/my-workflow.md
# 2. Compile to YAML
gh aw compile
# 3. Commit both files
git add .github/workflows/my-workflow.md
git add .github/workflows/my-workflow.lock.yml
git commit -m "Add my-workflow"
git push
Method 4: Remix Existing
Create a workflow for GitHub Agentic Workflows using
https://raw.githubusercontent.com/github/gh-aw/main/create.md
Remix the issue-triage.md workflow from github/gh-aw to add
automatic labeling based on issue content and priority.
🔐 Security Best Practices
✅ DO
Start with Minimal Permissions
permissions:contents:readissues:read
Use Safe Outputs for Write Operations
safe-outputs:create-comment:max:5
Enable Threat Detection
threat-detection:enabled:trueblock-on-threat:true
Limit Tool Access
tools:github:toolsets: [issues] # Only what's needed
✅ Creating GitHub Agentic Workflows
✅ Implementing AI-powered repository automation
✅ Setting up Continuous AI patterns
✅ Securing agentic workflows with defense-in-depth
✅ Designing orchestrator/worker patterns
✅ Implementing operational patterns (ChatOps, DailyOps, etc.)
✅ Configuring MCP tools and integrations
✅ Setting up safe inputs and safe outputs
✅ Managing workflow memory and state
✅ Optimizing workflow costs and performance
✅ Troubleshooting workflow issues
✅ Migrating from traditional GitHub Actions
✅ Implementing cross-repository automation
✅ Setting up project board automation
✅ Creating security scanning workflows
📝 Key Takeaways
Core Concepts
Agentic = Context-Aware Decision Making
AI interprets natural language instructions
Adapts behavior based on situation
No explicit conditionals needed
Security Through Layers
Read-only permissions for AI
Safe outputs for write operations
Threat detection and sanitization
Network controls and tool limits
Natural Language + Configuration
YAML frontmatter for technical settings
Markdown for task descriptions
Compiled to GitHub Actions YAML
Continuous AI Pattern
Systematic AI application
Incremental improvements
Automated intelligence
Best Practices
✅ Start simple, iterate based on results
✅ Use least privilege permissions
✅ Enable safe outputs for write operations
✅ Monitor costs and optimize
✅ Test in dry run mode first
✅ Choose appropriate operational pattern
✅ Document workflow purpose and design
✅ Review AI decisions regularly
Security Imperatives
🔒 Minimal permissions by default
🔒 Safe outputs over direct writes
🔒 Threat detection enabled
🔒 Network restrictions applied
🔒 Regular security audits
🔒 Incident response plan
Skill Version: 1.0.0 Last Updated: 2026-02-11 Maintained by: Hack23 AB License: Apache-2.0
🌐 Multi-Language Translation Pattern
Problem: API Data in Single Language
When building multi-language content from APIs that return data in only one language (e.g., Swedish Riksdag API), automated scripts can translate UI chrome but cannot translate dynamic content. Only LLMs can provide natural, context-aware translations.
🔗 Integration with Riksdagsmonitor agentic workflows
This gh-aw skill is applied by the 14 agentic news workflows in .github/workflows/news-*.md. Their domain contract (analysis-artifact product, gate, article contract) lives in: