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

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
IT之家
IT之家
S
SegmentFault 最新的问题
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
J
Java Code Geeks
博客园 - 聂微东
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
博客园_首页
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
腾讯CDC
Apple Machine Learning Research
Apple Machine Learning Research
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
宝玉的分享
宝玉的分享
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
月光博客
月光博客
NISL@THU
NISL@THU
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
Blog — PlanetScale
Blog — PlanetScale
aimingoo的专栏
aimingoo的专栏
L
LINUX DO - 热门话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
F
Fortinet All Blogs
博客园 - Franky
L
Lohrmann on Cybersecurity
S
Secure Thoughts
量子位
V
Vulnerabilities – Threatpost
Last Week in AI
Last Week in AI
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LINUX DO - 最新话题
I
InfoQ
C
CERT Recently Published Vulnerability Notes
Security Archives - TechRepublic
Security Archives - TechRepublic
P
Proofpoint News Feed
G
GRAHAM CLULEY
Cisco Talos Blog
Cisco Talos Blog

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 Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
📚 The Book Pattern: Progressive Disclosure for AI Agents
idavidov13 · 2026-05-22 · via DEV Community

You are standing in a bookshop holding a technical book you might buy. You have about thirty seconds before you decide. So you do three things.

You read the back cover to see what the book promises. You flip to the introduction to check the author's rules and how they think. You scan the table of contents to see if the parts you actually care about are in there.

If those three pass the test, you pay for it.

Later, when you sit down to read, you study the chapter that matches the problem you're solving. And later still, when you are deep in your own work, you flip back to the appendix to grab the exact example you need.

Your AI agent should read your project the exact same way.

In the previous article we sketched the three-layer model that the scaffold runs on. This article gives you the mental model that makes it stick, and the industry name for the architecture you are quietly already using - progressive disclosure.


📚 The Anatomy of a Technical Book

Open any well-written Packt, Manning, O'Reilly, or Pragmatic Bookshelf title and you will find the same three parts, every single time.

The back cover is the promise. Two paragraphs that tell you who the book is for, what it covers, and what you will be able to do after reading it. It exists so a reader can decide in thirty seconds whether the book belongs in their hands.

The preface is the author's constitution. It states the assumptions, the prerequisites, the conventions, the things you will be expected to know, and the things the book explicitly refuses to cover. It is what makes the author's voice consistent across two hundred pages.

The table of contents is the map. A flat list of chapter titles, ordered, scannable, with page numbers. It exists so that a reader who already trusts the book can find the exact part they need without re-reading everything that came before.

Three parts. Each loaded into the reader's mind at a different moment. Each designed for a different decision.

Diagram of a book's three anatomical parts - back cover, preface with MUST/SHOULD/WON'T badges, and a numbered table of contents - shown side by side


🤖 The Orchestrator File Is the Cover, Preface, and Table of Contents

Now look at the CLAUDE.md file at the root of the Playwright scaffold. It has the same three parts.

The Role section is the back cover.

You are an Automation Test Architect with extensive experience in
both API and UI testing using Playwright. Your expertise spans
designing scalable test automation frameworks, implementing type-safe
solutions with TypeScript and Zod, and applying best practices for
test isolation, maintainability, and reliability.

Enter fullscreen mode Exit fullscreen mode

In about fifty words the agent learns who it is, what kind of project this is, and what it is expected to be good at. The agent reads this once, at the start of every session.

The Constitution is the preface. The scaffold splits it into three tiers borrowed from how legal systems work:

### MUST (Mandatory)

| Dependency Injection | Use fixtures, never `new PageObject(page)` |
| Selectors | getByRole > getByLabel > getByPlaceholder > getByText > getByTestId |
| Type Safety | Use Zod schemas, no `any` type |
| Strict Schemas | Always `z.strictObject()`, never `z.object()` |

### SHOULD (Recommended)

| Data Generation | Use Faker via factories for happy-path data |
| Test Isolation | Independent tests, use beforeEach not shared state |

### WON'T (Forbidden)

| No XPath | Never use XPath selectors |
| No Hard Waits | Never use page.waitForTimeout() |
| No `any` | Never use TypeScript's any type |

Enter fullscreen mode Exit fullscreen mode

If you covered the CLAUDE.md article earlier in this series, this should look familiar. What's new here is the framing. These three tiers are the author's voice. Every time the agent hesitates, it consults this preface to know what kind of book it is reading.

The Skills Index is the table of contents.

