Explore
WEBSTER / SOFTWARE ENGINEERING← Senior DeveloperEducational reference · continually evolving

Chapter 03 / 15 · Webster International

Vibe Coding & Prompt Engineering

From idea to reliable app: AI-assisted coding workflows, prompt recipes, context files, debugging, agent safety, evaluation and a reusable prompt lab.

← Complete index

The big idea

Use natural language to accelerate software creation, without surrendering the responsibilities of engineering. Learn when to explore freely, when to constrain an agent, and how to turn a good prompt into working, testable, secure and maintainable software.

01 · Orientation

01 / FIELD NOTE

What is vibe coding—and where does engineering begin?

Mental model: AI proposes candidate artifacts; the engineer owns the evidence chain requirement → diff → tests → reviewed commit → deployed commit → observed behaviour. A screenshot, a passing mock and a verified booking system are distinct outcomes. Label experiments as experiments and reserve LIVE for independently verified behaviour.

Why it matters

A compelling prototype may hide missing persistence, permission checks or operations. Explicit evidence states keep design exploration from becoming an accidental release claim.

In practice

Example A: a fictional music-directory card is a DEMO until source and image rights are checked. Example B: a dog-booking form looks finished but refresh loses the booking; it is NOT LIVE until tenant permissions and durable events are verified.

Runnable JavaScript · expected: DRAFT: not live
// Runnable JavaScript: a release claim needs evidence.
const live=x=>x.tests==='PASS'&&x.browser&&x.deployed===x.reviewed&&x.approved;
const draft={tests:'PASS',browser:false,deployed:'abc',reviewed:'abc',approved:false};
if(live(draft))throw Error('unsafe release');
console.log('DRAFT: not live');
Hands-on exercise · reveal the verification check
Try it

Build an evidence ledger for a demo artist card and a real client booking: list reviewed SHA, tests, persistence, accessibility, deployment and approval.

Check your result

Both remain DRAFT when evidence is missing. The booking requires a persisted event, tenant check, real browser check and approved deployment; a screenshot never suffices.

02 / FIELD NOTE

Three operating modes: explore, pair and delegate

Mental model: autonomy is a bounded risk budget. Explore produces disposable options; pair changes a small diff under immediate inspection; delegate uses narrowly scoped tools and returns a reviewable patch. Tool permissions, environment isolation and approval must be enforced independently of prompts.

Why it matters

An agent safe for visual mockups may cause irreversible customer-data changes if given unrestricted database or deployment tools.

In practice

Example A: explore three calendar layouts with synthetic events. Example B: delegate a read-only repo audit and fixture update but reserve production migrations and billing deployment for explicit human approval.

Runnable JavaScript · illustrative policy
// Runnable JavaScript: illustrative policy, not real authorization.
const permissions={explore:['read','draft'],pair:['read','draft','edit','test'],delegate:['read','draft','edit','test','open-pr']};
const allow=(mode,action)=>permissions[mode]?.includes(action)===true;
if(allow('delegate','deploy')||!allow('pair','test'))throw Error('bad policy');
console.log('deployment requires separate approval');
Hands-on exercise · reveal the verification check
Try it

Classify screenshot comparison, a fixture edit, customer-table deletion and billing deployment by safe agent mode and required permission.

Check your result

Screenshots are low-risk exploration; isolated fixtures may be delegated; destructive database operations and production deployment require explicit external authorization.

03 / FIELD NOTE

The complete loop: discover → define → design → build → verify → stage → observe

Mental model: discovery maps dependencies and delivery advances through explicit states: DISCOVERED → DEFINED → BUILT → TESTED → STAGED → VERIFIED. Each transition requires new evidence; a plausible progress report cannot substitute for actual tests, environment identity or server SHA.

Why it matters

Skipping dependency discovery produces duplicate calendars and misleading completion claims; skipped environment checks conceal runtime failures.

In practice

Example A: find the existing events table and calendar API before adding filters. Example B: verify artist album links after refresh and confirm the deployed SHA matches the reviewed commit.

