Thank you for your interest in contributing to nightwire!
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/nightwire.git - Create a branch:
git checkout -b feature/your-feature - Make your changes
- Run tests:
python -m pytest tests/ -v --tb=short - Commit:
git commit -m "Add your feature" - Push:
git push origin feature/your-feature - Open a Pull Request
nightwire/
├── bot.py # Main bot: message routing, command dispatch
├── claude_runner.py # Claude CLI subprocess with retry and error classification
├── config.py # YAML/env configuration loader
├── nightwire_runner.py # nightwire AI assistant (OpenAI / Grok provider)
├── security.py # Auth, rate limiting, path validation, input sanitization
├── project_manager.py # Multi-project management
├── plugin_base.py # Plugin base class and PluginContext API
├── plugin_loader.py # Plugin auto-discovery and lifecycle management
├── exceptions.py # Structured exception hierarchy
├── attachments.py # Image download and processing
├── prd_builder.py # Robust JSON parsing for autonomous PRDs
├── autonomous/
│ ├── loop.py # Parallel task dispatch with dependency resolution
│ ├── executor.py # Task execution with git safety and verification
│ ├── verifier.py # Independent code review (fail-closed for security)
│ ├── quality_gates.py # Test runner with baseline snapshots
│ ├── database.py # SQLite operations for PRDs, stories, tasks
│ ├── models.py # Pydantic models for all autonomous data
│ ├── commands.py # Signal command handlers for autonomous system
│ └── exceptions.py # Exception hierarchy
└── memory/
├── manager.py # Memory API: store, recall, semantic search
├── database.py # SQLite + sqlite-vec for vector storage
└── haiku_summarizer.py # Conversation summarization
- Fail-closed verification: Security concerns or logic errors in code review block task completion
- Parallel execution: Tasks dispatched to concurrent workers with dependency-aware batching
- Regression detection: Pre-task test baselines compared to post-task results
- Error retry: Transient failures (rate limits, timeouts) retried with exponential backoff
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install in editable mode with dev dependencies (pyproject.toml)
pip install -e ".[dev]"
# Fallback: if using requirements.txt
# pip install -r requirements.txt
# pip install pytest pytest-asyncio black ruff
# Run linting
ruff check nightwire/
black --check nightwire/
# Run tests
python -m pytest tests/ -v --tb=shortnightwire supports custom plugins in the plugins/ directory. See plugins/README.md for the full guide.
Quick start:
- Create
plugins/my_plugin/plugin.py - Subclass
NightwirePluginfromnightwire.plugin_base - Override
commands(),message_matchers(),on_start(),on_stop(),help_sections()as needed - Add config to
config/settings.yamlunderplugins.my_plugin - Restart the bot — your plugin loads automatically
- Use Black for formatting
- Use Ruff for linting
- Follow PEP 8 conventions
- Add type hints to function signatures
- Write docstrings for public functions
- Keep PRs focused on a single feature or fix
- Update documentation if needed
- Add tests for new functionality
- Ensure all tests pass
- Write clear commit messages
When reporting bugs, please include:
- Python version
- Operating system
- Steps to reproduce
- Expected vs actual behavior
- Relevant logs
Feature requests are welcome! Please describe:
- The problem you're trying to solve
- Your proposed solution
- Any alternatives you've considered
Be respectful and constructive in all interactions.
By contributing, you agree that your contributions will be licensed under the MIT License.