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.
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:
echo 'export LINEAR_API_KEY=lin_api_...' >> ~/.zshrc && source ~/.zshrcstet 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.
Start the ticket
Name the ticket and the files it may touch. Stet fetches the title and description from Linear.
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 "…".
Give the AI the ticket and the code in one paste
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.
Apply the AI's changes, then check them
# 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.
Commit and open the PR
stet pr --check # runs the locks, writes the PR text (copied)git add -Agit commit -F .stet/.cache/commit.txt # "LIN-142: Add CSV export" + file listgit 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.
Next ticket
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.