sop-rfc2119
Use when writing SOPs that require precise requirement levels using RFC 2119 constraint keywords (MUST, SHOULD, MAY). Covers proper usage of requirement keywords for deterministic agent behavior.
What this skill does
# RFC 2119 Keywords for SOPs RFC 2119 defines keywords for indicating requirement levels in specifications. Using these keywords in SOPs creates precise, unambiguous instructions that AI agents can execute deterministically. ## Key Concepts ### The RFC 2119 Keywords RFC 2119 defines these keywords for requirement levels: | Keyword | Meaning | Usage | |---------|---------|-------| | **MUST** | Absolute requirement | Non-negotiable steps that must be performed | | **MUST NOT** | Absolute prohibition | Actions that are forbidden | | **SHOULD** | Strong recommendation | Preferred approach, but alternatives may exist | | **SHOULD NOT** | Strong discouragement | Discouraged, but may be acceptable in specific cases | | **MAY** | Optional | Truly optional actions at agent's discretion | ### Why Use RFC 2119 in SOPs 1. **Eliminates Ambiguity**: Clear distinction between required and optional steps 2. **Predictable Execution**: Agents know exactly what is mandatory vs. recommended 3. **Better Error Handling**: Violations of MUST/MUST NOT trigger immediate failures 4. **Consistent Interpretation**: Standard keywords understood across implementations ## Best Practices ### Using MUST **MUST** indicates absolute requirements. Use for: - Critical safety or security steps - Steps that affect data integrity - Prerequisites that block subsequent steps - Validation that prevents errors ```markdown ## Steps 1. You MUST verify all tests pass before deployment 2. You MUST backup the database before running migrations 3. You MUST validate user input before processing 4. You MUST check authentication before accessing resources ``` **When Not to Use MUST:** - ❌ Stylistic preferences: "You MUST use single quotes" - ❌ Minor optimizations: "You MUST use const instead of let" - ✅ Use SHOULD instead for preferences ### Using MUST NOT **MUST NOT** indicates absolute prohibitions. Use for: - Security violations - Data corruption risks - Breaking changes without migration - Actions that violate invariants ```markdown ## Steps 1. You MUST NOT commit secrets to version control 2. You MUST NOT modify production data without backup 3. You MUST NOT skip type checking before deployment 4. You MUST NOT proceed if validation fails ``` **Examples:** ```markdown ## Security Requirements - You MUST NOT log sensitive user data (passwords, tokens, PII) - You MUST NOT disable security features in production - You MUST NOT expose internal error details to users - You MUST NOT use user input directly in SQL queries ## Data Integrity - You MUST NOT delete data without backup verification - You MUST NOT modify schema without migration path - You MUST NOT skip transaction rollback on errors - You MUST NOT cache data without expiration ``` ### Using SHOULD **SHOULD** indicates strong recommendations. Use for: - Best practices that improve quality - Performance optimizations - Code style preferences - Recommended but not required steps ```markdown ## Steps 1. You SHOULD add logging for debugging 2. You SHOULD include usage examples in documentation 3. You SHOULD run linter before committing 4. You SHOULD use meaningful variable names ``` **SHOULD vs. MUST:** ```markdown ## Type Safety (MUST - affects correctness) - You MUST add type annotations to public APIs - You MUST validate types at runtime boundaries ## Code Quality (SHOULD - improves maintainability) - You SHOULD add type annotations to internal functions - You SHOULD use strict TypeScript configuration ``` ### Using SHOULD NOT **SHOULD NOT** indicates discouragement. Use for: - Anti-patterns to avoid - Suboptimal but sometimes necessary approaches - Deprecated patterns being phased out ```markdown ## Steps 1. You SHOULD NOT use global variables (use dependency injection) 2. You SHOULD NOT catch all errors (catch specific exceptions) 3. You SHOULD NOT use magic numbers (define constants) 4. You SHOULD NOT nest callbacks deeply (use async/await) ``` **With Justification:** ```markdown ## Code Patterns - You SHOULD NOT use eval() for parsing (security risk) - Exception: If you MUST use eval(), sanitize input and run in sandbox - You SHOULD NOT use var (use const or let) - Exception: Supporting legacy browsers may require var - You SHOULD NOT use any type in TypeScript (defeats type safety) - Exception: Interfacing with untyped libraries may require any ``` ### Using MAY **MAY** indicates truly optional actions. Use for: - Optional enhancements - User preferences - Non-critical additions - Context-dependent choices ```markdown ## Steps 1. You MAY add code comments for complex logic 2. You MAY include performance benchmarks 3. You MAY use helper utilities for common operations 4. You MAY add additional test cases beyond minimum coverage ``` **MAY vs. SHOULD:** ```markdown ## Documentation (SHOULD - recommended) - You SHOULD document public APIs - You SHOULD include README with setup instructions ## Additional Documentation (MAY - optional) - You MAY add architecture diagrams - You MAY include design decision records - You MAY create video tutorials ``` ## Examples ### Example 1: Code Review SOP with RFC 2119 ```markdown # Review Pull Request for Security ## Steps 1. Analyze authentication and authorization - You MUST verify authentication is required for protected routes - You MUST check authorization logic prevents privilege escalation - You SHOULD use role-based access control (RBAC) - You MAY suggest additional security layers 2. Review input validation - You MUST verify all user input is validated - You MUST confirm SQL queries use parameterization - You MUST NOT allow unescaped user input in templates - You SHOULD validate input both client and server side 3. Check secret management - You MUST NOT approve code with hardcoded secrets - You MUST verify secrets use environment variables - You SHOULD check secrets are not logged - You MAY recommend secret rotation policies 4. Assess error handling - You MUST verify errors don't expose sensitive information - You SHOULD check errors are logged appropriately - You SHOULD NOT allow generic catch-all error handlers - You MAY suggest specific error recovery strategies ``` ### Example 2: TDD Implementation SOP with RFC 2119 ```markdown # Implement Feature Using Test-Driven Development ## Steps 1. Write failing test (RED) - You MUST write test before implementation code - You MUST run test to verify it fails - You MUST confirm failure message describes expected behavior - You SHOULD use descriptive test names - You MAY add multiple test cases for edge cases 2. Write minimal implementation (GREEN) - You MUST write simplest code to pass test - You MUST run test to verify it passes - You MUST NOT add functionality beyond test requirements - You SHOULD NOT optimize prematurely - You MAY add code comments for complex logic 3. Refactor (REFACTOR) - You MUST keep all tests passing during refactoring - You MUST run tests after each refactoring step - You SHOULD extract duplicated code - You SHOULD improve naming and structure - You SHOULD NOT change test behavior - You MAY add performance optimizations if needed 4. Repeat cycle - You MUST complete red-green-refactor for each requirement - You SHOULD commit after each complete cycle - You MAY combine related test cases ``` ### Example 3: Deployment SOP with RFC 2119 ```markdown # Deploy Application to Production ## Prerequisites - You MUST have production credentials configured - You MUST verify all tests passed on staging - You SHOULD have reviewed recent changes - You MAY have notified team of deployment ## Steps 1. Pre-deployment verification - You MUST verify staging deployment is healthy - You MUST check database migrations are ready - You MUST confirm rollback plan is documented - You SHOULD review monitoring dashboards - You MAY run additional smoke tests 2. E
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.