trim: reduce workflow skill from 1115 to 420 lines#5
trim: reduce workflow skill from 1115 to 420 lines#5khaliqgant wants to merge 2 commits intomainfrom
Conversation
Consolidate redundant sections and add learnings from real workflow runs: Removed/merged: - Completion Signals → merged into Step Completion Model (5 tiers) - Robust Coordination → folded into Common Mistakes table - Interactive Agents Writing Files → 2 mistake rows - Verification Tokens → one line under Verification Gates - TypeScript/Python Setup → merged into Quick Reference - Workflow Authoring Rules → covered by patterns + mistakes - Supervisor handoff details → trimmed to essentials - Phase Count → absorbed into Step Sizing Added from production experience: - createWorkflowRenderer does not exist in SDK - Multi-file edit pattern: one file per step with verify gates - Never rely on agents to git commit (use deterministic steps) - Single step editing 4+ files fails (agents modify 1-2 then exit) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add subscribe/unsubscribe/mute/unmute SDK API documentation, semantics table, event callbacks, workflow usage patterns, and common mistakes for the new broker-managed channel operations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| relay.subscribe({ agent: 'security-auditor', channels: ['review-pr-456'] }); | ||
|
|
||
| // Unsubscribe — agent leaves the channel entirely | ||
| relay.unsubscribe({ agent: 'security-auditor', channels: ['general'] }); | ||
|
|
||
| // Mute — agent stays subscribed (history access) but messages are NOT injected into PTY | ||
| relay.mute({ agent: 'security-auditor', channel: 'review-pr-123' }); | ||
|
|
||
| // Unmute — resume PTY injection | ||
| relay.unmute({ agent: 'security-auditor', channel: 'review-pr-123' }); |
There was a problem hiding this comment.
🟡 Missing await on relay facade async calls in SDK API example
The SDK API code example for dynamic channel management omits await on all four relay facade calls (relay.subscribe, relay.unsubscribe, relay.mute, relay.unmute), despite the type signatures at skills/writing-agent-relay-workflows/SKILL.md:206-209 declaring them as Promise<void>. In contrast, the agent-level example at lines 140-143 correctly uses await on all calls. Since this skill file teaches AI agents how to write workflow code, agents following the relay facade example will generate fire-and-forget calls, leading to race conditions where channel operations haven't completed before subsequent code executes.
| relay.subscribe({ agent: 'security-auditor', channels: ['review-pr-456'] }); | |
| // Unsubscribe — agent leaves the channel entirely | |
| relay.unsubscribe({ agent: 'security-auditor', channels: ['general'] }); | |
| // Mute — agent stays subscribed (history access) but messages are NOT injected into PTY | |
| relay.mute({ agent: 'security-auditor', channel: 'review-pr-123' }); | |
| // Unmute — resume PTY injection | |
| relay.unmute({ agent: 'security-auditor', channel: 'review-pr-123' }); | |
| await relay.subscribe({ agent: 'security-auditor', channels: ['review-pr-456'] }); | |
| // Unsubscribe — agent leaves the channel entirely | |
| await relay.unsubscribe({ agent: 'security-auditor', channels: ['general'] }); | |
| // Mute — agent stays subscribed (history access) but messages are NOT injected into PTY | |
| await relay.mute({ agent: 'security-auditor', channel: 'review-pr-123' }); | |
| // Unmute — resume PTY injection | |
| await relay.unmute({ agent: 'security-auditor', channel: 'review-pr-123' }); |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
writing-agent-relay-workflowsskillKey additions from production experience
createWorkflowRendererdoes not exist in the SDK — was causing runtime errorsgit commit— they emit completion markers without running gitTest plan
🤖 Generated with Claude Code