test-backend-router

Test implementation of thin router skill for DiPeO backend. Provides decision criteria and documentation anchors for FastAPI server, CLI (dipeo run/results/metrics/compile/export), SQLite schema, and MCP integration in apps/server/. Use when task mentions CLI commands, server endpoints, database queries, or MCP tools.

12 stars

Best use case

test-backend-router is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Test implementation of thin router skill for DiPeO backend. Provides decision criteria and documentation anchors for FastAPI server, CLI (dipeo run/results/metrics/compile/export), SQLite schema, and MCP integration in apps/server/. Use when task mentions CLI commands, server endpoints, database queries, or MCP tools.

Teams using test-backend-router should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/test-backend-router/SKILL.md --create-dirs "https://raw.githubusercontent.com/sorryhyun/DiPeO/main/.claude/skills/test-backend-router/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/test-backend-router/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How test-backend-router Compares

Feature / Agenttest-backend-routerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Test implementation of thin router skill for DiPeO backend. Provides decision criteria and documentation anchors for FastAPI server, CLI (dipeo run/results/metrics/compile/export), SQLite schema, and MCP integration in apps/server/. Use when task mentions CLI commands, server endpoints, database queries, or MCP tools.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Test Backend Router Skill

**Purpose**: Demonstrate thin router pattern for on-demand documentation retrieval.

This is a **proof-of-concept** router skill showing how to replace automatic documentation injection with progressive disclosure via doc-lookup.

## When to Use This Skill (NOT the Agent)

Use this skill for **simple, focused tasks**:
- ✅ Reading CLI help text
- ✅ Understanding server configuration
- ✅ Reviewing database schema structure
- ✅ Learning MCP tool signatures
- ✅ Small config changes (<20 lines, 1 file)
- ✅ Debugging with logs (read-only investigation)

**Typical token usage**: ~1,500 tokens (router + specific section)

## When to Escalate to dipeo-backend Agent

Escalate for **complex, multi-step work**:
- ❌ Adding new CLI commands (multi-file changes)
- ❌ Database schema migrations
- ❌ New MCP tool implementation
- ❌ FastAPI route changes (>1 file)
- ❌ Background execution modifications
- ❌ Any task affecting >2 files

**Agent token usage**: Higher, but justified for complex work

## Decision Workflow

```
1. Task received
     ↓
2. Is it simple? (1 file, <20 lines, read-only)
     ↓ YES                    ↓ NO
3. Use this skill          5. Escalate to agent
     ↓
4. Need detailed docs?
     ↓ YES
   Load doc-lookup with specific anchor
```

## Key Documentation Sections

Use `Skill(doc-lookup)` with these anchors for targeted retrieval:

### CLI Commands & Architecture
- **Full guide**: `docs/agents/backend-development.md#cli-system`
- **Command examples**: `docs/agents/backend-development.md#cli-commands`
- **Architecture**: `docs/agents/backend-development.md#cli-architecture`
- **Background execution**: `docs/agents/backend-development.md#background-execution`

**Example lookup**:
```bash
python .claude/skills/doc-lookup/scripts/section_search.py \
  --query "cli-commands" \
  --paths docs/agents/backend-development.md \
  --top 1
```

### FastAPI Server
- **Overview**: `docs/agents/backend-development.md#fastapi-server`
- **Core responsibilities**: `docs/agents/backend-development.md#core-responsibilities`

### Database & Persistence
- **Database schema**: `docs/agents/backend-development.md#database-schema`
- **Message store**: `docs/agents/backend-development.md#message-store`
- **Full DB section**: `docs/agents/backend-development.md#database-persistence`

**Example lookup**:
```bash
python .claude/skills/doc-lookup/scripts/section_search.py \
  --query "database-schema" \
  --paths docs/agents/backend-development.md \
  --top 1 \
  --max-lines 40
```

