Agent Architect
Goal
To construct robust, production-grade AI agents by strictly following the Plan-and-Solve (SPARC) methodology.
Workflow
1. Specification (The "Plan")
- •Ask: Clarify inputs, outputs, and constraints.
- •Draft: Create
[agent-name]/SPEC.mdusingtemplates/SPEC_TEMPLATE.md. - •Review: Wait for user approval.
2. Architecture (The "Skeleton")
- •Scaffold: Create directories (
scripts,references,tests). - •Generate: Create
[agent-name]/SKILL.mdusingtemplates/SKILL_TEMPLATE.md. - •Code Quality Setup: For Python projects, set up code quality tools:
- •Create
pyproject.tomlusingtemplates/pyproject.toml.template - •Create
.pre-commit-config.yamlusingtemplates/.pre-commit-config.yaml - •Create
tests/conftest.pyusingtemplates/conftest.py
- •Create
3. Implementation (The "Solve")
- •Scripting: Write complex logic in
[agent-name]/scripts/(Python/Bash). - •Refinement: Update
SKILL.mdto use these scripts. - •Code Quality: For Python implementations:
- •Type Hints: Ensure all public functions have complete type annotations (PEP 484, 585, 604)
- •Docstrings: Add Google-style docstrings to all public APIs (PEP 257)
- •Error Handling: Implement custom exception hierarchy and use context managers
4. Verification
- •Format: For Python code, run
blackandisorton all source files - •Type Check: Run
mypy --strictand fix type errors - •Lint: Check YAML frontmatter and run
ruff checkfor Python - •Test: Run
pytestwith 80%+ coverage target - •Security: Run
safety checkon Python dependencies - •Dry Run: Perform a final validation of the agent
Code Quality Standards
For Python projects, follow comprehensive coding standards:
- •Reference: See Python coding standards for detailed guidelines
- •Formatting: Black (100 char line length), isort
- •Type Checking: Mypy strict mode with complete type hints
- •Testing: Pytest with 80%+ coverage, fixtures, parametrized tests
- •Security: No secrets in code, parameterized queries, security scanning
Design Patterns
Apply appropriate design patterns to maintain clean architecture:
- •Creational: Factory Pattern (for connector creation), Builder Pattern (for configuration)
- •Structural: Adapter Pattern (database adapters), Decorator Pattern (tracing, metrics)
- •Behavioral: Strategy Pattern (query execution), Iterator Pattern (streaming), Observer Pattern (events)
Tools & Scripts
- •
scripts/lint_check.sh: Run all code quality checks (black, isort, mypy, ruff, safety) - •
scripts/run_tests.sh: Run pytest with coverage reporting and various options
Templates
- •
templates/SPEC_TEMPLATE.md: Specification template - •
templates/SKILL_TEMPLATE.md: Skill documentation template - •
templates/pyproject.toml.template: Python project configuration - •
templates/.pre-commit-config.yaml: Pre-commit hooks configuration - •
templates/test_template.py: Pytest test examples - •
templates/conftest.py: Pytest configuration and shared fixtures