@dain-os/claude-tooling
v0.1.2
Published
CLI that syncs .claude/ assets (instructions, skills, agents, commands) from the DainOS library into any repo
Readme
@dain-os/claude-tooling
CLI that syncs .claude/ assets — instructions, skills, agents, commands, hooks — from the
DainOS library (Supabase claude_instructions_library + dev_knowledge_base) into any
target repository.
Installation
npx @dain-os/claude-tooling initCommands
| Command | Purpose | Status |
|---------|---------|--------|
| dain-claude init | Initialise .claude/ in a repo by selecting items from the DainOS library | coming in task-007 |
| dain-claude upgrade | Pull newer versions of installed items | coming in task-008 |
| dain-claude add | Add a single library item by slug | coming in task-009 |
| dain-claude doctor | Diagnose .claude/ drift and suggest fixes | coming in task-010 |
Governance
Every item in claude_instructions_library carries a lifecycle status:
active— safe for production use, installed by defaultdraft— work-in-progress, not installed by the CLI (authors edit via the DainOS web UI)deprecated— scheduled for removal, never installed, warned indoctor
V1 installs only active items. A --include-draft flag is planned for V0.2.
Security
The Supabase anon key is embedded in the published binary. Row-level security is
disabled on claude_instructions_library and dev_knowledge_base, so anyone who
installs this package can read every row across every Dain project. This is an
accepted trade-off: the library is Dain-internal reference material, and a per-repo
service-role flow would add friction far above the sensitivity of the data.
Do not store secrets, client PII, or commercially sensitive material in these tables.
Development
npm install # from repo root — registers the workspace
cd packages/claude-tooling
npm run build # emits dist/cli.js
npm run dev # watch mode
npm run check-types # tsc --noEmitThe CLI entrypoint is bin/dain-claude.js, which loads the compiled dist/cli.js.
Troubleshooting
init failed midway — how do I recover?
dain-claude init is transactional: if it throws mid-run, it rolls back
its own writes before exiting. You should see lines on stderr like
rollback: removed .claude/ (created this run).
Re-run dain-claude init after fixing the underlying error — no flags or
manual cleanup needed.
If you ran with --force and the rollback itself hit a problem, a
.claude.bak/ (and possibly .dain-tooling-manifest.json.bak) will be
preserved at the repo root as a manual recovery copy. Inspect it, restore
what you need, then delete the .bak paths before re-running.
