Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save johnlindquist/1223de7735b8ef4b169bcce0fcc7bd32 to your computer and use it in GitHub Desktop.
Microsoft AI Dev Days: Scripting Copilot - Building Blocks (LEGO-style progressive complexity)

Scripting Copilot: Piping Hot Intelligence

Microsoft AI Dev Days Talk (15-20 min)

Angle: Building Blocks / Progressive Complexity


THE CONCEPT

"Building Blocks" - Start with the simplest possible piece. Add one concept at a time. By the end, you've built something sophisticated from simple parts. LEGO-style learning.

Visual Theme: Blocks stacking. Each section adds one brick. The final structure is impressive, but every piece is simple.


ACT 1: THE HOOK (1-2 minutes)

Opening: One Block

Slide: A single LEGO brick

Say this:

"I'm going to show you something that runs an AI agent. It's a markdown file. Watch."

Drop the command:

$ ma task.copilot.md

Pause. Let it land.

"That's it. A markdown file just executed AI. But here's the thing - I didn't start there. I started with a single block..."

Reveal the first brick:

$ git diff | copilot -p "review"

The hook:

"Data goes in. Intelligence comes out. That's block one. Let me show you how to stack blocks until you've built something remarkable."


ACT 2: MAIN CONTENT (12-15 minutes)

Section 2.1: Block 1 - The Foundation (2 min)

Slide: One brick labeled "The Pipe"

The simplest possible AI integration:

echo "Hello" | copilot -p "translate to Spanish"

Breaking it down:

echo "Hello"     →  data (the input)
|                →  pipe (the connector)
copilot          →  AI (the processor)
-p "..."         →  prompt (the instruction)

Key insight:

"This is the same pattern as cat file | grep pattern. You already know this. The only new thing is: the processor is intelligent."

The foundational equation:

Software = Instructions + Tools

Section 2.2: Block 2 - Making It Scriptable (2 min)

Slide: Two bricks stacked, second labeled "-s flag"

The problem:

# This outputs spinners, decorations, noise
copilot -p "summarize this"

The solution:

# This outputs ONLY the answer
copilot -p "summarize this" -s

Why -s matters:

"Silent mode strips everything except the answer. And clean output... can be piped."

DEMO: The Difference

# Can't pipe this (has decorations)
git diff | copilot -p "review"

# CAN pipe this (clean output)
git diff | copilot -p "review" -s > review.txt

Block 2 complete:

"Now you have: input, intelligence, clean output. Two blocks. Let's add a third."


Section 2.3: Block 3 - Chaining Intelligence (2-3 min)

Slide: Three bricks, third labeled "Chains"

The revelation:

"If copilot outputs clean text, and copilot accepts text input... you can chain them."

DEMO: The Chain

git diff | \
  copilot -p "list the changes as bullets" -s | \
  copilot -p "rate each change: low/medium/high risk" -s | \
  copilot -p "format as a PR description" -s

What's happening:

raw diff → summarize → evaluate → format
   AI         AI         AI

The mental model:

"Each copilot call is a specialist. The first summarizes. The second evaluates. The third formats. Assembly line intelligence."

Block 3 complete. Three blocks: pipe, silent, chain.


Section 2.4: Block 4 - Model Selection (2-3 min)

Slide: Four bricks, fourth labeled "--model"

The --model flag:

# Fast and cheap (triage, simple tasks)
copilot -p "Is this a bug? YES or NO" -s --model claude-haiku-4.5

# Balanced (most daily work)
copilot -p "Review this code" -s --model claude-sonnet-4

# Deep thinking (architecture, complex analysis)
copilot -p "Design a caching strategy" -s --model claude-opus-4.5

The escalation pattern:

