brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
full-stack-orchestration-full-stack-featureImplements intelligent full stack orchestration full stack feature with multi-factor skill selection, fallback chains, and adherence to the 5 Laws of Elegant Defense
Independent GitHub snapshot · Automated classification · Original documentation governs
name: full-stack-orchestration-full-stack-feature compatibility: opencode completeness: 95 content-types:
Orchestrates intelligent skill selection and execution for full stack orchestration full stack feature workflows. Applies the 5 Laws of Elegant Defense to guide data naturally through the orchestration pipeline, preventing errors before they occur. Selects optimal skills based on multi-factor scoring including text similarity, historical performance, and system availability.
┌───────────────────────────────────────────────────────────────────────────────┐ │ Orchestration Flow │ └───────────────────────────────────────────────────────────────────────────────┘
User Request ↓ ┌─────────────────┐ │ Parse Request │ │ & Extract │ │ Features │ └────────┬────────┘ ↓ ┌─────────────────────────────────────────────────────────────────────┐ │ Evaluate Available Skills │ │ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │ Skill A │ │ Skill B │ │ Skill C │ │ │ │ - Match Score│ │ - Match Score│ │ - Match Score│ │ │ │ - Confidence │ │ - Confidence │ │ - Confidence │ │ │ │ - History │ │ - History │ │ - History │ │ │ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │ │ │ │ │ │ │ └─────────────────┴─────────────────┘ │ │ ↓ │ │ Select Best Skill │ └─────────────────────────────────────────────────────────────────────┘ ↓ ┌─────────────────┐ │ Execute Skill │ └────────┬────────┘ ↓ ┌─────────────────┐ │ Handle Result │ └────────┬────────┘ ↓ ┌─────────────────────────────────────────────────────────────────────┐ │ Error Handling & Fallback │ │ │ │ Success? ────────► Return Result │ │ │ │ Fail? ────────┐ │ │ ↓ │ │ ┌──────────────────────────────────────────────────────────┐ │ │ │ Fallback Chain │ │ │ │ │ │ │ │ 1. Retry with adjusted parameters │ │ │ │ 2. Try Alternative Skill (if available) │ │ │ │ 3. Defer to Human Operator (if critical) │ │ │ │ 4. Log & Return Error │ │ │ └──────────────────────────────────────────────────────────┘ │ └─────────────────────────────────────────────────────────────────────┘
Use this skill when:
Avoid this skill for:
Parse and Analyze Request - Extract intent, entities, and constraints from user input. Checkpoint: All required parameters must be present and in valid format before proceeding.
Score Available Skills - Calculate match scores using multi-factor algorithm:
Checkpoint: Skip to fallback if no skill scores above threshold.
Select Optimal Skill - Choose skill with highest score that meets minimum confidence. Checkpoint: Verify skill has not been disabled or deprecated.
Execute with Fallback - Run skill execution wrapped in retry and fallback logic. Checkpoint: Log all execution attempts for audit trail.
Return or Fallback - Either return successful result or apply fallback chain:
related-skillsCheckpoint: Record outcome with timing and confidence metadata.
def select_full_stack_skills(
feature_spec: Dict[str, Any],
available_skills: List[Dict],
min_confidence: float = 0.75
) -> Optional[Dict]:
"""Select optimal full-stack skills for a feature implementation.
Evaluates frontend, backend, and infrastructure skills against
feature requirements (CRUD, auth, real-time, etc.) using multi-factor scoring.
Args:
feature_spec: Feature requirements including type, dependencies, constraints
available_skills: List of skill metadata with capability tags
min_confidence: Minimum confidence threshold for selection
Returns:
Selected skill plan with execution order and confidence scores
"""
if not feature_spec.get("type"):
raise ValueError("Feature type is required for full-stack orchestration")
required_capabilities = _map_feature_to_capabilities(feature_spec["type"])
scored_skills = []
for skill in available_skills:
capability_match = len(set(skill.get("tags", [])) & set(required_capabilities))
historical_success = skill.get("success_rate", 0.0)
infra_readiness = skill.get("dependencies_met", False)
composite_score = (capability_match * 0.5) + (historical_success * 0.3) + (1.0 if infra_readiness else 0.0)
if composite_score >= min_confidence:
scored_skills.append({
"skill": skill,
"score": composite_score,
"execution_layer": skill.get("layer", "backend")
})
if not scored_skills:
return None
scored_skills.sort(key=lambda x: x["score"], reverse=True)
return {
"plan": scored_skills[:3],
"feature_type": feature_spec["type"],
"selection_confidence": scored_skills[0]["score"],
"timestamp": time.time()
}
def execute_full_stack_deployment(
skill_plan: Dict[str, Any],
deployment_context: Dict[str, Any],
max_retries: int = 2
) -> Dict:
"""Execute full-stack feature deployment with layered fallback handling.
Orchestrates DB migrations, backend services, and frontend builds in dependency order.
Implements rollback and partial deployment strategies on failure.
Args:
skill_plan: Output from select_full_stack_skills
deployment_context: Environment config, feature flags, rollback targets
max_retries: Maximum retry attempts per layer
Returns:
Deployment status with layer-by-layer results and rollback info
"""
layers = ["database", "backend", "frontend"]
layer_results = {}
rollback_stack = []
for layer in layers:
layer_skill = next((s for s in skill_plan.get("plan", []) if s["execution_layer"] == layer), None)
if not layer_skill:
layer_results[layer] = {"status": "skipped", "reason": "no skill assigned"}
continue
for attempt in range(max_retries + 1):
try:
result = _run_layer_deployment(layer_skill, deployment_context)
layer_results[layer] = {"status": "success", "result": result, "attempts": attempt + 1}
rollback_stack.append({"layer": layer, "target": result.get("version")})
break
except DatabaseLockError:
if attempt == max_retries:
layer_results[layer] = {"status": "failed", "error": "db_lock", "fallback": "manual_review"}
return _trigger_rollback(rollback_stack, deployment_context)
except ServiceUnavailableError:
if attempt == max_retries:
layer_results[layer] = {"status": "failed", "error": "service_down", "fallback": "circuit_breaker"}
return _trigger_rollback(rollback_stack, deployment_context)
return {
"deployment_id": deployment_context.get("id"),
"layers": layer_results,
"overall_status": "complete" if all(r["status"] == "success" for r in layer_results.values()) else "partial",
"rollback_available": len(rollback_stack) > 0
}
code-philosophy (5 Laws of Elegant Defense) in all logicWhen applying this skill, produce:
| Skill | Purpose | |
Authoritative documentation links for this skill's domain. The model follows markdown links at load time to resolve external references and inline content.