Spec-Driven Development: the post-vibe-coding playbook

Spec-Driven Development: ה־Playbook שאחרי ה־Vibe-Coding

We walk into an engineering org that adopted Cursor (or Claude Code, or Copilot) eight months ago. Leadership says shipping velocity went up. The engineers say they're miserable. Reviews take twice as long. Tests are inconsistent. Nobody quite remembers why that module was designed the way it was. This is the post-vibe-coding cliff - and the answer isn't to remove the AI. It's to change how the team uses it. Here's the actual playbook.

What vibe-coding is, and why it works for the first 10 PRs

Vibe-coding - the term is a bit unfair but useful - is the pattern where an engineer types a prompt into an AI coding tool, takes the first acceptable output, tweaks it slightly, and merges. It's fast. For small changes on well-understood surfaces, it produces good PRs. Your team's velocity goes up measurably in the first 2–3 months after AI adoption, which is why leadership is excited.

Then velocity flattens. Defect rate creeps up. The senior engineers start complaining that the junior PRs are correct-looking but architecturally inconsistent. The first post-vibe-coding cliff has arrived, and it happens for a structural reason: AI coding tools are optimizers of local quality. They produce plausible, idiomatic code that compiles, passes the visible tests, and matches the surrounding style. They do not maintain architectural coherence across a codebase over time. That's a human job, and if no human is doing it, the codebase accumulates entropy at the speed the AI can generate it.

The core move: specs come first, code second

Spec-Driven Development inverts the prompt-and-commit workflow. Every non-trivial change starts with a written specification - the intent, the constraints, the test cases, the failure modes, the observability it must produce, the migration story if any. The spec is written by a human. The AI reads the spec before generating code. The reviewer compares the output to the spec, not to a vibe.

This sounds slower. It isn't - once the muscle is built. A 20-minute spec trades against three rounds of reviewer ping-pong on a PR where the reviewer and the author never agreed on what the change was supposed to do. Teams that adopt SDD consistently report that review time drops, merge-to-main time drops, and the number of "fix the follow-up" PRs drops. The compounding effect on velocity is visible by week 6–8 after adoption.

What a good spec looks like

We use a lightweight but strict format. Every non-trivial change is a markdown file with the following sections:

  1. Problem. One paragraph: what's broken, why it matters, who it affects. No proposed solution yet.
  2. Constraints. What must be preserved - public API shape, database migrations, performance budgets, compliance posture, backward compatibility. This is the section where scope is defined and defended.
  3. Behavior. What the change does, in prose and in test cases. Cases include at least: happy path, boundary conditions, known failure modes, observability behavior.
  4. Non-goals. What this change is not doing. This section prevents scope creep and gives the reviewer a contract to judge against.
  5. Open questions. What the author doesn't know. If there are more than three, the spec isn't ready; go back to step 1.

This is 150–400 lines of markdown for a meaningful change. It takes 20–60 minutes to write. It reads in 5 minutes. It generates code that reviewers can evaluate against a written standard rather than a taste test.

Evals go in CI - with teeth

For any AI-sensitive code - prompt changes, agent logic, model routing - you need evals in CI. Not vibes. Not "the demo worked." Numeric metrics per commit, with pass/fail gates that block merges if quality regresses.

What we run in CI for every agent-touching PR:

  • Prompt regression. A reference dataset of 100–500 inputs with expected output characteristics. Precision/recall, specific-assertion checks, latency budgets. Any regression above a threshold blocks merge.
  • Cost diff. Average tokens-in / tokens-out per intent, per commit. A change that silently doubles cost is visible before it ships.
  • Audit-trail completeness. For critical paths, we require that every agent decision be reconstructable from logs. This is CI-enforced.
  • Prompt-injection resilience. A small but growing set of adversarial inputs that the agent must refuse or handle safely. Numbers go up over time as we learn new attack patterns.

The hard part is writing the first evals. The compounding value comes from never again shipping a regression on a case you've already caught once.

Review conventions designed around AI-authored PRs

