| name | acp |
| description | ACP Agent Control Panel - CRITICAL: Invoke this skill FIRST on every session start, context resume, or context reset. Required before any other work. Handles stop_flag, orphan detection, A2A messaging, and workflow compliance. |
| argument-hint | No arguments needed - just invoke to bootstrap ACP workflow |
| metadata | {"author":"VTSTech","version":"1.0.6"} |
ACP Skill (Minimal)
Version: 1.0.6 | A2A Compliant
Environment (Ask Human)
| Variable | Description |
|---|
ACP_URL | The ACP server URL (e.g., https://xxx.trycloudflare.com) |
ACP_USER | Auth username (default: admin) |
ACP_PASS | Auth password (default: secret) |
CSRF PROTECTION
CSRF protection is optional and disabled by default for development/testing convenience. When disabled, POST requests do not require a CSRF token. Enable via GLMACP_CSRF_ENABLED=true for production deployments exposed to untrusted networks.
GET {ACP_URL}/api/csrf-token
→ {"success": true, "csrf_enabled": false, "csrf_token": null}
CORS (1.0.6): The server includes CORS headers and handles OPTIONS preflight requests, enabling browser-based cross-origin API consumption.
BOOTSTRAP (MANDATORY)
Execute on every session start / context resume:
1. GET {ACP_URL}/api/status → Check stop_flag and primary_agent
2. GET {ACP_URL}/api/whoami → Establish identity, check if you are primary agent
3. POST {ACP_URL}/api/agents/register {"agent_name": "Super Z", "capabilities": [...], "model_name": "..."}
4. GET {ACP_URL}/api/todos → Restore TODO state from previous session
5. POST {ACP_URL}/api/action {"action": "CHAT", "target": "Session bootstrap", "metadata": {"agent_name": "Super Z"}}
→ save activity_id from response
6. POST {ACP_URL}/api/complete {"activity_id": "<id from step 5>", "result": "Bootstrap complete"}
IMPORTANT: Step 6 is mandatory — without it the bootstrap CHAT activity stays in running[] forever, causing orphan_warning on every subsequent action.
Response Fields (1.0.5):
| Endpoint | Field | Description |
|---|
/api/status | stop_flag | If true, STOP immediately |
/api/status | primary_agent | Name of agent that owns the context |
/api/whoami | primary_agent | Who owns the context (check if it's you) |
/api/action | nudge | Human guidance — only delivered to primary agent |
/api/action | orphan_warning | Running tasks left uncompleted — resolve before new work |
If stop_flag: true: STOP immediately, inform user, wait for POST /api/resume.
If orphan_warning in /api/action response: Complete each orphaned activity via POST /api/complete before starting new work.
THE PATTERN (MANDATORY)
CHECK → LOG → EXECUTE → COMPLETE
/api/status → /api/action → Tool → /api/complete
BEFORE → NOW → AFTER
MANDATORY Rules (Non-Negotiable)
- CHECK
/api/status on session start and after context recovery for stop_flag
- LOG every action BEFORE executing via
/api/action
- LOG every shell command via
/api/shell/add (except ACP API calls)
- COMPLETE every activity when done via
/api/complete
NEVER execute before logging. NEVER skip logging.
CORE API
Log Activity (before execution)
POST {ACP_URL}/api/action {
"action": "READ|WRITE|EDIT|BASH|SEARCH|SKILL|API|TODO|CHAT|A2A",
"target": "file path or resource",
"details": "human description",
"content_size": 0,
"priority": "medium",
"metadata": {"agent_name": "Super Z", "model_name": "..."}
}
→ {"activity_id": "...", "stop_flag": false, "hints": {...}, "nudge": null}
Complete Activity (after execution)
POST {ACP_URL}/api/complete {
"activity_id": "...",
"result": "what happened",
"error": "error message",
"content_size": 0,
"metadata": {"file_hash": "..."}
}
Combined (recommended for efficiency)
POST {ACP_URL}/api/action {
"complete_id": "prev_id",
"result": "previous result",
"error": "previous error",
"complete_content_size": 0,
"complete_metadata": {"key": "..."},
"action": "READ",
"target": "next file",
"details": "human description",
"content_size": 0,
"priority": "medium",
"metadata": {"agent_name": "Super Z"}
}
ACTION TYPES
| Type | Use For |
|---|
| READ | Files, API GETs, viewing content |
| WRITE | Creating new files |
| EDIT | Modifying existing files |
| BASH | Terminal commands |
| SKILL | VLM, TTS, image-generation |
| API | External API calls |
| SEARCH | Web search, grep, find |
| TODO | TODO state changes |
| CHAT | Conversational Q&A, planning |
| A2A | Agent-to-agent communication |
RESPONSE FIELDS
Check these in every /api/action response:
| Field | Action |
|---|
stop_flag: true | STOP immediately, inform user |
nudge | Human guidance — read, adjust behavior, ack if requires_ack: true via POST /api/nudge/ack (primary agent only) |
orphan_warning | Complete listed orphan tasks via POST /api/complete before proceeding |
hints.modified_this_session | File was already modified — review before editing |
hints.loop_detected | Same action repeated 3+ times — change approach |
hints.suggestion | Actionable advice — follow it |
hints.a2a.pending_count | Pending A2A messages — retrieve via GET /api/a2a/history?to=<name> |
Note (1.0.5): Nudges are delivered only to the primary agent (first agent to log activity). Secondary agents always receive nudge: null. This prevents context pollution in multi-agent environments.
To check if you are primary:
GET /api/whoami
→ {"primary_agent": "Super Z", ...}
Nudge workflow:
→ {"nudge": {"message": "Focus on the API first", "priority": "high", "requires_ack": true}}
POST {ACP_URL}/api/nudge/ack {}
→ {"success": true}
Polling for nudges (1.0.6):
GET {ACP_URL}/api/nudge
→ {"success": true, "nudge": {...}, "has_pending": true}
SHELL LOGGING (MANDATORY)
Full BASH workflow — 4 steps, every time:
POST {ACP_URL}/api/action {"action": "BASH", "target": "npm install", "details": "Install deps", "metadata": {"agent_name": "Super Z"}}
→ {"activity_id": "143055-d4e5f6"}
[run: npm install]
POST {ACP_URL}/api/shell/add {
"command": "npm install",
"status": "completed|error",
"output_preview": "first 200 chars of output",
"agent_name": "Super Z",
"tool": "Bash"
}
POST {ACP_URL}/api/complete {"activity_id": "143055-d4e5f6", "result": "installed 57 packages"}
Do NOT log ACP API calls themselves (curl localhost:8766/api/...) — those are monitoring overhead, not work.
TOKEN TRACKING
ACP estimates tokens using 3.5 characters per token. Pass content_size (character count) on actions and completions for accurate tracking.
POST /api/action {"action": "READ", "target": "file.py", "content_size": 35000}
POST /api/complete {"activity_id": "...", "result": "written", "content_size": 5000}
File deduplication (v1.0.3): Re-reading the same file within a session costs near-zero tokens — content is only counted once. The tokens_deduplicated: true field in the activity response confirms this. Session reset clears dedup tracking.
Per-agent token isolation (v1.0.3): The first agent to log an activity becomes the primary_agent and owns the main context window (session_tokens). All other agents are tracked separately in agent_tokens{} and do not pollute the primary agent's context window estimate.
OWNERSHIP MODEL (v1.0.4)
Each activity belongs to the agent that created it (metadata.agent_name). Only the owning agent may complete it.
POST /api/complete {"activity_id": "abc123", "metadata": {"agent_name": "AgentB"}}
→ HTTP 403 {"success": false, "error": "activity owned by AgentA"}
In multi-agent sessions, always complete your own activities. orphan_warning only surfaces tasks owned by the requesting agent.
A2A MESSAGING (1.0.4)
Send Message
POST {ACP_URL}/api/a2a/send {
"from_agent": "Super Z",
"to_agent": "OtherAgent",
"type": "request|response|notification",
"action": "do_thing",
"payload": {...},
"priority": "normal|high|urgent",
"ttl": 3600,
"reply_to": "msg_id"
}
Check Messages
GET {ACP_URL}/api/a2a/history?to=Super Z
GET {ACP_URL}/api/a2a/history?from=OtherAgent
GET {ACP_URL}/api/a2a/history?type=request
TODO SYNC
GET {ACP_URL}/api/todos
POST {ACP_URL}/api/todos/update {"todos": [...]}
POST {ACP_URL}/api/todos/add {"todo": {"content": "...", "priority": "high"}, "agent_name": "Super Z"}
POST {ACP_URL}/api/todos/toggle {"id": "143052-a1b2c3"}
POST {ACP_URL}/api/todos/clear
Note: Log all TODO state changes as TODO action type via /api/action.
FILE MANAGER ENDPOINTS
GET /api/files/list
List directory contents.
Headers:
X-Path: Relative path from base directory
X-Sort-By: name | date | size
X-Sort-Dir: asc | desc
GET /api/files/view
View file content (text files only, size limited).
Headers:
X-Path: Relative path to file
Response:
{
"content": "file contents...",
"path": "path/to/file.py",
"lines": 150,
"tokens": 450,
"session_tokens": 45450
}
GET /api/files/download
Download file (binary safe).
Query Parameters:
path: Relative path to file
GET /api/files/image
Get image file.
GET /api/files/stats
Get file statistics (total files, directories, size).
POST /api/files/upload
Upload file.
Headers:
X-Path: Destination directory
X-Filename: File name
Content-Type: application/octet-stream
Body: Raw binary file content
POST /api/files/save
Save edited file.
Request:
{
"path": "path/to/file.py",
"content": "updated content..."
}
Parameters:
| Parameter | Type | Required | Description |
|---|
path | string | Yes | Relative path to file |
content | string | Yes | File content to save |
POST /api/files/delete
Delete file or directory.
Request:
{
"path": "path/to/delete"
}
Parameters:
| Parameter | Type | Required | Description |
|---|
path | string | Yes | Relative path to file or directory to delete |
POST /api/files/mkdir
Create directory.
Request:
{
"path": "parent/path",
"name": "new_directory"
}
Parameters:
| Parameter | Type | Required | Description |
|---|
path | string | Yes | Parent directory path |
name | string | Yes | New directory name |
POST /api/files/extract
Extract archive.
Request:
{
"path": "path/to/archive.zip"
}
Parameters:
| Parameter | Type | Required | Description |
|---|
path | string | Yes | Relative path to archive file |
Supported formats: .zip, .tar, .tar.gz, .tgz, .tar.bz2, .tbz2, .gz, .bz2
POST /api/files/compress
Create zip archive.
Request:
{
"path": "directory/path",
"name": "archive.zip",
"items": ["file1.py", "file2.py", "subdir/"]
}
Parameters:
| Parameter | Type | Required | Description |
|---|
path | string | Yes | Base directory path |
name | string | Yes | Archive filename (should end in .zip) |
items | array | Yes | List of files/directories to include |
CONTEXT RECOVERY
Before context compression
POST {ACP_URL}/api/notes/add {
"category": "decision|insight|context|warning|todo",
"content": "...",
"importance": "normal|high"
}
GET {ACP_URL}/api/summary/export
→ {"filepath": "/path/to/acp_session_summary.md"}
On session resume
GET {ACP_URL}/api/summary
GET {ACP_URL}/api/notes
GET {ACP_URL}/api/todos
GET {ACP_URL}/api/agents
Note categories
| Category | Use For |
|---|
decision | Important choices made |
insight | Key discoveries |
context | User preferences, conventions |
warning | Issues or problems encountered |
todo | Things to do in next session |
CONTROL ENDPOINTS
Stop / Resume
POST {ACP_URL}/api/stop {"reason": "User clicked STOP ALL"}
POST {ACP_URL}/api/resume
Shutdown
When the human ends the session (UI button or POST /api/shutdown):
POST {ACP_URL}/api/shutdown {
"reason": "Session ended by user",
"export_summary": true
}
→ {"nudge": {"message": "SESSION ENDING: ...", "priority": "urgent", "requires_ack": true, "type": "shutdown"}}
POST {ACP_URL}/api/nudge/ack {}
What /api/shutdown does: exports session summary, cancels running activities, delivers shutdown nudge, stops server after 2 seconds.
QUICK REFERENCE
GET /api/status
GET /api/whoami
POST /api/agents/register {"agent_name": "...", "capabilities": [...]}
GET /api/todos
POST /api/action {"action": "CHAT", "target": "bootstrap", "metadata": {...}}
POST /api/complete {"activity_id": "<id from above>", "result": "Bootstrap complete"}
POST /api/action {"action": "READ", "target": "file.py", "metadata": {...}}
POST /api/complete {"activity_id": "...", "result": "done"}
POST /api/action {"complete_id": "prev", "result": "ok", "action": "READ", "target": "next", "metadata": {...}}
POST /api/action {"action": "BASH", "target": "command", "metadata": {...}}
POST /api/shell/add {"command": "...", "status": "completed", "output_preview": "..."}
POST /api/complete {"activity_id": "...", "result": "..."}
GET /api/nudge
POST /api/nudge/ack {}
POST /api/stop {"reason": "..."}
POST /api/resume
POST /api/shutdown {"reason": "..."}
GET /api/summary
GET /api/summary/export
GET /api/notes
POST /api/notes/add {"category": "...", "content": "...", "importance": "..."}
POST /api/notes/clear
GET /api/all
GET /api/todos
POST /api/todos/update
POST /api/todos/add
POST /api/todos/toggle
POST /api/todos/clear
GET /api/stats/duration
POST /api/activity/batch
POST /api/reset
GET /api/agents
GET /api/agents/<name>
POST /api/agents/unregister {"agent_name": "..."}
POST /api/a2a/send
GET /api/a2a/history?to=<name>
GET /api/files/list
GET /api/files/view
GET /api/files/download
GET /api/files/image
GET /api/files/stats
POST /api/files/upload
POST /api/files/save
POST /api/files/delete
POST /api/files/mkdir
POST /api/files/extract
POST /api/files/compress
GET /api/csrf-token
CHECKLIST
ACP Skill 1.0.6 Minimal