con un clic
implementation
Implement code from plan. Max 30 lines per function. No vague names.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Implement code from plan. Max 30 lines per function. No vague names.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Read-only quality scan of components. Reports problems without making changes. Uses software-base + domain profile skills.
Refactoring patterns - improving code design without changing behavior
Read-only quality scan of components. Reports problems without making changes. Uses software-base + domain profile skills.
Internal phase: independent Codex review + targeted fixes. Not user-facing.
Find duplicated code and consolidate into shared utilities. Fixes all duplicates.
Reference templates for Codex evaluation. Used by build/improve orchestrators — not executed directly.
| name | implementation |
| description | Implement code from plan. Max 30 lines per function. No vague names. |
Implement code from the approved plan. Strict constraints enforced.
No arguments? Describe this skill and stop. Do not execute.
mkdir -p .claude && echo '{"skill":"implement","started":"'$(date -Iseconds)'"}' > .claude/active-workflow.json
Write code a master craftsperson would be proud of.
Code must look like it was written by a skilled human engineer, not generated by AI.
| Antipattern | Example | Why It's Wrong |
|---|---|---|
| Over-abstraction | Factory that creates one thing | Abstraction without justification |
| Defensive paranoia | Null checks where null is impossible | Implies you don't understand your own code |
| Reimplementing stdlib | Custom string utils when lodash exists | Arrogance or ignorance |
| Comment spam | // increment counter above i++ | Insulting the reader |
| Speculative features | Config options nobody asked for | Solving imaginary problems |
| Wrapper classes | UserWrapper around User | Complexity without value |
| Enterprise patterns | AbstractFactoryBean for a helper | Cargo-culting |
Test: Would a senior engineer mass-delete your code in review? If yes, don't write it.
You MUST follow these constraints EXACTLY:
utils/, lib/, helpers/, common/ directoriesgrep -r "function copyDir" --include="*.ts" (or similar)data, result, temp, item, stuff, info, objBefore starting, read these canon skills and apply their principles throughout:
Always load (base brain — all 10):
canon/clarity/SUMMARY.mdcanon/pragmatism/SUMMARY.mdcanon/simplicity/SUMMARY.mdcanon/composition/SUMMARY.mdcanon/distributed/SUMMARY.mdcanon/data-first/SUMMARY.mdcanon/correctness/SUMMARY.mdcanon/algorithms/SUMMARY.mdcanon/abstraction/SUMMARY.mdcanon/optimization/SUMMARY.mdAuto-detect domain canon (check files, load matches):
| Check | If found, also read |
|---|---|
*.ts or *.js files in target | canon/javascript/typescript/SUMMARY.md, canon/javascript/js-safety/SUMMARY.md, canon/javascript/js-perf/SUMMARY.md, canon/javascript/js-internals/SUMMARY.md, canon/javascript/functional/SUMMARY.md |
angular.json in project root | canon/angular/angular-arch/SUMMARY.md, canon/angular/angular-core/SUMMARY.md, canon/angular/angular-perf/SUMMARY.md, canon/angular/rxjs/SUMMARY.md |
package.json contains "react" | canon/javascript/react-state/SUMMARY.md, canon/javascript/react-test/SUMMARY.md, canon/javascript/reactivity/SUMMARY.md |
pom.xml or build.gradle in project | canon/java/SUMMARY.md |
*.py files in target | canon/python/python-advanced/SUMMARY.md, canon/python/python-idioms/SUMMARY.md, canon/python/python-patterns/SUMMARY.md, canon/python/python-protocols/SUMMARY.md |
*.cs files or *.csproj in project | canon/csharp/csharp-depth/SUMMARY.md, canon/csharp/type-systems/SUMMARY.md, canon/csharp/async/SUMMARY.md |
.tsx, .jsx, or HTML template files | canon/ui-ux/components/SUMMARY.md, canon/ui-ux/usability/SUMMARY.md, canon/ui-ux/tokens/SUMMARY.md |
d3 in package.json or imports | canon/visualization/d3/SUMMARY.md, canon/visualization/charts/SUMMARY.md, canon/visualization/dashboards/SUMMARY.md |
| SQL files or ORM imports | canon/database/sql/SUMMARY.md, canon/database/sql-perf/SUMMARY.md |
| Auth, tokens, secrets, encryption | canon/security/security-mindset/SUMMARY.md, canon/security/owasp/SUMMARY.md, canon/security/web-security/SUMMARY.md |
If a skill file doesn't exist (not installed in this project), skip it and continue. List loaded experts in EXPERTS_LOADED. In EXPERT_DECISIONS, show each specific decision an expert drove with file:line.
Read both lessons files if they exist:
.claude/universal-lessons.md — universal patterns (ships with skills, applies to all projects).claude/lessons.md — project-specific patterns (accumulated from this project's runs)Apply these lessons as you write code:
existsSync+readFileSync — use try-catch; never use execSync with template literals — use execFileSync with args array; validate names before path.join; escape </ in embedded JSON)This is the most impactful phase for preventing recurring issues. Check each LOGIC entry against your implementation.
If a file doesn't exist, skip it and continue.
.claude/plans/ or context/structurePhase 3 is a builder AND a quality compiler. Code isn't done until it compiles clean.
For each unit from the plan:
Before writing this unit, reread the ONE canon SUMMARY.md most relevant to what this unit does:
canon/correctness/SUMMARY.mdcanon/simplicity/SUMMARY.mdcanon/data-first/SUMMARY.mdcanon/composition/SUMMARY.mdcanon/security/security-mindset/SUMMARY.mdcanon/optimization/SUMMARY.mdcanon/algorithms/SUMMARY.mdcanon/angular/rxjs/SUMMARY.md or canon/javascript/reactivity/SUMMARY.mdcanon/clarity/SUMMARY.mdThis is not optional. Read the file. 50 lines, <1 second. It refreshes the design principle before you write, not after.
Read the Constraint: from the plan for the current work item. If it includes an abstract type tag (e.g., [ValidatedInput + CausedError]), implement the contract using the target language's idiom from .claude/rubric/contracts.md. The BAD/GOOD example shows the specific boundary; the abstract type tells you the pattern. Apply it alongside the canon summary from Step 2a.
If the work item constraint includes an abstract type tag, implement it:
| Abstract Type | What to implement |
|---|---|
| ValidatedInput | Validation function at boundary. Function signature accepts validated type, not raw. |
| SafePath | Path factory that normalizes + checks prefix. Never pass raw user string to path.join. |
| CausedError | Error construction with { cause: e }. Never throw new Error(msg) in a catch block. |
| Secret | Opaque type. toString/toJSON must redact. Never interpolate into error messages or logs. |
| ExternalData | Parse in try-catch. Validate structure before use. Never assume shape. |
| BoundedOperation | Timeout parameter or max iterations. Never recurse/loop without a bound. |
| IdempotentAction | Write-then-rename for files. Transactions for DB. Never partial-write. |
Use the Language Idioms table from .claude/rubric/contracts.md for the target language.
Implement the code for this unit following all constraints above.
After writing each unit, run:
npx tsc --noEmit 2>&1 | head -30
tsx scripts/quality-gate.ts {FILES_JUST_WRITTEN}
Also self-check: no function > 30 lines, no file > 300 lines.
The point: a bad type in file A cascades through files B-E. Catching it after A prevents rewriting B-E.
After all units pass the compile loop:
npx tsc --noEmit
If the plan has a WORK_ITEMS section, you MUST:
## Implementation: [feature]
FILES_CREATED:
- path/to/file.ts: [functions defined]
LONGEST_FUNCTION: [name] at [N] lines (must be ≤30)
### Verification:
```bash
$ npx tsc --noEmit
(no errors)
TOOL_USED: [knip|qodana|vulture|deadcode|cargo-udeps] DEAD_CODE_FOUND: [N] items DEAD_CODE_REMOVED: [list or "none"]
COMPLETED:
REMAINING:
COMPILE_LOOP: {N} units, {M} required fixes, {K} canon refreshes
EXPERTS_LOADED: [list of skill names actually read] EXPERT_DECISIONS:
IMPLEMENTATION_COMPLETE
**REMAINING must be empty for IMPLEMENTATION_COMPLETE.** If items remain, output IMPLEMENTATION_PARTIAL instead and list what's left.
## Dead Code Cleanup (MANDATORY)
After implementation, detect language and remove dead code:
| Language | Detection | Tool | Command |
|----------|-----------|------|---------|
| JS/TS | `package.json` | knip | `npx knip --reporter compact` |
| Java | `pom.xml` or `build.gradle` | Qodana | Use `mcp__qodana__qodana_scan` |
| Python | `pyproject.toml` or `*.py` | vulture | `uvx vulture . --min-confidence 80` |
| Go | `go.mod` | deadcode | `go run golang.org/x/tools/cmd/deadcode@latest ./...` |
| Rust | `Cargo.toml` | cargo-udeps | `cargo +nightly udeps` |
| C# | `*.csproj` | Qodana | Use `mcp__qodana__qodana_scan` |
**Process:**
1. Run the appropriate tool for the detected language
2. Parse output for unused exports, functions, imports, variables
3. Remove dead code directly (no confirmation needed for code YOU just wrote)
4. Re-run tool to verify cleanup
<critical>Only remove dead code in files YOU modified during this implementation. Never touch unrelated files.</critical>
Skip items marked with `@keep`, `// keep`, or `# keep`.
## Validation (Phase will FAIL if violated)
- Any function > 30 lines
- Any file > 300 lines
- Any function with cyclomatic complexity > 10
- Vague variable names detected
- Duplicated utility that exists elsewhere in codebase
- Files not in plan created without justification
- Dead code left behind in files you created/modified
## 🛑 MANDATORY STOP
After implementation:
- DO NOT proceed to next phase
- DO NOT continue with "let me also..."
**Your turn ends here.** Output IMPLEMENTATION_COMPLETE and STOP.