# Metacode Agentic Engine — Autonomous TDD Software Factory

> Transform your codebase into a deterministic, multi-agent software factory. Enforce strict architectural boundaries, 100% test coverage, and hard quality gates across 20+ programming languages.

- **Entity**: Metacode Oy (Helsinki, Finland — Business ID: 3375232-1)
- **Product Type**: Enterprise AI-Driven Agentic Engineering Framework & Licensing
- **Canonical URL**: [metacode.fi/agentic-engine](https://metacode.fi/agentic-engine)
- **Markdown Mirror**: [metacode.fi/agentic-engine.md](https://metacode.fi/agentic-engine.md)
- **Contact**: [jouni@metacode.fi](mailto:jouni@metacode.fi) | +358 50 307 8306
- **Supported Ecosystems**: Laravel/PHP, Next.js/Node/TypeScript, Go, Python, Ruby, Rust, C#, Java, Swift, and 10+ more via [Everything Claude Code (ECC)](https://github.com/affaan-m/everything-claude-code) integration.

---

## 1. The Problem (#problem)

### AI Generates Code Fast. It Generates Technical Debt Even Faster.
While developers leverage AI daily for snippet generation, software engineering teams face severe bottlenecks:
- **No Architectural Guardrails**: AI assistants freely mix concerns, violate domain boundaries, and ignore framework conventions.
- **Surface-Level Testing**: Standard AI outputs mock tests superficially, failing to achieve true 100% test coverage or edge-case rigor.
- **Senior Review Fatigue**: Senior architects spend more time auditing and fixing low-quality AI code than building core features.

**Metacode Agentic Engine** solves this by replacing ad-hoc prompt engineering with a rigid, multi-agent pipeline and automated deterministic quality gates.

---

## 2. Core Architecture: The 5-Agent Pipeline (#architecture)

The engine provisions a secure, gitignored `.agents/` environment inside your target repository, orchestrating five specialized subagents through a hard termination gate:

1. **`planner` (Principal Architect):** Read-only agent that inspects existing routes, models, and specifications to produce a concrete, step-by-step implementation blueprint.
2. **`coder` (Senior TDD Engineer):** Implements features strictly via Test-Driven Development—writing failing test suites first, making them pass, and running automatic formatters (`Pint`, `Prettier`, `gofmt`).
3. **`reviewer` (Adversarial Security & Code Auditor):** Read-only security sentinel auditing `git diff`, static analysis (`PHPStan Level 10`, `ESLint`, `golangci-lint`), OWASP vulnerabilities, and architecture rules. Outputs `REVIEW_STATUS: APPROVED` or `REVIEW_STATUS: CHANGES_REQUIRED`.
4. **`fixer` (Surgical Remediation Specialist):** Applies minimal, precise code edits to resolve any defects flagged by the reviewer or QA engineer.
5. **`qa` (Lead QA Automation Engineer):** Executes full test suites, audits coverage thresholds (e.g., 100% lines/branches), and verifies edge cases. Outputs `QA_STATUS: PASSED` or `QA_STATUS: FAILED`.

### Deterministic Pipeline Gate (`verify-pipeline.js`)
A hard `Stop` hook intercepts session termination. The agentic system is strictly blocked from concluding its turn or opening a Pull Request unless both `REVIEW_STATUS: APPROVED` and `QA_STATUS: PASSED` are mathematically confirmed in the transcript.

---

## 3. Developer Experience & Workflow (#workflow)

Engineered for seamless integration with **Antigravity**, **Cursor**, **Claude Code**, and standard IDE toolchains via standard Markdown (`AGENTS.md`) and Model Context Protocol (MCP).

### Day-to-Day Lifecycle:
1. **`/create-bdd-ticket <raw_notes>`**: Transforms rough notes or feature requirements into a structured GitHub Issue containing Gherkin **Given / When / Then** scenarios (Happy Path, Validation Failure, Tenant Isolation) and a TDD checklist.
2. **`/resolve-ticket <issue_number>`**: Automatically checks out a feature branch, executes the full 5-agent pipeline, enforces quality gates, and **opens a ready-for-review GitHub Pull Request (`Closes #ID`)**.
3. **`/quick-fix <issue_number>`**: Lightweight fast-path workflow for minor bugs, configuration updates, or typo fixes that bypasses planning while retaining strict quality verification.
4. **Iterative PR Revisions (Mode B)**: Feedback on open Pull Requests is routed directly through the `fixer` agent, maintaining continuous compliance without re-planning.

---

## 4. Supported Tech Stacks (#stacks)

The engine's language-agnostic core decouples orchestration from technology specifics, allowing instant deployment across modern ecosystems:

- **PHP / Laravel**: Strict typing (`declare(strict_types=1)`), FormRequests, Actions/Services, Laravel Pint, PHPStan Level 10, PHPUnit 100% coverage, and CRAP score checks.
- **TypeScript / Next.js (App Router)**: Strict TypeScript (`noImplicitAny`), Zod input validation, React Server Components (RSC) vs. Client boundary governance, Prettier, ESLint, and Vitest 100% coverage.
- **Node.js Backends**: Clean layered architecture (Controllers -> Services -> Repositories), Zod DTO validation, and Vitest integration suites.
- **Additional Stacks**: Go, Python, Ruby, Rust, C#, Java, Swift, Vue, React Native, and more (backed by ECC rule packs).

---

## 5. Legacy Project? Progressive Quality Gates (#progressive-gates)

Not every codebase starts at 100 % coverage and PHPStan Level 10. The Metacode Agentic Engine treats `AGENTS.md` as the single source of truth for quality policy.

You can begin with deliberately low thresholds — for example 5 % overall coverage combined with a strict “dirty files only = 100 % coverage” rule — and raise the gates incrementally as the project improves.

This progressive enforcement model lets teams adopt the full 5-agent pipeline on mature or even zero-test codebases without an all-or-nothing rewrite. Architecture boundaries, static analysis levels, and coverage targets remain fully configurable and version-controlled.

---

## 6. Preliminary Findings from Internal Production Use (#findings)

Early internal measurements on real tickets show a clear pattern:
- **Code Volume Reduction**: Average lines of code produced per ticket dropped from ~300 to ~220 (>25 % reduction).
- **Deliberate Throughput**: Throughput is intentionally not faster than unconstrained prompt-driven coding. Some tickets that previously took 15 minutes now take ~20 minutes.

The difference is deliberate. The extra time is spent enforcing Test-Driven Development, adversarial review, coverage gates, and architectural constraints. The result is less code, higher signal density, and significantly lower downstream technical debt.

We prioritise deterministic quality over raw speed.

---

## 7. Intelligent Model Allocation & Token Efficiency (#efficiency)

Running every agent on the most expensive frontier model is wasteful.

The Metacode Agentic Engine supports per-agent model assignment:
- **Heavy Reasoning**: Planner and Coder can use Claude Opus when needed.
- **Surgical & Linear**: Fixer and QA routinely run on Claude Sonnet or equivalent mid-tier models.
- **Adversarial Audit**: Reviewer dedicated to diff audit and static verification.

This selective allocation, combined with the observed 25 %+ reduction in generated code volume, materially lowers token consumption and cost per delivered feature without compromising the hard quality gates.

---

## 8. Engagement & Licensing Models (#pricing)

We offer turnkey onboarding combined with repository licensing so your team can master autonomous TDD development immediately.

### 01 / Agentic Quickstart — 2,900 € (VAT 0%)
* **Ideal for**: Development teams (3–8 developers) with existing automated test foundations.
* **Includes**: 12-month repository access license, custom `AGENTS.md` architecture tuning for your primary product, and a half-day hands-on workshop for your engineering team.

### 02 / Turnkey AI Factory — 6,500 € – 9,500 € (VAT 0%)
* **Ideal for**: Software houses and scale-ups wanting an end-to-end autonomous engineering pipeline.
* **Includes**: Full architecture audit, setup and enforcement of strict quality gates (PHPStan/ESLint, coverage thresholds, security audits) in your repository, customized multi-agent roles, and a 2-week active pilot support period.

### 03 / Fractional Enterprise Advisory & Custom Stacks
* Tailored multi-stack rollouts, custom MCP server integrations, and strategic AI governance consulting led by Jouni Tuovinen.

---

## 9. Contact & Licensing Inquiries (#contact)

Ready to eliminate architectural debt and let your developers focus on high-level design while autonomous agents handle rigorous TDD execution?

- **Representative**: Jouni Tuovinen — Founder & Lead Software Architect, Metacode Oy
- **Direct Email**: [jouni@metacode.fi](mailto:jouni@metacode.fi)
- **Phone**: +358 50 307 8306
- **Entity**: Metacode Oy (Helsinki, Finland — Business ID: 3375232-1)

---

## Machine-Readable Resources
- Frontpage Markdown Mirror: [metacode.fi/index.md](https://metacode.fi/index.md)
- Agentic Engine Markdown Mirror: [metacode.fi/agentic-engine.md](https://metacode.fi/agentic-engine.md)
- Metacode Agentic Engine: [metacode.fi/agentic-engine](https://metacode.fi/agentic-engine)
- LLM Documentation: [metacode.fi/llms.txt](https://metacode.fi/llms.txt)
- Comprehensive Documentation: [metacode.fi/llms-full.txt](https://metacode.fi/llms-full.txt)
- RFC 9727 API Catalog: [metacode.fi/.well-known/api-catalog](https://metacode.fi/.well-known/api-catalog)
- Sitemap XML: [metacode.fi/sitemap.xml](https://metacode.fi/sitemap.xml)
