decomposer: generate deliverable files for Inspect the single_agent template and target repository conventions to identify the required project structure, configuration, interfaces, and implementation patterns for the application landing zone agent.; Define the application landing zone agent's behavior, input and output contracts, document-generation workflow, and architecture-diagram requirements using the extracted template conventions.; Validate the implemented application_landing_zone_agent by running repository tests and checking the TSD document generation, draw.io diagram generation, agent packaging, configuration, and committed implementation against the defined contracts.; Commit and push the validated application_landing_zone_agent implementation to the target repository.
This commit is contained in:
23
src/application_landing_zone_agent/cli.py
Normal file
23
src/application_landing_zone_agent/cli.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import argparse, json, sys
|
||||
from pathlib import Path
|
||||
from .agent import LandingZoneAgent, ValidationError, load_config
|
||||
|
||||
def main(argv=None) -> int:
|
||||
p = argparse.ArgumentParser(description="Generate a TSD and draw.io architecture diagram")
|
||||
p.add_argument("--input", required=True, help="requirements JSON")
|
||||
p.add_argument("--output-dir", required=True)
|
||||
p.add_argument("--config", default="config/default.json")
|
||||
args = p.parse_args(argv)
|
||||
try:
|
||||
data = json.loads(Path(args.input).read_text())
|
||||
result = LandingZoneAgent(load_config(args.config)).generate(data)
|
||||
out = Path(args.output_dir); out.mkdir(parents=True, exist_ok=True)
|
||||
result_files = {"tsd.md": result.tsd_markdown, "architecture.drawio": result.drawio_xml, "validation.json": json.dumps(result.validation.__dict__, indent=2) + "\n"}
|
||||
for name, content in result_files.items(): (out / name).write_text(content)
|
||||
return 0
|
||||
except ValidationError as exc:
|
||||
print(f"validation error: {exc}", file=sys.stderr); return 2
|
||||
except (OSError, json.JSONDecodeError, RuntimeError) as exc:
|
||||
print(f"generation error: {exc}", file=sys.stderr); return 1
|
||||
|
||||
if __name__ == "__main__": sys.exit(main())
|
||||
Reference in New Issue
Block a user