AWS Builder Center
Outer Sprint, Inner Spec: Two Extensions to Loop Engineering

Outer Sprint, Inner Spec: Two Extensions to Loop Engineering

Loop Engineering automates code checking and iteration — but it doesn't answer two questions: how do you break down a real, large-scale project into appropriately sized Loops? And where do Grade rules come from? This article proposes a dual-layer structure: an outer layer borrowing Scrum's Sprint mechanism for task decomposition, and an inner layer drawing on Spec's WBS and TC/AC to generate Grade rules.

Outer Sprint, Inner Spec: Two Extensions to Loop Engineering

Loop Engineering automates code checking and iteration — but it doesn't answer two questions: how do you break down a real, large-scale project into appropriately sized Loops? And where do Grade rules come from? This article proposes a dual-layer structure: an outer layer borrowing Scrum's Sprint mechanism for task decomposition, and an inner layer drawing on Spec's WBS and TC/AC to generate Grade rules.
This article is based on the author's engineering practice in AI-assisted software development. The viewpoints, proposals, and findings represent a personal perspective and have not undergone large-scale validation or peer review.



1. What Loop Engineering Does, and Doesn't Do

Loop Engineering already has a working implementation. The core mechanism: AI generates code → Grade automatically scores it → if it fails, feedback goes back → AI rewrites → another round. Three components — Loop Engine manages the rhythm, Grade manages quality checks, Task tells the AI what to generate.
After integrating this mechanism into a real code generation workflow, the effect is visible: code quality improves from an initial mess (print statements, missing try-except, hardcoded keys) to a reasonably standardized state (logging, exception handling, environment variable reads) over several rounds. The entire process requires no one to paste error messages back and forth or manually decide whether a fix worked.
However, two problems emerged during use.
The first: how do you scope a Task? Starting with "generate an API file" as the Task works at that granularity. But when facing a real project — dozens of modules, varying business logic, complex dependencies — how large should each Task be? How do you ensure each Task is focused enough for the AI to complete within one Loop?
The second: what should Grade rules check? Generic rules like "code must not have syntax errors" have off-the-shelf automation — Ruff catches over two hundred categories of issues. But project-specific rules — "file I/O must have try-except," "ports must be read from environment variables," "API responses must be JSON" — can only be defined manually. The question isn't whether humans need to define them. It's whether these rules have a systematic source, rather than being invented from scratch each time.
Loop Engineering tells you "how the cycle runs." It doesn't tell you "how to decompose tasks" or "how to write rules." Answering those two questions is the subject of this article.



2. Outer Sprint: Using Agile to Decompose Large Projects into Loops

The answer to "how to decompose tasks" doesn't lie in AI. It lies in software engineering. For thirty years, human developers have faced the same challenge — how do you break a large project into small iterations? The answer has been here all along: Scrum.
Scrum's core is the Sprint — breaking a large project into small Sprints, each with a clear delivery goal. Finish one Sprint, pass Review, open the next. This cycle maps directly onto Loop's structure:
Scrum Role
Sprint Loop Role
Performed By
Product Owner defines acceptance criteria
Human writes Grade rules
Human
Team develops
LLM generates code
AI
Sprint Review checks
Grade auto-scores
Loop
Backlog adjustment
Issues fed back, next round
Loop
All the roles are still there — only the executor has changed. The Product Owner still exists — a human defining standards. The team has been replaced by an LLM. Review still happens — performed by a machine. The Scrum Master still exists — the Loop Engine manages rhythm.
AI Coding hasn't invented anything new. It has simply taken decades of accumulated human experience in writing code — decomposing tasks, defining standards, delivering iteratively — and translated it into a form that AI can execute. Humans have used Scrum for twenty years: break down the Backlog, define the Definition of Done, run Sprint Reviews. Sprint Loop follows the same logic: one WBS task = one Sprint, and within one Sprint, Loop runs 3-5 Rounds (micro-iterations). Not replacement — translation.
With this mapping, task decomposition has a methodology:
  • Any large project starts by decomposing into WBS. Not generating the entire system at once — breaking it into dozens of independent tasks.
  • Each WBS task = one Loop instance. The Loop is responsible only for that one task, not the entire system.
  • The finer the WBS decomposition, the easier it is for Loop to pass. A Prompt that says "generate the entire backend API" will likely fail in three rounds. Break it down to "generate the query_device endpoint" — one round will pass.
Micro-iterations within a Sprint (Rounds) are managed automatically by Loop. Between Sprints (macro-iterations), a human manages — which WBS tasks can run in parallel, which must be sequential, when to deliver. Distinguishing these two levels is what allows Sprint Loop to scale from "generating a single file" to "delivering a system."



3. Inner Spec: Using WBS and TC/AC to Give Grade Rules a Source

The outer layer answers "how to decompose tasks." The next question: what should Grade rules check? Where do they come from?
Grade rules shouldn't be invented from scratch. They need a systematic source. That source is the Spec (specification document).
The specific Spec framework doesn't matter. MumuSpec — or any other Spec framework with WBS and TC/AC — works. As long as the Spec contains WBS task decomposition and TC/AC acceptance criteria, it can be mapped directly to Sprint Loop. What matters isn't which Spec you use — it's whether you have these two things:
Spec Document
Maps to Sprint Loop
Function
WBS task decomposition
Task (one WBS item = one Loop execution)
Determines "what to generate"
TC test cases
Grade check rules (one TC = one rule)
Determines "how to check"
AC acceptance criteria
Grade pass standard (AC = Definition of Done)
Determines "what passing means"
Scenario definition
Task Prompt context (background, constraints, roles)
Provides "context"
This mapping is the core of the Sprint Loop methodology. With it, Spec is no longer a pile of documents for humans to read — it becomes executable configuration for Loop. WBS isn't for project managers to track schedules — it's for Loop to receive task assignments. TC isn't for QA to manually execute — it's the rule source for Grade to automatically check.
The Loop's task scenarios (corresponding to WBS) need a human to decompose and select. Grade rules (corresponding to TC/AC) need a human to define and encode. Loop doesn't make decisions. Loop executes the standards that humans set.



