When tasked with extracting, mapping, or summarizing configurations or data from multiple local directories, projects, or sites simultaneously:
- Locate Targets: Use
bash(e.g.,find) to locate all target sites/configurations. - Define Extraction Schema: In a Python
evalblock, define a strict JSON dictionary schema (e.g.,SCHEMA = {"type": "object", "properties": {"plugins": {"type": "string"}}}). - Create Mapping Function: Write a Python function that uses the sandbox
read()helper to read a target's files, and callsres = agent(prompt, agent="quick_task", schema=SCHEMA). Always extract defensively usingres.get("data", res). - Execute Parallel Swarm: Run the mapper over all targets using the
parallel()array helper:mapped_data = parallel([lambda t=t: map_site(t) for t in SITES]). - Synthesize: Pass
json.dumps(mapped_data)to anoracleortaskagent to synthesize a unified report or SSOT cheat sheet.