@su-record/vibe 2.16.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +15 -0
- package/CLAUDE.md +8 -8
- package/README.en.md +46 -29
- package/README.md +41 -24
- package/agents/acceptance-tester.md +56 -0
- package/agents/architect.md +25 -67
- package/agents/build-error-resolver.md +28 -97
- package/agents/code-reviewer.md +89 -0
- package/agents/diagrammer.md +34 -165
- package/agents/documenter.md +43 -0
- package/agents/e2e-tester.md +46 -277
- package/agents/event/event-ops.md +54 -77
- package/agents/event/event-planner.md +63 -0
- package/agents/figma/figma-engineer.md +76 -0
- package/agents/implementer.md +26 -41
- package/agents/security-reviewer.md +56 -0
- package/agents/tester.md +37 -33
- package/agents/ui/design-reviewer.md +62 -0
- package/agents/ui/design-system-gen.md +63 -0
- package/dist/__tests__/agent-model-sync.test.d.ts +2 -0
- package/dist/__tests__/agent-model-sync.test.d.ts.map +1 -0
- package/dist/__tests__/agent-model-sync.test.js +71 -0
- package/dist/__tests__/agent-model-sync.test.js.map +1 -0
- package/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +8 -1
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +1 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/info.d.ts.map +1 -1
- package/dist/cli/commands/info.js +2 -0
- package/dist/cli/commands/info.js.map +1 -1
- package/dist/cli/commands/llm.d.ts +11 -0
- package/dist/cli/commands/llm.d.ts.map +1 -0
- package/dist/cli/commands/llm.js +62 -0
- package/dist/cli/commands/llm.js.map +1 -0
- package/dist/cli/commands/remove.d.ts.map +1 -1
- package/dist/cli/commands/remove.js +8 -10
- package/dist/cli/commands/remove.js.map +1 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +35 -1
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/index.d.ts +0 -4
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +59 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/llm/config.d.ts.map +1 -1
- package/dist/cli/llm/config.js +7 -0
- package/dist/cli/llm/config.js.map +1 -1
- package/dist/cli/llm/index.d.ts +1 -0
- package/dist/cli/llm/index.d.ts.map +1 -1
- package/dist/cli/llm/index.js +1 -0
- package/dist/cli/llm/index.js.map +1 -1
- package/dist/cli/llm/model-refresh.d.ts +29 -0
- package/dist/cli/llm/model-refresh.d.ts.map +1 -0
- package/dist/cli/llm/model-refresh.js +139 -0
- package/dist/cli/llm/model-refresh.js.map +1 -0
- package/dist/cli/llm/zai-commands.d.ts +15 -0
- package/dist/cli/llm/zai-commands.d.ts.map +1 -0
- package/dist/cli/llm/zai-commands.js +64 -0
- package/dist/cli/llm/zai-commands.js.map +1 -0
- package/dist/cli/postinstall/claude-agents.d.ts.map +1 -1
- package/dist/cli/postinstall/claude-agents.js +16 -77
- package/dist/cli/postinstall/claude-agents.js.map +1 -1
- package/dist/cli/postinstall/constants.d.ts.map +1 -1
- package/dist/cli/postinstall/constants.js +81 -296
- package/dist/cli/postinstall/constants.js.map +1 -1
- package/dist/cli/postinstall/cursor-agents.d.ts +5 -0
- package/dist/cli/postinstall/cursor-agents.d.ts.map +1 -1
- package/dist/cli/postinstall/cursor-agents.js +26 -68
- package/dist/cli/postinstall/cursor-agents.js.map +1 -1
- package/dist/cli/postinstall/cursor-skills.d.ts.map +1 -1
- package/dist/cli/postinstall/cursor-skills.js +26 -30
- package/dist/cli/postinstall/cursor-skills.js.map +1 -1
- package/dist/cli/postinstall/main.d.ts.map +1 -1
- package/dist/cli/postinstall/main.js +0 -2
- package/dist/cli/postinstall/main.js.map +1 -1
- package/dist/cli/setup/Provisioner.d.ts.map +1 -1
- package/dist/cli/setup/Provisioner.js +19 -21
- package/dist/cli/setup/Provisioner.js.map +1 -1
- package/dist/cli/types.d.ts +15 -0
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/utils.d.ts +4 -1
- package/dist/cli/utils.d.ts.map +1 -1
- package/dist/cli/utils.js +4 -1
- package/dist/cli/utils.js.map +1 -1
- package/dist/infra/lib/FrameworkDetector.js +4 -4
- package/dist/infra/lib/FrameworkDetector.js.map +1 -1
- package/dist/infra/lib/OrchestrateWorkflow.js +2 -2
- package/dist/infra/lib/OrchestrateWorkflow.js.map +1 -1
- package/dist/infra/lib/browser/launch.js +1 -1
- package/dist/infra/lib/browser/launch.js.map +1 -1
- package/dist/infra/lib/browser/types.d.ts +1 -1
- package/dist/infra/lib/browser/types.js +1 -1
- package/dist/infra/lib/config/GlobalConfigManager.d.ts +2 -0
- package/dist/infra/lib/config/GlobalConfigManager.d.ts.map +1 -1
- package/dist/infra/lib/config/GlobalConfigManager.js +6 -0
- package/dist/infra/lib/config/GlobalConfigManager.js.map +1 -1
- package/dist/infra/lib/constants.d.ts +1 -1
- package/dist/infra/lib/constants.d.ts.map +1 -1
- package/dist/infra/lib/constants.js +4 -5
- package/dist/infra/lib/constants.js.map +1 -1
- package/dist/infra/lib/evolution/__tests__/integration.test.js +7 -7
- package/dist/infra/lib/evolution/__tests__/integration.test.js.map +1 -1
- package/dist/infra/lib/llm-availability.d.ts +4 -0
- package/dist/infra/lib/llm-availability.d.ts.map +1 -1
- package/dist/infra/lib/llm-availability.js +9 -1
- package/dist/infra/lib/llm-availability.js.map +1 -1
- package/dist/infra/lib/memory/index.d.ts +0 -2
- package/dist/infra/lib/memory/index.d.ts.map +1 -1
- package/dist/infra/lib/memory/index.js +0 -2
- package/dist/infra/lib/memory/index.js.map +1 -1
- package/dist/infra/lib/telemetry/SkillTelemetry.test.js +1 -1
- package/dist/infra/lib/telemetry/SkillTelemetry.test.js.map +1 -1
- package/dist/infra/lib/zai/client.d.ts +30 -0
- package/dist/infra/lib/zai/client.d.ts.map +1 -0
- package/dist/infra/lib/zai/client.js +124 -0
- package/dist/infra/lib/zai/client.js.map +1 -0
- package/dist/infra/lib/zai/index.d.ts +11 -0
- package/dist/infra/lib/zai/index.d.ts.map +1 -0
- package/dist/infra/lib/zai/index.js +10 -0
- package/dist/infra/lib/zai/index.js.map +1 -0
- package/dist/infra/lib/zai/orchestration.d.ts +15 -0
- package/dist/infra/lib/zai/orchestration.d.ts.map +1 -0
- package/dist/infra/lib/zai/orchestration.js +54 -0
- package/dist/infra/lib/zai/orchestration.js.map +1 -0
- package/dist/infra/lib/zai/types.d.ts +40 -0
- package/dist/infra/lib/zai/types.d.ts.map +1 -0
- package/dist/infra/lib/zai/types.js +5 -0
- package/dist/infra/lib/zai/types.js.map +1 -0
- package/dist/infra/orchestrator/SmartRouter.d.ts.map +1 -1
- package/dist/infra/orchestrator/SmartRouter.js +16 -34
- package/dist/infra/orchestrator/SmartRouter.js.map +1 -1
- package/dist/infra/orchestrator/index.d.ts +1 -0
- package/dist/infra/orchestrator/index.d.ts.map +1 -1
- package/dist/infra/orchestrator/index.js +11 -9
- package/dist/infra/orchestrator/index.js.map +1 -1
- package/dist/infra/orchestrator/types.d.ts +32 -9
- package/dist/infra/orchestrator/types.d.ts.map +1 -1
- package/dist/infra/orchestrator/types.js +68 -37
- package/dist/infra/orchestrator/types.js.map +1 -1
- package/dist/infra/orchestrator/types.test.d.ts +2 -0
- package/dist/infra/orchestrator/types.test.d.ts.map +1 -0
- package/dist/infra/orchestrator/types.test.js +57 -0
- package/dist/infra/orchestrator/types.test.js.map +1 -0
- package/dist/tools/index.d.ts +0 -4
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +0 -4
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/memory/autoSaveContext.d.ts +0 -1
- package/dist/tools/memory/autoSaveContext.d.ts.map +1 -1
- package/dist/tools/memory/autoSaveContext.js +13 -27
- package/dist/tools/memory/autoSaveContext.js.map +1 -1
- package/hooks/scripts/__tests__/code-check-detectors.test.js +2 -2
- package/hooks/scripts/__tests__/run-ledger.test.js +1 -1
- package/hooks/scripts/__tests__/scope-from-spec.test.js +12 -12
- package/hooks/scripts/__tests__/step-counter.test.js +1 -1
- package/hooks/scripts/code-check.js +16 -203
- package/hooks/scripts/context-save.js +0 -11
- package/hooks/scripts/lib/scope-from-spec.js +9 -6
- package/hooks/scripts/llm-orchestrate.js +49 -0
- package/hooks/scripts/post-edit-dispatcher.js +1 -1
- package/hooks/scripts/prompt-dispatcher.js +7 -18
- package/hooks/scripts/session-start.js +25 -35
- package/package.json +4 -4
- package/skills/agents-md/SKILL.md +62 -15
- package/skills/arch-guard/SKILL.md +1 -1
- package/skills/brand-assets/SKILL.md +2 -2
- package/skills/capability-loop/SKILL.md +1 -1
- package/skills/chub-usage/SKILL.md +1 -1
- package/skills/commerce-patterns/SKILL.md +2 -2
- package/skills/commit-push-pr/SKILL.md +0 -1
- package/skills/context7-usage/SKILL.md +1 -1
- package/skills/create-prd/agents/edge-case-finder.md +4 -4
- package/skills/create-prd/agents/prioritizer.md +4 -4
- package/skills/create-prd/agents/requirements-writer.md +3 -3
- package/skills/create-prd/agents/researcher.md +3 -3
- package/skills/create-prd/agents/reviewer.md +3 -3
- package/skills/create-prd/orchestrator.md +2 -0
- package/skills/design-refine/SKILL.md +140 -0
- package/skills/{design-polish → design-refine}/templates/polish-report.md +1 -1
- package/skills/{design-normalize → design-refine}/templates/token-audit.md +3 -3
- package/skills/design-review/SKILL.md +143 -0
- package/skills/{design-audit → design-review}/agents/a11y-auditor.md +1 -1
- package/skills/{design-audit → design-review}/agents/performance-auditor.md +1 -1
- package/skills/{design-audit → design-review}/agents/responsive-auditor.md +1 -1
- package/skills/{design-audit → design-review}/agents/slop-detector.md +1 -1
- package/skills/{design-audit → design-review}/frameworks/core-web-vitals.md +1 -1
- package/skills/{design-audit → design-review}/frameworks/wcag-checklist.md +1 -1
- package/skills/{design-audit → design-review}/orchestrator.md +5 -3
- package/skills/{design-critique → design-review}/templates/critique-report.md +3 -3
- package/skills/{design-audit → design-review}/templates/report.md +3 -3
- package/skills/design-teach/SKILL.md +11 -11
- package/skills/docs/SKILL.md +14 -16
- package/skills/e2e-commerce/SKILL.md +1 -1
- package/skills/event-comms/SKILL.md +1 -1
- package/skills/event-ops/SKILL.md +2 -2
- package/skills/event-planning/SKILL.md +1 -1
- package/skills/exec-plan/SKILL.md +2 -2
- package/skills/exec-plan/orchestrator.md +2 -0
- package/skills/figma/SKILL.md +240 -148
- package/skills/figma/rubrics/css-mapping.md +125 -0
- package/skills/git-worktree/SKILL.md +1 -1
- package/skills/handoff/SKILL.md +1 -1
- package/skills/parallel-research/SKILL.md +14 -28
- package/skills/parallel-research/orchestrator.md +2 -0
- package/skills/priority-todos/SKILL.md +1 -1
- package/skills/regress/SKILL.md +11 -0
- package/skills/restraint/SKILL.md +72 -0
- package/skills/seo-checklist/SKILL.md +2 -2
- package/skills/spec/SKILL.md +65 -836
- package/skills/test/SKILL.md +3 -3
- package/skills/tool-fallback/SKILL.md +2 -2
- package/skills/vercel-react-best-practices/SKILL.md +1 -1
- package/skills/vibe/SKILL.md +20 -35
- package/skills/vibe.analyze/SKILL.md +7 -9
- package/skills/vibe.docs/SKILL.md +1 -1
- package/skills/vibe.event/SKILL.md +27 -27
- package/skills/vibe.figma/SKILL.md +14 -18
- package/skills/vibe.harness/SKILL.md +5 -5
- package/skills/vibe.llm/SKILL.md +50 -0
- package/skills/vibe.reason/SKILL.md +0 -2
- package/skills/vibe.review/SKILL.md +45 -49
- package/skills/vibe.run/SKILL.md +2 -5
- package/skills/vibe.run/references/parallel-agents.md +33 -98
- package/skills/vibe.spec/SKILL.md +38 -535
- package/skills/vibe.utils/SKILL.md +3 -3
- package/skills/vibe.verify/SKILL.md +70 -542
- package/skills/video-production/SKILL.md +1 -1
- package/vibe/rules/orchestrator-contract.md +57 -0
- package/vibe/rules/quality/performance.md +1 -1
- package/vibe/templates/claudemd-template.md +1 -1
- package/vibe/templates/spec-template.md +35 -185
- package/agents/architect-low.md +0 -41
- package/agents/architect-medium.md +0 -59
- package/agents/compounder.md +0 -261
- package/agents/docs/api-documenter.md +0 -99
- package/agents/docs/changelog-writer.md +0 -93
- package/agents/event/event-comms.md +0 -78
- package/agents/event/event-content.md +0 -68
- package/agents/event/event-image.md +0 -95
- package/agents/event/event-scheduler.md +0 -69
- package/agents/event/event-speaker.md +0 -86
- package/agents/explorer-low.md +0 -42
- package/agents/explorer-medium.md +0 -59
- package/agents/explorer.md +0 -48
- package/agents/figma/figma-analyst.md +0 -52
- package/agents/figma/figma-architect.md +0 -112
- package/agents/figma/figma-auditor.md +0 -82
- package/agents/figma/figma-builder.md +0 -100
- package/agents/implementer-low.md +0 -43
- package/agents/implementer-medium.md +0 -52
- package/agents/junior-mentor.md +0 -141
- package/agents/planning/requirements-analyst.md +0 -84
- package/agents/planning/ux-advisor.md +0 -83
- package/agents/qa/acceptance-tester.md +0 -86
- package/agents/qa/edge-case-finder.md +0 -93
- package/agents/qa/qa-coordinator.md +0 -131
- package/agents/refactor-cleaner.md +0 -143
- package/agents/research/best-practices.md +0 -199
- package/agents/research/codebase-patterns.md +0 -157
- package/agents/research/framework-docs.md +0 -188
- package/agents/research/security-advisory.md +0 -213
- package/agents/review/architecture-reviewer.md +0 -107
- package/agents/review/complexity-reviewer.md +0 -116
- package/agents/review/data-integrity-reviewer.md +0 -88
- package/agents/review/git-history-reviewer.md +0 -103
- package/agents/review/performance-reviewer.md +0 -86
- package/agents/review/python-reviewer.md +0 -150
- package/agents/review/rails-reviewer.md +0 -139
- package/agents/review/react-reviewer.md +0 -144
- package/agents/review/security-reviewer.md +0 -80
- package/agents/review/simplicity-reviewer.md +0 -140
- package/agents/review/test-coverage-reviewer.md +0 -116
- package/agents/review/typescript-reviewer.md +0 -127
- package/agents/searcher.md +0 -54
- package/agents/simplifier.md +0 -120
- package/agents/teams/debug-team.md +0 -70
- package/agents/teams/dev-team.md +0 -88
- package/agents/teams/docs-team.md +0 -80
- package/agents/teams/figma-team.md +0 -85
- package/agents/teams/fullstack-team.md +0 -83
- package/agents/teams/lite-team.md +0 -69
- package/agents/teams/migration-team.md +0 -78
- package/agents/teams/refactor-team.md +0 -94
- package/agents/teams/research-team.md +0 -86
- package/agents/teams/review-debate-team.md +0 -125
- package/agents/teams/security-team.md +0 -81
- package/agents/ui/ui-a11y-auditor.md +0 -93
- package/agents/ui/ui-antipattern-detector.md +0 -102
- package/agents/ui/ui-dataviz-advisor.md +0 -69
- package/agents/ui/ui-design-system-gen.md +0 -57
- package/agents/ui/ui-industry-analyzer.md +0 -49
- package/agents/ui/ui-layout-architect.md +0 -65
- package/agents/ui/ui-stack-implementer.md +0 -68
- package/agents/ui/ux-compliance-reviewer.md +0 -81
- package/agents/ui-previewer.md +0 -258
- package/hooks/scripts/__tests__/keyword-detector.test.js +0 -242
- package/hooks/scripts/keyword-detector.js +0 -226
- package/skills/characterization-test/SKILL.md +0 -209
- package/skills/characterization-test/agents/behavior-capturer.md +0 -50
- package/skills/characterization-test/agents/coverage-checker.md +0 -54
- package/skills/characterization-test/agents/reporter.md +0 -50
- package/skills/characterization-test/agents/test-writer.md +0 -49
- package/skills/characterization-test/rubrics/coverage-criteria.md +0 -53
- package/skills/characterization-test/templates/test-template.ts +0 -101
- package/skills/claude-md-guide/SKILL.md +0 -353
- package/skills/claude-md-guide/rubrics/anti-patterns.md +0 -88
- package/skills/design-audit/SKILL.md +0 -154
- package/skills/design-critique/SKILL.md +0 -140
- package/skills/design-distill/SKILL.md +0 -131
- package/skills/design-normalize/SKILL.md +0 -135
- package/skills/design-polish/SKILL.md +0 -132
- package/skills/figma-convert/SKILL.md +0 -236
- package/skills/figma-extract/SKILL.md +0 -242
- package/skills/interview/SKILL.md +0 -358
- package/skills/interview/checklists/api.md +0 -101
- package/skills/interview/checklists/feature.md +0 -88
- package/skills/interview/checklists/library.md +0 -95
- package/skills/interview/checklists/mobile.md +0 -89
- package/skills/interview/checklists/webapp.md +0 -97
- package/skills/interview/checklists/website.md +0 -99
- package/skills/plan/SKILL.md +0 -254
- package/skills/rob-pike/SKILL.md +0 -66
- package/skills/spec/references/askuser-examples.md +0 -57
- package/skills/spec/references/example-session.md +0 -87
- package/skills/spec/references/templates.md +0 -194
- package/skills/spec-review/SKILL.md +0 -725
- package/skills/systematic-debugging/SKILL.md +0 -142
- package/skills/techdebt/SKILL.md +0 -126
- package/skills/techdebt/agents/analyzer.md +0 -50
- package/skills/techdebt/agents/fixer.md +0 -41
- package/skills/techdebt/agents/reviewer.md +0 -47
- package/skills/techdebt/agents/scanner.md +0 -44
- package/skills/techdebt/orchestrator.md +0 -70
- package/skills/techdebt/rubrics/severity.md +0 -51
- package/skills/techdebt/scripts/scan.js +0 -90
- package/skills/techdebt/templates/report.md +0 -86
- package/skills/typescript-advanced-types/SKILL.md +0 -68
- package/skills/typescript-advanced-types/rubrics/type-patterns.md +0 -109
- package/skills/yagni-ladder/SKILL.md +0 -90
- /package/skills/{claude-md-guide → agents-md}/templates/claude-md.md +0 -0
- /package/skills/{design-polish → design-refine}/rubrics/polish-checklist.md +0 -0
- /package/skills/{design-normalize → design-refine}/rubrics/token-naming.md +0 -0
- /package/skills/{design-distill → design-refine}/templates/design-system.md +0 -0
- /package/skills/{design-audit → design-review}/agents/scorer.md +0 -0
- /package/skills/{design-audit → design-review}/rubrics/ai-slop-patterns.md +0 -0
- /package/skills/{design-audit → design-review}/rubrics/scoring.md +0 -0
- /package/skills/{design-critique → design-review}/rubrics/ux-heuristics.md +0 -0
- /package/skills/{figma-convert → figma}/rubrics/conversion-rules.md +0 -0
- /package/skills/{figma-extract → figma}/rubrics/image-rules.md +0 -0
- /package/skills/{figma-convert → figma}/templates/component.md +0 -0
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
# Technical Debt Report
|
|
2
|
-
|
|
3
|
-
**Project**: {{PROJECT_NAME}}
|
|
4
|
-
**Date**: {{DATE}}
|
|
5
|
-
**Scanned Directory**: {{SCAN_DIR}}
|
|
6
|
-
**Files Scanned**: {{FILE_COUNT}}
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Summary
|
|
11
|
-
|
|
12
|
-
| Priority | Count | Status |
|
|
13
|
-
|----------|-------|--------|
|
|
14
|
-
| P1 — Blocks Merge | {{P1_COUNT}} | {{P1_STATUS}} |
|
|
15
|
-
| P2 — Fix Before PR | {{P2_COUNT}} | {{P2_STATUS}} |
|
|
16
|
-
| P3 — Backlog | {{P3_COUNT}} | {{P3_STATUS}} |
|
|
17
|
-
| **Total** | **{{TOTAL_COUNT}}** | |
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## P1 — Blocks Merge ({{P1_COUNT}} items)
|
|
22
|
-
|
|
23
|
-
{{P1_ITEMS}}
|
|
24
|
-
|
|
25
|
-
<!-- Example entry:
|
|
26
|
-
- `src/services/auth.ts:42` — `any` type usage: parameter `payload` typed as `any`
|
|
27
|
-
-->
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## P2 — Fix Before PR ({{P2_COUNT}} items)
|
|
32
|
-
|
|
33
|
-
### Console Statements ({{CONSOLE_COUNT}})
|
|
34
|
-
|
|
35
|
-
{{CONSOLE_ITEMS}}
|
|
36
|
-
|
|
37
|
-
### Unused Imports ({{UNUSED_IMPORT_COUNT}})
|
|
38
|
-
|
|
39
|
-
{{UNUSED_IMPORT_ITEMS}}
|
|
40
|
-
|
|
41
|
-
### Long Functions ({{LONG_FUNCTION_COUNT}})
|
|
42
|
-
|
|
43
|
-
{{LONG_FUNCTION_ITEMS}}
|
|
44
|
-
|
|
45
|
-
### Deep Nesting ({{DEEP_NESTING_COUNT}})
|
|
46
|
-
|
|
47
|
-
{{DEEP_NESTING_ITEMS}}
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## P3 — Backlog ({{P3_COUNT}} items)
|
|
52
|
-
|
|
53
|
-
### Magic Numbers ({{MAGIC_NUMBER_COUNT}})
|
|
54
|
-
|
|
55
|
-
{{MAGIC_NUMBER_ITEMS}}
|
|
56
|
-
|
|
57
|
-
### Commented-Out Code ({{COMMENTED_CODE_COUNT}})
|
|
58
|
-
|
|
59
|
-
{{COMMENTED_CODE_ITEMS}}
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Auto-fixable Items
|
|
64
|
-
|
|
65
|
-
The following can be removed safely without review:
|
|
66
|
-
|
|
67
|
-
{{AUTOFIXABLE_LIST}}
|
|
68
|
-
|
|
69
|
-
> Run with user confirmation before applying auto-fixes.
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Requires Manual Review
|
|
74
|
-
|
|
75
|
-
The following require human judgment:
|
|
76
|
-
|
|
77
|
-
{{MANUAL_REVIEW_LIST}}
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Next Steps
|
|
82
|
-
|
|
83
|
-
1. Fix all P1 items immediately
|
|
84
|
-
2. Address P2 items before opening PR
|
|
85
|
-
3. Create tracked tickets for P3 items
|
|
86
|
-
4. Re-run scan after fixes: `node skills/techdebt/scripts/scan.js {{SCAN_DIR}}`
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: typescript-advanced-types
|
|
3
|
-
invocation: [auto]
|
|
4
|
-
tier: core
|
|
5
|
-
description: "TypeScript advanced type system master guide. Covers Generics, Conditional Types, Mapped Types, Template Literals, Utility Types. Activates for complex type logic, reusable type utilities, and compile-time type safety."
|
|
6
|
-
sections:
|
|
7
|
-
- name: "Core Concepts"
|
|
8
|
-
triggers: [generic, generics, constraint, conditional, infer, mapped, utility, Pick, Omit, Partial, Required, Record, Exclude, Extract, readonly]
|
|
9
|
-
- name: "Advanced Patterns"
|
|
10
|
-
triggers: [template literal, branded, opaque, phantom, discriminated union, exhaustive, builder pattern, recursive type, variadic tuple]
|
|
11
|
-
- name: "Type Inference"
|
|
12
|
-
triggers: [inference, infer, type narrowing, type guard, satisfies, const assertion]
|
|
13
|
-
- name: "Best Practices"
|
|
14
|
-
triggers: [best practice, type safety, convention]
|
|
15
|
-
- name: "Type Testing"
|
|
16
|
-
triggers: [type test, type assertion, expectType, tsd]
|
|
17
|
-
- name: "Common Mistakes"
|
|
18
|
-
triggers: [mistake, pitfall, error, wrong]
|
|
19
|
-
- name: "Performance"
|
|
20
|
-
triggers: [performance, compile time, type complexity, depth limit]
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
# TypeScript Advanced Types
|
|
24
|
-
|
|
25
|
-
## Pre-check (K1)
|
|
26
|
-
|
|
27
|
-
> Is this a VIBE-specific type safety issue? Standard TypeScript generics/conditionals/mapped types are well-known — read the code instead. This skill exists for VIBE's strict rules and non-obvious gotchas only.
|
|
28
|
-
|
|
29
|
-
## VIBE Forbidden Patterns
|
|
30
|
-
|
|
31
|
-
| Forbidden | Why | Use Instead |
|
|
32
|
-
|-----------|-----|-------------|
|
|
33
|
-
| `any` | Disables all type checking | `unknown` + type guard |
|
|
34
|
-
| `as any` | Bypasses type system | Define proper interface |
|
|
35
|
-
| `@ts-ignore` | Hides real errors | Fix the type issue at root |
|
|
36
|
-
| Raw generic `T` without constraint | Too permissive | `T extends SomeInterface` |
|
|
37
|
-
|
|
38
|
-
## `unknown` + Type Guard (VIBE's `any` Replacement)
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
// Instead of: function process(data: any)
|
|
42
|
-
function process(data: unknown): string {
|
|
43
|
-
if (typeof data === 'string') return data.toUpperCase();
|
|
44
|
-
if (isUser(data)) return data.name;
|
|
45
|
-
throw new Error('Unexpected data type');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function isUser(value: unknown): value is User {
|
|
49
|
-
return typeof value === 'object' && value !== null && 'name' in value;
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Gotchas
|
|
54
|
-
|
|
55
|
-
| Gotcha | Why Non-obvious | Fix |
|
|
56
|
-
|--------|----------------|-----|
|
|
57
|
-
| Distributive conditionals | `ToArray<string \| number>` → `string[] \| number[]`, not `(string \| number)[]` | Wrap in tuple: `[T] extends [U]` |
|
|
58
|
-
| Recursive type depth | TS has ~50 level depth limit | Use tail-recursive patterns or simplify |
|
|
59
|
-
| `satisfies` vs `as const` | `satisfies` validates + keeps literal types; `as` skips validation | Prefer `satisfies` |
|
|
60
|
-
| Type assertions (`as X`) | Skips checking entirely | Use type guards instead |
|
|
61
|
-
| `interface` vs `type` | `interface` gives better error messages for objects | Use `type` for unions/complex, `interface` for shapes |
|
|
62
|
-
|
|
63
|
-
## Done Criteria (K4)
|
|
64
|
-
|
|
65
|
-
- [ ] No `any`, `as any`, or `@ts-ignore` in code
|
|
66
|
-
- [ ] All `unknown` usages have corresponding type guards
|
|
67
|
-
- [ ] Complex types have `AssertEqual` type tests
|
|
68
|
-
- [ ] Recursive types are bounded (no infinite depth)
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
# Advanced TypeScript Type Patterns
|
|
2
|
-
|
|
3
|
-
## Discriminated Unions
|
|
4
|
-
|
|
5
|
-
Use a literal `kind`/`type` field to let TypeScript narrow exhaustively.
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
type Result<T> =
|
|
9
|
-
| { kind: 'ok'; value: T }
|
|
10
|
-
| { kind: 'err'; error: string };
|
|
11
|
-
|
|
12
|
-
function handle<T>(r: Result<T>): T {
|
|
13
|
-
if (r.kind === 'ok') return r.value; // narrowed: r.value exists
|
|
14
|
-
throw new Error(r.error); // narrowed: r.error exists
|
|
15
|
-
}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
**Exhaustive check pattern** — compile-time guard against missing branches:
|
|
19
|
-
|
|
20
|
-
```typescript
|
|
21
|
-
function assertNever(x: never): never {
|
|
22
|
-
throw new Error(`Unhandled case: ${JSON.stringify(x)}`);
|
|
23
|
-
}
|
|
24
|
-
// In switch default: case: return assertNever(action);
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Template Literal Types
|
|
28
|
-
|
|
29
|
-
Compose string types at the type level.
|
|
30
|
-
|
|
31
|
-
```typescript
|
|
32
|
-
type EventName = 'click' | 'focus' | 'blur';
|
|
33
|
-
type Handler = `on${Capitalize<EventName>}`;
|
|
34
|
-
// → 'onClick' | 'onFocus' | 'onBlur'
|
|
35
|
-
|
|
36
|
-
type RouteParam<T extends string> =
|
|
37
|
-
T extends `${infer _Start}:${infer Param}/${infer Rest}`
|
|
38
|
-
? Param | RouteParam<Rest>
|
|
39
|
-
: T extends `${infer _Start}:${infer Param}`
|
|
40
|
-
? Param
|
|
41
|
-
: never;
|
|
42
|
-
// RouteParam<'/user/:id/post/:postId'> → 'id' | 'postId'
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**Gotcha**: Template literals distribute over unions — one type per combination.
|
|
46
|
-
|
|
47
|
-
## Conditional Types
|
|
48
|
-
|
|
49
|
-
Branch the type system on type relationships.
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
type NonNullable<T> = T extends null | undefined ? never : T;
|
|
53
|
-
type Awaited<T> = T extends Promise<infer U> ? Awaited<U> : T;
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Distributive gotcha** — to prevent distribution, wrap in a tuple:
|
|
57
|
-
|
|
58
|
-
```typescript
|
|
59
|
-
type IsArray<T> = T extends unknown[] ? true : false;
|
|
60
|
-
// IsArray<string | number[]> → boolean (distributed!)
|
|
61
|
-
|
|
62
|
-
type IsArrayExact<T> = [T] extends [unknown[]] ? true : false;
|
|
63
|
-
// IsArrayExact<string | number[]> → false (no distribution)
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Mapped Types
|
|
67
|
-
|
|
68
|
-
Transform every property in a type.
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
type Readonly<T> = { readonly [K in keyof T]: T[K] };
|
|
72
|
-
type Optional<T> = { [K in keyof T]?: T[K] };
|
|
73
|
-
|
|
74
|
-
// Key remapping with 'as'
|
|
75
|
-
type Getters<T> = {
|
|
76
|
-
[K in keyof T as `get${Capitalize<string & K>}`]: () => T[K];
|
|
77
|
-
};
|
|
78
|
-
// Getters<{ name: string }> → { getName: () => string }
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Branded / Opaque Types
|
|
82
|
-
|
|
83
|
-
Prevent mixing semantically different strings/numbers.
|
|
84
|
-
|
|
85
|
-
```typescript
|
|
86
|
-
type UserId = string & { readonly _brand: 'UserId' };
|
|
87
|
-
type PostId = string & { readonly _brand: 'PostId' };
|
|
88
|
-
|
|
89
|
-
function toUserId(id: string): UserId {
|
|
90
|
-
return id as UserId; // only one cast, at the boundary
|
|
91
|
-
}
|
|
92
|
-
// toUserId('abc') satisfies UserId ✅
|
|
93
|
-
// 'raw-string' satisfies UserId ✗ (compile error)
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## `satisfies` vs `as const`
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
const config = {
|
|
100
|
-
port: 3000,
|
|
101
|
-
host: 'localhost',
|
|
102
|
-
} satisfies Record<string, string | number>;
|
|
103
|
-
// satisfies: validates shape AND keeps literal types (port: 3000, not number)
|
|
104
|
-
|
|
105
|
-
const colors = ['red', 'green', 'blue'] as const;
|
|
106
|
-
// as const: freezes to readonly tuple of literals
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Use `satisfies` when you need both **validation** and **literal type preservation**.
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: yagni-ladder
|
|
3
|
-
user-invocable: false
|
|
4
|
-
invocation: [auto]
|
|
5
|
-
tier: core
|
|
6
|
-
description: "YAGNI Ladder — block writing code before checking 5 cheaper rungs. Sibling of rob-pike: rob-pike blocks premature optimization, this blocks premature code. Auto-activates when about to write non-trivial implementation code."
|
|
7
|
-
triggers: [add feature, implement, create a class, write a, build a, helper, utility, wrapper, abstraction, manager, handler, service for]
|
|
8
|
-
priority: 90
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# The YAGNI Ladder
|
|
12
|
-
|
|
13
|
-
`rob-pike` blocks premature *optimization*. This blocks premature *code*.
|
|
14
|
-
|
|
15
|
-
The agent's default failure mode is writing too much: a 50-line class for a
|
|
16
|
-
one-line job, a wrapper around something the stdlib already does, a config
|
|
17
|
-
system for a value that never changes. Catch it **before** generation, not in
|
|
18
|
-
review — once the code exists, deleting it costs more tokens than never writing
|
|
19
|
-
it.
|
|
20
|
-
|
|
21
|
-
## The Ladder
|
|
22
|
-
|
|
23
|
-
Before writing implementation code, climb these rungs **in order** and stop at
|
|
24
|
-
the **first** one that satisfies the need:
|
|
25
|
-
|
|
26
|
-
1. **Is it needed at all?** — Does the requirement actually ask for this, or am
|
|
27
|
-
I inventing it? If speculative ("might need it later"), stop. Don't build it.
|
|
28
|
-
2. **Is it in the stdlib?** — Language standard library / built-ins. (`crypto`,
|
|
29
|
-
`Intl`, `Array.prototype`, `pathlib`, …)
|
|
30
|
-
3. **Is it a native platform feature?** — The runtime/platform already does it.
|
|
31
|
-
(`<input type="date">`, CSS `:has()`, HTTP caching headers, DB constraints.)
|
|
32
|
-
4. **Does an already-installed dependency do it?** — Check `package.json` /
|
|
33
|
-
lockfile first. Don't add a dependency for what an existing one covers.
|
|
34
|
-
5. **Can it be one line?** — A single expression / call, no new file, no class.
|
|
35
|
-
6. **Only now: write the minimal code** — and no more than rungs 1–5 left undone.
|
|
36
|
-
|
|
37
|
-
**Tie-break rule:** if two rungs both apply, take the **higher** rung (lower
|
|
38
|
-
number). Native feature beats a one-liner; stdlib beats a dependency.
|
|
39
|
-
|
|
40
|
-
## Anti-Patterns to Block
|
|
41
|
-
|
|
42
|
-
| Impulse | Rung that catches it | Response |
|
|
43
|
-
|---|---|---|
|
|
44
|
-
| "I'll write a date-picker component" | 3 (native) | `<input type="date">`. One line. |
|
|
45
|
-
| "Add a `StringUtils.isEmpty()` helper" | 2 (stdlib) | `!s` / `not s`. The language already does this. |
|
|
46
|
-
| "Let me build a retry wrapper class" | 4 (installed dep) | Does an HTTP/util lib in the lockfile already retry? |
|
|
47
|
-
| "I'll add a config system for this value" | 1 (needed?) | It's one constant that never changes. A `const` is the config. |
|
|
48
|
-
| "A `CacheManager` class with TTL + eviction" | 1 / 5 | Is concurrency real yet? A `Map` + one `setTimeout` may be the whole job. |
|
|
49
|
-
| "Generic `DataProcessor(strategy, validator…)`" | 1 (needed?) | One concrete function. Generalize when a *second* caller exists. |
|
|
50
|
-
| "190-line animated dashboard" | 1 (needed?) | Did the task ask for animation, or just the number? Ship the 13 lines. |
|
|
51
|
-
|
|
52
|
-
## When Writing The Code IS Justified
|
|
53
|
-
|
|
54
|
-
Proceed to rung 6 only when ALL are true:
|
|
55
|
-
|
|
56
|
-
- Rungs 1–5 genuinely don't cover it (you checked the lockfile, not guessed).
|
|
57
|
-
- The requirement explicitly asks for it — not "might need."
|
|
58
|
-
- You write the **minimum** that satisfies the requirement, nothing for "later."
|
|
59
|
-
|
|
60
|
-
## Two Hard Rules That Override Simplicity
|
|
61
|
-
|
|
62
|
-
Simplification pressure must never erode these:
|
|
63
|
-
|
|
64
|
-
1. **Never skip security or trust-boundary work.** Input validation, auth
|
|
65
|
-
checks, escaping, permission boundaries — these are *requirements*, not
|
|
66
|
-
optional complexity. "One line" is no excuse to drop a validation.
|
|
67
|
-
2. **Leave a comment + upgrade path on deliberate simplifications.** When you
|
|
68
|
-
pick the simple option knowing a bigger one might be needed later, say so in
|
|
69
|
-
the code so the next reader sees it was a *choice*, not an oversight:
|
|
70
|
-
|
|
71
|
-
```ts
|
|
72
|
-
// Global lock is enough at current throughput.
|
|
73
|
-
// Switch to per-account locking if write contention shows up.
|
|
74
|
-
const lock = new Mutex();
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Relationship to Other Skills
|
|
78
|
-
|
|
79
|
-
- **`rob-pike`** — same shape, optimization axis. Climb both ladders: don't
|
|
80
|
-
optimize without measuring, don't write code without climbing the rungs.
|
|
81
|
-
- **`simplicity-reviewer`** (review agent) — the *sufficiency net* after the
|
|
82
|
-
fact. This skill is the *generation gate* before the fact. If this skill did
|
|
83
|
-
its job, simplicity-reviewer finds nothing to delete.
|
|
84
|
-
|
|
85
|
-
## Questions to Ask Before Writing
|
|
86
|
-
|
|
87
|
-
1. "Does the stdlib or platform already do this?"
|
|
88
|
-
2. "Is there a dependency already installed that covers it?"
|
|
89
|
-
3. "Can this be one line instead of one file?"
|
|
90
|
-
4. "Am I building for a requirement that exists, or one I imagined?"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|