Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save johnlindquist/13c0f11903656295cef42f933a6ad5d7 to your computer and use it in GitHub Desktop.
Microsoft AI Dev Days Talk: Scripting Copilot - Piping Hot Intelligence (Problem-Solution Structure)

Scripting Copilot: Piping Hot Intelligence

Microsoft AI Dev Days Talk (15-20 min)


Core Concept

"Piping Hot Intelligence" - Fresh, ready-to-use AI straight from your terminal via Unix pipes.

Central Theme: Software = Instructions + Tools


ACT 1: THE HOOK (1-2 minutes)

Opening: The Mystery Command

Slide: A terminal with a single command

$ ma task.copilot.md

Say this:

"What if your markdown files could run AI? Not just document it. Not just describe it. Actually execute it."

Pause. Let it land.

Reveal the real magic:

$ git diff | copilot -p "review this"

The hook:

"Data goes in. Intelligence comes out. That fifty-year-old pipe operator now carries something entirely new. But first... let me show you the problems this solves."


ACT 2: MAIN CONTENT - Problem/Solution Deep Dive (12-15 minutes)

PROBLEM 1: "I'm Stuck in Interactive Mode" (3 min)

Slide: Developer frustration - waiting for prompts, clicking through menus

The Pain:

# This is interactive - can't script it
$ copilot
? What would you like help with?
> (typing... waiting... more typing...)
  • Can't automate
  • Can't pipe data
  • Can't batch process
  • Human has to babysit every request

SOLUTION: Non-Interactive Mode

# The -p flag changes everything
$ copilot -p "explain this error"

The before/after:

# BEFORE: Interactive, manual, slow
copilot
→ Type question
→ Wait for response
→ Manually copy output
→ Paste elsewhere

# AFTER: Non-interactive, scriptable, fast
copilot -p "explain this error" > analysis.txt

Key flags:

  • -p "prompt" - Non-interactive mode with prompt
  • -s - Silent mode (removes spinners, pure output)

Demo 1:

# Now you can script it
cat error.log | copilot -p "What went wrong here?" -s

# Chain it
npm test 2>&1 | copilot -p "Why is this failing?" -s

# Save it
git diff | copilot -p "Review for bugs" -s > review.md

"One flag. -p. That's all it takes to turn interactive AI into scriptable AI."


PROBLEM 2: "I'm Overpaying for Simple Tasks" (3 min)

Slide: Price comparison chart - showing API costs

The Pain:

  • Using the most powerful model for every request
  • Simple yes/no questions cost the same as deep analysis
  • No way to match task complexity to model capability
  • Budget evaporates on trivial classification

SOLUTION: Model Selection with --model

# Fast and cheap for simple tasks
copilot -p "Is this a bug or a feature request?" -s --model claude-haiku-4.5

# Balanced for most work
copilot -p "Review this function" -s --model claude-sonnet-4

# Maximum power for complex analysis
copilot -p "Architect this system" -s --model claude-opus-4.5

The Model Ladder:

Model Speed Cost Use Case
claude-haiku-4.5 Fast Low Triage, classification, simple Q&A
claude-sonnet-4 Balanced Medium Code review, debugging, daily tasks
claude-opus-4.5 Thorough High Architecture, security audits, deep analysis

Demo 2: Smart Escalation

# Use Haiku to decide if you need Opus
COMPLEXITY=$(echo "$TASK" | copilot -p "SIMPLE or COMPLEX? One word." -s --model claude-haiku-4.5)

if [ "$COMPLEXITY" = "COMPLEX" ]; then
  copilot -p "$TASK" -s --model claude-opus-4.5
else
  copilot -p "$TASK" -s --model claude-haiku-4.5
fi

"Haiku is 10x cheaper and 5x faster. Use the lightweight model to decide if you need the heavyweight."


PROBLEM 3: "I Don't Trust AI With My System" (3 min)

Slide: Security lock icons, permission boundaries

The Pain:

  • AI agents want to run arbitrary commands
  • No visibility into what tools get accessed
  • All-or-nothing permission models
  • Can't scope access to specific domains

SOLUTION: Permission Boundaries with --allow-tool

# Read-only: AI can only look, not touch
copilot -p "Analyze this code" -s --allow-tool 'Read'

# Git-scoped: Can run git commands, nothing else
copilot -p "Summarize recent commits" -s --allow-tool 'shell(git:*)'

# Npm-scoped: Can run npm, but not arbitrary shell
copilot -p "Fix linting errors" -s --allow-tool 'shell(npm:*)'

The Trust Ladder:

Level 1: Pure pipes (safest)
  cat code.ts | copilot -p "find bugs" -s
  → No tool access, just text in/out

Level 2: Scoped tools (controlled)
  copilot -p "check status" -s --allow-tool 'shell(git:*)'
  → Only git commands allowed

Level 3: Full autonomy (supervised)
  copilot -p "refactor auth" -s --allow-all-tools
  → Use sparingly, monitor closely

Demo 3:

# Safe code review - read-only
git diff | copilot -p "Security review" -s --allow-tool 'Read'

# Safe git operations - can't touch files directly
copilot -p "Create a branch from main for feature-x" -s --allow-tool 'shell(git:*)'

"The pipe doesn't grant permissions. You do. Every boundary is explicit."


PROBLEM 4: "My Pipelines Disappear After I Run Them" (3 min)

Slide: Terminal history scrolling away, lost commands

The Pain:

  • Complex flag combinations hard to remember
  • Copy-pasting from Slack/docs every time
  • No version control for prompts
  • Can't share patterns with team
  • Reinventing the wheel on every project

This leads to the resolution...


ACT 3: THE RESOLUTION - markdown-agent (3-4 minutes)

The Reveal

Slide: A markdown file icon with a play button

