molecule-core/plugins/molecule-skill-update-docs/skills/update-docs/SKILL.md
Hongming Wang 119b02c544 feat(plugins): split guardrails into 12 modular plugins
Replaces the proposed monolithic molecule-guardrails plugin with 12
single-purpose plugins users can install à la carte. Powered by a
small extension to the AgentskillsAdaptor base class so any plugin can
ship hooks/, commands/, and a settings-fragment.json without writing a
custom adapter.

## Base adapter changes

workspace-template/plugins_registry/builtins.py + sdk/python/molecule_plugin/builtins.py
(both copies — drift-tested):
- New _install_claude_layer() helper called at the end of install()
- Conditionally copies hooks/ → /configs/.claude/hooks/ (preserving exec bit)
- Conditionally copies commands/*.md → /configs/.claude/commands/
- Conditionally merges settings-fragment.json into /configs/.claude/settings.json
  with ${CLAUDE_DIR} placeholder rewritten to the workspace's absolute install
  path. Existing user hooks are preserved (deep-merge by event name).
- All steps no-op when the plugin doesn't ship the corresponding files,
  so existing skill+rule plugins (molecule-dev, superpowers, ecc,
  browser-automation) are unchanged.

Drift test (tests/test_plugins_builtins_drift.py) still passes.

## 12 new plugins

Hook plugins (ambient enforcement):
- molecule-careful-bash       — refuses destructive bash; ships careful-mode skill
- molecule-freeze-scope       — locks edits via .claude/freeze
- molecule-audit-trail        — appends every Edit/Write to audit.jsonl
- molecule-session-context    — auto-loads cron-learnings at session start
- molecule-prompt-watchdog    — injects warnings on destructive prompt keywords

Skill plugins (on-demand):
- molecule-skill-code-review        — 16-criteria multi-axis review
- molecule-skill-cross-vendor-review — adversarial second-model review
- molecule-skill-llm-judge          — deliverable-vs-request scoring
- molecule-skill-update-docs        — post-merge doc sync
- molecule-skill-cron-learnings     — operational-memory JSONL format

Workflow plugins (slash commands):
- molecule-workflow-triage  — /triage full PR-triage cycle
- molecule-workflow-retro   — /retro + cron-retro skill, weekly retrospective

Each ships only what it needs — most have just plugin.yaml + skills/ or
hooks/ + adapter (one-line stub: `from plugins_registry.builtins import
AgentskillsAdaptor as Adaptor`). Total ~120 files but each plugin is
small and self-contained.

## Verification

- python3 -m molecule_plugin validate plugins/molecule-* → all 13 valid
  (12 new + pre-existing molecule-dev)
- End-to-end install smoke test on representative samples: hook plugin
  (molecule-careful-bash), skill-only plugin (molecule-skill-code-review),
  workflow plugin (molecule-workflow-triage). All produce expected
  /configs/ tree, settings.json paths rewritten, exec bits preserved,
  zero warnings.
- workspace-template pytest tests/test_plugins_builtins_drift.py → passes
  (SDK + runtime stay in sync).

## CLAUDE.md repo-doc updated

Lists all 12 new plugins under the existing Plugins section, organized
by category (hook / skill / workflow). Each entry one line, recommend-
together hints where dependencies make sense.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 12:20:04 -07:00

3.2 KiB

name description
update-docs Review recent edits and update all documentation including architecture docs, API specs, and edit history. Creates missing docs for new implementations.

Update Documentation

Review recent code changes and update ALL relevant documentation in the /docs folder.

Steps

  1. Read today's edit history

    • Check docs/edit-history/ for the current date's session file
    • Identify all files that were modified
  2. Analyze changes

    • Read the modified files to understand what changed
    • Categorize changes: new features, bug fixes, architecture changes, API changes, config changes
  3. Update edit-history session file

    • Add a summary section at the top describing what was accomplished
    • Group related changes under descriptive headings
    • Add any missing context about why changes were made
  4. Update CLAUDE.md if needed

    • New commands or scripts added
    • Architecture or key modules changed
    • New environment variables required
    • New routes or endpoints added
    • Test counts when new test files were added
  5. Update PLAN.md (repo root) if needed

    • When a planned phase ships, mark it complete and add any follow-ups
    • When new architectural decisions are made, update the relevant phase
    • Keep the current status / next steps section in sync with reality
    • If a feature was reverted, document the reversal and reasoning
  6. Update README.md (repo root) if needed

    • New features visible to users (canvas tabs, deploy flows, etc.)
    • Changed setup or quickstart instructions
    • Updated tech stack list (when adding/removing major dependencies)
    • Updated test counts in the status badges
    • License or branding changes
  7. Update README.zh-CN.md (repo root) if README.md was updated

    • Mirror any user-visible changes from README.md
    • Keep the Chinese translation in sync — don't let it drift
    • Update the same sections in both files (status, features, setup, license)
  8. Update .env.example (repo root) if needed

    • Every new env var read by code must be documented in .env.example
    • Include a comment describing the var and its expected format
    • When removing an env var from code, remove from .env.example
    • Keep default values consistent with code defaults
  9. Update docs/README.md if needed

    • New features or capabilities
    • Changed setup instructions
    • Updated project overview
  10. Update docs/ files Review and update all architecture documentation to match current implementation

    For each doc:

    • Check if documented features match actual code implementation
    • Update outdated sections to reflect current code
    • Add NEW sections for features that are implemented but not documented
    • Remove or mark deprecated features that no longer exist
    • Ensure code examples match actual implementation
  11. Create new docs if needed

    • If a significant new feature or module was added but has no documentation, create appropriate documentation
    • Follow existing documentation style and structure
  12. Report summary

    • List all documentation files updated
    • Note any new documentation files created
    • Summarize key changes documented