This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This repository converts secure coding patterns from code-snippets-security-utils into Claude Code skills — reusable instruction sets that guide code generation toward secure implementations.
Skills live in .claude/skills/<skill-name>/SKILL.md. Each skill follows the agentskills.io specification.
name: skill-name # must match directory name; lowercase, hyphens only
description: ... # what it does and when to invoke it
allowed-tools: Read Grep Glob # tools the skill may use without approval
metadata:
category: security # all skills in this repo use category: security
security-considerations: # optional, provide information about threats not covered or strictness of controls applied.
- ... Do not add fields outside the agentskills.io spec at the top level. Non-standard fields belong under metadata.
Mandatory or optional presence of fields in the section metadata:
security-considerationsis optional.categoryis mandatory.
Every skill must have:
- An intro line: "Apply all rules below when generating or reviewing any code related to …".
- A numbered section
## 1. <Topic> (CRITICAL)containing:ALWAYS …rule statements (language-agnostic).- A Java BAD/GOOD code example illustrating every rule.
- A
## 2. Output Checklistsection with one checkbox per rule. - A
## Referencessection linking to one or several of the following authoritative sources: OWASP, PORTSWIGGER, MITRE, NIST, ANSSI, SANS, MICROSOFT, ECMA. - A Frontmatter section fully valid according to the rules defined in the section
Frontmatter (valid fields only).
When writing or editing code snippets inside a skill:
- Never wrap lines at 80 columns. Write each logical statement on a single line regardless of length.
- Never add alignment padding. Do not insert extra spaces to align operators, arguments, or comments across lines.
- Let the reader's editor handle soft-wrapping.
Before adding or modifying a skill, verify:
- Rules are language-agnostic (no Java-only wording).
- Code examples cover every stated rule — no rule without corresponding code, no code without a matching rule.
- Numeric limits (sizes, counts, depths) are identical in both the rule text and the code constants.
- Code snippets declare all variables they use.
- Security gaps covered: No case is missing.
- Skill follow a consistent
secure-<subject>-<action>naming pattern. - Code snippets follow the formatting rules defined into the section
Code snippet formatting rules(no 80-column wrapping, no alignment padding).
To validate a skill using the built-in Claude command:
/validate-skill <skill-name> # validate a single skill
/validate-skill all # validate all skills
To check a skill against the agentskills.io spec only:
agentskills validate .claude/skills/<skill-name>The skills-ref tool is the reference validator from agentskills/agentskills.