### MCP Server Integration
- **MCP overview**: `docs/agents/backend-development.md#mcp-server`
- **MCP tools**: `docs/agents/backend-development.md#mcp-tools`
- **MCP resources**: `docs/agents/backend-development.md#mcp-resources`
- **MCP architecture**: `docs/agents/backend-development.md#mcp-architecture`

**Example lookup**:
```bash
python .claude/skills/doc-lookup/scripts/section_search.py \
  --query "mcp-tools" \
  --paths docs/agents/backend-development.md \
  --top 1
```

### General Reference
- **Common patterns**: `docs/agents/backend-development.md#common-patterns`
- **Troubleshooting**: `docs/agents/backend-development.md#troubleshooting`
- **Escalation**: `docs/agents/backend-development.md#escalation`

## Usage Examples

### Example 1: Understanding CLI Flags

**User request**: "How do I add a `--json` flag to `dipeo run`?"

**Router workflow**:
1. Assess: Simple task, need CLI context
2. Load doc-lookup for CLI commands section:
   ```bash
   python .claude/skills/doc-lookup/scripts/section_search.py \
     --query "cli-commands" \
     --paths docs/agents/backend-development.md \
     --top 1
   ```
3. Review returned section (~50 lines)
4. Answer question or make simple change
5. **Token cost**: ~1,000 tokens (vs. 15,000 with auto-injection)

### Example 2: Debugging MCP Tool Registration

**User request**: "The `dipeo_run` MCP tool isn't showing up"

**Router workflow**:
1. Assess: Debugging task, need MCP tool context
2. Load doc-lookup for MCP tools:
   ```bash
   python .claude/skills/doc-lookup/scripts/section_search.py \
     --query "mcp-tools" \
     --paths docs/agents/backend-development.md \
     --top 1 \
     --max-lines 50
   ```
3. Review MCP tool implementation section
4. Investigate registration logic
5. If fix is simple → handle directly
6. If complex (multi-file) → escalate to agent

### Example 3: Database Schema Review

**User request**: "What columns are in the executions table?"

**Router workflow**:
1. Assess: Read-only, need database schema
2. Load doc-lookup for database schema:
   ```bash
   python .claude/skills/doc-lookup/scripts/section_search.py \
     --query "database-schema" \
     --paths docs/agents/backend-development.md \
     --top 1
   ```
3. Return schema information from section
4. **Token cost**: ~800 tokens (just the schema section)

### Example 4: Complex Task → Escalate

**User request**: "Add support for background execution with progress callbacks"

**Router workflow**:
1. Assess: Complex (affects CLI, database, possibly execution engine)
2. Decision: This requires multi-file changes and architecture decisions
3. **Escalate**: `Task(dipeo-backend, "Add background execution with progress callbacks")`
4. Agent can then load specific sections as needed during implementation

## Escalation Paths

### To dipeo-package-maintainer
When task involves:
- Execution handler logic
- Service architecture (EventBus, ServiceRegistry)
- Domain models
- LLM infrastructure

### To dipeo-codegen-pipeline
When task involves:
- GraphQL schema changes
- Generated type issues
- TypeScript model specs

## Quick Reference: Files You Can Work With

**Directly editable** (if task is simple):
- `apps/server/src/dipeo_server/cli/parser.py` - CLI argument parsing
- `apps/server/src/dipeo_server/api/router.py` - API routes
- `apps/server/main.py` - Server initialization
- `apps/server/src/dipeo_server/infra/db_schema.py` - Database schema

**Requires agent** (if complex):
- Multiple files across CLI, API, and database
- New feature implementation
- Architecture changes

## Testing the Router + Doc-Lookup Pattern

This test skill demonstrates:
1. ✅ **Thin router**: ~100 lines vs. 600+ lines of full docs
2. ✅ **Anchor references**: Stable links to specific sections
3. ✅ **Decision criteria**: Clear guidelines for skill vs. agent
4. ✅ **Progressive disclosure**: Load only needed sections via doc-lookup
5. ✅ **Token efficiency**: ~1,500 tokens vs. 15,000 with auto-injection

## Token Savings Analysis

