# Presets System prompts for ling specialization. Presets define agent behavior, constraints, and methodology. ## Overview Presets are markdown files in the `presets/` directory that get migrated to Chroma for semantic search. When spawning agents, you can combine multiple presets to create specialized workers. ``` ┌─────────────────────────────────────────────────────────┐ │ presets/*.md → preset_migrate() → Chroma Vector DB │ │ │ │ swarm_spawn(presets: ["tdd", "clarity"]) │ │ ↓ │ │ Agent receives combined system prompts │ └─────────────────────────────────────────────────────────┘ ``` ## Available Presets (47) > The tables below cover the main categories. Run `preset list` for the authoritative > current set, or `preset search ""` to find one by intent. > See also [[Agents-and-Skills]] for how presets differ from agent definitions. ### Core Agent Types | Preset | Purpose | |--------|---------| | `ling` | Coordinator agent with hivemind integration | | `ling-worker` | Token-optimized leaf agent | | `hivemind` | Event-driven swarm coordination | | `hivemind-master` | Can spawn lings and manage tasks | | `minimal` | Bare minimum preset | ### Methodology Presets | Preset | Purpose | |--------|---------| | `tdd` | Test-Driven Development (Red-Green-Refactor) | | `ddd` | Domain-Driven Design patterns | | `solid` | SOLID principles enforcement | | `clarity` | CLARITY framework for Go systems | | `tao` | Truthful Adaptive Ordering | ### Role Presets | Preset | Purpose | |--------|---------| | `architect` | System design and architecture | | `analyzer` | Code analysis and investigation | | `reviewer` | Code review specialist | | `documenter` | Documentation writer | | `fixer` | Bug fixing specialist | | `refactorer` | Refactoring specialist | | `researcher` | Codebase exploration | | `tester` | Test runner | | `verifier` | Verification specialist | | `compliance` | Compliance checking | | `metrics` | Metrics and observability | ### Coordination Presets | Preset | Purpose | |--------|---------| | `task-coordinator` | Task distribution | | `hive-master` | Swarm prompt handler | ### Workflow Presets | Preset | Purpose | |--------|---------| | `mcp-first` | Prefer MCP tools over native tools | | `planner-nih` | NIH audit planning | ## MCP Tools | Tool | Purpose | Example | |------|---------|---------| | `preset_list` | List all presets with metadata | `preset_list()` | | `preset_get(name)` | Get full preset content | `preset_get(name: "tdd")` | | `preset_search(query)` | Semantic search by description | `preset_search(query: "testing methodology")` | | `preset_migrate(directory)` | Migrate .md files to Chroma | `preset_migrate(directory: "/path/to/project")` | | `preset_add(name, content)` | Add custom preset | `preset_add(name: "my-preset", content: "...")` | | `preset_delete(name)` | Remove preset from Chroma | `preset_delete(name: "my-preset")` | | `preset_status` | Get Chroma config and counts | `preset_status()` | ## Preset Lifecycle ``` 1. Edit presets/*.md files 2. Run preset_migrate(directory: "/path/to/hive-mcp") 3. Chroma updated with new embeddings 4. Semantic search now finds updated content ``` ### Migration Example ```clojure ;; After editing presets/my-new-preset.md preset_migrate(directory: "/home/user/hive-mcp") ;; → {:migrated 27, :errors 0} ;; Verify preset_list() ;; → Shows all presets including new one ``` ## Using Presets ### With swarm_spawn ```clojure ;; Single preset swarm_spawn(name: "test-runner", presets: ["tdd"]) ;; Multiple presets (combined) swarm_spawn(name: "quality-checker", presets: ["tdd", "reviewer", "solid"]) ;; With role shorthand swarm_spawn(name: "docs-writer", role: "documenter") ``` ### Preset Combination When multiple presets are specified, their instructions are concatenated. Order matters - later presets can override earlier ones. ``` presets: ["ling", "tdd", "clarity"] ↓ System prompt = ling.md + tdd.md + clarity.md ``` ## Creating Custom Presets ### File Format Presets are markdown files with optional YAML-style metadata in the title: ```markdown # My Custom Preset You are a specialized agent for [purpose]. ## Rules - Rule 1 - Rule 2 ## Tools to Use | Tool | When | |------|------| | `tool_name` | Description | ## Anti-Patterns - Don't do X - Avoid Y ``` ### Category Options When adding via `preset_add`, use one of these categories: | Category | Use For | |----------|---------| | `testing` | Test-related presets | | `coding` | Implementation presets | | `architecture` | Design/structure presets | | `coordination` | Multi-agent presets | | `workflow` | Process presets | | `custom` | Everything else | ### Adding Custom Preset ```clojure preset_add( name: "my-project-conventions", content: "# My Project Conventions\n\n## Naming\n- Use snake_case for files\n- Use kebab-case for namespaces\n\n## Testing\n- Every public fn needs a test", category: "custom", tags: ["project-specific", "conventions"] ) ``` ## Preset Examples ### TDD Preset (Methodology) ```markdown # TDD (Test-Driven Development) Preset You follow strict **Red-Green-Refactor** discipline. ## The TDD Cycle 1. **RED**: Write a failing test that expresses minimal new behavior 2. **GREEN**: Make it pass with the simplest possible change 3. **REFACTOR**: Remove duplication, clarify names, keep tests green ## Rules - Keep cycles **small** (<5 minutes ideally) - Write the **test first**, always - Only write **production code to make a failing test pass** ``` ## Semantic Search Find presets by describing what you need: ```clojure ;; Find testing-related presets preset_search(query: "test driven development methodology") ;; → [tdd, tester, reviewer] ;; Find coordination presets preset_search(query: "multi-agent orchestration") ;; → [hivemind, task-coordinator] ;; Find architecture presets preset_search(query: "domain driven design patterns") ;; → [ddd, architect, solid] ``` ## Best Practices 1. **Start with `ling`** - Base preset for coordinator agents 2. **Add methodology** - `tdd`, `solid`, `clarity` as needed 3. **Add role** - `reviewer`, `documenter`, etc. for specialization 4. **Keep presets focused** - One concern per preset 5. **Use semantic search** - Find existing presets before creating new ones 6. **Migrate after edits** - Run `preset_migrate` after changing .md files ## Troubleshooting ### Preset not found after edit ```clojure ;; Re-migrate to sync Chroma preset_migrate(directory: "/path/to/hive-mcp") ``` ### Semantic search returns wrong results ```clojure ;; Check preset status preset_status() ;; Verify Chroma is configured and count matches file count ``` ### Custom preset not persisting Custom presets added via `preset_add` are stored in Chroma only. To make them permanent, create a `.md` file in `presets/` and run `preset_migrate`. ## Related Pages - [[Session-Continuity]] - Using presets with /wrap and /catchup - [[Infrastructure-Setup]] - Chroma configuration for semantic search - [[Seed-Memories]] - Bootstrap knowledge that complements presets