We built a software factory with 6 scoped agents, 1 orchestrator, and 3 feedback loops

Reddit r/AI_Agents Tools

Summary

They built a reference implementation of an end-to-end agent workflow in TypeScript using Mastra, featuring 6 scoped agents, an orchestrator, and 3 feedback loops for automating code generation, validation, and monitoring tasks.

We wanted to see what an end-to-end agent workflow looks like once you wire up the parts around code generation. So we built a reference implementation in TypeScript with Mastra. It takes work from GitHub, Sentry, deployment events, and manual requests, then moves it through triage, implementation, validation, release, documentation, and monitoring. The build at a glance 6 scoped agents: triage, codegen, validation, release, documentation, and monitoring 1 orchestrator: routes work when a fixed workflow is not enough 7 typed workflows: one for each stage, plus the main SDLC router 3 feedback loops: development, production monitoring, and documentation drift 3 tool groups: GitHub, Sentry, and factory metrics 1 shared LibSQL database: stores workflow state, memory, schedules, and traces 15-minute monitoring interval: production health is checked on a cron schedule 4 validation checks: correctness, security, tests, and performance This is a reference architecture, so we’re not claiming throughput, cost, or accuracy improvements from these numbers. A production error can move through the system like this The monitoring workflow pulls the Sentry issue with its stack trace and event context. Triage classifies it from P0 to P3, checks whether it duplicates existing work, and routes it. Codegen reads the relevant files, writes the change and its tests, then opens a PR. Validation returns a structured verdict for correctness, security, tests, and performance. Release handles the version, changelog, deployment, health check, and rollback. Documentation compares the merged change with the existing docs and opens a docs PR or a new triage item when they drift. The full path looks roughly like this: Sentry → monitoring → triage → codegen → validation → release → documentation Every workflow step has typed input and output schemas. If an agent returns malformed data, the workflow stops at that boundary instead of handing bad context to the next agent. The agents also get different tool permissions. Codegen can read the repo and open a PR, but it doesn’t need production access. Validation reviews the PR without being the agent that wrote it. Monitoring can read production health and create incidents, but it doesn’t get to ship code. Where we’d use this Recurring production bugs that already have good Sentry context GitHub issue and stale PR triage Small, well-defined changes in a tested codebase Release tasks such as versioning, changelogs, health checks, and rollback Documentation drift after a PR is merged Scheduled production checks that can create their own incident work Where a human still steps in Architecture decisions Breaking changes Failed validation SEV1 incidents UX-sensitive frontend changes that need visual review Where we wouldn’t use it An early product where requirements change every day A codebase without a useful test suite Regulated work where a person must approve every diff anyway
Original Article

Similar Articles