When 50-70% of your PRs are AI-assisted, the review categories need to shift. The traditional "does this compile / do the tests pass / is the style consistent" checklist catches very little of what actually goes wrong in AI-authored code. We add four explicit review categories:

  1. Spec-adherence. Does the PR do what the spec said? Nothing more, nothing less.
  2. Regression risk. What else in the codebase this could plausibly break. The reviewer is required to state this explicitly, not infer.
  3. Prompt-eval delta. If the PR touches any prompt or agent, the eval results from the CI run are surfaced directly in the review.
  4. Observability impact. New logs, new metrics, new audit events - are they present, correctly labeled, and ingested?

These categories are explicit fields in our review template. A PR can't be approved until each is addressed. It's slightly more friction per PR; it's substantially less friction per release, because the post-release firefights go away.

Measure velocity - before and after - with honest numbers

The cheapest way to lose your engineering org's trust is to claim AI made them 3× faster when their reality is that they're working longer hours to clean up AI-generated messes. Measure honestly:

  • Cycle time: first commit to production for a typical PR.
  • Review time: opened-to-merged for a typical PR.
  • Defect density: bugs per 1,000 lines of merged code, normalized against historical baseline.
  • Rework rate: percentage of PRs that require a follow-up PR within 2 weeks.
  • P99 time-to-ship: the slow PRs matter more than the fast ones. A 5× speedup on the easy PRs that coincides with a 2× slowdown on the hard ones is a wash.

Track these from before your AI rollout. Track them after. If the metrics aren't moving in the direction you want, the rollout isn't working - change the playbook, don't retrospectively redefine the metrics.

The cultural program is the hard part

SDD is a social change before it's a technical one. Engineers who have been writing prompts for 6 months without a spec resist the process. The natural response - "I'll just write the spec after the code" - defeats the entire point.

What we've seen work:

  • Workshops, not memos. Two-hour hands-on sessions where the team writes specs for real in-flight work and generates PRs from them. One workshop is worth ten all-hands presentations.
  • Paired transitions. A senior engineer pairs with a junior for the first 5–10 spec-driven PRs, explicitly coaching on the spec itself.
  • Office hours. A weekly slot where anyone can bring a tricky spec for group review. This becomes the cultural forum where shared judgment gets built.
  • Public before/after metrics. The team needs to see that the process is working. Show the numbers on a dashboard everyone can watch.
  • Principal-led defaults. Principal engineers model the behavior first. If the most senior people are still vibe-coding, nobody below them will adopt SDD.

Where SDD doesn't apply

Not every change needs a spec. Documentation typos, a test fixture update, a straightforward rename, a dependency bump - these are legitimate candidates for "just prompt it." The SDD bar kicks in for any change that (a) affects public API shape, (b) touches agent logic or prompts, (c) has multi-file impact, (d) has compliance or security implications, or (e) the author genuinely isn't sure about. We estimate 60-75% of merged PRs at a mature SDD shop have an associated spec; the rest are fine without one.

The results we actually see

At our own engineering org and across the customer teams we've coached into SDD, the pattern is consistent. Six to eight weeks after adoption:

  • Review time per PR drops 20-35%.
  • Defect density drops measurably - typically 25-40% off the pre-SDD baseline.
  • Rework rate drops. PRs that required a same-sprint follow-up fall from 18-25% pre-SDD to 5-10% post-SDD.
  • Engineers report lower cognitive load. They're not holding the architecture in their head all day to compensate for AI drift.
  • New hires onboard faster, because the spec corpus becomes a teaching artifact.

The velocity gains are real but not what leadership was initially told to expect. The headline is not "3× faster." The headline is "same velocity with substantially less debt and substantially happier engineers." Over 12 months, that's the win that actually matters.

If your engineering team is on the cliff

We run Spec-Driven Development on our own product and delivery work - every case study we've shipped (Atlantic Logistics, Brinks, Apollo, Sensei, MAIA, PIBA) was built under SDD discipline. If your team is seeing rising review friction, drift, or just a general sense of "we ship faster but everything feels worse" - book a discovery call. We'll walk your engineering org through a structured SDD readiness assessment, and tell you honestly whether a four-week enablement program will move the numbers or whether something deeper needs to change first.

אנחנו נכנסים לארגון הנדסה שאימץ Cursor (או Claude Code, או Copilot) לפני שמונה חודשים. ההנהלה אומרת שמהירות המשלוח עלתה. המהנדסים אומרים שהם אומללים. Reviews לוקחים פי שניים. בדיקות לא עקביות. אף אחד לא זוכר בדיוק למה המודול הזה עוצב ככה. זה ה־Cliff שאחרי Vibe-Coding - והתשובה אינה להסיר את ה־AI. היא לשנות איך הצוות משתמש בו. הנה ה־Playbook האמיתי.

