skills/documentation/sop-structure/SKILL.md
Use when structuring Standard Operating Procedures with proper sections, organization, and markdown formatting. Covers SOP anatomy and section organization.
npx skillsauth add pantheon-org/tekhne sop-structureInstall 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.
Well-structured SOPs follow consistent patterns that make them easy to understand, maintain, and execute. This skill covers the anatomy of effective SOPs and how to organize sections.
Every SOP should include these core sections:
SOP files MUST use the .sop.md extension:
✅ deployment-checklist.sop.md
✅ code-review-security.sop.md
✅ database-migration.sop.md
❌ deployment.md (missing .sop)
❌ checklist.sop.txt (wrong file type)
❌ SOP-Deployment.md (incorrect format)
An SOP is executed by someone who was not in the room when it was written. Optimise for unambiguous, repeatable execution: every step one concrete action, every prerequisite stated up front. Know when not to write an SOP: a one-off task nobody will repeat does not need one.
Use when writing or restructuring a Standard Operating Procedure, or when a procedure is being followed inconsistently and needs a repeatable structure.
# {Action Verb} {Specific Outcome}
Short form: Use kebab-case filename
Long form: Use Title Case heading
Examples:
# Generate API Documentation
# Implement Feature Using TDD
# Review Pull Request for Security
The overview should answer three questions:
## Overview
This SOP guides you through implementing new features using Test-Driven
Development (TDD). Use this when adding functionality that requires high
confidence in correctness. TDD ensures comprehensive test coverage and
reduces regression risk.
Define all configurable inputs at the beginning:
## Parameters
- **Input Variable**: {variable_name} - Description and example values
- **Configuration**: {config_option} - Available options (option1, option2, option3)
- **Path**: {file_path} - Expected format and constraints
Example:
## Parameters
- **Repository Path**: {repository_path} - Absolute path to git repository
- **Output Format**: {output_format} - Documentation format (markdown, html, pdf)
- **Verbosity**: {verbosity} - Detail level (concise, standard, comprehensive)
- **Include Tests**: {include_tests} - Whether to include test examples (yes, no)
List required tools, knowledge, and setup:
## Prerequisites
### Required Tools
- Tool name (version X.X or higher)
- Another tool (version Y.Y or higher)
### Required Knowledge
- Understanding of concept A
- Familiarity with technology B
### Required Setup
- Environment variable {VAR_NAME} must be set
- Configuration file {config.json} must exist
Example:
## Prerequisites
### Required Tools
- Node.js (v18 or higher)
- npm (v8 or higher)
- Git (v2.30 or higher)
### Required Knowledge
- Understanding of JavaScript/TypeScript
- Familiarity with testing frameworks
- Git workflow basics
### Required Setup
- Package.json exists in project root
- Test framework is installed (Jest, Vitest, or Mocha)
- Git repository is initialized
Structure steps hierarchically:
## Steps
1. First major step
- Sub-step or detail
- Another sub-step
- Additional context
2. Second major step
- Implementation detail
- Expected outcome
3. Third major step
- Specific action
- Validation step
With Validation:
## Steps
1. Analyze codebase structure
- Identify main entry points
- Map directory organization
- List dependencies
- **Validation**: Confirm all entry points are documented
2. Extract patterns
- Identify design patterns
- Document data flow
- Note architectural decisions
- **Validation**: Verify patterns are correctly identified
3. Generate documentation
- Create overview section
- Document public APIs
- Add usage examples
- **Validation**: Ensure documentation builds without errors
Define measurable outcomes:
## Success Criteria
- [ ] Specific measurable outcome 1
- [ ] Specific measurable outcome 2
- [ ] Specific measurable outcome 3
- [ ] All tests pass
- [ ] Documentation is complete
Example:
## Success Criteria
- [ ] All new code has test coverage ≥ 90%
- [ ] All tests pass without warnings
- [ ] Code passes linter with zero errors
- [ ] Documentation includes usage examples
- [ ] Changes follow existing code patterns
Provide guidance for common failures:
## Error Handling
### Error: {Error Name or Code}
**Symptoms**: How this error manifests
**Cause**: Why this error occurs
**Resolution**:
1. First troubleshooting step
2. Second troubleshooting step
3. Alternative approach if steps fail
Example:
## Error Handling
### Error: Tests Fail to Run
**Symptoms**: Test runner exits with error code, tests don't execute
**Cause**: Missing dependencies, incorrect test framework configuration, or environment issues
**Resolution**:
1. Verify test framework is installed: `npm list {test-framework}`
2. Check test configuration file exists and is valid
3. Ensure NODE_ENV is set correctly
4. If issue persists, reinstall dependencies: `rm -rf node_modules && npm install`
### Error: Type Errors During Build
**Symptoms**: TypeScript compiler reports type mismatches
**Cause**: Incorrect type annotations or missing type definitions
**Resolution**:
1. Run type checker: `npx -y --package typescript tsc`
2. Review error messages for specific type issues
3. Add necessary type annotations
4. Install missing @types packages if needed
Link to related workflows:
## Related SOPs
- **{sop-name}**: Brief description of when to use this instead
- **{another-sop}**: How this complements the current SOP
Example:
## Related SOPs
- **code-review**: Use after completing feature implementation to get peer review
- **deployment-checklist**: Use after code review passes to deploy changes
- **rollback-procedure**: Use if deployment fails or issues are discovered
Avoid These Structure Mistakes:
Missing Parameters
Unclear Prerequisites
Vague Success Criteria
No Error Handling
Poor Section Organization
tools
A skill that produces warnings but no errors.
testing
A well-formed example skill for testing the validator.
development
A skill with code blocks and imperative instructions for testing content and contamination analysis.
tools