---
name: Genesis Architect
description: |
  Meta-skill for autonomous skill generation. Analyzes source documentation,
  code, or knowledge bases and generates complete Claude skills with proper
  progressive disclosure structure.

  WHEN TO USE:
  - "Create a skill for [domain/topic]"
  - "Package this code/docs as a skill"
  - "Generate skill from [file/folder]"
  - "Build a workflow skill for [process]"
  - Converting knowledge bases to executable skills
  - Packaging existing Genesis protocols as skills

  CAPABILITIES:
  - Reads and analyzes source materials (docs, code, transcripts)
  - Generates SKILL.md with proper YAML frontmatter
  - Creates scripts/ for deterministic operations
  - Builds references/ for context materials
  - Validates output against skill standards
  - Supports progressive disclosure patterns

allowed-tools:
  - Read
  - Write
  - Edit
  - Bash
  - Glob
  - Grep
---

# Genesis Architect

## Purpose

Transform static knowledge into living, executable Claude skills. This meta-skill enables Genesis to grow autonomously by converting documentation, code, and knowledge bases into properly structured skills.

## Core Principle

> "Build the system that builds the system" - IndyDevDan

Skills are **living knowledge** - executable, persistent, and portable. This architect ensures all Genesis knowledge follows the skill standard.

## Skill Generation Workflow

### Step 1: Source Analysis

Analyze the source material to extract:
- **Domain**: What area of expertise does this cover?
- **Triggers**: When should this skill activate?
- **Operations**: What deterministic operations are needed?
- **Context**: What reference materials should be included?

```
Source Types Supported:
├── Documentation (.md, .txt, .rst)
├── Code files (.py, .js, .ts)
├── Transcripts (YouTube, meetings)
├── Knowledge bases (existing skills, protocols)
└── Structured data (JSON, YAML, CSV)
```

### Step 2: Structure Planning

Plan the skill structure using progressive disclosure:

```
.claude/skills/[skill-name]/
├── SKILL.md              # Required: YAML frontmatter + instructions
│   ├── name              # Human-friendly name
│   ├── description       # WHEN to trigger (be specific!)
│   └── allowed-tools     # Minimal tool set needed
├── scripts/              # Optional: Deterministic Python tools
├── references/           # Optional: Context files (lazy-loaded)
└── examples/             # Optional: Sample inputs/outputs
```

### Step 3: SKILL.md Generation

Generate SKILL.md following this template:

```yaml
---
name: [Human-Friendly Name]
description: |
  [What this skill does]

  WHEN TO USE:
  - [Trigger phrase 1]
  - [Trigger phrase 2]
  - [Trigger phrase 3]

  CAPABILITIES:
  - [Capability 1]
  - [Capability 2]

allowed-tools:
  - [Tool1]
  - [Tool2]
---

# [Skill Name]

## Purpose
[Clear statement of what this skill accomplishes]

## Instructions
[Step-by-step process to follow]

## Scripts Available
[List scripts in scripts/ folder with descriptions]

## References
[List files in references/ folder]
```

### Step 4: Script Generation

Generate Python scripts for deterministic operations:

```python
#!/usr/bin/env python3
"""
[Script description]

Usage:
    python script_name.py [args]
"""

import sys
import json
from pathlib import Path

def main():
    """Main entry point"""
    # Implementation
    pass

if __name__ == "__main__":
    main()
```

### Step 5: Validation

Validate the generated skill:
- [ ] SKILL.md has valid YAML frontmatter
- [ ] Name is human-friendly (not kebab-case)
- [ ] Description includes WHEN TO USE triggers
- [ ] allowed-tools is minimal (principle of least privilege)
- [ ] Scripts are executable and documented
- [ ] References exist and are relevant
- [ ] Folder name is kebab-case

## Progressive Disclosure Pattern

**Key Insight**: Only name + description load initially. Full content loads when triggered.

Design for this:
1. **Description is critical** - Claude uses this to decide when to activate
2. **Be specific about triggers** - Vague descriptions = skill never activates
3. **Front-load key information** - First 100 chars matter most
4. **Lazy-load context** - Put detailed docs in references/, not SKILL.md

## Skill Categories

### Domain Knowledge Skills
Package expertise into queryable skills:
- Technical documentation
- Best practices
- Patterns and anti-patterns

### Workflow Skills
Automate multi-step processes:
- Build → Test → Deploy pipelines
- Research → Analyze → Report workflows
- Create → Review → Refine loops

### Tool Integration Skills
Wrap external tools with context:
- MCP server configurations
- API integrations
- CLI tool wrappers

### Meta Skills
Skills that create/manage other skills:
- genesis-architect (this skill)
- skill-validator
- skill-optimizer

## Output Format

When generating a skill, output:

1. **Skill folder structure** (create all files)
2. **Validation report** (confirm standards met)
3. **Usage example** (show how to invoke)

## Example Invocation

```
User: Create a skill for the PITER framework from my mastery document

Genesis Architect:
1. Reads INDYDEVDAN_AGENTIC_MASTERY.md
2. Extracts PITER framework section (Protocol 43)
3. Generates:
   .claude/skills/piter-framework/
   ├── SKILL.md (triggers, instructions)
   ├── scripts/piter_runner.py (execution helper)
   └── references/piter_details.md (full protocol)
4. Validates and reports
```

## Integration with Genesis

This skill integrates with:
- **genesis-memory-cortex**: Index generated skills in memory
- **genesis-evolution-protocol**: Track skill creation as learning
- **n8n pipelines**: Automate skill generation from new sources

## Templates

See `templates/` folder for:
- `skill_md_template.md` - Standard SKILL.md structure
- `script_template.py` - Python script boilerplate
- `progressive_disclosure.md` - Disclosure pattern guide
