Rules that keep AI coding agents from making the classic mistakes when they write code against the Crossly API: a personal access token shipped in a React bundle, a webhook verified against JSON.stringify(req.body), dollars added up as floats, a list that stops after page one, a 429 retried in a tight loop.
One source, src/rules.md, generated into every agent's native format. CI fails if a generated file drifts from the source, and checks every endpoint the rules mention against the live OpenAPI specs.
- Credentials per surface: seller vs buyer API;
crossly_pat_…and OAuth tokens server-side only;crossly_pk_…publishable keys are the only Crossly credential allowed in frontend code; least-privilege scopes; OAuth with PKCE. - Money:
…Centsfields are integer cents, listing and order amounts are dollars, never float arithmetic. - Webhooks: verify
Crossly-Signatureagainst the raw body, constant-time, 300 s tolerance, dedupe on the event id. - Pagination:
page/limit(max 100),{ data, pagination }, stop whendata.length < limit. - Errors: the
{ error: { code, message, details }, correlationId }envelope, 401 vs 403, what never to retry. - Rate limits: quotas per plan,
Retry-After,Idempotency-Keyon retried writes. - Crossposting is asynchronous: poll
platformListings.
Clone this repository (or download the release zip), then from your project's root:
/path/to/crossly-ai-rules/install.sh cursor # one agent
/path/to/crossly-ai-rules/install.sh all # every agent
/path/to/crossly-ai-rules/install.sh # auto-detect (.cursor/, .github/, ...), else AGENTS.mdIt never overwrites a file you already have unless you pass --force; merge by hand instead.
| Agent | File | Notes |
|---|---|---|
| OpenAI Codex, OpenCode, Jules, Amp, … | AGENTS.md |
The cross-agent standard; also read by Cursor, Zed and the Copilot coding agent |
| Cursor | .cursor/rules/crossly.mdc |
alwaysApply: true |
| GitHub Copilot | .github/copilot-instructions.md |
Repository custom instructions |
| Windsurf | .windsurf/rules/crossly.md |
trigger: always_on; kept under Windsurf's 12,000-character limit |
| Cline | .clinerules/crossly.md |
|
| Roo Code | .roo/rules/crossly.md |
|
| Gemini CLI | GEMINI.md |
|
| Zed | .rules |
Zed reads the first rules file it finds, and .rules comes first |
| Aider | CONVENTIONS.md |
Load with aider --read CONVENTIONS.md or read: CONVENTIONS.md in .aider.conf.yml |
| JetBrains Junie | .junie/guidelines.md |
Claude Code reads AGENTS.md too, but the richer option is the plugin with task skills and the MCP server: /plugin marketplace add crossly-dev/crossly-skills (crossly-dev/crossly-skills).
Edit src/rules.md, never a generated file, then:
node scripts/build.mjs # regenerate every agent's file
node scripts/build.mjs --check # what CI runs
node scripts/check-endpoints.mjs # every /v1 path in the rules exists in the live specsEvery statement must come from the OpenAPI specs (https://crossly.net/openapi/seller.json, https://crossly.net/openapi/buyer.json), the SDK sources or https://crossly.net/docs. If it can't be confirmed, leave it out.