sop-writer

Creates validated standard operating procedures grounded in codebase research and OCXP code intelligence.

Updated May 12, 2026
One-click install
npx skills add https://github.com/contexthub-md/marketplace --skill sop-writer-contexthub-md
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sop-writer
Source: https://github.com/contexthub-md/marketplace/tree/main/contexthub/skills/sop-writer
Command: npx skills add https://github.com/contexthub-md/marketplace --skill sop-writer-contexthub-md

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing runbooks and procedures from memory produces stale, inaccurate documentation that agents and operators cannot trust. This Skill grounds every SOP in actual source code, validates each step against the codebase, and saves it with staleness tracking so procedures stay discoverable and current. ## Core Features & Use Cases - Code-Grounded Research: Uses OCXP tools (route, grep, file read) to extract exact commands, flags, and file paths from the real codebase instead of approximations. - Structured SOP Template: Enforces a complete format with prerequisites, tool-annotated steps, expected outputs, verification, rollback, and troubleshooting tables. - Validation & Staleness Tracking: Verifies referenced files exist, flags unverifiable steps, and records depends_on paths so SOPs are tracked when files change. - Use Case: Ask it to document your production deployment process; it finds the actual Makefile targets and CI configs, drafts a step-by-step runbook, verifies every path, and saves it with metadata linking it to the right repos and environments. ## Quick Start Ask the assistant to create an SOP for your deployment process using the sop-writer skill.

Frequently Asked Questions about sop-writer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an SOP from an existing codebase?

Invoke the sop-writer skill with a topic like "deploy to production process". It researches the codebase with OCXP tools to find exact commands and file paths, drafts a structured SOP, validates each step, and saves it with ch_create_sop.

How to write a runbook that AI agents can follow?

Use the enforced SOP template: every step needs a tool annotation (shell, kubectl, terraform) and an Expected line describing success. Set metadata.audience to "agents" or "both" and auto_include to true so agents discover it via ch_get_memory_context.

Does the SOP writer work without OCXP code intelligence?

Yes, it falls back to ch_discover_context to search the project knowledge base when OCXP is unavailable. However, file-level validation of referenced paths is strongest when OCXP tools are connected.

How are SOPs kept up to date when code changes?

Each saved SOP includes a depends_on list of every file referenced during research. The system tracks these files for staleness, so when referenced code changes, the affected SOPs are flagged for review.

What happens if a step cannot be verified against the codebase?

The validation phase checks each referenced file with ch_ocxp_file_exists and greps for Makefile targets and API routes. Any step that cannot be confirmed is marked with [UNVERIFIED] so reviewers know it needs manual checking.