# skillit

Adopt this skill: https://proskills.md/skills/other/pradeepmouli-skillit-skills-skillit

Page: https://proskills.md/skills/other/pradeepmouli-skillit-skills-skillit
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: skills/skillit/SKILL.md
size: 2835
upstream: https://github.com/pradeepmouli/skillit/blob/master/skills/skillit/SKILL.md

```text
---
name: skillit
description: Generate structured AI agent skills (SKILL.md) and llms.txt from your TypeScript API documentation
license: MIT
---

# skillit

Generate structured AI agent skills (SKILL.md) and llms.txt from your TypeScript API documentation

## When to Use

- You have a Commander program and want structured option/argument extraction with full fidelity
- Runtime introspection is unavailable (no access to the program object)
- The CLI uses a framework other than Commander (yargs, oclif, custom)
- You have both CLI surfaces (from introspection/help) and typed config interfaces (from TypeDoc)
- You want JSDoc @useWhen/@avoidWhen/@never tags to appear on CLI options in the generated skill
- You have a Commander program and want to generate a skill from its command structure
- You have raw --help output and no runtime access to the program object

**Avoid when:**

- Your CLI uses yargs, oclif, or another framework — use parseHelpOutput as a fallback instead
- Your CLI is built with a framework other than Commander — use parseHelpOutput directly instead
- API surface: 4 functions

## NEVER

- NEVER pass both `program` and `helpTexts` — program takes precedence and helpTexts is silently ignored
- NEVER forget to pass configSurfaces when you have typed option interfaces — JSDoc metadata won't be correlated

## Configuration

### CliExtractionOptions

| Key              | Type                                                                                                 | Required | Default | Description                                        |
| ---------------- | ---------------------------------------------------------------------------------------------------- | -------- | ------- | -------------------------------------------------- |
| `program`        | `any`                                                                                                | no       | —       | Commander program object (preferred)               |
| `helpTexts`      | `Record<string, string>`                                                                             | no       | —       | Help text per command (fallback)                   |
| `metadata`       | `{ name?: string; description?: string; keywords?: string[]; repository?: string; author?: string }` | no       | —       | Package metadata                                   |
| `configSurfaces` | `ExtractedConfigSurface[]`                                                                           | no       | —       | Config surfaces from TypeDoc for JSDoc correlation |

## Quick Reference

**Commander:** `introspectCommander`
**Fallback:** `parseHelpOutput`
**Correlation:** `correlateFlags`
**Extraction:** `extractCliSkill`

## Links

- [Repository](https://github.com/pradeepmouli/skillit)
- Author: Pradeep Mouli
```

## File: README.md
upstream: https://github.com/pradeepmouli/skillit/blob/master/README.md

````text
# skillit

> **skillit** — Compile-time generator of AI agent skills from your codebase.

Inline docs, CLI definitions, config schemas, and examples compile into progressively disclosed [SKILL.md](https://agentskills.io) files that any LLM can discover. Integrated with TypeDoc, with support for conventional repo docs, and plugins for Docusaurus and VitePress provided for what code can't cover.

## MCP Servers (orthogonal workflow)

`skillit` can also generate skills from **any live MCP server**, even when the
server was not authored with `skillit`.

This is separate from the TypeDoc/docs extraction flow above: it introspects MCP
tools/resources/prompts over stdio or HTTP and emits a progressive-disclosure
`SKILL.md`. You can render:

- native MCP launch instructions (`mcp:` frontmatter in `SKILL.md`, which tells
  MCP-capable agents how to start/connect to the server), or
- CLI-proxy launch instructions for non-MCP harnesses (such as mcpc/fastmcp).

```bash
# Inspect any running or launchable MCP server and generate skills
npx skillit mcp extract \
  --command "npx -y @modelcontextprotocol/server-filesystem /tmp" \
  --out ./skills

# Optional: install non-default CLI invocation adapters
npm install --save-dev @skillit/target-mcpc @skillit/target-fastmcp

# Emit CLI-proxy invocation variants for non-MCP agents
npx skillit mcp extract \
  --command "npx -y @modelcontextprotocol/server-filesystem /tmp" \
  --invocation cli:mcpc \
  --invocation cli:fastmcp \
  --out ./skills
```

For server package authors, `skillit mcp bundle` can be run in your build to
ship pre-generated skills with your MCP package.

See [`packages/mcp/README.md`](packages/mcp/README.md) for install, extract,
bundle, config-file batch mode (`mcp.json` / `claude_desktop_config.json`), and
programmatic API details.

### Bootstrap (recommended): `/skillit-bootstrap`

The primary way to create or improve a skill is the **`/skillit-bootstrap`**
Claude Code skill (bundled with `@skillit/client`). It runs the deterministic
generate → audit loop and lets the agent enrich your repo's source (JSDoc,
README, examples, package.json) until the skill hits its grade target — you
never hand-edit a `SKILL.md`.

