Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/skills/base/skill.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ triggers:
alwaysActivate: true
---

You are working in **aspens** — a CLI that keeps coding-agent context accurate as your codebase changes. Scans repos, generates project-specific instructions and skills for Claude Code and Codex CLI, and keeps them fresh.
You are working in **aspens** — a CLI that keeps coding-agent context accurate as your codebase changes. Scans repos, generates project-specific instructions and skills for Claude Code, Codex, and OpenCode CLI, and keeps them fresh.

## Tech Stack
Node.js 20+ (ESM) | Commander | Vitest | es-module-lexer | @clack/prompts | picocolors
Expand All @@ -14,7 +14,7 @@ Node.js 20+ (ESM) | Commander | Vitest | es-module-lexer | @clack/prompts | pico
- `npm test` — Run vitest suite
- `npm start` / `node bin/cli.js` — Run CLI
- `aspens scan [path]` — Deterministic repo analysis (no LLM)
- `aspens doc init [path]` — Generate skills + hooks + CLAUDE.md (`--target claude|codex|all`, `--recommended` for full recommended setup)
- `aspens doc init [path]` — Generate skills + hooks + CLAUDE.md (`--target claude|codex|opencode`, `--recommended` for full recommended setup)
- `aspens doc impact [path]` — Show freshness, coverage, and drift of generated context (`--apply` for auto-repair, `--backend`/`--model`/`--timeout`/`--verbose` for LLM interpretation)
- `aspens doc sync [path]` — Incremental skill updates from git diffs
- `aspens doc graph [path]` — Rebuild import graph cache (`.claude/graph.json`)
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [0.9.0] - 2026-08-15

