{"id":14274,"date":"2026-04-29T15:14:09","date_gmt":"2026-04-29T15:14:09","guid":{"rendered":"https:\/\/techtrendfeed.com\/?p=14274"},"modified":"2026-04-29T15:14:10","modified_gmt":"2026-04-29T15:14:10","slug":"structured-immediate-pushed-growth-spdd","status":"publish","type":"post","link":"https:\/\/techtrendfeed.com\/?p=14274","title":{"rendered":"Structured-Immediate-Pushed Growth (SPDD)"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>As soon as a crew adopts AI coding assistants, the primary beneficial properties present up on the<br \/>\n      particular person degree: one developer can draft, modify, and refactor code<br \/>\n      a lot sooner than earlier than.<br \/>\n      However supply velocity isn&#8217;t restricted by typing.<br \/>\n      Whenever you have a look at the complete supply lifecycle, from necessities via<br \/>\n      launch, new friction seems:<\/p>\n<ul>\n<li>Ambiguous necessities develop into code rapidly, and misunderstandings scale with them.<\/li>\n<li>Evaluations need to course of extra change, and inconsistency turns into simpler to introduce.<\/li>\n<li>Extra integration and testing points floor as a result of \u201cgenerated\u201d doesn&#8217;t suggest \u201caligned.\u201d<\/li>\n<li>Manufacturing danger is tougher to cause about when the quantity of change rises.<\/li>\n<\/ul>\n<p>So sure, native velocity improves. However that does not mechanically<br \/>\n      translate into system-level throughput. It is like shopping for a Ferrari and driving it on muddy roads: the engine is<br \/>\n      highly effective, however your arrival time is set by highway situations and<br \/>\n      visitors. In our expertise, the true query is not \u201cHow can we generate extra code?\u201d It is<br \/>\n      how can we make AI-generated adjustments governable, reviewable, and reusable,<br \/>\n      so groups get sooner and safer?<\/p>\n<p>That led our Thoughtworks inner IT groups (International IT Providers) to a<br \/>\n      technique and workflow we now name Structured Immediate-Pushed Growth (SPDD).<br \/>\n      SPDD goals to show AI help from private effectivity into an organization-level<br \/>\n      functionality that scales, with out buying and selling away high quality.<\/p>\n<div class=\"figure \" id=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/spdd-overview.svg\"><img decoding=\"async\" src=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/spdd-overview.svg\" style=\"max-width: 95vw;\" width=\"700\" \/><\/p>\n<p class=\"photoCaption\">Prompts as First-Class Supply Artifacts<\/p>\n<\/div>\n<section id=\"WhatIsSpdd\">\n<h2>What&#8217;s SPDD?<\/h2>\n<p>Structured Immediate-Pushed Growth (SPDD) is an engineering technique<br \/>\n      that treats prompts as first-class supply artifacts.<\/p>\n<p>As a substitute of counting on advert hoc chats, SPDD turns prompts into property that<br \/>\n      might be: model managed, reviewed, reused, and improved over time.<br \/>\n      Groups use structured prompts to seize necessities, area language,<br \/>\n      design intent, constraints, and a job breakdown. Then the LLM generates<br \/>\n      code inside an outlined boundary, so output turns into extra predictable and<br \/>\n      simpler to validate.<\/p>\n<p>It has two core parts<\/p>\n<section id=\"TheReasonsCanvas\">\n<h3>The REASONS Canvas<\/h3>\n<p>The REASONS Canvas is a construction for producing prompts. It forces<br \/>\n          readability round necessities, area mannequin, answer method, system<br \/>\n          construction, job decomposition, reusable norms, and safeguards. So the<br \/>\n          LLM is guided by intent, not guesswork.<\/p>\n<p>The REASONS Canvas is a seven-part construction that guides a immediate from<br \/>\n      intent \u2192 design \u2192 execution \u2192 governance.<\/p>\n<div class=\"figure \" id=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/spdd-reason-canvas.svg\"><img decoding=\"async\" src=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/spdd-reason-canvas.svg\" style=\"max-width: 95vw;\" width=\"900\" \/><\/p>\n<\/div>\n<p><b>Summary elements (intent &amp; design)<\/b><\/p>\n<ul>\n<li>R \u2014 Necessities: What downside are we fixing, and what&#8217;s DoD?<\/li>\n<li>E \u2014 Entities: Area entities and relationships.<\/li>\n<li>A \u2014 Method: The technique of how we&#8217;ll meet the necessities.<\/li>\n<li>S \u2014 Construction: The place the change suits within the system; parts and dependencies.<\/li>\n<\/ul>\n<p><b>Particular elements (execution)<\/b><\/p>\n<ul>\n<li>O \u2014 Operations: Break the summary technique into concrete, testable implementation steps.<\/li>\n<\/ul>\n<p><b>Frequent requirements elements (governance)<\/b><\/p>\n<ul>\n<li>N \u2014 Norms: Cross-cutting engineering norms (naming, observability, defensive coding, and so on.).<\/li>\n<li>S \u2014 Safeguards: Non-negotiable boundaries (invariants, efficiency limits, safety guidelines, and so on.).<\/li>\n<\/ul>\n<p>The canvas aligns intent and limits earlier than code is generated, shifting uncertainty to the left.<br \/>\n        As a result of the structured immediate captures the complete specification, reviewers cause a few single artifact as an alternative of scattered chat logs and partial diffs.<br \/>\n        By following the identical construction, each immediate turns into governable in the identical means.<br \/>\n        And as area information and design choices accumulate in every immediate, they compound particular person experience throughout iterations and scale back variability throughout the crew.\n      <\/p>\n<\/section>\n<section id=\"TheSpddWorkflow\">\n<h3>The SPDD workflow<\/h3>\n<p>The workflow brings prompts into the identical self-discipline as code: commit<br \/>\n          historical past, evaluation, and high quality gates. It additionally enforces a easy however highly effective rule:<\/p>\n<p>When actuality diverges, repair the immediate first \u2014 then replace the code.<\/p>\n<p>Over time, this adjustments how groups work. Evaluations transfer away from \u201cspot<br \/>\n          the bug\u201d towards \u201ctest the intent.\u201d Rework turns into extra managed. And<br \/>\n          profitable patterns naturally accumulate right into a reusable immediate library<br \/>\n          that helps AI-First Software program Supply (AIFSD).<\/p>\n<p>Should you&#8217;ve recognized about <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Spec-driven_development\">Spec-Pushed<br \/>\n          Growth<\/a>,<br \/>\n          you may acknowledge the identical start line: write the spec clearly first,<br \/>\n          then let the mannequin implement. SPDD takes a distinct angle. It treats<br \/>\n          structured prompts as ruled, reusable, versioned crew property (REASONS<br \/>\n          + workflow) that evolve alongside the code &#8211; an method that Birgitta<br \/>\n          B\u00f6ckeler categorizes as a <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/martinfowler.com\/articles\/exploring-gen-ai\/sdd-3-tools.html\">spec-anchored<\/a> method.<\/p>\n<p>The purpose of the SPDD workflow is to show enterprise enter \u2192 abstraction \u2192<br \/>\n      execution \u2192 validation \u2192 launch right into a <i>\u201cclosed loop\u201d<\/i>\u2014and to ensure<br \/>\n      immediate property and code evolve collectively, not individually.<\/p>\n<div class=\"figure \" id=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/spdd-workflow.svg\"><img decoding=\"async\" src=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/spdd-workflow.svg\" style=\"max-width: 95vw;\" width=\"930\" \/><\/p>\n<p class=\"photoCaption\">SPDD workflow<\/p>\n<\/div>\n<p>The purpose of this workflow is to anchor collaboration on the prompts, so<br \/>\n      that builders and product homeowners can keep away from repeated cycles of alignment.<br \/>\n      The immediate units an express boundary for code technology, lowering the<br \/>\n      randomness of the LLM&#8217;s non-determinism, making it simpler to control. By<br \/>\n      treating the structured prompts as first-class artifacts in model<br \/>\n      management, we flip profitable practices into reusable property, enhancing<br \/>\n      consistency and lowering reinvention.<\/p>\n<p>In apply these steps are carried out via instructions offered<br \/>\n      by <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\">openspdd<\/a>, a command-line instrument that<br \/>\n      implements the SPDD workflow. The desk under summarizes every<br \/>\n      command.<\/p>\n<table class=\"dark-head\">\n<thead>\n<tr>\n<th>Command<\/th>\n<th>Kind<\/th>\n<th>Function<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/optional\/spdd-story.md\">\/spdd-story<\/a><\/td>\n<td>Non-compulsory<\/td>\n<td>Breaks a big requirement into unbiased, deliverable<br \/>\n            consumer tales following the INVEST precept.<\/td>\n<\/tr>\n<tr>\n<td><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/core\/spdd-analysis.md\">\/spdd-analysis<\/a><\/td>\n<td>Core<\/td>\n<td>Extracts area key phrases from necessities, scans related<br \/>\n            code, and produces a strategic evaluation protecting area ideas,<br \/>\n            dangers, and design course.<\/td>\n<\/tr>\n<tr>\n<td><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/core\/spdd-reasons-canvas.md\">\/spdd-reasons-canvas<\/a><\/td>\n<td>Core<\/td>\n<td>Generates the complete REASONS Canvas \u2014 an executable blueprint<br \/>\n            from high-level rationale all the way down to method-level operations.<\/td>\n<\/tr>\n<tr>\n<td><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/core\/spdd-generate.md\">\/spdd-generate<\/a><\/td>\n<td>Core<\/td>\n<td>Reads the Canvas and generates code job by job, strictly<br \/>\n            following the operations, norms, and safeguards outlined within the<br \/>\n            immediate.<\/td>\n<\/tr>\n<tr>\n<td><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/optional\/spdd-api-test.md\">\/spdd-api-test<\/a><\/td>\n<td>Non-compulsory<\/td>\n<td>Generates a cURL-based API check script with structured check<br \/>\n            circumstances protecting regular, boundary, and error situations.<\/td>\n<\/tr>\n<tr>\n<td><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/core\/spdd-prompt-update.md\">\/spdd-prompt-update<\/a><\/td>\n<td>Core<\/td>\n<td>Incrementally updates the Canvas when necessities change<br \/>\n          (necessities \u2192 immediate \u2192 code).<\/td>\n<\/tr>\n<tr>\n<td><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/core\/spdd-sync.md\">\/spdd-sync<\/a><\/td>\n<td>Core<\/td>\n<td>Synchronizes code-side adjustments (refactoring, fixes) again<br \/>\n            into the Canvas so the immediate stays an correct file of the<br \/>\n            present code (code \u2192 immediate).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/section>\n<\/section>\n<section id=\"EnhancingABillingEngineWithSpdd\">\n<h2>Enhancing a billing engine with SPDD<\/h2>\n<p>A sophisticated workflow is obscure within the summary, so<br \/>\n      now we have ready an instance workflow of enhancing an present software program<br \/>\n      system. This technique, and its enhancement, are neccessarily small so as<br \/>\n      to be understandable inside a tutorial article. That mentioned the enhancement<br \/>\n      instance is a full end-to-end instance: from creating preliminary<br \/>\n      necessities, to analyzing enterprise necessities, to producing and reviewing a structured immediate,<br \/>\n        to producing and verifying code, to ultimate cleanup and testing.<\/p>\n<p>You possibly can observe together with this instance by putting in<br \/>\n      <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\">openspdd<\/a> in your individual surroundings.<\/p>\n<section id=\"TheCurrentSystem\">\n<h3>The present system<\/h3>\n<p>The present system is an easy billing engine that calculates payments<br \/>\n        for utilizing a large-language mannequin. It accepts a file that captures how<br \/>\n        many tokens are utilized in a session and calculates a invoice.<\/p>\n<p>The whole codebase for this preliminary model is<br \/>\n          <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/tree\/iteration-1-end\">accessible on GitHub<\/a>.<br \/>\n          The repository contains the <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/blob\/iteration-1-start\/requirements\/token-usage-billing-story.md\">preliminary necessities story<\/a><br \/>\n          and <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/compare\/iteration-1-start...iteration-1-end\">all of the SPDD artifacts used to generate it<\/a>.<br \/>\n          For brevity, we do not describe that preliminary technology right here, but it surely follows primarily the identical steps as that for the enhancement.<br \/>\n          We deal with describing the enhancement as a result of most work on a system are enhancements.<\/p>\n<\/section>\n<section id=\"TheEnhancement\">\n<h3>The enhancement<\/h3>\n<p>Pushed by evolving enterprise necessities and direct consumer suggestions, we&#8217;re enhancing the billing engine to transition from a static pricing mannequin to a extra refined,<br \/>\n          versatile infrastructure. This replace goals to help various subscription methods and variable, model-specific pricing via the next key adjustments:<\/p>\n<ul>\n<li>API enhancement: replace the present <code>POST \/api\/utilization<\/code><br \/>\n          endpoint to just accept a brand new, required <code>modelId<\/code> parameter<br \/>\n          (e.g., \u201cfast-model\u201d, \u201creasoning-model\u201d).<\/li>\n<li>Mannequin-aware pricing: shift from a single world fee to dynamic<br \/>\n          pricing, the place prices fluctuate relying on the precise AI mannequin<br \/>\n          invoked.<\/li>\n<li>Multi-plan billing logic: introduce distinct billing behaviors<br \/>\n          primarily based on the client&#8217;s subscription tier:<\/li>\n<ul>\n<li>Customary plan (optimized): retains the worldwide month-to-month quota,<br \/>\n            however any overage utilization is now calculated utilizing model-specific<br \/>\n            charges.<\/li>\n<li>Premium plan (new): operates with out a quota restrict. It<br \/>\n            introduces cut up billing, the place immediate tokens and completion<br \/>\n            tokens are charged individually at totally different charges relying<br \/>\n            on the mannequin used.<\/li>\n<\/ul>\n<li>Architectural scalability: implement an extensible design sample<br \/>\n          (similar to Technique or Manufacturing facility) to cleanly isolate the calculation<br \/>\n          formulation for various plans, making certain the system can simply<br \/>\n          accommodate future pricing fashions.<\/li>\n<\/ul>\n<p><i>Since this new part encompasses each enterprise necessities and technical particulars,<br \/>\n          it&#8217;s sometimes accomplished collaboratively via a pairing session between a PO (or BA) and a developer.<\/i><\/p>\n<\/section>\n<section id=\"Step1CreateInitialRequirements\">\n<h3>Step 1: Create preliminary necessities<\/h3>\n<p>To kick off the method rapidly, we will use the <code>\/spdd-story<\/code><br \/>\n        command to generate a consumer story instantly primarily based on the enhancement. Usually, consumer tales are offered by the PO or BA.<br \/>\n        Nevertheless, in our workflow, we will remodel tales of any type right into a constant format and dimension.<br \/>\n        So long as there&#8217;s shared alignment on the ultimate acceptance standards, this step might be carried out by a PO, BA, or developer, relying on the crew&#8217;s versatile division of labor.<\/p>\n<p>Instruction:<\/p>\n<div class=\"command-details\">\n<h3>How <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/optional\/spdd-story.md\">spdd-story<\/a> works<\/h3>\n<p>This command breaks a big requirement into unbiased,<br \/>\n            deliverable consumer tales following the INVEST precept (1\u20135 days<br \/>\n            of labor every). Every story contains acceptance standards written in<br \/>\n            enterprise language, able to function enter for<br \/>\n            <code>\/spdd-analysis<\/code>.<\/p>\n<p>Its goal is to make giant necessities manageable and to make sure a standardized,<br \/>\n            predictable format for the subsequent steps.<\/p>\n<\/div>\n<p>The AI analyzed the enhancement description and cut up it into two<br \/>\n        consumer tales:<\/p>\n<p>The auto-generated tales are detailed sufficient to function a baseline<br \/>\n        for a proper venture. For this walkthrough we consolidate them right into a<br \/>\n        single simplified story so the instance stays self-contained.<\/p>\n<p>Instruction:<\/p>\n<div class=\"prompt\">\n<p>Consolidate the next two consumer tales right into a single, simplified<br \/>\n          story:<br \/>@[User-story-1-1-initial]Multi-Plan-Billing-Basis-&amp;-Customary-Plan-Mannequin-Conscious-Pricing.md<br \/>@[User-story-1-2-initial]Premium-Plan-Break up-Price-Billing.md<\/p>\n<p>Necessities:<br \/>1. Merge each plans (Customary and Premium) into one coherent story.<br \/>2. Hold solely the sections: Background, Enterprise Worth, Scope In, Scope Out, and Acceptance Standards.<br \/>3. Strip implementation-level element \u2014 deal with what the system ought to do, not how.<br \/>4. Acceptance Standards should use Given\/When\/Then format with concrete numeric examples.<br \/>5. Hold the outcome concise \u2014 no multiple web page.<br \/>6. Solely maintain three high-level ACs.\n        <\/p>\n<\/div>\n<p>Directions of this sort hardly ever produce similar textual content on each run \u2014<br \/>\n        fashions and sampling introduce small variations \u2014 so we nonetheless count on to<br \/>\n        evaluation and tweak the output earlier than treating it as ultimate. The mixed<br \/>\n        story under is the model we refined for this walkthrough: a intentionally<br \/>\n        simplified consolidation of the 2 preliminary tales.<\/p>\n<\/section>\n<section id=\"Step2ClarifyAnalysis\">\n<h3>Step 2: Make clear evaluation<\/h3>\n<p>Earlier than leaping into implementation, the developer opinions the consumer<br \/>\n        story to construct a shared understanding of what it means in apply. If<br \/>\n        there are apparent business-level points, that is the purpose to align with<br \/>\n        the BA or PO. On this case the story is obvious sufficient, so we transfer<br \/>\n        straight to breaking it down alongside three dimensions: core logic, scope<br \/>\n        boundaries, and definition of finished.<\/p>\n<p><b>Core logic<\/b><\/p>\n<p>One new required subject on the API: <code>modelId<\/code>. The client<br \/>\n        now tells us which AI mannequin they used \u2014 that is the important thing that unlocks the<br \/>\n        proper value.<\/p>\n<ul>\n<li><i>Customary Plan:<\/i> Buyer has a month-to-month token quota. Utilization<br \/>\n          inside quota is free. Overage is charged at a model-specific fee<br \/>\n          (e.g., fast-model $0.01\/1K vs. reasoning-model $0.03\/1K). Current<br \/>\n          quota logic stays; solely the speed lookup adjustments.<\/li>\n<li><i>Premium Plan:<\/i> No quota. Each token is billed from the<br \/>\n          first one. Immediate tokens and completion tokens are charged individually,<br \/>\n          every at a model-specific fee. Invoice = immediate cost + completion<br \/>\n          cost. This plan is totally new.<\/li>\n<li><i>Routing:<\/i> The system determines the client&#8217;s plan and<br \/>\n          dispatches to the matching billing components. The design have to be simple to<br \/>\n          lengthen \u2014 Enterprise plans (Story 2) are subsequent.<\/li>\n<\/ul>\n<p><b>Scope boundaries<\/b><\/p>\n<p>We&#8217;re solely calculating the present invoice. We&#8217;re NOT constructing buyer<br \/>\n        CRUD, NOT querying historic payments, NOT managing subscriptions, and NOT<br \/>\n        including\/eradicating fashions.<\/p>\n<p><b>Definition of finished<\/b><\/p>\n<p>The next situations restate the story&#8217;s acceptance standards<br \/>\n        with the implementation element the crew must confirm. The fourth<br \/>\n        merchandise (Response format) shouldn&#8217;t be a brand new enterprise AC \u2014 it captures the<br \/>\n        non-functional contract the developer provides to make the factors<br \/>\n        testable end-to-end.<\/p>\n<ul>\n<li><i>Validation:<\/i> Lacking <code>modelId<\/code> \u2192 HTTP 400.<br \/>\n          Unknown buyer \u2192 HTTP 404. Damaging tokens \u2192 HTTP 400. All<br \/>\n          present validations stay intact.<\/li>\n<li><i>Customary Plan billing:<\/i> A buyer with a 100K quota and<br \/>\n          90K already used submits 30K tokens for fast-model ($0.01\/1K).<br \/>\n          Anticipated outcome: 10K coated by quota, 20K overage, cost $0.20.<br \/>\n          The identical request with reasoning-model ($0.03\/1K) yields $0.60 \u2014<br \/>\n          similar quota logic, totally different fee.<\/li>\n<li><i>Premium Plan billing:<\/i> A buyer submits 10K immediate<br \/>\n          tokens + 20K completion tokens for reasoning-model (immediate $0.03\/1K,<br \/>\n          completion $0.06\/1K). Anticipated outcome: $0.30 + $1.20 = $1.50. No<br \/>\n          quota, no overage \u2014 immediate and completion are billed individually.<\/li>\n<li><i>Response format:<\/i> HTTP 201 returning invoice ID, buyer ID,<br \/>\n          token counts, timestamp, <code>modelId<\/code>, and a plan-appropriate<br \/>\n          cost breakdown.<\/li>\n<\/ul>\n<p>If all these situations go, we have conquered this story.<\/p>\n<\/section>\n<section id=\"Step3GenerateAnalysisContext\">\n<h3>Step 3: Generate evaluation context<\/h3>\n<p>With the necessities and scope clarified, we use the<br \/>\n        <code>\/spdd-analysis<\/code> command. By feeding it the enterprise<br \/>\n        necessities, we instruct the AI to generate a complete evaluation<br \/>\n        context.<\/p>\n<div class=\"command-details\">\n<h3>How <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/core\/spdd-analysis.md\">spdd-analysis<\/a> works<\/h3>\n<p>This command extracts area key phrases from the enterprise<br \/>\n            necessities (e.g. \u201cbilling\u201d, \u201cquota\u201d, \u201cplan\u201d) and makes use of them to<br \/>\n            scan solely the related elements of the codebase \u2014 not all of it. It<br \/>\n            identifies present ideas, new ideas, key enterprise guidelines,<br \/>\n            and technical dangers.<\/p>\n<p>The output is a context-rich doc protecting area idea<br \/>\n            recognition, strategic course, and danger evaluation. It serves as<br \/>\n            enter for the subsequent step: producing the REASONS Canvas.<\/p>\n<\/div>\n<p>Instruction:<\/p>\n<p>\/spdd-analysis<br \/>\n          @[User-story-1]Multi-Plan-Billing-Basis-&amp;-Mannequin-Conscious-Pricing.md<\/p>\n<p>Generated artifact: <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/blob\/after-enhancement\/spdd\/analysis\/GGQPA-001-202603191100-%5BAnalysis%5D-multi-plan-billing-model-aware-pricing.md\">the preliminary evaluation context doc<\/a>.<\/p>\n<p>This command produces a strategic-level evaluation grounded in precise<br \/>\n        codebase exploration. The output focuses totally on the \u201cwhat\u201d and<br \/>\n        \u201cwhy,\u201d intentionally avoiding granular implementation particulars at this<br \/>\n        stage. It sometimes covers:<\/p>\n<ul>\n<li>Area ideas: present vs. new, relationships, enterprise<br \/>\n          guidelines<\/li>\n<li>Strategic method: answer course, design choices,<br \/>\n          trade-offs<\/li>\n<li>Dangers &amp; gaps: ambiguities, edge circumstances, technical dangers,<br \/>\n          acceptance-criteria protection<\/li>\n<\/ul>\n<section id=\"ReviewAndRefineTheAnalysisContext\">\n<h4>Evaluation and refine the evaluation context<\/h4>\n<p>With our personal understanding of the enterprise necessities in thoughts, we<br \/>\n        evaluation the generated evaluation doc\u2014specializing in the areas<br \/>\n        highlighted within the <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/alignment.html\">alignment<\/a> talent. This evaluation serves<br \/>\n        two functions: confirming that our understanding aligns with the AI&#8217;s<br \/>\n        interpretation, and discovering edge circumstances or boundary situations the AI<br \/>\n        may floor that we hadn&#8217;t thought of.<\/p>\n<p>On this particular occasion, the evaluation targeted on a number of vital<br \/>\n        areas:<\/p>\n<ul>\n<li>Whether or not the Technique Sample was appropriately thought of.<\/li>\n<li>Adherence to the OOP ideas established within the present system,<br \/>\n          particularly ISP and SRP.<\/li>\n<li>The validity of the proposed technique for including new fields.<\/li>\n<li>Figuring out edge circumstances not beforehand anticipated.<\/li>\n<li>Uncovering potential technical dangers.<\/li>\n<\/ul>\n<p>Upon finishing the evaluation, the AI&#8217;s evaluation largely aligned with<br \/>\n        our architectural intent; in reality, its issues have been much more<br \/>\n        complete than ours in sure areas.<\/p>\n<div class=\"figure \" id=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/example-analysis-review.png\"><img decoding=\"async\" src=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/example-analysis-review.png\" style=\"max-width: 95vw;\" width=\"650\" \/><\/p>\n<p class=\"photoCaption\">Edge circumstances and dangers from the<br \/>\n        <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/blob\/after-enhancement\/spdd\/analysis\/GGQPA-001-202603191100-%5BAnalysis%5D-multi-plan-billing-model-aware-pricing.md#edge-cases\">evaluation doc<\/a><\/p>\n<\/div>\n<p>To be clear, at this stage we solely possess a high-level<br \/>\n        conceptual alignment. Whereas we will rapidly envision the implementation<br \/>\n        for areas the place now we have prior expertise, we can&#8217;t utterly map out<br \/>\n        all of the granular technical particulars for the unfamiliar elements proper<br \/>\n        now.<\/p>\n<p>Nevertheless, that&#8217;s completely wonderful. The overarching course is aligned.<br \/>\n        We will proceed to the subsequent step: observing how the AI \u201csimulates\u201d the<br \/>\n        concrete implementation particulars inside our established framework and<br \/>\n        context. As soon as now we have these tangible particulars, we will uncover deeper,<br \/>\n        hidden points and make knowledgeable trade-offs primarily based on the precise<br \/>\n        state of affairs\u2014adopting the approaches the place the advantages outweigh the<br \/>\n        drawbacks, and discarding the remainder.<\/p>\n<p>Determination: settle for the evaluation as-is and proceed.<\/p>\n<\/section>\n<\/section>\n<section id=\"Step4GenerateStructuredPrompt\">\n<h3>Step 4: Generate structured immediate<\/h3>\n<div class=\"command-details\">\n<h3>How <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/core\/spdd-reasons-canvas.md\">spdd-reasons-canvas<\/a> works<\/h3>\n<p>This command reads enterprise context (the output of<br \/>\n            <code>\/spdd-analysis<\/code>, or a direct necessities description)<br \/>\n            and combines it with the present state of the codebase. It then<br \/>\n            generates a design specification throughout all seven REASONS<br \/>\n            dimensions \u2014 from \u201cwhy are we doing this\u201d to \u201cwhat should we not<br \/>\n            do.\u201d<\/p>\n<p>The output is an executable blueprint. The Operations<br \/>\n            part is exact all the way down to technique signatures, parameter sorts, and<br \/>\n            execution steps.<\/p>\n<\/div>\n<p>Instruction:<\/p>\n<p>\/spdd-reasons-canvas<br \/>\n          @GGQPA-001-202603191100-[Analysis]-multi-plan-billing-model-aware-pricing.md<\/p>\n<p>Generated artifact: <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/blob\/after-enhancement\/spdd\/prompt\/GGQPA-001-202603191105-%5BFeat%5D-multi-plan-billing-model-aware-pricing.md\">the preliminary structured immediate<\/a>.<\/p>\n<p>By this level, we have already gone via high-level technique throughout<br \/>\n        the evaluation part\u2014so when reviewing the structured immediate, we&#8217;re not<br \/>\n        ranging from scratch. As a substitute, we&#8217;re inspecting how the AI has<br \/>\n        translated our shared understanding into the REASONS Canvas construction:<br \/>\n        from technique to abstraction to concrete particulars.<\/p>\n<p>Consider it as a development: the evaluation part gave us strategic<br \/>\n        readability; now we&#8217;re checking whether or not that readability has been faithfully<br \/>\n        carried via into the architectural abstractions and implementation<br \/>\n        specifics. That is intent alignment at a deeper degree\u2014making certain that<br \/>\n        earlier than any code is generated, the AI has successfully \u201csimulated\u201d the<br \/>\n        whole answer inside our outlined framework. We get to evaluation from a<br \/>\n        world perspective quite than getting misplaced in particulars from the<br \/>\n        begin.<\/p>\n<p>Focus the evaluation on the areas highlighted within the <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/abstraction-first.html\">abstraction-first<\/a> talent. On this case,<br \/>\n        this foundational context is already embedded within the codebase and the <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/blob\/after-enhancement\/spdd\/prompt\/GGQPA-XXX-202603131758-%5BFeat%5D-api-token-usage-billing.md\">earlier<br \/>\n        structured immediate<\/a>. Consequently, when producing the structured<br \/>\n        immediate for this iteration, the AI naturally elements in these<br \/>\n        architectural tips and OO ideas. Consequently, although the<br \/>\n        generated content material is extremely advanced, there are remarkably few main<br \/>\n        points. We will choose to proceed with producing the code utilizing this<br \/>\n        structured immediate first, after which conduct a deeper evaluation to determine<br \/>\n        any potential code-level anomalies later.<\/p>\n<p>To date, now we have reached a robust consensus on the intent degree,<br \/>\n        clarifying each the core downside and the decision path. Whereas there<br \/>\n        could also be slight omissions within the particulars, this isn&#8217;t a priority; having<br \/>\n        aligned on the general scope with the AI makes native optimizations<br \/>\n        extremely controllable. Now, we transition into the code technology<br \/>\n        part.<\/p>\n<\/section>\n<section id=\"Step5GenerateCode\">\n<h3>Step 5: Generate code<\/h3>\n<p>This step is extra concerned as we&#8217;re producing the product code,<br \/>\n        checks, and our opinions have two different outcomes.<\/p>\n<section id=\"GenerateProductCode\">\n<h4>Generate product code<\/h4>\n<p>As soon as our structured immediate is locked in, use it to generate the<br \/>\n        product code.<\/p>\n<div class=\"command-details\">\n<h3>How <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/core\/spdd-generate.md\">spdd-generate<\/a> works<\/h3>\n<p>This command reads the REASONS Canvas and generates code job<br \/>\n            by job, following the order outlined in Operations. It strictly<br \/>\n            adheres to the coding requirements in Norms and the constraints in<br \/>\n            Safeguards \u2014 no improvisation, no options past what the spec<br \/>\n            defines.<\/p>\n<p>The core precept: the immediate captures the intent, and the code<br \/>\n            is the implementation of that intent. Generated code should correspond<br \/>\n            one-to-one with this specification.<\/p>\n<\/div>\n<p>Instruction:<\/p>\n<p>\/spdd-generate<br \/>\n          @GGQPA-001-202603191105-[Feat]-multi-plan-billing-model-aware-pricing.md<\/p>\n<p>Generated artifact: <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/commit\/ac3e07b396e3ee8ab54b5a5ab838ff07a6bdd64b\">code generated primarily based on the structured<br \/>\n        immediate<\/a>.<\/p>\n<p>Due to the a number of rounds of logical deduction we did earlier<br \/>\n        utilizing structured prompts, we method the code evaluation with a transparent<br \/>\n        focus and set of priorities:<\/p>\n<ol>\n<li>Structure: does the code strictly observe our anticipated 3-tier<br \/>\n          structure?<\/li>\n<li>Enterprise logic: does the Service layer implementation completely<br \/>\n          align with our preliminary intent?<\/li>\n<li>Scope of change: are the modifications strictly confined to the<br \/>\n          boundaries outlined by the structured immediate, avoiding unrelated<br \/>\n          adjustments or scope creep?<\/li>\n<\/ol>\n<p>On this particular case, due to the extremely exact context, the<br \/>\n        generated code largely met our expectations, except for just a few<br \/>\n        potential \u201cmagic numbers.\u201d We are going to optimize these out as soon as the<br \/>\n        purposeful verification is full.<\/p>\n<p>The important thing takeaway right here is: don&#8217;t be concerned about making errors, and<br \/>\n        do not stress over not catching each single element completely on the<br \/>\n        first strive. So long as we maintain iterating and advancing via the SPDD<br \/>\n        workflow, there are many alternatives to course-correct. Minor<br \/>\n        code smells are wonderful for now\u2014we confirm the core performance first,<br \/>\n        then circle again to optimize.<\/p>\n<\/section>\n<section id=\"FeatureVerification\">\n<h4>Function verification<\/h4>\n<p>Throughout function validation, the SPDD workflow gives the<br \/>\n        <code>\/spdd-api-test<\/code> command to generate purposeful testing<br \/>\n        scripts. <\/p>\n<div class=\"command-details\">\n<h3>How <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/optional\/spdd-api-test.md\">spdd-api-test<\/a> works<\/h3>\n<p>This command extracts API endpoint data from the code<br \/>\n            implementation or acceptance standards and generates a cURL-based<br \/>\n            check script. The script features a structured test-case desk<br \/>\n            protecting regular situations, boundary situations, and error<br \/>\n            situations. When executed, it outputs expected-vs-actual comparability<br \/>\n            outcomes.<\/p>\n<\/div>\n<p>Instruction:<\/p>\n<p>\/spdd-api-test<\/p>\n<p>Generated artifact: <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/blob\/after-enhancement\/scripts\/test-api.sh\">the API check script<\/a>.<\/p>\n<p>Guided by the outlined guidelines within the command, the AI generates a<br \/>\n        script that formulates the required check situations utilizing curl instructions.<br \/>\n        We will evaluation these AI-generated situations within the \u201cTEST CASE OVERVIEW\u201d<br \/>\n        part of the script.<\/p>\n<div class=\"figure \" id=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/example-script-generation.png\"><img decoding=\"async\" src=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/example-script-generation.png\" style=\"max-width: 95vw;\" width=\"650\" \/><\/p>\n<p class=\"photoCaption\">Generated API Check Script<\/p>\n<\/div>\n<p>Execution: as soon as the script is generated, run it:<\/p>\n<p><code>sh scripts\/test-api.sh<\/code><\/p>\n<p>Outcome: all purposeful checks handed efficiently.<\/p>\n<div class=\"figure \" id=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/example-test-results.png\"><img decoding=\"async\" src=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/example-test-results.png\" style=\"max-width: 95vw;\" width=\"650\" \/><\/p>\n<p class=\"photoCaption\">API Check Outcomes<\/p>\n<\/div>\n<\/section>\n<section id=\"CodeReviewampFinalAdjustments\">\n<h4>Code evaluation &amp; ultimate changes<\/h4>\n<p>Due to the rigorous intent alignment within the first a number of steps, the<br \/>\n        heavy lifting is already finished. At this stage, the remaining points are<br \/>\n        often minor logic discrepancies or surface-level code smells.<\/p>\n<p>To keep up precision in our engineering practices, we categorize<br \/>\n        these ultimate changes into two distinct sorts\u2014primarily based on whether or not they<br \/>\n        change the system&#8217;s observable habits\u2014and deal with them utilizing<br \/>\n        totally different methods throughout the SPDD workflow:<\/p>\n<div class=\"figure \" id=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/code-review.svg\"><img decoding=\"async\" src=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/code-review.svg\" \/><\/p>\n<p class=\"photoCaption\">Two responses to code evaluation adjustments<\/p>\n<\/div>\n<\/section>\n<section id=\"logic-correction\">\n<h4>Logic corrections (habits adjustments)<\/h4>\n<p>Technique: replace the immediate first, then generate code. For points<br \/>\n        associated to enterprise guidelines or logic mismatches (which inherently change<br \/>\n        the observable habits of the software program), at all times replace the structured<br \/>\n        immediate to lock within the appropriate intent earlier than touching the code. That is<br \/>\n        an replace or bug repair, not a refactoring.<\/p>\n<p>For example, when persisting <code>modelId<\/code> within the invoice, we<br \/>\n        at the moment permit this subject to be nullable. The underlying cause is the<br \/>\n        want to take care of backward compatibility with historic knowledge, making<br \/>\n        this workaround an inexpensive architectural choice.<\/p>\n<div class=\"figure \" id=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/example-prompt-update-a.png\"><img decoding=\"async\" src=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/example-prompt-update-a.png\" style=\"max-width: 95vw;\" width=\"650\" \/><\/p>\n<p class=\"photoCaption\">Immediate wants replace<\/p>\n<\/div>\n<p>Nevertheless, there&#8217;s an alternate. If the enterprise stakeholders can<br \/>\n        verify what the <code>modelId<\/code> worth needs to be previous to this<br \/>\n        change, we will unify the system&#8217;s habits and remove this potential<br \/>\n        technical debt. Let&#8217;s assume that, after confirming with the enterprise,<br \/>\n        the <code>modelId<\/code> for all historic payments needs to be set to<br \/>\n        <code>fast-model<\/code>.<\/p>\n<p>With this clear intent, we work together with the AI:<\/p>\n<div class=\"command-details\">\n<h3>How <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/core\/spdd-prompt-update.md\">spdd-prompt-update<\/a> works<\/h3>\n<p>This command incrementally updates the present Canvas. It<br \/>\n            modifies solely the sections affected by the change and preserves<br \/>\n            all the pieces else. Based mostly on the kind of change \u2014 new requirement,<br \/>\n            architectural adjustment, or constraint change \u2014 it mechanically<br \/>\n            determines which REASONS dimensions want updating.<\/p>\n<p>This differs from <code>\/spdd-sync<\/code>: sync flows from<br \/>\n            code to spec when code has modified; prompt-update flows from<br \/>\n            necessities to spec when necessities have modified.<\/p>\n<\/div>\n<p>Instruction:<\/p>\n<div class=\"prompt\">\n<p>\/spdd-prompt-update @GGQPA-001-202603191105-[Feat]-multi-plan-billing-model-aware-pricing.md<\/p>\n<p>model_id is a required subject, and its default worth is fast-model.<br \/>\n          Based mostly on this choice, replace the corresponding elements of the structured immediate.<\/p>\n<\/div>\n<p>The AI updates the structured immediate primarily based on this instruction.<\/p>\n<p>Up to date artifact: <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/commit\/904747b35d4888c51ec46faa533c6605e340cdf5\">the up to date structured immediate<\/a>.<\/p>\n<p>As soon as confirmed, use the <code>\/spdd-generate<\/code> command to<br \/>\n        replace the corresponding code primarily based on the newly up to date structured<br \/>\n        immediate:<\/p>\n<p>\/spdd-generate<br \/>\n        @GGQPA-001-202603191105-[Feat]-multi-plan-billing-model-aware-pricing.md<\/p>\n<p>The AI, guided by the principles outlined throughout the<br \/>\n        <code>\/spdd-generate<\/code> command, comprehends the required adjustments<br \/>\n        and performs focused updates completely on the affected<br \/>\n        codebase.<\/p>\n<p>Up to date artifact: <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/commit\/d140a0a2ed01387714f4ecc74604f570c05fb86e\">the up to date code<\/a>.<\/p>\n<p>It is very important observe that we don&#8217;t regenerate your entire<br \/>\n        codebase. We proceed utilizing the present structured immediate and the AI<br \/>\n        handles focused diffs:<\/p>\n<ol>\n<li>Determine the mismatch: discover that the habits of<br \/>\n          <code>modelId<\/code> throughout persistence is inconsistent with the brand new<br \/>\n          enterprise requirement (it have to be obligatory with a default).<\/li>\n<li>Goal the immediate snippet: copy the precise part from the<br \/>\n          structured immediate that defines the outdated logic.<\/li>\n<li>Replace the immediate: paste the extracted snippet into the chat<br \/>\n          alongside the revised enterprise rule, instructing the AI to replace<br \/>\n          the structured immediate first.<\/li>\n<li>Generate focused code updates: as soon as the immediate displays the brand new<br \/>\n          fact, run <code>\/spdd-generate<\/code> pointing to the up to date file.<br \/>\n          The AI mechanically performs focused diffs completely on the<br \/>\n          affected codebase, quite than regenerating all the pieces from<br \/>\n          scratch.<\/li>\n<\/ol>\n<\/section>\n<section id=\"RefactoringcleanCodeampStyle\">\n<h4>Refactoring (clear code &amp; fashion)<\/h4>\n<blockquote>\n<p>\u201cA change made to the inner construction of software program to make it simpler<br \/>\n          to know and cheaper to switch with out altering its observable<br \/>\n          habits.\u201d<\/p>\n<p class=\"quote-attribution\">&#8212; Martin Fowler<\/p>\n<\/blockquote>\n<p>Technique: refactor the code first, then sync again to the immediate.<br \/>\n        For structural or stylistic points that don&#8217;t change observable<br \/>\n        habits, instruct the AI to refactor the code instantly, after which use<br \/>\n        a sync command to replace the immediate documentation.<\/p>\n<p>For instance, the AI-generated <code>BillingServiceImpl<\/code> class<br \/>\n        accommodates some hardcoded magic numbers that have to be extracted into<br \/>\n        significant constants.<\/p>\n<pre>personal int calculateRemainingQuota(String customerId, PricingPlan plan) {\n        if (plan.getMonthlyQuota() == null || plan.getMonthlyQuota() == <span class=\"highlight\">0<\/span>) {\n            return <span class=\"highlight\">0<\/span>;\n        }\n\n        LocalDate currentDate = LocalDate.now(ZoneOffset.UTC);\n        LocalDateTime monthStart = currentDate.withDayOfMonth(<span class=\"highlight\">1<\/span>).atStartOfDay();\n        LocalDateTime monthEnd = currentDate.plusMonths(<span class=\"highlight\">1<\/span>).withDayOfMonth(<span class=\"highlight\">1<\/span>).atStartOfDay();\n\n        Integer currentMonthUsage = billRepository.sumIncludedTokensUsedForMonth(customerId, monthStart, monthEnd);\n        return plan.getMonthlyQuota() - currentMonthUsage;\n    }\n<\/pre>\n<p>Instruction 1:<\/p>\n<p>@BillingServiceImpl.java Within the calculateRemainingQuota technique,<br \/>\n        there are some magic numbers that have to be processed as<br \/>\n        constants<\/p>\n<p>The AI executes the code refactoring primarily based on this instruction<br \/>\n        (bear in mind the golden rule: at all times refactor in small, incremental<br \/>\n        steps). If the output meets our expectations, we use the<br \/>\n        <code>\/spdd-sync<\/code> command to synchronize these newly up to date<br \/>\n        code particulars again to their corresponding areas throughout the<br \/>\n        structured immediate.<\/p>\n<p>Instruction 2:<\/p>\n<div class=\"command-details\">\n<h3>How <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\/blob\/v0.4.9\/internal\/templates\/data\/core\/spdd-sync.md\">spdd-sync<\/a> works<\/h3>\n<p>This command compares the present code in opposition to the Canvas<br \/>\n          specification, then synchronizes code-side adjustments (refactoring,<br \/>\n          bug fixes, new parts) again into the Canvas.<\/p>\n<p>The purpose is to maintain the Canvas as an correct design doc<br \/>\n          for the present code, quite than an outdated historic<br \/>\n          file.<\/p>\n<\/div>\n<p>\/spdd-sync<\/p>\n<p>The AI summarizes the adjustments primarily based on the principles outlined within the<br \/>\n        <code>\/spdd-sync<\/code> command. It then follows the structural<br \/>\n        necessities of the REASONS Canvas to write down the detailed code<br \/>\n        description updates again into the corresponding sections of the<br \/>\n        structured immediate.<\/p>\n<p>As soon as each instructions are executed, we will see all of the immediate and code<br \/>\n        adjustments <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/commit\/56cc47e1ab6d4ec75528be276c92e0e93209bb84\">right here<\/a>.<\/p>\n<p>For any deeper or hidden code smells, merely repeat these steps.<br \/>\n        The golden rule is to at all times maintain the structured immediate synchronized<br \/>\n        along with your newest codebase.<\/p>\n<\/section>\n<section id=\"RegressionTest\">\n<h4>Regression check<\/h4>\n<p>As soon as all optimizing is full, restart the service and run the<br \/>\n        API check script another time to make sure no core performance was<br \/>\n        damaged in the course of the cleanup.<\/p>\n<p>Outcome: all handed.<\/p>\n<div class=\"figure \" id=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/example-regression-results.png\"><img decoding=\"async\" src=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/example-regression-results.png\" style=\"max-width: 95vw;\" width=\"650\" \/><\/p>\n<p class=\"photoCaption\">Regression Check Outcomes<\/p>\n<\/div>\n<\/section>\n<\/section>\n<section id=\"Step6GenerateUnitTests\">\n<h3>Step 6: generate unit checks<\/h3>\n<p>Useful testing alone is inadequate for strong validation; it<br \/>\n        acts primarily as an auxiliary test and isn&#8217;t factored into code<br \/>\n        protection metrics. The ultimate sign-off on core logic requires<br \/>\n        complete unit checks. At the moment, the SPDD workflow doesn&#8217;t have<br \/>\n        devoted testing instructions finalized (these can be launched in<br \/>\n        future iterations). As an interim answer, we make the most of a<br \/>\n        template-driven method to generate structured prompts for unit<br \/>\n        testing.<\/p>\n<section id=\"GenerateTheInitialTestPrompt\">\n<h4>Generate the preliminary check immediate<\/h4>\n<p>We start by combining the implementation particulars with our<br \/>\n        standardized testing template to generate a baseline check immediate.<\/p>\n<p>Instruction:<\/p>\n<div class=\"prompt\">Based mostly on the implementation particulars immediate<br \/>\n        @GGQPA-001-202603191105-[Feat]-multi-plan-billing-model-aware-pricing.md,<br \/>\n        mixed with the template <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/blob\/after-enhancement\/spdd\/template\/TEST-SCENARIOS-TEMPLATE.md\">@TEST-SCENARIOS-TEMPLATE.md<\/a>, please<br \/>\n        generate a check immediate file.<\/div>\n<\/section>\n<section id=\"DeduplicateAndRefineScenarios\">\n<h4>Deduplicate and refine situations<\/h4>\n<p>After producing the preliminary structured check immediate, a number of the<br \/>\n        proposed check situations have been duplicates of what we already had. To<br \/>\n        deal with this, we continued the dialogue, instructing the AI to<br \/>\n        cross-reference the generated immediate with the present check suite,<br \/>\n        determine the genuinely new situations, and take away any<br \/>\n        redundancies.<\/p>\n<p>Instruction:<\/p>\n<p>@GGQPA-001-202603191105-[Test]-multi-plan-billing-model-aware-pricing.md<br \/>\n        There are checks which can be duplicated with present ones, evaluate the<br \/>\n        related checks that exist, after which solely add checks for brand spanking new<br \/>\n        situations<\/p>\n<p>Up to date artifact: <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/commit\/c910aede947bfeae12eedeff7991b506d2e015db\">the check structured immediate<\/a>.<\/p>\n<\/section>\n<section id=\"GenerateTheUnitTestCode\">\n<h4>Generate the unit check code<\/h4>\n<p>As soon as the refined check situations are reviewed and confirmed, use the<br \/>\n        finalized check immediate to drive the precise code technology.<\/p>\n<p>Instruction:<\/p>\n<p>Based mostly on the generated check immediate<br \/>\n        @GGQPA-001-202603191105-[Test]-multi-plan-billing-model-aware-pricing.md,<br \/>\n        please generate the corresponding unit check code.<\/p>\n<p>Outcome: all checks handed. <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/commit\/6461da90fffcff94ab9e1f57c6fb4476dd122922\">Commit for checks<\/a>.<\/p>\n<\/section>\n<\/section>\n<section id=\"WhatThisExampleDelivered\">\n<h3>What this instance delivered<\/h3>\n<p>This marks the conclusion of a whole SPDD workflow. By means of this<br \/>\n        standardized course of, we efficiently delivered the next key<br \/>\n        outcomes:<\/p>\n<ol>\n<li>A enterprise logic implementation with exceptionally excessive intent<br \/>\n          alignment (~99%).<\/li>\n<li>Full engineering transparency, together with a transparent<br \/>\n          understanding of the implementation path, technical choices, and<br \/>\n          accepted trade-offs.<\/li>\n<li>A structured immediate asset tightly synchronized with the present<br \/>\n          codebase, laying a strong basis for future iterations.<\/li>\n<li>Compounding human experience, fostering a steady accumulation<br \/>\n          of developer expertise and psychological fashions as we iterate<br \/>\n          collaboratively with the AI.<\/li>\n<\/ol>\n<p><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/compare\/before-enhancement...after-enhancement\">View the entire code diff for this enhancement<\/a> on GitHub.<\/p>\n<p>We have additionally ready a bonus enhancement function\u2014<a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/token-billing\/blob\/after-enhancement\/requirements\/%5BUser-story-2%5DEnterprise-Plan-Volume-Based-Tiered-Billing.md\">Enterprise<br \/>\n        Plan Quantity-Based mostly Tiered Billing<\/a>. Should you&#8217;re interested by getting<br \/>\n        some hands-on apply, we extremely encourage you to sort out it utilizing the<br \/>\n        SPDD workflow outlined above.<\/p>\n<\/section>\n<\/section>\n<section id=\"core-skills\">\n<h2>Three core expertise<\/h2>\n<p>SPDD is a fabric change in how builders construct software program. In our work<br \/>\n      now we have recognized three core expertise that they want so as to do their<br \/>\n      work successfully. These expertise mirror the place the worth of builders<br \/>\n      is shifting in an AI-assisted world.<\/p>\n<div class=\"page-list\">\n<div class=\"page-ref\">\n<h3><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/abstraction-first.html\">Abstraction first<\/a><\/h3>\n<p class=\"lede\">design earlier than you generate<\/p>\n<div class=\"problem\">\n<p>Earlier than producing any code, it is advisable to be clear about what objects<br \/>\n          exist, how they collaborate, and the place the boundaries are. With out that,<br \/>\n          AI typically sprints on implementation particulars whereas the construction falls aside.<br \/>\n          Unclear obligations, duplicated logic, inconsistent interfaces, and<br \/>\n          the fee reveals up later in evaluation and rework.<\/p>\n<\/div>\n<p class=\"link\"><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/abstraction-first.html\">learn extra\u2026<\/a><\/p>\n<\/div>\n<div class=\"page-ref\">\n<h3><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/alignment.html\">Alignment<\/a><\/h3>\n<p class=\"lede\">lock intent earlier than you write code<\/p>\n<div class=\"problem\">\n<p>Earlier than implementation, it is advisable to make \u201cwhat we&#8217;ll do \/ what we can&#8217;t<br \/>\n          do\u201d express, and agree on the requirements and laborious constraints up entrance.<br \/>\n          In any other case you find yourself with quick output and gradual rework.<\/p>\n<\/div>\n<p class=\"link\"><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/alignment.html\">learn extra\u2026<\/a><\/p>\n<\/div>\n<div class=\"page-ref\">\n<h3><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/iterative-review.html\">Iterative Evaluation<\/a><\/h3>\n<p class=\"lede\">flip output right into a managed loop<\/p>\n<div class=\"problem\">\n<p>You need AI help to behave like an engineering course of, not a<br \/>\n          one-shot draft. With out a disciplined review-and-iterate loop, groups both<br \/>\n          maintain forcing the mannequin to patch issues till the answer drifts, or they<br \/>\n          restart repeatedly and lose management of value and time.<\/p>\n<\/div>\n<p class=\"link\"><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/martinfowler.com\/articles\/structured-prompt-driven\/iterative-review.html\">learn extra\u2026<\/a><\/p>\n<\/div>\n<\/div>\n<\/section>\n<section id=\"WhereSpddFits\">\n<h2>The place SPDD suits<\/h2>\n<section id=\"FitnessAssessment\">\n<h3>Health evaluation<\/h3>\n<p>SPDD is an engineering funding. The desk under charges how nicely it pays off by state of affairs, from extremely really helpful (5 stars) to not appropriate (1 star).<\/p>\n<table class=\"dark-head\">\n<thead>\n<tr>\n<th>Ranking<\/th>\n<th>Situation<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u2605\u2605\u2605\u2605\u2605<\/td>\n<td>Scaled, standardized supply<\/td>\n<td>Excessive-repeat enterprise logic that wants long-term maintainability (e.g., constructing many comparable APIs, automating core enterprise workflows).<\/td>\n<\/tr>\n<tr>\n<td>\u2605\u2605\u2605\u2605\u2605<\/td>\n<td>Excessive compliance and laborious constraints<\/td>\n<td>Environments the place you need to observe laws, safety requirements, or strict architectural guidelines (e.g., monetary core techniques, multi-channel \/ multi-client deployments).<\/td>\n<\/tr>\n<tr>\n<td>\u2605\u2605\u2605\u2605\u2606<\/td>\n<td>Workforce collaboration and auditability<\/td>\n<td>Multi-person supply the place adjustments have to be absolutely traceable and reviewable end-to-end.<\/td>\n<\/tr>\n<tr>\n<td>\u2605\u2605\u2605\u2605\u2606<\/td>\n<td>Cross-cutting consistency work<\/td>\n<td>Complicated refactors the place logic should keep tightly synchronized throughout a number of microservices or totally different languages.<\/td>\n<\/tr>\n<tr>\n<td>\u2605\u2605\u2606\u2606\u2606<\/td>\n<td>Firefighting hotfixes<\/td>\n<td>\u201cCease the bleeding\u201d manufacturing fixes the place velocity issues greater than architectural self-discipline.<\/td>\n<\/tr>\n<tr>\n<td>\u2605\u2605\u2606\u2606\u2606<\/td>\n<td>Exploratory spikes<\/td>\n<td>When the purpose is to validate an concept rapidly quite than ship production-quality software program, SPDD&#8217;s governance overhead will not pay again.<\/td>\n<\/tr>\n<tr>\n<td>\u2605\u2605\u2606\u2606\u2606<\/td>\n<td>One-off scripts<\/td>\n<td>Disposable knowledge cleanup or non permanent scripts the place SPDD&#8217;s upfront value is just too excessive relative to the worth.<\/td>\n<\/tr>\n<tr>\n<td>\u2605\u2606\u2606\u2606\u2606<\/td>\n<td>Context black holes<\/td>\n<td>When the area is poorly outlined and enterprise guidelines are unclear, you possibly can&#8217;t set significant boundaries for the mannequin.<\/td>\n<\/tr>\n<tr>\n<td>\u2605\u2606\u2606\u2606\u2606<\/td>\n<td>Pure inventive \/ visible work<\/td>\n<td>Duties pushed by style and aesthetics quite than logic (e.g., UI visible exploration, advertising copy).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/section>\n<section id=\"Trade-offsToConsider\">\n<h3>Commerce-offs to contemplate<\/h3>\n<p><b>Return on funding<\/b><\/p>\n<table class=\"dark-head\">\n<thead>\n<tr>\n<th>Profit<\/th>\n<th>Affect<\/th>\n<th>Pace<\/th>\n<th>What you get<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Determinism<\/td>\n<td>Excessive<\/td>\n<td>Quick<\/td>\n<td>Encode logic in a exact spec, which considerably reduces hallucination and \u201cinventive\u201d interpretation.<\/td>\n<\/tr>\n<tr>\n<td>Traceability<\/td>\n<td>Excessive<\/td>\n<td>Quick<\/td>\n<td>Each significant change might be traced again to the structured immediate, closing the audit loop.<\/td>\n<\/tr>\n<tr>\n<td>Quicker opinions<\/td>\n<td>Excessive<\/td>\n<td>Quick-term<\/td>\n<td>Code \u201carrives\u201d nearer to crew requirements, so opinions deal with logic and design, not formatting and cleanup.<\/td>\n<\/tr>\n<tr>\n<td>Explainability<\/td>\n<td>Medium-Excessive<\/td>\n<td>Gradual<\/td>\n<td>Intent and habits are seen on the natural-language degree, decreasing the cognitive load for understanding and upkeep.<\/td>\n<\/tr>\n<tr>\n<td>Safer evolution<\/td>\n<td>Excessive<\/td>\n<td>Lengthy-term<\/td>\n<td>Effectively-defined boundaries and stepwise implementation make focused adjustments lower-risk and simpler to iterate.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>Upfront funding<\/b><\/p>\n<table class=\"dark-head\">\n<thead>\n<tr>\n<th>Space<\/th>\n<th>Barrier<\/th>\n<th>Nature<\/th>\n<th>What it takes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Mindset shift<\/td>\n<td>Excessive<\/td>\n<td>Ongoing coaching<\/td>\n<td>Groups need to adapt to \u201cdesign first\u201d quite than \u201ccode first.\u201d<\/td>\n<\/tr>\n<tr>\n<td>Senior experience up entrance<\/td>\n<td>Medium-Excessive<\/td>\n<td>Per-feature<\/td>\n<td>Engineers who can translate enterprise guidelines into clear abstractions and design constraints.<\/td>\n<\/tr>\n<tr>\n<td>Automation tooling<\/td>\n<td>Medium<\/td>\n<td>Infrastructure setup<\/td>\n<td>With out automation, SPDD hits a throughput ceiling and struggles to maintain prompts constant. <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/gszhangwei\/open-spdd\">openspdd<\/a> runs the workflow on this article\u2014from evaluation and structured REASONS prompts via code and non-obligatory check help\u2014as repeatable CLI steps, so artifacts keep versioned and reviewable as an alternative of trapped in chat. Bigger organizations should layer a information platform on prime to handle and reuse property at scale.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/section>\n<\/section>\n<section id=\"Closing\">\n<h2>Closing<\/h2>\n<p>Through the use of the REASONS Canvas, clarifying intent, establishing the correct<br \/>\n      abstractions, breaking work into concrete duties, and locking in boundaries,<br \/>\n      we give AI a well-defined area to function. Inside that area, SPDD could not<br \/>\n      be the shortest path to \u201cgenerate code rapidly,\u201d but it surely is without doubt one of the most<br \/>\n      dependable methods to ship the correct change with confidence.<\/p>\n<p>It is also honest to say that SPDD shines most in logic-heavy domains.<br \/>\n      In areas pushed by aesthetic judgment, frontend styling, for instance, we&#8217;re<br \/>\n      nonetheless exploring engineering patterns that may be as secure as purely logical<br \/>\n      building.<\/p>\n<p>The framework on this article is just the \u201cstrikes.\u201d The true benefit comes<br \/>\n      from sharpening the meta-skills behind it: abstraction and modelling, systematic<br \/>\n      evaluation, and a deep understanding of the enterprise as an entire. These are the<br \/>\n      human strengths that in the end decide how a lot worth we will get from AI.<\/p>\n<p>Within the AI period, software program growth is not a contest of mannequin IQ. It is a<br \/>\n      contest of engineer cognitive bandwidth \u2013 how clearly we will suppose,<br \/>\n      body issues, and make choices.<\/p>\n<p>We&#8217;ll shut with a quote that captures the spirit<br \/>\n      of SPDD:<\/p>\n<blockquote>\n<p>\u201cIn science, if you realize what you might be doing, you should not be doing it.<br \/>\n        In engineering, if you do not know what you might be doing, you should not be doing it.\u201d<\/p>\n<p class=\"quote-attribution\">&#8212; <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.amazon.com\/gp\/product\/9056995014\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=9056995014&amp;linkCode=as2&amp;tag=martinfowlerc-20\">Richard W. Hamming<\/a><\/p>\n<\/blockquote>\n<\/section>\n<hr class=\"bodySep\" \/>\n<\/div>\n<div>\n<section id=\"Acknowledgements\">\n<h2>Acknowledgements<\/h2>\n<p>We might like to specific our honest due to Martin Fowler. Regardless of a<br \/>\n      busy schedule, he invested deeply on this article \u2014 from sharpening the<br \/>\n      narrative construction and clarifying key ideas, to elevating the visible<br \/>\n      storytelling with improved and new diagrams. His eager eye for element and<br \/>\n      dedication to precision profoundly formed the ultimate outcome.<\/p>\n<p>We&#8217;re additionally deeply grateful to Eric (Ke) Zhou, Wei Solar, Sara Michelazzo,<br \/>\n      Rebecca Parsons, Matteo Vaccari, Might (Ping) Xu, Zhi Wang, Feng Chen and Da Cheng for his or her considerate critique and insights.<br \/>\n      Your enter helped us make clear a number of key ideas that underpin the methodology.<\/p>\n<p>We additionally wish to acknowledge early practitioners: Jie Wang, Jian Gao,<br \/>\n      Yixuan Feng, Siyuan Li, Yixuan Li, Biao Tian, Wei Cheng, Qi Huang, and Yulong<br \/>\n      Li. Thanks for validating SPDD in actual initiatives, and to your endurance<br \/>\n      because the method matured. Your frontline suggestions has been foundational to<br \/>\n      making SPDD sensible and strong.<\/p>\n<p>Lastly, within the spirit of working towards what we preach, this text itself<br \/>\n      was formed with the help of giant language fashions \u2014 Claude 4.5 Sonnet,<br \/>\n      Claude 4.6 Opus, Gemini 3.1 Professional, and ChatGPT 5.4. We relied on them for<br \/>\n      prose refinement, structural evaluation, synthesizing strategies, and as<br \/>\n      thought companions for steady studying all through the writing course of.<br \/>\n      Their contributions are a becoming testomony to the very method this<br \/>\n      article describes.<\/p>\n<\/section>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>As soon as a crew adopts AI coding assistants, the primary beneficial properties present up on the particular person degree: one developer can draft, modify, and refactor code a lot sooner than earlier than. However supply velocity isn&#8217;t restricted by typing. Whenever you have a look at the complete supply lifecycle, from necessities via launch, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":14276,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[237,8862,8861],"class_list":["post-14274","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-development","tag-spdd","tag-structuredpromptdriven"],"_links":{"self":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/14274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14274"}],"version-history":[{"count":1,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/14274\/revisions"}],"predecessor-version":[{"id":14275,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/14274\/revisions\/14275"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/media\/14276"}],"wp:attachment":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- This website is optimized by Airlift. Learn more: https://airlift.net. Template:. Learn more: https://airlift.net. Template: 69d9690a190636c2e0989534. Config Timestamp: 2026-04-10 21:18:02 UTC, Cached Timestamp: 2026-04-30 12:07:45 UTC -->