mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Route required checks by changed surface, add offline provider and chat contracts, and keep fork PRs independent of live credentials. Layer agent guidance by subtree and enforce a compact instruction budget. Tested: bun run check:policy Confidence: high Scope-risk: broad
1.2 KiB
1.2 KiB
CLI and Runtime Instructions
These rules apply to src/ changes in addition to the root instructions.
- Keep CLI/runtime behavior under the existing
entrypoints,commands,services,tools,utils, andserverboundaries. Prefer the nearest existing seam over a new cross-cutting helper. - Add a focused
*.test.tsregression beside the affected area. Run it first, then followbun run check:impact; ordinarysrc/changes normally selectbun run check:server. - Provider presets, authentication, managed environment variables, model metadata, proxy transforms, or streaming changes also require the offline
bun run check:provider-contractwhen selected. - Keep tests hermetic: use fake credentials, intercepted requests or loopback servers, temporary
HOME/CLAUDE_CONFIG_DIR, and restored environment/global state. - Never mutate real user configuration or transcripts. Persistence format changes require forward migration, unknown-field preservation, an old fixture, and
bun run check:persistence-upgrade. - Agent-loop, tool execution, provider routing, permissions, resume, and file-editing behavior need deterministic mock/fixture coverage before any separately authorized live smoke.