ワンクリックで
coding-standards
Detects code smells, anti-patterns, and readability issues. Use when implementing features, reviewing code, or refactoring.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Detects code smells, anti-patterns, and readability issues. Use when implementing features, reviewing code, or refactoring.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Coordinates subagent task distribution and collaboration. Controls scale determination and autonomous execution mode.
Execute comprehensive test suite with coverage reporting
Coordinates subagent task distribution and collaboration. Controls scale determination and autonomous execution mode.
Coordinates subagent task distribution and collaboration. Controls scale determination and autonomous execution mode.
Coordinates subagent task distribution and collaboration. Controls scale determination and autonomous execution mode.
Run full code quality and testing pipeline (lint + test)
| name | coding-standards |
| description | Detects code smells, anti-patterns, and readability issues. Use when implementing features, reviewing code, or refactoring. |
Immediately stop and reconsider design when detecting the following patterns:
Fail quickly on errors to prevent processing continuation in invalid states. Error suppression is prohibited.
For detailed implementation methods (Result type, custom error classes, layered error handling, etc.), refer to language and framework-specific rules.
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
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: Excessive use of any type or as Cause: Impulse to avoid type errors Avoidance: Handle safely with unknown type and type guards
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:
Symptom: Duplicate implementations, architecture inconsistency, integration failures Cause: Insufficient understanding of existing code before implementation Avoidance Methods:
Symptom: Build error
Why1: Type 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
To isolate problems, attempt reproduction with minimal code:
Type Safety Principle: Use unknown type with type guards. any type disables type checking and causes runtime errors.
any Type Alternatives (Priority Order)
Type Guard Implementation Pattern
function isUser(value: unknown): value is User {
return typeof value === 'object' && value !== null && 'id' in value && 'name' in value
}
Type Complexity Management
Basic Policy
Implementation Procedure: Understand Current State -> Gradual Changes -> Behavior Verification -> Final Validation
Priority: Duplicate Code Removal > Large Function Division > Complex Conditional Branch Simplification > Type Safety Improvement
Completion Criteria: Complete all 3 stages
Grep -n "TargetClass\|TargetMethod" -o content
Grep -n "DependencyClass" -o content
Grep -n "targetData\|SetData\|UpdateData" -o content
Mandatory: Read all discovered files and include necessary parts in context:
Structured impact report (mandatory):
## Impact Analysis
### Direct Impact: ClassA, ClassB (with reasons)
### Indirect Impact: SystemX, ComponentY (with integration paths)
### Processing Flow: Input -> Process1 -> Process2 -> Output
Important: Do not stop at search; execute all 3 stages
When unused code is detected -> Will it be used?
Target: Code, documentation, configuration files
Recommended Principle: Always start code changes with tests
Development Steps:
NG Cases (Test-first not required):
Recommended: Mock external dependencies in unit tests
Avoid: Actual external connections in unit tests
Fix tests: Wrong expected values, references to non-existent features, dependence on implementation details, implementation only for tests Fix implementation: Valid specifications, business logic, important edge cases When in doubt: Confirm with user
MUST Test: Public APIs, return values, exceptions, external calls, persisted state MUST NOT Test: Private methods, internal state, algorithm implementation details