Imported from cv/pit (
AGENTS.md). Install upstream withnpx skills add cv/pit. Copyright stays with the author.
Pit agent workflow
Hashed edits
- Use only revisions and anchors returned by the immediately preceding
workspace.readorworkspace.search. - A successful edit or formatter run invalidates every previous anchor for that file. Re-read before another mutation.
- Never guess a line hash or reuse one from an older result.
- Prefer
workspace.searchfor a single edit target andworkspace.batchfor independent multi-file reads. - Put multiline, regex-heavy, or quote-heavy patch content in top-level
paramson the first attempt. - After one malformed tool submission, simplify it. After two failures of the same class, split the operation instead of varying the same construction.
Tool selection
- Use
npm.test()for the normal suite andnpm.run(script)forcheck,coverage, andpackage:check. - Use
shell.execFile("npx", ...)only for targeted executable invocations without a typed capability. - Use typed Git and GitHub methods whenever supported. One unsupported GitHub step does not justify raw
ghfor supported view/list/comment/close/run steps. - Use
shell.execonly when shell syntax is required.
Parallelism and ordering
- Use
Promise.allorworkspace.batchfor independent probes. - Keep same-file mutations, Git mutations, and dependent state transitions sequential.
- Do not run the full test and coverage suites concurrently.
- Format only files changed by the task; never run a broad fixer with unrelated modifications.
Testing
- Prefer typed
it.eachtables when cases share setup and assertion shape but vary inputs and expected outputs. - Give table rows descriptive names; keep lifecycle, concurrency, ordering, and heterogeneous workflows as explicit standalone tests.
- Do not move substantial control flow into table data merely to reduce line count.
Delivery
- Load the
pit-deliveryskill for issue implementation and finalization. - Run
validatePit()for the standard gates andpreparePitDelivery()before delivery. - For TUI, extension-loading, saved-function, sandbox, or partial-update changes: push a non-closing commit, reload Pi, and smoke-test before closing the issue.
- Do not use
Closes #...until interactive acceptance has passed.