Safe task spawn

From DNYoussef/context-cascade · View interactive version

Safe task spawn is an AI agent skill from the GitHub repository DNYoussef/context-cascade. [assert|neutral] Validated wrapper around Task() calls that enforces agent registry compliance, prevents invalid spawns, and logs all spawn attempts for audit trails [ground:given] [conf:0.95] [state:confirmed]

How to use this skill

Skill file

/============================================================================/

/* SKILL SKILL :: VERILINGUA x VERIX EDITION */

/============================================================================/


name: SKILL

version: 1.0.0

description: |

[assert|neutral] Validated wrapper around Task() calls that enforces agent registry compliance, prevents invalid spawns, and logs all spawn attempts for audit trails [ground:given] [conf:0.95] [state:confirmed]

category: orchestration

tags:

author: system

cognitive_frame:

primary: evidential

goal_analysis:

first_order: "Execute SKILL workflow"

second_order: "Ensure quality and consistency"

third_order: "Enable systematic orchestration processes"


/----------------------------------------------------------------------------/

/* S0 META-IDENTITY */

/----------------------------------------------------------------------------/

[define|neutral] SKILL := {

name: "SKILL",

category: "orchestration",

version: "1.0.0",

layer: L1

} [ground:given] [conf:1.0] [state:confirmed]

/----------------------------------------------------------------------------/

/* S1 COGNITIVE FRAME */

/----------------------------------------------------------------------------/

[define|neutral] COGNITIVE_FRAME := {

frame: "Evidential",

source: "Turkish",

force: "How do you know?"

} [ground:cognitive-science] [conf:0.92] [state:confirmed]

Kanitsal Cerceve (Evidential Frame Activation)

Kaynak dogrulama modu etkin.

/----------------------------------------------------------------------------/

/* S2 TRIGGER CONDITIONS */

/----------------------------------------------------------------------------/

[define|neutral] TRIGGER_POSITIVE := {

keywords: ["SKILL", "orchestration", "workflow"],

context: "user needs SKILL capability"

} [ground:given] [conf:1.0] [state:confirmed]

/----------------------------------------------------------------------------/

/* S3 CORE CONTENT */

/----------------------------------------------------------------------------/

Safe Task Spawn - Registry-Validated Task Spawning

Kanitsal Cerceve (Evidential Frame Activation)

Kaynak dogrulama modu etkin.

Version: 1.0.0 (Gold Tier)

Purpose: Prevent invalid agent spawns through registry validation, skill requirement matching, and comprehensive audit logging

Overview

Safe Task Spawn is a validated wrapper around Task() calls that acts as a security gate for agent spawning. Instead of directly calling Task() with potentially invalid agent types, this skill validates against the canonical agent registry at claude-code-plugins/ruv-sparc-three-loop-system/agents/, ensures spawned agents match skill requirements, and logs all attempts to Memory MCP for audit trails.

The Problem:

The Solution:

When to Use This Skill

Use safe-task-spawn when:

Auto-triggers on keywords: "spawn agent", "Task()", "delegate to agent", "create task", "agent spawning"

When NOT to Use This Skill

Skip safe-task-spawn when:

Core Principles

1. Fail Fast with Actionable Errors

Invalid agent spawns should fail immediately with clear suggestions from the registry, not spawn generic agents or fail silently.

Example:

ERROR: Agent type 'backend-developer' not found in registry

Did you mean one of these?
- backend-dev (delivery/development/backend/dev-backend-api.md)
- backend-api-enhanced (delivery/development/backend/dev-backend-api-enhanced.md)
- golang-backend-specialist (delivery/development/golang/golang-backend-specialist.md)

Registry path: claude-code-plugins/ruv-sparc-three-loop-system/agents/

2. Skill-Agent Compatibility Validation

When a skill provides context about required agent capabilities, validate the requested agent matches those requirements.

Example:

// Skill requires backend API development
skill_context = {
  required_capabilities: ["api-design", "database-integration", "authentication"],
  category: "delivery",
  phase: "development"
}

// Validates agent has required capabilities
safe_task_spawn("backend-dev", "Build REST API...", skill_context)
// ✅ PASS: backend-dev has all required capabilities

safe_task_spawn("frontend-dev", "Build REST API...", skill_context)
// ❌ FAIL: frontend-dev missing "api-design", "database-integration"

3. Comprehensive Audit Logging

Every spawn attempt (success or failure) is logged to Memory MCP for debugging, compliance, and pattern analysis.

Example:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.