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
13 changes: 13 additions & 0 deletions .changeset/add-asset-system.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"dev-workflows": minor
---

Add asset system for commands, templates, hooks, and presets

- **Commands**: `devw add command/spec` downloads slash commands that deploy to `.claude/commands/`
- **Templates**: `devw add template/feature-spec` installs spec templates to `docs/specs/`
- **Hooks**: `devw add hook/auto-format` merges editor hooks into `.claude/settings.local.json`
- **Presets**: `devw add preset/spec-driven` installs a full workflow bundle (rules + commands + templates + hooks)
- **Init with preset**: `devw init --preset spec-driven` scaffolds a project with a complete workflow
- **Asset-aware commands**: `list`, `remove`, `doctor`, `watch`, and `compile` all support the new asset types
- **Content**: 4 slash commands (spec, plan, build, learn), 1 template (feature-spec), 1 hook (auto-format), 1 preset (spec-driven), 1 rule (workflow/spec-driven)
4 changes: 3 additions & 1 deletion content/hooks/auto-format.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"PostToolUse": [
{
"matcher": "Write|Edit",
"command": "pnpm format || true"
"hooks": [
{ "type": "command", "command": "pnpm format || true" }
]
}
]
}
Expand Down
9 changes: 8 additions & 1 deletion packages/cli/tests/core/assets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,12 @@ describe('deployHooks', () => {
version: '0.1.0',
settings: {
hooks: {
PostToolUse: [{ matcher: 'Write|Edit', command: 'pnpm format || true' }],
PostToolUse: [
{
matcher: 'Write|Edit',
hooks: [{ type: 'command', command: 'pnpm format || true' }],
},
],
},
},
});
Expand All @@ -198,6 +203,8 @@ describe('deployHooks', () => {
);
assert.ok(Array.isArray(settings.hooks.PostToolUse));
assert.equal(settings.hooks.PostToolUse[0].matcher, 'Write|Edit');
assert.ok(Array.isArray(settings.hooks.PostToolUse[0].hooks));
assert.equal(settings.hooks.PostToolUse[0].hooks[0].type, 'command');
});
});

Expand Down