Thanks for your interest in contributing to opencode-damage-control.
- Node.js 22+
- npm
git clone https://github.com/whjvenyl/opencode-damage-control.git
cd opencode-damage-control
npm installnpm run build # Compile TypeScript to dist/
npm test # Run all tests (352 tests)src/
patterns.ts 108 patterns, 103 paths, matching helpers
config.ts Config loading, validation, merging
index.ts Plugin entry point (2 hooks)
patterns.test.ts 326 pattern tests
config.test.ts 26 config tests
patterns.ts-- all pattern/path data and matching logic. This is where new patterns and paths go.config.ts-- config file loading, validation, and merge semantics.index.ts-- thin entry point that wires hooks. Should stay small.
- Add the regex and metadata to
DEFAULT_PATTERNSinsrc/patterns.ts - Add test cases to
src/patterns.test.ts(both matching and non-matching) - Run
npm testto verify - Update
docs/patterns.mdwith the new entry
- Add the path to the appropriate tier in
DEFAULT_PROTECTED_PATHSinsrc/patterns.ts - Add test cases to
src/patterns.test.ts - Run
npm testto verify - Update
docs/paths.mdwith the new entry
Use branch prefixes for automatic PR labeling:
| Prefix | Label |
|---|---|
feature/ |
enhancement |
fix/ |
bug |
chore/ |
chore |
docs/ |
documentation |
- One concern per PR
- Include tests for new patterns/paths
- Ensure
npm testpasses andnpm run buildsucceeds - Fill out the PR template
- Zero runtime dependencies -- keep it that way
- Tests use
node:test(no test framework dependency) - TypeScript strict mode