function-length-and-responsibility
This rule enforces the single responsibility principle, ensuring functions are short and focused.
Best use case
function-length-and-responsibility is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
This rule enforces the single responsibility principle, ensuring functions are short and focused.
Teams using function-length-and-responsibility should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/function-length-and-responsibility/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How function-length-and-responsibility Compares
| Feature / Agent | function-length-and-responsibility | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
This rule enforces the single responsibility principle, ensuring functions are short and focused.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Function Length And Responsibility Skill <identity> You are a coding standards expert specializing in function length and responsibility. You help developers write better code by applying established guidelines and best practices. </identity> <capabilities> - Review code for guideline compliance - Suggest improvements based on best practices - Explain why certain patterns are preferred - Help refactor code to meet standards </capabilities> <instructions> When reviewing or writing code, apply these guidelines: - Write short functions that only do one thing. - Follow the single responsibility principle (SRP), which means that a function should have one purpose and perform it effectively. - If a function becomes too long or complex, consider breaking it into smaller, more manageable functions. </instructions> <examples> Example usage: ``` User: "Review this code for function length and responsibility compliance" Agent: [Analyzes code against guidelines and provides specific feedback] ``` </examples> ## Memory Protocol (MANDATORY) **Before starting:** ```bash cat .claude/context/memory/learnings.md ``` **After completing:** Record any new patterns or exceptions discovered. > ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
Related Skills
go-functional-options
The functional options pattern for Go constructors and public APIs. Use when designing APIs with optional configuration, especially with 3+ parameters.
functional-enrichment
Perform GO and KEGG functional enrichment using HOMER from genomic regions (BED/narrowPeak/broadPeak) or gene lists, and produce R-based barplot/dotplot visualizations. Use this skill when you want to perform GO and KEGG functional enrichment using HOMER from genomic regions or just want to link genomic region to genes.
function-ordering-conventions
Defines the function ordering conventions, where functions that compose other functions appear earlier in the file, regardless of the file type.
Frontend Functional Validator (Detective)
Clicks through the running UI to identify broken features and missing backend endpoints.
firebase-functions-templates
Create production-ready Firebase Cloud Functions with TypeScript, Express integration, HTTP endpoints, background triggers, and scheduled functions. Use when building serverless APIs with Firebase or setting up Cloud Functions projects.
azure-functions
Expert patterns for Azure Functions development including isolated worker model, Durable Functions orchestration, cold start optimization, and production patterns. Covers .NET, Python, and Node.js programming models. Use when: azure function, azure functions, durable functions, azure serverless, function app.
analyze-function
Deep line-by-line analysis of a function or method. Explains what each line does, why it's written that way, performance implications, edge cases, and design patterns. Use when user says "analyze-function", "analyze {function}", "deep dive on {function}", or "explain {function} line by line".
functional-programming-preference
Promotes functional programming and composition over inheritance while maintaining consistency with WordPress best practices.
acc-create-chain-of-responsibility
Generates Chain of Responsibility pattern for PHP 8.5. Creates handler chains for request processing with middleware-style composition. Includes unit tests.
add-private-function-with-signatures
Add private functions from game DLLs (server.dll/engine.dll) to metamod plugins using signature scanning and symbol lookup. Use when adding new private function hooks that require IDA Pro analysis, signature creation, cross-platform support (Windows/Linux), and runtime function pointer filling.
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
moai-lang-{{LANGUAGE_SLUG}}
{{LANGUAGE_NAME}} best practices with modern frameworks, {{PRIMARY_DOMAIN}}, and performance optimization for 2025