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

推荐订阅源

T
Threat Research - Cisco Blogs
博客园 - 聂微东
小众软件
小众软件
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
TaoSecurity Blog
TaoSecurity Blog
博客园 - 司徒正美
罗磊的独立博客
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security Affairs
S
Security @ Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
月光博客
月光博客
S
Secure Thoughts
P
Proofpoint News Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Forbes - Security
Forbes - Security
H
Heimdal Security Blog
W
WeLiveSecurity
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
L
LangChain Blog
T
The Blog of Author Tim Ferriss
NISL@THU
NISL@THU
Google DeepMind News
Google DeepMind News
Cloudbric
Cloudbric
H
Hacker News: Front Page
The Last Watchdog
The Last Watchdog
Hacker News - Newest:
Hacker News - Newest: "LLM"
C
Cisco Blogs
博客园 - 三生石上(FineUI控件)
博客园_首页
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Schneier on Security
Project Zero
Project Zero
SecWiki News
SecWiki News
爱范儿
爱范儿
The Register - Security
The Register - Security
AI
AI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog
L
Lohrmann on Cybersecurity
Application and Cybersecurity Blog
Application and Cybersecurity Blog
P
Privacy International News Feed
J
Java Code Geeks
S
Securelist
C
Cyber Attacks, Cyber Crime and Cyber Security
V
Visual Studio 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
Agent contexts - A tool to feed you coding agents
Francesco Marchesini · 2026-06-17 · via DEV Community

In the AI era, something funny is happening: side projects that have been collecting dust in ~/code/wishful-thinking/ are getting dusted off. Suddenly that "someday I'll write this" repo on GitHub has a real README, a working CI, and three open issues you actually want to close.

Why? Because the AI doesn't complain. Doesn't get bored. Doesn't ask "but why do we need this when we have X?" at 11pm when all you want is to feel better with yourself, when your children are on the bed and you think "now is the moment i should use to realize some of my personal projects."
So while the discourse is busy replacing you with LLMs, you're quietly using LLMs to replace the procrastination that used to replace you.

This post is about one of those moments, one of those ideas born in the night, that probably, in pre-AI era, would have been forgotten behind "it's too late to open my laptop": a small CLI called
agent-contexts I wrote because I was sick of having 40 AGENTS.md tabs open across 40 different repos.

What Even Is "Context" and Why Should You Care?

When you sit down with Claude Code, Cursor, Gemini CLI, or any of the other agentic tools, they don't read your mind. They need to be told things. Some of those things you tell them in chat. But the important stuff — the project conventions, the "don't do this here" rules, the "we use tabs not spaces, fight me" — should live in the repo itself, so every agent (and every teammate) picks them up automatically.

Different agents have different conventions for where to look:

  • Claude Code looks for CLAUDE.md (and also AGENTS.md, because Anthropic isn't petty).
  • Gemini CLI looks for GEMINI.md.
  • GitHub Copilot, OpenAI Codex, Cursor, and friends use AGENTS.md.
  • A bunch of tools also support .cursorrules and similar.

So if you're running a polyglot agent setup (and who isn't these days)you're maintaining multiple files per project. That's annoying before you've written a line of code.

Context Is a Diet, Not a Buffet

The thing i learned the hard way: bigger context does not equal better context.

When you feed your agent a 4,000-line AGENTS.md covering every
architectural decision from 2019 to today, two things happen:

  1. The model gets slower and more expensive.
  2. The model gets worse. Conflicting instructions, ancient context that's no longer relevant, edge cases from a code path that got deleted last year — all of it pollutes the "what to do right now" buffer.

The same project rarely wants the same context for every task:

  • Building a new feature? You want the architecture overview, the existing patterns, the conventions.
  • Refactoring existing code? You want the constraints, the dependencies, the "this is load-bearing, don't touch" notes.
  • Hunting a bug? You want the diagnostics playbook, the logging conventions, the test scaffolding.
  • Onboarding a new dev (human or AI)? You want the orientation guide: how to run things, where to look first, what's safe to change.

Same repo. Four different AGENTS.md files. (Plus nested ones for
subfolders, because your src/payments/ deserves its own context, thank you very much.)

The "obvious" solution at the beginning was one big monolithic AGENTS.md at the root... but soon you understand the unefficency of that approach. The other "obvious" solution currently is a hand-maintained tree of nested AGENTS.md files in every folder, it wins on quality but loses on maintenance. The day someone updates the root convention, they have to remember to propagate it. And nobody remembers.

