DEV Community

Cover image for Docs first, then code: how Watcher features avoid silent drift
Apogee Watcher
Apogee Watcher

Posted on Originally published at apogeewatcher.hashnode.dev

Docs first, then code: how Watcher features avoid silent drift

When we opened Apogee Watcher to AI coding agents as well as humans, we worried less about broken merges than about features that shipped cleanly while the plan, the schema note, and the support answer quietly disagreed. The product looked finished in the pull request. Marketing still described last month’s behaviour. Support answered from a wiki page nobody had touched.

So we made the wiki the gate before code moves. Before anyone edits Laravel on the develop branch, the task has to name its governing doc, pull the constraints that already live there, and treat write-back as part of done. That habit is docs-driven delivery: a short ritual that keeps a multi-tenant PageSpeed SaaS from drifting into two truths (the one in git, and the one everyone else still believes). Most tickets need a named wiki home and a constraint list, not a novel-length design document.

What docs-first means for a Laravel SaaS (not a novel)

Docs-first, here, means the wiki is the source of truth for product behaviour before the first line of application code moves. A Watcher change almost always already has a home: product and architecture notes, database and server paths, marketing voice, or the public docs agencies actually read. The job is to map the ticket to that file, not to invent a parallel brainstorm in chat.

What we extract before coding is concrete: paths, components, data fields, tone, quota rules, multi-tenant boundaries. Those constraints become the acceptance bar for the pull request. If the wiki says PageSpeed jobs honour organisation quotas and scheduled discovery, the implementation does not invent a one-off path that skips them. If the branding guide names Victor Mono and the orange/charcoal palette, a new Blade screen does not quietly ship a different typeface “just for this screen.”

That is documentation-first development as an engineering gate, not README theatre. The README still matters for install. The wiki matters for what stays true after the merge.

Why silent feature drift shows up when the plan stays stale

Silent drift starts when a change “works” and the plan is left for later. Agents are especially good at that pattern: they can implement a green path, leave a plausible commit message, and never open the governing doc. Humans do the same under deadline pressure. The ticket closes. The schema note still describes the old column. Support still pastes the old steps.

The cost shows up outside engineering. An agency lead asks whether multi-site schedules include sitemap discovery, and the answer depends on who they ask. A changelog claims a reporting change that marketing has not mirrored. A buyer who already knows what automated web performance monitoring means looks for that behaviour in the app and finds a half-updated screen.

A stale wiki is enough to produce those failures; you do not need a production outage. We treat the mismatch as a product defect: a SaaS that sells continuous monitoring rather than one-off audits sells trust with every schedule, so the next support thread becomes the regression report when written truth and running truth diverge.

How the docs-driven delivery loop runs on develop

The loop is short enough to copy into another team’s checklist this week.

  1. Map the task to one or more governing wiki docs (product plan, database notes, server paths, marketing, branding). If no doc fits, that is a signal: the feature has no home yet, so write the thin constraint page before coding.
  2. Extract constraints into working notes: fields, paths, tone, quota and tenancy rules, UI patterns. Those become the review checklist.
  3. Implement on develop / the shared development host, following the documented patterns. We do not treat a local Dropbox mirror as the source of truth for application commits; the development environment and the develop branch do.
  4. Write behaviour back into the same wiki docs before the work is called done. New conventions, changed jobs, updated screens, and “what support should say” belong in the file the next agent or human will open.

Post-change hygiene on the development host (cleared views, rebuilt assets when classes change, careful tests that do not wipe the shared database) sits beside that loop, so the next person inherits an updated plan instead of reverse-engineering the last merge. Branch discipline is a sibling habit: fixes land on develop before production. The docs loop keeps that branch from becoming a museum of undocumented behaviour. When the next feature has nowhere to hang in the wiki, create the home first. That is cheaper than teaching support a surprise.

Docs-first versus fix production then document later

The opposite habit looks efficient for a day. Someone patches production, pastes a screenshot into Slack, and promises to “update the docs tomorrow.” Tomorrow never arrives with the same detail. The next agent reads the old wiki, reintroduces the bug, or ships a UI that contradicts the patch. Support keeps answering from the stale page, because that is what search finds.

Docs-first flips the order: constraints first, code second, write-back before done. It feels slower on a one-line fix. Across a month of agent-assisted pull requests it is faster, because each change leaves a trail the next change can trust. We would rather ship one fewer surprise feature than explain why the app and the help article disagree.

For the buyer-facing side of that honesty, the Watcher guide on how to set up automated PageSpeed monitoring for multiple sites is the operational companion, because definition and setup stay aligned only when the wiki and the public posts move together.

FAQ

Is this the same as writing a long design document for every ticket?

No. Most Watcher tasks map to an existing wiki file and a short constraint list. The novel-length design doc is the exception. The rule is “name the governing doc and write behaviour back,” not “produce a ten-page RFC.”

Does docs-first replace code review or tests?

No. Review and tests still catch logic bugs. Docs-first catches a different class of failure: behaviour that is correct in git and wrong in every human-facing artefact. Both gates matter.

What if the wiki is wrong?

Fix the wiki as part of the same change, or open a short task that corrects it before you encode the wrong constraint. Shipping code against a known-bad plan just hardens the drift.

How does this relate to refusing production hotfixes?

Hotfix policy is about where code lands (develop and the development host before production). Docs-driven delivery is about what must stay true when that code lands. They reinforce each other; they are not the same ritual.

Map the next feature to a wiki home before you open the editor

If you run a Laravel SaaS with humans and agents in the same repository, pick one upcoming feature and force the loop once: governing doc, extracted constraints, develop-branch implementation, write-back before merge. Skipping the loop rarely fails the build; it leaves a support answer that contradicts the app, and a buyer who trusted the public definition of automated web performance monitoring until the product quietly moved.

For the agency-facing setup path that should stay in sync, start from how to set up automated PageSpeed monitoring for multiple sites and keep the definition post beside it, so “automated monitoring” still means the same thing in marketing and in the app even after the next agent-assisted merge.

References

Top comments (0)