Bug Reports
Found a bug? Report it via GitHub Issues.
Include:
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Node version)
- Error messages or screenshots
We’re thrilled that you’re interested in contributing to Cortex TMS! This guide will help you get started, whether you’re fixing a typo, proposing a feature, or submitting your first pull request.
Cortex TMS is built on the principle of “Pragmatic Rigor”—we value quality, clarity, and user trust while keeping the barrier to contribution low.
Bug Reports
Found a bug? Report it via GitHub Issues.
Include:
Feature Requests
Have an idea for a new feature? Open a GitHub Issue with the “enhancement” label.
Describe:
Code Contributions
Fix bugs, add features, or improve performance by submitting pull requests.
Focus areas:
Documentation Improvements
Help make Cortex TMS more accessible by improving documentation.
Opportunities:
Community Support
Help other users succeed with Cortex TMS.
Activities:
Translations (Future)
Coming in v3.0: Help translate templates and documentation into other languages.
Target languages:
Core Principles:
Reporting Issues: If you experience or witness unacceptable behavior, contact the maintainers at [email protected] (confidential).
Before contributing, ensure you have:
node --version)Look for issues labeled “good first issue” or “help wanted”:
Recommended Areas for First-Time Contributors:
See Development Setup for detailed instructions on:
Click the “Fork” button on the Cortex TMS GitHub page.
This creates a copy of the repository under your GitHub account.
git clone https://github.com/YOUR_USERNAME/cortex-tms.gitcd cortex-tmsLink your fork to the original repository:
git remote add upstream https://github.com/cortex-tms/cortex-tms.gitgit fetch upstreamThis allows you to pull in the latest changes from the main repository.
Follow the branch naming convention from Git Standards:
git checkout -b feat/TMS-123-add-json-export# orgit checkout -b fix/234-validate-crash# orgit checkout -b docs/update-contributing-guideBranch Name Format: [type]/[ID]-[description]
Types:
feat/ - New featuresfix/ - Bug fixesdocs/ - Documentation onlyrefactor/ - Code restructuringchore/ - Maintenance taskstest/ - Test additions/fixesFollow the patterns and conventions documented in:
Before You Code:
docs/core/PATTERNS.md to understand template design patternsdocs/core/DOMAIN-LOGIC.md to understand TMS principlessrc/__tests__/ for examplesEvery code change should include tests:
import { describe, it, expect } from 'vitest';import { myNewFeature } from '../commands/myNewFeature';
describe('myNewFeature', () => { it('should handle valid input correctly', () => { const result = myNewFeature('valid-input'); expect(result).toBe('expected-output'); });
it('should throw error on invalid input', () => { expect(() => myNewFeature(null)).toThrow('Input cannot be null'); });});Test Coverage Requirements:
Run tests locally:
pnpm testDocumentation changes should accompany code changes:
For CLI Commands:
CLI-USAGE.md with command syntax and exampleswebsite/src/content/docs/reference/cli/For Template Changes:
templates/README.md if template structure changesdocs/core/PATTERNS.md with new patternsFor New Features:
CHANGELOG.md under “Unreleased” section (if major feature)Follow Conventional Commits format:
git add .git commit -m "feat(cli): add JSON export for status command
Implements --json flag for cortex-tms status to enableprogrammatic consumption of project health data.
Closes #123
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>"Commit Message Format: [type]([scope]): [subject]
Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Code formatting (no logic change)refactor: Code restructuring (no behavior change)test: Adding or fixing testschore: Maintenance tasks (dependencies, build scripts)Scopes (optional but recommended):
cli: CLI command changesvalidate: Validation enginemigrate: Migration systemtemplates: Template filesdocs: Documentationtests: Test suiteGood Commit Examples:
✅ feat(migrate): add selective file upgrade option✅ fix(validate): handle missing .cortexrc gracefully✅ docs: update contributing guide with commit examples✅ refactor(backup): simplify manifest creation logic✅ test(release): add rollback failure scenarioBad Commit Examples:
❌ update files (too vague)❌ fix bug (no context)❌ feat: added new feature (past tense, no scope)git push origin feat/TMS-123-add-json-exportPull Request Title: Should match your commit message format
feat(cli): add JSON export for status commandPull Request Description Template:
## SummaryAdds `--json` flag to `cortex-tms status` command for programmatic consumption.
## Related References- Closes #123- Related to #45 (API documentation request)
## Changes- Added `--json` flag to status command- Implemented JSON serializer for project health data- Updated CLI-USAGE.md with examples- Added 5 tests covering JSON output scenarios
## Testing- ✅ Unit tests passing (5 new tests added)- ✅ Manual testing: `cortex-tms status --json | jq .`- ✅ Backward compatibility verified (default behavior unchanged)
## Screenshots/Examples```bash$ cortex-tms status --json{ "projectName": "my-project", "scope": "standard", "health": "passing", "sprintProgress": 0.75, "tasks": { "done": 6, "inProgress": 2, "todo": 0 }}### 11. PR Review Process
**What to Expect**:1. **Automated Checks** (GitHub Actions): - Linting (`pnpm run lint`) - Tests (`pnpm test`) - Build verification (`pnpm build`) - Validation (`cortex-tms validate --strict`) - Documentation sync check (`pnpm run docs:check`)
2. **Maintainer Review** (1-3 days typically): - Code quality and style - Test coverage - Documentation completeness - Alignment with project philosophy
3. **Feedback and Iteration**: - Address review comments by pushing new commits to the same branch - Engage in discussion if you disagree with feedback (constructively)
4. **Approval and Merge**: - Once approved, a maintainer will merge your PR - Your branch will be automatically deleted on GitHub (if enabled)
**Tips for Faster Reviews**:- Keep PRs focused (one feature/fix per PR)- Include tests and documentation- Respond promptly to feedback- Use clear commit messages
---
## Code Guidelines
### TypeScript Conventions
**Style Rules** (enforced by ESLint):
```typescript// ✅ Use explicit types for function parametersfunction validateFile(filePath: string, config: Config): ValidationResult { // ...}
// ❌ Avoid implicit anyfunction validateFile(filePath, config) { // ...}
// ✅ Use const for immutable valuesconst MAX_FILE_SIZE = 1000;
// ❌ Avoid let for constantslet MAX_FILE_SIZE = 1000;
// ✅ Use async/await for asynchronous operationsasync function readTemplate(path: string): Promise<string> { return await fs.readFile(path, 'utf-8');}
// ❌ Avoid callback hellfunction readTemplate(path: string, callback: Function) { fs.readFile(path, 'utf-8', (err, data) => { callback(err, data); });}Naming Conventions:
validateConfig, parseMarkdown)ReleaseEngine, BackupManager)MAX_LINE_LIMIT, DEFAULT_SCOPE)Config, ValidationResult)Error Handling:
// ✅ Use descriptive error messages with contextif (!fs.existsSync(filePath)) { throw new Error( `File not found: ${filePath}\n\n` + `Expected location: ${path.resolve(filePath)}\n` + `Tip: Run 'cortex-tms init' to create missing files.` );}
// ❌ Avoid generic error messagesif (!fs.existsSync(filePath)) { throw new Error('File not found');}Prefer Functional Patterns:
// ✅ Use array methods for transformationsconst outdatedFiles = files.filter(f => f.version < currentVersion);
// ❌ Avoid manual loops when array methods sufficeconst outdatedFiles = [];for (const file of files) { if (file.version < currentVersion) { outdatedFiles.push(file); }}Test Structure (using Vitest):
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
describe('Feature: Template Migration', () => { beforeEach(() => { // Setup: Create test fixtures });
afterEach(() => { // Cleanup: Remove test files });
describe('when file is outdated', () => { it('should detect version mismatch', () => { // Arrange const file = createTestFile('2.5.0'); const currentVersion = '2.6.0';
// Act const result = detectOutdated(file, currentVersion);
// Assert expect(result.isOutdated).toBe(true); expect(result.currentVersion).toBe('2.5.0'); expect(result.targetVersion).toBe('2.6.0'); }); });
describe('when file is customized', () => { it('should detect user modifications', () => { // Test implementation }); });});Test Coverage Goals:
Run Tests:
pnpm test # Run all testspnpm test:watch # Run tests in watch modepnpm test:coverage # Generate coverage reportInline Code Comments:
// ✅ Explain WHY, not WHAT// Backup must succeed before any file modifications to ensure rollback safetyconst backupPath = await createBackup(files, 'pre-migration');
// ❌ State the obvious// Create a backupconst backupPath = await createBackup(files, 'pre-migration');Function Documentation (TSDoc format):
/** * Validates project structure against TMS requirements. * * @param projectRoot - Absolute path to project root directory * @param config - Optional configuration overrides from .cortexrc * @returns Validation result with issues array and pass/fail status * @throws Error if projectRoot does not exist * * @example * ```typescript * const result = await validateProject('/path/to/project'); * if (!result.isValid) { * console.error(result.issues); * } * ``` */export async function validateProject( projectRoot: string, config?: Config): Promise<ValidationResult> { // Implementation}README and Guide Updates:
Documentation improvements are some of the most valuable contributions! No code changes needed.
Simple Process:
docs: fix typo in contributing guideNo local setup required for simple documentation fixes!
Good Documentation Examples:
Before (unclear):
Run the validate command with the fix flag.After (clear):
To automatically repair missing files, run:
```bashcortex-tms validate --fixThis will:
### Adding Tutorials
**Tutorial Structure** (recommended):1. **Goal**: What will users accomplish?2. **Prerequisites**: What do they need before starting?3. **Step-by-Step Instructions**: Numbered steps with code examples4. **Verification**: How to confirm it worked?5. **Next Steps**: Where to go from here?
**Example Tutorial Outline**:```markdown---title: Creating Custom Validation Rules---
## GoalBy the end of this tutorial, you'll have a custom validator that checks for specific ticket ID formats in task descriptions.
## Prerequisites- Cortex TMS 2.6.0 or higher installed- Basic TypeScript knowledge- Project initialized with `cortex-tms init`
## Step 1: Create Validator File[Instructions...]
## Step 2: Register Validator[Instructions...]
## VerificationRun `cortex-tms validate` and confirm your rule executes.
## Next Steps- Read [Validation API Reference](/reference/validation-api)- Explore [Community Validators](https://github.com/cortex-tms/community-validators)Status: Coming in v3.0
How to Prepare:
templates/ directoryHelp others succeed with Cortex TMS by:
Where to Help:
Good Answer Checklist:
Anyone can review PRs! You don’t need commit access.
What to Check:
Leave Constructive Feedback:
Help shape future releases:
npm install -g cortex-tms@betaProvide Feedback:
All contributors are recognized in:
Cortex TMS embraces AI-assisted development. If you use Claude Code, GitHub Copilot, or other AI tools:
Add co-author credit:
git commit -m "feat(cli): add JSON export
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>"Why This Matters:
Simple CLA (implicit on first contribution):
By submitting a pull request, you agree that:
No Separate Signature Required - Contributing implies agreement.
Cortex TMS is licensed under the MIT License. Your contributions will also be licensed under MIT.
What This Means:
Resources:
docs/core/ARCHITECTURE.md in repositorysrc/__tests__/ for examplesBefore Asking:
How to Reach Us:
Response Times (typical):
Looking for inspiration? Here are high-impact contribution areas:
Thank you for contributing to Cortex TMS! Every contribution—whether it’s a typo fix, a new feature, or answering someone’s question—makes the project better for everyone.
Last Updated: January 19, 2026 Maintained By: Cortex TMS Contributors Feedback: Improve this guide via GitHub PR