Agent skill
prism-syntax
Use when adding syntax highlighting for custom languages to Prism.js, used by Docusaurus and many documentation sites
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/prism-syntax
SKILL.md
Prism.js Syntax Highlighting
Quick Start
Prism.languages.mylang = {
'comment': /\/\/.*/,
'string': /"(?:\\.|[^"\\])*"/,
'keyword': /\b(?:if|else|while|for|return)\b/,
'number': /\b\d+(?:\.\d+)?\b/,
'operator': /[+\-*/%=<>!&|]+/,
'punctuation': /[{}[\];(),.:]/
};
Token Types (CSS Classes)
comment- Commentsstring- String literalskeyword- Language keywordsnumber- Numeric literalsoperator- Operatorspunctuation- Punctuation marksfunction- Function namesclass-name- Type/class namesproperty- Object propertiesboolean- true/falsebuiltin- Built-in functions
Pattern Techniques
{
// Lookbehind for context
'function': {
pattern: /(\bfunction\s+)\w+/,
lookbehind: true
},
// Nested grammar
'interpolation': {
pattern: /\$\{[^}]+\}/,
inside: {
'variable': /\$\{|\}/,
'expression': { pattern: /[\s\S]+/, inside: Prism.languages.javascript }
}
},
// Greedy matching
'string': { pattern: /"(?:\\.|[^"\\])*"/, greedy: true }
}
Docusaurus Integration
// docusaurus.config.js
module.exports = {
themeConfig: {
prism: {
additionalLanguages: ['mylang'],
theme: require('prism-react-renderer').themes.github,
}
}
};
// Create src/prism/prism-mylang.js and import in src/theme/prism-include-languages.js
Reference Files
- references/tokens.md - Complete token reference
- references/patterns.md - Advanced pattern techniques
- references/docusaurus.md - Docusaurus integration
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?