Contributing
Prerequisites
Section titled “Prerequisites”- Node.js 18+
- Claude Code CLI (needed for
doc init,doc sync, andcustomizecommands) - Git
# Fork the repo on GitHub, then:git clone https://github.com/<your-username>/aspens.gitcd aspensnpm install
# Verify it worksnode bin/cli.js --helpnpm testNo build step. The CLI runs directly from source (ES modules).
Testing your changes
Section titled “Testing your changes”Run the test suite
Section titled “Run the test suite”npm test # Run all testsnpx vitest run tests/scanner.test.js # Run a single test filenpx vitest --watch # Watch mode during developmentTest against a real repo
Section titled “Test against a real repo”The best way to verify your changes is to run aspens against an actual codebase.
Option 1: npm link (recommended)
# In the aspens directory:npm link
# Now test from any repo:cd /path/to/some-projectaspens scanaspens doc init --dry-runWhen you’re done:
npm unlink -g aspensOption 2: Run directly
node /path/to/aspens/bin/cli.js scan /path/to/some-projectOption 3: Use --dry-run
node bin/cli.js doc init --dry-run /path/to/some-projectnode bin/cli.js doc sync --dry-run /path/to/some-projectSubmitting a pull request
Section titled “Submitting a pull request”- Fork the repo and create a branch (
git checkout -b my-change) - Make your changes
- Run the tests (
npm test) - Test against at least one real repo
- Open a PR with a clear description of what changed and why
What makes a good PR
Section titled “What makes a good PR”- Small and focused — one feature or fix per PR
- Tests included — add or update tests in
tests/for any logic changes - Tested against a real repo — mention which repo you tested with in the PR description
Code review
Section titled “Code review”We use CodeRabbit for automated code review on every PR. It posts a summary and inline suggestions — you can reply to them directly. The review profile is set to chill, so it’s there to catch things, not block you.
Code style
Section titled “Code style”- ES modules —
import/export, norequire() - Path handling —
path.resolve()for absolute,path.relative()for display - UI —
@clack/promptsfor interactive prompts,picocolorsfor color - Error handling — throw descriptive errors with remediation hints
- File reads — try/catch returning
nullon failure, never throw on missing files
Where to start
Section titled “Where to start”Look for issues labeled good first issue — these are scoped, well-described tasks ideal for first-time contributors.