Sop Rfc2119 标志

Sop Rfc2119

组织
zenobi-us
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.

Add to TypingMind

概览

发布者zenobi-us
代码仓库dotfiles
技能名称sop-rfc2119
星标数
67
复刻数
6
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 zenobi-us 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Sop Rfc2119 AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/zenobi-us/dotfiles/tree/master/files/devtools/agent/bundles/agent-core/skills/sop/sop-rfc2119
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zenobi-us/dotfiles.git /tmp/dotfiles
mkdir -p .claude/skills
cp -r /tmp/dotfiles/files/devtools/agent/bundles/agent-core/skills/sop/sop-rfc2119 .claude/skills/sop-rfc2119
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Sop Rfc2119,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Sop Rfc2119。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Sop Rfc2119 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

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:

KeywordMeaningUsage
MUSTAbsolute requirementNon-negotiable steps that must be performed
MUST NOTAbsolute prohibitionActions that are forbidden
SHOULDStrong recommendationPreferred approach, but alternatives may exist
SHOULD NOTStrong discouragementDiscouraged, but may be acceptable in specific cases
MAYOptionalTruly 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. Execute deployment
   - You MUST backup production database
   - You MUST apply database migrations before code deployment
   - You MUST NOT skip health checks during rollout
   - You SHOULD deploy during low-traffic window
   - You MAY use canary deployment strategy

3. Post-deployment verification
   - You MUST run smoke tests on production
   - You MUST monitor error rates for 15 minutes
   - You MUST verify critical user flows work
   - You SHOULD check performance metrics
   - You SHOULD NOT close deployment until verification complete
   - You MAY run additional integration tests

4. Error handling
   - You MUST execute rollback if error rate exceeds threshold
   - You MUST NOT ignore failing health checks
   - You SHOULD capture logs for debugging
   - You MAY attempt targeted fixes if safe

Common Patterns

Combining Requirements

markdown
## Validation Steps

1. Input validation
   - You MUST validate all required fields are present
   - You MUST check data types match schema
   - You SHOULD validate format (email, phone, etc.)
   - You SHOULD NOT accept malformed input
   - You MAY provide user-friendly error messages

2. If validation fails:
   - You MUST return validation errors to user
   - You MUST NOT proceed to next step
   - You SHOULD log validation failures
   - You MAY suggest corrections

Conditional Requirements

markdown
## Conditional Steps

1. Check feature flag state
   - If feature flag is enabled:
     - You MUST use new implementation
     - You SHOULD monitor adoption metrics
   - If feature flag is disabled:
     - You MUST use legacy implementation
     - You MUST NOT access new feature code paths

Progressive Enhancement

markdown
## Implementation Levels

### Minimum Viable (MUST)
- You MUST implement core functionality
- You MUST add error handling
- You MUST include basic tests

### Recommended (SHOULD)
- You SHOULD add logging
- You SHOULD document public APIs
- You SHOULD optimize common paths

### Optional (MAY)
- You MAY add performance monitoring
- You MAY include usage analytics
- You MAY create detailed examples

Anti-Patterns

Avoid These RFC 2119 Mistakes:

  1. Overusing MUST

    • ❌ "You MUST use 2 spaces for indentation"
    • ✅ "You SHOULD follow project code style"
  2. Weak MUST Statements

    • ❌ "You MUST try to write good code"
    • ✅ "You MUST pass all linter checks"
  3. Missing Negative Forms

    • ❌ "You SHOULD avoid using eval()"
    • ✅ "You SHOULD NOT use eval() except in sandboxed contexts"
  4. Vague MAY Statements

    • ❌ "You MAY improve the code"
    • ✅ "You MAY add performance optimizations if metrics show bottlenecks"
  5. Conflicting Requirements

    • ❌ "You MUST validate input" + "You MAY skip validation for performance"
    • ✅ "You MUST validate untrusted input" + "You MAY cache validation results"

Keyword Selection Guide

Use MUST when

  • ✅ Skipping the step causes errors or data corruption
  • ✅ Security or privacy is at stake
  • ✅ Step is prerequisite for subsequent steps
  • ✅ Violating requirement breaks system invariants

Use SHOULD when

  • ✅ Following guideline improves quality or maintainability
  • ✅ Best practice but alternatives exist
  • ✅ Strongly recommended but context may vary
  • ✅ Performance or readability benefit

Use MAY when

  • ✅ Truly optional enhancement
  • ✅ User preference or style choice
  • ✅ Context-dependent decision
  • ✅ No impact on correctness or quality

Related Skills

  • sop-authoring: Learn to write effective SOP instructions
  • sop-structure: Organize SOPs with proper sections
  • sop-maintenance: Keep SOPs accurate and current

常见问题

Sop Rfc2119 AI 技能有什么作用?

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.

为什么在 TypingMind 中使用 Sop Rfc2119?

因为您只需安装一次,就能搭配任何模型使用。Sop Rfc2119 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Sop Rfc2119?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/zenobi-us/dotfiles/tree/master/files/devtools/agent/bundles/agent-core/skills/sop/sop-rfc2119。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Sop Rfc2119?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Sop Rfc2119 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Sop Rfc2119 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Sop Rfc2119 AI 技能免费吗?

是的。zenobi-us 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