```bash
# Install the bundled skill into your user skill roots (one time)
mkdir -p ~/.claude/skills ~/.copilot/skills ~/.agents/skills
cp -R node_modules/@skillit/client/skills/skillit-bootstrap ~/.claude/skills/
cp -R node_modules/@skillit/client/skills/skillit-bootstrap ~/.copilot/skills/
cp -R node_modules/@skillit/client/skills/skillit-bootstrap ~/.agents/skills/

# Then, in your agent:
/skillit-bootstrap --source cli --program ./dist/cli.js#program
/skillit-bootstrap --source typedoc
```

Supported sources this release: **cli** and **typedoc**. For `config` / `mcp`,
use `skillit refine` (below); slash-command support for those lands in a later
phase. The CLI commands (`skillit gen`, `skillit audit --json`, `skillit
refine`) remain for headless/CI use.

### Init: detect → install

`skillit init` wires a project up. It detects the project's nature and installs
the matching `@skillit/*` package with your package manager, then points you at
`skillit gen` to produce the skill. It does **not** generate or refine — those
are separate, explicit commands (`skillit gen`, `skillit refine`).

```bash
# Auto-detects nature and package manager, installs the right @skillit package
npx skillit init

# Force the source kind
npx skillit init --source mcp

# Config source is built in (no install) — init just points at `skillit gen`
npx skillit init --source config --config-type ./src/config.ts#MyConfig
```

Detection:

- **Nature** — `commander` / `yargs` dep → `cli`; `@modelcontextprotocol/sdk` →
  `mcp`; otherwise a plain TS library → `typedoc`. Override with `--source`.
- **Package** — `cli` → `@skillit/cli`, `mcp` → `@skillit/mcp`, `typedoc` →
  `typedoc-plugin-skillit`. The `config` source is built into the CLI (no
  install).
- **Package manager** — `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, else npm.

If the install step fails, `init` prints the exact add command and stops.

| Flag                           | Default | Description                       |
| ------------------------------ | ------- | --------------------------------- |
| `--source <cli\|mcp\|typedoc>` | auto    | Override project-nature detection |
| `--config-type <file#export>`  | —       | Config type entry (config source) |

### Gen: deterministic skill generation

`skillit gen` (re)generates the skill from the current source — no install, no
model, no network. It is the deterministic, side-effect-free generate primitive:
the same source always yields the same skill. Run it after `init`, and again
whenever you change the documented source (JSDoc, config type, README).

```bash
# Generate from the auto-detected source into skills/
npx skillit gen

# CLI source with an explicit commander program entry
npx skillit gen --source cli --program ./dist/cli.js#program

# Config source
npx skillit gen --source config --config-type ./src/config.ts#MyConfig

# Generate into a custom directory (default: skills)
npx skillit gen --out docs/skills
```

| Flag                                   | Default  | Description                              |
| -------------------------------------- | -------- | ---------------------------------------- |
| `--source <cli\|config\|mcp\|typedoc>` | auto     | Source kind                              |
| `--program <file#export>`              | —        | Commander program entry (cli source)     |
| `--config-type <file#export>`          | —        | Config type entry (config source)        |
| `--mcp <path>`                         | —        | MCP config path (mcp source)             |
| `--server <name>`                      | —        | MCP server entry (mcp source)            |
| `--out <dir>`                          | `skills` | Output directory for the generated skill |

### Audit: score + findings as JSON

`skillit audit` runs the same audit + judge the refine loop uses and prints the
result. With `--json` it emits the full `AuditResult` + score estimate, plus a
resolved on-disk location for each improvement target — the machine-readable
read-surface an agent (or CI) can act on without re-deriving anything.

```bash
# Human summary (grade + severity counts)
npx skillit audit --source cli

# Full machine-readable report
npx skillit audit --source config --config-type ./src/config.ts#MyConfig --json
```

| Flag                                   | Default | Description                            |
| -------------------------------------- | ------- | -------------------------------------- |
| `--source <cli\|config\|mcp\|typedoc>` | auto    | Source kind                            |
| `--program <file#export>`              | —       | Commander program entry (cli source)   |
| `--config-type <file#export>`          | —       | Config type entry (config source)      |
| `--mcp <path>`                         | —       | MCP config path (mcp source)           |
| `--server <name>`                      | —       | MCP server entry (mcp source)          |
| `--json`                               | off     | Emit the full audit + estimate as JSON |

### Refine: autonomous annotation loop

`skillit refine` runs an audit → draft → review loop that iteratively improves
the `useWhen` / `avoidWhen` annotations in your generated skills. On each pass it
asks an LLM to evaluate the current guidance, proposes improvements, and applies
them — no manual editing required.

Refine is **source-aware**. It auto-detects the source from the installed
`@skillit/*` package, or you can choose explicitly:

```bash
# CLI source — writes guidance back into the *Options interface JSDoc
npx skillit refine --source cli --program ./dist/cli.js#program

# MCP source (see modes below)
npx skillit refine --source mcp --mcp ./mcp.json
```

For the **cli** source, refine writes annotations into the JSDoc of your typed
`*Options` interfac
````
