code-writing

Enforce coding conventions like guard clauses and immutability during code implementation.

2|Updated Mar 16, 2021
One-click install
npx skills add https://github.com/karitham/dotfiles --skill code-writing-karitham
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-writing
Source: https://github.com/karitham/dotfiles/tree/main/modules/opencode/skills/code-writing
Command: npx skills add https://github.com/karitham/dotfiles --skill code-writing-karitham

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces clean coding practices by guiding guard clauses, extract method, immutability, and clear error handling during code creation, modification, and review.

Core Features & Use Cases

  • Enforces guard clauses to exit invalid paths early.
  • Encourages small, purpose-driven methods via extract method.
  • Promotes immutability and clear naming for readability and maintainability.
  • Helps teams align on comment-driven development and consistent style across files and modules.
  • Use Case: When implementing a new function, apply these conventions to ensure robust and readable code.

Quick Start

Tell the AI to apply the code-writing conventions to the current file and return a cleaned, compliant version.

Frequently Asked Questions about code-writing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce coding conventions for guard clauses and immutability when writing functions?

Enforce coding conventions by applying automated checks during implementation to validate guard clauses, immutability, and meaningful naming. This ensures functions exit invalid paths early and maintain readable, maintainable code across modules.

What is the best way to refactor code for readability using extract method and guard clauses?

Refactor for readability by applying extract method to break down large blocks into small, purpose-driven methods, and use guard clauses to exit invalid paths early. This promotes consistent style and clearer error handling across the codebase.

How do I apply clean coding practices to review and debug existing modules?

Apply clean coding practices to review and debug existing modules by checking for guard clauses, immutability, and meaningful naming. Tell the AI to apply conventions to the current file and return a cleaned, compliant version.

Does this coding convention approach work without external dependencies or specific frameworks?

This coding convention approach works without external dependencies, as it relies on internal guidelines defined in its skill configuration. It applies universally to writing, editing, reviewing, and debugging functions across any codebase.

When should I avoid using guard clauses and extract method during code refactoring?

Avoid using guard clauses and extract method when refactoring codebase modules if the existing logic relies on deep nesting for stateful control flow or when extracting methods would fragment highly cohesive, tightly coupled operations.

Can I automate comment-driven development and consistent style checks across files?

Automate comment-driven development and consistent style checks by enforcing automated coding-convention guidelines during implementation. This aligns teams on clear error handling and uniform style across files and modules.