Internet RFC Skill#
Comprehensive skill for working with IETF RFCs in OCaml projects.
Features#
- 📥 Fetch RFCs in plain text and save to
spec/directory - 📝 Generate OCamldoc citations with proper formatting
- 🔗 Link code to RFC sections with specific references
- ✅ Validate RFC references in existing code
- 💡 Suggest improvements for RFC documentation
Usage#
Invoke the skill#
# In Claude Code CLI
@internet-rfc <your request>
Example Prompts#
Fetch and document an RFC:
@internet-rfc I'm implementing RFC 6265 for HTTP cookies.
Please fetch the RFC and help me document the module.
Add RFC citations to existing code:
@internet-rfc Review lib/punycode.mli and add proper RFC 3492
citations to all functions.
Validate RFC implementation:
@internet-rfc Check if our RFC 5891 implementation matches
all the MUST requirements in the spec.
Improve existing documentation:
@internet-rfc Look at our IDNA module and suggest where we should
add RFC references to make the documentation clearer.
What the Skill Does#
1. Fetches and Stores RFCs#
- Downloads from
https://datatracker.ietf.org/doc/html/rfcXXXX.txt - Saves to
spec/rfcXXXX.txtin your project - Creates
spec/directory if needed
2. Generates Proper OCamldoc Links#
Converts plain text references like "RFC 3492 Section 6.1" into:
{{:https://datatracker.ietf.org/doc/html/rfc3492#section-6.1}RFC 3492 Section 6.1}
3. Links Code to Specs#
Adds comprehensive documentation:
val encode : Uchar.t array -> (string, error) result
(** [encode codepoints] encodes Unicode code points to Punycode.
Implements {{:https://datatracker.ietf.org/doc/html/rfc3492#section-6.3}
RFC 3492 Section 6.3} encoding procedure. *)
4. Validates References#
- Checks RFC numbers exist
- Verifies section numbers are correct
- Ensures URL format is proper
- Validates implementation matches spec
5. Suggests Improvements#
Analyzes code and suggests where to add:
- Missing RFC citations
- Section-specific references
- Error condition documentation
- Parameter documentation
File Structure#
your-project/
├── spec/
│ ├── rfc3492.txt # Punycode spec
│ ├── rfc5891.txt # IDNA spec
│ └── rfc6265.txt # HTTP cookies spec
├── lib/
│ ├── module.ml
│ └── module.mli # With RFC citations
└── README.md
RFC Citation Format#
Basic Reference#
{{:https://datatracker.ietf.org/doc/html/rfc3492}RFC 3492}
Section-Specific#
{{:https://datatracker.ietf.org/doc/html/rfc3492#section-6.1}RFC 3492 Section 6.1}
Appendix#
{{:https://datatracker.ietf.org/doc/html/rfc3492#appendix-A}RFC 3492 Appendix A}
Best Practices#
The skill follows these best practices automatically:
✅ Always uses plain text RFC files
✅ Stores RFCs locally in spec/ directory
✅ Links functions to specific sections
✅ Documents error types with RFC requirements
✅ Keeps citation format consistent
✅ References "why" from RFC, not just "what"
Examples from Real Projects#
Punycode (RFC 3492)#
(** RFC 3492 Punycode: A Bootstring encoding of Unicode for IDNA.
This module implements the Punycode algorithm as specified in
{{:https://datatracker.ietf.org/doc/html/rfc3492}RFC 3492}. *)
val adapt : delta:int -> numpoints:int -> firsttime:bool -> int
(** Implements the bias adaptation algorithm from
{{:https://datatracker.ietf.org/doc/html/rfc3492#section-6.1}
RFC 3492 Section 6.1}. *)
IDNA (RFC 5891)#
type error =
| Label_too_long of int
(** Label exceeds 63 bytes per
{{:https://datatracker.ietf.org/doc/html/rfc1035}RFC 1035}. *)
When to Use#
Use this skill when you:
- Start implementing a new RFC
- Need to document RFC compliance
- Want to improve existing RFC documentation
- Need to validate implementation against spec
- Are reviewing code that implements standards
Tips#
- Always mention the RFC number in your prompt
- Be specific about what you need (fetch, document, validate, etc.)
- Point to the module/file you want to work with
- The skill will read existing RFCs from
spec/if available - Use section numbers when you know them for more precise results
Troubleshooting#
RFC not found?
- Verify the RFC number exists
- Check if it's a draft (use draft name instead)
Links not working in generated docs?
- Make sure odoc is properly configured
- Check URL format matches examples above
Skill not activating?
- Use
@internet-rfcprefix - Or mention "RFC XXXX" prominently in your message
For detailed documentation, see skill.md.