| name | GitHub Agentic Workflows Continuous AI Patterns |
| description | Comprehensive guide for continuous AI workflows including triage, review, maintenance, monitoring, scheduling strategies, event-driven automation, human-in-the-loop patterns, and feedback loops |
| license | Apache-2.0 |
| version | 2.0.0 |
| last_updated | "2026-04-02T00:00:00.000Z" |
| tags | ["github-agentic-workflows","continuous-ai","workflow-patterns","automation","triage","code-review","maintenance","monitoring","scheduling","event-driven","human-in-the-loop","feedback-loops"] |
🔄 GitHub Agentic Workflows Continuous AI Patterns
🔴 AI FIRST Quality Principle
Apply the AI FIRST principle: never accept first-pass quality. Minimum 2 iterations. Read all output, improve every section. No shortcuts.
📋 Overview
This skill provides comprehensive patterns for implementing Continuous AI workflows with GitHub Agentic Workflows. Continuous AI extends CI/CD principles to AI-powered automation, enabling agents to continuously triage issues, review code, maintain repositories, and monitor systems with minimal human intervention.
What is Continuous AI?
Continuous AI is the practice of deploying AI agents that run continuously or on regular schedules to perform repetitive tasks, monitor systems, and maintain code quality without manual intervention:
- Continuous Triage: Automatically label, prioritize, and route issues and PRs
- Continuous Review: Automated code reviews on every PR
- Continuous Maintenance: Dependency updates, security patches, code refactoring
- Continuous Monitoring: System health, performance metrics, security alerts
- Feedback Loops: Learn from outcomes and improve over time
Why Continuous AI?
Traditional CI/CD focuses on build, test, and deploy. Continuous AI extends this to intelligent automation:
- ✅ 24/7 Operation: Agents work around the clock
- ✅ Instant Response: No waiting for human availability
- ✅ Consistency: Same quality standards applied every time
- ✅ Scalability: Handle thousands of issues, PRs, and alerts
- ✅ Cost Efficiency: Reduce manual work and accelerate development
- ✅ Knowledge Retention: Agents learn from history and feedback
🎯 Continuous AI Concept
The Continuous AI Loop
┌─────────────────────────────────────────────────────────────┐
│ CONTINUOUS AI LOOP │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. OBSERVE │
│ └─> Events (issues, PRs, commits, alerts) │
│ │
│ 2. ANALYZE │
│ └─> Context, patterns, history │
│ │
│ 3. DECIDE │
│ └─> Determine action (or escalate to human) │
│ │
│ 4. ACT │
│ └─> Execute action (label, review, fix) │
│ │
│ 5. LEARN │
│ └─> Collect feedback, update models │
│ │
│ 6. REPEAT │
│ └─> Back to OBSERVE │
│ │
└─────────────────────────────────────────────────────────────┘
Continuous AI Principles
- Autonomy: Agents make decisions independently within defined boundaries
- Observability: All actions are logged and auditable
- Reversibility: Actions can be undone if incorrect
- Human Oversight: Critical decisions require human approval
- Continuous Learning: Agents improve from feedback
- Graceful Degradation: Fall back to safer behavior on uncertainty
🏷️ Continuous Triage Pattern
Automatic Issue Labeling and Prioritization
name: Continuous Issue Triage
on:
issues:
types: [opened, edited]
schedule:
- cron: '0 */6 * * *'
permissions:
issues: write
contents: read
jobs:
triage-issues:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@v4
- name: Triage New Issues
uses: github/copilot-agent@v1
with:
agent: triage-agent
task: |
Analyze and triage all issues:
1. Classify by type (bug, feature, docs, security)
2. Assign priority (P0-critical, P1-high, P2-medium, P3-low)
3. Apply relevant labels
4. Detect duplicates
5. Auto-assign to appropriate team/person
6. Add to project board
Triage Agent Implementation
---
name: triage-agent
description: Automatically triage issues and PRs
tools:
- github-issue_read
- github-issue_write
- github-search_issues
- github-projects_write
---
You are an expert issue triage agent. Your goal is to efficiently categorize, prioritize, and route issues to the appropriate teams.
- **bug**: Runtime errors, crashes, incorrect behavior
- **enhancement**: New features or improvements
-
┌──────────────────┬──────────┬──────────┬──────────┬──────────┐
│ Type / Impact │ Critical │ High │ Medium │ Low │
├──────────────────┼──────────┼──────────┼──────────┼──────────┤
│ Security │ P0 │ P0 │ P1 │ P2 │
│ Bug (prod) │ P0 │ P1 │ P2 │ P3 │
│ Bug (dev) │ P1 │ P2 │ P3 │ P3 │
│ Enhancement │ P1 │ P2 │ P3 │ P3 │
│ Documentation │ P2 │ P3 │ P3 │ P3 │
│ Refactor │ P2 │ P3 │ P3 │ P3 │
└──────────────────┴──────────┴──────────┴──────────┴──────────┘
## Triage Steps
1. **Read issue content**: Title, description, labels, comments
2. **Classify**: Determine issue type based on content
3. **Assess impact**: Production vs. dev, users affected
4. **Assign priority**: Use decision matrix
5. **Apply labels**: Type + priority + additional context labels
6. **Detect duplicates**: Search for similar issues
7. **Assign owner**: Route to appropriate team or person
8. **Add to project**: Place in correct project board column
## Special Handling
### Security Issues
- Immediately label as 'security'
- Set priority to P0 or P1
- Assign to security team
- If vulnerability disclosure, create security advisory
- Do NOT comment sensitive details publicly
### Duplicates
- Search for similar issues using keywords
- If found, comment with link and close as duplicate
- Transfer conversation to original issue
### Invalid Issues
- Missing reproduction steps for bugs → Request more info
- Spam or off-topic → Close with explanation
- Question (not issue) → Convert to discussion
## Examples
### Example 1: Security Issue
Issue: "SQL Injection in user login"
Classification: security
Priority: P0-critical
Labels: security, bug, P0-critical
Assigned: security-team
Action: Create security advisory
### Example 2: Feature Request
Issue: "Add dark mode support"
Classification: enhancement
Priority: P2-medium
Labels: enhancement, ui, P2-medium
Assigned: frontend-team
Action: Add to backlog project
### Example 3: Bug with Reproduction
Issue: "App crashes when clicking save button"
Classification: bug
Priority: P1-high (production impact)
Labels: bug, P1-high, reproduction-provided
Assigned: backend-team
Action: Add to current sprint
Intelligent Duplicate Detection
class DuplicateDetector {
constructor(github) {
this.github = github;
}
async findDuplicates(issue) {
const keywords = this.extractKeywords(issue.title + ' ' + issue.body);
const searchQuery = `repo:${issue.repository} is:issue ${keywords.join(' OR ')}`;
const { data: searchResults } = await this.github.search.issuesAndPullRequests({
q: searchQuery,
per_page: 10,
});
const candidates = searchResults.items.filter(
item => item.number !== issue.number
);
const scored = candidates.map(candidate => ({
issue: candidate,
score: this.calculateSimilarity(issue, candidate),
}));
duplicates = scored.( s. > );
duplicates.( b. - a.);
}
() {
stopwords = ([
, , , , , , , ,
, , , , , ,
]);
words = text.()
.(, )
.()
.( word. > && !stopwords.(word));
[... (words)];
}
() {
titleSim = .(
issue1..(),
issue2..()
);
bodySim = .(
issue1..(),
issue2..()
);
labelSim = .(
issue1.,
issue2.
);
(titleSim * + bodySim * ) * ( + labelSim * );
}
() {
set1 = (str1.());
set2 = (str2.());
intersection = ([...set1].( set2.(x)));
union = ([...set1, ...set2]);
intersection. / union.;
}
() {
set1 = (labels1.( l.));
set2 = (labels2.( l.));
intersection = ([...set1].( set2.(x)));
union = ([...set1, ...set2]);
union. > ? intersection. / union. : ;
}
}
👀 Continuous Review Pattern
Automated Code Review on Every PR
name: Continuous Code Review
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
jobs:
code-review:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Checkout PR
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: AI Code Review
uses: github/copilot-agent@v1
with:
agent: code-reviewer
task: |
Review pull request #${{ github.event.pull_request.number }}:
Progressive Review Pattern
class ProgressiveReviewer {
constructor() {
this.levels = [
{
name: 'quick-scan',
timeout: 30,
checks: [
'syntax-errors',
'obvious-bugs',
'security-critical',
],
},
{
name: 'standard-review',
timeout: 120,
checks: [
'code-quality',
'performance',
'best-practices',
'security',
],
},
{
name: 'deep-analysis',
timeout: 300,
checks: [
'architecture',
'design-patterns',
'edge-cases',
'maintainability',
],
},
];
}
async reviewPR(pr) {
const findings = [];
for (const level of this.levels) {
console.log(`Running ${level.name}...`);
try {
const levelFindings = .(level, pr);
findings.(...levelFindings);
(.(levelFindings)) {
.();
;
}
} (error) {
.(, error);
;
}
}
.(findings);
}
() {
findings = [];
( check level.) {
checkFindings = .(check, pr);
findings.(...checkFindings);
}
findings;
}
() {
(check) {
:
.(pr);
:
.(pr);
:
.(pr);
:
[];
}
}
() {
findings.( f. === );
}
() {
seen = ();
unique = [];
sorted = findings.( {
severityOrder = { : , : , : , : };
severityOrder[a.] - severityOrder[b.];
});
( finding sorted) {
key = ;
(!seen.(key)) {
seen.(key);
unique.(finding);
}
}
unique;
}
}
🔧 Continuous Maintenance Pattern
Automated Dependency Updates
name: Continuous Maintenance
on:
schedule:
- cron: '0 2 * * 1'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check for Dependency Updates
id: updates
run: |
npm outdated --json > outdated.json || true
jq '[.[] | select(.wanted != .current)]' outdated.json > updates.json
- name: AI-Powered Update Decision
uses: github/copilot-agent@v1
with:
agent: maintenance-agent
Automated Code Refactoring
name: Refactor Bot
on:
schedule:
- cron: '0 3 * * 0'
jobs:
identify-refactoring-opportunities:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Static Analysis
run: |
# Find code smells
npx jscpd src/ --format json > duplication.json
npx complexity-report src/ --format json > complexity.json
npm test -- --coverage --json > coverage.json
- name: AI Refactoring Analysis
uses: github/copilot-agent@v1
with:
agent:
📊 Continuous Monitoring Pattern
System Health Monitoring
name: Continuous Monitoring
on:
schedule:
- cron: '*/15 * * * *'
permissions:
issues: write
jobs:
health-check:
runs-on: ubuntu-latest
steps:
- name: Check Production Health
id: health
run: |
# Health check endpoints
curl -f https://api.example.com/health > health.json
curl -f https://api.example.com/metrics > metrics.json
curl -f https://api.example.com/errors > errors.json
- name: AI Anomaly Detection
uses: github/copilot-agent@v1
with:
agent: monitoring-agent
task: |
Analyze system health data:
Anomaly Detection Algorithm
class AnomalyDetector {
constructor(historicalData) {
this.historicalData = historicalData;
this.baseline = this.calculateBaseline();
}
calculateBaseline() {
const values = this.historicalData.map(d => d.value);
return {
mean: this.mean(values),
stdDev: this.standardDeviation(values),
median: this.median(values),
p95: this.percentile(values, 95),
p99: this.percentile(values, 99),
};
}
detectAnomalies(currentData) {
const anomalies = [];
for (const point of currentData) {
const zScore = (point.value - this.baseline.mean) / ..;
(.(zScore) > ) {
anomalies.({
: point.,
: point.,
: ..,
zScore,
: .(zScore) > ? : ,
: point.,
});
} (.(zScore) > ) {
anomalies.({
: point.,
: point.,
: ..,
zScore,
: ,
: point.,
});
}
}
anomalies;
}
() {
trends = [];
( i = windowSize; i < timeSeriesData.; i++) {
= timeSeriesData.(i - windowSize, i);
values = .( d.);
{ slope, r2 } = .(values);
(r2 > && .(slope) > ) {
trends.({
: timeSeriesData[i].,
: slope > ? : ,
slope,
r2,
: r2,
: timeSeriesData[i].,
});
}
}
trends;
}
() {
values.( a + b, ) / values.;
}
() {
avg = .(values);
squareDiffs = values.( .(value - avg, ));
.(.(squareDiffs));
}
() {
sorted = [...values].( a - b);
mid = .(sorted. / );
sorted. % ===
? (sorted[mid - ] + sorted[mid]) /
: sorted[mid];
}
() {
sorted = [...values].( a - b);
index = (p / ) * (sorted. - );
lower = .(index);
upper = .(index);
weight = index % ;
sorted[lower] * ( - weight) + sorted[upper] * weight;
}
() {
n = values.;
x = .({ : n }, i);
y = values;
sumX = x.( a + b, );
sumY = y.( a + b, );
sumXY = x.( sum + xi * y[i], );
sumX2 = x.( sum + xi * xi, );
sumY2 = y.( sum + yi * yi, );
slope = (n * sumXY - sumX * sumY) / (n * sumX2 - sumX * sumX);
intercept = (sumY - slope * sumX) / n;
yMean = sumY / n;
ssRes = y.( {
predicted = slope * x[i] + intercept;
sum + .(yi - predicted, );
}, );
ssTot = y.( sum + .(yi - yMean, ), );
r2 = - ssRes / ssTot;
{ slope, intercept, r2 };
}
}
⏰ Scheduling Strategies
Cron-Based Scheduling
on:
schedule:
- cron: '0 2 * * *'
- cron: '0 * * * *'
- cron: '*/15 * * * *'
- cron: '0 9 * * 1-5'
- cron: '0 0 1 * *'
Adaptive Scheduling
class AdaptiveScheduler {
constructor() {
this.metrics = {
issueRate: 0,
prRate: 0,
errorRate: 0,
};
}
calculateOptimalInterval() {
const baseIntervals = {
triage: 360,
review: 60,
monitoring: 15,
};
const activityMultiplier = this.calculateActivityMultiplier();
return {
triage: Math.max(30, baseIntervals.triage / activityMultiplier),
review: Math.max(15, baseIntervals.review / activityMultiplier),
monitoring: Math.max(5, baseIntervals.monitoring / activityMultiplier),
};
}
calculateActivityMultiplier() {
issueScore = .(.. + );
prScore = .(.. + );
errorScore = .(.. + ) * ;
+ (issueScore + prScore + errorScore) / ;
}
() {
alpha = ;
.. =
alpha * newMetrics. + ( - alpha) * ..;
.. =
alpha * newMetrics. + ( - alpha) * ..;
.. =
alpha * newMetrics. + ( - alpha) * ..;
}
}
🎛️ Event-Driven Automation
GitHub Events
on:
issues:
types:
- opened
- edited
- labeled
- assigned
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
pull_request_review:
types:
- submitted
issue_comment:
types:
- created
push:
branches:
- main
- 'release/**'
release:
types:
- published
workflow_run:
workflows:
- CI
types:
- completed
Event-Driven Agent Dispatch
class EventDispatcher {
constructor(agents) {
this.agents = agents;
this.eventHandlers = new Map();
this.registerHandlers();
}
registerHandlers() {
this.on('issues.opened', async (event) => {
await this.agents.triage.handleNewIssue(event.issue);
await this.agents.duplicate.checkDuplicate(event.issue);
});
this.on('pull_request.opened', async (event) => {
await this.agents.review.reviewPR(event.pull_request);
await this.agents.test.triggerTests(event.pull_request);
});
.(, (event) => {
...(event.);
});
.(, (event) => {
...(event.);
...(event.);
});
.(, (event) => {
(event.. === ) {
...(event.);
}
});
}
() {
(!..(eventType)) {
..(eventType, []);
}
..(eventType).(handler);
}
() {
eventType = ;
handlers = ..(eventType) || [];
.();
( handler handlers) {
{
(event);
} (error) {
.(, error);
}
}
}
}
👤 Human-in-the-Loop Patterns
Approval Gates
name: Critical Change with Approval
on:
workflow_dispatch:
inputs:
change_description:
description: 'What change to make'
required: true
jobs:
analyze-change:
runs-on: ubuntu-latest
steps:
- name: AI Analysis
id: analysis
uses: github/copilot-agent@v1
with:
agent: change-analyzer
task: |
Analyze the proposed change: "${{ inputs.change_description }}"
Provide:
1. Impact assessment
2. Risk level (low/medium/high/critical)
3. Affected systems
4. Rollback plan
5. Recommendation
Feedback Collection
name: Collect Agent Feedback
on:
issue_comment:
types: [created]
jobs:
check-feedback:
if: contains(github.event.comment.body, '@agent-feedback')
runs-on: ubuntu-latest
steps:
- name: Parse Feedback
id: feedback
run: |
# Extract feedback sentiment
if [[ "${{ github.event.comment.body }}" =~ "👍" ]]; then
echo "sentiment=positive" >> $GITHUB_OUTPUT
elif [[ "${{ github.event.comment.body }}" =~ "👎" ]]; then
echo "sentiment=negative" >> $GITHUB_OUTPUT
else
echo "sentiment=neutral" >> $GITHUB_OUTPUT
fi
- name: Store Feedback
run: |
# Store feedback for model training
cat << EOF > feedback.json
{
"issue": ${{ github.event.issue.number }},
"comment": ${{ github.event.comment.id }},
"sentiment": "${{ steps.feedback.outputs.sentiment }}",
"text": "${{ github.event.comment.body }}",
"timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
}
EOF
curl -X POST https://feedback-api.example.com/collect \
-H "Content-Type: application/json"
🔁 Feedback Loops
Performance Feedback
class FeedbackCollector {
constructor() {
this.metrics = {
accuracy: [],
latency: [],
satisfaction: [],
};
}
async collectFeedback(agentAction) {
const feedback = {
actionId: agentAction.id,
timestamp: new Date().toISOString(),
agent: agentAction.agent,
action: agentAction.action,
outcome: await this.measureOutcome(agentAction),
};
await this.storeFeedback(feedback);
this.updateMetrics(feedback);
if (this.shouldRetrain()) {
await this.triggerRetraining();
}
return feedback;
}
async measureOutcome(agentAction) {
switch (agentAction.) {
:
.(agentAction);
:
.(agentAction);
:
;
}
}
() {
issue = .(action.);
initialLabels = (action.);
currentLabels = (issue..( l.));
correctLabels = [...currentLabels].( initialLabels.(l));
accuracy = correctLabels. / initialLabels.;
{
accuracy,
: initialLabels. - correctLabels.,
};
}
() {
pr = .(action.);
reviewComments = action.;
helpful = ;
unhelpful = ;
( comment reviewComments) {
reactions = .(comment.);
helpful += reactions[] || ;
unhelpful += reactions[] || ;
}
satisfaction = helpful / (helpful + unhelpful + );
{
satisfaction,
helpful,
unhelpful,
};
}
() {
(feedback.?. !== ) {
...(feedback..);
}
(feedback.?. !== ) {
...(feedback..);
}
( key .) {
(.[key]. > ) {
.[key] = .[key].(-);
}
}
}
() {
recentAccuracy = ...(-);
avgAccuracy =
recentAccuracy.( a + b, ) / recentAccuracy.;
avgAccuracy < ;
}
() {
.();
...({
: ,
: ,
: ,
: ,
: {
: ,
: .(.()),
},
});
}
() {
{
: {
: .(..),
: .(..),
},
: {
: .(..),
: .(..),
},
};
}
() {
values.( a + b, ) / values.;
}
() {
avg = .(values);
squareDiffs = values.( .(v - avg, ));
.(.(squareDiffs));
}
}
🎓 Related Skills
- gh-aw-security-architecture: Security for continuous AI
- gh-aw-mcp-configuration: MCP server configuration
- gh-aw-tools-ecosystem: Available tools for agents
- github-actions-workflows: CI/CD workflows
📚 References
🆕 Agent Factory Patterns (Lessons from github/gh-aw)
Proven Workflow Categories
The GitHub Next team operates 100+ agentic workflows. Key categories:
| Category | Examples | Impact |
|---|
| Issue Triage | Auto-label, auto-assign, duplicate detection | Instant response to new issues |
| Code Quality | Code Simplifier, Dead Code Remover, Typist | Continuous incremental improvement |
| Documentation | Doc Healer, Doc Updater, Glossary Maintainer | Always-current docs |
| Security | Red Team Agent, Secrets Analysis, Malicious Code Scan | Daily security posture |
| Metrics | Code Metrics, Token Consumption, Performance Summary | Data-driven decisions |
| Analytics | Session Insights, PR NLP Analysis, Prompt Clustering | Meta-analysis of AI behavior |
| Project Coordination | Plan Command, Discussion Task Miner | 67% PR merge rate |
Key Insights
- Specialized agents > generic agents — Customize for your repo context
- Incremental > heroic — Small daily improvements compound over time
- Observability is essential — Meta-analyze agent behavior patterns
- Schedule staggering — Avoid resource contention with varied cron times
- Merge rate matters — Track accepted vs. rejected agent PRs
Multi-Agent Coordination
# Pattern: Sequential task chaining
# Step 1: Task Miner discovers work from discussions
# Step 2: Plan Command decomposes into sub-issues
# Step 3: Copilot Coding Agent implements each sub-issue
# Step 4: Code review and merge
# Verified causal chain example:
# Discussion #7631 → Issue #8058 → PR #8110 (merged)
✅ Remember
- ✅ Design agents for continuous 24/7 operation
- ✅ Use adaptive scheduling based on repository activity
- ✅ Implement event-driven dispatch (issues, PRs, comments)
- ✅ Add human approval gates for critical operations
- ✅ Monitor agent merge rates as quality signal
- ✅ Specialize agents — generic agents underperform
- ✅ Incremental improvements compound over time
- ✅ Meta-analyze agent behavior (NLP, clustering, session insights)
- ✅ Stagger schedules to avoid contention
- ✅ Log all actions for audit trail
Last Updated: 2026-04-02
Version: 2.0.0
License: Apache-2.0
🔗 Integration with Riksdagsmonitor agentic workflows
This gh-aw skill is applied by the 11 agentic news workflows in .github/workflows/news-*.md. Their domain contract (analysis-artifact product, gate, article contract) lives in:
Upstream gh-aw docs (v0.69.3): abridged · complete · agentic-workflows blog series · source repo · GitHub CLI manual.