This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
APAB (Agentic Phased Array Builder) is a Python package that connects an LLM to MCP-exposed engineering tools for phased-array antenna design and analysis. It plans and executes workflows end-to-end: full-wave unit-cell simulation with mutual coupling (over frequency, scan angle, polarization) propagated into array-level patterns and system-level metrics.
The full-wave solver is EdgeFEM (not VectorEM).
# Install in development mode (once pyproject.toml exists)
pip install -e ".[dev]"
# Run all tests
pytest tests/
# Run a single test
pytest tests/test_file.py::test_name -v
# Type checking
mypy src/apab/
# Linting
ruff check src/ tests/
# CLI entry points
apab init # scaffold project
apab design # interactive agent session
apab run # non-interactive from config
apab report # generate report from run bundle
apab mcp serve # run as MCP server-
Agent Orchestrator (
src/apab/agent/) - Talks to LLM providers via aLLMProviderprotocol. Uses tool-calling to dispatch actions to MCP tools. Default: Ollama withqwen2.5-coder:14b, offline-capable. -
MCP Tool Layer (
src/apab/mcp/) - First-party MCP server exposing tools for simulation (EdgeFEM), array patterns (phased-array-modeling), system trades (phased-array-systems), export/plot/report, and optional external EM adapters. -
Execution/Compute Layer (
src/apab/compute/) - Local execution by default.ComputeBackendprotocol designed for future cloud backends (AWS/GCP) via entry points (apab.compute_backends). -
Artifact + Provenance Layer - Run bundles at
workspace/runs/<run_id>/containing manifest, config, logs, and artifacts. Cache keys include config/geometry/sweep hashes and dependency versions.
- edgefem (PyPI) - Full-wave unit-cell solver backend (
jman4162/EdgeFEM) - phased-array-modeling (PyPI) - Array factor/patterns/impairments (
jman4162/Phased-Array-Antenna-Model) - phased-array-systems (GitHub:
jman4162/phased-array-systems) - System-level trades/scenarios
| Group | Purpose |
|---|---|
apab.llm_providers |
LLM provider plugins (Ollama, OpenAI, Anthropic, Gemini, OpenAI-compatible) |
apab.em_adapters |
External EM tool adapters (HFSS, CST, FEKO) |
apab.compute_backends |
Compute backend plugins (local, future AWS/GCP) |
LLMProvider- Provider abstraction insrc/apab/providers/. Implementations:OllamaProvider,OpenAIProvider,AnthropicProvider,GeminiProvider,OpenAICompatibleProvider.FullWaveUnitCellSolver- Solver protocol. EdgeFEM integrated viaEdgeFEMAdapter.FullWaveFiniteArraySolver- Reserved for future finite-array simulations.ExternalEMToolAdapter- For commercial EM tools (HFSS/CST/FEKO).ComputeBackend- For local and future cloud execution.
Project config lives in apab.yaml, validated by Pydantic. Key sections: project, llm, mcp, compute, solver, unit_cell, sweep, array, outputs. See SPEC.md section 7 for full example.
Core data arrays use the shape convention S[f, scan, pol, i, j] (complex). Derived quantities: Z_active[f, scan, pol], Gamma_active[f, scan, pol]. Storage: HDF5 (primary), NPZ (cache), Touchstone (.sNp export). All schemas must be JSON/YAML-serializable.
- All commits must be authored by John Hodge (jman4162):
git config user.name "John Hodge",git config user.email "jhodge007@gmail.com" - The active
ghaccount must be jman4162 before pushing. Switch with:gh auth switch --user jman4162 - The
engineerinvestoraccount does NOT have push access to this repo
- Workspace-only filesystem access by default
- Local-first, offline-capable defaults (safe mode ON)
- Remote LLM providers and cloud compute require explicit opt-in
llm.redaction_modelevels:none(local default),metadata_only,strict- All tool calls and remote LLM egress must be audit-logged