Agent hooks execute shell commands at key lifecycle points during agent sessions. We'll add a workspace-scoped Stop hook that gates every agent — no agent can finish until all tests pass.
Steps:
- Open the
.github/hooks/folder - Prompt: Add an agent hook that runs the tests and blocks the agent from finishing if any test fails
- The hook should be a JSON file in
.github/hooks/(e.g.stop-test-gate.json), not inside any single agent file.
✅ Result: Every agent now has a safety net — it will keep working until all tests pass before handing back control.
Use the TDD agent to add a "Four Corners" bingo pattern. The workspace stop hook you set up will enforce test discipline — every agent must leave tests passing before it hands back control.
Steps:
- New chat with agent:
TDD - Add a "Four Corners" bingo win pattern — all four corner squares (top-left, top-right, bottom-left, bottom-right) must be marked
- Watch TDD orchestrate:
- TDD Red writes failing tests for Four Corners detection
- Review the new tests in VS Code's test runner
- TDD Green implements the minimal code to pass — stop hook fires, keeps it going if tests fail
- TDD Refactor cleans up the implementation
- Click on any sub-agent while it runs to see its context and instructions
- Review the summary of changes
✅ Result: Orchestrated TDD cycle with automatic test gating — no manual handoffs between agents.
Inspect what happened under the hood — did the hook fire? How did agents communicate?
Steps:
- Verify the hook loads: open the GitHub Copilot Chat Hooks output channel (Output panel → channel dropdown)
- Open Agent Debug Logs: gear icon (⚙️) in Chat view → Show Agent Debug Logs
- Logs view: filter for hook execution events during the TDD cycle
- Agent Flow Chart: visualize the TDD → Red → Green → Refactor orchestration
- Summary view: review total tool calls and token usage
Bonus: Click the ✨ sparkle icon to attach debug events to a new chat, then ask: /troubleshoot did the Stop hook fire during the TDD cycle?
✅ Result: Full observability into multi-agent orchestration and hook execution.
Break down agent workflows into specific focus areas, like design-first.
Steps:
- New chat with agent:
Pixel Jam - New mode: Card Deck Shuffle. Every player opens the game → taps → gets a random card with a question.
- Agent iterates on the UI
- Follow up to make it work like you want:
- Add left/right (fail, success)
- Draw a card right when I open it
- Commit
Combine MCP, custom workflows, and subagent isolation in an agent for powerful workflows. Focus on different aspects, like usability, a11y, compliance.
Steps:
- New chat with agent:
Pixel Jam: Run review - Keep the app open in VS Code browser preview while the review runs
- Follow along as it reviews
- Aside: Open
.github/agents/pixel-jam.agent.mdto review the prompt
- Aside: Open
- Behold a mighty in-depth review
Bonus:
- File findings as issues on GitHub for later
- Assign critical issues to coding agent to fix
- Fix UX review problems, delegated to background or cloud agent
- Add ability to have multiple question themes to pick from
- Add social sharing to win state
- Make a real iOS or full-stack app?
You've learned how to:
- Add workspace-scoped agent hooks to enforce quality gates (Stop hook on all agents)
- Use TDD to orchestrate Red → Green → Refactor automatically
- Inspect agent behavior with Agent Debug Logs and Flow Charts
- Use design-first agents for UI-driven development
- Run UX review agents for comprehensive testing
- Combine multiple agent types for complex workflows