Thank you for your interest in contributing to CatNet.
- Open an issue before large changes.
- Keep changes focused and small.
- Align with repository scope.
- Prefer incremental pull requests.
- Code builds successfully.
- Tests pass locally.
- Documentation is updated when applicable.
- No unrelated files were changed.
- The PR description explains what changed and why.
UI repositories must not duplicate core scanning logic.
-
Pin third-party actions by commit SHA
- Every
uses:directive referencing a third-party action must use a full commit SHA (40 hex chars), optionally followed by a# vX.Y.Zcomment for readability. - Floating tags (
@v1,@v2,@master) are not permitted. - Dependabot is configured to open PRs for action updates — reviewers must ensure SHA pinning is maintained.
- Every
-
Explicit workflow permissions
- Every workflow file must declare a top-level
permissions:block. - Use the least-privilege scope:
permissions: contents: read
- Only jobs that need write access (e.g., creating releases) should override this.
- Every workflow file must declare a top-level
-
Security scanning baseline The following tools are mandatory in CI:
- Govulncheck — Go vulnerability scanning
- Snyk — Go and npm dependency scanning
- Semgrep — SAST for Go and TypeScript
- Dependabot — automated dependency bump PRs
-
Avoid dangerous triggers
pull_request_targetmust not be used unless absolutely necessary, and only with explicit checkout of the base ref.scheduletriggers on security scans should run at most once per day.
-
Build matrix and caching
- Use build matrices for cross-platform releases (already done in
release.yml). - Cache Go modules (
actions/cacheorsetup-go cache) to reduce CI time. - Cache bun dependencies similarly.
- Use build matrices for cross-platform releases (already done in
-
Accessibility checklist
- All interactive elements must be keyboard accessible (
tabIndex,onKeyDownfor Enter/Space). - Sortable table headers must include
aria-sort(ascending/descending/none). - Do not override native ARIA roles (e.g.,
role="button"on<th>removescolumnheader). - Focus indicators must use
:focus-visible(not:focus) to avoid cluttering mouse users. - Color contrast must meet WCAG AA (4.5:1 for normal text, 3:1 for large text).
- Error states must include
aria-invalid,aria-describedby, androle="alert"where appropriate.
- All interactive elements must be keyboard accessible (
-
Reusable components
- Do not duplicate accessibility logic across inline JSX. Extract shared patterns into components under
frontend/src/components/. - Each component must have a corresponding unit test file.
- Do not duplicate accessibility logic across inline JSX. Extract shared patterns into components under
-
PR size
- Maximum recommended: ~300 lines changed. Larger PRs should be split into logical feature branches.
- Exceptions: dependency bumps (can be mechanical across many files).
-
Branch naming
feature/<description>for new featuresfix/<description>for bug fixes- Avoid machine-generated random suffixes in branch names. Use semantic, human-readable names.
- Collaboration Branch: The
developbranch is the primary integration branch for development. All contributor pull requests must targetdevelop. - Main Branch Restrictions: The
mainbranch is reserved for stable releases. Pull requests targetingmainmust:- Come exclusively from
develop. - Be automatically created by
github-actions[bot].
- Come exclusively from
- Signed Commits: All commits in pull requests targeting
mainmust be signed (GPG or SSH signature) to ensure verification and integrity.