Your Documentation Is Out of Date. Let an AI Agent Keep It in Sync A developer has proposed a `sync-docs` agent skill that keeps technical Markdown documentation aligned with source code by storing a `commit` and `updated` date in each document's frontmatter. The agent uses the recorded commit as a baseline, inspects everything changed since then, and reviews the existing documentation against the current implementation rather than simply appending Git summaries. The approach treats source code as the source of truth and aims for accuracy over activity. We've all been there. You join a new team, open the repository, and find a beautifully written README.md , an architecture document, and a collection of Markdown files explaining how everything works. You start reading. A few minutes later, you notice that the architecture diagram doesn't match the actual implementation. The documentation references tools that no longer exist. Some configuration options have changed, and a few important components are missing entirely. The documentation is there, but can you trust it? This is one of the most common problems in software engineering: documentation slowly drifts away from the source code. And it's not because developers don't understand the importance of documentation. It's because maintaining it is a continuous task, and it's very easy to forget. But what if we could delegate this responsibility to an AI agent? Let's start with one simple principle: The source code is always the source of truth. Documentation is a human-friendly representation of how the system works. It helps developers understand the architecture, discover available tools, learn conventions, and onboard new team members. But documentation should never override the implementation. Whenever the implementation changes, the relevant documentation should be reviewed and updated if necessary. The problem is knowing when documentation needs attention. Here's a simple trick. What if every technical Markdown document included metadata describing the last commit against which it was reviewed? For example: --- commit: '9b6f166af5227ff4093af7347084d8f7d2a81e4f' updated: '2026-11-04' --- That's it. Two simple pieces of information: commit : The Git commit against which the document was last reviewed and synchronized. updated : The date the document was last reviewed. This small addition gives us something very useful: a reference point. When someone opens a Markdown document, they can immediately see when it was last reviewed and how far behind the codebase that review was. More importantly, an AI agent can use that commit as a starting point for reviewing the document. For example, if the document references commit 9b6f166 , the agent can inspect everything that has changed since that commit and determine whether any of those changes affect the documentation. We now have a simple, explicit relationship between our documentation and the source code. sync-docs skill Imagine having an agent skill called sync-docs . Its responsibility is straightforward: Make sure technical documentation accurately reflects the current state of the codebase. The workflow could look something like this: For example, the agent might discover that since the last documentation review: It can then inspect the relevant source files and update the documentation accordingly. Notice something important: the agent isn't simply summarizing the latest Git changes and appending them to a document. It needs to understand the existing documentation, inspect the current implementation, and determine whether the document still accurately describes the system. The goal is accuracy, not just activity. Let's make this concrete. We need two things: The important distinction is that the skill owns the logic. The workflow simply orchestrates it. Let's create the following structure: .agents/ skills/ sync-docs/ SKILL.md The SKILL.md file contains the actual instructions the agent must follow. Here is an example implementation: .agents/skills/sync-docs/SKILL.md --- name: sync-docs description: Review and synchronize Markdown documentation against the current source code. --- Sync Documentation Your responsibility is to ensure that technical documentation accurately reflects the current implementation in the repository. The source code is always the source of truth. 1. Discover documentation Find all Markdown files containing the following frontmatter fields: - commit - updated These fields identify the last source-code commit against which the document was reviewed. Ignore files without this metadata. 2. Review each document For every document: 1. Read its recorded commit. 2. Verify that the commit exists in the repository. 3. Identify the source files relevant to the document. 4. Inspect changes introduced since the recorded commit: git diff