Thank you for your interest in contributing to OpenCroc! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to abide by our Code of Conduct.
- Use the Bug Report issue template
- Include your Node.js version, OS, and OpenCroc version
- Provide a minimal reproduction if possible
- Use the Feature Request issue template
- Describe the use case and expected behavior
- Fork the repository
- Create a branch from
main:git checkout -b feat/my-feature - Make your changes with clear, focused commits
- Add tests for new functionality
- Run the test suite:
npm test - Submit a PR against
main
| Prefix | Purpose |
|---|---|
feat/ |
New features |
fix/ |
Bug fixes |
docs/ |
Documentation only |
refactor/ |
Code restructuring |
test/ |
Test additions/changes |
chore/ |
Build, CI, tooling |
We follow Conventional Commits:
feat(parser): add TypeORM entity parser
fix(self-healing): prevent rollback on partial success
docs(readme): add Prisma to supported ORMs
test(pipeline): add chain planner edge case coverage
# Clone your fork
git clone https://github.com/<your-username>/opencroc.git
cd opencroc
# Install dependencies
npm install
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Build
npm run build
# Lint
npm run lintopencroc/
├── src/
│ ├── cli/ # CLI entry points
│ ├── core/ # Orchestrator, pipeline, config
│ ├── parsers/ # Source code parsers (ts-morph)
│ ├── generators/ # Test code + ER diagram generators
│ ├── planners/ # Chain planning (DAG + greedy)
│ ├── validators/ # 3-layer config validation
│ ├── self-healing/ # AI attribution + controlled fix
│ ├── reporters/ # HTML/JSON/Markdown reporters
│ ├── observation/ # Network monitor + log completion
│ └── adapters/ # ORM/framework adapters
├── tests/
│ ├── unit/ # Unit tests (Jest)
│ └── e2e/ # Integration tests
├── docs/ # Documentation
└── examples/ # Example projects
- Source-first: Always derive test knowledge from actual source code, not guesses
- Safety gates: Self-healing must have dry-run → verify → rollback at every step
- Adapter pattern: ORM/framework support via pluggable adapters, not hardcoded logic
- Fail-open: When AI is unavailable, fall back to heuristics — never block execution
- Observable: Every decision point should produce a traceable artifact (JSON/Mermaid/log)
- Create
src/adapters/<orm>-adapter.tsimplementingBackendAdapter - Add parser in
src/parsers/<orm>-model-parser.ts - Register in
src/adapters/index.ts - Add tests in
tests/unit/adapters/<orm>-adapter.test.ts - Add example project in
examples/<orm>-example/
- Create
src/ai/<provider>.tsimplementingLlmProvider - Register in
src/ai/index.ts - Add to
opencroc.config.tsprovider union type - Document in
docs/ai-providers.md
- All PRs require at least 1 approval
- CI must pass (lint + tests)
- Breaking changes require RFC discussion in an issue first
By contributing, you agree that your contributions will be licensed under the MIT License.