yumm lab

de-faults

Use AI well.

A short field guide from de-faults: what AI is good for, how agents actually work, and the habits that save real time.

summarise this meeting into 5 action items

What AI is good for

Seven everyday jobs. Each card ends with a prompt you can borrow.

Three levels of using AI

Same request, three ways. The difference is who does the legwork.

  1. 1

    Chat

    You ask, it answers. You copy the result and do the work yourself.

  2. 2

    Assistant + tools

    It can read files, search, run code. It reports back, you decide.

  3. 3

    Agentic

    You give a goal and a finish line. It plans, acts, checks, and loops until done.

1 · chat

Login is broken. Can you fix it?

Probably the expiry check. Here's a patch to try: paste it in and run your tests.

2 · tools

Login is broken. Can you fix it?

read_file auth.jsrun npm test

Found it: the expiry check uses < instead of <=. Patch and the failing test attached.

3 · agentic

Login is broken. Can you fix it?

planedit auth.jstest ✗edittest ✓

Fixed and verified. All tests pass. The diff is ready for your review.

How the agentic loop works

A goal goes in, then a loop: plan, act with tools, look at the result, check it against the finish line. Missed it? Go round again.

1 2 3 4 5 Goal Plan Act Observe Check until done

One run, step by step

  1. Goalfix login. Done = all tests pass.
  2. Planread the auth code, suspect the expiry check.
  3. Actedit auth.js, run the tests.
  4. Observe2 tests still fail.
  5. Checknot done, so go round again.
  6. Planthe fix missed refresh tokens.
  7. Actpatch the refresh path, re-run.
  8. Observeall tests pass.
  9. Checkdone. Report back with the diff.

What an agent is made of

Five patterns you'll meet

Most agent systems are one of these, or two of them stacked.

  • Prompt chain

    Split the job into steps. Each output feeds the next.

  • Routing

    Classify first, then hand off to the right specialist.

  • Parallel

    Fan out to several agents at once, then merge the results.

  • Orchestrator and workers

    A lead splits the work on the fly and collects it back.

  • Evaluator and optimizer

    One makes, one critiques. Repeat until it passes.

Agent, or just ask?

Use an agent when

  • The job has several steps.
  • Success can be checked: tests pass, a build runs, a page loads.
  • It needs tools: files, a shell, search.

Just ask when

  • One question gets you the answer.
  • There's no way to check the result automatically.
  • Speed and cost matter more than autonomy.

Do it yourself

Four recipes, in order. Each one says why, then how, then gives you a file to copy.

Write AGENTS.md

An agent starts every session knowing nothing about your project. This file is read first, every time, so you stop explaining the same things.

  1. 1

    Create it at the root

    One AGENTS.md in the repo. Codex, Cursor and Copilot read it as is. If your tool wants another name (CLAUDE.md, GEMINI.md), point that file at this one.

  2. 2

    Write what it can't guess

    What the project is, how to run and test it, the rules, and what done means.

  3. 3

    Keep it short

    It loads every session and takes up context every time. Cut anything the code already says.

  4. 4

    Grow it from mistakes

    When the agent gets the same thing wrong twice, add one line so there's no third time.

Example AGENTS.md
# AGENTS.md

## What this is
Static page served by a Cloudflare Worker.
No build step. Files live in public/de-faults/.

## Run
npx wrangler dev

## Rules
- Colours and fonts come from /tokens.css.
- No inline scripts or styles (strict CSP).
- Done = page loads with no console errors.
- Ask before pushing: main deploys to prod.

Run an agentic task

An agent keeps going round the loop until the job is done, but only if you tell it what done looks like.

  1. 1

    Give a goal, a finish line, limits

    What you want, how to check that it worked, and what it must not touch.

  2. 2

    Plan first

    Ask for a plan before any edits. Read it, fix what's wrong, then say go.

  3. 3

    Let it loop

    It reads, edits, runs the checks and goes round again. When it asks before a risky step, you decide.

  4. 4

    Review the result

    Read the diff and run it yourself. The agent saying “done” is a claim, not proof.

  5. 5

    Commit or roll back

    Good: commit. Off track: revert, sharpen the prompt, run it again.

