AGENCYSCRIPT
CoursesEnterpriseBlog
đź‘‘FoundersSign inJoin Waitlist
AGENCYSCRIPT

Governed Certification Framework

The operating system for AI-enabled agency building. Certify judgment under constraint. Standards over scale. Governance over shortcuts.

Stay informed

Governance updates, certification insights, and industry standards.

Products

  • Platform
  • Certification
  • Launch Program
  • Vault
  • The Book

Certification

  • Foundation (AS-F)
  • Operator (AS-O)
  • Architect (AS-A)
  • Principal (AS-P)

Resources

  • Blog
  • Verify Credential
  • Enterprise
  • Partners
  • Pricing

Company

  • About
  • Contact
  • Careers
  • Press
© 2026 Agency Script, Inc.·
Privacy PolicyTerms of ServiceCertification AgreementSecurity

Standards over scale. Judgment over volume. Governance over shortcuts.

On This Page

Stage 1: PrimeWhat priming includesWhy it is firstStage 2: ComposeThe compose disciplineCorrection is part of ComposeStage 3: VerifyThe verification standardStage 4: CaptureUsing the Loop to Diagnose FailuresFrom blame to diagnosisWhen to Apply Each Stage More HeavilyNovel or risky workRoutine, pattern-rich workFrequently Asked QuestionsWhy only four stages?How is PCVC different from a checklist?Which stage do people most often neglect?Can I use this framework with any AI coding tool?How does the loop change for high-risk code?Key Takeaways
Home/Blog/The PCVC Loop: A Mental Model for AI Coding
General

The PCVC Loop: A Mental Model for AI Coding

A

Agency Script Editorial

Editorial Team

·January 7, 2024·7 min read
how ai code generation workshow ai code generation works frameworkhow ai code generation works guideai fundamentals

Most advice about AI code generation arrives as a pile of disconnected tips. Tips are hard to apply under pressure because you cannot remember all of them and you cannot tell which one a given problem calls for. A framework solves this by giving you a single structure to hang everything on, so that when output goes wrong you know exactly which stage failed.

This article introduces the PCVC loop: Prime, Compose, Verify, Capture. It is a deliberately small model with four stages, each mapping directly to how the underlying system works. Once you internalize it, every session has a shape, and every failure has an address. You stop reacting and start diagnosing.

The framework is reusable across tools and tasks because it targets the mechanics of prediction, not the features of any product. Learn it once and apply it everywhere.

Stage 1: Prime

Prime is everything you do to set up a good prediction before you make a request. Because the model predicts from what it can see, this stage determines most of your output quality.

What priming includes

  • Writing the desired outcome in one clear sentence.
  • Bringing relevant interfaces, types, and example data into the context window.
  • Stating constraints such as libraries to use or avoid.

Why it is first

A model primed with the right context produces code that fits your project. A starved model invents its own. If your output keeps ignoring your existing code, the failure is almost always in Prime. The mechanics behind this are in Inside the Machine That Writes Your Code.

Stage 2: Compose

Compose is the request and the iterative shaping of the result. The key principle is to build through small, bounded pieces rather than one large generation.

The compose discipline

  • Ask for a single function or bounded change with explicit inputs and outputs.
  • Read the result before accepting it.
  • Correct with specific instructions rather than rewriting by hand.

Composing in small steps keeps each result reviewable and lets you converge through a fast loop. When a session produces sprawling, unverifiable output, the failure is in Compose: the scope was too large. This stage operationalizes the sequence in From Prompt to Working Code in Seven Moves.

Correction is part of Compose

A common misread of the loop is to think Compose ends when the first suggestion arrives. It does not. Shaping the result through specific corrections is part of the same stage, and it is usually faster than rewriting by hand. "You ignored the cancelled status; exclude those records" reshapes the next prediction and converges in a round or two. Staying in this corrective loop, rather than dropping out to edit manually, is what keeps Compose efficient.

Stage 3: Verify

Verify is the fixed bar you apply to every result before trusting it, regardless of how confident the output made you feel. This stage exists because generation optimizes for plausibility, not truth.

The verification standard

  • Run the code with a normal input and an edge case.
  • Confirm unfamiliar external calls exist in real documentation.
  • Run the existing test suite where one is available.

Hallucinated APIs and subtle logic errors are structural, not occasional. When a bug reaches production, the failure was in Verify: the bar was skipped or too low. The cost of getting this wrong is documented in 7 Common Mistakes with How Ai Code Generation Works (and How to Avoid Them).

Stage 4: Capture

Capture is the short reflective step after the work is done. Note what produced good output and which task types went badly. This is how the loop improves itself over time.

