1.9 KiB
1.9 KiB
Agent Instructions
Goals
- Keep runtime behavior explicit and predictable.
- Keep integration points documented when features are added.
- Enforce a consistent quality gate before merging changes.
Project Organization
src/agents: session lifecycle, limits, resource provisioning, and schema-driven orchestration.src/mcp: MCP config types, conversion, and handler policy resolution.src/examples: provider-specific execution entrypoints.tests: focused unit tests for orchestration and config behavior.
Engineering Standards
- TypeScript strict mode stays enabled.
- Exported interfaces should be typed explicitly and validated at boundaries.
- New behavior should include at least one test if it changes control flow or config parsing.
- Avoid provider-specific policy in shared modules unless there is a clear extension point.
- When adding new runtime limits or resource constraints, ensure they are added to
.env.example.
Runtime Environment Variables
- Agent manager limits:
AGENT_MAX_CONCURRENTAGENT_MAX_SESSIONAGENT_MAX_RECURSIVE_DEPTH
- Orchestration/context limits:
AGENT_STATE_ROOTAGENT_PROJECT_CONTEXT_PATHAGENT_TOPOLOGY_MAX_DEPTHAGENT_TOPOLOGY_MAX_RETRIESAGENT_RELATIONSHIP_MAX_CHILDREN
- Provisioning/resource controls:
AGENT_WORKTREE_ROOTAGENT_WORKTREE_BASE_REFAGENT_PORT_BASEAGENT_PORT_BLOCK_SIZEAGENT_PORT_BLOCK_COUNTAGENT_PORT_PRIMARY_OFFSETAGENT_PORT_LOCK_DIRAGENT_DISCOVERY_FILE_RELATIVE_PATH
Documentation Standards
- Update
README.mdfor user-facing behavior. - Update this file for any new environment variables related to agent context or limits.
- Add design/maintenance notes in
docs/for non-trivial architecture decisions.
Quality Gate
Run this before opening a PR:
npm run verify
Equivalent individual commands:
npm run check
npm run check:tests
npm run test
npm run build