skills/ai-development-guide/SKILL.md
Technical decision criteria, anti-pattern detection, debugging techniques, and quality check workflow. Use when making technical decisions, detecting code smells, or performing quality assurance.
npx skillsauth add jcchikikomori/opencode-workflow ai-development-guideInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Immediately stop and reconsider design when detecting the following patterns:
Make all errors visible and traceable with full context. Prioritize primary code reliability over fallback implementations. Excessive fallback mechanisms mask errors and make debugging difficult.
Infrastructure Layer:
Application Layer:
Review Triggers (require design review):
Before Implementing Any Fallback:
AVOID: Silent fallback that hides errors
<handle error>:
return DEFAULT_VALUE // Error hidden, debugging impossible
PREFERRED: Explicit failure with context
<handle error>:
log_error('Operation failed', context, error)
<propagate error> // Re-throw exception, return Error, return error tuple
Adaptation: Use language-appropriate error handling (exceptions, Result types, error tuples, etc.)
How to handle duplicate code based on Martin Fowler's "Refactoring":
| Duplication Count | Action | Reason | |-------------------|--------|--------| | 1st time | Inline implementation | Cannot predict future changes | | 2nd time | Consider future consolidation | Pattern beginning to emerge | | 3rd time | Implement commonalization | Pattern established |
Cases for Commonalization
Cases to Avoid Commonalization
// Immediate commonalization on 1st duplication
validateUserEmail(email) { /* ... */ }
validateContactEmail(email) { /* ... */ }
// Commonalize on 3rd occurrence with context parameter
validateEmail(email, context) { /* ... */ }
// context: 'user' | 'contact' | 'admin'
Adaptation: Use appropriate abstraction for your codebase (functions, classes, modules, configuration)
Symptom: Fixing one error causes new errors Cause: Surface-level fixes without understanding root cause Avoidance: Identify root cause with 5 Whys before fixing
Symptom: Bypassing safety mechanisms (type systems, validation, contracts) Cause: Impulse to avoid correctness errors Avoidance: Use language-appropriate safety mechanisms (static checking, runtime validation, contracts, assertions)
Symptom: Many bugs after implementation Cause: Ignoring Red-Green-Refactor process Avoidance: Always start with failing tests
Symptom: Frequent unexpected errors when introducing new technology Cause: Assuming "it should work according to official documentation" without prior investigation Avoidance:
Certainty: low (Reason: no working examples found for this integration)
Exploratory implementation: true
Fallback: use established alternative approach
Symptom: Duplicate implementations, architecture inconsistency, integration failures, adopting outdated patterns Cause: Insufficient understanding of existing code before implementation; referencing only nearby files without verifying representativeness Avoidance Methods:
Example:
Symptom: Build error
Why1: Contract definitions don't match → Why2: Interface was updated
Why3: Dependency change → Why4: Package update impact
Why5: Major version upgrade with breaking changes
Root cause: Inappropriate version specification in dependency manifest
To isolate problems, attempt reproduction with minimal code:
Pattern: Structured logging with context
{
context: 'operation-name',
input: { relevant, input, data },
state: currentState,
timestamp: current_time_ISO8601
}
Key elements:
- Operation context (what is being executed)
- Input data (what was received)
- Current state (relevant state variables)
- Timestamp (for correlation)
Before executing quality checks, identify what quality mechanisms exist for the change area:
Universal quality assurance phases applicable to all languages:
All checks must pass before proceeding:
Workflow:
1. Format check → 2. Lint/Style → 3. Static analysis →
4. Build/Compile → 5. Unit tests → 6. Coverage check →
7. Integration tests → 8. Final gate
Auto-fix capabilities (when available):
- Format auto-fix
- Lint auto-fix
- Dependency/import organization
- Simple code smell corrections
Complete these stages sequentially before any implementation:
1. Discovery - Identify all affected code:
2. Understanding - Analyze each discovered location:
3. Identification - Produce structured report:
## Impact Analysis
### Direct Impact
- [Unit]: [Reason and modification needed]
### Indirect Impact
- [System]: [Integration path → reason]
### Data Flow
[Source] → [Transformation] → [Consumer]
### Risk Assessment
- High: [Complex dependencies, fragile areas]
- Medium: [Moderate coupling, test gaps]
- Low: [Isolated, well-tested areas]
### Implementation Order
1. [Start with lowest risk or deepest dependency]
2. [...]
Critical: Do not implement until all 3 stages are documented
When unused code is detected:
In use? No → Delete
Yes → Working? No → Delete + Reimplement
Yes → Fix/Extend
Principle: Prefer clean implementation over patching broken code
testing
Language-agnostic testing principles including TDD, test quality, coverage standards, and test design patterns. Use when writing tests, designing test strategies, or reviewing test quality.
documentation
Guides subagent coordination through implementation workflows. Use when orchestrating multiple agents, managing workflow phases, or determining autonomous execution mode.
development
Implementation strategy selection framework. Use when planning implementation strategy, selecting development approach, or defining verification criteria.
documentation
Documentation creation criteria including PRD, ADR, Design Doc, and Work Plan requirements with templates. Use when creating or reviewing technical documents, or determining which documents are required.