Thank you for your interest in contributing to Groundkeeper! This document provides guidelines and instructions for contributing.
- Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/groundkeeper.git
cd groundkeeper- Install dependencies
npm install- Build the project
npm run build- Run tests
npm testgroundkeeper/
├── src/
│ ├── __tests__/ # Test files
│ ├── phases/ # Phase implementations
│ │ ├── Phase.ts # Base phase class
│ │ ├── ScanPhase.ts # Scan phase
│ │ ├── AnalyzePhase.ts # Analyze phase
│ │ ├── PlanPhase.ts # Plan phase
│ │ ├── ProposePhase.ts # Propose phase
│ │ └── ActPhase.ts # Act phase
│ ├── groundkeeper.ts # Main Groundkeeper class
│ ├── cli.ts # CLI entry point
│ ├── config.ts # Configuration loader
│ ├── types.ts # TypeScript types
│ └── index.ts # Public API exports
├── dist/ # Compiled JavaScript (committed for GitHub Actions)
├── action.yml # GitHub Action manifest
├── package.json
├── tsconfig.json
└── README.md
- Create a feature branch
git checkout -b feature/your-feature-name- Make your changes
- Write code following the existing style
- Add tests for new functionality
- Update documentation as needed
- Run tests
npm test- Build the project
npm run build- Test locally
node dist/cli.js run- Commit your changes
git add .
git commit -m "Description of your changes"- Push and create a pull request
git push origin feature/your-feature-name- Use TypeScript for all code
- Follow existing naming conventions
- Add JSDoc comments for public APIs
- Keep functions focused and testable
- Use meaningful variable names
- Write tests for all new functionality
- Place tests in
src/__tests__/ - Use descriptive test names
- Aim for high code coverage
Example test:
describe('MyFeature', () => {
it('should do something specific', () => {
// Arrange
const input = 'test';
// Act
const result = myFunction(input);
// Assert
expect(result).toBe('expected');
});
});To add a new phase:
- Create a new file in
src/phases/(e.g.,MyPhase.ts) - Extend the
Phasebase class - Implement the
runmethod - Export from
src/phases/index.ts - Add to the phase list in
src/groundkeeper.ts - Add tests in
src/__tests__/
Example:
import { Phase } from './Phase';
import { GroundkeeperContext } from '../types';
export class MyPhase extends Phase {
name = 'my-phase';
protected async run(context: GroundkeeperContext): Promise<any> {
// Your phase logic here
return { result: 'data' };
}
}To add a new task type for the analyze phase:
- Add a new case in
AnalyzePhase.analyzeTask() - Create a private method for the analysis
- Return findings as
Finding[] - Document the task type in README.md
Before creating a release:
- Update version in
package.json - Update CHANGELOG.md (if exists)
- Run
npm run build - Commit the updated
dist/directory - Create a git tag
npm version patch # or minor, or major
npm run build
git add dist/
git commit -m "Build for release"
git tag -a v1.0.1 -m "Version 1.0.1"
git push origin main --tagsWhen reporting issues, please include:
- Groundkeeper version
- Node.js version
- Operating system
- Steps to reproduce
- Expected vs actual behavior
- Error messages or logs
Feel free to open an issue for any questions about contributing!
By contributing, you agree that your contributions will be licensed under the MIT License.