creating-workflows
from delorenj/skills
My sack of delicious Claude skills
npx skills add https://github.com/delorenj/skills --skill creating-workflowsSKILL.md
Creating Workflows Skill
Comprehensive guidance for building automated development workflows using claude-flow orchestration, multi-agent coordination, and intelligent verification systems.
When to Use This Skill
This skill should be triggered when:
- Creating multi-phase development workflows (implementation + verification)
- Building automated CI/CD pipelines with intelligent agents
- Implementing retry loops with context injection
- Setting up verification steps with failure detection
- Orchestrating multiple agents for parallel/sequential task execution
- Creating workflows that need checkpoint recovery
- Implementing silent failure detection (processes that pretend to succeed)
- Building developer experience tooling with dry-run capabilities
- Documenting complex automated workflows
- Migrating manual processes to automated orchestration
Key Concepts
Shell Context Independence & jelmore Execution
Critical Requirement: Workflow scripts must not depend on interactive shell configuration.
Why: Shell aliases and functions don't propagate to subprocess environments (n8n workflows, cron jobs, systemd services).
jelmore: Convention-Based LLM Execution Primitive
jelmore provides a unified CLI for LLM invocations with shell context independence built-in. Use jelmore instead of calling LLM clients directly when building workflows.
Why Use jelmore in Workflows:
- ✅ Shell-context-free (no alias dependencies)
- ✅ Convention over configuration (auto-infer client/MCP servers)
- ✅ Detached Zellij sessions with immediate return
- ✅ Built-in iMi worktree integration
- ✅ Native Bloodbank event publishing
- ✅ Unified interface across all LLM clients
Location: /home/delorenj/code/jelmore
Basic Usage in Workflows:
# Instead of: npx claude-flow@alpha swarm "$objective" --claude
# Use jelmore with auto-inference:
uv run jelmore execute -p "$objective" --auto
# Instead of: gptme --model $KK "$task"
# Use jelmore with explicit client:
uv run jelmore execute -f task.md --client gptme --model-tier balanced
# For PR review workflows:
uv run jelmore execute --config pr-review.json --var PR_NUMBER=$pr_num --json
Implementation Patterns:
- Place scripts in
~/.local/bin/with explicit PATH exports - Replace aliases with direct command invocations or jelmore CLI
- Use jelmore for LLM invocations (inherits detached Zellij pattern)
- Return session identifiers immediately for observability
See:
ecosystem-patternsskill - jelmore architecture and patternsbloodbank-n8n-event-driven-workflowsskill - Event-driven integration/home/delorenj/code/jelmore/CLI.md- Complete CLI reference
Multi-Phase Workflows
Workflows split into distinct phases with different execution strategies:
- Phase 1 (Kickoff): Implementation via multi-agent orchestration (parallel execution)
- Phase 2 (Verification): System state validation (sequential execution)
- Phase N: Additional phases as needed (testing, deployment, etc.)
Retry Loops with Context Injection
When Phase 2 fails, retry Phase 1 with failure context:
- Append failure details to context string
- Increment attempt counter
- Enforce max retry limit
- Provide comprehensive failure summary on exhaustion
Silent Failure Detection
Processes that don't properly report errors require explicit monitoring:
- Log pattern matching (success indicators)
- Error pattern matching (failure indicators)
- Timeout enforcement
- Background process monitoring
Claude-Flow Integration
Critical: claude-flow@alpha v2.7.26+ does NOT support workflow execute command.
Available Commands:
swarm <objective>- Multi-agent coordination with parallel executionsparc <mode>- SPARC methodology (spec, architect, tdd, integration)stream-chain- Chain multiple Claude instances with context preservationagent <action>- Agent management (spawn, list, terminate)
Quick Reference
1. Basic Workflow Script Structure
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
# Colors for output
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# Parse CLI arguments
TASK_FILE="${PROJECT_ROOT}/TASK.md"
PHASE="all"
MAX_RETRIES=2
RETRY_ENABLED=true
DRY_RUN=false
# Parse flags (--task, --phase, --max-retries, --no-retry, --dry-run, --help)
# Implement usage() function
# Validate inputs
2. Phase 1: Implementation with jelmore (Recommended)
run_phase1() {
local attempt=$1
local context_override="${2:-$CONTEXT}"
echo -e "${GREEN}Running Phase 1: Implementation${NC}"
if [[ $attempt -gt 1 ]]; then
echo -e "${BLUE}Retry attempt $((attempt - 1))/${MAX_RETRIES}${NC}"
fi
# jelmore execution with JSON output
local jelmore_output
jelmore_output=$(uv run jelmore execute \
--file "$TASK_FILE" \
--auto \
--json 2>&
...