Contributing Guide
Goal: make safe, testable, and maintainable contributions without regressions.
Local Setup
bash
pnpm install
pnpm compile
pnpm test:unit
pnpm test:integrationRecommended dev loop:
pnpm compilefor fast type-level feedback.pnpm test:unitfor targeted correctness.pnpm test:integrationbefore merge.
Core Safety Gates
Before opening a PR:
pnpm compilepasses.- Unit tests pass.
- Integration tests pass.
- Behavior of command IDs and settings keys remains stable unless intentional change is documented.
Working on Diagnostics and Quick Fixes
Relevant modules:
src/validation/zodShadow.tssrc/validation/integratorDiagnostics.tssrc/validation/integratorRules.tssrc/validation/codeActions/*
Safety checklist:
- Preserve diagnostic source semantics (
json-schema,openclaw-zod,openclaw-integrator). - Preserve quick-fix payload compatibility.
- Add or update tests in
test/unit/for new rules or transformations. - Validate no regressions in command visibility and activation behavior.
Working on Schema Sync and Artifacts
Relevant modules:
src/schema/artifactManager.tssrc/schema/security.tsscripts/sync-openclaw-schema.mts
Safety checklist:
- Keep HTTPS and allowlist policy enforcement intact by default.
- Keep SHA-256 verification as non-optional for accepted downloads.
- Preserve fallback behavior (
cache->bundled). - Update runbook and troubleshooting docs if sync behavior changes.
Working on Extension Orchestration
Relevant modules:
src/extension.tssrc/extension/settings.tssrc/extension/catalog.tssrc/extension/events.tssrc/extension/commands.ts
Safety checklist:
- Keep initialization lock behavior correct (single in-flight init).
- Preserve command IDs and user-facing command behavior.
- Keep event handlers and revalidation pathways consistent.
- Avoid introducing startup work that breaks lazy activation intent.
Testing Strategy by Change Type
- Documentation-only change:
- Link/accuracy checks, optional test run.
- Validation or code-action change:
- Mandatory unit tests + compile.
- Sync/security change:
- Unit tests around policy/sync behavior + integration sanity.
- Command and activation change:
- Integration tests required.
Documentation Expectations
Any feature or behavior change must update docs in the same PR:
- End-user behavior:
README.md,docs/getting-started.md,docs/commands.md - Settings/policy:
docs/configuration.md - Diagnostics/quick fixes:
docs/diagnostics-and-quick-fixes.md - Operations impact:
docs/runbook.md,docs/troubleshooting.md - Architectural movement:
docs/architecture.md
PR Checklist
- [ ] Compile passes.
- [ ] Unit tests pass.
- [ ] Integration tests pass.
- [ ] Documentation updated for behavior/config changes.
- [ ] Changelog updated for user-visible changes.
Related Guides
- Architecture details:
architecture.md - Operational verification:
runbook.md