מה זה Vibe-Coding, ולמה זה עובד ל־10 ה־PRs הראשונים

Vibe-Coding - המונח קצת לא הוגן אבל שימושי - הוא הדפוס שבו מהנדס מקליד Prompt לכלי AI, לוקח את הפלט הראשון הסביר, עושה Tweak קטן, וממזג. זה מהיר. לשינויים קטנים על Surfaces מוכרות, זה מייצר PRs טובים. מהירות הצוות שלכם עולה באופן מדיד בחודשיים-שלושה הראשונים אחרי אימוץ AI - ולכן ההנהלה מתלהבת.

ואז המהירות נשטחת. ה־Defect Rate מטפס. המהנדסים הבכירים מתחילים להתלונן שה־PRs של הזוטרים נראים נכונים אבל אינם עקביים ארכיטקטונית. ה־Cliff הראשון שאחרי Vibe-Coding הגיע, והוא קורה מסיבה מבנית: כלי קוד AI מייעלים איכות מקומית. הם מייצרים קוד סביר, אידיומטי, שמתקמפל, עובר את הבדיקות הנראות ומתאים לסגנון הסובב. הם לא שומרים על קוהרנטיות ארכיטקטונית על פני Codebase לאורך זמן. זו עבודה אנושית, ואם אף אדם לא עושה אותה - ה־Codebase צובר אנטרופיה במהירות שה־AI יכול לייצר.

המהלך המרכזי: מפרטים קודם, קוד אחר כך

Spec-Driven Development הופך את Workflow ה־Prompt-and-Commit. כל שינוי לא־טריוויאלי מתחיל במפרט כתוב - הכוונה, האילוצים, מקרי הבדיקה, מצבי הכשל, ה־Observability שחייב לייצר, סיפור ההגירה אם יש. המפרט נכתב על ידי אדם. ה־AI קורא את המפרט לפני שהוא מייצר קוד. ה־Reviewer משווה את הפלט למפרט, לא לתחושה.

זה נשמע איטי. זה לא - ברגע שהשריר נבנה. מפרט של 20 דקות נסחר מול שלושה סיבובי Ping-Pong של Reviewer על PR שבו ה־Reviewer והכותב אף פעם לא הסכימו מה השינוי אמור לעשות. צוותים שמאמצים SDD מדווחים באופן עקבי שזמן ה־Review יורד, זמן ה־Merge-to-Main יורד, ומספר ה־PRs של ״תיקון המשך״ יורד. האפקט המצטבר על המהירות נראה בשבוע 6–8 אחרי האימוץ.

איך נראה מפרט טוב

אנחנו משתמשים בפורמט קל אך קפדני. כל שינוי לא־טריוויאלי הוא קובץ Markdown עם הסעיפים הבאים:

  1. בעיה. פסקה אחת: מה שבור, למה זה חשוב, את מי זה משפיע. עוד לא הצעת פתרון.
  2. אילוצים. מה חייב להישמר - צורת API פומבי, מיגרציות DB, תקציבי ביצועים, עמדת ציות, תאימות לאחור. זה הסעיף שבו Scope מוגדר ומוגן.
  3. התנהגות. מה השינוי עושה, בפרוזה ובמקרי בדיקה. המקרים כוללים לפחות: Happy Path, תנאי גבול, מצבי כשל ידועים, התנהגות Observability.
  4. לא־מטרות. מה השינוי הזה לא עושה. הסעיף הזה מונע Scope Creep ונותן ל־Reviewer חוזה לשפוט עליו.
  5. שאלות פתוחות. מה הכותב לא יודע. אם יש יותר משלוש, המפרט לא מוכן; חזרו לשלב 1.

זה 150–400 שורות של Markdown לשינוי משמעותי. כתיבה: 20–60 דקות. קריאה: 5 דקות. מייצר קוד ש־Reviewers יכולים להעריך מול תקן כתוב במקום מבחן טעם.

Evals ב־CI - עם שיניים

