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.
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
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 the local
SKILL.md, bundled references or scripts, and manual verification. Show the exact commands, evidence, and final checks you used before concluding."
- If the current host does not expose a matching server, use the bundled references, scripts, native toolchain, and manual workflow already described in this skill.
- Treat direct local verification, rendered output, logs, tests, or screenshots as the fallback evidence path before completion.
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 Synchronization67Use this skill when docs contain code snippets that are likely to drift from the real implementation.89- Leverage native parallel subagent dispatch and 200k+ context windows where available.101112## Activation Conditions1314Use symptom -> action triggers: when one matches, apply this skill and verify with the protocol below.1516- Function signatures changed17- Imports or package names changed18- Request or response contracts changed19- Framework guidance or recommended patterns changed20- A doc snippet compiles conceptually but no longer matches the codebase2122## Workflow23241. 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.2829## Anti-Patterns3031- Starting work before the plan or gate is clear: Execution drifts when success criteria are implied instead of explicit.32- Treating verification as optional cleanup: The last mile is where regressions and missing updates are usually hiding.33- Mixing planning, implementation, and release work in one jump: You lose the causal chain that explains why a change is safe.3435## Verification Protocol3637Before claiming "skill applied successfully":38391. Pass/fail: The Code Examples Sync workflow starts from explicit success criteria, constraints, and stop conditions.402. Pass/fail: Required evidence is collected before any completion, approval, or readiness claim.413. Pass/fail: The next action follows the documented gate order without skipping review or verification steps.424. Pressure-test scenario: Apply the workflow under time pressure with one failing check and one tempting shortcut.435. Success metric: Zero rationalizations; blocked, failed, or unverified work is reported as such.4445## Quality Checklist4647- [ ] Snippet matches current API shape48- [ ] Imports and package names are current49- [ ] Async, error handling, and setup steps still make sense50- [ ] Output examples match current behavior51- [ ] Duplicate snippets across docs were updated together5253## References & Resources5455### Documentation56- [Code Example Verification](./references/verification.md) - Checks for examples, imports, outputs, and compatibility5758### Scripts59- [Example Sync Check](./scripts/example-sync-check.py) - Audit Markdown files for untyped fences, placeholder text, and obviously stale examples6061<!-- MCP:START -->6263<!-- PORTABILITY:START -->64## Cross-Client Portability6566This skill is written to stay usable across GitHub Copilot, Claude Code, and Codex.6768- GitHub Copilot: keep the folder in a Copilot-visible skill path or wrap the69 workflow in project instructions when folder discovery is unavailable.70- Claude Code: keep the folder in a local skills directory or a compatible plugin source.71- Codex: install or sync the folder into72 `$CODEX_HOME/skills/code-examples-sync` and restart Codex after major changes.7374<!-- PORTABILITY:END -->7576## MCP Availability And Fallback7778Preferred MCP Server: None required7980- Fallback prompt: "Use the Code Example Synchronization skill without MCP. Rely on the local `SKILL.md`, bundled references or scripts, and manual verification. Show the exact commands, evidence, and final checks you used before concluding."81- If the current host does not expose a matching server, use the bundled references, scripts, native toolchain, and manual workflow already described in this skill.82- Treat direct local verification, rendered output, logs, tests, or screenshots as the fallback evidence path before completion.8384<!-- MCP:END -->8586## Related Skills8788- [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.