least-astonishment

Guide code changes to follow existing patterns and conventions.

Updated Apr 11, 2023
One-click install
npx skills add https://github.com/salverius-tech/dotfiles --skill least-astonishment
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: least-astonishment
Source: https://github.com/salverius-tech/dotfiles/tree/main/home/dot_claude/skills/least-astonishment
Command: npx skills add https://github.com/salverius-tech/dotfiles --skill least-astonishment

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers write code that behaves as users and other developers would expect, preventing surprising or counter-intuitive changes that can lead to bugs and confusion.

Core Features & Use Cases

  • Predictable Changes: Ensures code modifications align with existing patterns and conventions.
  • Scope Management: Prevents unintended side effects or scope creep during development.
  • Use Case: When refactoring a function, this Skill guides you to ensure the new version behaves consistently with its name and the surrounding code, avoiding unexpected return types or hidden mutations.

Quick Start

Activate the least-astonishment skill before making any code changes to ensure they are predictable.

Frequently Asked Questions about least-astonishment

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

FAQPage Schema
What is the Principle of Least Astonishment in software development?

The Principle of Least Astonishment (POLA) is a development principle stating that code should behave as users and other developers expect, preventing counter-intuitive changes that cause bugs and confusion.

How do I ensure my code refactoring follows existing conventions?

To ensure refactoring follows existing conventions, activate this Skill before making changes to guide you toward predictable modifications, consistent naming, and minimal, focused diffs that align with surrounding code patterns.

How do I prevent scope creep and unintended side effects during code modifications?

Prevent scope creep and unintended side effects during code modifications by enforcing strict adherence to existing patterns and requiring minimal, focused diffs that avoid surprising behavior or hidden mutations.

When should I apply the Principle of Least Astonishment during code review?

Apply the Principle of Least Astonishment during code review whenever evaluating API changes or refactoring to ensure the new code behaves consistently with its name and the existing codebase, avoiding unexpected return types.

Does the Principle of Least Astonishment require any specific frameworks or dependencies?

The Principle of Least Astonishment requires no specific frameworks or dependencies, serving as a basic guideline applicable across all code modifications, refactoring, and API changes regardless of your tech stack.