_ctx-update-docs
Check if docs and code conventions are consistent after changes. Use after modifying source code, before committing, or when asked to sync docs.
Best use case
_ctx-update-docs is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Check if docs and code conventions are consistent after changes. Use after modifying source code, before committing, or when asked to sync docs.
Teams using _ctx-update-docs should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/_ctx-update-docs/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How _ctx-update-docs Compares
| Feature / Agent | _ctx-update-docs | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Check if docs and code conventions are consistent after changes. Use after modifying source code, before committing, or when asked to sync docs.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
When source code changes, check public docs AND internal code
conventions for consistency.
## When to Use
- After modifying source code that has user-facing behavior
- Before committing changes that touch CLI flags, file formats,
or defaults
- When the user asks to sync docs with code
- After adding or removing commands, subcommands, or flags
## When NOT to Use
- When changes are purely internal — renaming a private variable,
reordering unexported code — skip this skill and commit directly
- When only docs were changed (no code to drift from)
- When the user explicitly says docs updates are not needed
## Usage Examples
```text
/_ctx-update-docs
/_ctx-update-docs (after adding --session flag to ctx agent)
```
## Workflow
1. **Diff** the branch: `git diff main --stat` (or relevant
base)
2. **Verify mapping** is current (see Self-Maintenance below)
3. **Map** changed packages to affected docs (see table)
4. **Read** each affected doc; flag sections that contradict
the new code
5. **Update** or flag for the user
6. **Validate**: `mkdocs build` in docs site (if available)
## Code-to-Docs Mapping
| Source Path | Likely Affected Docs |
|------------------------------------|---------------------------------------------------------------|
| `cmd/ctx/`, `internal/cli/` | `docs/cli/*.md` |
| `internal/config/` | `docs/home/context-files.md`, `docs/home/configuration.md` |
| `internal/context/` | `docs/home/context-files.md`, `docs/home/prompting-guide.md` |
| `internal/drift/` | `docs/recipes/context-health.md` |
| `internal/journal/` | `docs/reference/session-journal.md`, `docs/cli/journal.md` |
| `internal/bootstrap/` | `docs/home/getting-started.md` |
| `internal/claude/`, `internal/rc/` | `docs/operations/integrations.md`, `docs/home/configuration.md` |
| `internal/assets/` | `docs/home/context-files.md` (templates) |
| `internal/assets/claude/skills/` | `.claude/skills/` (live versions), `docs/reference/skills.md` |
| `SECURITY.md` | `docs/security/*.md` |
| `.context/` schema changes | `docs/home/context-files.md` |
## What to Check
- **New CLI flags/commands**: are they in
`docs/cli-reference.md`?
- **Changed file formats**: does `docs/context-files.md`
match?
- **New context files**: added to both read order docs and
`docs/context-files.md`?
- **Removed features**: still referenced in docs?
- **Changed defaults**: do examples in docs use old defaults?
- **Skill templates changed**: do live versions in
`.claude/skills/` match `internal/assets/claude/skills/`?
- **Architecture drift**: when packages are added, removed, or
renamed, or when dependency relationships change, update
`.context/ARCHITECTURE.md` (component map, dependency graph,
and file layout sections). `ctx drift` scans ARCHITECTURE.md
for dead backtick-path references.
## Self-Maintenance
This mapping table will drift. Before relying on it:
1. `ls internal/`: any packages not in the table? Add them.
2. `ls docs/*.md`: any doc pages not in the table? Map them.
3. If the mapping table is stale, flag it to the user rather
than editing this file automatically.
The skill is its own first test case: if the mapping is stale,
the skill has already failed at its job.
## Internal Code Conventions
Also check that changed code follows project patterns (not
Go defaults):
### Godoc Style
Project uses explicit **Parameters/Returns** sections, not
standard godoc.
```go
// Good (project style):
// FunctionName does X.
//
// Parameters:
// - param1: Description
//
// Returns:
// - Type: Description
func FunctionName(param1 string) error
// Bad (standard godoc; agent corpus drift):
// FunctionName does X with param1.
func FunctionName(param1 string) error
```
Verify that godoc comments match actual parameters and
behavior.
### Predicate Naming
Project uses predicates **without** Is/Has/Can prefixes:
- `Completed()` not `IsCompleted()`
- `Empty()` not `IsEmpty()`
- `Exists()` not `DoesExist()`
### File Organization
Public API in the main file, private helpers in **separate
logical files**:
- `loader.go` (public `Load()`) + `process.go` (private)
- NOT: everything in one file with unexported functions at
the bottom
### Magic Strings
Literals belong in `internal/config/`. If you see a hardcoded
string used in 2+ files, it needs a constant. Check
`internal/config/` for existing constants before introducing
new literals.
## Relationship to ctx drift
`ctx drift` checks `.context/` file health (dead paths,
staleness). This skill checks docs-to-source-code alignment
and internal conventions. They are complementary.
## Quality Checklist
Before reporting results, verify:
- [ ] All changed packages were mapped to their affected docs
- [ ] Each flagged doc section was actually read (not assumed)
- [ ] Skill template/live drift was checked if `internal/assets/`
was touched
- [ ] Self-maintenance was done (mapping table is current)Related Skills
ctx-verify
Verify before claiming completion. Use before saying work is done, tests pass, or builds succeed.
ctx-skill-creator
Create, improve, test, and deploy skills. Full skill lifecycle from intent to working skill file.
ctx-sanitize-permissions
Audit tool permissions for dangerous or overly broad entries. Use to ensure safe agent configuration.
ctx-recall
Browse session history. Use when referencing past discussions or finding context from previous work.
ctx-prompt
Apply, list, and manage saved prompt templates from .context/prompts/. Use when the user asks to apply, list, or create a reusable template like code-review or refactor.
ctx-journal-normalize
Normalize journal source markdown for clean rendering. Use after journal site shows rendering issues: fence nesting, metadata formatting, broken lists.
ctx-import-plans
Import plan files into project specs directory. Use to convert external plans into project-tracked specs.
ctx-compact
Archive completed tasks and trim context. Use when context files are growing large.
ctx-check-links
Audit docs for dead links. Use before releases, after restructuring docs, or when running a documentation audit.
ctx-add-task
Add a task. Use when follow-up work is identified or when breaking down complex work into subtasks.
ctx-add-learning
Record a learning. Use when discovering gotchas, bugs, or unexpected behavior that future sessions should know about.
ctx-add-decision
Record architectural decision. Use when a trade-off is resolved or a non-obvious design choice is made that future sessions need to know.