惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Vercel News
Vercel News
Martin Fowler
Martin Fowler
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LangChain Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
The real reason PRDs and ADRs don't survive contact with ...
joaosmoura · 2026-06-15 · via DEV Community

It's not a culture problem. It's a timing problem.


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.

High-stakes environments. High documentation standards.

And even there, the same pattern kept appearing: the documentation existed, but the decisions didn't survive.


The timing trap

Here's what actually happens in most teams.

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.

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 should have been written is still a blank template in a folder nobody opens.

This isn't a discipline problem. It's a friction-at-the-wrong-moment problem.

Most documentation systems ask for the artifact after the decision. By then, the cognitive context has evaporated. What gets written is a rationalization, not a record.


Why AI coding tools made this worse before making it better

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.

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.

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.


The upstream hypothesis

The insight behind upstream is simple: documentation should be enforced upstream of the code, not downstream of it.

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.

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.


How it works technically

upstream installs a UserPromptSubmit hook into Claude Code — one of the lifecycle hooks the tool exposes for exactly this kind of integration.

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:

UPSTREAM: feature detected without PRD. Invoke upstream-guard before continuing.

Claude then runs the upstream-guard skill, which does four things:

  1. Classifies the work — feature, bug, fix, chore, or incident. Bug fixes and chores bypass the check automatically; only feature work triggers enforcement.
  2. Checks for a PRD — by filename or content match in the configured docs directory.
  3. Checks for an ADR — 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.
  4. Releases to development once the required docs exist.

A few design decisions worth noting:

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

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

PRDs and ADRs can be created four ways: 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.

Skips are logged, not blocked. 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 SKIPS.md and a PR snippet is generated. Transparency, not bureaucracy.


What gets committed to the repo

.claude/
  hooks/
    upstream-check.sh           # UserPromptSubmit hook
  plugins/upstream/
    skills/
      upstream-guard.md         # orchestration skill
      upstream-prd.md           # PRD creation skill
      upstream-adr.md           # ADR creation skill
    templates/
      PRD.md
      ADR.md
upstream.config.yaml

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


The organizational argument

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

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.

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.

upstream is an attempt to make the documentation as fast as the code.


Getting started

npm install -g upstream-docs
cd your-repo
upstream init

The init wizard configures upstream.config.yaml, scaffolds .claude/, and optionally sets up a CODEOWNERS guardian for the config file.

The repo is at github.com/joaos-moura/upstream-docs. Feedback, issues, and contributions welcome.


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.