Thank you for your interest in contributing! This document provides guidelines and setup instructions for contributors.
git clone https://github.com/the-perfect-developer/the-perfect-opencode.git
cd the-perfect-opencodeSet up git hooks for automatic code quality checks:
./scripts/setup-hooks.shThis configures git to use hooks from the .githooks/ directory.
This repository uses git hooks to maintain code quality:
The pre-commit orchestrator (.githooks/pre-commit) runs 4 validation hooks in sequence:
| Hook | Purpose |
|---|---|
10-validate-bash.sh |
Syntax-checks staged .sh files with bash -n |
20-validate-skills.sh |
Validates SKILL.md frontmatter for staged skill files |
30-validate-python-ruff.sh |
Runs Ruff lint + format check on staged Python files |
40-validate-eslint.sh |
Runs ESLint on staged JS/TS files (only activates if a root package.json exists) |
Example output:
[10-validate-bash] Validating bash script syntax...
✓ install.sh
[20-validate-skills] Validating SKILL.md files...
✓ .opencode/skills/python/SKILL.md
[30-validate-python-ruff] Running Ruff...
✓ No lint errors
[40-validate-eslint] Running ESLint...
✓ No lint errors
All hooks passed.
| Workflow | Trigger | Action |
|---|---|---|
validate-bash.yml |
PR/push to main |
bash -n all .sh files |
validate-skills.yml |
PR/push to main |
Validate all SKILL.md frontmatter |
generate-catalog.yml |
Push to main or develop |
Auto-regenerate opencode-catalog.json |
generate-tools-docs.yml |
Push to main or develop (path-filtered) |
Auto-regenerate docs/tools-reference.md |
Note:
opencode-catalog.jsonanddocs/tools-reference.mdare auto-generated — do not edit them manually.
All bash scripts must:
- Have valid syntax (verified by
bash -n) - Include proper shebang (
#!/bin/bash) - Be executable (
chmod +x) - Follow consistent formatting
Python code is enforced by Ruff (lint + format), configured in pyproject.toml.
ruff check . # lint
ruff check --fix . # lint + auto-fix
ruff format . # format
ruff format --check . # format check (CI mode)JS/TS files in consumer projects are enforced by ESLint. The 40-validate-eslint.sh hook only activates when a root package.json is present.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Ensure all git hooks pass
- Commit your changes following Conventional Commits (
git commit -m 'feat: add amazing feature') All commits must follow the Conventional Commits spec (feat,fix,docs,refactor,chore, etc.) - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Ensure all CI checks pass
- Provide clear description of changes
- Reference any related issues
- Keep changes focused and atomic
Feel free to open an issue for:
- Bug reports
- Feature requests
- Documentation improvements
- General questions
By contributing, you agree that your contributions will be licensed under the MIT License.