how-to-code

Guide code design, implementation, and review to reduce hidden state and architectural drift.

Updated Jul 17, 2026
One-click install
npx skills add https://github.com/kartikkabadi/skills --skill how-to-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: how-to-code
Source: https://github.com/kartikkabadi/skills/tree/main/how-to-code
Command: npx skills add https://github.com/kartikkabadi/skills --skill how-to-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid sloppy architecture, hidden state, brittle boundaries, and overcomplicated code by giving you a disciplined way to think before you write or review software.

Core Features & Use Cases

  • Engineering Taste: Build small cores, explicit lifecycle boundaries, and durable state that can be reconstructed reliably.
  • Architecture Guidance: Organize packages, modules, and dependencies so core logic stays isolated from adapters, UI, storage, and runtime concerns.
  • Code Quality Rules: Apply principles like KISS, YAGNI, SRP, DIP, OCP, DRY, strict typing, and fail-fast invariants to everyday implementation decisions.
  • Use Case: Before changing a subsystem, use this Skill to decide what belongs in core logic, what belongs at the edge, and how to keep the diff reviewable and maintainable.

Quick Start

Use the how-to-code skill to review this feature design and tell me how to structure the modules, state, and dependencies before I start coding.

Frequently Asked Questions about how-to-code

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

FAQPage Schema
How do I structure software modules and dependencies to prevent architectural drift?

To prevent architectural drift, organize packages and modules so core logic stays isolated from adapters, UI, storage, and runtime concerns. This ensures explicit dependency direction and keeps boundaries durable across general software projects.

What is the best way to plan a refactoring strategy for hidden state and brittle boundaries?

Refactoring hidden state and brittle boundaries requires building small cores with explicit lifecycle boundaries. You must separate durable state that can be reconstructed reliably from edge components to maintain a maintainable architecture.

How do I apply software architecture principles like SRP and DIP during code review?

Apply KISS, YAGNI, SRP, DIP, OCP, DRY, strict typing, and fail-fast invariants during code review to guide everyday implementation decisions. This enforces disciplined handling of lifecycle boundaries and explicit contracts.

Does this code design guidance work for auditing package structure in existing systems?

Yes, this guidance applies to auditing package structure in existing systems by evaluating dependency direction and isolating core logic. It helps identify hidden state and enforces strict boundaries during subsystem changes.

When should I not use strict module isolation in my codebase?

Strict module isolation should be carefully balanced against overcomplicated code. While isolating core logic is generally recommended, you must apply KISS and YAGNI principles to avoid creating unnecessary complexity for simple features.