Thank you for your interest in contributing to Agent NERO. This document provides guidelines and information for contributors.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/agent-nero.git - Install dependencies:
npm install - Create a feature branch:
git checkout -b feature/your-feature-name
- Node.js >= 20.0.0
- npm >= 10.0.0
- An Anthropic API key (for integration testing)
# Direct execution
npx tsx src/index.ts
# With file watching (auto-restart on changes)
npm run devnpm run typecheckAll code must pass TypeScript strict mode with zero errors before submission.
- Strict mode enabled (
"strict": true) - ES2022 target with ESNext modules
- All exports must have explicit types
- Use
constby default,letwhen mutation is required - Prefer
async/awaitover raw promises - Error handling: catch specific error types, never swallow errors silently
- File naming:
kebab-case.ts(e.g.,memory-bus.ts,agent-pool.ts) - Class naming:
PascalCase(e.g.,NeroAgent,MemoryBus) - Tool naming:
snake_casewithnero_prefix for MCP tools (e.g.,nero_spawn) - Internal tools:
snake_casewithout prefix (e.g.,read_file,run_command)
- 2-space indentation
- LF line endings
- UTF-8 encoding
- Trailing newline on all files
- No trailing whitespace (except in Markdown)
See .editorconfig for the full specification.
- Create
src/tools/your-tool.tsfollowing the pattern in existing tools - Define a
registerYourTool()function that takesMcpServerand required dependencies - Use Zod schemas for input validation
- Register the tool in
src/index.ts - Update the tool count comment in
src/index.ts - Document the tool in
docs/API.md - Add to the MCP permissions list in the README
- Add the tool definition to
getToolDefinitions()insrc/agent-tools.ts - Add the executor to
createToolExecutors()in the same file - Include path sanitization for any file system operations
- Respect the
TOOL_TIMEOUT_MSandMAX_OUTPUT_CHARSlimits - Document in
docs/API.md
agent.ts— The tool-use loop is critical. Changes must preserve the Anthropic API contract.memory-bus.ts— Thread safety matters if future async patterns are introduced.agent-pool.ts— Agent lifecycle management. Ensure no memory leaks on kill/reset.
Use clear, descriptive commit messages:
feat: add nero_memory_dump tool for disk export
fix: prevent history pruning from violating user-first constraint
docs: add architecture diagram to README
refactor: extract tool executor factory from agent class
Prefixes: feat, fix, docs, refactor, test, chore, perf
- Ensure
npm run typecheckpasses with zero errors - Test your changes with an actual Claude Code session if possible
- Update documentation for any user-facing changes
- Update
CHANGELOG.mdwith your changes - Keep PRs focused — one feature or fix per PR
- Fill out the PR template completely
Use the bug report template. Include:
- Node.js version
- Claude Code version
- Steps to reproduce
- Expected vs actual behavior
- Relevant logs (stderr output from
[NERO]prefix)
Use the feature request template. Describe:
- The problem your feature solves
- Your proposed solution
- Alternatives you've considered
If you discover a security vulnerability, do not open a public issue. See SECURITY.md for responsible disclosure instructions.
By contributing to Agent NERO, you agree that your contributions will be licensed under the MIT License.