Thank you for your interest in contributing! This document provides guidelines and instructions.
- Bun (recommended) or Node.js 18+
- Git
# Clone the repository
git clone https://github.com/Tpypan/AgentPostmortem.git
cd AgentPostmortem
# Install dependencies
bun install
# Run tests
bun test
# Build
bun run build
# Lint
bun run lintsrc/
├── index.ts # Plugin entry point & tool definitions
├── postmortem.plugin.ts # OpenCode plugin loader
├── analysis.ts # Failure classification logic
├── injection.ts # Guardrail injection system
├── inspect.ts # Context inspector
├── record-failure.ts # Failure recording
├── retry.ts # Retry with guardrails
├── why-failed.ts # Failure analysis
├── manage-failures.ts # Failure record management
├── manage-rules.ts # Prevention rule management
├── redaction.ts # Secret redaction
├── selection.ts # Rule selection algorithm
├── eval.ts # Metrics evaluation
├── model.ts # Zod schemas & types
├── snapshot/ # Last-run context capture
├── storage/ # File storage & locking
├── store/ # Failure store operations
└── templates/ # Command/skill templates
- TypeScript with strict mode
- ES modules (ESM)
- Zod for validation
- Functional style preferred
Follow conventional commits:
feat:— New featurefix:— Bug fixdocs:— Documentation onlytest:— Adding/updating testsrefactor:— Code refactoringchore:— Maintenance tasks
- All new features need tests
- All bug fixes need regression tests
- Run
bun testbefore submitting
- Fork the repository
- Create a feature branch (
git checkout -b feat/my-feature) - Make your changes
- Add/update tests
- Run tests:
bun test - Run lint:
bun run lint - Commit with conventional commit message
- Push and open a pull request
- Create the tool in
src/(e.g.,src/my-command.ts) - Add Zod schema in
src/model.ts - Register the tool in
src/index.ts - Create template files:
src/templates/commands/my-command.mdsrc/templates/skills/my-command/SKILL.md
- Add tests in
test/my-command.test.ts - Update README.md command table
- Never log or persist unredacted secrets
- All user input must be validated with Zod
- File operations must handle edge cases (symlinks, locks, corruption)
Open an issue for bugs, feature requests, or questions.
By contributing, you agree that your contributions will be licensed under the MIT License.