SubagentDelegation

From imqqmi/FloppyControl · View interactive version

SubagentDelegation is an AI agent skill from the GitHub repository imqqmi/FloppyControl. When to delegate tasks and work to subagents.

How to use this skill

Skill file

What I do

Sub-Agent Delegation Strategy

To conserve context space and token usage:

When to Delegate

When NOT to Delegate

How to use subagents

Analyze task dependencies from exec plan

SUB-AGENT DELEGATION:

To save context space and token usage, delegate implementation tasks to sub-agents:

  1. Break work into discrete, well-scoped tasks
  2. Use the Task tool to spawn sub-agents for:
  1. Provide sub-agents with:
  1. Subagent must apply best practices for security, logging, clarity. Avoid security holes, sql injection vulnerabilities and other security issues.
  2. Review

Example delegation:

Task: "Implement FileSystemConnector class in src/ingestion/filesystem.py.
Requirements:
- Implement DataConnector interface (see docs/ARCHITECTURE.md and docs/phase<N>_SPEC.md)
- Walk directories recursively
- Filter by file extension
- Extract metadata (size, modified date, path)
- Return IngestedDocument objects
- Include docstrings and type hints
- Handle errors gracefully"

Example Prompts

New feature

Implement the FileSystemConnector class according to the DataConnector interface.
It should:
- Walk a directory recursively
- Support filtering by file extension
- Extract basic metadata (size, modified date, path)
- Return IngestedDocument objects

Follow the patterns in docs/ARCHITECTURE.md.

Utility function

Create a utility function for semantic chunking of text documents.
Requirements:
- Respect paragraph boundaries
- Target chunk size of ~500 tokens
- Overlap of ~50 tokens between chunks
- Return chunks with metadata (position, total chunks)

Integration

Implement the ChromaDB storage layer.
It should:
- Initialize collections on startup
- Add documents with embeddings and metadata
- Query by similarity with filters
- Handle connection errors gracefully

Example Workflow

Here's how the Build Agent should handle a multi-part implementation:

1. Receive task and plan

User: Implement the ingestion pipeline with filesystem and markdown connectors.

Agent thinks:
- This involves multiple components
- I'll break it into sub-tasks and delegate each
- After each component, I'll commit

2. Delegate to sub-agents

Task 1 (delegate): "Implement base DataConnector interface in src/ingestion/base.py..."
Task 2 (delegate): "Implement FileSystemConnector in src/ingestion/filesystem.py..."
Task 3 (delegate): "Implement MarkdownConnector in src/ingestion/markdown.py..."
Task 4 (delegate): "Write tests for connectors in tests/test_connectors.py..."

3. Commit after each logical unit

# After base interface is implemented:
git add src/ingestion/base.py
git commit -m "feat: add DataConnector base interface"

# After filesystem connector:
git add src/ingestion/filesystem.py
git commit -m "feat: add FileSystemConnector with recursive walking"

# After markdown connector:
git add src/ingestion/markdown.py
git commit -m "feat: add MarkdownConnector with frontmatter parsing"

# After tests:
git add tests/test_connectors.py
git commit -m "test: add unit tests for ingestion connectors"

4. Update PROGRESS.md, docs/SESSION_LOG.md, docs/FUTURE_IDEAS.md, DECISION_LOG.md

Document what was completed, decisions made, and commit references where relevant.

Sub-Agent Task Template

When delegating to a sub-agent, use this template:

Implement [component name] in [file path].

CONTEXT:
[Relevant background from architecture docs]

REQUIREMENTS:
- [Specific requirement 1]
- [Specific requirement 2]
- [etc.]

INTERFACE:
[Any interfaces or base classes to implement]

PATTERNS TO FOLLOW:
[Reference existing code patterns]

DELIVERABLES:
- Working implementation with type hints
- Docstrings for public methods
- Error handling with meaningful messages
- [Any specific outputs needed]
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.