Skip to content

Latest commit

 

History

History
91 lines (66 loc) · 3.1 KB

File metadata and controls

91 lines (66 loc) · 3.1 KB

Contributing

Rethunk AI internal project. External PRs are not expected, but the process is documented for clarity.

Prerequisites

  • Node.js ≥ 22 — see docs/install.md Prerequisites for version notes.
  • Bun ≥ 1.3.11 (packageManager in package.json) — only needed to build and test from source.
  • Git ≥ 2.28.

Development setup

git clone https://github.com/Rethunk-AI/rethunk-github-mcp.git
cd rethunk-github-mcp
bun install
bun run build       # rimraf dist && tsc → dist/
bun run check       # Biome lint + format check
bun run check:fix   # auto-fix with Biome
bun run test        # bun test src/
bun run test:coverage  # bun test src/ --coverage
bun run setup-hooks    # one-time per clone: wire .githooks/

Git hooks

bun run setup-hooks sets core.hooksPath = .githooks.

Hook Runs
pre-commit bun run check + bun run test
pre-push frozen install + build + check + test (mirrors CI)

Set SKIP_GIT_HOOKS=1 to bypass.

Commit conventions

type(scope): imperative summary ≤72 chars

Body explains WHY this change exists — motivation, context, constraints.
Not a file list. Not a summary of what the diff already shows.
Type When
feat New capability
fix Bug corrected
docs Documentation only
refactor No behaviour change
test Test additions or fixes
chore Maintenance, deps, tooling
ci CI/CD config
build Build system changes

One logical unit per commit. Max ~7 files. Split by theme, not by file count.

CI

.github/workflows/ci.yml runs on PRs and pushes to main:

  1. bun install --frozen-lockfile
  2. bun run build
  3. bun run check (Biome)
  4. bun run test:coverage + 80% line coverage threshold assertion
  5. Prerelease npm pack artifact uploaded (90-day retention)

Match the CI steps locally before opening a PR.

Pull request checklist

  • bun run build passes.
  • bun run check passes (no Biome errors).
  • bun run test passes.
  • Any new tool has a corresponding *.test.ts file.
  • docs/mcp-tools.md and README.md tool table updated if the public tool surface changed.
  • CHANGELOG.md entry added under [Unreleased].

Adding a GitHub tool

  1. Create src/server/<tool-name>-tool.ts exporting a register<ToolName>Tool(server: FastMCP) function.
  2. Register it in src/server/tools.ts inside registerRethunkGitHubTools.
  3. Add a test file src/server/<tool-name>-tool.test.ts.
  4. Update docs/mcp-tools.md (tool ID, parameters, JSON shape, error codes) and the README.md tool table.
  5. Follow contract-change rules in AGENTS.md — bump MCP_JSON_FORMAT_VERSION if the JSON envelope changes incompatibly.

Code style

Enforced by Biome (biome.json): recommended rules, 100-char lines, double quotes, semicolons, trailing commas.

TypeScript: strict: true, noUncheckedIndexedAccess: true, verbatimModuleSyntax: true. Avoid any; if genuinely necessary, add an inline comment explaining why.