home / skills / oimiragieo / agent-studio / editing-code-rules

This skill helps enforce and apply code editing guidelines, refactoring, and verbosity control to ensure consistent, high-quality JavaScript code.

npx playbooks add skill oimiragieo/agent-studio --skill editing-code-rules

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
1.5 KB
---
name: editing-code-rules
description: Prioritizes the method for editing code and defines verbosity levels.
version: 1.0.0
model: sonnet
invoked_by: both
user_invocable: true
tools: [Read, Write, Edit]
globs: '*'
best_practices:
  - Follow the guidelines consistently
  - Apply rules during code review
  - Use as reference when writing new code
error_handling: graceful
streaming: supported
---

# Editing Code Rules Skill

<identity>
You are a coding standards expert specializing in editing code rules.
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:

- Editing Code (prioritized choices):
  - Return completely edited file
- Verbosity: I may use V=[0-3] to define code detail:
  - V=0 code golf
  - V=1 concise
  - V=2 simple
  - V=3 verbose, DRY with extracted functions
    </instructions>

<examples>
Example usage:
```
User: "Review this code for editing code rules 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.

Overview

This skill helps developers prioritize how code edits are applied and sets verbosity levels for the edits. It enforces a single preferred edit mode (return the completely edited file) and supports four verbosity settings to control the level of detail in edits. The goal is consistent, predictable code changes and clear guidance about why changes are recommended.

How this skill works

The skill inspects code for guideline compliance, suggests improvements, and can return a fully edited file as the primary output. It uses a verbosity parameter V=[0-3] to choose the editing style: V=0 for code-golf minimal edits, V=1 concise edits, V=2 simple clear edits, and V=3 verbose edits that extract reusable functions and emphasize DRY principles. Before starting, it checks a local memory file for prior learnings and after finishing it records any new patterns discovered.

When to use it

  • You need consistent code edits returned as a complete, ready-to-apply file.
  • You want to control how detailed edits and explanations are (from code golf to verbose refactors).
  • You are enforcing or auditing coding standards across a codebase.
  • You want automated refactors that highlight why patterns change and where to reuse functions.

Best practices

  • Always request the desired verbosity level V=[0-3] so edits match your review goals.
  • Prefer V=3 for refactors that should be DRY and maintainable; use V=1 for quick, minimal fixes.
  • Provide the full file or relevant module to enable returning a complete edited file.
  • Treat the skill's output as authoritative for formatting and structure, then run tests before merge.
  • Record discovered patterns after review to improve future consistency.

Example use cases

  • Submit a JavaScript module and ask for a V=3 edit to extract repeated logic into helper functions.
  • Request a V=0 pass to minimize characters for a code-golf challenge.
  • Ask for a V=1 concise cleanup to remove obvious style issues without architecture changes.
  • Run a batch audit to ensure all files follow a chosen standard and receive full-file replacements.

FAQ

Do I have to use the verbosity parameter?

No, but specifying V=[0-3] yields predictable edit styles. If not provided, the skill defaults to V=2 (simple).

Will the skill modify only snippets or always return the whole file?

The prioritized behavior is to return the completely edited file. If you need a patch-only response, request it explicitly and accept potential deviation from the primary preference.