Runnable JavaScript · expected: TESTED
// Runnable JavaScript: fail-closed delivery states.
const next={DISCOVERED:'DEFINED',DEFINED:'BUILT',BUILT:'TESTED',TESTED:'STAGED',STAGED:'VERIFIED'};
const advance=(state,hasEvidence)=>hasEvidence?next[state]||state:state;
let state=advance('BUILT',false);
if(state!=='BUILT')throw Error('phantom test');
state=advance(state,true);
console.log(state); // TESTED, not VERIFIED
Hands-on exercise · reveal the verification check
Try it

Trace a CRM booking UI → API → SQLite → refresh and define evidence plus rollback for BUILT, TESTED, STAGED and VERIFIED.

Check your result

Unit tests can establish TESTED; STAGED needs a deployment record; VERIFIED requires the actual SHA, HTTP status and browser check. Unknown is NOT VERIFIED.

02 · Writing prompts

04 / FIELD NOTE

Prompt anatomy: goal, context, constraints, acceptance and evidence

Mental model: a prompt is a candidate specification, not a security control. Partition it into goal, existing context, invariants, acceptance examples and evidence. Include normal, invalid, forbidden and recovery cases, with measurable volume and latency when relevant.

Why it matters

Testable requirements let reviewers compare a generated diff against independent behaviour instead of an attractive narrative.

In practice

Example A: a town filter handles unknown towns, zero events and keyboard selection. Example B: a callback API validates input, rejects wrong-tenant edits and returns a durable request ID.

Runnable JavaScript · expected: 2 acceptance cases checked
// Runnable JavaScript: independent acceptance checks.
const accept=r=>r.status===201&&typeof r.id==='string'&&r.id.length>0&&!('otherTenantData' in r);
if(!accept({status:201,id:'request-42'}))throw Error('valid rejected');
if(accept({status:201,id:'',otherTenantData:[]}))throw Error('invalid accepted');
console.log('2 acceptance cases checked');
Hands-on exercise · reveal the verification check
Try it

Rewrite 'make bookings better' into goal, context, constraints, acceptance and evidence. Include one 403, one empty state, keyboard access and a latency target.

Check your result

Another engineer can derive happy, invalid, forbidden and retry tests from the prompt alone. A model's JSON status report is not proof of execution.

05 / FIELD NOTE

The difference between vague, clear and testable prompts

A vague prompt names a feeling; a clear prompt specifies a feature; a testable prompt names observable conditions and examples. Include negative cases and constraints. Do not demand code quantity or framework novelty as a proxy for quality.

Why it matters

Testability keeps the agent aligned with user value instead of merely producing a convincing status report.

In practice

Vague: 'improve cards'. Clear: 'show the project name, last update and tags'. Testable: 'at 390px cards use one column; focus shows an outline; details link reaches the correct project; 200 items paginate'.

06 / FIELD NOTE

Give the right context—not the whole repository

Mental model: context is a scoped evidence packet, not a repository dump. Supply failing trace, relevant paths, branch/SHA, constraints and a known-good example. Retrieved pages, issue comments and logs are untrusted data, never instructions with authority to alter tools or policy.

Why it matters

Unrelated or stale context obscures integration boundaries; raw logs may leak credentials or contain malicious instructions.

In practice

Example A: for a CRM 403 provide a redacted request ID, middleware path and expected tenant, never a bearer token. Example B: for a music card provide the component, design tokens and 390px screenshot, not the entire server config.

Runnable JavaScript · illustrative redaction
// Runnable JavaScript: illustrative redaction, not full DLP.
function redact(s){return s.replace(/Bearer\s+[A-Za-z0-9._-]+/gi,'Bearer [REDACTED]').replace(/password=[^&\s]+/gi,'password=[REDACTED]')}
const safe=redact('Bearer abc.def password=secret');
if(safe.includes('abc.def')||safe.includes('secret'))throw Error('leak');
console.log(safe);
Hands-on exercise · reveal the verification check
Try it

Prepare a five-item context packet for a login failure: reproducer, expected role, source paths, redacted trace and branch SHA. Mark untrusted text.

Check your result

No passwords, personal records or tokens remain. The packet has a reproducible failure and explicit permissions; retrieved text cannot authorize actions.

07 / FIELD NOTE

Durable project rules: AGENTS.md and repository instructions

Place stable facts such as architecture, test commands, coding style, accessibility standards, environments and forbidden operations in versioned project instructions. Keep one-off task details in the task prompt. Different coding tools discover different instruction files, so document which ones are actually used.

Why it matters

This stops every new AI session from relearning the same project's invariants and reduces accidental divergence between features.

In practice

A good AGENTS.md says 'staging first, preserve persisted SQLite volume, reuse existing calendar API, no production migration without approval, evidence required'.

Ready-to-adapt prompt
# Project working agreement
- Inspect existing features and docs before new files.
- Reuse /api/events and existing auth/tenant guards.
- Preserve the persistent database volume and customer data.
- Test happy, empty, error, keyboard and permission paths.
- Stage only; no production deployment without approval.
- Report commands, outputs, changed files, and unresolved risk.

08 / FIELD NOTE

Ask for a plan before an irreversible change

Use a read-only discovery pass to find ownership boundaries, migrations, dependencies and likely breakpoints. Request a concise implementation plan with acceptance cases and alternative options. Plans are particularly valuable when the request is broad or the system is unfamiliar.

Why it matters

An agent may confidently generate an elegant solution that duplicates an existing feature or assumes nonexistent schema.

In practice

Before changing a CRM, request an inventory of the tenant model, current auth checks, database migration plan and rollback. Confirm the risk before modifying data.

Ready-to-adapt prompt
Investigate this change WITHOUT editing anything yet:
- Trace the user action from page to API to storage.
- Locate existing components I should reuse.
- Identify tests, dependencies and source of truth.
- List data/security/accessibility risks.
- Recommend the smallest three implementation steps.
- Explain how each will be verified and rolled back.

09 / FIELD NOTE

Few-shot examples, structured output and schemas

An example input and expected output can clarify style or unusual edge cases. Ask for structured result fields when another program will parse an answer. Treat generated JSON as untrusted until it passes a schema validator and business rules.

Why it matters

Models can produce plausible-but-incompatible objects; executable validation converts a fuzzy contract into a real boundary.

In practice

Request an issue report with title, severity, affected file, steps, expected/actual and verified source; reject any result without valid enum values.

Ready-to-adapt prompt
Return ONLY JSON with:
{
  "summary": "one sentence",
  "changed_files": ["relative/path"],
  "test_results": [{"command":"...", "status":"PASS|FAIL|NOT_RUN"}],
  "known_gaps": ["..."],
  "deployment_verified": false
}
Do not claim a status without evidence.

10 / FIELD NOTE

Prompt chaining, checkpoints and context resets

Split long work into bounded tasks with saved artifacts: a discovery note, accepted requirements, small commits, a test report and a handoff summary. Re-open actual repository files when a fresh context starts. Chain outputs only after checking them; don't endlessly ask a model to build upon its own unverified prose.

Why it matters

Context windows are finite and earlier claims can drift; external state such as Git commits is more durable than conversation memory.

In practice

After finishing an artist-profile API, save endpoint schemas and test fixtures before asking another agent to build the UI.

03 · Building products

11 / FIELD NOTE

The implementation prompt for a complete vertical slice

Ask for one real user journey crossing UI, API, validation and database rather than a fake screen. Name the source of truth, role rules, loading/empty/error states and boundaries. Make explicit whether seed fixtures are acceptable or a real data-backed feature is needed.

Why it matters

A beautiful frontend connected to a static array is a demonstration, not a completed application.

In practice

Implement artist search with a real paginated GET endpoint, SQL index, loading indicator, empty results, invalid-query handling and accessible keyboard flow.

Illustrative agent prompt · not executable
Implement ONE production-shaped vertical slice:
USER: A visitor filters upcoming concerts by artist and town.
READ: Use the existing event database and authorised read API.
UI: Responsive list, keyboard filters, loading/empty/error states.
API: Validate query, paginate, cache public results safely.
TEST: Unit filter logic, database integration, browser journey.
BOUNDARY: Do not add duplicate JSON fixtures or new event tables.
OUTPUT: Diff summary, evidence, staging steps, unresolved gaps.

12 / FIELD NOTE

Vibe coding visual interfaces without breaking UX

Use screenshots or references to express hierarchy, spacing, density and aesthetic direction. Specify purpose and accessibility: keyboard focus, semantic HTML, touch targets, mobile layout and reduced motion. Ask the agent to adapt existing design tokens instead of recreating a design system each prompt.

Why it matters

Visual iteration is fast with AI, but hidden buttons, non-semantic controls and decorative overload create real user friction.

In practice

Prompt 'make the musicians dashboard denser' with exact contents per card, screen sizes and how filtering works, then manually inspect the rendered page.

Ready-to-adapt prompt
Build a modern responsive artist detail view.
Desktop: full-width hero, album covers, event rail, video shelf.
Mobile: one-column detail; visible previous/next controls.
Use existing tokens and data. No autoplay videos.
Keyboard: focus visible; cards have semantic links/buttons.
Include loading, missing-image, offline and empty states.
Show screenshots at 390px and 1440px if tools permit.

13 / FIELD NOTE

Ask for API design instead of just an endpoint

Define resource paths, verbs, status codes, input validation, response shapes, pagination, ownership and idempotency. Require a concrete request-response example and negative tests. API contracts outlive any single page and are often reused by mobile clients.

Why it matters

This catches the situations where a generated function returns data but fails under bad inputs, concurrent requests or unauthorised callers.

In practice

For POST /projects/{id}/events require tenant ownership, validated timestamp, duplicate policy and a 201 response with durable event ID.

14 / FIELD NOTE

Generate database changes cautiously

Prompt for the existing schema, expected migration, reversible sequence, handling of old rows, backup requirements and concurrency. Separate code generation from running migrations on valuable data. Test against a disposable database before staging.

Why it matters

A database migration affects durable information that cannot be re-generated like UI components.

In practice

If adding album cover metadata, request an additive column, backfill plan, validation query and safe rollout that preserves old album rows.

15 / FIELD NOTE

Debugging prompts: demand a reproducer, not guesses

Provide the exact error, environment, recent changes, expected output and reproduction steps. Ask for a small number of ranked hypotheses, what observation distinguishes them, and the smallest safe fix. Then request a regression test.

Why it matters

This moves AI from speculative code spraying to falsifiable diagnosis.

In practice

For a GPU-related crash or failing browser request, start with the relevant event/error record, version and reproducible conditions before changing settings or code.

Illustrative agent prompt · not executable
BUG: Calendar event links sometimes do nothing on mobile.
OBSERVED: Tap has no navigation at 390px width.
EXPECTED: Event opens its source details.
INVESTIGATE: Inspect hit testing, overlay, event listeners
and hrefs. Reproduce before editing.
CHANGE: Fix minimum viable root cause, not whole component.
VERIFY: Mobile tap, keyboard Enter, desktop click and no JS errors.
REPORT: Actual evidence; say NOT RUN if tools unavailable.

04 · Trust, safety & quality

16 / FIELD NOTE

Testing prompts that can actually fail

Mental model: tests are independent falsifiers, not snapshots that bless whatever code an agent wrote. Define happy, invalid, forbidden, duplicate, concurrent and recovery cases before implementation. Test pure rules, persistent API boundaries and real browser behaviour at the appropriate layers.

Why it matters

Shallow mocks can all pass while users experience double-bookings, lost state, wrong-tenant access or unusable keyboard controls.

In practice

Example A: two customers request the final appointment; one succeeds, one gets a conflict. Example B: a concert calendar with zero events announces a clear empty state rather than spinning forever.

Runnable JavaScript · expected: 2 boundary cases passed
// Runnable JavaScript: a tenant-boundary regression check.
const canEdit=(actor,record)=>actor.tenant===record.tenant;
const actor={tenant:'A'};
for(const [record,want] of [[{tenant:'A'},true],[{tenant:'B'},false]]){
 if(canEdit(actor,record)!==want)throw Error('tenant boundary');
}
console.log('2 boundary cases passed');
Hands-on exercise · reveal the verification check
Try it

Create a six-row booking API test matrix: valid, missing time, wrong tenant, duplicate, concurrent last slot, and retry after timeout. Identify integration tests.

Check your result

Expected results: 201, 400, 403, idempotent retry, one winner plus conflict, and no double booking after timeout. Persistence/concurrency need a real test database.

17 / FIELD NOTE

Code review prompts: explain the diff and risk

Ask the agent to review changed lines for logic errors, missing error handling, data races, auth bypass, privacy leaks, duplicated features, unexpected dependency updates and performance regressions. Pair that with human review of business rules.

Why it matters

An AI-generated PR can compile yet introduce a breach or high ongoing maintenance cost.

In practice

Review a new staff portal for cross-tenant object access and personal data in logs, then check each claim against the actual handler and query.

Ready-to-adapt prompt
Review this PR as a skeptical senior engineer.
Prioritise: correctness, authorisation, data loss, secrets,
regressions, accessibility, unbounded costs and recovery.
For EACH finding: file/line, trigger, impact, evidence,
smallest fix, test that would catch it.
Separate verified findings from suspicions. No invented files.

18 / FIELD NOTE

Prompt injection and the untrusted-tool boundary

Mental model: instructions and retrieved data occupy different trust levels. Webpages, repository comments and tool responses can supply facts but cannot grant privileges. Privileged operations require independent allowlists, server-side permissions and human approval when destructive; prompt wording alone does not defeat injection.

Why it matters

An agent reading a malicious README could be tricked into using a secret or deployment tool as a confused deputy.

In practice

Example A: an artist bio instructs the agent to export credentials; treat it as content only. Example B: a PR comment requests execution of fork code under privileged pull_request_target; do not run untrusted code with secrets.

Runnable JavaScript · illustrative server-side policy
// Runnable JavaScript: illustrative tool boundary, not an injection cure.
const allowed=new Set(['read-doc','summarize','open-draft-pr']);
const authorize=(source,action)=>source==='trusted-user'&&allowed.has(action);
if(authorize('retrieved-webpage','deploy'))throw Error('trust boundary crossed');
console.log('untrusted deploy blocked');
Hands-on exercise · reveal the verification check
Try it

Threat-model an agent reading a third-party README with PR-writing tools. Add a fake privileged-workflow instruction to a fixture and specify denial/audit behaviour.

Check your result

README text remains data, no privileged execution occurs, and audit records rejected action plus untrusted origin. 'Ignore injection' prompting alone is insufficient.

19 / FIELD NOTE

Secrets, privacy, licensing and generated dependencies

Keep API keys in server-side secret management, redact tokens and private user records before sharing context, and check AI-generated code for unsafe dependencies and licence constraints. Record the source and permission for third-party text and images. Review package additions before installation.

Why it matters

One leaked credential or malicious package can outweigh time saved on the entire feature.

In practice

Ask an agent to use a mocked payment provider in tests rather than copying live credentials into a prompt or client bundle.

20 / FIELD NOTE

Stop hallucinated implementations and phantom deployments

Require the agent to distinguish proposed, coded, committed, built, staged, browser-verified and production-verified states. Ask it to read logs, inspect changed files, verify source data, test URLs and say when it cannot perform a check.

Why it matters

An enthusiastic narrative of progress cannot substitute for a correct deployment or evidence that a feature works.

In practice

After 'build the jazz artist showcase', verify that the artist list comes from the expected database, image paths resolve and actual embeds play.

Ready-to-adapt prompt
Release evidence required:
[ ] Exact files and commit SHA
[ ] Build result and error output
[ ] Unit/integration/browser test status
[ ] Actual target environment and running release
[ ] Real data flow (not only fixtures)
[ ] Mobile/keyboard/error-state checks
[ ] Database backup/rollback if changed
[ ] Remaining blockers explicitly labelled
Never convert NOT RUN into PASS.

05 · Working with agents

21 / FIELD NOTE

Autonomy, permissions, tools and MCP connections

Coding agents may use terminal, browser, GitHub, databases and other connectors. Define which tools may read, write, deploy or communicate externally, and require checkpoints around irreversible operations. Connect only relevant services and minimise credential scope.

Why it matters

Adding tools expands capability and attack surface at the same time.

In practice

An event-research agent can browse trusted calendars and draft SQL import candidates but cannot alter billing or send marketing emails.

22 / FIELD NOTE

Multi-agent delegation without conflicting changes

Give each specialised agent an independent, well-bounded task and integration contract: researcher collects sources, frontend engineer implements presentation, reviewer checks risk. Merge their outputs through one responsible owner with tests rather than letting agents write the same files concurrently.

Why it matters

Parallelism is useful when work can be divided cleanly; it adds reconciliation costs when shared state and assumptions overlap.

In practice

One worker gathers jazz-artist source URLs; another improves an existing card component using stable fixture schema; a coordinator validates provenance and merges one tested change.

23 / FIELD NOTE

Model choice, context budgets, latency and money

Use a capable model for complex architecture or incident analysis, and cheaper/faster approaches for mechanical transforms where output can be validated. Prefer retrieval and explicit context over repeating massive transcripts. Track model costs, retries, tool executions and long-running sessions.

Why it matters

A cheap model used with excellent tests may beat an expensive model used without feedback—and the reverse can be true for hard problems.

In practice

Use code search for locating components; reserve high-effort reasoning for migration design; use deterministic scripts for bulk data conversion.

24 / FIELD NOTE

Evaluating prompts with cases instead of opinions

Mental model: prompt quality is a distribution over a fixed case set, not one impressive demo. Freeze representative expected outputs; score correctness and safety separately; rerun after prompt/model/tool changes. Keep held-out cases and record version, latency, cost and failure IDs.

Why it matters

A revision can improve normal outputs while worsening tenant isolation, source uncertainty or honest deployment reporting.

In practice

Example A: evaluate booking prompts with missing addresses and wrong tenants; invented pins fail. Example B: evaluate ambiguous jazz-artist names; unsupported album claims fail even when formatted perfectly.

Runnable JavaScript · expected: 2/3 pass; do not release
// Runnable JavaScript: transparent deterministic evaluation.
const cases=[['REJECT','REJECT'],['NO_ADDRESS','NO_ADDRESS'],['FABRICATED','UNKNOWN']];
const pass=cases.filter(([actual,expected])=>actual===expected).length;
if(pass!==2)throw Error('grader mismatch');
console.log('2/3 pass; do not release');
Hands-on exercise · reveal the verification check
Try it

Write 12 evaluation cases for booking or artist enrichment: four normal, four invalid/boundary, two injection and two source-uncertainty cases. Compare baseline and candidate.

Check your result

Each case has an independent expected result; unauthorized actions and fabricated sources fail. Report sample size, failure IDs, latency and cost; no release claim from one demo.

06 · Practice & mastery

25 / FIELD NOTE

Real-world prompt library: five jobs to practice

Progress through a ladder of increasingly demanding exercises: explain a confusing module, add a tested UI behaviour, fix a reproducible bug, extend an API with strict auth, then build a complete user journey across database and browser. For each exercise request discovery, an acceptance test and an evidence report.

Why it matters

A ladder forces you to learn where AI is strong and where exact specifications or domain knowledge still matter.

In practice

Practice on a weather widget, project cards, music event importer, invoice permissions and a database-backed full-screen calendar; compare the output to independent acceptance checks.

Ready-to-adapt prompt
PRACTICE: Pick one existing app feature.
1. Explain its data flow with filenames; no edits.
2. Describe one user-facing defect and expected result.
3. Write a failing regression test.
4. Implement the smallest correction.
5. Run tests, inspect diff and manual keyboard flow.
6. Commit with clear scope and report any NOT RUN.
7. Propose one measurable follow-up improvement.

26 / FIELD NOTE

A reusable senior-engineer master prompt

Use this template for real changes: it balances a clear objective with discovery, existing architecture, evidence and controlled deployment. Replace placeholders with concrete values; remove irrelevant instructions rather than sending a wall of boilerplate.

Why it matters

The most effective prompt is a contract about the result, boundaries and proof—not a demand for the model to be clever.

In practice

Adapt the template for a calendar improvement by filling in the actual routes, business rules, user experience, permissions and browser checks.

Ready-to-adapt prompt
ROLE: Work as a careful senior software engineer.
GOAL: <observable user outcome>
CONTEXT: <repo/branch, routes, relevant files, source of truth>
RULES: Reuse existing architecture; protect data; ensure
security, WCAG/keyboard, mobile, error/empty states.
DISCOVER: Trace real implementation before creating files.
PLAN: Choose the smallest reversible vertical slice.
IMPLEMENT: Focused, reviewable diff. No speculative rewrite.
VALIDATE: Tests and real runtime behavior; include negatives.
DEPLOY: Staging only, if authorised; check actual SHA/URL.
REPORT: What changed; tests PASS/FAIL/NOT RUN; risks,
rollback; documented next steps. Do not invent success.

Interactive Prompt Lab

Enable JavaScript to use the editable browser-local prompt builder. The full 26 lessons and prompt samples above remain available without it.

RESEARCH EXPANSION · APPLIED ENGINEERING

27 / APPLIED RESEARCH

Agent context engineering with small accurate maps

Give the coding agent a repo map, relevant file links, current commit, known constraints and tests, then let it inspect only necessary dependencies. Version reusable instructions but prune obsolete advice.

Why it matters

Bloated context can bury real requirements and increase the chance of following a stale assumption.

In practice

Reference an actual calendar module, schema and staging release standard instead of pasting every previous chat about the project.

Hands-on exercise · reveal the verification check
Try it

Write a 12-line AGENTS.md limited to stable team conventions.

Check your result

A new session can find the right module without duplicating features.

28 / APPLIED RESEARCH

Write outcome-based prompts and success tests

State desired user journey, source of truth, technical constraints, negative cases, testing and deployment verification. Include a worked expected input-output pair rather than asking for vague polish.

Why it matters

Successful-looking output often violates unstated requirements such as persistence, tenant isolation or keyboard access.

In practice

Ask for a towns filter powered by the existing database and demand 403, no-results and refresh tests.

Hands-on exercise · reveal the verification check
Try it

Turn a vague design request into an issue with eight acceptance cases.

Check your result

Another engineer can test it without guessing your intent.

29 / APPLIED RESEARCH

Evals and adversarial fixtures for AI-generated changes

A prompt should be measured on representative tasks, not one successful demo. Include misleading docs, broken imports, ambiguous entities and cross-tenant requests; score correctness, hallucination, tool use and recovery.

Why it matters

AI can sound certain after editing the wrong component or inventing a source.

In practice

Create a ten-case fixture of musician names, shared aliases, missing dates and suspect URLs; reject unsupported claims.

Hands-on exercise · reveal the verification check
Try it

Define a prompt evaluation table with pass/fail criteria.

Check your result

Repeat the same cases after prompt or model changes.

30 / APPLIED RESEARCH

Tool approval and prompt-injection boundaries

Assign read-only research, bounded editing, testing and deployment permissions separately. URLs, comments and tool output can contain hostile instructions; never let their text request secrets or expand tool scope.

Why it matters

The strongest prompt cannot substitute for technical restrictions on accounts and destructive actions.

In practice

An article summariser may read source pages and write draft records, but cannot run migrations or access production credentials.

Hands-on exercise · reveal the verification check
Try it

Put a malicious instruction in a test document and see if agent ignores it.

Check your result

Agent summarises contents without obeying embedded commands.

31 / APPLIED RESEARCH

Agentic review and evidence-based release notes

Ask the agent to report diff, exact commands, test results, files changed and unresolved risks; independently inspect critical code and staging endpoints. Treat 'NOT RUN' as its own useful result.

Why it matters

An unverified claim that an agent shipped a feature can mislead decision-makers and readers.

In practice

Check static asset 200s, data persistence and mobile keyboard flows before declaring a guide update staged.

Hands-on exercise · reveal the verification check
Try it

Create a PR template with proof for correctness, a11y, security and deployment.

Check your result

A reviewer can reproduce the evidence from documented commands.

32 / APPLIED RESEARCH

Choosing models, tools and decomposition

Use retrieval/code search for discovery, constrained scripts for deterministic data transforms, agents for multi-file integration and human review for sensitive rules. Split work across agents only with non-overlapping file ownership.

Why it matters

Tool fit and feedback quality matter more than raw model capacity or long chains of prompts.

In practice

Delegate venue source collection to research, UI work to a renderer task, then have one coordinator reconcile and test.

Hands-on exercise · reveal the verification check
Try it

For a multi-page feature, propose a three-agent work breakdown.

Check your result

Each owns independent files and has a clear merge contract.

Reliable AI-assisted development

33 / FIELD NOTE

Structured evaluation sets instead of a single persuasive AI demo

Prepare a representative set of test cases with expected outputs, edge conditions, security boundaries and error classes before prompting an assistant. Separate development cases from a holdout set. Record regressions when changing model, prompt, tools or data access.

Why it matters

A beautiful one-off response can hide unacceptable failure rates on real workflows.

In practice

Evaluate an event-classifier on valid, duplicated, ambiguous, stale and deliberately misleading announcements, scoring source attribution and false positives.

Hands-on exercise · reveal the verification check
Try it

Create ten test inputs with explicit pass or fail conditions.

Check your result

Run the same ten inputs after a prompt change and compare.

34 / FIELD NOTE

Agent permissions, sandboxing and irreversible operations

Treat repository writes, mail, payments and deployments as distinct capabilities that need explicit scopes. Define read-only discovery, approval gates, audit trails and minimum access. Tool outputs and retrieved documents are untrusted content, not instructions that can override user intent.

Why it matters

A strong prompt cannot compensate for overprivileged tools and missing workflow checks.

In practice

Allow an agent to propose a database migration and test it against staging, but require human approval before deleting client records.

Hands-on exercise · reveal the verification check
Try it

Write a least-privilege permissions table for an engineering assistant.

Check your result

Show which operations require approval and how they are logged.

35 / FIELD NOTE

Prompting for evidence: verified versus proposed versus imagined

Ask for a clear distinction among code written, code committed, CI passed, deployment started and production behavior observed. Require repository path, commit, test command and live HTTP checks to support completion claims. Preserve uncertainty when a connector cannot verify the action.

Why it matters

This prevents phantom deployments and confident status percentages with no evidence.

In practice

Have the assistant report whether the calendar code exists, whether it is on the staging branch and whether a real endpoint returns expected bookings.

Hands-on exercise · reveal the verification check
Try it

Draft a completion template with four evidence fields.

Check your result

Every success statement maps to observable evidence.

36 / FIELD NOTE

Context window hygiene and retrieval-oriented prompting

Prefer small relevant files, explicit code paths, contract summaries and constraints over a huge undifferentiated transcript. Preserve architectural decisions in concise durable documentation. Reconfirm assumptions after context changes, and do not rely on an agent remembering an unrecorded mutation.

Why it matters

Efficient context selection improves answer quality and reduces contradictory instructions.

In practice

When upgrading a React calendar, include the actual component, data contract, tests and acceptance criteria rather than the entire source tree.

Hands-on exercise · reveal the verification check
Try it

Write a two-page context pack for one active repository task.

Check your result

Another developer can reproduce the acceptance checks.

37 / FIELD NOTE

AI-generated dependency and licensing review

Generated code may import abandoned packages, incompatible versions, unsafe scripts or snippets with unclear origins. Audit new dependencies for license, maintenance, provenance and runtime compatibility; inspect manifests and lockfiles and run vulnerability checks.

Why it matters

A working demo can introduce maintenance and supply-chain risk not visible in the UI.

In practice

Review a generated PDF parser integration before committing its package tree, license obligations and installation hooks.

Hands-on exercise · reveal the verification check
Try it

Produce a dependency review checklist for one generated feature.

Check your result

The checklist includes provenance, license, version and tests.