@toriistudio/ai-toolkit
v2.0.1
Published
Install Torii's AI Toolkit into your AI IDE.
Readme
Torii AI Toolkit
@toriistudio/ai-toolkit is a CLI that installs Torii's AI coding packages into any project. Pick the packages you need, point it at your AI IDE, and the right files land in the right place.
Supported IDEs: Cursor, Claude Code, Codex, and a generic custom folder layout.
Landing page: https://toriistudio.github.io/ai-toolkit (coming soon)
Using the toolkit
Quickstart
npx @toriistudio/ai-toolkit@latestThe CLI asks which IDE you're using, which packages you want, and runs any package-specific prompts (e.g. UI framework for the guardrails package). All prompts can also be skipped via flags — see below.
Available packages
| Package | What it installs | |---|---| | guardrails | Rule + agent-skill packs for naming, structure, DRY, imports, code quality. Picks Tailwind / Material UI / no-framework add-ons based on a prompt. | | perf-improve | Lighthouse-driven loop for diagnosing and fixing React app performance regressions. Details. |
Packages are auto-discovered from src/packages/*/manifest.json — adding a new one does not require a code change to the CLI.
CLI flags
| Flag | Values | Description |
|---|---|---|
| --platform, -p | cursor, claude, codex, custom | Target IDE. |
| --install-dir, --dir | path | Install root (mainly for --platform custom). |
| --with | comma-separated package ids, or all | Non-interactive package selection. |
| --force | flag | Overwrite seed files (PATTERNS.md, LOGS.md, .gitignore) on re-install. |
Examples:
# Interactive
npx @toriistudio/ai-toolkit@latest
# Targeted
npx @toriistudio/ai-toolkit@latest --platform cursor --with guardrails
npx @toriistudio/ai-toolkit@latest -p claude --with perf-improve
npx @toriistudio/ai-toolkit@latest -p custom --dir ./ai-config --with all
# Re-install and overwrite user-edited seed files
npx @toriistudio/ai-toolkit@latest -p claude --with perf-improve --forceWhere files land
| IDE | Rules | Agent skills |
|---|---|---|
| Cursor | .cursor/rules/<id>.mdc | .cursor/skills/<id>/SKILL.md |
| Claude Code | .claude/rules/<id>.md | .claude/skills/<id>/SKILL.md |
| Codex | Merged Torii block in AGENTS.md | .agents/skills/<id>/SKILL.md |
| Custom | <install-dir>/rules/<id>.md | <install-dir>/skills/<id>/SKILL.md |
Contributing a package
Packages live under src/packages/<id>/. Each package folder contains a manifest.json plus the content the manifest references. The CLI auto-discovers packages from this folder.
Manifest shape (manifest.json)
{
"id": "<must match folder name>",
"label": "Short label shown in the CLI multi-select",
"description": "One-line summary of what this package installs.",
"prompts": [
{
"id": "framework",
"type": "select",
"message": "Which UI stack?",
"choices": [
{ "value": "tailwind", "label": "Tailwind / shadcn" },
{ "value": "other", "label": "Other / none" }
]
}
],
"outputs": [
{ "type": "tree", "source": "." },
{ "type": "bundle", "source": "bundles/base" },
{ "type": "bundle", "source": "bundles/tailwind", "when": "framework=tailwind" }
]
}prompts— optional. Each prompt's answer is available towhenpredicates as<promptId>=<value>. Currently onlyselectprompts are supported.outputs— required, non-empty.type: "tree"— copy every file undersourceverbatim into<ide-skills-dir>/<package-id>/.skill.mdis renamed toSKILL.md.manifest.jsonis excluded.type: "bundle"— each immediate subdir ofsourceis treated as arule.md+skill.mdpair, namespaced by the subdir name (becomes its own IDE skill folder).
when— optional, format"<promptId>=<value>". Omit for "always install."
Authoring steps
- Copy
src/packages/_template/tosrc/packages/<your-package-id>/. - Edit
manifest.json— make sureidmatches the folder name and the file list underoutputsreferences real files. - Add your content. For
treepackages, files likePATTERNS.md,LOGS.md, and.gitignoreare treated as user seeds — preserved on re-install unless--forceis passed. - Run
npm testandnpm run build. - Smoke test with the local CLI:
npm link # in a scratch project ai-toolkit-init --platform custom --dir ./out --with <your-package-id> - Open a PR. The PR template will prompt you for what to confirm.
Authoring a rule + agent-skill bundle
When a package emits one or more rule.md/skill.md pairs (the bundle output type), each pair lives in its own subdirectory:
src/packages/<your-package-id>/
manifest.json
bundles/
base/
<bundle-id-a>/
rule.md
skill.md
<bundle-id-b>/
rule.md
skill.mdrule.md is the IDE-rule content. skill.md is the Claude/Cursor agent-skill content. Frontmatter name: should match the bundle folder name. See src/packages/guardrails/bundles/base/* for real examples.
Local development
Requirements
- Node.js (CI runs on Node 22)
- npm
Setup
npm ciCommon scripts
npm test # vitest
npm run typecheck # tsc --noEmit
npm run build # produces dist/, copies src/packages → dist/packages
npm start # node dist/cli.jsTesting the published-style CLI locally
# in this repo
npm run build && npm link
# in a separate test project
ai-toolkit-init --platform cursor --with guardrails
# cleanup
npm unlink # (and `npm unlink @toriistudio/ai-toolkit` in the test project)Release process
Releases are automated by semantic-release on pushes to main:
- CI runs
npm ci && npm test && npm run build. npx semantic-releaseanalyzes Conventional Commits, bumps the version, publishes to npm, cuts a GitHub release, updatesCHANGELOG.md, and commits the release artifacts.
Commit conventions (from .releaserc.json):
feat:→ minorfix:,perf:,revert:,chore:→ patchfeat!:orBREAKING CHANGE:footer → majorchore(release):→ no release
License
MIT © Torii Studio
