Thank you for your interest in contributing to MARVEL. This document covers the process for submitting changes.
- Fork the repository and clone your fork
- Install dependencies:
pnpm install - Build:
pnpm build - Run tests:
pnpm test:run
The build pipeline runs tests, type checks, compiles TypeScript, bundles the daemon, and validates the settings schema. All steps must pass.
The hook daemon source lives in marvel/tools/hooks/src/. After making changes:
pnpm typecheck # Type check without emitting
pnpm test:run # Run tests once
pnpm build # Full build (test + typecheck + compile + bundle + validate)For iterative development, use pnpm test (vitest watch mode) and pnpm dev (tsc watch mode).
- Create a branch from
main - Make your changes
- Ensure
pnpm buildpasses - Write a clear commit message describing why, not just what
- Open a pull request against
main
Use conventional commit style:
feat: add support for pack dependencies
fix: prevent duplicate lesson injection after compaction
docs: clarify relevance scoring thresholds
Packs are the primary extension point. To create a new pack:
- Create a directory under
marvel/packs/<pack-name>/ - Add
pack.jsonwith required fields (name,version,owner) - Add
guardrails.mdwith clear, actionable rules - Add an empty
lessons.jsonl
See docs/packs.md for the full pack specification.
- Be specific. Vague rules ("write good code") are not useful. Concrete instructions ("use
unknowninstead ofanyfor untyped values") are. - Scope narrowly. A pack should cover one domain. Don't combine unrelated concerns.
- Test relevance. Verify your pack's
applies_to.extensionsandsensitive_pathstrigger on the right files.
Changes to marvel/security/allowlist.json and marvel/security/denylist.json affect command evaluation for all users. Be conservative:
- Allowlist additions should be clearly safe in all contexts
- Denylist additions should be dangerous in nearly all contexts
- When in doubt, let the LLM evaluator handle it
- TypeScript with strict mode enabled
- ES modules (
import/export, notrequire) - No runtime dependencies except
ws(WebSocket library) - Prefer explicit types over inference for public APIs
- Tests use vitest
Open an issue with:
- What you expected to happen
- What actually happened
- Steps to reproduce
- Daemon log output if relevant (
bin/marvel-daemon log)
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.