---
name: cloudbot-frontend-file-coordinator
description: Coordinate customer file requests across CloudBot frontend agents, backend agents, and the Library.
---

# CloudBot Frontend File Coordinator

Use this skill when the customer asks a CloudBot frontend agent to find, send, share, summarize, transform, or delegate work on files.

## Natural User Intent

Customers should speak naturally:

- "Cloud, send that image to Kenny and have Kenny create 3 different marketing ideas we can use."
- "Share the trimmed video with the support agent."
- "Find the logo Kenny made last week and send it to the sales agent."
- "Use the second idea and make a task for Sarah to review Friday."

The frontend agent should resolve intent, not ask the customer for database IDs unless there is ambiguity.

## Frontend Agent Responsibilities

1. Resolve the referenced file from the current conversation, selected dashboard item, recent Library context, or a clarification question.
2. Resolve the target backend agent or frontend agent by name.
3. Create or preserve a durable request id.
4. Share artifact references, not copied files.
5. Preserve correlation fields in every dispatch and status update.
6. Report progress in human terms: accepted, working, draft saved, completed, blocked, or failed.

## Required Fields

Always preserve:

- request_id
- tenant_id
- room_name
- frontend_agent_id
- backend_agent_id
- route_id
- artifact_id
- idempotency_key

## File Reference Shape

```json
{
  "artifact_id": "customer_artifact_uuid",
  "library_id": "customer_library_uuid",
  "name": "campaign-image.png",
  "media_type": "image",
  "mime_type": "image/png",
  "size_bytes": 1842201,
  "content_hash": "sha256_hex",
  "request_id": "cbbe_1720000000_ab12cd34",
  "frontend_agent_id": "frontend_voice_agent_id",
  "backend_agent_id": "backend_agent_profile_id",
  "route_id": "frontend_backend_route_uuid"
}
```

## Duplicate Rule

Do not ask another agent to upload the same file again. Send the artifact reference and let the backend agent request a signed URL only if it needs the original bytes.

## Lost Work Rule

For multi-step work, create or reuse a work request. Backend agents should save drafts and final outputs with the same request_id so the dashboard can show progress.

```http
POST /api/runtime/agent/{frontend_agent_id}/file-work
X-Runtime-API-Key: <cloudbot_runtime_key>
Content-Type: application/json

{
  "request_id": "cbbe_1720000000_ab12cd34",
  "frontend_agent_id": "frontend_voice_agent_id",
  "backend_agent_id": "backend_agent_profile_uuid",
  "route_id": "frontend_backend_route_uuid",
  "source_artifact_id": "customer_artifact_uuid",
  "instructions": "Create 3 marketing ideas from the selected image.",
  "status": "working",
  "idempotency_key": "cbbe_1720000000_ab12cd34:work"
}
```

## Customer Reply Examples

- "I sent the image to Kenny. I will save the three ideas in your Library when Kenny finishes."
- "Kenny saved two drafts and is still working on the third idea."
- "I found a matching file already in your Library, so I shared that reference instead of uploading another copy."
