ticket workflow

From Linear ticket to pull request. Git is the source of truth.

For teams that work ticket by ticket with ChatGPT, Claude or Cursor. Stet carries the ticket and the latest code to the AI, checks what comes back, and writes the PR text. Linear features need stet-cli 0.3 or later.

every ticket, beforewith stet
Retype do's and don'ts for every ticketWritten once in .stet/charter.md, included in every context pack
Copy the Linear ticket into the chatstet scope set LIN-142 pulls title and description from Linear
Zip and upload the latest src folderstet context packs the live repo from git and copies it to your clipboard
Read every line for side effectsstet guard flags files outside the ticket; stet check catches what broke
Ask the AI to write the PR descriptionstet pr writes it from the real diff, checks and decisions
Type the ticket ID into every commitThe git hook adds “LIN-142:” for you
01

Connect Linear (once)

In Linear, open Settings → Security & access → Personal API keys and create a key (read access is enough). Put it in your shell, never in the repo:

terminal
echo 'export LINEAR_API_KEY=lin_api_...' >> ~/.zshrc && source ~/.zshrc
stet ticket LIN-142 # test: prints the ticket

This is Stet's only network call, and it's optional. Only the ticket ID is sent to Linear; your code never is. Tickets are cached in .stet/.cache/, which git ignores.

02

Start the ticket

Name the ticket and the files it may touch. Stet fetches the title and description from Linear.

terminal
stet scope set LIN-142 --allow "src/export/**,tests/export/**"

No Linear key? Type the title yourself: stet scope set "LIN-142 Add CSV export" --allow "…".

03

Give the AI the ticket and the code in one paste

terminal
stet context --files "src/export/**,src/invoices/**"

Copied to your clipboard: the Linear ticket, your rules, the scope, locked behaviours, decisions, recent commits, uncommitted changes, the full file tree and the files you named. Paste it into ChatGPT or Claude. If the AI needs another file, it asks for the path and you run stet context --files "that/file.ts".

Claude Code, Cursor and Codex work inside your repo, so they need no pasting at all: stet init --mcp lets them read the same context themselves.

04

Apply the AI's changes, then check them

terminal
# copy in the delta files or run the patch, then:
stet guard && stet check

Guard ✗ means the AI changed files outside the ticket: undo them with git restore <file>. Check ✗ means something that worked is broken: send the output back to the AI and ask it to fix its change, not the test.

05

Commit and open the PR

terminal
stet pr --check # runs the locks, writes the PR text (copied)
git add -A
git commit -F .stet/.cache/commit.txt # "LIN-142: Add CSV export" + file list
git push

The PR description links the Linear ticket and lists the changed files, the scope result, every locked behaviour and the decisions logged during the ticket. Fill in the one line Stet can't know: what changed for the user, and why.

06

Next ticket

terminal
stet scope set LIN-150 --allow "src/billing/**"

Rules, locks and decisions carry over. Nothing to re-explain, nothing to re-upload.

New to Stet? Start with installation and the setup guide.