לכל קוד רגיש ל־AI - שינויי Prompt, לוגיקת סוכן, ניתוב מודלים - אתם צריכים Evals ב־CI. לא תחושות. לא ״הדמו עבד״. Metrics מספריים לכל Commit, עם שערי Pass/Fail שחוסמים Merges אם איכות נסוגה.

מה שאנחנו מריצים ב־CI לכל PR שנוגע בסוכן:

  • רגרסיית Prompt. Dataset ייחוס של 100–500 קלטים עם מאפייני פלט צפויים. Precision/Recall, בדיקות טענות ספציפיות, תקציבי Latency. כל רגרסיה מעל סף חוסמת Merge.
  • Diff עלות. ממוצע Tokens-In / Tokens-Out לכל כוונה, לכל Commit. שינוי שמכפיל עלות בשקט גלוי לפני שנשלח.
  • שלמות Audit Trail. למסלולים קריטיים, אנחנו דורשים שכל החלטת סוכן תהיה ניתנת לשחזור מ־Logs. זה נאכף ב־CI.
  • חוסן ל־Prompt Injection. סט קטן אך גדל של קלטים אדברסריים שהסוכן חייב לסרב להם או לטפל בהם בבטחה. המספרים עולים עם הזמן כשאנחנו לומדים דפוסי התקפה חדשים.

החלק הקשה הוא לכתוב את ה־Evals הראשונים. הערך המצטבר בא מלעולם לא לשלח שוב רגרסיה על Case שכבר תפסתם פעם.

מוסכמות Review שנבנו סביב PRs שנכתבו ב־AI

כש־50-70% מה־PRs מסייעי־AI, קטגוריות ה־Review צריכות לזוז. ה־Checklist המסורתית ״האם זה מתקמפל / הבדיקות עוברות / הסגנון עקבי״ תופסת מעט מאוד ממה שבאמת משתבש בקוד AI. אנחנו מוסיפים ארבע קטגוריות Review מפורשות:

  1. עמידה במפרט. האם ה־PR עושה מה שהמפרט אמר? לא יותר, לא פחות.
  2. סיכון רגרסיה. מה עוד ב־Codebase זה יכול באופן סביר לשבור. ה־Reviewer נדרש להצהיר על זה מפורשות, לא להסיק.
  3. Delta של Prompt Eval. אם ה־PR נוגע ב־Prompt או בסוכן, תוצאות ה־Eval מהריצה ב־CI מופיעות ישירות ב־Review.
  4. השפעה על Observability. Logs חדשים, Metrics חדשים, אירועי Audit חדשים - האם הם נוכחים, מתויגים נכון, וקולטו?

הקטגוריות האלה הן שדות מפורשים בתבנית ה־Review שלנו. אי אפשר לאשר PR עד שכל אחת מטופלת. זה חיכוך קל יותר ל־PR; זה חיכוך משמעותית פחות לכל Release, כי כיבוי שריפות שאחרי Release נעלם.

מדדו מהירות - לפני ואחרי - עם מספרים ישרים

הדרך הזולה ביותר לאבד אמון של ארגון ההנדסה היא לטעון ש־AI הפך אותם למהירים פי 3 כשהמציאות היא שהם עובדים שעות ארוכות יותר כדי לנקות בלגנים שנוצרו ב־AI. מדדו ישרות:

  • Cycle Time: Commit ראשון לפרודקשן ל־PR טיפוסי.
  • Review Time: Opened-to-Merged ל־PR טיפוסי.
  • Defect Density: באגים ל־1,000 שורות קוד ממוזג, מנורמל מול Baseline היסטורי.
  • Rework Rate: אחוז ה־PRs שדורשים PR המשך תוך שבועיים.
  • p99 Time-to-Ship: ה־PRs האיטיים חשובים יותר מהמהירים. האצה של פי 5 על PRs קלים שמתלוה להאטה של פי 2 על קשים - שווה אפס.

עקבו אחרי אלה מלפני ה־Rollout של ה־AI. עקבו אחרי אלה אחרי. אם ה־Metrics לא זזים בכיוון שאתם רוצים, ה־Rollout לא עובד - שנו את ה־Playbook, אל תגדירו מחדש את ה־Metrics בדיעבד.

התוכנית התרבותית היא החלק הקשה

