How repello-ai/agent-wiz works
Project Overview & Goals
• Explanation: Agent Wiz is a Python-based CLI tool that (a) parses agentic workflows from code (via AST‐based mappers), (b) visualizes them as interactive D3 graphs, and (c) runs automated threat assessments producing Markdown reports.
• If single, we’ll group all major components in one view.
Main Components
• Core CLI (entrypoint in src/repello_agent_wiz/cli.py)
• Framework Parsers (one mapper per supported framework under src/repello_agent_wiz/frameworks/*/mapper.py)
• Graph Model (in memory representation → JSON output under examples/output/)
• Visualizer (src/repello_agent_wiz/visualizers/visualizer.py + src/repello_agent_wiz/templates/index.html + D3 assets)
• Analyzer (src/repello_agent_wiz/analyzers/threat_modelling.py + sys_prompt.txt, maestro.txt)
• File System I/O (reading input code directories + writing JSON, HTML, Markdown)
• External Service: OpenAI API (for optional threat‐assessment NLP calls)
• Prompt: Are there any other external services or subsystems (e.g., custom logging, metrics) you want to include?
Relationships & Data Flows
• Extraction Flow:
• CLI “extract” command → invokes selected framework mapper → produces internal graph model → writes graph.json
• Visualization Flow:
• Analysis Flow:
• CLI “analyze” → reads graph.json → passes it to Analyzer → applies MAESTRO rules & (optionally) OpenAI API → outputs threat_report.md
Architectural Patterns
• Plugin/Adapter Pattern: one mapper per framework implements a common extraction interface
• Model–View–Controller style within CLI:
• Controller = CLI commands
• Model = Graph internal representation
• View = HTML templates + D3
• Template‐based Code Generation for reports and visual outputs
Technologies & Frameworks
• Python 3.x, Click or argparse for CLI
• AST module for static parsing
• Jinja2 or string‐based templates for HTML (index.html under templates)
• D3.js for interactive graph rendering
• Markdown generator for threat reports