Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Created December 7, 2025 16:09
Show Gist options
  • Select an option

  • Save johnlindquist/dd3bae164f148d3f4f870b186e64bc31 to your computer and use it in GitHub Desktop.

Select an option

Save johnlindquist/dd3bae164f148d3f4f870b186e64bc31 to your computer and use it in GitHub Desktop.
Microsoft AI Dev Days Talk: The Automation Architect - Building Self-Organizing AI Workflows

The Automation Architect: Building Self-Organizing AI Workflows

Microsoft AI Dev Days Talk Outline

Duration: 15-20 minutes + demos Presenter Perspective: The Automation Architect


Hook (1 minute)

"What if your scripts could decide they need help?"

Open with a live demo: A simple bash script encounters an error, automatically escalates to an AI agent, gets a fix, applies it, and continues—all without human intervention.

The shift: We're not just writing code anymore. We're writing instructions for systems that can think about their own limitations.


Section 1: The New Software Paradigm (3 minutes)

Key Points:

  • Software = Instructions + Tools (not just code)
  • The skill shift: Learning tools → Creating instructions
  • AI agents are the new runtime

The Markdown Agent Pattern:

---
command: copilot
model: gpt-4o
---
Analyze this error and suggest a fix:
{{ error_output }}

Demo Idea: Show how a .md file IS the program. Run ma fix.copilot.md --error_output "$(cat error.log)" and watch it solve a real problem.


Section 2: Escalation Patterns (4 minutes)

The Escalation Hierarchy:

Level 1: Fast & Cheap (copilot --model gpt-4o-mini)
    ↓ on failure/uncertainty
Level 2: Capable (copilot --model gpt-4o)
    ↓ on complex reasoning needed
Level 3: Expert (claude --model opus)
    ↓ on multi-file/architectural
Level 4: Multi-Agent Council

Key Patterns:

1. Confidence-Based Escalation

# First try: fast model
result=$(ma quick-check.copilot.md --task "$TASK")

# Check confidence
if echo "$result" | grep -q "UNCERTAIN"; then
    # Escalate to smarter model
    result=$(ma deep-analysis.claude.md --task "$TASK")
fi

2. Error-Triggered Escalation

# Try simple fix
if ! ma simple-fix.copilot.md --error "$ERROR"; then
    # Escalate with full context
    ma complex-fix.claude.md --error "$ERROR" --context "$(git diff)"
fi

3. Complexity Detection

  • Line count heuristics
  • File count thresholds
  • Dependency graph depth
  • Time-based escalation (if fast model takes too long → escalate)

Demo Idea: The Escalation Pipeline

Show a script that:

  1. Receives a bug report
  2. Tries a quick copilot fix
  3. Detects it failed
  4. Automatically escalates to Claude with more context
  5. Applies the fix and verifies

Section 3: Error Detection & Intelligent Recovery (3 minutes)

The Self-Healing Pattern:

#!/bin/bash
MAX_RETRIES=3
AGENT="fix.copilot.md"

for i in $(seq 1 $MAX_RETRIES); do
    output=$(ma $AGENT --attempt $i --history "$HISTORY" 2>&1)
    exit_code=$?

    if [ $exit_code -eq 0 ]; then
        echo "Success on attempt $i"
        exit 0
    fi

    # Append failure to history for next attempt
    HISTORY="$HISTORY\n---\nAttempt $i failed:\n$output"

    # Escalate agent on repeated failures
    if [ $i -eq 2 ]; then
        AGENT="fix.claude.md"
    fi
done

Key Recovery Strategies:

  • Retry with memory: Each attempt includes previous failures
  • Strategy rotation: Try different approaches on each retry
  • Graceful degradation: Fall back to simpler solutions
  • Human escalation gate: Know when to STOP and ask

The "Ask or Continue" Decision:

---
command: copilot
---
Given this situation, respond with ONE of:
- CONTINUE: [next action] - if confident
- ESCALATE: [reason] - if need smarter model
- ASK: [question] - if need human input
- ABORT: [reason] - if unsafe to continue

Situation: {{ situation }}
Previous attempts: {{ history }}

Section 4: Multi-Agent Orchestration (4 minutes)

Pattern 1: Pipeline Composition

# Code review pipeline
ma analyze.copilot.md --file "$FILE" |
ma critique.claude.md |
ma synthesize.copilot.md > review.md

Pattern 2: Parallel Specialists

