coding
Coding workflow covering discovery, planning, implementation, and verification. Invoke whenever task involves any interaction with code — writing, modifying, debugging, refactoring, or understanding codebases. Runs discovery protocol before language-specific skills engage.
What this skill does
# Coding **Discover before assuming. Verify before shipping.** Every coding failure traces to one of three root causes: - Acting on assumptions instead of evidence - Skipping verification before declaring done - Burning context on noise instead of signal This skill prevents all three. ## Core Loop Every task follows this sequence. No exceptions. ``` Discover → Plan → Implement → Verify ``` - **Discover**: Read the code. Trace dependencies. Understand what exists. - **Plan**: Define success criteria. Scope the change. Identify risks. - **Implement**: Write minimal code. Work incrementally. Stay simple. - **Verify**: Run tests. Validate behavior. Confirm requirements met. The loop exists because each step prevents a category of failure. Skipping discovery causes wrong assumptions. Skipping planning causes scope creep. Skipping verification ships broken code. **The threshold**: if you can describe the diff in one sentence, skip planning. Otherwise, plan first. ## The Assumption Interrupt This pattern must become automatic in your reasoning: <cognitive-interrupt> WHENEVER you find yourself: - Using a method/type/interface without having read its definition - Using words like "probably", "likely", "should have", "typically" - Recalling an API from memory instead of reading current source - Planning changes to code you haven't read in this session - Assuming a method signature, type structure, or interface shape STOP. Ask yourself: 1. "Do I have evidence in current context that this exists?" 2. "Have I actually read this code, or am I assuming?" 3. If no evidence exists → VERIFY before proceeding. Every unverified assumption is a potential compile failure, runtime bug, or behavioral regression. </cognitive-interrupt> <assumption-markers> These words in your reasoning are RED FLAGS: - "probably" → You don't know. Read it. - "likely" → You're guessing. Check it. - "should have" → Assumption. Verify it. - "typically" → General knowledge, not this codebase. Read it. - "I remember" → Memory is unreliable. Read it now. - "usually" → This codebase may differ. Check it. </assumption-markers> ## Discovery Protocol Before planning or implementing, map the territory. <discovery-protocol> ### 1. Map the Area - Read files in the target directory - Understand package/module structure - Identify related files and established patterns ### 2. Trace Dependencies - What does this code import/use? - What imports/uses this code? - Search for usages: grep for function/type names ### 3. Verify Contracts - Read actual method signatures — don't assume - Read interface and type definitions - For third-party code: read vendored source OR fetch docs - Verify: function exists, signature matches, types correct ### 4. Assess Impact - Who calls what you're modifying? - What tests cover this code? - What might break? </discovery-protocol> Discovery is cheap. Debugging wrong assumptions is expensive. ## Planning Discipline Before writing code, establish: <planning-checklist> - **Success criteria** — What does "done" look like? Define measurable outcomes, not vague goals. Bad: "improve the API" Good: "add pagination to /api/users, 100 items/page, response under 200ms" - **Scope** — What files change? What stays untouched? Explicitly bound the change. Don't "helpfully improve" adjacent code. - **Risks** — What could break? If modifying shared code, trace all callers first. - **Verification strategy** — How will you prove it works? Tests > manual check > "it looks right". Define this BEFORE writing any implementation code. </planning-checklist> ## Implementation Discipline ### Work Incrementally Don't one-shot complex features. <incremental-rules> - One logical change at a time - Verify each change works before moving to the next - If a change touches 5+ files, break it into smaller steps - Leave the codebase in a clean, working state at every step - For multi-step tasks: track completed steps and remaining work </incremental-rules> ### Write Simple Code Agents overcomplicate by default. Actively resist this. <simplicity-rules> - Prefer functions over classes when either works - Avoid inheritance unless the problem demands it - Prefer explicit over implicit — no magic - Keep permission checks and validation visible at the call site, not hidden in middleware the next reader won't find - Use descriptive names — longer is better than ambiguous - Do the simplest thing that works, then optimize if measured performance requires it - Prefer deep modules — a small interface hiding substantial implementation — over shallow ones that expose nearly as much as they hide. A wrapper that only forwards calls earns nothing. - Don't introduce a seam (interface, port, strategy) until two concrete implementations need it — typically production plus test. One implementation behind an interface is indirection, not abstraction. - Deletion test before adding an abstraction: imagine the module gone. If its complexity reappears in every caller, it earns its place. If the complexity merely moves, it was a shallow pass-through — inline it. </simplicity-rules> ### Isolate Dependencies for Testing A module is hard to test when a dependency hides behind it. Match the strategy to the dependency's nature instead of reaching for a mock by default. <dependency-rules> - **Pure logic, no I/O** — test through the interface directly. No doubles needed. - **Locally substitutable (in-memory DB, temp filesystem, fake clock)** — run the real code against the substitute. A working stand-in beats a mock. - **A service you own, across the network** — hide it behind a port with two adapters: the real HTTP/RPC one for production, an in-memory one for tests. - **Third-party or external** — inject it behind your own narrow interface and mock that interface, not the vendor SDK. </dependency-rules> ### Follow Existing Patterns Before inventing a new pattern, search the codebase for existing ones. Consistency beats novelty. <pattern-rules> - Search for similar features/components as reference - Match the existing error handling strategy - Use the same testing patterns found in adjacent tests - Follow the project's naming conventions - Read CLAUDE.md and lint config for project-specific rules - When two patterns contradict, pick one (more recent / more tested) — explain the choice, flag the other for cleanup. Never blend conflicting patterns into an average. - If you think an existing convention is harmful, surface it explicitly. Don't fork it silently. </pattern-rules> ### Refactor Targets When the goal is to improve existing code, hunt for named smells and apply the matching move. Naming the smell turns "this feels messy" into a concrete change. <refactor-targets> - **Duplication** — extract a shared function or type. - **Long function doing several things** — split it along the boundaries of what it does. - **Shallow module** (interface nearly as large as its implementation) — deepen it, or fold it into its caller. - **Feature envy** (a function reaching repeatedly into another type's internals) — move the logic to the data it operates on. - **Primitive obsession** (bare strings or ints carrying domain meaning) — introduce a value type. </refactor-targets> ## Verification Discipline Verification is the single highest-leverage activity. Code that "looks right" but hasn't been tested is unverified code. <verification-protocol> ### Before Declaring Done 1. **Run the tests** — If tests exist, run them. If they don't exist for the code you changed, write them. 2. **Check for regressions** — If you modified existing behavior, run the full relevant test suite, not just new tests. 3. **Check both axes — spec and standards.** _Spec:_ does it do what was actually asked — the success criteria defined during planning — not merely something plausible? _Standards:_ does it follow this repo's documented conventions (CLAUDE.md, lint and type config, ADRs)? Che
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.