- Create the agent
.mdfile in the appropriate category folder:
agent-swarm/agents/<category>/<agent-name>.md
Example: agent-swarm/agents/sales/sales-revenue-ops.md
---
name: Revenue Operations Specialist
description: Optimizes revenue processes across sales, marketing, and CS
vibe: Data-driven, systems thinker, cross-functional
---
# Revenue Operations Specialist
You are an expert Revenue Operations (RevOps) specialist...
## Core Capabilities
- CRM hygiene and process standardization
- Sales/marketing/CS alignment
- Revenue forecasting and attribution
## Your Approach
1. Audit the current revenue stack
2. Identify bottlenecks in the funnel
...- Register in
swarm.config.json:
{
"agents": {
"sales-revenue-ops": {
"file": "sales/sales-revenue-ops.md",
"engine": null,
"source": "sales"
}
}
}- Sync into AOS registry:
cd backend
source .venv/bin/activate
python manage.py sync_swarm_agents --category salesSkills are reusable knowledge modules injected into agent context.
Create agent-swarm/skills/<category>/<skill-name>.md:
# Revenue Attribution Modeling
## Multi-Touch Attribution
Use this when assigning credit across the customer journey...
## First-Touch vs. Last-Touch
- First-touch: credits the first marketing touchpoint
- Last-touch: credits the interaction before conversion
...Reference it in an agent's system prompt or in commands.
Commands are workflow templates — multi-agent chains.
Create agent-swarm/commands/<command-name>.md:
# /revenue-audit
Runs a comprehensive revenue operations audit.
## Steps
1. Dispatch `sales-pipeline-analyst` to assess pipeline health
2. Dispatch `sales-revenue-ops` to identify process gaps
3. Dispatch `strategy-financial-modeler` to project impact
4. Compile findings into an executive summary- Create the app:
cd backend
source .venv/bin/activate
python manage.py startapp myfeature apps/myfeature- Add to
INSTALLED_APPSinsettings.py:
INSTALLED_APPS = [
...
'apps.myfeature',
]- Create
apps/myfeature/urls.pyand register inbackend/urls.py:
path('api/myfeature/', include('apps.myfeature.urls')),- Create and apply migrations:
python manage.py makemigrations myfeature
python manage.py migrateTo add a new policy effect (e.g., THROTTLE):
- Add to
PolicyEffectinapps/policy_engine/models.py:
class PolicyEffect(models.TextChoices):
...
THROTTLE = "THROTTLE", _("Throttle")- Handle in
PolicyEvaluator.evaluate():
if effect == PolicyEffect.THROTTLE:
# Add rate limiting logic
pass- Handle in
SwarmPolicyCheckView:
if effect == PolicyEffect.THROTTLE:
decision = "throttle"
# Return retry-after header- Handle in
core/aos_client.py:
if decision == "throttle":
time.sleep(retry_after)
return self.policy_check(...) # retry- Add to
LLMProviderenum inapps/agent_intelligence/models.py:
class LLMProvider(models.TextChoices):
...
COHERE = "COHERE", "Cohere"- Add to
LLMManager.get_llm()inapps/agent_intelligence/utils/llm_manager.py:
elif config.provider == LLMProvider.COHERE:
from langchain_cohere import ChatCohere
return ChatCohere(
model=config.model_name,
cohere_api_key=config.decrypted_api_key,
)- Add to
engines/adapter.pyin agent-swarm if you want swarm to use it directly.
In agent-swarm/engines/adapter.py:
register_engine(
name="my-engine",
command_template="{engine} --system {system_file} --task {task}",
system_flag="--system",
task_position="--task",
auto_flag="--auto",
)Set it as default in swarm.config.json:
{"default_engine": "my-engine"}cd backend
source .venv/bin/activate
# Run all tests
python manage.py test
# Run a specific app's tests
python manage.py test apps.policy_engine
# Run with coverage
pytest --cov=apps --cov-report=html
open htmlcov/index.htmlTests live in apps/<appname>/tests.py. Use Django's TestCase for DB tests and DRF's APITestCase for endpoint tests.
- Python: follow PEP 8. No inline comments unless the WHY is non-obvious.
- Use Django's ORM — avoid raw SQL.
- All new models need
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False). - All new API views need
permission_classes = [IsAuthenticated]. - New management commands should be idempotent (safe to run multiple times).
- New swarm agents should have YAML frontmatter with at least
nameanddescription.