# Use cheap model to decide if you need expensive model
COMPLEXITY=$(echo "$TASK" | copilot -p "SIMPLE or COMPLEX?" -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

The principle:

"Haiku is 10x cheaper and 5x faster than Opus. Use the small model to decide if you need the big model. Intelligent escalation."

Block 4 complete. Four blocks: pipe, silent, chain, model.


Section 2.5: Block 5 - Permission Boundaries (2-3 min)

Slide: Five bricks, fifth labeled "--allow-tool"

The safety layer:

# Read-only intelligence (can't modify anything)
copilot -p "Analyze this" -s --allow-tool 'shell(git:*)' --allow-tool 'Read'

# Scoped write access (can only touch git)
copilot -p "Fix linting and commit" -s --allow-tool 'shell(git:*)' --allow-tool 'shell(npm:lint)'

# Full autonomy (supervised only!)
copilot -p "Refactor auth system" -s --allow-all-tools

The trust ladder:

Level 1: Pure pipes           cat code | copilot -p "review" -s
Level 2: Read-only tools      --allow-tool Read --allow-tool Glob
Level 3: Scoped mutations     --allow-tool 'shell(git:*)'
Level 4: Full autonomy        --allow-all-tools (supervised)

The principle:

"The pipe doesn't grant permissions. You do. Each step up the ladder is explicit."

Block 5 complete. Five blocks: pipe, silent, chain, model, permissions.


Section 2.6: Block 6 - Real Pipelines (2 min)

Slide: Tower of blocks showing complete pipelines

DEMO: Code Review Pipeline

#!/bin/bash
# review-pipeline.sh

git diff main..HEAD | \
  copilot -p "List changes with file:line format" -s | \
  copilot -p "For each: bug risk, perf impact, security concern" -s | \
  copilot -p "Format as markdown table sorted by risk" -s \
  > review.md

DEMO: Debug Pipeline

#!/bin/bash
# debug-pipeline.sh

npm test 2>&1 | \
  copilot -p "Extract only the failing tests" -s --model claude-haiku-4.5 | \
  copilot -p "Identify root cause" -s --model claude-sonnet-4 | \
  copilot -p "Generate fix with explanation" -s --model claude-opus-4.5

Notice the escalation pattern:

"Haiku filters. Sonnet analyzes. Opus solves. Each model does what it's best at."

Block 6 complete. Six blocks assembled into real workflows.


ACT 3: THE RESOLUTION (3-4 minutes)

The Problem: Loose Blocks

Slide: Scattered LEGO bricks

"You now have six blocks. But be honest - will you remember these flag combinations tomorrow? Will your team?"

Pain points:

  • Complex flag combinations disappear
  • No version control for your pipelines
  • Sharing patterns via... Slack?
  • Rebuilding the same structures repeatedly

Transition:

"What if you could save your structures? What if your blocks could become... blueprints?"


The Reveal: markdown-agent (The Blueprint)

Slide: LEGO instruction manual

$ ma review.copilot.md

How it reads:

  • review = your structure name
  • .copilot = build with copilot
  • .md = it's just markdown

The blueprint file:

---
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 - piping into your blueprint:

git diff | ma review.copilot.md

"Your pipeline, in a file. Your file, in git. Your team's standards, automated."


The Advanced Blueprint: Variables and Imports

Slide: Complex LEGO set with variable pieces

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

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

## The Task
Review with focus on {{ focus_area | default: "all areas" }}.

For each change:
- Risk level (low/medium/high)
- Category (bug fix, feature, refactor)
- Specific concerns

## Output Format
A PR description with summary and risk table.

Run your blueprint:

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

The Complete Picture

Slide: Completed LEGO structure

All six blocks, now in a file:

  1. Pipe - !git diff`` brings data in
  2. Silent - silent: true in frontmatter
  3. Chain - Multiple prompts in the body
  4. Model - model: claude-sonnet-4
  5. Permissions - allow-tool: array
  6. Blueprint - The .copilot.md file itself

The equation:

Building Blocks → Structures → Blueprints → Libraries
    (flags)       (scripts)    (markdown)   (repos)

CLOSING (1 minute)

The Stack

Slide: Six blocks with labels

Your six blocks:

  1. | - The pipe (data flows in)
  2. -s - Silent mode (clean output)
  3. | copilot | copilot - Chaining (assembly line)
  4. --model - Selection (right tool for the job)
  5. --allow-tool - Permissions (explicit trust)
  6. .copilot.md - Blueprints (version-controlled)

Call to Action

Today:

  1. Block 1: git diff | copilot -p "review" -s
  2. Block 2: Add --model claude-haiku-4.5 for speed
  3. Block 3: Create one .copilot.md file for something you do daily
  4. Block 4: Commit it. Share it. Build a library.

Resources

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

Final Thought

Slide: Single brick becoming a tower

"Every LEGO masterpiece starts with one brick. Every AI pipeline starts with one pipe. Start stacking."


TIMING GUIDE

Section Time Cumulative
Hook: Single block intro 2 min 2 min
Block 1: The Pipe 2 min 4 min
Block 2: Silent Mode 2 min 6 min
Block 3: Chaining 2 min 8 min
Block 4: Model Selection 2 min 10 min
Block 5: Permissions 2 min 12 min
Block 6: Real Pipelines 2 min 14 min
Resolution: markdown-agent 4 min 18 min
Closing 2 min 20 min

KEY TAKEAWAYS

  1. Block 1: | pipes data into AI
  2. Block 2: -s makes output pipeable
  3. Block 3: Chain copilot | copilot | copilot
  4. Block 4: --model picks the right brain
  5. Block 5: --allow-tool sets boundaries
  6. Block 6: .copilot.md saves it all

QUOTABLE MOMENTS

"This is the same pattern as cat file | grep pattern. You already know this."

"Silent mode strips everything except the answer. And clean output can be piped."

"Each copilot call is a specialist. Assembly line intelligence."

"Use the small model to decide if you need the big model. Intelligent escalation."

"The pipe doesn't grant permissions. You do."

"Every LEGO masterpiece starts with one brick. Every AI pipeline starts with one pipe."


VISUAL/SLIDE CONCEPTS

Slide 1: Title

  • Single LEGO brick
  • Title: "Scripting Copilot: Piping Hot Intelligence"
  • Subtitle: "Building blocks for AI automation"

Slide 2-7: The Blocks

  • Each slide adds one brick to a growing stack
  • Labels: Pipe, Silent, Chain, Model, Permissions, Blueprint

Slide 8: The Tower

  • Complete stack of six blocks
  • Each labeled with its purpose

Slide 9: Scattered Blocks

  • Loose LEGO bricks scattered
  • Caption: "Hard to remember. Hard to share."

Slide 10: The Blueprint

  • LEGO instruction manual
  • .copilot.md file inside

Slide 11: The Structure

  • Completed LEGO build
  • Caption: "Version-controlled. Shareable. Reproducible."

DEMO FILES

review.copilot.md (Basic Blueprint)

---
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 Selection)

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

Task: {{ task }}

pr-review.copilot.md (Full Blueprint)

---
model: claude-sonnet-4
silent: true
inputs:
  - 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]

DEMO CHECKLIST

  • Terminal with large font (24pt minimum)
  • Git repo with staged changes for git diff demos
  • Sample error.log file
  • Pre-written .copilot.md blueprint files
  • Test all pipes before talk
  • Backup: screenshot/video of each demo
  • Verify copilot CLI is installed and authenticated
  • LEGO bricks as physical props (optional but memorable)

Talk outline for Microsoft AI Dev Days Theme: Building Blocks - Progressive complexity with LEGO-style learning Duration: 15-20 minutes

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