DELETE FROM agent_skills WHERE name IN ('openclaw_start_session','openclaw_end_session','openclaw_report_finding','openclaw_exchange','openclaw_get_status');

INSERT INTO agent_skills (name, description, category, scope, handler, enabled, origin, trust_level, tool_definition, instructions)
VALUES
  ('openclaw_start_session', 'Start a beta test session with a scenario description', 'system', 'internal', 'module:openclaw', true, 'bundled', 'auto',
   '{"type":"function","function":{"name":"openclaw_start_session","description":"Start a beta test session","parameters":{"type":"object","properties":{"scenario":{"type":"string","description":"Test scenario description"},"peer_name":{"type":"string","description":"Name of the tester"},"metadata":{"type":"object","description":"Optional metadata"}},"required":["scenario"]}}}'::jsonb,
   'Use when: OpenClaw initiates a beta testing session. Call this first to register the session before any findings or exchanges. Pass scenario as a short description of what is being tested. peer_name defaults to "openclaw". Returns a session_id used in all subsequent openclaw calls.'),
  ('openclaw_end_session', 'End a beta test session with summary', 'system', 'internal', 'module:openclaw', true, 'bundled', 'auto',
   '{"type":"function","function":{"name":"openclaw_end_session","description":"End a beta test session","parameters":{"type":"object","properties":{"session_id":{"type":"string","description":"Session ID to end"},"summary":{"type":"string","description":"Session summary"},"status":{"type":"string","description":"Final status"}},"required":["session_id"]}}}'::jsonb,
   'Use when: A beta test session is complete. Call with the session_id from openclaw_start_session. Provide a summary of what was tested and a final status (e.g. "completed", "aborted"). NOT for: ending sessions that were never started.'),
  ('openclaw_report_finding', 'Report a bug, UX issue, or suggestion from beta testing', 'system', 'internal', 'module:openclaw', true, 'bundled', 'auto',
   '{"type":"function","function":{"name":"openclaw_report_finding","description":"Report a finding from beta testing","parameters":{"type":"object","properties":{"session_id":{"type":"string","description":"Session ID"},"type":{"type":"string","enum":["bug","ux_issue","suggestion","observation","performance"],"description":"Finding type"},"severity":{"type":"string","enum":["low","medium","high","critical"],"description":"Severity level"},"title":{"type":"string","description":"Finding title"},"description":{"type":"string","description":"Detailed description"},"context":{"type":"object","description":"Additional context"},"screenshot_url":{"type":"string","description":"Screenshot URL"}},"required":["session_id","type","title"]}}}'::jsonb,
   'Use when: OpenClaw discovers a bug, UX issue, suggestion, or observation during a beta test. Requires an active session_id. type must be one of: bug, ux_issue, suggestion, observation, performance. severity must be: low, medium, high, or critical. Include as much context as possible in the description field.'),
  ('openclaw_exchange', 'Send a message between OpenClaw and FlowPilot', 'system', 'internal', 'module:openclaw', true, 'bundled', 'auto',
   '{"type":"function","function":{"name":"openclaw_exchange","description":"Exchange a message between agents","parameters":{"type":"object","properties":{"session_id":{"type":"string","description":"Optional session ID"},"direction":{"type":"string","enum":["openclaw_to_flowpilot","flowpilot_to_openclaw"],"description":"Message direction"},"message_type":{"type":"string","enum":["observation","question","suggestion","learning","acknowledgment"],"description":"Message type"},"content":{"type":"string","description":"Message content"},"payload":{"type":"object","description":"Structured payload"}},"required":["content"]}}}'::jsonb,
   'Use when: Sending a structured message between OpenClaw and FlowPilot during a session. direction defaults to "openclaw_to_flowpilot". message_type should reflect intent: observation (what was seen), question (asking FlowPilot something), suggestion (proposing a change), learning (insight gained), acknowledgment (confirming a message). content is the human-readable message body.'),
  ('openclaw_get_status', 'Get current beta test status', 'system', 'internal', 'module:openclaw', true, 'bundled', 'auto',
   '{"type":"function","function":{"name":"openclaw_get_status","description":"Get beta test status overview","parameters":{"type":"object","properties":{}}}}'::jsonb,
   'Use when: Checking the current state of active beta test sessions — how many are open, recent findings, and pending messages from FlowPilot. NOT for: checking a specific session in detail (use openclaw_exchange for that). No arguments required.');