Skip to content

feat(cli): add asset system for commands, templates, hooks, and presets#51

Merged
gpolanco merged 4 commits intomainfrom
fix/hook-settings-format
Mar 7, 2026
Merged

feat(cli): add asset system for commands, templates, hooks, and presets#51
gpolanco merged 4 commits intomainfrom
fix/hook-settings-format

Conversation

@gpolanco
Copy link
Copy Markdown
Owner

What

Adds a full asset system to the CLI that allows users to install not just rules, but also commands, templates, hooks, and presets from the registry. Includes a settings-merge utility that correctly writes Claude Code hook settings in the expected format.

Why

The CLI previously only supported rules. This extends the asset model to cover all developer workflow primitives as defined in the v0.2/v0.2.1 specs and the internal content/ directory structure.

Also fixes a bug in the hook settings format: Claude Code expects each matcher group to have a hooks array with {type, command} objects, not a command directly.

Changes

New files:

  • packages/cli/src/core/assets.ts — asset resolution, installation, and registry logic
  • packages/cli/src/core/settings-merge.ts — merges hook entries into Claude Code settings.json with correct format
  • packages/cli/tests/core/assets.test.ts — full test coverage for asset system
  • packages/cli/tests/core/settings-merge.test.ts — tests for settings merge logic
  • content/commands/build.md, learn.md, plan.md, spec.md — built-in commands
  • content/hooks/auto-format.json — built-in auto-format hook (with correct format)
  • content/presets/spec-driven.yml — example preset
  • content/templates/feature-spec.md — feature spec template
  • content/rules/workflow/spec-driven.md — spec-driven workflow rule
  • docs/concepts/assets.mdx — documentation for the asset system
  • .changeset/add-asset-system.md

Modified files:

  • packages/cli/src/commands/add.ts — supports all asset types
  • packages/cli/src/commands/list.ts — lists all asset types
  • packages/cli/src/commands/doctor.ts — validates asset installations
  • packages/cli/src/commands/init.ts — initializes with assets
  • packages/cli/src/commands/compile.ts — compiles assets
  • packages/cli/src/commands/remove.ts — removes assets
  • packages/cli/src/bridges/types.ts — bridge type extensions
  • packages/cli/src/utils/github.ts — updated GitHub fetching
  • packages/cli/src/core/parser.ts — parser updates
  • docs/commands/add.mdx, compile.mdx, doctor.mdx, init.mdx, list.mdx — updated docs
  • docs/index.mdx, docs/quickstart.mdx, docs/docs.json — updated navigation and content
  • README.md — updated with asset system overview

Test

pnpm install
pnpm build

# Listar assets disponibles
devw add --list

# Instalar un hook
devw add hooks/auto-format

# Verificar que el formato en .claude/settings.json sea correcto:
# hooks → PostToolUse → [{matcher, hooks: [{type, command}]}]

# Correr los tests
pnpm test

Extend dev-workflows from a rule compiler to a complete AI workflow system.
The new asset system supports slash commands, spec templates, editor hooks,
and presets that bundle everything together. Running `devw init --preset
spec-driven` now sets up a full spec-driven development workflow.
Update README, Mintlify docs, and content registry to reflect the new
asset system (commands, templates, hooks, presets). Fix outdated block
naming, add missing rules and bridges to tables, create assets concept
page, and generate changeset for minor version bump.
The hook settings were using the old format with `command` directly
in the matcher group. Claude Code expects each matcher group to have
a `hooks` array with `{type, command}` objects.

Fixes: hooks → PostToolUse → 0 → hooks: Expected array, received undefined
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
landing Ready Ready Preview, Comment Mar 7, 2026 10:52am

@gpolanco gpolanco merged commit 7196c41 into main Mar 7, 2026
4 checks passed
@gpolanco gpolanco deleted the fix/hook-settings-format branch March 7, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant