Índice do artigofaltam 11 min de leitura
"AI speeds things up. But it only becomes real productivity when the team can trust what was delivered."
Using AI to write code and documentation is already part of the daily routine for many teams. The problem is that, in a real project, AI can hand back a "done" that doesn't cover every detail (missing filters, edge cases, back-end validations, permission errors, etc.). Worse: sometimes it looks like it did everything, but left a "hole" that only shows up in staging, or in production.
This post is an operational playbook (very hands-on) for keeping speed without losing control: planning, execution in small slices, human review, testing and a deployment that doesn't put production at risk.
Who this checklist is for
- Developers (front/back/full stack) who use coding assistants and want to reduce rework.
- Tech leads and engineers responsible for quality and security.
- Teams with CI/CD and multiple environments (dev/stg/prod) who need a "no surprises" flow.
- People who have already lived through: "the AI said it did everything... and it didn't."
What you will learn
- How to avoid the "the AI said it did everything, but it didn't" pattern.
- How to break features down to fit the context window and reduce "silent hallucination".
- How to set up a validation flow (front + back) that doesn't rely on "faith".
- How to deploy safely: without giving direct access to production.
- How to measure whether AI is actually improving delivery (and not just changing the kind of chaos).
AI-assisted development is "assisted", not "automatic"
Call it "assisted development" when:
- you keep technical responsibility (architecture, decisions and validation);
- the AI does parts of the work (boilerplate, adjustments, tests, documentation);
- the team has rituals to catch errors and unwanted changes.
When it becomes "automatic", the risk goes way up:
- merges without review;
- deployments outside CI;
- exposed credentials;
- back-end changes "by accident";
- "optimizations" nobody asked for (refactors and swapped structures).
If your goal is speed with predictability, the path is: ritual + evidence.
Four principles that make AI use sustainable
-
Responsibility is human
AI can suggest and implement, but the team answers for architecture, security and quality. -
Small is faster (in practice)
Smaller tasks reduce "context loss", cut rework and speed up review and testing. -
Proof before opinion
"It compiled" is not "done". The artifact needs validation: guided testing (UI) and contract testing (API). -
Least privilege, always
The bigger the permission, the bigger the cost of a mistake. Deployment should happen through CI, with minimal credentials.
If you want a more "formal" guide to secure practices across the SDLC, the NIST SSDF (Secure Software Development Framework) is worth reading; it emphasizes practices and evidence throughout the development cycle: NIST SSDF (SP 800-218).
The real problem: short context + "minimum acceptable" delivery
In squads, four recurring failures show up:
-
Context loss
The bigger the task, the higher the chance the AI "forgets" decisions, existing components, repo patterns and domain details. -
Partial delivery
It solves what you explicitly asked for, but leaves "out of scope" items that should have come along (e.g., it wires up the table but not the filters; adds an API but doesn't update the UI; creates an endpoint but doesn't check permissions). -
Unrequested refactors
The AI may "improve" something that was fine: it changes structures, renames methods, alters validations, reorders logic. This increases the bug surface without adding value. -
Operational and security risk
When the AI has too much access (infrastructure, production, secrets), the cost of a mistake grows exponentially.
The solution is not "don't use AI". It is to use it with ritual, with clear limits and with proof mechanisms.
Recommended 6-step flow
| Step | What to ask the AI | What you validate | Required artifact |
|---|---|---|---|
| 1) Plan | Impact map + acceptance criteria | Whether it covers front, back, data, QA and deploy | (Short) plan + risks |
| 2) Slice | List of small tasks (30–90 min) | Whether each task has a clear start/end | "Sliced" backlog |
| 3) Execute | Implementation per task | Whether it follows repo patterns | One MR/PR per slice |
| 4) Review | Review checklist + diffs | Whether it "broke" anything that existed | Review + approval |
| 5) Test | Test script (front + API) | Whether it works in the real flow | Evidence (screenshots/video/log) |
| 6) Safe deploy | Pipeline/CI + minimal permissions | Whether nobody (not even AI) pushes directly | Deploy via CI + rollback |
1) Plan before you code
Before saying "do this", force the planning step. The goal is for the AI to see the impact and for you to be able to review it clearly. Good planning is planning that:
- can be turned into small tasks;
- makes explicit what should not change;
- defines measurable acceptance criteria.
Planning checklist (what can't be missing)
- Functional scope: what the end user will see/be able to do.
- Data impact: migrations? seeds? schema changes?
- Permission impact: RBAC/ABAC, affected endpoints and screens.
- Integration impact: external APIs, authentication, tokens.
- Observability: logs, metrics, error handling.
- Acceptance criteria: how to prove it's done.
- Risks: what can go wrong and how to detect it early.
Impact map (simple template)
| Area | Question | Example of what may change |
|---|---|---|
| UI | Which screens/states? | loading, empty, error, pagination |
| API | Which endpoints? | request/response, filters, status codes |
| Data | What is persisted? | new table/field, seed, migration |
| Permissions | Who can see/do it? | RBAC by profile, owner-only |
| QA | How to prove it? | scripts + evidence |
| Deploy | How does it ship? | feature flag, rollback, migration |
Planning prompt (template)
Plan the implementation of feature X.
Deliverables:
- List of files/folders that should change (front, back, infra, docs).
- Objective acceptance criteria.
- Risks and points that require manual validation.
- Test checklist (front + API).
- What should NOT be changed.
Constraints:
- Don't implement anything yet.
- If information is missing, list questions.Your task's "Definition of Ready" (to reduce rework)
Before handing the slice to the AI (or to someone on the team), check:
- There is an objective acceptance criterion (not "make it look good").
- There is an input/output example (when it's an API/integration).
- There is a visual reference (when it's UI).
- There is a permission and profile rule (when access is involved).
2) Small slices: how to break things down without losing the thread
The most useful rule: one slice = one testable unit.
If you can't test a slice in 5–10 minutes, it's too big.
Quick heuristic for "right size"
| If the task... | Then... | Because... |
|---|---|---|
| touches 5+ critical files | break it up | it raises the chance of conflicts/bugs |
| involves front + back + data | start with the minimal vertical slice | it proves value early |
| has lots of "and also..." | turn it into 2–4 subtasks | it reduces context and hallucination |
| requires a product decision | stop and align | AI doesn't decide scope for you |
Technique: the minimal vertical slice
Instead of "building the whole module", aim for a small end-to-end flow:
- UI displays minimal information
- API returns the minimum needed
- Permission applied
- Guided test and contract test
Practical example (very common): "margin calculation by route".
A minimal vertical slice could be:
- endpoint returns margins by route (with owner-only permission)
- screen displays margins (with empty/loading state)
- the "best margin" calculation appears in the summary
- evidence: video/screenshot + a Postman call
From there, you create new slices: export, visual tweaks, PDF, etc.
Examples of good slices (real world)
- "Apply RBAC to the list: profiles A and B only see their own routes."
- "Display margins on screen and calculate the best margin in the summary."
- "Add PDF export and validate the minimum layout."
- "Create endpoint X + contract tests + endpoint documentation."
Examples of bad slices (avoid)
- "Finish the entire operations module."
- "Do the full app integration."
- "Refactor the whole area to make it better."
3) Execute slice by slice, with proof built in
For each slice, combine:
- what to do
- how to prove it worked
- how to prevent unwanted changes
Execution prompt (template)
Implement the task below.
Task:
- ...
Acceptance criteria:
- ...
Constraints:
- Don't refactor code outside the scope.
- Reuse existing components where possible.
- Don't change API contracts without flagging it.
After implementing:
- List how to validate manually.
- Name which files were changed.
- Suggest minimal automated tests (unit/integration/e2e)."Targeted fix" prompt (when a piece is missing)
When you spot the "built the table but not the filter" case, avoid asking it to "do everything again". Be specific:
The implementation is incomplete.
Fix only the items below (no refactoring outside the scope):
- ...
- ...
Then list:
- files changed
- how to validateA tip that reduces "done, but not done"
At the end of execution, always ask:
- "List what you did not implement and why."
- "List the risks you see in what was done."
- "List the assumptions you made."
This forces the AI to "expose" gaps.
4) Review that catches "silent hallucination"
AI may "optimize" things that didn't need to change. That's the kind of bug that slips past a rushed review.
Review checklist (practical and fast)
Scope and architecture:
- Did it change only what was necessary?
- Did it reuse existing components/patterns (instead of duplicating)?
- Did it avoid adding a new dependency without justification?
- Did it avoid changing API contracts without versioning/documenting?
Business rules:
- Does it meet the acceptance criteria?
- Does it cover filters, empty states, pagination, sorting?
- Did it validate permissions (RBAC/ABAC) on all affected endpoints/screens?
Quality and security:
- Are logs/errors useful (without leaking sensitive data)?
- Did it avoid adding credentials to the code?
- Does error handling avoid masking failures (e.g., an empty
catch)? - Are config/infra changes intentional?
Tip: reviewing "by diff" works better than "reading the whole file". A good code review checklist starts by understanding inputs, permissions and data flow.
If you want to go deeper into security review, the OWASP Secure Code Review Cheat Sheet is a good reference: Secure Code Review Cheat Sheet.
Protect the main branch and make review mandatory
From a process standpoint, two rules reduce risk a lot:
- protected main branch (no direct push)
- mandatory approval on the MR/PR
In GitLab, you can:
- protect branches (blocking direct pushes and requiring an MR flow): Protected branches
- define approval rules for merge requests: Merge request approval rules
The goal is simple: "nobody (and no AI) gets straight through."
CODEOWNERS: a simple trick for sharper reviews
If your repo allows it, use CODEOWNERS to require approval from whoever "owns" the module when it changes.
A simple example:
# Example (adjust for your repo)
src/backend/ @backend-team
src/frontend/ @frontend-team
infra/ @devops-team5) Explicit testing (front and back)
If you only "looked at the code", you didn't test. And with AI this matters even more, because the code can be coherent and still fail in the real flow.
Test matrix (the minimum that catches 80% of problems)
Front end (guided test):
- Full main flow (happy path).
- Empty states (no data) and loading.
- Permissions (RBAC): the user only sees what they're allowed to.
- Exports: CSV/Excel/PDF generate correct content.
- Responsiveness and critical layout (especially if there was visual feedback).
Back end (contract test):
- Authentication works (tokens/refresh).
- Filters return correct data.
- Pagination and sorting.
- Errors return a consistent status (400/401/403/500) with a useful message.
- No information leaked (e.g., user A can see user B's data).
Prompt to generate a test script (template)
Create a test script to validate feature X.
Include:
- Happy path cases (front + API)
- Permission cases (RBAC)
- Error cases (400/401/403/500)
- Edge cases (empty data, pagination, filter)
- Minimum evidence to collect (screenshots/logs)Where AI most often "slips through": the back end
On the front end, you can see on screen when it's wrong. On the back end, an error can stay invisible without Postman/tests.
Golden rule: every slice that changes an API needs a contract test (manual or automated).
If your team needs a baseline of security requirements for web/APIs, OWASP ASVS is a great starting point: OWASP ASVS.
6) Safe deployment: "the AI doesn't push anything to production"
The safest pattern is:
- the AI works on a development branch;
- it opens a merge request;
- CI runs tests/build;
- only the pipeline has deployment credentials;
- production only receives a validated artifact.
This follows the principle of least privilege: grant only the permissions needed for each task, and nothing more. In the AWS context, for example, this is explicitly recommended as an IAM practice: Least-privilege permissions.
Use ephemeral environments to review before merging (Review Apps)
If you use GitLab, "Review Apps" are temporary environments created per branch/MR to validate changes without having to "push to production" or tie up a fixed environment:
The payoff here is huge:
- UI review becomes "clickable", not "imaginable";
- QA tests before merging;
- stakeholders validate the flow without installing anything locally;
- the environment disappears afterwards (less cost and less mess).
An (illustrative) skeleton of a review job in .gitlab-ci.yml:
review_app:
stage: review
script:
- echo "Deploying the review environment"
environment:
name: review/$CI_COMMIT_REF_NAME
on_stop: stop_review_app
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
stop_review_app:
stage: review
script:
- echo "Tearing down the review environment"
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
when: manualTip: keep the real deployment script in CI, not in the agent's hands.
Avoid long-lived credentials in CI (prefer short-lived tokens)
A leap in maturity is replacing fixed secrets with temporary credentials via federated identity (e.g., OIDC), reducing the risk of leaks and abuse.
In GitHub Actions, for example, you can assume roles in AWS without storing fixed keys, using OIDC:
Illustrative snippet (GitHub Actions):
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::123456789012:role/ci-deploy-role
aws-region: us-east-1
- run: ./deploy.shSupply chain security: the "next level" when AI comes in strong
When you speed up the pace of change, you also increase the need to guarantee the integrity of the build and the artifact.
The SLSA framework is a useful reference for thinking about supply chain controls (build provenance, integrity, tampering prevention):
In version 1.2 of the specification (checked in November 2026), SLSA has two tracks. The build track goes from L0 to L3 (L3 requires a hardened build platform). The source track, reintroduced in this version, has four levels, and Level 4 is precisely review by two people (two-party review): the same mandatory MR approval rule this checklist advocates. The old single-track SLSA levels 1 to 4 no longer apply.
You don't need to reach the highest level of each track tomorrow. But you can start with simple questions:
- Who can trigger a deployment?
- Did the production artifact come from CI?
- Is there an audit trail of what was built and by whom?
The "bundle" of artifacts that makes AI work in the real world
To turn AI into predictability, you need artifacts (evidence) that support delivery. In software security, frameworks like the NIST SSDF reinforce the importance of keeping records/evidence of practices throughout the cycle.
In practice, for each relevant feature, try to produce:
- A short plan (scope, impact, risks, acceptance criteria).
- An MR/PR with an objective description and a validation checklist.
- Test evidence (screenshots, short video, logs).
- A documentation change (README/endpoint/notes).
- A rollback plan (even if it's just "revert the MR").
Ready-to-copy templates
1) "AI-friendly" slice (ticket) template
### Context
- (1–3 lines) What problem are we solving?
### Scope
- ✅ Must do:
- ...
- ❌ Must not do:
- ...
### Acceptance criteria
- [ ] ...
- [ ] ...
### Impact
- Front:
- Back:
- Data:
- Permissions:
- Logs/monitoring:
### How to test (manual)
1. ...
2. ...
3. ...
### Notes
- Links / screenshots / endpoints2) MR/PR description template (with proof)
## What was done
- ...
## Why it was done
- ...
## What was NOT done (out of scope)
- ...
## How to validate
1. ...
2. ...
## Checklist
- [ ] CI green
- [ ] Manual happy path test
- [ ] Permission test (RBAC)
- [ ] No secrets in the code
- [ ] Logs/errors ok3) Final "before merge" checklist
- The feature meets the acceptance criteria.
- No "free bonus" refactor made it into the diff.
- The API contract test was run (or an automated test exists).
- The main branch is protected (no direct push).
- MR/PR approved by at least 1 reviewer.
- Deployment will go through CI (no direct access to production).
How to measure whether the process is improving (and not just changing the kind of problem)
If you want to know whether "AI + ritual" is working, stop measuring "lines of code" and start measuring flow and stability.
A widely used set of metrics in the industry is the DORA metrics, which balance speed with reliability. A good starting point is the official guide: DORA metrics.
Simple metrics to start with (no new tool)
- Lead time (MR opened → in production): is it going down?
- Rework per MR: how many "firefighting" commits after review?
- Escaped defects: bugs that made it to staging/production.
- Review time: is it within expectations or has it become a bottleneck?
If you already use GitLab, the platform also documents how it measures/defines DORA metrics: GitLab DORA metrics.
Final summary (what really matters)
If you want to keep speed and confidence, treat AI as an accelerator, not as an autopilot.
The checklist that works best day to day:
- Plan (impact map + acceptance criteria).
- Slice (small, testable tasks).
- Execute (one slice per MR).
- Review (diff + checklist, no "free bonus refactor").
- Test (front + API contract).
- Deploy safely (CI with least privilege, no direct access to production).
Related reading
- Reviewing 100% of what AI produces: the cost and the sampling way out
- Vibe coding and AI: why new features break what already worked
- AI agents to test systems and record bug evidence
- CI/CD on Git for small teams: performance, cache and runners
To turn this checklist into an operational pipeline, see the pages on AI-assisted development and generative AI squads.





