Thank you for your interest in contributing to agent-ready! This guide will help you get started.
- Code of Conduct
- Getting Started
- Development Workflow
- Adding New Checks
- Testing
- Pull Request Process
- Code Style
Be respectful and constructive in all interactions. We welcome contributors of all experience levels.
- Node.js >= 20.0.0
- npm >= 10.0.0
- Git
# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/agent-ready.git
cd agent-ready
# Install dependencies
npm install
# Verify setup
npm test # Should pass 22 tests
npm run dev -- scan . # Should output L2 score# Development mode (with hot reload)
npm run dev -- scan .
# With specific flags
npm run dev -- scan /path/to/repo --verbose
npm run dev -- scan . --output json
npm run dev -- init --dry-run| Script | Description |
|---|---|
npm run dev |
Run CLI in development mode |
npm test |
Run test suite |
npm run typecheck |
TypeScript type checking |
npm run lint |
ESLint code linting |
npm run format |
Prettier code formatting |
npm run build |
Build for production |
main are blocked. All changes must go through pull requests.
Branch names must follow this pattern: <type>/<description>
| Type | Purpose | Example |
|---|---|---|
feat/ |
New features | feat/add-docker-check |
fix/ |
Bug fixes | fix/path-glob-windows |
docs/ |
Documentation | docs/update-readme |
style/ |
Code style changes | style/format-checks |
refactor/ |
Code refactoring | refactor/simplify-engine |
perf/ |
Performance improvements | perf/faster-glob |
test/ |
Test additions | test/add-integration |
build/ |
Build system | build/update-deps |
ci/ |
CI configuration | ci/add-coverage |
chore/ |
Maintenance | chore/cleanup |
hotfix/ |
Urgent fixes | hotfix/critical-bug |
release/ |
Release branches | release/v1.0.0 |
# Always start from latest main
git checkout main
git pull origin main
# Create feature branch
git checkout -b feat/my-new-feature
# Make changes, then push
git push -u origin feat/my-new-featureEdit src/types.ts:
// Add to CheckType union
export type CheckType =
| 'file_exists'
| 'my_new_type'; // Add here
// Create config interface
export interface MyNewCheckConfig extends BaseCheckConfig {
type: 'my_new_type';
my_option: string;
}
// Add to CheckConfig union
export type CheckConfig =
| FileExistsCheckConfig
| MyNewCheckConfig; // Add hereCreate src/checks/my-new-check.ts:
import { MyNewCheckConfig, CheckResult, ScanContext } from '../types.js';
export async function executeMyNewCheck(
check: MyNewCheckConfig,
context: ScanContext
): Promise<CheckResult> {
// Implementation
const passed = /* your logic */;
return {
check_id: check.id,
passed,
message: passed ? 'Check passed' : 'Check failed',
suggestions: passed ? [] : ['How to fix this']
};
}Edit src/checks/index.ts:
import { executeMyNewCheck } from './my-new-check.js';
// In executeCheck function
case 'my_new_type':
return executeMyNewCheck(check as MyNewCheckConfig, context);Edit profiles/factory_compat.yaml:
- id: pillar.my_check
name: My New Check
description: What this check does
type: my_new_type
pillar: docs # or style, build, test, etc.
level: L2 # L1-L5
required: false
my_option: valueAdd to test/checks.test.ts:
describe('my_new_type check', () => {
it('should pass when condition met', async () => {
// Test implementation
});
});npm test# Filter by name
npm test -- --grep "file_exists"
# Run single file
npx tsx --test test/checks.test.tsTest fixtures are in test/fixtures/:
test/fixtures/
├── minimal-repo/ # L1 baseline
├── standard-repo/ # L2+ features
└── monorepo/ # Multi-app structure
# Scan a real repository
npm run dev -- scan /path/to/repo
# Compare with expected output
cat readiness.json | jq '.level'# 1. Create branch from latest main
git checkout main && git pull
git checkout -b feat/my-feature
# 2. Make changes and commit
git add .
git commit -m "feat: add my feature"
# 3. Push and create PR
git push -u origin feat/my-feature
gh pr create --fillAll PRs must pass these automated checks:
| Check | Description |
|---|---|
| PR Title | Must follow conventional commits (e.g., feat: add feature) |
| Branch Name | Must match pattern <type>/<description> |
| Lint | npm run lint passes |
| Type Check | npm run typecheck passes |
| Tests | npm test passes |
| Build | npm run build succeeds |
| Agent Readiness | Scan runs successfully |
-
Run all checks locally:
npm run check # Runs typecheck + lint + format:check npm test
-
Update documentation if needed:
- README.md for user-facing changes
- AGENTS.md for structural changes
- CHANGELOG.md for notable changes
-
Self-review your code:
- Remove debug statements
- Check for hardcoded values
- Ensure error handling
PR titles must follow Conventional Commits:
<type>: <description>
Examples:
feat: add Docker check typefix: handle missing package.jsondocs: update contribution guiderefactor: simplify level gating
- Create PR against
mainbranch - All automated checks must pass ✅
- At least one maintainer approval required
- Squash and merge preferred
- Delete branch after merge
- Use strict mode
- Prefer interfaces over types
- Use
unknowninstead ofany - Export types from
types.ts
# Auto-format code
npm run format
# Check formatting
npm run lintFollow Conventional Commits:
feat: add new check type for Docker support
fix: handle missing package.json gracefully
docs: update CONTRIBUTING guide
refactor: simplify level gating logic
test: add fixtures for monorepo detection
- Open an issue for bugs or feature requests
- Check existing issues before creating new ones
- See AGENTS.md for codebase details
Thank you for contributing!