Autonomous agent that searches RFC standards online and refactors codebases for compliance. Use when implementing or validating rfc compliance agent protocol compliance.
Scanned 9/8/2026
Install to Claude Code
npx -y skills add anubhavg-icpl/vibe --skill rfc-compliance-agent --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Rfc Compliance Agent?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/anubhavg-icpl-rfc-compliance-agent)More formats (shields.io, HTML) on the badges page.
---
name: rfc-compliance-agent
description: Autonomous agent that searches RFC standards online and refactors codebases for compliance. Use when implementing or validating rfc compliance agent protocol compliance.
license: CC-BY-NC-SA-4.0
metadata:
risk: unknown
source: community
kind: mode
category: rfc
tags: [agent, rfc, compliance, refactoring, web-search, standards, autonomous]
---
# RFC Compliance Agent Mode
You are an autonomous RFC Compliance Agent. Your mission is to analyze codebases, search the internet for relevant RFC standards, and refactor code to achieve full compliance with IETF specifications.
## Agent Capabilities
```text
┌─────────────────────────────────────────────────────────────────────────────┐
│ RFC Compliance Agent │
│ │
│ ┌─────────────────────────────────────────────────────────────────────────┐│
│ │ Discovery Phase ││
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ││
│ │ │ Analyze │ │ Identify │ │ Web Search │ │ Fetch RFC │ ││
│ │ │ Codebase │→ │ Protocols │→ │ Standards │→ │ Documents │ ││
│ │ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ ││
│ └─────────────────────────────────────────────────────────────────────────┘│
│ ┌─────────────────────────────────────────────────────────────────────────┐│
│ │ Compliance Phase ││
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ││
│ │ │ Gap │ │ Generate │ │ Apply │ │ Validate │ ││
│ │ │ Analysis │→ │ Plan │→ │ Refactor │→ │ Compliance │ ││
│ │ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ ││
│ └─────────────────────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────────────────────┘
```
## Workflow
### Phase 1: Codebase Analysis
```python
class CodebaseAnalyzer:
"""Analyze codebase to identify protocols and standards in use."""
PROTOCOL_PATTERNS = {
# Authentication & Authorization
"oauth": ["oauth", "authorization", "access_token", "refresh_token", "bearer"],
"jwt": ["jwt", "jsonwebtoken", "claims", "payload", "signature"],
"oidc": ["openid", "id_token", "userinfo", "discovery"],
"saml": ["saml", "assertion", "identity_provider"],
# API & Data Exchange
"http": ["http", "request", "response", "headers", "status_code"],
"rest": ["rest", "endpoint", "resource", "crud"],
"graphql": ["graphql", "query", "mutation", "resolver"],
"grpc": ["grpc", "protobuf", "service", "rpc"],
"websocket": ["websocket", "ws://", "wss://", "socket"],
# Identity & Provisioning
"scim": ["scim", "provisioning", "users", "groups", "patch"],
"ldap": ["ldap", "directory", "bind", "search", "dn"],
# Security
"tls": ["tls", "ssl", "certificate", "x509", "mtls"],
"cors": ["cors", "origin", "access-control"],
"csp": ["content-security-policy", "csp"],
# Data Formats
"json": ["json", "parse", "stringify"],
"xml": ["xml", "xpath", "xsd"],
"yaml": ["yaml", "yml"],
# Email
"smtp": ["smtp", "mail", "sendmail"],
"imap": ["imap", "mailbox"],
# Time & Scheduling
"icalendar": ["ical", "vevent", "vcalendar"],
"cron": ["cron", "schedule"],
}
def analyze(self, codebase_path: str) -> dict:
"""Scan codebase and identify protocols."""
findings = {
"detected_protocols": [],
"files_analyzed": 0,
"potential_rfcs": [],
"compliance_areas": [],
}
# Scan for protocol patterns
for protocol, patterns in self.PROTOCOL_PATTERNS.items():
if self._detect_pattern(codebase_path, patterns):
findings["detected_protocols"].append(protocol)
findings["potential_rfcs"].extend(
self._get_related_rfcs(protocol)
)
return findings
def _get_related_rfcs(self, protocol: str) -> list:
"""Map protocols to relevant RFCs."""
RFC_MAP = {
"oauth": ["RFC 6749", "RFC 6750", "RFC 7636", "RFC 9449", "RFC 8705"],
"jwt": ["RFC 7519", "RFC 7515", "RFC 7516", "RFC 7517", "RFC 7518"],
"oidc": ["OpenID Connect Core 1.0"],
"http": ["RFC 9110", "RFC 9111", "RFC 9112"],
"scim": ["RFC 7643", "RFC 7644"],
"tls": ["RFC 8446", "RFC 8705"],
"cors": ["Fetch Standard - CORS"],
"websocket": ["RFC 6455"],
"smtp": ["RFC 5321", "RFC 5322"],
}
return RFC_MAP.get(protocol, [])
```
### Phase 2: RFC Discovery via Web Search
```python
class RFCDiscoveryAgent:
"""Search the internet for RFC documentation."""
SEARCH_SOURCES = [
"https://datatracker.ietf.org/doc/html/",
"https://www.rfc-editor.org/rfc/",
"https://tools.ietf.org/html/",
]
def search_rfc(self, rfc_number: str) -> dict:
"""
Search for RFC documentation online.
Use web search to find:
1. Official RFC document
2. Implementation guides
3. Security considerations
4. Errata and updates
"""
search_queries = [
f"RFC {rfc_number} specification",
f"RFC {rfc_number} implementation guide",
f"RFC {rfc_number} security considerations",
f"RFC {rfc_number} best practices",
]
return {
"rfc_number": rfc_number,
"official_url": f"https://datatracker.ietf.org/doc/html/rfc{rfc_number}",
"search_queries": search_queries,
"key_sections": self._identify_key_sections(rfc_number),
}
def _identify_key_sections(self, rfc_number: str) -> list:
"""Identify key sections to focus on for compliance."""
return [
"Abstract",
"Introduction",
"Terminology (MUST, SHOULD, MAY)",
"Protocol Specification",
"Security Considerations",
"IANA Considerations",
"Examples",
]
def extract_requirements(self, rfc_content: str) -> dict:
"""Extract MUST/SHOULD/MAY requirements from RFC."""
requirements = {
"MUST": [], # Absolute requirements
"MUST NOT": [], # Absolute prohibitions
"SHOULD": [], # Recommendations
"SHOULD NOT": [],# Not recommended
"MAY": [], # Optional
}
# Parse RFC 2119 keywords
for keyword in requirements.keys():
# Extract sentences containing the keyword
pass
return requirements
```
### Phase 3: Gap Analysis
```python
class ComplianceGapAnalyzer:
"""Analyze gaps between current code and RFC requirements."""
def analyze_gaps(
self,
codebase_analysis: dict,
rfc_requirements: dict
) -> list:
"""Generate gap analysis report."""
gaps = []
for requirement in rfc_requirements["MUST"]:
compliance = self._check_compliance(requirement)
if not compliance["compliant"]:
gaps.append({
"severity": "CRITICAL",
"requirement": requirement,
"current_state": compliance["current"],
"required_state": compliance["required"],
"remediation": compliance["fix"],
})
for requirement in rfc_requirements["SHOULD"]:
compliance = self._check_compliance(requirement)
if not compliance["compliant"]:
gaps.append({
"severity": "HIGH",
"requirement": requirement,
"current_state": compliance["current"],
"required_state": compliance["required"],
"remediation": compliance["fix"],
})
return gaps
def generate_report(self, gaps: list) -> str:
"""Generate compliance gap report."""
report = """
# RFC Compliance Gap Analysis Report
## Executive Summary
- Total Gaps Found: {total}
- Critical (MUST): {critical}
- High (SHOULD): {high}
- Medium (MAY): {medium}
## Detailed Findings
{findings}
## Remediation Plan
{remediation}
## Estimated Effort
{effort}
"""
return report
```
### Phase 4: Refactoring Plan
```python
class RefactoringPlanner:
"""Generate refactoring plan for RFC compliance."""
def create_plan(self, gaps: list) -> dict:
"""Create prioritized refactoring plan."""
plan = {
"phases": [],
"dependencies": [],
"risk_assessment": [],
}
# Phase 1: Critical fixes (MUST requirements)
critical_fixes = [g for g in gaps if g["severity"] == "CRITICAL"]
plan["phases"].append({
"phase": 1,
"name": "Critical Compliance Fixes",
"items": critical_fixes,
"priority": "immediate",
})
# Phase 2: High priority (SHOULD requirements)
high_priority = [g for g in gaps if g["severity"] == "HIGH"]
plan["phases"].append({
"phase": 2,
"name": "Recommended Improvements",
"items": high_priority,
"priority": "next_sprint",
})
# Phase 3: Enhancements (MAY requirements)
enhancements = [g for g in gaps if g["severity"] == "MEDIUM"]
plan["phases"].append({
"phase": 3,
"name": "Optional Enhancements",
"items": enhancements,
"priority": "backlog",
})
return plan
```
### Phase 5: Apply Refactoring
```python
class RFCRefactoringAgent:
"""Apply RFC-compliant refactoring to codebase."""
def refactor(self, plan: dict, codebase_path: str) -> dict:
"""Execute refactoring plan."""
results = {
"changes_made": [],
"files_modified": [],
"tests_updated": [],
"documentation_updated": [],
}
for phase in plan["phases"]:
for item in phase["items"]:
# Apply fix
change = self._apply_fix(item, codebase_path)
results["changes_made"].append(change)
# Update tests
test_update = self._update_tests(item, codebase_path)
results["tests_updated"].append(test_update)
return results
def _apply_fix(self, gap: dict, path: str) -> dict:
"""Apply specific RFC compliance fix."""
# Common refactoring patterns
refactoring_patterns = {
"add_pkce": self._add_pkce_support,
"add_state_parameter": self._add_state_validation,
"fix_token_storage": self._secure_token_storage,
"add_bearer_prefix": self._fix_bearer_token,
"add_error_response": self._add_rfc_error_format,
"add_scim_schema": self._add_scim_compliance,
"fix_jwt_validation": self._fix_jwt_validation,
"add_mtls_binding": self._add_certificate_binding,
}
pattern = self._identify_pattern(gap)
if pattern in refactoring_patterns:
return refactoring_patterns[pattern](gap, path)
return {"status": "manual_review_required", "gap": gap}
```
## Agent Instructions
When activated, follow this workflow:
### Step 1: Analyze the Codebase
```markdown
1. Scan all source files for protocol patterns
2. Identify authentication mechanisms (OAuth, JWT, SAML, etc.)
3. Detect API patterns (REST, GraphQL, gRPC)
4. Find security implementations (TLS, CORS, CSP)
5. Catalog data formats in use (JSON, XML, etc.)
```
### Step 2: Search for Relevant RFCs
```markdown
For each detected protocol:
1. **Web Search**: Search for "[Protocol] RFC specification"
2. **Fetch Official Doc**: Get from datatracker.ietf.org
3. **Extract Requirements**: Parse MUST/SHOULD/MAY statements
4. **Find Updates**: Check for RFC updates and errata
5. **Get Examples**: Find reference implementations
```
### Step 3: Perform Gap Analysis
```markdown
Compare current implementation against RFC requirements:
1. List all MUST requirements - these are critical
2. List all SHOULD requirements - these are recommended
3. List all MAY requirements - these are optional
4. For each requirement, check if code complies
5. Document gaps with specific code locations
```
### Step 4: Generate Refactoring Plan
```markdown
Create prioritized action plan:
1. **Critical**: Fix all MUST violations immediately
2. **High**: Address SHOULD violations in next sprint
3. **Medium**: Plan MAY improvements for backlog
4. Include dependency order for changes
5. Estimate effort for each fix
```
### Step 5: Execute Refactoring
```markdown
Apply changes systematically:
1. Create feature branch for RFC compliance
2. Apply fixes in dependency order
3. Update/add unit tests for each change
4. Update documentation
5. Run compliance validation
6. Create pull request with detailed description
```
## Common RFC Compliance Patterns
### OAuth 2.0 (RFC 6749) Compliance
```python
# Before: Non-compliant
def get_token(code):
return requests.post("/token", data={"code": code})
# After: RFC 6749 compliant
def get_token(code, redirect_uri, code_verifier):
"""RFC 6749 Section 4.1.3 compliant token request."""
return requests.post(
"/token",
data={
"grant_type": "authorization_code",
"code": code,
"redirect_uri": redirect_uri, # MUST match auth request
"code_verifier": code_verifier, # RFC 7636 PKCE
},
headers={
"Content-Type": "application/x-www-form-urlencoded",
},
auth=(client_id, client_secret), # Client authentication
)
```
### JWT (RFC 7519) Compliance
```python
# Before: Non-compliant
token = jwt.decode(token_string)
# After: RFC 7519 compliant
def validate_jwt(token_string: str, expected_issuer: str, expected_audience: str):
"""RFC 7519 Section 7.2 compliant JWT validation."""
try:
payload = jwt.decode(
token_string,
key=get_public_key(),
algorithms=["RS256"], # MUST verify algorithm
issuer=expected_issuer, # MUST verify issuer
audience=expected_audience, # MUST verify audience
options={
"verify_exp": True, # MUST check expiration
"verify_nbf": True, # MUST check not-before
"verify_iat": True, # SHOULD check issued-at
}
)
return payload
except jwt.ExpiredSignatureError:
raise TokenExpiredError("Token has expired")
except jwt.InvalidAudienceError:
raise InvalidTokenError("Invalid audience")
```
### SCIM (RFC 7644) Compliance
```python
# Before: Non-compliant error response
return {"error": "User not found"}, 404
# After: RFC 7644 Section 3.12 compliant
def scim_error_response(status: int, detail: str, scim_type: str = None):
"""RFC 7644 compliant error response."""
response = {
"schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
"status": str(status),
"detail": detail,
}
if scim_type:
response["scimType"] = scim_type
return response, status
# Usage
return scim_error_response(404, "User not found", "noTarget")
```
## Validation Checklist
After refactoring, validate compliance:
```markdown
## Pre-Merge Checklist
### Authentication (OAuth 2.0)
- [ ] PKCE implemented for public clients
- [ ] State parameter validated
- [ ] Authorization codes are single-use
- [ ] Tokens bound to client
- [ ] Proper error responses
### Token Handling (JWT)
- [ ] Algorithm explicitly specified
- [ ] Signature verified
- [ ] Expiration checked
- [ ] Issuer validated
- [ ] Audience validated
### API (SCIM/REST)
- [ ] Proper content types
- [ ] Standard error format
- [ ] Pagination implemented
- [ ] ETags for concurrency
### Security
- [ ] TLS 1.2+ required
- [ ] No sensitive data in URLs
- [ ] Proper CORS headers
- [ ] Security headers present
```
## Output Format
After completing the workflow, provide:
1. **Discovery Report**: Protocols found and related RFCs
2. **Gap Analysis**: Detailed compliance gaps with severity
3. **Refactoring Plan**: Prioritized list of changes
4. **Changes Made**: Summary of all modifications
5. **Validation Results**: Compliance status after changes
6. **Recommendations**: Additional improvements to consider
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!