META ORCHESTRATOR for complete implementation workflow - design, test, lint, refactor, review, commit. Use for any code change that should result in a commit (features, bug fixes, refactors)...
DEFAULT ENTRY POINT: This skill should be automatically invoked for ALL code changes when the plugin is enabled.
META ORCHESTRATOR for implementation workflow: design ā test ā lint ā refactor ā review ā commit. Use for any commit: features, bug fixes, refactors.
When this plugin is enabled in a project, this skill is the default workflow for:
The CLAUDE.md file at the plugin root enforces this automatic invocation.
CRITICAL - Read Before Starting:
Never Disable Rules by Default
eslint-disable, @ts-ignore, @ts-expect-error, or similar comments without explicit user approvalFix, Don't Suppress
Clean Code at Every Step
IMPORTANT: Before using this skill, the project MUST have linter configurations:
TypeScript (tsconfig.json)
ESLint (eslint.config.mjs or .eslintrc.js)
eslint-plugin-sonarjs for complexity metricsPrettier (.prettierrc.json or prettier.config.js or .prettierrc)
Stylelint (stylelint.config.js) - if using CSS/SCSS
Project must have scripts for running quality checks. Script names vary by project - detect them from package.json.
Common patterns to look for:
test, test:unit, vitest, jesttypecheck, type-check, tsc, check-typeslint, lint:check, eslint, lintchecklint:fix, eslint:fix, lint --fixformat, format:check, prettier:check, formatcheckformat:fix, prettier:write, prettier --writestylelint, style:check, stylecheckstylelint:fix, style:fixcheck, checkall, validate, verifyfix, fixall, format:allDetection strategy: Read package.json scripts and identify which commands serve each purpose.
FIRST STEP - Do this before starting any workflow:
Detect Package Manager
yarn.lock ā Use yarn commandspackage-lock.json or npm-shrinkwrap.json ā Use npm commandspnpm-lock.yaml ā Use pnpm commandsDetect Available Scripts
package.json scripts sectiontypecheck, type-check, tsc)lint, eslint, lint:check)lint:fix, eslint:fix)format:check, prettier:check)format:fix, prettier:write)test, vitest, jest)check, checkall, validate)fix, fixall)Build Command Map
{ typecheck: 'typecheck', lint: 'lint', lintFix: 'lint:fix', test: 'test' }Remember: Use detected package manager + detected script names consistently throughout ALL workflow phases.
Before starting, verify setup by running detected commands:
If scripts are missing:
check that runs multiple tools)eslint .) or skip that phaseCommand detection examples:
# If package.json has:
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"check": "tsc && eslint .",
"test": "vitest"
}
# Detected commands:
typecheck: (not found, will run 'tsc' directly)
lint: 'lint'
lintFix: 'lint:fix'
test: 'test'
combined: 'check'
IMPORTANT: Start every workflow by detecting the package manager (Step 0 in Prerequisites).
Use detected package manager and script names from Step 0 for all commands below.
Run quality checks in this order (using detected script names from package.json):
typecheck, type-check, tsc)lint, lint:check, eslint)format:check, prettier:check)stylelint, style:check) - if CSS/SCSS in projectHandling missing scripts:
tsc --noEmit directlyeslint . directlyprettier --check . directlyIf any failures detected:
lint:fix, eslint:fix)format:fix, prettier:write)stylelint:fix, style:fix)eslint-disable, @ts-ignore, @ts-expect-error, or similar comments unless explicitly approved by the usertypeof checks: Use or create type guard utilities (e.g., isString, isNumber) instead of repeating typeof value === 'string'Alternative: If project has combined commands (detected in Step 0):
Example workflow:
# Step 0: Detect commands from package.json
# Found: { packageManager: 'npm', typecheck: 'typecheck', lint: 'lint', lintFix: 'lint:fix', ... }
# Run checks using detected script names
[package-manager] run [detected-typecheck-script]
[package-manager] run [detected-lint-script]
[package-manager] run [detected-format-check-script]
# If failures, run fixes using detected fix scripts
[package-manager] run [detected-lint-fix-script]
[package-manager] run [detected-format-fix-script]
# Re-run checks to verify
[package-manager] run [detected-typecheck-script]
[package-manager] run [detected-lint-script]
[package-manager] run [detected-format-check-script]
š COMMIT READINESS SUMMARY
ā
Type Check: Passed (0 errors)
ā
ESLint: Passed (0 issues)
ā
Prettier: Passed (all files formatted)
ā
Stylelint: Passed (0 style issues)
ā
Tests: 92% coverage (3 leaf hooks at 100%, 1 orchestrating component, 18 test cases)
ā ļø Design Review: 3 findings (see below)
šÆ COMMIT SCOPE
Modified:
- src/components/LoginForm.tsx (+65, -20 lines)
- src/hooks/useAuth.ts (+30, -5 lines)
Added:
- src/types/auth.ts (new: UserId, Email types)
- src/contexts/AuthContext.tsx (new context provider)
Tests:
- src/components/LoginForm.test.tsx (+95 lines)
- src/hooks/useAuth.test.ts (new)
- src/types/auth.test.ts (new)
ā ļø DESIGN REVIEW FINDINGS
š“ DESIGN DEBT (Recommended to fix):
- src/components/LoginForm.tsx:45 - Primitive obsession detected
Current: function validateEmail(email: string): boolean
Better: Use Zod schema or branded Email type with validation
Why: Type safety, validation guarantee, prevents invalid emails
Fix: Use @component-designing to create self-validating Email type
- src/hooks/useAuth.ts:78 - Prop drilling detected
Auth state passed through 3+ component levels
Why: Tight coupling, hard to maintain
Fix: Extract AuthContext or use composition pattern
š” READABILITY DEBT (Consider fixing):
- src/components/LoginForm.tsx:120 - Mixed abstraction levels
Component mixes validation logic with UI rendering
Why: Harder to understand and test independently
Fix: Use @refactoring to extract custom hooks (useValidation)
- src/components/LoginForm.tsx:88 - Cognitive complexity: 18 (max: 15)
Nested conditionals for form validation
Why: Hard to understand logic flow
Fix: Use @refactoring to extract validation functions or use Zod
š¢ POLISH OPPORTUNITIES:
- src/types/auth.ts:12 - Missing JSDoc comments
Public types should have documentation
- src/components/LoginForm.tsx:45 - Consider semantic HTML
Use <form> with proper ARIA labels for better accessibility
- src/hooks/useAuth.ts:34 - Missing error boundaries
Consider wrapping async operations with error handling
š BROADER CONTEXT:
While reviewing LoginForm.tsx, noticed similar validation patterns in
RegisterForm.tsx and ProfileForm.tsx (src/components/). Consider
extracting a shared validation hook or creating branded types for common
fields (Email, Username, Password) used across the application.
š” SUGGESTED COMMIT MESSAGE
Add self-validating Email and UserId types to auth feature
- Introduce Email type with RFC 5322 validation using Zod
- Introduce UserId branded type for type safety
- Refactor LoginForm to use validated types
- Extract useAuth hook for auth state management
- Add AuthContext to eliminate prop drilling
- Achieve 92% test coverage with React Testing Library
Follows component composition principles and reduces primitive obsession.
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Would you like to:
1. Commit as-is (ignore design findings)
2. Fix design debt only (š“), then commit
3. Fix design + readability debt (š“ + š”), then commit
4. Fix all findings (š“ š” š¢), then commit
5. Refactor broader scope (address validation patterns across features), then commit
These metrics trigger @refactoring when exceeded:
Rules that can cause runtime errors:
@typescript-eslint/no-unsafe-member-access (416 violations)@typescript-eslint/no-unsafe-assignment (267 violations)@typescript-eslint/no-explicit-any (194 violations)@typescript-eslint/no-unsafe-argument (101 violations)@typescript-eslint/no-unsafe-call (72 violations)@typescript-eslint/no-unsafe-return (50 violations)Fix Strategy: Use proper types, type guards, Zod schemas, or branded types
Rules that affect readability and maintenance:
no-magic-numbers (243 violations) - Extract to named constantsreact/forbid-dom-props (94 violations) - No inline styles, use CSS modulessonarjs/cyclomatic-complexity (34 violations) - Reduce branches, early returnssonarjs/prefer-read-only-props (25 violations) - Props should be immutablereact-hooks/exhaustive-deps (41 violations) - Fix dependencies or simplifyFix Strategy: Apply @refactoring patterns (storifying, early returns, extract functions)
Rules that improve consistency:
no-console (28 violations) - Use proper loggingFix Strategy: Auto-fix or manual cleanup
Sequential Phases: Each phase depends on previous phase completion
Iterative Linting: Phase 3 loops until clean Advisory Review: Phase 4 never blocks, always asks user
This orchestrator invokes other skills automatically:
After committing, consider:
Auto-fixable:
Requires refactoring (invoke @refactoring):
prettier --write .stylelint "**/*.{css,scss}" --fix@typescript-eslint/no-unsafe-* errorsany types with proper typesCRITICAL: All criteria must be met before completing this skill.
No Linter Rule Disabling in Changed Files
eslint-disable, eslint-disable-next-line, eslint-disable-line comments@ts-ignore, @ts-expect-error, @ts-nocheck commentsstylelint-disable commentsAll Quality Checks Pass Clean
All Tests Pass
Iterative Verification
IMPORTANT: Detect available scripts from the project's package.json before running checks.
# Iteration 1: Initial check
Run all quality check commands detected from package.json:
- TypeScript check (e.g., typecheck, type-check, tsc)
- Linting check (e.g., lint, lint:check, eslint)
- Format check (e.g., format:check, prettier:check)
- Tests (e.g., test, test:unit, vitest)
# If failures: fix issues, then...
# Iteration 2: Verify fixes didn't introduce new issues
Run the same quality check commands again
# If still clean: proceed to commit
# If new failures: fix and repeat until two consecutive clean runs
Before marking workflow complete:
ā
ACCEPTANCE CRITERIA CHECKLIST
Linter Compliance:
[ ] No eslint-disable comments added to changed files
[ ] No @ts-ignore/@ts-expect-error added to changed files
[ ] All linter issues fixed through proper refactoring
[ ] If any disabling approved: comment explains WHY
Quality Gates:
[ ] TypeScript: 0 errors
[ ] ESLint: 0 errors/warnings in changed files
[ ] Prettier: All files formatted
[ ] Tests: All passing
Iteration Verification:
[ ] Ran checks twice consecutively
[ ] Both runs passed clean
[ ] No oscillating fixes (fix A breaks B, fix B breaks A)
Ready to commit: All boxes checked ā
The following will BLOCK skill completion:
Only with explicit user consent:
When disabling a rule with approval, add a comment explaining WHY:
// ā Bad: Disabled without explanation
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const data: any = response.body
// ā
Good: Disabled with justification
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Legacy API returns untyped response, migration planned in JIRA-123
const data: any = response.body
Document any exceptions in commit message.