Enter: Vercel's Skills

The Vercel team had a similar itch a while back, and they scratched it with agent skills. They treated the bundle of "things an agent needs to do a job" (instructions, scripts, references) as a package. So they made it installable. You can npx skills add <source>, the tool fetches the right files, drops them in the right places, and tracks what's installed in a lockfile. Deterministic, versioned, no fuss.

But skills are about capabilities: "here's how to run my CI", "here's how to deploy", "here's a script to seed the DB". They don't really cover the AGENTS.md use case, where you want to distribute context, not behavior.

So I built something in the same vein, but scoped to context files.

agent-contexts: npm, but for AGENTS.md

agent-contexts is a CLI. The way to think about it:

Curate agent context once in a central git repo. Install it into every
consumer project. Versioned, deterministic, reproducible.

How it works

You write a contexts.yml at the root of your contexts repo:

version: "1"
name: engineering-contexts

mappings:
  ".":
    context_source: ./agents/root/AGENTS.md
    description: Repo-wide conventions
  src/products:
    context_source: ./agents/products/AGENTS.md
    description: Products module
  src/common/database:
    context_source: ./agents/database/AGENTS.md
    description: Sequelize + MySQL integration

Each mapping points a folder in the consumer project at a profile file in the contexts repo. agent-contexts add then:

  1. Materializes the contexts repo into a git-ignored cache: .contexts/cache/<slug>/.
  2. Drops relative symlinks at every target path. (Yes, relative - so the project still works after you move it.)
  3. Writes a contexts.lock pinning each source to a commit SHA and each file to a SHA-256 hash.

agent-contexts install is the npm ci of context. It only reads
contexts.lock, never the manifest, so CI doesn't have to fetch the manifest or guess about upstream availability. Same lock, same files, every time.

agent-contexts status recomputes truth from disk and exits non-zero if anything is broken, missing, or hand-edited. Easy CI gate.

Tags: different context, same folder

Sometimes you need a different context for the same folder, depending on what you're doing.

Say your repo has a default tone — calm, professional, focused on the production codebase. But today you're refactoring and you want a more pedagogical tone with extra "before you change this, consider…" notes. Or you're onboarding a junior dev and you want a glossary of project-specific terms front and center.

You author those as a tag:

mappings:
  ".":
    context_source: ./agents/root/AGENTS.md
  src/products:
    context_source: ./agents/products/AGENTS.md

tags:
  onboarding:
    mappings:
      ".":
        context_source: ./agents/root/onboarding/AGENTS.md
      src/products:
        context_source: ./agents/products/onboarding/AGENTS.md
  refactor:
    mappings:
      src/products:
        context_source: ./agents/products/refactor/AGENTS.md

Switch with a flag:

npx agent-contexts add your-org/your-contexts --tag onboarding
# or
npx agent-contexts update --tag refactor

Effective set is root ∪ tag (tag wins on conflicts), so you only write the differences. The lock records which tag each entry is on, so install reproduces it and update keeps you there.

A tiny end-to-end example

NestJS microservice. You want a Star-Wars-toned AGENTS.md for
src/products — because why not.

# contexts repo
mkdir -p agents/star-wars

cat > agents/products/AGENTS.md <<'EOF'
# Products Module

Follow the Repository pattern for data access.
Split Read and Write services (CQS-lite).
Use `class-validator` DTOs for every input.
EOF

cat > agents/star-wars/products.md <<'EOF'
# Products Module — The Armory of the Bounty Hunters

The domain heart, this is. Where artifacts of the holonet catalog,
manage you do.

- The Repository pattern, follow — data access through one gate
- Read and Write services, split — CQS-lite, the path of clarity
- DTOs with `class-validator`, use — `@nestjs/swagger` for the holomap
EOF

cat > contexts.yml <<'EOF'
version: "1"
mappings:
  src/products:
    context_source: ./agents/products/AGENTS.md
    description: Products module
tags:
  star-wars:
    mappings:
      src/products:
        context_source: ./agents/star-wars/products.md
        description: Products module — Yoda edition
EOF

In the consumer project:

npx agent-contexts add ../your-contexts --tag star-wars --force -y
# src/products/AGENTS.md is now a relative symlink into the cached file
# contexts.lock records tag=star-wars + the SHA of the file

