Skip to content

Latest commit

 

History

History
90 lines (67 loc) · 2.19 KB

File metadata and controls

90 lines (67 loc) · 2.19 KB

Contributing to Ritsu

Prerequisites

Setup

cd Ritsu/runtime
bun install

Development

# Build
bun run build

# Test (70 files, 479 tests)
bun run test

# Test single file
bun run test -- tests/policy/engine.test.ts

# Run tests from src/tests/ (newer modules)
bun test src/tests/contract-verification.test.ts

# Lint
bun run lint

# Type check
bunx tsc --noEmit

Project Architecture

Ritsu/
  skills/            8 SKILL.md instruction files, one per slash command
  rules/             Policy definitions (anti-patterns, guardrails)
  _shared/           MCP tool schemas, JSON Schema, shared protocols
  runtime/
    src/
      handlers/      24 MCP tool handlers
      policy/        11 detectors + import graph + blast radius
      orchestration/ Preflight, diff-inspect, multi-agent, architecture
      cli/           CLI subcommands (doctor, report, violations, etc.)
    tests/           Unit tests (vitest)
  AGENTS.md          Project baseline (generated by /r-init)
  CLAUDE.md          AI onboarding guide

Guidelines

  • Positive rules: Write "use const" not "don't use let" — positive rules halve violations
  • Skill vs Rule vs Script:
    • Needs AI judgment → skills/<stage>/SKILL.md
    • Deterministic output → runtime/src/ (handler or CLI)
    • Always-on guardrail → rules/anti-patterns.yaml
  • Add wrong/right/story examples when adding new anti-patterns
  • New features need tests — verify with bun run test before PR

Conventional Commits

  • feat: new feature
  • fix: bug fix
  • docs: documentation
  • chore: maintenance
  • refactor: code restructure
  • test: test additions/fixes

Skill Development

  1. Create directory in skills/<name>/
  2. Provide SKILL.md with YAML frontmatter (name, version, tags)
  3. Add structured Gotchas table at the bottom
  4. Follow _shared/skill-common-steps.md protocol

Release Process

  1. Update version in package.json and runtime/package.json
  2. Update AGENTS.md ritsu-version field
  3. Add entry to CHANGELOG.md
  4. Tag the release: git tag v8.x.x
  5. Push: git push && git push --tags

Code of Conduct

Be respectful and professional in all interactions.