<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: joaosmoura</title>
    <description>The latest articles on DEV Community by joaosmoura (@joaos-moura).</description>
    <link>https://dev.to/joaos-moura</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3985620%2F7ad7500d-e520-4be2-b725-08895be217d9.jpeg</url>
      <title>DEV Community: joaosmoura</title>
      <link>https://dev.to/joaos-moura</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joaos-moura"/>
    <language>en</language>
    <item>
      <title>The real reason PRDs and ADRs don't survive contact with your team</title>
      <dc:creator>joaosmoura</dc:creator>
      <pubDate>Mon, 15 Jun 2026 13:09:56 +0000</pubDate>
      <link>https://dev.to/joaos-moura/the-real-reason-prds-and-adrs-dont-survive-contact-with-your-team-2m6d</link>
      <guid>https://dev.to/joaos-moura/the-real-reason-prds-and-adrs-dont-survive-contact-with-your-team-2m6d</guid>
      <description>&lt;p&gt;&lt;em&gt;It's not a culture problem. It's a timing problem.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;I've led engineering teams at four of Brazil's largest financial institutions — environments where decision traceability isn't optional. Audits require architectural rationale. Incidents demand post-mortems that explain not just what broke, but why the system was designed the way it was. Onboarding a new engineer means they need to understand decisions made months before they joined.&lt;/p&gt;

&lt;p&gt;High-stakes environments. High documentation standards.&lt;/p&gt;

&lt;p&gt;And even there, the same pattern kept appearing: the documentation existed, but the decisions didn't survive.&lt;/p&gt;




&lt;h2&gt;
  
  
  The timing trap
&lt;/h2&gt;

&lt;p&gt;Here's what actually happens in most teams.&lt;/p&gt;

&lt;p&gt;A developer picks up a ticket. They open their editor — or increasingly, they open Claude Code, Cursor, or Copilot — and they start building. The context is fresh, the problem is clear, and forward momentum feels like progress.&lt;/p&gt;

&lt;p&gt;Three weeks later, a tech lead asks: "Why did we introduce this new dependency?" The developer who built it has moved on to the next sprint. The Slack thread where the decision was made has scrolled past. The ADR that &lt;em&gt;should&lt;/em&gt; have been written is still a blank template in a folder nobody opens.&lt;/p&gt;

&lt;p&gt;This isn't a discipline problem. It's a &lt;strong&gt;friction-at-the-wrong-moment problem.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most documentation systems ask for the artifact &lt;em&gt;after&lt;/em&gt; the decision. By then, the cognitive context has evaporated. What gets written is a rationalization, not a record.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why AI coding tools made this worse before making it better
&lt;/h2&gt;

&lt;p&gt;The arrival of Claude Code, Cursor, and similar tools accelerated this pattern significantly. A developer can now go from "here's the ticket" to "here's a working prototype" in an hour. The speed is genuinely impressive. The documentation gap it creates is genuinely dangerous.&lt;/p&gt;

&lt;p&gt;In a team of one, that's manageable. In a team of eight, working across five services, with two new engineers onboarding — it's how you accumulate architectural debt that takes quarters to unwind.&lt;/p&gt;

&lt;p&gt;In high-compliance environments, the cost of this gap is particularly visible — but the pattern exists everywhere. The irony is that AI coding tools are also the best possible enforcement point. They sit exactly where the work begins.&lt;/p&gt;




&lt;h2&gt;
  
  
  The upstream hypothesis
&lt;/h2&gt;

&lt;p&gt;The insight behind &lt;a href="https://github.com/joaos-moura/upstream-docs" rel="noopener noreferrer"&gt;upstream&lt;/a&gt; is simple: &lt;strong&gt;documentation should be enforced upstream of the code, not downstream of it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not in the PR review. Not in the sprint retrospective. Not in the quarterly architecture review. At the moment a developer opens a feature branch and types their first prompt.&lt;/p&gt;

&lt;p&gt;That's the moment the context is fullest. That's when the cost of writing a PRD is lowest. That's when the ADR actually captures a decision, not a post-hoc justification.&lt;/p&gt;




&lt;h2&gt;
  
  
  How it works technically
&lt;/h2&gt;

&lt;p&gt;upstream installs a &lt;code&gt;UserPromptSubmit&lt;/code&gt; hook into Claude Code — one of the lifecycle hooks the tool exposes for exactly this kind of integration.&lt;/p&gt;