npx agent-contexts status
# ✓ src/products/AGENTS.md  ok

# Later, switch back to the default tone
npx agent-contexts update                       # keeps the recorded tag
npx agent-contexts add ../your-contexts -y     # back to root mappings

That's the whole loop. Symlink in, versioned, switchable, reproducible.

A real (and less jokey) combo: code review in CI

Tags turn out to be the right tool for one specific scenario that I keep running into: a CI job that boots a code-review agent on every PR. You don't want that agent reading the same AGENTS.md files as your dev-time sessions, you want it focused, skeptical, and pointing at your review checklist, not your "how to add a new endpoint" doc.

So you ship a ci-code-review tag alongside the default one:

mappings:
  ".":
    context_source: ./agents/root/AGENTS.md
  src/products:
    context_source: ./agents/products/AGENTS.md

tags:
  ci-code-review:
    mappings:
      ".":
        context_source: ./agents/root/ci-review.md
        description: Code-review checklist + tone for CI agents
      src/products:
        context_source: ./agents/products/ci-review.md
        description: Review-time conventions for the products module

Then the CI job does the swap before invoking the agent:

# restore the lock so the cache is hot
npx agent-contexts install

# swap every entry to the CR-specific tone
npx agent-contexts update --tag ci-code-review

# boot the reviewer — it picks up AGENTS.md / CLAUDE.md / GEMINI.md
# that all point at the ci-code-review content
npx your-cr-agent

Same project, same lock, completely different AGENTS.md content at every target. The dev never sees the CI variant; the CI never sees the dev variant. Both live in the same repo, both are versioned, and a PR against either one is just a normal git workflow.

Commands cheat sheet

Command What it does
agent-contexts add <source> Fetch, select mappings, link, write lock.
agent-contexts install Headless restore from contexts.lock. The npm ci.
agent-contexts update Pull upstream, diff, re-pin.
agent-contexts status Per-entry truth from disk. Exit 5 on problems.
agent-contexts list Pretty table straight from the lock.
agent-contexts reset Undo: remove links, restore .bak backups, delete lock + cache.

All commands take --json, -y, --dry-run, and --verbose. None of them need a TTY, so they slot into CI without fuss.

The full docs and source live at
github.com/gadz82/contexts.

Pros, cons, and an honest disclaimer

Pros

  • Deterministic. Same contexts.lock, same files, anywhere — laptop, CI, your colleague's machine.
  • Versioned. Pin to a SHA. Roll back by changing one line in the lock.
  • Composable. Tags mean you ship one context repo per project, not N forks of it.
  • Familiar. Anyone who's used npm, cargo, or pip already gets it.
  • Portable. Symlinks are relative — the project keeps working after you move or re-clone it.
  • Cross-tool. AGENTS.md, CLAUDE.md, GEMINI.md, whatever your agent of the week wants.
  • Scriptable. --json everywhere, deterministic exit codes, no TTY needed, for example you can wire it into a CI job that swaps to a ci-cr tag before booting the reviewer agent, then walk away.

Cons (fair's fair)

  • Local-path sources store an absolute path in the lock. Commit that lock and ship it to another machine and install won't find anything to fetch from. The reason is in the docs (TL;DR: only a git URL is the same string everywhere). Use git for shared/CI; locals are for solo experiments.
  • Windows without Developer Mode falls back to file copies. It still works, but updates need a re-run.
  • The schema is opinionated — POSIX paths, no .. escapes, lowercase hex hashes, that sort of thing. Read the spec once and you'll stop fighting it.
  • This is v0.x. I'm not promising the lockfile format won't change in a breaking way. Pin your agent-contexts version.

Wrapping up

If you've ever felt the pain of maintaining AGENTS.md files across a fleet of repos — or worse, watching them drift out of sync — give agent-contexts a try. The README is short, the install is one command, and the worst case is that you rm a .contexts/ folder and a contexts.lock.

Found a bug? Open an issue. Got a feature idea? Open a PR. Want to yell at me about the name (it should be agent-context and the binary should be contexts, I know, I know)? There's an issue tracker for that too.

And a proper thank-you to the Vercel Skills folks. The shape of
this whole thing is theirs; the AGENTS-shaped twist is mine.

That's all. Go ship something.