How bpaulraj/api-tests-generator works
Apigen is a portable AI-agent framework for REST API test automation. Its workflow analyzes a target test repository, normalizes an API contract, measures test coverage, plans missing tests or journey scenarios, and—after human approval—generates and verifies tests in the repository’s conventions. The README documents these stages and artifacts; sampled source confirms the repo scanner and spec normalizer share common utilities. Several tool implementations were not sampled, so their internal calls are shown only where the README documents them.
Main entry points: AGENTS.md Workflow orchestrator · test-writer.md Test writer · journey-composer.md Journey composer · repo_scan.py Repo scan and inventory
Components 24
Agent workflow
- Workflow orchestrator
AGENTS.md - Repository analyst
framework/agents/repo-analyst.md - Spec ingestor
framework/agents/spec-ingestor.md - Coverage analyst
framework/agents/coverage-analyst.md - Scenario designer
framework/agents/scenario-designer.md - Journey composer
framework/agents/journey-composer.md - Test writer
framework/agents/test-writer.md - Test verifier
framework/agents/verifier.md
Deterministic tools
- CLI and mode entry
framework/tools/apigen.py - Repo scan and inventory
framework/tools/repo_scan.py - Contract normalization
framework/tools/spec_normalize.py - Shared matching and IO
framework/tools/common.py - Coverage calculation
framework/tools/coverage.py - Journey validation
framework/tools/journeys.py - Plan candidates
framework/tools/plan.py
Models and outputs
- Versioned artifact schemas
framework/schemas - Profiles, reports, plans
- Generated test code
Stack and journey guidance
- Stack adapters
framework/adapters - Journey templates
framework/templates/journeys.template.yaml
Other components
- Agent runtime
- Target test repo
- API contract
- Journey mapping
Connections 30
- Agent runtime → Workflow orchestrator: invokes modes
README.md - Workflow orchestrator → CLI and mode entry: runs tools
README.md - Target test repo → Repository analyst: provides conventions
README.md - Repository analyst → Repo scan and inventory: scans repository
README.md - API contract → Spec ingestor: provides API spec
README.md - Spec ingestor → Contract normalization: normalizes contract
README.md - Journey mapping → Journey composer: provides mapping
README.md - Journey composer → Journey validation: validates journeys
README.md - Repo scan and inventory → Shared matching and IO: uses helpers
framework/tools/repo_scan.py - Contract normalization → Shared matching and IO: uses helpers
framework/tools/spec_normalize.py - Repository analyst → Profiles, reports, plans: writes repo profile
README.md - Spec ingestor → Profiles, reports, plans: writes API model
README.md - Repo scan and inventory → Profiles, reports, plans: produces inventory
README.md - Coverage analyst → Repo scan and inventory: enriches inventory
README.md - Coverage analyst → Coverage calculation: calculates coverage
README.md - Coverage calculation → Profiles, reports, plans: writes coverage report
README.md - Scenario designer → Plan candidates: builds candidates
README.md - Scenario designer → Profiles, reports, plans: produces test plan
README.md - Journey composer → Profiles, reports, plans: designs scenarios
README.md - Test writer → Stack adapters: uses stack guidance
README.md - Test writer → Target test repo: imitates repo style
README.md - Test writer → Generated test code: writes tests
README.md - Test verifier → Generated test code: compiles and runs
README.md - Test verifier → Coverage calculation: reruns coverage
README.md - Versioned artifact schemas → Profiles, reports, plans: defines artifact formats
README.md - Journey templates → Journey composer: guides mappings
README.md - Workflow orchestrator → Coverage analyst: coordinates analysis
README.md - Workflow orchestrator → Scenario designer: coordinates planning
README.md - Workflow orchestrator → Test writer: starts after approval
README.md - Workflow orchestrator → Test verifier: coordinates verification
README.md