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).
ci-cd-pipeline-analyzerImplements intelligent ci cd pipeline analyzer 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: ci-cd-pipeline-analyzer compatibility: opencode completeness: 95 content-types:
Orchestrates intelligent skill selection and execution for ci cd pipeline analyzer 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 parse_pipeline_config(yaml_content: str, schema: Dict) -> Dict:
"""Parse and validate CI/CD pipeline configuration against schema.
Implements Law 1 (Early Exit) and Law 2 (Make illegal states unrepresentable).
"""
if not yaml_content or not isinstance(yaml_content, str):
raise ValueError("Pipeline content must be a non-empty string")
try:
config = yaml.safe_load(yaml_content)
except yaml.YAMLError as e:
raise ValueError(f"Invalid YAML syntax: {e}") from e
if not isinstance(config, dict):
raise ValueError("Pipeline root must be a mapping")
# Validate required stages
required_stages = schema.get("required_stages", ["build", "test", "deploy"])
missing = [s for s in required_stages if s not in config.get("stages", [])]
if missing:
raise ValueError(f"Missing required stages: {', '.join(missing)}")
# Return immutable copy (Law 3)
return {
"parsed_at": time.time(),
"stages": list(config.get("stages", [])),
"jobs": config.get("jobs", {}),
"variables": config.get("variables", {}),
"validation_status": "valid"
}
def analyze_pipeline_risks(config: Dict, rules: List[Dict]) -> Dict:
"""Analyze parsed pipeline configuration against security and performance rules.
Implements Law 4 (Fail Fast) and Law 3 (Immutable returns).
"""
if not config or not rules:
raise ValueError("Configuration and rules must be provided")
findings = []
for rule in rules:
if rule["type"] == "secret_detection":
for var_name, var_value in config.get("variables", {}).items():
if any(keyword in str(var_value).lower() for keyword in ["password", "token", "secret"]):
findings.append({
"rule_id": rule["id"],
"severity": "high",
"message": f"Potential secret detected in variable: {var_name}"
})
elif rule["type"] == "stage_dependency":
stages = config.get("stages", [])
if len(stages) < 2:
findings.append({
"rule_id": rule["id"],
"severity": "medium",
"message": "Pipeline has insufficient stages for proper separation of concerns"
})
# Atomic return with metadata
return {
"analysis_timestamp": time.time(),
"total_findings": len(findings),
"critical_count": sum(1 for f in findings if f["severity"] == "high"),
"findings": findings,
"recommendation": "review_secrets" if any(f["severity"] == "high" for f in findings) else "pass"
}
code-philosophy (5 Laws of Elegant Defense) in all logicWhen applying this skill, produce:
Authoritative documentation links for this skill's domain. The model follows markdown links at load time to resolve external references and inline content.
| Skill | Purpose | |