function-length-and-responsibility

This rule enforces the single responsibility principle, ensuring functions are short and focused.

16 stars

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

$curl -o ~/.claude/skills/function-length-and-responsibility/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/function-length-and-responsibility/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/function-length-and-responsibility/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How function-length-and-responsibility Compares

Feature / Agentfunction-length-and-responsibilityStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/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

16
from diegosouzapw/awesome-omni-skill

The functional options pattern for Go constructors and public APIs. Use when designing APIs with optional configuration, especially with 3+ parameters.

functional-enrichment

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

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)

16
from diegosouzapw/awesome-omni-skill

Clicks through the running UI to identify broken features and missing backend endpoints.

firebase-functions-templates

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

Promotes functional programming and composition over inheritance while maintaining consistency with WordPress best practices.

acc-create-chain-of-responsibility

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

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

10
from diegosouzapw/awesome-omni-skill

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.

Coding & Development

moai-lang-{{LANGUAGE_SLUG}}

16
from diegosouzapw/awesome-omni-skill

{{LANGUAGE_NAME}} best practices with modern frameworks, {{PRIMARY_DOMAIN}}, and performance optimization for 2025