Skip to content

trim: reduce workflow skill from 1115 to 420 lines#5

Open
khaliqgant wants to merge 2 commits intomainfrom
trim/workflow-skill-bloat
Open

trim: reduce workflow skill from 1115 to 420 lines#5
khaliqgant wants to merge 2 commits intomainfrom
trim/workflow-skill-bloat

Conversation

@khaliqgant
Copy link
Member

@khaliqgant khaliqgant commented Mar 23, 2026

Summary

  • 62% reduction (1115 → 420 lines) of the writing-agent-relay-workflows skill
  • Merged redundant sections (Completion Signals, Robust Coordination, Verification Tokens, etc.)
  • Added learnings from real workflow runs that failed

Key additions from production experience

  • createWorkflowRenderer does not exist in the SDK — was causing runtime errors
  • Multi-file edit pattern: one file per step with verify gates (agents fail on 4+ files)
  • Never rely on agents to git commit — they emit completion markers without running git
  • Single step editing 4+ files: agents modify 1-2 then exit silently

Test plan

  • All existing guidance preserved (just consolidated)
  • New mistake entries match real failure modes observed
  • Verify skill loads correctly in Claude Code

🤖 Generated with Claude Code


Open with Devin

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>
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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>
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment on lines +124 to +133
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' });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Suggested change
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' });
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant