Guidance for coding agents working in procoder.
This repo builds procoder, a Go CLI for an offline Git exchange workflow between:
- a local developer repository
- a locked-down ChatGPT coding container
The main user flow is:
procoder prepare- remote work inside the exported repo
./procoder-returnprocoder apply <return-package.zip>
cmd/procoder/main.go: process entrypoint, error handling, exits non-zero on failure.cmd/procoder-return/main.go: remote helper entrypoint used inside prepared task packages.internal/app/app.go: command parser + top-level CLI handlers.internal/exchange/: exchange IDs, task-ref helpers, and JSON models forexchange.json/procoder-return.json.internal/gitx/: Git command runner with structured output and typed failures.internal/prepare/:procoder prepareimplementation.internal/returnpkg/:./procoder-returnimplementation.internal/apply/:procoder applyimplementation.bin/procoder.js: npm shim that invokes packaged native binary.scripts/postinstall.js: downloads or builds both the host CLI binary and the packagedlinux/amd64helper..github/workflows/release.yml: tag-driven release pipeline.
The current Git-valid task-family shape is:
- default prepared task branch:
refs/heads/procoder/<exchange-id>/task - writable task-family prefix:
refs/heads/procoder/<exchange-id> - allowed returned refs:
refs/heads/procoder/<exchange-id>/*
Important:
- do not reintroduce the invalid older shape where both
refs/heads/procoder/<exchange-id>andrefs/heads/procoder/<exchange-id>/*exist at the same time - Git cannot store both of those refs because one path would need to be both a ref and a directory
Machine-owned metadata lives under .git/procoder/.
- local exchange record:
.git/procoder/exchanges/<exchange-id>/exchange.json - exported repo exchange record:
.git/procoder/exchange.json
User-facing artifacts live at repo root by default:
- task package:
./procoder-task-<exchange-id>.zip - return package:
./procoder-return-<exchange-id>.zip
When changing exchange behavior, keep gg/agent-outputs/procoder-handoff-v1-product-spec.md and gg/agent-outputs/procoder-exchange-v1-internal-spec.md aligned with the code.
Use make targets:
make fmtmake testmake vetmake lintmake checkmake buildmake build-helpermake build-allmake install-local
Direct commands:
go test ./...go vet ./...npm run lint
Phase-oriented validation:
procoder preparechanges should be covered by integration tests underinternal/prepare/procoder-returnchanges should be covered by integration tests underinternal/returnpkg/procoder applychanges should be covered by integration tests underinternal/apply/
- Rename CLI command consistently in all places:
- directory
cmd/procoder package.jsonvalues (bin,config.cliBinaryName)bin/procoder.js- workflow env
CLI_BINARY MakefileBIN_NAME
- Keep binary naming convention unchanged unless you also update postinstall/workflow:
- release assets:
<cli>_<goos>_<goarch>[.exe] - packaged helper asset:
procoder-return_linux_amd64 - npm-installed binary path:
bin/<cli>-bin(or.exeon Windows)
-
If adding dependencies, commit
go.sumand optionally enable Go cache in workflow. -
Keep help output expressive and command-local (
<command> --helpshould explain examples). -
If you change exchange filenames, helper asset names, or task-family ref naming, update:
- code
- tests
README.mdAGENTS.md- both spec docs under
gg/agent-outputs/
Release pipeline triggers on v* tags and expects:
NPM_TOKENGitHub secret present.- npm package name in
package.jsonis publishable under your account/org. - repository URL matches the release origin used by
scripts/postinstall.js.
- Prefer additive changes; do not break the release asset naming contract unintentionally.
- If you change release artifacts or CLI binary name, update both workflow and postinstall script in the same PR.
- Keep agent-facing failures specific and actionable, especially for
procoder-return. - Favor integration tests for real Git behavior over mocked unit-only coverage for exchange flows.