Example prompt
Goal: users can reset their password by email.

Done when:
- npm test passes, including a new test for reset
- no new dependencies

Limits:
- only touch src/auth/
- ask before changing the database

First read the auth code and show me a plan.
Wait for my OK before you edit anything.

Create a skill

A skill is a folder of instructions the agent loads only when a task matches it. Write a procedure once, reuse it for good, and pay nothing for it when it isn't needed.

  1. 1

    Spot a repeat

    Typed the same long prompt three times? Explained the same steps again? That's a skill.

  2. 2

    Make the folder

    A folder named after the skill with a SKILL.md inside, in your tool's skills folder: for example .agents/skills/, .claude/skills/ or .github/skills/.

  3. 3

    Write the description well

    The top of the file needs a name and a description. The agent picks skills by the description alone, so say what it does and when to use it.

  4. 4

    Write the steps

    The body holds the steps, the checks and the output format. Scripts or templates can sit beside it in the folder.

  5. 5

    Test it, then tune it

    Ask for the task in your own words. It didn't kick in? Fix the description. It went wrong? Fix that step.

Example: weekly-report/SKILL.md
---
name: weekly-report
description: Write the weekly team report from merged PRs and closed issues. Use when asked for a weekly report, a status update or "what did we ship".
---

# Weekly report

1. List PRs merged and issues closed in the last 7 days.
2. Group them by project. Skip bots and typo fixes.
3. One line per group: what changed, why it matters.
4. End with blockers, if any.

Output: Markdown, under 200 words, no jargon.
Check: every line links to its PR or issue.

Extend the agent

Three ways to give an agent more reach without writing a longer prompt.

  • Hooks

    A command that runs by itself before or after the agent uses a tool: format each edited file, block edits to secrets, run the tests at the end. Claude Code, Cursor and Gemini CLI all have them; the config differs.

    A hook runs with your permissions. Read one before you install it.

    The idea (each tool's config differs)
    on:   after each file edit
    run:  npx prettier --write <edited file>
  • MCP

    One standard plug for outside tools: GitHub, a database, a browser, your files. Add a server once and any agent that speaks MCP can use it.

    Only connect servers you trust: they can read and act on whatever you open to them.

    Example MCP config
    {
      "mcpServers": {
        "files": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-filesystem", "./docs"]
        }
      }
    }
  • Subagents

    A fresh agent for a side job, like searching the code or reviewing a diff. It works in its own context and hands back only the answer, so your main session stays clean.

    Example prompt
    Use a subagent to find every caller of parseDate().
    Report file:line only, 10 lines at most.

Habits that save real time

Ten things that separate a useful session from a wasted one.

  1. 01

    Write the context down

    Keep a CLAUDE.md or AGENTS.md: what the project is, how to run it, the rules. Stop repeating yourself.

  2. 02

    Define done

    “Tests pass” or “the page loads with no errors” lets the agent check its own work.

  3. 03

    Plan before big changes

    Ask for a plan, read it, then let it build.

  4. 04

    Keep tasks small

    One thing at a time. Easier to review, easier to undo.

  5. 05

    Commit often

    Git is your safety net. If the agent breaks something, revert.

  6. 06

    Turn repeats into skills

    A prompt you type every week belongs in a skill or a slash command.

  7. 07

    Automate with hooks

    Format, lint or test automatically before or after each tool call.

  8. 08

    Run work in parallel

    Separate git worktrees, separate sessions, no collisions.

  9. 09

    Stay the reviewer

    Deploys, deletes and messages to the outside world need a human yes.

  10. 10

    Verify what matters

    AI can be confidently wrong. Check important facts at the source.