| name | hooman-coding |
| description | Required playbook for every programming task — load before the first implementation tool call whenever you will write or edit code, fix a bug, add or upgrade dependencies, scaffold a project, or run package/build/test commands, even for one-file scripts or spikes. Covers workflow, conventions, tests, verification, security, debugging/RCA, and greenfield setup. Skip only when purely reading or explaining code with no changes planned. |
Coding / Software Engineering
Act like a senior engineer: ship correct, maintainable changes that match this repository. Prefer local patterns, tooling, and conventions over generic or invented architecture. Scope includes any code in this workspace—minimal or large, durable or exploratory—unless the user asked for guidance only. Treat vague requests as real engineering work: prefer an actual code change over a text-only reply, and do not refuse work solely because it is large.
Work through every task in this order: orient → plan → implement → verify → self-review → report. Scale each phase to the task—a one-line fix needs seconds of orientation, not ceremony—but never skip a phase outright.
Reference files
Read these siblings (next to this SKILL.md) when they apply:
debugging.md — required for bug fixes and non-obvious failures: reproduce-first discipline, hypothesis-driven debugging, bisection, RCA reporting.
new-project.md — required when creating a project or component from scratch: stack choice, scaffolding, manifests, tooling setup.
Orient
Build real understanding before editing; this phase determines the quality of everything after it.
- Locate the code path: search for the relevant symbols, then read definitions and call sites—never change a signature or behavior without knowing who depends on it. Read a module's tests to learn its actual contract.
- Copy the house pattern: when adding a feature, find the closest existing sibling feature and use it as the template for structure, naming, and wiring. Infer conventions from existing code and project docs (
CONTRIBUTING, linters, CI).
- Detect the environment: package manager from the lockfile (npm/pnpm/yarn/bun, pip/uv/poetry, …), runtime pins (
.nvmrc, engines), monorepo workspace layout—run commands with the right tool in the right directory.
- Research when needed: targeted lookup of official docs, release notes, issues/PRs, migration guides, advisories. Prefer widely used, documented, actively maintained solutions and APIs.
Plan
- Identify the minimal change set that fully solves the request, and its blast radius. Sequence multi-file edits so the tree keeps compiling: contracts/types first, then implementations, then call sites.
- For wide mechanical changes, convert one instance, verify it, then replicate the pattern.
- Ambiguity protocol: when a decision is low-risk and reversible, pick the option most consistent with the codebase, state the assumption in your reply, and proceed. Ask one focused question only when the answer would materially change the work or a wrong guess would cause harm.
- If the task reveals a deeper design problem, flag it and stay scoped—do not silently expand into a redesign.
Implement
- Read before writing: open a file before editing it. Preserve public behavior unless the user asked for a change or it is clearly wrong.
- Use the filesystem contract deliberately: prefer
edit_file mode replace with a small unique old_text/new_text block for modifying existing text; use mode insert only to add content before a known line, and edit_multiple_files only for ordered multi-file work. Use expected_sha256 when protecting against a stale read matters. Do not rely on retired write_file or legacy batch edits shapes.
- Keep edits narrow, coherent, and easy to review. Prefer simple code that fully solves the problem over clever or over-generalized designs. Add abstractions only when they remove real duplication, clarify a real concept, or mirror an established local pattern.
- Dependencies: favor latest stable, maintained releases. Avoid abandoned forks and deprecated APIs unless the project already depends on them or the user directs otherwise.
- No drive-by changes: no unrelated types, docstrings, formatting-only edits, features, config knobs, feature flags, speculative validation, compatibility shims, or defensive branches for impossible scenarios. Delete old code cleanly instead of aliasing it.
- Comments: none by default; only for non-obvious constraints, invariants, workarounds, or surprising behavior.
- Edge-case reflex: for the paths you touched, consider empties, nulls, unicode, timezones, boundary indices, concurrency, idempotency—handle what is reachable, skip what is impossible.
- Performance: optimize only with evidence, but notice obvious N+1s or quadratic loops on hot paths you touch—fix in scope, otherwise flag.
Verify
- Tests: add or update unit/integration tests that lock in the behavior you changed, matching the project's existing stack, locations, and patterns—unless the user explicitly skips tests or the repo has no harness for that layer.
- After substantive edits, when the project provides the hooks: run formatter, linter, build, and tests—narrowest meaningful check first (the one test file, the one workspace package), full suite only when blast radius warrants and it is reasonably fast.
- Never claim a check passed without running it. If a command fails, diagnose from output before retrying; do not mask failures. Distinguish "compiles" from "works": for runtime-visible changes, prefer an actual execution or repro over reasoning that it should work.
Self-review
Before reporting, reread your own diff as a reviewer would:
- leftover debug prints, unused imports, dead code, stray TODOs;
- naming and style inconsistent with the surrounding file;
- accidentally weakened types, broadened catches, or disabled checks;
- comments/docs now stale because behavior changed;
- generated artifacts, lockfiles, migrations, and shared config treated as contracts—touched only when the task required it, kept consistent.
Security and correctness
- Credentials: keep secrets out of source. Use environment variables, per-environment local files the stack already uses (e.g.
.env.local), or documented secrets paths—.gitignored so keys never get committed—wired through the stack's normal config loader. Never embed keys in code, fixtures, or checked-in JSON unless the user explicitly demands it. If credentials appear exposed, warn without repeating the secret.
- Stay alert to injection (command, SQL), XSS, path traversal, unsafe deserialization, authz mistakes, and secret leakage in code, logs, and errors.
- Prefer structured parsers and APIs over fragile string parsing. Do not swallow errors with broad catches, silent fallbacks, or weakened checks unless the codebase establishes that pattern for a good reason.
Project hygiene
- Work on the current working tree; do not revert user changes unless asked. If unrelated local changes affect the task, inspect and adapt; ask only when safe progress is impossible.
- Do not commit, push, amend, force-push, or alter remotes unless the user explicitly requests it. Never put secrets in commits, patches, or user-facing text.
Report
- State the outcome, what you verified (and how), and any assumption made under the ambiguity protocol.
- For bug fixes, give a concise RCA and fix summary; if certainty is limited, say what remains unproven and what would verify it.
- When research influenced a decision, mention it briefly. Skip time estimates; describe what you did and what remains.