SDD הוא שינוי חברתי לפני שהוא טכני. מהנדסים שכתבו Prompts במשך 6 חודשים בלי מפרט מתנגדים לתהליך. התגובה הטבעית - ״אני פשוט אכתוב את המפרט אחרי הקוד״ - מבטלת את כל הפואנטה.

מה שראינו שעובד:

  • סדנאות, לא Memos. סשנים מעשיים של שעתיים שבהם הצוות כותב מפרטים לעבודה אמיתית ומייצר PRs מהם. סדנה אחת שווה עשר מצגות All-Hands.
  • מעברים ב־Pairing. מהנדס בכיר מתאם עם זוטר ל־5–10 ה־PRs הראשונים מבוססי־מפרט, מלמד מפורשות על המפרט עצמו.
  • Office Hours. חלון שבועי שבו כל אחד יכול להביא מפרט מורכב לסקירה קבוצתית. זה הופך לפורום התרבותי שבו שיקול דעת משותף נבנה.
  • Metrics של לפני/אחרי בפומבי. הצוות צריך לראות שהתהליך עובד. הראו את המספרים על Dashboard שכולם יכולים לראות.
  • ברירות מחדל בהובלת Principals. Principal Engineers מדגימים התנהגות ראשונים. אם האנשים הכי בכירים עדיין עושים Vibe-Coding - אף אחד מתחתיהם לא יאמץ SDD.

איפה SDD לא חל

לא כל שינוי צריך מפרט. שגיאות תיעוד, עדכון Fixture של בדיקות, Rename פשוט, העלאת תלות - אלה מועמדים לגיטימיים ל־״פשוט תן Prompt״. רף ה־SDD נכנס לכל שינוי ש־(א) משפיע על צורת API פומבי, (ב) נוגע בלוגיקת סוכן או Prompts, (ג) משפיע על מספר קבצים, (ד) יש לו השלכות ציות או אבטחה, או (ה) הכותב באמת לא בטוח. אנחנו מעריכים ש־60-75% מה־PRs הממוזגים בסדנה SDD בוגרת יש להם מפרט; השאר בסדר בלי.

התוצאות שאנחנו באמת רואים

בארגון ההנדסה שלנו ובצוותי הלקוחות שאימנו ל־SDD, הדפוס עקבי. שישה עד שמונה שבועות אחרי אימוץ:

  • זמן Review ל־PR יורד ב־20-35%.
  • Defect Density יורד באופן מדיד - בדרך כלל 25-40% מ־Baseline טרם־SDD.
  • Rework Rate יורד. PRs שדרשו המשך באותו Sprint יורדים מ־18-25% טרם־SDD ל־5-10% אחרי.
  • המהנדסים מדווחים על עומס קוגניטיבי נמוך יותר. הם לא מחזיקים את הארכיטקטורה בראש כל היום כדי לפצות על Drift של ה־AI.
  • גיוסים חדשים נקלטים מהר יותר, כי קורפוס המפרטים הופך לחפץ הוראה.

רווחי המהירות אמיתיים אבל לא מה שההנהלה ציפתה לו בהתחלה. הכותרת היא לא ״פי 3 מהיר יותר״. הכותרת היא ״אותה מהירות עם משמעותית פחות חוב ומהנדסים משמעותית יותר מרוצים.״ על פני 12 חודשים - זה הניצחון שבאמת חשוב.

אם צוות ההנדסה שלכם ב־Cliff

אנחנו מפעילים Spec-Driven Development על עבודת המוצר והמשלוח של עצמנו - כל Case Study ששלחנו (Atlantic Logistics, Brinks, Apollo, Sensei, MAIA, PIBA) נבנה תחת משמעת SDD. אם הצוות שלכם רואה עלייה בחיכוך Review, Drift, או סתם תחושה כללית של ״אנחנו משלחים מהר יותר אבל הכל מרגיש גרוע יותר״ - קבעו שיחת היכרות. נעבור את ארגון ההנדסה שלכם על הערכת מוכנות SDD מובנית, ונאמר בכנות אם תוכנית הטמעה של ארבעה שבועות תזיז את המספרים, או אם משהו עמוק יותר צריך להשתנות קודם.

Want more operator-grade notes?

רוצים עוד פתקים ברמת מפעיל?

Book a discovery call. We exchange architecture diagrams, not decks.

לקביעת שיחה - אנחנו מחליפים ארכיטקטורה, לא מצגות.