nia-onboarding-agent
v1.0.2
Published
Nia Onboarding Agent — AI-powered Collison Installation for any SDK
Readme
Why "Collison Installation"?
The name comes from Paul Graham's 2013 essay Do Things that Don't Scale:
Stripe is one of the most successful startups we've funded, and the problem they solved was an urgent one. If anyone could have sat back and waited for users, it was Stripe. But in fact they're famous within YC for aggressive early user acquisition.
Startups building things for other startups have a big pool of potential users in the other companies we've funded, and none took better advantage of it than Stripe. At YC we use the term "Collison installation" for the technique they invented. More diffident founders ask "Will you try our beta?" and if the answer is yes, they say "Great, we'll send you a link." But the Collison brothers weren't going to wait. When anyone agreed to try Stripe they'd say "Right then, give me your laptop" and set them up on the spot.
— Paul Graham, Do Things that Don't Scale (July 2013)
This agent automates that moment. Instead of sending a link to your docs and hoping developers figure it out, the Nia Onboarding Agent reads your documentation, understands your SDK, and performs a full integration into the user's codebase — right then and there.
How It Works
The agent is powered by Nia, the knowledge engine by Nozomio Labs. Here's the flow:
- Index — Nia indexes your SDK documentation, GitHub repository, and package registry
- Research — The agent retrieves concrete code snippets, API patterns, and install instructions
- Plan — A custom installation plan is generated based on the target project's framework and structure
- Execute — An agentic loop (Claude + Anthropic SDK) reads, writes, and edits files in the user's codebase
- Verify — The agent runs typechecks, linting, and smoke tests to confirm the integration works
All knowledge retrieval — doc search, repo search, semantic search — is handled by Nia's API. The execution engine uses Anthropic's Claude Agent SDK with the claude_code tool preset.
Usage
Prerequisites
You need two API keys set in your environment:
export NIA_COLLISON_NIA_API_KEY=nk_... # Nia API key — get one at https://trynia.ai
export ANTHROPIC_API_KEY=sk-ant-api03-... # Anthropic API key — https://console.anthropic.comThen run:
npx nia-onboarding-agent \
--work-email [email protected] \
--product-name "Your Product" \
--package-name @your-org/sdk \
--docs-url https://docs.yourproduct.comOr pass them inline:
NIA_COLLISON_NIA_API_KEY=nk_... ANTHROPIC_API_KEY=sk-ant-... npx nia-onboarding-agent \
--work-email [email protected] \
--product-name "Your Product" \
--package-name @your-org/sdk \
--docs-url https://docs.yourproduct.comOptions
| Option | Description | Type | Default |
| ------------------- | -------------------------------------------------- | ------- | ------- |
| --help | Show help | boolean | |
| --version | Show version number | boolean | |
| --debug | Enable verbose logging | boolean | false |
| --ci | Enable CI mode (non-interactive) | boolean | false |
| --execute | Execute generated plan immediately | boolean | false |
| --dry-run | Preview changes without writing files | boolean | false |
| --install-dir | Directory to apply integration changes | string | . |
| --work-email | Owner email for the setup session | string | |
| --product-name | Product name for generated assets | string | |
| --package-name | SDK package name to install | string | |
| --docs-url | Main docs entry URL for indexing | string | |
| --repository | GitHub repo (owner/repo) for repo-aware planning | string | |
| --organization-id | Organization id for multi-tenant context | string | |
| --nia-base-url | Nia API base URL | string | apigcp.trynia.ai/v2 |
| --nia-api-key | Nia API key | string | |
Environment Variables
| Variable | Description | Required |
| ------------------------------ | ---------------------------------------- | -------- |
| NIA_COLLISON_NIA_API_KEY | Nia API key for doc/repo indexing | Yes |
| ANTHROPIC_API_KEY | Anthropic API key for the agent loops | Yes |
| NIA_COLLISON_NIA_BASE_URL | Nia API base URL (override for dev) | No |
CLI flags follow the pattern NIA_COLLISON_<OPTION> and override env vars.
CI Mode
NIA_COLLISON_NIA_API_KEY=$NIA_KEY ANTHROPIC_API_KEY=$ANTHROPIC_KEY \
npx nia-onboarding-agent \
--ci \
--execute \
--work-email [email protected] \
--product-name "Acme SDK" \
--package-name @acme/sdk \
--docs-url https://docs.acme.com \
--install-dir .In CI mode:
- All prompts use provided flags (no interactive input)
--executeruns the plan automatically--dry-runpreviews without writing
Architecture
bin.ts CLI entrypoint (yargs)
src/collison/
cli.ts Interactive wizard flow
service.ts Session prep → plan → execute pipeline
research-agent.ts Nia-powered doc/repo research
agentic-runner.ts Claude Agent SDK execution loop
adaptive-retrieval.ts Smart retrieval with fallback strategies
question-engine.ts Dynamic question generation
source-lifecycle.ts Doc/repo indexing orchestration
nia-client.ts Nia API client (v2)
rollback.ts Rollback on failure
types.ts Shared type definitions
recipes/
nextjs-app-router.ts Next.js App Router recipe
apps/web/ Dashboard web app (Next.js)Execution Engine
The agent execution uses @anthropic-ai/claude-agent-sdk with the claude_code preset, which provides:
Read— Read filesWrite— Write filesEdit— Patch filesGlob— File pattern matchingGrep— Text searchBash— Command execution
In dry-run mode, only Read, Glob, and Grep are allowed.
Development
# Install dependencies
pnpm install
# Run locally against a target project
pnpm try --install-dir=/path/to/project \
--work-email [email protected] \
--product-name "Test" \
--package-name @test/sdk \
--docs-url https://docs.test.com
# Run tests
pnpm test
# Run the web dashboard
bun --cwd apps/web devHeritage
This project was originally forked from the PostHog Wizard, which pioneered the idea of using an AI agent to install an SDK into a user's codebase. The scaffolding for the agent execution loop and CLI structure draws from that work. Scaffolding credit also to the Sentry Wizard.
The Collison Installation Agent replaces the PostHog-specific MCP/skill system with Nia's general-purpose knowledge retrieval, making it work for any SDK — not just PostHog.
License
MIT — Nozomio Labs
