> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dev-workflows.com/llms.txt
> Use this file to discover all available pages before exploring further.

# devw add

> Add rules, commands, templates, hooks, and presets from the registry

```bash theme={null}
devw add [category/name]
```

Adds rules and assets from the official dev-workflows registry. Supports both interactive and direct modes.

## Interactive Mode

Running `devw add` without arguments launches an interactive flow:

1. Browse categories from the registry
2. Select rules to install (with back navigation)
3. Optionally add rules from multiple categories
4. Review a summary and confirm
5. Rules are downloaded, converted to YAML, and compiled

Rules already installed are shown with an `(already installed)` indicator.

## Direct Mode

```bash theme={null}
devw add typescript/strict       # add a rule
devw add command/spec            # add a slash command
devw add template/feature-spec   # add a spec template
devw add hook/auto-format        # add an editor hook
devw add preset/spec-driven      # add a preset (bundle)
```

Downloads and installs a specific rule or asset by path. If the rule already exists at the same version, reports "Already up to date".

## Asset Types

The `category` prefix determines the type:

| Prefix          | Type          | Destination                                          |
| --------------- | ------------- | ---------------------------------------------------- |
| `command/`      | Slash command | `.dwf/assets/commands/` → `.claude/commands/`        |
| `template/`     | Spec template | `.dwf/assets/templates/` → `docs/specs/`             |
| `hook/`         | Editor hook   | `.dwf/assets/hooks/` → `.claude/settings.local.json` |
| `preset/`       | Bundle        | Installs multiple rules + assets at once             |
| *anything else* | Rule          | `.dwf/rules/` → editor configs                       |

## Flags

| Flag                | Description                             |
| ------------------- | --------------------------------------- |
| `--list [category]` | List available rules from the registry  |
| `--no-compile`      | Skip auto-compile after adding          |
| `--force`           | Overwrite existing rules without asking |
| `--dry-run`         | Show output without writing files       |

## Examples

```bash theme={null}
# Interactive — browse and select rules
devw add

# Install a specific rule
devw add typescript/strict

# Install a slash command
devw add command/spec

# Install a full workflow preset
devw add preset/spec-driven

# List all available rules
devw add --list

# Preview what would be written
devw add javascript/react --dry-run

# Force overwrite without confirmation
devw add css/tailwind --force
```

## Available Rules

Rules are organized by category. Run `devw add --list` for the latest list.

| Rule                         | Category   | Description                          |
| ---------------------------- | ---------- | ------------------------------------ |
| `typescript/strict`          | TypeScript | Strict TypeScript conventions        |
| `javascript/react`           | JavaScript | React conventions and best practices |
| `javascript/nextjs`          | JavaScript | Next.js App Router patterns          |
| `css/tailwind`               | CSS        | Utility-first Tailwind conventions   |
| `testing/vitest`             | Testing    | Vitest testing patterns              |
| `security/supabase-rls`      | Security   | Supabase RLS enforcement             |
| `security/auth-patterns`     | Security   | Authentication best practices        |
| `frontend/design-guidelines` | Frontend   | UI/UX design conventions             |
| `frontend/accessibility`     | Frontend   | Accessibility (a11y) rules           |
| `frontend/performance`       | Frontend   | Frontend performance patterns        |
| `workflow/git-conventions`   | Workflow   | Git commit and branch conventions    |
| `workflow/debugging`         | Workflow   | Systematic debugging methodology     |
| `workflow/spec-driven`       | Workflow   | Spec-driven development workflow     |

## Available Assets

| Asset                   | Type     | Description                                      |
| ----------------------- | -------- | ------------------------------------------------ |
| `command/spec`          | Command  | Generate a feature spec through guided questions |
| `command/plan`          | Command  | Create an implementation plan from a spec        |
| `command/build`         | Command  | Execute a plan step by step with verification    |
| `command/learn`         | Command  | Capture a lesson learned as a project rule       |
| `template/feature-spec` | Template | Markdown template for feature specifications     |
| `hook/auto-format`      | Hook     | Auto-format files after AI edits                 |
| `preset/spec-driven`    | Preset   | Complete spec-driven development workflow        |
