Code Example Synchronization
Use this skill when docs contain code snippets that are likely to drift from the real implementation.
- Leverage native parallel subagent dispatch and 200k+ context windows where available.
Activation Conditions
Use symptom -> action triggers: when one matches, apply this skill and verify with the protocol below.
- Function signatures changed
- Imports or package names changed
- Request or response contracts changed
- Framework guidance or recommended patterns changed
- A doc snippet compiles conceptually but no longer matches the codebase
Workflow
- Find the canonical implementation first.
- Update every affected snippet in docs, examples, and READMEs.
- Verify syntax, imports, and expected outputs.
- Note any intentional divergence, such as simplified tutorial snippets.
Cross-Client Portability
This skill is written to stay usable across GitHub Copilot, Claude Code, and Codex.
- GitHub Copilot: keep the folder in a Copilot-visible skill path or wrap the
workflow in project instructions when folder discovery is unavailable.
- Claude Code: keep the folder in a local skills directory or a compatible plugin source.
- Codex: install or sync the folder into
$CODEX_HOME/skills/code-examples-sync and restart Codex after major changes.
MCP Availability And Fallback
Preferred MCP Server: None required
- Fallback prompt: "Use the Code Example Synchronization skill without MCP. Rely on its local instructions, bundled resources, standard shell or editor tools, and direct verification. Show the evidence used before concluding."
- Do not claim an MCP operation was used when the active host does not expose it.
- Treat local files, tests, rendered outputs, logs, or screenshots as the fallback evidence path.
Anti-Patterns
- Starting work before the plan or gate is clear: Execution drifts when success criteria are implied instead of explicit.
- Treating verification as optional cleanup: The last mile is where regressions and missing updates are usually hiding.
- Mixing planning, implementation, and release work in one jump: You lose the causal chain that explains why a change is safe.
Verification Protocol
Before claiming "skill applied successfully":
- Pass/fail: The Code Examples Sync workflow starts from explicit success criteria, constraints, and stop conditions.
- Pass/fail: Required evidence is collected before any completion, approval, or readiness claim.
- Pass/fail: The next action follows the documented gate order without skipping review or verification steps.
- Pressure-test scenario: Apply the workflow under time pressure with one failing check and one tempting shortcut.
- Success metric: Zero rationalizations; blocked, failed, or unverified work is reported as such.
Quality Checklist
References & Resources
Documentation
Scripts
- Example Sync Check - Audit Markdown files for untyped fences, placeholder text, and obviously stale examples
Related Skills
- development-workflow: Use it when the workflow also needs planning, quality gates, and delivery tracking.
- code-quality: Use it when the workflow also needs two-stage review (spec compliance first, then code quality), maintainability, and refactoring guidance.
- systematic-debugging: Use it when the workflow also needs root-cause debugging before proposing fixes.
- test-driven-development: Use it when the workflow also needs test-first implementation and regression safety.
1---2name: code-examples-sync3description: Synchronize and verify code examples in documentation. Use when function signatures change, API interfaces update, imports shift, or documentation snippets become outdated and need correction.4---5# Code Example Synchronization
6
7Use this skill when docs contain code snippets that are likely to drift from the real implementation.
8
9- Leverage native parallel subagent dispatch and 200k+ context windows where available.
10
11
12## Activation Conditions
13
14Use symptom -> action triggers: when one matches, apply this skill and verify with the protocol below.
15
16- Function signatures changed
17- Imports or package names changed
18- Request or response contracts changed
19- Framework guidance or recommended patterns changed
20- A doc snippet compiles conceptually but no longer matches the codebase
21
22## Workflow
23
241. Find the canonical implementation first.
252. Update every affected snippet in docs, examples, and READMEs.
263. Verify syntax, imports, and expected outputs.
274. Note any intentional divergence, such as simplified tutorial snippets.
28
29<!-- MCP:START -->
30
31<!-- PORTABILITY:START -->
32## Cross-Client Portability
33
34This skill is written to stay usable across GitHub Copilot, Claude Code, and Codex.
35
36- GitHub Copilot: keep the folder in a Copilot-visible skill path or wrap the
37 workflow in project instructions when folder discovery is unavailable.
38- Claude Code: keep the folder in a local skills directory or a compatible plugin source.
39- Codex: install or sync the folder into
40 `$CODEX_HOME/skills/code-examples-sync` and restart Codex after major changes.
41
42<!-- PORTABILITY:END -->
43
44## MCP Availability And Fallback
45
46Preferred MCP Server: None required
47
48- Fallback prompt: "Use the Code Example Synchronization skill without MCP. Rely on its local instructions, bundled resources, standard shell or editor tools, and direct verification. Show the evidence used before concluding."
49- Do not claim an MCP operation was used when the active host does not expose it.
50- Treat local files, tests, rendered outputs, logs, or screenshots as the fallback evidence path.
51
52<!-- MCP:END -->
53
54## Anti-Patterns
55
56- Starting work before the plan or gate is clear: Execution drifts when success criteria are implied instead of explicit.
57- Treating verification as optional cleanup: The last mile is where regressions and missing updates are usually hiding.
58- Mixing planning, implementation, and release work in one jump: You lose the causal chain that explains why a change is safe.
59
60## Verification Protocol
61
62Before claiming "skill applied successfully":
63
641. Pass/fail: The Code Examples Sync workflow starts from explicit success criteria, constraints, and stop conditions.
652. Pass/fail: Required evidence is collected before any completion, approval, or readiness claim.
663. Pass/fail: The next action follows the documented gate order without skipping review or verification steps.
674. Pressure-test scenario: Apply the workflow under time pressure with one failing check and one tempting shortcut.
685. Success metric: Zero rationalizations; blocked, failed, or unverified work is reported as such.
69
70## Quality Checklist
71
72- [ ] Snippet matches current API shape
73- [ ] Imports and package names are current
74- [ ] Async, error handling, and setup steps still make sense
75- [ ] Output examples match current behavior
76- [ ] Duplicate snippets across docs were updated together
77
78## References & Resources
79
80### Documentation
81- [Code Example Verification](./references/verification.md) - Checks for examples, imports, outputs, and compatibility
82
83### Scripts
84- [Example Sync Check](./scripts/example-sync-check.py) - Audit Markdown files for untyped fences, placeholder text, and obviously stale examples
85
86## Related Skills
87
88- [development-workflow](../development-workflow/SKILL.md): Use it when the workflow also needs planning, quality gates, and delivery tracking.
89- [code-quality](../code-quality/SKILL.md): Use it when the workflow also needs two-stage review (spec compliance first, then code quality), maintainability, and refactoring guidance.
90- [systematic-debugging](../systematic-debugging/SKILL.md): Use it when the workflow also needs root-cause debugging before proposing fixes.
91- [test-driven-development](../test-driven-development/SKILL.md): Use it when the workflow also needs test-first implementation and regression safety.