Contributing¶
Guidelines for contributing to the Prisma AIRS plugin.
Prerequisites¶
- Node.js 18+
- npm
- Git
Setup¶
git clone https://github.com/cdot65/prisma-airs-plugin-openclaw.git
cd prisma-airs-plugin-openclaw/prisma-airs-plugin
npm ci
npm run check
Branch Naming¶
Prefix personal branches with cdot65/:
Commit Conventions¶
Use conventional commit prefixes:
| Prefix | Use |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
docs: |
Documentation |
refactor: |
Code refactoring |
test: |
Test changes |
chore: |
Maintenance |
Example: feat: add rate limiting for AIRS API calls
Pre-Commit Hooks¶
The project uses Husky + lint-staged. On every commit:
- TypeScript type check (
tsc --noEmit) - ESLint + Prettier on staged
.tsfiles - Full test suite (
vitest run)
If the hook fails, fix the issue and commit again.
Development Workflow¶
- Create a branch:
git checkout -b cdot65/my-feature - Make changes in
prisma-airs-plugin/ - Run
npm run check(typecheck + lint + format + tests) - Commit with conventional prefix
- Push and open a PR
Pull Request Process¶
PR Title¶
Format: type: brief description
PR Description¶
Include:
- Summary of changes
- Motivation
- Testing done
- Breaking changes (if any)
Review Checklist¶
- [ ]
npm run checkpasses - [ ] Documentation updated (if behavior changed)
- [ ] HOOK.md updated (for hook changes)
- [ ] Version bumped in all 3 locations (for releases)
Code Style¶
- TypeScript strict mode
- ESLint with
@typescript-eslintrules - Prettier formatting
- No emojis in code or docs unless explicitly requested
Naming Conventions¶
| Type | Convention | Example |
|---|---|---|
| Files | kebab-case | scan-cache.ts |
| Functions | camelCase | getCachedScanResult |
| Types/Interfaces | PascalCase | ScanResult |
| Constants | UPPER_SNAKE | TTL_MS |
File Structure¶
prisma-airs-plugin/
├── index.ts # Plugin entrypoint
├── package.json
├── openclaw.plugin.json # Plugin manifest + config schema
├── src/
│ ├── scanner.ts # SDK adapter (ScanResult, scan(), mapScanResponse())
│ ├── scanner.test.ts
│ ├── scan-cache.ts # Result caching (30s TTL)
│ ├── scan-cache.test.ts
│ └── config.ts # Mode resolution (FeatureMode, resolveAllModes())
│ └── config.test.ts
└── hooks/
├── prisma-airs-guard/
│ ├── HOOK.md
│ ├── handler.ts
│ └── handler.test.ts
└── ... (12 hooks total)
Adding a New Hook¶
- Create directory:
hooks/prisma-airs-<name>/ - Create
HOOK.mdwith frontmatter (name, description, events) - Create
handler.tswith default export function - Create
handler.test.ts - Add config field to
openclaw.plugin.jsonconfigSchema - Register hook path in
openclaw.plugin.jsonhooks array - Add to docs:
docs/hooks/prisma-airs-<name>.md
Version Locations¶
When releasing, update version in all 3 files:
package.jsonversionfieldopenclaw.plugin.jsonversionfieldindex.ts(3 occurrences: status RPC, CLI command, export const)
Release Process¶
- Update version in all 3 locations
- Update release notes
- Create PR for version bump
- Merge to main
- Create GitHub Release (triggers npm publish)
Questions¶
Open an issue on GitHub.