.claude/skills/docs/SKILL.md
Update or create DOCS.md files for Shift subsystems. Use this skill whenever the user asks to update docs, refresh documentation, create a DOCS.md, write module documentation, or says "update docs for X". Also trigger after completing a large feature when Claude.md says to update docs — check if any DOCS.md in the affected subsystem needs refreshing.
npx skillsauth add shift-editor/shift docsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The goal is documentation that helps agents and contributors understand constraints they cannot discover by reading source code.
docs/architecture/index.md to find the canonical doc for the subsystemEvery DOCS.md follows this structure. Omit empty sections but preserve the order.
# Module Name
One-sentence purpose.
## Architecture Invariants
## Codemap
## Key Types
## How it works
## Workflow recipes
## Gotchas
## Verification
## Related
This is the most valuable section because it captures knowledge that is invisible in code. A contributor can read every line of source and still violate an invariant, because invariants describe absences, performance motivations, and semantic distinctions that only make sense with historical context.
Each invariant states a rule and explains why it exists:
Architecture Invariant: Rust is never touched during the draft hot path.
GlyphDraft.setPositionscalls onlyglyph.apply()— a JS-only signal update. Rust sees the final result once whenfinish()callsbridge.sync(). This exists because NAPI struct marshaling at thousands of points per frame causes ~450ms frames + GC pressure.
Good invariants describe:
$glyph fires on identity changes, not data changes")Bad invariants just restate what the code does ("X calls Y", "X extends Z"). If you can see it by reading the source, it does not belong here.
Use **CRITICAL**: labels sparingly — only for rules that will silently break things or waste hours if violated. These are not style preferences; they are landmines.
A tree showing key files with one-line purposes. Skip test fixtures, generated files, and barrel re-exports. The point is orientation, not an exhaustive listing.
module/
├── Foo.ts — one-line purpose
├── Bar.ts — one-line purpose
└── types.ts — one-line purpose
Only types that matter for understanding the module's contract. Reference by symbol name (EditSession, BaseTool), not file path. Symbol names survive refactors; paths break.
Brief narrative explaining data flow and lifecycle. Focus on design rationale for non-obvious choices — "we do X because Y, not because Z." This is not an API dump listing every method signature.
Step-by-step instructions for common modifications. Include which symbols to touch and what verification to run. Be specific enough that someone unfamiliar with the module can follow along:
### Adding a new tool
1. Create a class extending `BaseTool` in `lib/tools/`
2. Define `behaviors` array — first `canHandle` match wins
3. Implement `activate()` to enter a reactive state (e.g. `"ready"`)
4. Register in `ToolRegistry`
5. Verify: `pnpm typecheck && pnpm test`
Things that have bitten people. Performance traps. Known edge cases. These are experiential — the kind of thing someone would tell a new teammate over coffee.
What to run after changing this module. Be specific about which commands and what they check.
Other modules this one connects to, referenced by symbol name with a brief note on the relationship.
These patterns weaken documentation and cause maintenance burden:
docs/architecture/, not in one module's DOCS.md.PascalCase symbol in the docpython3 scripts/context-drift-check.py to validate the full docs systemClaude.md — it is manually curatedCONTEXT.md files — banned by Claude.mddocs/architecture/, not module DOCS.mddevelopment
Find and remove dead code (unused files, exports, class members) using Knip as a candidate generator, then verify each candidate through AST-level analysis and interface tracing before removing anything. Use when the user asks to clean up unused code, find dead code, or reduce the codebase.
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".