Which template, when
The templates follow the stages of the 13-week adoption plan. Each is meant to be edited: replace the bracketed parts, delete what does not apply, keep it short.
| Stage | Template | Who uses it |
|---|---|---|
| The decision to run a pilot | Launch letter, AI-use policy | Sponsor, security, legal |
| Weeks 1–2, diagnosis | Git baseline script, baseline table (Start column) | Harness owners, team lead |
| Weeks 3–4, first harness | Task spec, AGENTS.md templates | Spec author, harness owners |
| Weeks 6–12, run and adjust | Manual-edit review log, baseline table (Week 6 column) | Team lead, harness owners |
| Week 13, review | Baseline table (Final against Start) | Sponsor, team |
The git baseline script
A pilot without a "before" cannot show an "after". Most of the before is already in git. git-baseline.py reads a repository's history and prints the delivery figures for a period. It needs Python 3.8 or later and nothing else: standard library only, read-only (it runs git log and reads diffs; it writes nothing), and no network unless you ask for review times with --github. It also fills the pilot's table for you, and puts the before and the after side by side.
# the last 90 days of the current branch, releases detected automatically
python3 git-baseline.py --repo ~/src/billing
# releases are tags named v*, over a fixed window, as CSV for the table
python3 git-baseline.py --repo ~/src/billing --days 90 --end 2026-11-30 \
--releases tags --tag-pattern 'v*' --format csv > baseline.csv
# skip generated files in change sizes
python3 git-baseline.py --exclude 'dist/*' --exclude '*.min.js'
# the pilot's table with its Start column filled; at week 6, the same table
# with Week 6 added and everything already in it kept
python3 git-baseline.py --repo ~/src/billing --format sheet > pilot.csv
python3 git-baseline.py --repo ~/src/billing --format sheet \
--column week6 --into pilot.csv > pilot-week6.csv
# before and after the pilot started on 1 September
python3 git-baseline.py --repo ~/src/billing --compare 2026-09-01
Options
| Option | Default | Meaning |
|---|---|---|
--repo PATH | . | The repository to read. |
--branch NAME | HEAD | The branch whose history counts as delivered. |
--days N | 90 | Length of the period. |
--end YYYY-MM-DD | today | Last day of the period; fix it so a later run measures the same window. |
--releases | auto | tags, merges or commits. auto takes tags if there are any in the period, else merge commits, else every first-parent commit. With commits there is no lead time to measure. |
--tag-pattern GLOB | * | Which tags are releases. |
--hotfix-hours H | 24 | A release followed by another within this many hours counts as a likely fix release. |
--exclude GLOB | lock files | Files left out of change sizes; repeatable. |
--compare YYYY-MM-DD | off | The day the pilot started: the --days before it against the days from it to --end, with the change for each figure. Releases are counted the same way in both. |
--github | off | Adds time to first review and pull request open to merge, from GitHub through the gh command line. The only option that uses the network. |
--format | text | text, json, csv, or sheet: the pilot's table below, with these numbers in it. |
--column | start | With sheet: start, week6 or final. With --compare, Start takes the before and this column the after (final unless set). |
--into FILE | none | With sheet: a table you already started; its other cells are kept. The result goes to the screen, so redirect it to a new file. |
What it prints
- Releases per week and the median days between releases.
- Lead time from commit to the release that carried it, median and 85th percentile.
- Change size in lines added plus removed, median and 85th percentile, and files per change (median).
- Changes on the main branch in the period.
- Revert share: commits that revert an earlier one.
- Releases followed by another within
--hotfix-hours, with tag releases only: a rough stand-in for failed changes.
What it cannot see
Git knows when code was committed and tagged, not when it reached users. So the script cannot give deploy time, the real change failure rate or recovery time: those need incident or rollback records. Review time comes from GitHub with --github; on GitLab, from its API by hand. Fill those rows of the table yourself, or leave them empty and say so: an honest gap is better than a guessed number.
The baseline table
The table comes three ways, with the same rows: in the browser, where the change and its direction are worked out as you type and nothing leaves the page; as a workbook for Excel or Google Sheets, with the changes as formulas, coloured green or red by which way is better; and as pilot-baseline.csv, which opens in any spreadsheet. Its columns are Group, Metric, Source, How to get it, Start, Week 6, Final (week 13) and Comment. Fill Start in weeks 1–2 and do not change it afterwards. Every number goes in as a number — hours, a count, a percentage — so the spreadsheet can compare the columns. git-baseline.py --format sheet writes this table with the rows it can measure already filled.
| Group | Metric | Source |
|---|---|---|
| Speed | Lead time, median | git script |
| Speed | Lead time, 85th percentile | git script |
| Speed | Releases per week | git script, or the CI deploy log |
| Speed | Time to first review, median | git script with --github, or the GitLab API |
| Speed | Pull request open to merge, median | git script with --github, or the GitLab API |
| Stability | Change failure rate | Incident records, rollbacks |
| Stability | Time to restore, median | Incident records |
| Stability | Unplanned fix releases, share | Release notes, or the script's hotfix figure |
| Process | Change size, median | git script |
| Process | Revert share | git script |
| AI | Agent changes merged without manual rework | The weekly edit review |
| AI | Defects traced to agent changes | Bug tracker, linked to the change |
| AI | Model spend per task | Gateway logs or provider bills |
| Team | Short survey: where time goes, what gets in the way | Survey at start and end |
What a finished sheet looks like
| Metric | Start | Week 6 | Final | Final vs start |
|---|---|---|---|---|
| Lead time commit → release, median (hours) | 92 | 61 | 41 | -55% |
| Releases per week | 1.5 | 2.4 | 3.2 | +113% |
| Time to first review, median (hours) | 20 | 9 | 6 | -70% |
| Change failure rate (%) | 12 | 14 | 9 | -3.0 pp |
| Change size in lines, median | 240 | 150 | 118 | -51% |
| Agent changes merged without a manual fix (%) | — | 38 | 61 | — |
| Model spend per task | — | 1.9 | 1.4 | — |
Two things to read in it. Change failure rate went up at week 6 before it came down: the sheet keeps that, because a pilot that only shows the good weeks is not believed. And the AI rows have no Start, since there were no agents before the pilot; their story runs from week 6 to the final column. The whole example is on the workbook's second sheet and behind Show an example on the page.
Pull request counts and lines of code are left out on purpose: they rise whether or not anything gets better. Measuring the effect of AI explains why.
AI-use policy
One page. Have security and legal read the data section: what may leave your network depends on your contracts and on data-protection law in your jurisdiction (for example GDPR).
# Using AI agents in development
Owner: [name, role] · Last reviewed: [date]
## Why this document
We are piloting AI agents in [team]. This page says which tools may be used,
what must never be sent to them, and who answers for the result.
## Permitted tools
- [Tool 1]: available to every developer; request access from [who].
- [Tool 2]: through [the company gateway / a self-hosted model] only.
- No other AI tools are used with company code or data.
## Never send to an external model
- Personal data of customers or employees.
- Code or documents covered by an NDA or a client contract that forbids it.
- Secrets: keys, tokens, passwords, certificates.
- Other confidential business information: [examples].
Work that touches these goes to [the self-hosted model] or is done without AI.
## Responsibility for code
- The author of a pull request owns its code, whoever or whatever wrote it.
- Agent code gets the same review and the same CI checks as any other.
- Tests are not weakened or deleted to make a change pass.
## What we expect
- Try agents on your own tasks; time for this is planned in the sprint.
- Share what works and what fails in [channel].
- When an agent gets something wrong, look for the cause and propose
a change to the rules, the checks or the spec template.
## How metrics are used
Metrics describe the process and the team. They are not used to compare
or evaluate individual people.
## Questions
[Name], [channel]. This page is reviewed every quarter and whenever
a tool changes.
Task spec
A spec is a ticket an agent can work from without guessing. The two sections tickets usually lack, Boundaries and Out of scope, are the ones that stop an agent from widening the change. See spec-driven development for how to write the criteria.
# [Short title]
Ticket: [link] · Author: [name] · Status: draft | agreed | in progress | done
## Goal
What changes for the user, in one or two sentences.
Example: customers are billed for a renewal on their own local renewal date.
## Context
- Where the code lives: [module, files]
- How it works today: [two or three lines]
- Related documents: [links]
- A similar implementation to follow: [file or pull request]
## Acceptance criteria
Each criterion is checked by a test, or says why it is checked by hand.
1. Given a customer in UTC+10 whose renewal date is the 1st,
when the renewal job runs, then the charge is dated the 1st.
2. Given a customer in UTC-8, ... then ...
3. Errors and edge cases: [a missing time zone, a renewal on the 29th
of February, a retry after a failed charge]
## Boundaries
Scope: one module | changes a public API | affects other teams
Do not touch: [database migrations, shared packages, configuration]
If the change needs any of these, stop and describe the plan
in the pull request before going on.
## Out of scope
- [What a reader might expect but this task does not do]
## Plan
Filled in before the work starts: the steps and the files.
## Verification
- Commands: [as in AGENTS.md: tests, lint, type check]
- Manual check: [the scenario a person walks through]
## Open questions
- [Question] (owner: [name])
Manual-edit review log
Once a week, for thirty minutes, the team lead and a harness owner go through every pull request where a person changed what an agent wrote. Each edit gets a cause and a change to the harness, so the same edit is not needed next week.
# Manual edits, week of [date]
| Pull request | What the person changed | Why the agent got it wrong | Harness change | Owner |
|---|---|---|---|---|
| [link] | Renewal date computed in UTC | No rule on time zones for billing | Rule added to AGENTS.md; test helper for local dates | [name] |
| [link] | | | | |
Causes, one per row:
- missing rule
- missing knowledge of the system
- missing CI check
- missing requirement in the spec
- other (describe)
## Totals
- Pull requests with agent changes: [n]
- Accepted without manual rework: [n]
- Harness changes made: [n] ([links])
- Causes repeated from last week: [list]
A cause that repeats usually means one of three things: the rule is too general to act on, the instructions file is too long for the rule to be noticed, or the rule should be an automated check instead.
Launch letter to the team
The sponsor sends this before the diagnosis starts. It answers the questions people will otherwise ask each other in private.
Subject: A three-month pilot of AI agents in [team]
Hi all,
Over the past months many of us started using AI tools, and individual
tasks get written faster. Our releases have not got faster. We want to
find out whether changing how we specify, check and accept work lets
the whole team deliver sooner, without losing quality.
What will happen
- Weeks 1-2: we measure how work flows today, from git and CI history,
and look at where it waits. Nothing changes in how you work yet.
- Weeks 3-4: we write short rules for agents, a template for task specs
and the checks that run on every change.
- [Date]: a working session where we take two or three real tasks
through the new process together.
- After that: a short weekly review of where agents got things wrong,
and what we change so it does not happen again.
- In about three months: we compare the figures with today's and decide,
together, what comes next.
What matters
- During the pilot, defect-based targets for the team are suspended.
Trying things and getting them wrong is part of the work.
- The figures describe the process and the team, never individual people.
- The goal is to deliver the same backlog sooner. Any decision about
how the team works next is made with you, on the figures.
- The AI-use policy is attached; [name] answers questions about it.
Questions to me or to [team lead] at any time.
[Name]
[Role]
Questions
Can we measure DORA metrics without access to CI?
Partly. The git script gives release frequency, lead time from commit to release and change size from history alone. Change failure rate and recovery time need incident or rollback records, and review time needs your Git host's API.
Is the script safe to run on a working repository?
Yes. It only reads: it runs git log and reads diffs, writes nothing to the repository and makes no network calls. It is a single readable file, so you can check that before running it.
How is a spec different from a ticket?
A spec has criteria a test can check, explicit boundaries on what the change may touch, and a list of what is out of scope. Without those, an agent fills the gaps with its own guesses.
What must an AI-use policy include?
The permitted tools, the data that must never go to an external model, who answers for the code, what is expected of people, how metrics are used and whom to ask. The template above covers all six on one page.
Take your team there, step by step
A 13-week pilot on one team: a baseline, a harness built around your process, real backlog tasks through the whole cycle, and the numbers before and after.