# Run specialists in parallel
ma security-scan.copilot.md --code "$CODE" &
ma performance-check.copilot.md --code "$CODE" &
ma style-review.copilot.md --code "$CODE" &
wait

# Synthesize results
ma synthesize.claude.md --security "$(cat security.out)" \
                        --perf "$(cat perf.out)" \
                        --style "$(cat style.out)"

Pattern 3: The Supervisor Pattern

---
command: claude
model: opus
---
You are a supervisor agent. You have these worker agents available:
- quick-fix.copilot.md: Fast, simple fixes
- deep-analysis.claude.md: Complex reasoning
- code-gen.copilot.md: Code generation

Given this task, output a PLAN as a sequence of agent calls:
{{ task }}

Demo Idea: The Code Review Orchestra

Show 3 agents reviewing code in parallel:

  1. Security specialist (finds vulnerability)
  2. Performance specialist (finds N+1 query)
  3. Style specialist (finds naming issues)
  4. Supervisor synthesizes into prioritized action items

Section 5: Workflow Composition (3 minutes)

Building Blocks:

[Trigger] → [Triage Agent] → [Specialist Agents] → [Synthesis] → [Action]

Real-World Workflow: The Intelligent PR Bot

#!/bin/bash
# On PR opened:

# 1. Quick triage
complexity=$(ma triage.copilot.md --diff "$(gh pr diff)")

# 2. Route based on complexity
case $complexity in
    "TRIVIAL")
        ma quick-review.copilot.md --diff "$(gh pr diff)"
        ;;
    "STANDARD")
        ma full-review.copilot.md --diff "$(gh pr diff)"
        ;;
    "COMPLEX")
        # Parallel deep review
        ma arch-review.claude.md --diff "$(gh pr diff)" &
        ma security-review.claude.md --diff "$(gh pr diff)" &
        wait
        ma synthesize.claude.md
        ;;
    "NEEDS_HUMAN")
        gh pr comment --body "This PR needs human review: $reason"
        ;;
esac

The Feedback Loop:

  • Log all decisions
  • Track success/failure rates per agent
  • Automatically adjust thresholds
  • Learn which escalation paths work

Section 6: The Architecture Principles (2 minutes)

1. Start Cheap, Escalate Smart

  • Default to fast/cheap models
  • Escalate based on signals, not assumptions
  • Every escalation should be logged and learnable

2. Agents Should Know Their Limits

  • Build uncertainty detection into prompts
  • Explicit "I don't know" is better than wrong answers
  • Define clear escalation triggers

3. Composition Over Complexity

  • Small, focused agents > one mega-agent
  • Unix philosophy: do one thing well
  • Pipe agents together

4. Always Have an Exit

  • Human escalation as final backstop
  • Time limits on autonomous operation
  • Audit trails for every decision

5. The Three Questions Every Agent Should Answer:

  1. Can I handle this? (capability check)
  2. Should I handle this? (safety check)
  3. Did I handle it correctly? (verification)

Closing: The Future is Orchestration (1 minute)

"The best developers won't be the ones who write the most code. They'll be the ones who orchestrate the best agent workflows."

The Takeaways:

  1. Markdown is your new runtime - Instructions are programs
  2. Escalation is a feature - Build it in from day one
  3. Composition beats complexity - Small agents, big workflows
  4. Know when to stop - The best automation knows its limits

Call to Action:

  • Start with ONE escalation pattern
  • Add it to your existing scripts
  • Watch your automation become intelligent

Demo Script Summary

Demo Duration Shows
Quick hook 30s Error → AI → Fix → Continue
Escalation pipeline 2min Copilot fails → Claude succeeds
Code review orchestra 2min Parallel specialists + synthesis
PR bot workflow 1min Triage → Route → Review

Resources

  • markdown-agent: npm install -g markdown-agent (or bun install -g markdown-agent)
  • GitHub Copilot CLI: gh extension install github/gh-copilot
  • Pattern library: [link to examples repo]

Speaker Notes

Audience Assumptions:

  • Familiar with CLI tools
  • Some experience with AI assistants
  • Interested in automation

Key Moments to Emphasize:

  1. The "software is instructions" paradigm shift
  2. Escalation is not failure—it's intelligence
  3. The supervisor pattern as the future of workflows
  4. Knowing when to stop is the hardest part

Potential Q&A Topics:

  • Cost management with escalation
  • Security concerns with autonomous agents
  • Testing agent workflows
  • Debugging multi-agent systems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment