Thank you for your interest in contributing to the Persona Control Language!
- Project Structure: docs/PROJECT-STRUCTURE.md
- Code of Conduct: docs/GOVERNANCE_MODEL.md
- Security Policy: SECURITY.md
- Fork the repository
- Clone your fork locally
- Install dependencies:
npm install - Create a branch from
main - Make your changes following our standards
- Test your changes (
npm test, coverage β₯90%) - Commit with conventional commit messages
- Push to your fork
- Open a Pull Request
# Clone the repository
git clone https://github.com/personamanagementlayer/pcl.git
cd pcl
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm test
# Run linter
npm run lint
# Type check
npx tsc --noEmitWe use Conventional Commits:
feat: add workflow orchestration support
fix: correct parser validation logic
docs: update getting started guide
chore: update dependencies
test: add integration tests for Phase 1.2
refactor: improve state machine performance
perf: optimize snapshot serialization
Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Code style (formatting, missing semicolons, etc.)refactor: Code refactoringperf: Performance improvementtest: Adding or updating testschore: Build process or auxiliary tool changesci: CI/CD configuration changes
# Run all tests
npm test
# Run with coverage (target: β₯90%)
npm run test:coverage
# Run specific test file
npm test -- tests/runtime.test.ts
# Run tests in watch mode
npm run test:watch
# Run linting
npm run lint
# Fix linting issues automatically
npm run lint:fix
# Type checking
npx tsc --noEmit
# Full quality gate (before PR)
npm run lint && npm test && npm run buildpcl/
βββ src/ # Source code
β βββ ast/ # Abstract Syntax Tree
β βββ lexer/ # Lexical analyzer
β βββ parser/ # Parser
β βββ semantic/ # Semantic analyzer
β βββ runtime/ # Runtime engine
β βββ codegen/ # Code generators
β βββ cli/ # CLI interface
βββ tests/ # Test suites
β βββ integration/ # Integration tests
β βββ benchmarks/ # Performance benchmarks
βββ docs/ # User-facing documentation
βββ examples/ # Example projects
βββ stdlib/ # Standard library (personas & skills)
βββ scripts/ # Build and utility scripts
- Include test case reproducing the bug
- Reference issue number in commit message:
fix: resolve parser issue (#123) - Update relevant documentation if behavior changes
- Ensure all existing tests still pass
- Discuss first: Open an issue to discuss significant features
- Design review: For language changes, document the design approach
- Tests required: Include comprehensive unit and integration tests
- Documentation: Update user guides and API documentation
- Examples: Provide usage examples
- Documentation is licensed under CC BY 4.0 (see LICENSE-DOCS)
- Update both user-facing docs and inline code comments
- Include practical examples
- Check for broken links
- Ensure consistent formatting
- All new code must have tests
- Target coverage: β₯90%
- Write meaningful test descriptions
- Include edge cases and error scenarios
- Use descriptive test names
- DO NOT open public issues for security vulnerabilities
- Report security issues via GitHub Security Advisories
- See SECURITY.md for reporting process
- Include proof of concept if applicable
- Allow time for fixes before disclosure
All contributions MUST maintain:
- β TypeScript strict mode compliance
- β Test coverage β₯90%
- β No ESLint errors
- β Proper error handling
- β Input validation where applicable
- β Audit logging for security-relevant operations
- Use JSDoc for all public APIs
- Include examples in JSDoc comments
- Document parameters, return values, and exceptions
- Explain the "why" not just the "what"
- Write for beginners and experts
- Include code examples
- Use clear, concise language
- Follow markdown best practices
- Test all code examples
/**
* Creates a state machine with typed states and transitions.
*
* @example
* ```typescript
* const machine = createStateMachine<{ count: number }, string>()
* .withInitialState('idle')
* .addStates('processing', 'completed')
* .build();
* ```
*
* @returns A new state machine builder
*/
export function createStateMachine<TContext, TEvent>() {
return new StateMachineBuilder<TContext, TEvent>();
}- Use welcoming and inclusive language
- Respect differing viewpoints and experiences
- Accept constructive criticism gracefully
- Focus on what's best for the community
- Keep discussions on-topic
- Avoid personal attacks
- Provide constructive feedback
- Help newcomers
- Acknowledge contributions from others
- Reference prior work
- Cite sources
PCL uses dual licensing:
- Code (src/, tests/, scripts/): Apache 2.0 License
- Documentation (docs/, *.md): CC BY 4.0
By contributing, you agree that:
- Your code contributions will be licensed under MIT
- Your documentation contributions will be licensed under CC BY 4.0
- You have the right to submit the work under these licenses
- You understand the contribution is public and preserved in version control
Before submitting your PR, ensure:
- Code follows TypeScript best practices
- Tests pass locally (
npm test) - Test coverage β₯90% (
npm run test:coverage) - Linting passes (
npm run lint) - Type checking passes (
npx tsc --noEmit) - Build succeeds (
npm run build) - Documentation updated (if applicable)
- CHANGELOG.md updated (for user-facing changes)
- Conventional commit message format used
- PR description clearly explains the change
- Related issues linked
## Description
Brief description of the changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
Describe the tests you ran and how to reproduce them
## Checklist
- [ ] Tests pass
- [ ] Documentation updated
- [ ] CHANGELOG updatedNew to PCL?
- Start with Getting Started Guide
- Read Persona Building Guide
- Explore examples/ directory
- Review stdlib/ for standard personas and skills
Contributing to Core?
- Read CLAUDE.md for project architecture
- Review docs/PROJECT-STRUCTURE.md
- Check tests/ for testing patterns
- Study existing code in src/runtime/
Phase 1.2 Implementation:
- See .roadmap/PHASE-1.2-COMPLETE.md
- State Machines: src/runtime/state-machine.ts
- Team Edge Cases: src/runtime/team-edge-cases.ts
- Snapshot/Restore: src/runtime/snapshot.ts
- Automated Checks: CI runs tests, linting, type checking
- Initial Review: Maintainer reviews for general approach
- Detailed Review: Line-by-line code review
- Revisions: Address feedback and update PR
- Approval: At least one maintainer approval required
- Merge: Squash merge to main branch
When reporting bugs, include:
- Environment: OS, Node version, PCL version
- Steps to Reproduce: Minimal reproduction steps
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Code Sample: Minimal code that demonstrates the issue
- Logs: Relevant error messages or stack traces
When requesting features:
- Use Case: Describe the problem you're trying to solve
- Proposed Solution: Suggest how it might work
- Alternatives: What alternatives have you considered?
- Context: Why is this important?
- Examples: Provide usage examples if possible
- Questions: Open a GitHub Discussion
- Issues: Use GitHub Issues
- Documentation: Check docs/ folder
- Examples: Review examples/ folder
Contributors are recognized in:
CHANGELOG.mdfor their contributions- GitHub insights and contribution graphs
- Project documentation (where appropriate)
- Development Guide: CLAUDE.md
- Project Structure: docs/PROJECT-STRUCTURE.md
- Skills Guide: docs/SKILLS_INTEGRATION_GUIDE.md
- VS Code Setup: docs/VSCODE_SETUP.md
Thank you for making PCL better! π
We appreciate your contributions and look forward to reviewing your pull requests.