Ai development guide

From shinpr/codex-workflows · View interactive version

Ai development guide is an AI agent skill from the GitHub repository shinpr/codex-workflows. Root-cause discipline, proportionate impact analysis, and implementation completeness assurance. Use when fixing bugs, reviewing code quality, refactoring, making technical decisions, or performing quality assurance.

How to use this skill

Skill file

AI Development Guide

Reference

Read references/frontend.md only for React or TypeScript frontend work whose changed behavior or quality failure needs those rules.

Outcome Boundary

Ground the required outcome in the governing task or design sources and the user's explicit instructions. Choose work by what the consumer must be able to do or judge, preserving that result while reducing the means needed to deliver it.

When an unverified premise could invalidate the approach, check it by the cheapest sufficient means before expanding dependent work. When results contradict that premise, reconsider the approach before patching its parts. Keep this reasoning in the current task; a small request needs no additional artifact.

Phase passage permits progress; technical necessity remains a separate evidence-backed lifecycle decision. Reconsider and remove or supersede means recorded in a Design Doc, ADR, plan, AC, or test when the required outcome remains satisfied. Preserve user-required outcomes, explicit constraints, actual consumer contracts, and external-action authority. For authorized feature removal, check remaining consumers; the removed entry point and its now-unused backend create no preservation obligation. Coordinate affected source and consumer updates through the orchestrator; existing execution authority continues for outcome-preserving technical reductions.

Investigate, repair, refactor, and verify only as far as one of these requires:

Evidence makes a candidate evaluable. Adopt work only when it is necessary now and its benefit justifies total lifecycle cost over no change, subtraction, or reuse. A required outcome defect still needs a sufficient response. Keep unrelated debt outside the change.

Root-Cause Discipline

When an observed failure exists:

  1. Reproduce or identify the failing observable condition.
  2. Trace the responsible control, data, or state path until the cause is supported by evidence.
  3. Correct the cause at the smallest responsibility boundary that preserves the governing contract.
  4. Verify the original failure and the affected contract.

Stop causal questioning when the evidence supports the responsible path and its verification. Apply a direct correction when the cause and proof are already evident. Keep root-cause reasoning in the active task or response; create a separate artifact only for a named downstream consumer. Preserve error visibility and test strength, and correct the observed cause rather than masking it with an unconditional fallback or symptom patch.

Proportionate Impact Analysis

Before changing code, inspect the target and enough representative callers, consumers, tests, configuration, and siblings to determine:

When the change alters a public, shared, serialized, or persistent contract and its consumers are enumerable, account for every known consumer. For other changes, representative inspection is sufficient. Stop expanding the search when the candidates that could change the implementation or verification decision have been read and judged; a search with no match shows only that the search found nothing. Record findings in the active task or response only when another worker needs them.

For an observed bug or regression, inspect adjacent cases that share its supported cause, contract, or state boundary. Include an adjacent case in the change only when leaving it unchanged would keep the same in-scope failure active.

Design and Reuse Judgment

Error and Fallback Safety

Preserve useful error context and keep failures observable. Limit fallbacks to degraded behavior defined by a requirement, accepted design, or representative repository contract. Limit logging, metrics, and operational machinery to those supported by the current outcome or representative repository practice.

Quality Assurance

Discover applicable checks from the changed file types, task verification methods, project manifests, configuration, and CI. Run:

  1. the focused check that observes the changed behavior or artifact;
  2. static analysis, formatting, build, unit, integration, or E2E commands that the repository or governing task requires for this change;
  3. any wider check needed because the change crosses that boundary.

Limit checks, thresholds, environments, external connections, and test lanes to those required by the repository or governing artifact. Reuse valid task-specific evidence; rerun it after a later fix that can invalidate it.

Fix failures caused by the current change and failures within required dependencies. Report unrelated baseline failures with evidence; they block completion only when they prevent the changed outcome from being verified.

Completion Gate

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.