Capture is the stage almost everyone skips, and it is why many people plateau. Ten seconds of recording the unlock turns scattered sessions into a compounding skill. When your usage stops improving, the missing stage is Capture. The habits this builds are described in How Ai Code Generation Works: Best Practices That Actually Work.

Using the Loop to Diagnose Failures

The real power of PCVC is diagnostic. When something goes wrong, ask which stage failed and the fix becomes obvious.

  • Output ignores your existing code? Prime failed; add context.
  • Output is sprawling and unverifiable? Compose failed; shrink the scope.
  • A bug reached production? Verify failed; raise the bar.
  • Your skill has stopped improving? Capture failed; start taking notes.

This turns vague frustration into a precise repair. Instead of concluding the tool is bad, you locate the broken stage. The case study in How One Team Cut a Two-Week Migration to Three Days is essentially PCVC run well under deadline.

From blame to diagnosis

Most disappointment with AI coding tools takes the form of a global verdict: the tool is bad, the model is dumb, the hype is empty. PCVC replaces that verdict with a question: which stage failed this time? That reframing is powerful because global verdicts are dead ends, while stage-level diagnoses point straight at a fix. A team that says "the model keeps inventing functions" is stuck; a team that says "our Verify stage is too weak for niche libraries" knows exactly what to change. The loop converts frustration into an actionable signal, which is the difference between abandoning the tools and steadily getting better with them.

When to Apply Each Stage More Heavily

The loop is constant, but the weight you give each stage shifts with the task.

Novel or risky work

Lean hard on Prime and Verify. Novel tasks expose the model's bias toward average solutions, so context and verification carry more load, and sometimes the right move is to lead with human judgment entirely.

Routine, pattern-rich work

Compose can move fast because the model predicts these well, but never skip Verify. Even easy tasks produce the occasional confident error, which is exactly when overconfidence is most dangerous.

Frequently Asked Questions

Why only four stages?

A framework you cannot remember is useless under pressure. Four stages are few enough to recall instantly and broad enough to cover the full session. Each maps to a distinct part of how the model works, so the structure stays meaningful rather than arbitrary.

How is PCVC different from a checklist?

A checklist tells you what to do; PCVC tells you why and where. Its real value is diagnostic: when output fails, the framework tells you which stage broke. A checklist and PCVC complement each other, with the loop providing the mental map behind the items.

Which stage do people most often neglect?

Capture, followed closely by Prime. People rush into requests without priming context, then skip reflection afterward. Strengthening those two stages tends to produce the largest improvement for most users, since they bookend the parts everyone already does.

Can I use this framework with any AI coding tool?

Yes. PCVC targets the mechanics of prediction and verification, not the features of a specific product. The interface details differ, but priming context, composing in small steps, verifying on a fixed bar, and capturing lessons apply universally.

How does the loop change for high-risk code?

Shift weight toward Prime and Verify, and be willing to lead with human judgment. Security-critical and novel work exposes the model's weaknesses, so more context and stricter verification are warranted, with AI relegated to a reviewer rather than an author.

Key Takeaways

  • PCVC organizes every AI coding session into Prime, Compose, Verify, and Capture.
  • Prime sets up prediction by stocking context; most output quality is decided here.
  • Compose builds through small, reviewable pieces and corrects rather than rewrites.
  • Verify applies a fixed bar every time because plausibility is not correctness.
  • The loop is diagnostic: when output fails, identify the broken stage and repair it.

Search Articles

Categories

OperationsSalesDeliveryGovernance

Popular Tags

prompt engineeringai fundamentalsai toolsthe difference between AIMLagency operationsagency growthenterprise sales

Share Article

A

Agency Script Editorial

Editorial Team

The Agency Script editorial team delivers operational insights on AI delivery, certification, and governance for modern agency operators.

Related Articles

General

Prompt Quality Decides Whether AI Earns Its Keep

Prompt quality is the single biggest variable in whether AI delivers real work or expensive noise. The model matters, the platform matters — but the prompt you write determines whether you get a first

A
Agency Script Editorial
June 1, 2026·10 min read
General

Counting the Real Cost of Every Token You Send

Tokens and context windows sit at the intersection of AI capability and operational cost—yet most business cases treat them as technical footnotes. That's a mistake that costs real money. Every time y

A
Agency Script Editorial
June 1, 2026·10 min read
General

Rolling Out AI Hallucinations Across a Team

Most teams discover AI hallucinations the hard way — a confident-sounding wrong answer makes it into a client deliverable, a legal brief, or a published report. The damage isn't just to the output; it

A
Agency Script Editorial
June 1, 2026·11 min read

Ready to certify your AI capability?

Join the professionals building governed, repeatable AI delivery systems.

Explore Certification