4. How to Turn AC/TC into Executable Grade Rules

We've established that Grade rules come from TC/AC. But "come from" doesn't mean "automatically generated." How do you turn an acceptance criterion into a piece of executable check code?
Example: suppose a Spec contains the TC "the backend API must use the logging module for request logging and must not use print." Transformed into a Grade rule:
if "print(" in code and "import logging" not in code:
issues.append({
"severity": "error",
"message": "Using print() instead of logging"
})
Another AC: "the frontend page's fetch calls must have error handling." Transformed into a Grade rule:
if "fetch(" in code and ".catch(" not in code and "try" not in code:
issues.append({
"severity": "error",
"message": "fetch() missing error handling"
})
Common transformation patterns:
AC Type
Grade Implementation
Example
"Must use X"
Positive match for X
 "logging" in code 
"Must not use Y"
Negative match for Y
 "print(" in code and "logging" not in code 
"Format requirement Z"
Regex or AST analysis
Ruff's 200+ built-in rules
"Functionally runnable"
Start service + HTTP request
Start service → curl endpoint → verify response
One AC often corresponds to multiple Grade rules, not just one. Take the AC "the backend API must be robust" — it can decompose into: functions have try-except, ports read from environment variables, correct Content-Type returned, and request logging uses the logging module. Four rules, four different check methods, all from a single AC.
The transformation principle is consistent: AC is for humans to read ("must have error handling"), Grade rules are for machines to read (regex matching). Do the transformation once, and the rules apply to all Sprints. Currently this transformation is manual — it requires familiarity with regex and AST. Future work on LLM-assisted Grade rule generation (human writes AC, AI translates to check code, human reviews) can lower the barrier, but the transformation itself won't disappear — standards must be set by humans.



5. How to Validate: Three Metrics and Run Data

How do you validate the effectiveness of this outer Sprint + inner Spec dual-layer structure? Full controlled experiments haven't been run yet, but the limited runs conducted so far provide some reference.
Existing run data: On a task of "generate backend API + frontend page + data file," three independent runs were conducted using qwen-plus. Without Loop, the directly generated code scored between 40-55 on the Grade scale (print, missing try-except, hardcoded keys, missing type annotations). After three rounds of Loop iteration, all three runs reached above 90 (passing all checks). On average, 4-6 issues were fixed per run, with a 100% pass rate after three rounds.
Metric 1: Single-Loop fix rate. Compare the Grade score improvement of the same task — direct generation without Loop vs. three rounds of Loop iteration. Based on existing data, Loop iteration improves scores by approximately 40-50 points after three rounds. Statistical significance requires 10+ repetitions to average.
Metric 2: Layered feedback effectiveness. Compare "giving the AI all rule feedback at once" vs. "giving it progressively across three layers," measuring the difference in fix success rate. During development, the latter was qualitatively observed to be more effective — the AI faces 3-4 issues at a time and fixes them more precisely — but no rigorous A/B comparison has been run. This experiment is simple to design: one set of 5 tasks × two feedback methods = 10 runs for a preliminary conclusion.
Metric 3: Rule accumulation effect. Apply the same set of Grade rules to 10 different WBS tasks in sequence. The expected result: Task 1 has 8 issues detected, Task 5 has 4, Task 10 has 2 — because issues encountered earlier have been converted into Grade rules and won't recur. This quantifies the value of "Grade rules growing from static to organic." Data collection for this metric is still ongoing.
Beyond self-collected data, existing academic validation can also be referenced: the MultiCodeIF benchmark shows constraint satisfaction rising from 63% to 83.4% over four refinement rounds; ReflexiCoder achieves 94.51% on HumanEval; Murphy delivers an +8% Pass@1 improvement. These don't directly validate Sprint Loop, but they validate the broader direction that "automated iteration improves code quality."



6. Current Problems and Next Steps

With the outer Sprint and inner Spec layers added, humans no longer need to write code and review code — that's the LLM's and Loop's job. But humans have gained two new responsibilities: extracting WBS from Spec and assigning appropriate Loops, and translating TC/AC into Grade rules. Neither of these is yet frictionless.
WBS decomposition remains manual. A project breaks into 30 WBS tasks — which ones are suitable for Loop, which require human development? There's no assistive tool for this judgment yet. Grade rule authoring has a learning curve — regex, AST, Python code; miss any one and you'll struggle. Until these two barriers are lowered, the outer Sprint and inner Spec remain "theoretically sound."
The next steps are concrete: run A/B comparison data to produce quantified conclusions for the three metrics; implement multi-Loop parallel scheduling to automatically distribute WBS task lists across multiple Loop instances; and enable LLM-assisted Grade rule generation — human writes AC, AI translates to check code, human reviews.
Scrum has spent twenty years proving that "breaking work into small iterations" is an effective method for managing complex software projects. The outer Sprint manages project rhythm, the inner Spec manages quality standards, and the Loop Engine automatically executes between them. This is no different from how humans write code — only the executor has changed from human to AI.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article