| Skill         | Read When Working On         |
| ------------- | ---------------------------- |
| selectors     | pages/\*\*                   |
| page-objects  | pages/\*\*                   |
| fixtures      | fixtures/**, tests/**        |
| api-testing   | fixtures/api/\*\*, tests/api |
| data-strategy | test-data/\*\*               |
| debugging     | When a test fails            |

Enter fullscreen mode Exit fullscreen mode

The agent does not read every skill on startup. It reads the index, and only the index. When a task lands, it looks at the table of contents and decides which chapter to open.

That is exactly the bookshop scan. Promise, constitution, map. Thirty seconds of reading and the agent knows whether your project belongs in its hands.


📖 Every Skill Is a Chapter

A great chapter does three things. It tells you why the rule exists, how to apply it step by step, and what the right and wrong code looks like. Take the selectors skill from the scaffold as a worked example.

It opens with a frontmatter description that acts as a chapter abstract:

---
name: selectors
description: Selector strategy, exploration-first workflow, locator
  priority order (getByRole > getByLabel > getByPlaceholder > getByText
  > getByTestId), and feedback/validation-message selector rules for
  Playwright page objects. Use when creating page objects, writing or
  updating locators, generating UI tests...
---

Enter fullscreen mode Exit fullscreen mode

The description is what the agent reads first, before it commits to opening the chapter at all. The body opens with a WHY section called "Critical" that names the principles:

- Selector priority order is mandatory: getByRole > getByLabel > ...
- NEVER use XPath
- Exploration with playwright-cli is mandatory before writing selectors
- Every page object covering forms or CRUD must include feedback selectors

Enter fullscreen mode Exit fullscreen mode

Then a HOW section breaks the work into phases:

### Phase 1: Open and authenticate

### Phase 2: Explore like a user

### Phase 3: Plan test coverage

### Phase 4: Generate selectors

Enter fullscreen mode Exit fullscreen mode

Then a WHAT section shows the actual code, correct and forbidden side by side:

// ✅ Correct
page.getByRole("button", { name: "Submit" });
page.getByLabel("Email");
page.getByText(Messages.LOGIN_ERROR);

// ❌ Forbidden
page.locator('//div[@id="test"]');
page.locator('xpath=//button[text()="Submit"]');
page.locator(".btn-primary");

Enter fullscreen mode Exit fullscreen mode

And finally a See Also section that links to the appendix and to sibling chapters:

## See Also

- `page-objects` skill - POM class structure
- `playwright-cli` skill - the exploration tool
- `references/feedback-selectors-example.md` - full code pattern
- `references/troubleshooting.md` - common pitfalls

Enter fullscreen mode Exit fullscreen mode

That is a chapter. Self-contained, focused on one topic, structured the way a reader's brain actually wants to consume it. The Skills article covered the what of skill files. The book pattern explains the why of the structure inside them.

Exploded view of a SKILL.md file showing four stacked blocks - WHY with a radiating principle node, HOW with a 1-2-3 phase pipeline, WHAT with correct vs forbidden code, and SEE ALSO with a branching link tree


📎 The References Folder Is the Appendix

Look at the selectors/ folder on disk and you find more than just SKILL.md.

.claude/skills/selectors/
├── SKILL.md                                      ← the chapter
└── references/
    ├── examples.md                               ← worked code examples
    ├── feedback-selectors-example.md             ← deep page-object pattern
    └── troubleshooting.md                        ← common pitfalls and fixes

Enter fullscreen mode Exit fullscreen mode

The chapter mentions these files but does not contain them. They are the appendix. A reader uses them only when they are deep in the actual work, the same way you flip to the back of a textbook to grab a worked example or a lookup table.

Some skills carry heavier appendices. The skill-creator skill, for example, ships with executables alongside its references:

.claude/skills/skill-creator/
├── SKILL.md
├── agents/                  ← subagent definitions
├── scripts/                 ← runnable Python tools
├── eval-viewer/             ← HTML report generator
└── references/              ← schemas and Anthropic resources

Enter fullscreen mode Exit fullscreen mode

The crucial property of the appendix is that the agent does not pay for it until it asks for it. The chapter says "for the full code pattern, see references/feedback-selectors-example.md". The agent only reads that file if the current task requires it. The token cost is zero until the moment of need.


🏷️ The Industry Name: Progressive Disclosure

The pre-purchase scan, the chapter, and the appendix are not just an analogy. They are the three levels of an architecture pattern that the AI tooling industry has now formally converged on.

Anthropic released the SKILL.md format in December 2025, calling it progressive disclosure. OpenAI, Google, GitHub, and Cursor adopted variants of it within weeks. By early 2026 it was the default architecture for any production agent that needs to scale beyond a handful of rules. The State of Context Engineering 2026 write-up captures the shift in one sentence: "discovery first, activation when relevant, execution only during the task."

The three levels map cleanly onto the bookshop journey.

Level What loads When Token cost Reader's moment
L1 Skill name and description from YAML frontmatter At session start, for every skill ~100 tokens per skill The thirty-second pre-purchase scan
L2 The full SKILL.md body When the agent decides the skill is relevant Under 5,000 tokens Sitting down to study one chapter
L3 Files in references/, scripts/, assets/ When the chapter explicitly points to them Unlimited Flipping to the appendix mid-task

The Anthropic Claude Code documentation is the canonical reference. The four-mode Diátaxis framework is the closest cousin in the technical writing world and is worth reading if you are designing your own skills from scratch.

Architectural diagram of progressive disclosure showing three stacked layers - L1 metadata always loaded, L2 chapter body with one highlighted chapter active, L3 references with one file fetched - connected by a vertical scan-study-fetch arrow


⚖️ Why It Beats the All-in-One Prompt

A reasonable question at this point is: why not stuff every rule and every example into one giant system prompt? The three loading strategies look like this side by side.

Strategy Upfront cost Discoverability Capacity
Eager loading Massive. Tens of thousands of tokens before the user types a word Perfect. The agent knows everything Capped by the context window
Lazy loading Zero. Nothing is loaded Poor. The agent does not know what exists Theoretically unlimited, practically unusable
Progressive disclosure Small. Only metadata is loaded Good. Semantic index drives discovery Effectively unlimited

Eager loading is the binder you hand a new hire on day one. They might be impressed. They will not actually read it. By the time they reach page two hundred they will have forgotten page two.

AI agents behave the same way. Long instruction files cause context rot, the documented phenomenon where rules near the bottom of a prompt get applied less consistently than rules near the top.

Lazy loading is the opposite failure mode. Nothing is loaded, so the agent has no idea your project has rules at all. It defaults to its own habits, which are not yours.

Progressive disclosure is the bookshop. Cheap on day one, deep when you need it, infinite on the shelf. This is the property that lets the scaffold ship sixteen skills today and another forty next year without the agent slowing down or losing accuracy.

Split comparison - on the left a chaotic three-ring binder with hundreds of pages spilling out labelled EAGER LOADING, on the right a clean bookshelf with one glowing book pulled out labelled PROGRESSIVE DISCLOSURE


✍️ Writing Your Orchestration Like an Author

Here is how to apply the pattern to your own project. Treat it as a writing brief, not a coding task.

For the orchestrator file (CLAUDE.md, .cursor/rules/, .github/copilot-instructions.md):

  1. The back cover. One short paragraph naming the agent's role and the project's domain. Resist the urge to over-explain.
  2. The preface. A three-tier constitution. MUST for non-negotiables, SHOULD for recommended defaults, WON'T for hard refusals. Write each rule in one line.
  3. The table of contents. A single table listing every skill, when to read it, and what it covers. Nothing else lives in this file. Detail goes downstream.

For each skill chapter (.claude/skills/{name}/SKILL.md):

  1. The frontmatter description. Two to three sentences that name the topic, list the triggering keywords, and pre-empt the wrong skill from loading. This is the part the agent reads first.
  2. WHY. A short "Critical" or "Principles" section that names the rules and explains the reasoning behind them.
  3. HOW. Numbered phases or steps. Each phase ends with a concrete outcome.
  4. WHAT. Code examples, labelled with ✅ and ❌. Tables for decision trees. A "See Also" section pointing to the appendix.

For each appendix (references/, scripts/, assets/):

  1. Things the chapter would suffer from including inline. Long worked examples, troubleshooting tables, runnable scripts, deep edge cases.
  2. Always referenced by name from the chapter. An appendix the chapter never mentions might as well not exist.

If you are starting from scratch, the Playwright scaffold's `CLAUDE.md` is a working template. Strip out the parts that do not apply to your stack and replace them with your own rules.


🧭 The Bookshelf Mental Model

If a colleague asked you "where in this book does the rule about X live?", you should be able to answer in under five seconds. If you cannot, the book is poorly organized, not your colleague.

Apply the same test to your agent. If your agent struggles to find which rule applies to a piece of code, the failure is almost never the agent. It is the bookshelf.

Progressive disclosure works because it respects how readers actually read. A good orchestration respects how agents actually load.

The structure you choose tomorrow is the structure your agent will live with on every task next month. Write it like an author, not like a checklist.


🙏🏻 Thank you for reading! The book pattern is the spine of every well-behaved AI agent. The agent reads the cover, opens the chapter, flips to the appendix. Your job is to make those three moments easy. In the next article we will look at how to add a new chapter to your agent's bookshelf without breaking the ones already on it.

You can find the Public README.md file for the scaffold on GitHub: Playwright Scaffold

You can get access to the private GitHub repository here: Get Access