### Added
- **OpenCode CLI support** — `opencode` is now a supported generation backend and output target across `doc init` / `doc sync` / `doc impact`. `runOpenCode()` drives `opencode run --format json` (prompt passed via a `-f` file, stdin disabled to avoid a startup hang) and adapts its event stream to the shared `{ text, usage }` runner interface. The target writes `AGENTS.md` + `.claude/skills`. (#48)
- **`.php` recognized as a code-bearing extension** — PHP source files are now counted by the scanner and domain discovery. (#47)

### Changed
- **`--target all` removed** — with three targets (and `codex`/`opencode` both owning `AGENTS.md`), `all` was ambiguous. Pick an explicit target: `--target claude|codex|opencode`. Passing `--target all` now errors with the valid list; run `doc init --target <one>` per target instead.

### Fixed
- **OpenCode runner hardening** — dropped `--dangerously-skip-permissions`; added a safe-charset guard on `--model` before it reaches argv; replaced shell-based temp-file cleanup with `rmSync`; buffered JSON events across stdout chunks so generated text isn't lost; classified rate-limit exits. (#48)
- **`doc init` target/backend selection generalized** — the backend picker, target multiselect, and `inferConfig()` recovery now handle all three targets instead of hardcoding claude/codex; conflicting shared-output targets (`codex` + `opencode` both writing `AGENTS.md`) are rejected with a clear error. (#48)

### Security
- **Dev-dependency advisories resolved** — `npm audit fix` patched transitive `postcss`, `vite`, and `nanoid` advisories (dev-only; runtime dependencies were already clean). `npm audit` now reports 0 vulnerabilities.

## [0.8.0] - 2026-05-11

### Added
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- `npm start` — run the CLI (`node bin/cli.js`)
- `npm run lint` — no-op check (`echo 'No linter configured yet' && exit 0`)
- `aspens scan [path]` — deterministic repo scan
- `aspens doc init [path]` — generate skills, hooks, and instructions file (`--target claude|codex|all`, `--recommended` for full recommended setup including save-tokens, agents, and doc-sync hook)
- `aspens doc init [path]` — generate skills, hooks, and instructions file (`--target claude|codex|opencode`, `--recommended` for full recommended setup including save-tokens, agents, and doc-sync hook)
- `aspens doc impact [path]` — show freshness, coverage, drift, and LLM interpretation of generated context (interactive apply for repairs)
- `aspens doc sync [path]` — update docs from recent diffs
- `aspens doc graph [path]` — rebuild `.claude/graph.json`
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You started with 50 clean lines. Three months later it's 200, and Claude ignores

aspens replaces the monolith with scoped skill files (~35 lines each) generated from your actual import graph. Each skill activates only when the agent touches that part of the codebase. A post-commit hook keeps them in sync automatically. The agent reads 35 focused lines instead of 200 sprawling ones, and actually follows them.

Works with Claude Code, Codex, or both.
Works with Claude Code, Codex, or OpenCode.

## Install

Expand Down Expand Up @@ -98,7 +98,7 @@ Aspens supports multiple agent environments through output targets:

- `claude`: `CLAUDE.md` + `.claude/skills` + Claude hooks
- `codex`: `AGENTS.md` + `.agents/skills` + directory `AGENTS.md`
- `all`: generate both sets together
- `opencode`: `AGENTS.md` + `.claude/skills`
- we are working on adding more agents and tools - ask or contribute!

## Commands
Expand Down Expand Up @@ -140,8 +140,8 @@ $ aspens doc init
| `--no-graph` | Skip import graph analysis |
| `--model <model>` | Model for the selected backend |
| `--verbose` | Show backend reads/activity in real time |
| `--target <target>` | Output target: `claude`, `codex`, or `all` |
| `--backend <backend>` | Generation backend: `claude` or `codex` |
| `--target <target>` | Output target: `claude`, `codex`, or `opencode` |
| `--backend <backend>` | Generation backend: `claude`, `codex`, or `opencode` |

### `aspens doc impact`

Expand Down Expand Up @@ -258,6 +258,7 @@ aspens save-tokens --remove # Uninstall
- At least one supported agent CLI:
- [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) — `npm install -g @anthropic-ai/claude-code`
- Codex CLI
- [OpenCode CLI](https://opencode.ai)

## License

Expand Down
5 changes: 2 additions & 3 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ function showWelcome() {
${pc.green('aspens doc init --recommended')} Install the full recommended setup
${pc.green('aspens doc init --dry-run')} Preview without writing
${pc.green('aspens doc init --mode chunked')} One domain at a time (large repos)
${pc.green('aspens doc init --target all')} Generate docs for every configured target
${pc.green('aspens doc init --model haiku')} Use a specific backend model
${pc.green('aspens doc init --verbose')} See backend activity in real time
${pc.green('aspens doc sync')} Update generated docs from recent commits
Expand All @@ -79,7 +78,7 @@ function showWelcome() {
${pc.yellow('--force')} Overwrite existing files ${pc.yellow('--model')} ${pc.dim('<m>')} Choose backend model
${pc.yellow('--mode')} ${pc.dim('<mode>')} all, chunked, base-only ${pc.yellow('--timeout')} ${pc.dim('<s>')} Seconds per call
${pc.yellow('--strategy')} ${pc.dim('<s>')} improve, rewrite, skip ${pc.yellow('--json')} JSON output (scan)
${pc.yellow('--target')} ${pc.dim('<t>')} claude, codex, opencode, all ${pc.yellow('--backend')} ${pc.dim('<b>')} claude, codex, or opencode
${pc.yellow('--target')} ${pc.dim('<t>')} claude, codex, opencode ${pc.yellow('--backend')} ${pc.dim('<b>')} claude, codex, or opencode
${pc.yellow('--no-hooks')} Skip Claude hook installation ${pc.yellow('--hooks-only')} Update Claude hooks only
${pc.yellow('--no-graph')} Skip import graph analysis

Expand Down Expand Up @@ -165,7 +164,7 @@ doc
.option('--no-hooks', 'Skip Claude hook/rules/settings installation')
.option('--hooks-only', 'Skip doc generation, just install/update Claude hooks')
.option('--no-graph', 'Skip import graph analysis')
.option('--target <target>', 'Output target: claude, codex, opencode, all')
.option('--target <target>', 'Output target: claude, codex, opencode')
.option('--backend <backend>', 'Generation backend: claude, codex, opencode (default: matches target)')
.action(docInitCommand);

Expand Down
Loading
Loading