**Before (auto-injection via PreToolUse hook)**:
- Backend agent invocation: 15,000 tokens automatic
- Total: 15,000 tokens (all-or-nothing)

**After (router + doc-lookup)**:
- Router skill load: ~500 tokens
- Doc-lookup single section: ~500-1,000 tokens
- Total: ~1,000-1,500 tokens (on-demand)
- **Savings**: ~90% reduction for focused tasks

## Version History

- **v1.0.0** (2025-10-19): Initial test implementation demonstrating thin router pattern

Related Skills

dipeo-backend

12
from sorryhyun/DiPeO

Router skill for DiPeO backend ecosystem (server/ and cli/): FastAPI server, CLI tools, database, MCP integration. Use when task mentions CLI commands, server endpoints, database queries, or MCP tools. For simple tasks, handle directly; for complex work, escalate to dipeo-backend agent.

todo-manage

12
from sorryhyun/DiPeO

Manage and organize TODO.md at project root - plan features, track progress, mark tasks complete, and clean up completed items. Use when planning tasks, organizing work, reviewing priorities, or managing the project TODO list. Access via /dipeotodos command.

separate-monolithic-python

12
from sorryhyun/DiPeO

Break large Python files (>500 LOC) into smaller, well-organized modules with proper package structure. Use when a Python file is too large, monolithic, or needs refactoring. Triggered by requests mentioning "too large", "separate", "split", "break up", or "refactor" for Python files.

maintain-docs

12
from sorryhyun/DiPeO

Update and maintain documentation to reflect current implementation after code changes, refactoring, or new features. Remove temporal language, verify accuracy against code, and keep docs current. Use when updating docs, syncing documentation, removing outdated info, or after implementing features.

import-refactor

12
from sorryhyun/DiPeO

Update all import statements, module references, string paths, and config references after moving or renaming files and modules. Handles Python, TypeScript, and JavaScript imports. Use when moving files, renaming modules, restructuring directories, or consolidating code.

skill-generator

12
from sorryhyun/DiPeO

Create new Claude Code skills with proper structure and best practices. Use when the user wants to create a new skill, extend Claude's capabilities, or needs help structuring a SKILL.md file.

doc-lookup

12
from sorryhyun/DiPeO

Locate and retrieve specific documentation sections from DiPeO's docs/ by heading anchors or keywords. Returns minimal, targeted excerpts instead of full files. Use when you need precise documentation context without loading entire guides.

dipeo-package-maintainer

12
from sorryhyun/DiPeO

Router skill for DiPeO runtime Python code (execution handlers, service architecture, domain models, LLM infrastructure). Use when task mentions node handlers, EventBus, ServiceRegistry, Envelope pattern, or domain logic. For simple tasks, handle directly; for complex work, escalate to dipeo-package-maintainer agent.

dipeo-frontend-dev

12
from sorryhyun/DiPeO

Router skill for DiPeO frontend (React, visual editor, GraphQL integration, TypeScript types). Use when task mentions React components, diagram editor, GraphQL hooks, or type errors. For simple tasks, handle directly; for complex work, escalate to dipeo-frontend-dev agent.

dipeo-codegen-pipeline

12
from sorryhyun/DiPeO

Router skill for DiPeO code generation pipeline (TypeScript specs → IR → Python/GraphQL). Use when task mentions TypeScript models, IR builders, generated code diagnosis, or codegen workflow. For simple tasks, handle directly; for complex work, escalate to dipeo-codegen-pipeline agent.

clean-comments

12
from sorryhyun/DiPeO

Remove unnecessary, redundant, or obvious code comments while preserving valuable explanations. Use when cleaning up comments, removing verbose documentation, simplifying inline comments, or preparing code for review.

jepsen-testing

16
from plurigrid/asi

Jepsen-style correctness testing for distributed systems under faults (partitions, crashes, clock skew) using concurrent operation histories and formal checkers (linearizability/serializability and Elle-style anomalies). Use when designing, implementing, or running Jepsen tests, or interpreting histories/violations.