π§ Core Philosophy
Orchestrate parallel OMP subagents via hyper-efficient Python
evalsandboxes. NEVER process serially. SWARM the AST/filesystem! π
πͺοΈ Pattern 1: Constellation Mapper πΊοΈ
Goal: Deep-scan workspace β‘οΈ build Project Markdown Table.
| Step | Action | Snippet π» |
|---|---|---|
| 1οΈβ£ | Locate targets | targets = [d for d in Path(".").iterdir() if d.is_dir()] |
| 2οΈβ£ | Batch Reads | content = {d: read(d / "package.json") for d in targets} |
| 3οΈβ£ | Swarm | parallel([lambda d=d: agent(prompt, schema=S) for d in targets]) |
π‘ Pro-Tip
Batch file reads before swarming! Feed raw text to agents directly; DO NOT rely on them to use search tools.
π§½ Pattern 2: Project-Ready2Go π¦
Goal: Sanitize & package repo for immediate handoff.
| Phase | Agent Role π€ | Action π― |
|---|---|---|
| 1οΈβ£ Clone | bash | rsync -av --exclude={'node_modules','.git'} ./ ./out/ |
| 2οΈβ£ Refresh | task | Rewrite [[AGENTS-Spec |
| 3οΈβ£ Audit | explore / reviewer | Flag bloat β‘οΈ Deep audit β‘οΈ Final greenlight β |
| 4οΈβ£ Ship | bash | tar -czf ready.tgz ./out/ |
β‘ God-Tier Execution Rules
π¨ Enforce Schemas (No Hallucinations)
ALWAYS use
schemainagent()to force strict JSON extraction.res = agent("Extract...", schema={"type": "object", "properties": {"val": {"type": "string"}}})
π‘οΈ Defensive Try/Catch Thunks
ONE failure MUST NOT crash the swarm! Wrap
parallel()thunks.def safe_agent(d): try: return agent(f"Parse {d}", schema=S).get("data", {}).get("key") except Exception as e: return None # Note: lambda d=d fixes late-binding closure bugs! res = parallel([lambda d=d: safe_agent(d) for d in targets])
π§© Safe Extraction
AI SDKs wrap responses unpredictably. Extract defensively:
data = res.get("data", res).get("target_key")
/ymlsum
type: cheat-sheet
framework: Oh My Pi (OMP)
core_tools: [eval, parallel, agent, explore, task, reviewer]
status: "100% triple-checked perfect"