$ ma review.copilot.md

How it reads:

  • review = your task name
  • .copilot = run with copilot
  • .md = it's just markdown

SOLUTION: Capture Patterns as Files

---
model: claude-sonnet-4
allow-tool:
  - 'shell(git:*)'
  - Read
silent: true
---

Review these code changes for:
1. Bug risks
2. Performance issues
3. Security concerns

Prioritize by severity.

Usage:

git diff | ma review.copilot.md

Variables and Dynamic Content

---
model: claude-sonnet-4
args:
  - base_branch
  - focus_area
---

## Changes to Review
!`git diff {{ base_branch | default: "main" }}..HEAD`

## Focus
Review with emphasis on {{ focus_area | default: "all areas" }}.

For each change:
- Risk level (low/medium/high)
- Category (bug fix, feature, refactor)
- Concerns if any

Run with arguments:

ma pr-review.copilot.md --base_branch develop --focus_area security

The Complete Before/After

BEFORE (The Four Problems):

Problem 1: Interactive only         → Can't automate
Problem 2: One model fits all       → Wasting money
Problem 3: No permission control    → Security risk
Problem 4: Ephemeral commands       → Lost knowledge

AFTER (The Solutions):

Solution 1: -p flag                 → Scriptable AI
Solution 2: --model flag            → Right-sized intelligence
Solution 3: --allow-tool flag       → Explicit boundaries
Solution 4: markdown-agent          → Version-controlled prompts

The paradigm shift:

Old: Software = Code + Data
New: Software = Instructions + Tools

Your prompts are code now.
Version them. Test them. Ship them.

CLOSING (1 minute)

Call to Action

Your four steps today:

  1. First pipe: git diff | copilot -p "review" -s
  2. First escalation: Try --model claude-haiku-4.5 for triage
  3. First boundary: Add --allow-tool 'shell(git:*)'
  4. First file: Create one .copilot.md for a task you repeat

Resources

  • GitHub Copilot CLI: gh copilot
  • markdown-agent: github.com/johnlindquist/agents
  • This outline: [gist link]

Final Thought

Slide: A pipe symbol | with data flowing in, intelligence flowing out

"Four problems. Four flags. One new way of thinking. The pipe carried data for 50 years. Now it carries intelligence. Start piping."


TIMING GUIDE

Section Time Cumulative
Hook: Mystery command + pipe reveal 2 min 2 min
Problem 1: Interactive mode → -p flag 3 min 5 min
Problem 2: Overpaying → --model flag 3 min 8 min
Problem 3: Trust issues → --allow-tool 3 min 11 min
Problem 4: Lost commands → Setup for resolution 2 min 13 min
Resolution: markdown-agent reveal 4 min 17 min
Closing: Call to action 2 min 19 min

KEY TAKEAWAYS (One Slide)

Problem Flag/Solution Result
Can't script -p "prompt" Automation unlocked
Overpaying --model Right-sized cost
No trust --allow-tool Explicit boundaries
Lost patterns .copilot.md files Version-controlled AI

The equation: Software = Instructions + Tools


DEMO CHECKLIST

  • Terminal with large font (24pt minimum)
  • Git repo with staged changes for git diff demos
  • Sample error.log file with realistic errors
  • Pre-written .copilot.md recipe files
  • Test all pipes before talk
  • Backup: screenshots of each demo
  • Verify copilot CLI is installed and authenticated
  • Have fallback commands ready if live demo fails

DEMO FILES

review.copilot.md

---
model: claude-sonnet-4
allow-tool:
  - 'shell(git:*)'
  - Read
silent: true
---
Review this code for bugs, security issues, and performance concerns.
Prioritize findings by severity.

triage.copilot.md

---
model: claude-haiku-4.5
silent: true
args:
  - task
---
Classify this task as SIMPLE, MODERATE, or COMPLEX.
Respond with ONLY one word.

Task: {{ task }}

pr-review.copilot.md

---
model: claude-sonnet-4
silent: true
args:
  - base
---
Generate a PR description from these changes:

!`git diff {{ base | default: "main" }}..HEAD`

## Summary
[2-3 sentences]

## Changes
[Bullet list]

## Risk Assessment
[low/medium/high with explanation]

QUOTABLE MOMENTS

"One flag. -p. That's all it takes to turn interactive AI into scriptable AI."

"Haiku is 10x cheaper and 5x faster. Use the lightweight model to decide if you need the heavyweight."

"The pipe doesn't grant permissions. You do. Every boundary is explicit."

"Your prompts are code now. Version them. Test them. Ship them."

"Four problems. Four flags. One new way of thinking."

"The pipe carried data for 50 years. Now it carries intelligence. Start piping."


SLIDE CONCEPTS

Slide 1: Title

  • Terminal prompt with pipe symbol
  • "Scripting Copilot: Piping Hot Intelligence"
  • Subtitle: "Real Problems, Elegant Solutions"

Slide 2: The Four Problems

  • Grid of 4 icons with pain points
  • Interactive lock, dollar signs, warning shield, disappearing text

Slide 3: Problem → Solution Matrix

  • Clean table showing each problem/flag/result
  • Visual before/after

Slide 4: The Trust Ladder

  • Three levels visualized as steps
  • Pure pipes → Scoped tools → Full autonomy

Slide 5: Model Selection

  • Three tiers: Haiku, Sonnet, Opus
  • Speed/Cost/Power indicators

Slide 6: markdown-agent Reveal

  • Markdown file with play button
  • "Your prompts, in git, forever"

Slide 7: Call to Action

  • Four numbered steps
  • Clear, actionable items

Talk outline for Microsoft AI Dev Days Theme: Piping Hot Intelligence - Real Problems, Elegant Solutions Duration: 15-20 minutes Structure: Problem → Solution throughout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment