A copilot-instructions.md template for open source projects with contribution guidelines, documentation standards, and changelog conventions.
## copilot-instructions.md for Open Source Projects
This is an open source project. Follow these conventions to maintain consistency across contributors:
### Code Quality Standards
- All code must pass CI checks: linting, formatting, type checking, tests
- No warnings allowed: treat all warnings as errors in CI
- Maximum function complexity: 10 (cyclomatic complexity)
- Maximum file length: 300 lines; split larger files into modules
- 100% type coverage; no implicit `any` in TypeScript or missing types
### Commit Conventions
- Conventional Commits format: `type(scope): description`
- Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`, `perf`
- Scope: module or feature area affected
- Description: imperative mood, lowercase, no period at end
- Body: explain what and why, not how
- Footer: reference issues with `Closes #123` or `Fixes #456`
### Pull Request Standards
- PR title follows Conventional Commits format
- Description includes: what changed, why, how to test
- Link related issues with `Closes #issue`
- Keep PRs small: under 400 lines changed; split larger changes
- All CI checks must pass before review
- At least one maintainer approval required
### Documentation
- JSDoc/docstring on all exported functions, classes, and types
- `@param`, `@returns`, `@throws`, `@example` tags required
- Update README.md when adding features or changing API
- Include inline comments only for non-obvious logic: explain why, not what
- API documentation auto-generated from code comments
### Backward Compatibility
- Follow Semantic Versioning (SemVer) strictly
- Breaking changes only in major versions with migration guide
- Deprecate before removing: add `@deprecated` with removal version
- Maintain changelog in `CHANGELOG.md` following Keep a Changelog format
- Feature flags for experimental features
### Testing Requirements
- New features must include tests; PRs without tests will be rejected
- Bug fixes must include regression tests
- Test descriptions explain the expected behavior: `it('should return empty array when no items match')`
- Edge cases: null, undefined, empty, boundary values, large inputs
- Integration tests for public API surface
### Accessibility & Internationalization
- All user-facing strings must be i18n-ready (no hardcoded English)
- Accessible markup: semantic HTML, ARIA attributes, keyboard navigation
- Support RTL layouts where applicable
- Date, number, and currency formatting via Intl API
### Security
- Never commit secrets, tokens, or credentials
- Validate and sanitize all external input
- Dependency updates reviewed for security advisories
- Report vulnerabilities via SECURITY.md process, not public issuesFree to copy and use. Compatible with GitHub Copilot, GPT-5.
Save as .github/copilot-instructions.md in your open source repository. This helps all contributors get consistent Copilot suggestions aligned with project standards.
Initial release
Sign in and download this prompt to leave a review.