&lt;p&gt;When a developer opens a feature branch and submits their first prompt in a Claude Code session, the hook fires and injects a context message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UPSTREAM: feature detected without PRD. Invoke upstream-guard before continuing.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude then runs the &lt;code&gt;upstream-guard&lt;/code&gt; skill, which does four things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Classifies the work&lt;/strong&gt; — feature, bug, fix, chore, or incident. Bug fixes and chores bypass the check automatically; only feature work triggers enforcement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checks for a PRD&lt;/strong&gt; — by filename or content match in the configured docs directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checks for an ADR&lt;/strong&gt; — but only if the PRD describes architectural decisions (new external dependency, database migration, API contract change, infrastructure change, auth change). Not every feature needs an ADR.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Releases to development&lt;/strong&gt; once the required docs exist.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A few design decisions worth noting:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The hook fires at most once per session.&lt;/strong&gt; This is intentional. It's tracked via a PPID-based cache file in &lt;code&gt;/tmp&lt;/code&gt;. Subsequent prompts in the same session are silent. The goal is to interrupt once, not to create a tollgate on every interaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bypass branches are first-class citizens.&lt;/strong&gt; &lt;code&gt;fix/&lt;/code&gt;, &lt;code&gt;hotfix/&lt;/code&gt;, &lt;code&gt;chore/&lt;/code&gt;, &lt;code&gt;docs/&lt;/code&gt; prefixes skip the check entirely. The system is designed to get out of the way when it shouldn't be in the way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PRDs and ADRs can be created four ways:&lt;/strong&gt; imported from an existing document, generated through a short interview (the most common path), auto-drafted from git context, or linked to an external tool (Confluence, Google Docs via OAuth/PKCE). The barrier to compliance is intentionally low.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skips are logged, not blocked.&lt;/strong&gt; If a developer genuinely doesn't need a PRD for a particular piece of work, they can skip with a justification. The skip is logged to &lt;code&gt;SKIPS.md&lt;/code&gt; and a PR snippet is generated. Transparency, not bureaucracy.&lt;/p&gt;




&lt;h2&gt;
  
  
  What gets committed to the repo
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;.claude/&lt;/span&gt;
  &lt;span class="s"&gt;hooks/&lt;/span&gt;
    &lt;span class="s"&gt;upstream-check.sh&lt;/span&gt;           &lt;span class="c1"&gt;# UserPromptSubmit hook&lt;/span&gt;
  &lt;span class="s"&gt;plugins/upstream/&lt;/span&gt;
    &lt;span class="s"&gt;skills/&lt;/span&gt;
      &lt;span class="s"&gt;upstream-guard.md&lt;/span&gt;         &lt;span class="c1"&gt;# orchestration skill&lt;/span&gt;
      &lt;span class="s"&gt;upstream-prd.md&lt;/span&gt;           &lt;span class="c1"&gt;# PRD creation skill&lt;/span&gt;
      &lt;span class="s"&gt;upstream-adr.md&lt;/span&gt;           &lt;span class="c1"&gt;# ADR creation skill&lt;/span&gt;
    &lt;span class="s"&gt;templates/&lt;/span&gt;
      &lt;span class="s"&gt;PRD.md&lt;/span&gt;
      &lt;span class="s"&gt;ADR.md&lt;/span&gt;
&lt;span class="s"&gt;upstream.config.yaml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The entire plugin lives in &lt;code&gt;.claude/&lt;/code&gt;, which Claude Code picks up automatically. A platform engineer runs &lt;code&gt;upstream init&lt;/code&gt; once in the repo. The team gets it on their next &lt;code&gt;git pull&lt;/code&gt;. No global install required on individual machines.&lt;/p&gt;




&lt;h2&gt;
  
  
  The organizational argument
&lt;/h2&gt;

&lt;p&gt;There's a framing from Will Larson's &lt;em&gt;An Elegant Puzzle&lt;/em&gt; that I keep returning to: systems that rely on individual discipline fail at scale, while systems that encode discipline into process survive it.&lt;/p&gt;

&lt;p&gt;PRD and ADR culture almost always relies on individual discipline — a tech lead who remembers to ask, a developer who takes the time to write. upstream encodes that discipline into the toolchain itself. The enforcement happens whether or not the tech lead is in the room.&lt;/p&gt;

&lt;p&gt;For teams adopting AI coding tools, this matters more than it might seem. The productivity gains from Claude Code are real. But productivity without process creates a specific kind of technical debt: fast, well-written code that nobody can explain, modify, or audit six months later.&lt;/p&gt;

&lt;p&gt;upstream is an attempt to make the documentation as fast as the code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; upstream-docs
&lt;span class="nb"&gt;cd &lt;/span&gt;your-repo
upstream init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The init wizard configures &lt;code&gt;upstream.config.yaml&lt;/code&gt;, scaffolds &lt;code&gt;.claude/&lt;/code&gt;, and optionally sets up a CODEOWNERS guardian for the config file.&lt;/p&gt;

&lt;p&gt;The repo is at &lt;a href="https://github.com/joaos-moura/upstream-docs" rel="noopener noreferrer"&gt;github.com/joaos-moura/upstream-docs&lt;/a&gt;. Feedback, issues, and contributions welcome.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;João Moura is a Head of Engineering with experience leading technical teams at XP Inc., Itaú, BTG Pactual, B3, and Syngenta Digital. He builds at the intersection of engineering leadership and system design.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>claude</category>
      <category>productivity</category>
      <category>devops</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
