@heyai-rules/pilo-masterkit 1.2.2
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/.agent/agents/PILO_MASTER.md +77 -0
- package/.agent/agents/architect.md +211 -0
- package/.agent/agents/backend-specialist.md +263 -0
- package/.agent/agents/build-error-resolver.md +114 -0
- package/.agent/agents/chief-of-staff.md +151 -0
- package/.agent/agents/code-archaeologist.md +106 -0
- package/.agent/agents/code-reviewer.md +237 -0
- package/.agent/agents/cpp-build-resolver.md +90 -0
- package/.agent/agents/cpp-reviewer.md +72 -0
- package/.agent/agents/database-architect.md +226 -0
- package/.agent/agents/database-reviewer.md +91 -0
- package/.agent/agents/debugger.md +225 -0
- package/.agent/agents/devops-engineer.md +242 -0
- package/.agent/agents/doc-updater.md +107 -0
- package/.agent/agents/docs-lookup.md +68 -0
- package/.agent/agents/documentation-writer.md +104 -0
- package/.agent/agents/e2e-runner.md +107 -0
- package/.agent/agents/explorer-agent.md +73 -0
- package/.agent/agents/flutter-reviewer.md +243 -0
- package/.agent/agents/frontend-specialist.md +593 -0
- package/.agent/agents/game-developer.md +162 -0
- package/.agent/agents/go-build-resolver.md +94 -0
- package/.agent/agents/go-reviewer.md +76 -0
- package/.agent/agents/harness-optimizer.md +35 -0
- package/.agent/agents/java-build-resolver.md +153 -0
- package/.agent/agents/java-reviewer.md +92 -0
- package/.agent/agents/kotlin-build-resolver.md +118 -0
- package/.agent/agents/kotlin-reviewer.md +159 -0
- package/.agent/agents/loop-operator.md +36 -0
- package/.agent/agents/mobile-developer.md +377 -0
- package/.agent/agents/orchestrator.md +416 -0
- package/.agent/agents/penetration-tester.md +188 -0
- package/.agent/agents/performance-optimizer.md +187 -0
- package/.agent/agents/planner.md +212 -0
- package/.agent/agents/product-manager.md +112 -0
- package/.agent/agents/product-owner.md +95 -0
- package/.agent/agents/project-planner.md +406 -0
- package/.agent/agents/python-reviewer.md +98 -0
- package/.agent/agents/pytorch-build-resolver.md +120 -0
- package/.agent/agents/qa-automation-engineer.md +103 -0
- package/.agent/agents/refactor-cleaner.md +85 -0
- package/.agent/agents/rust-build-resolver.md +148 -0
- package/.agent/agents/rust-reviewer.md +94 -0
- package/.agent/agents/security-auditor.md +170 -0
- package/.agent/agents/security-reviewer.md +108 -0
- package/.agent/agents/seo-specialist.md +111 -0
- package/.agent/agents/tdd-guide.md +91 -0
- package/.agent/agents/test-engineer.md +158 -0
- package/.agent/agents/typescript-reviewer.md +112 -0
- package/.agent/rules/ARCHITECTURAL_BLUEPRINTS.md +62 -0
- package/.agent/rules/CODE_CRAFTSMANSHIP.md +69 -0
- package/.agent/rules/CORE_RULES.md +72 -0
- package/.agent/rules/PROJECT_MAP.md +58 -0
- package/.agent/rules/QUALITY_ASSURANCE.md +54 -0
- package/.agent/rules/SECURITY_ARMOR.md +44 -0
- package/.agent/rules/VERSION_ORCHESTRATION.md +64 -0
- package/.agent/rules/WORKFLOW_ORCHESTRATION.md +55 -0
- package/.agent/scripts/auto_preview.py +148 -0
- package/.agent/scripts/checklist.py +217 -0
- package/.agent/scripts/session_manager.py +120 -0
- package/.agent/scripts/verify_all.py +327 -0
- package/.agent/skills/api-patterns/SKILL.md +81 -0
- package/.agent/skills/api-patterns/api-style.md +42 -0
- package/.agent/skills/api-patterns/auth.md +24 -0
- package/.agent/skills/api-patterns/documentation.md +26 -0
- package/.agent/skills/api-patterns/graphql.md +41 -0
- package/.agent/skills/api-patterns/rate-limiting.md +31 -0
- package/.agent/skills/api-patterns/response.md +37 -0
- package/.agent/skills/api-patterns/rest.md +40 -0
- package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
- package/.agent/skills/api-patterns/security-testing.md +122 -0
- package/.agent/skills/api-patterns/trpc.md +41 -0
- package/.agent/skills/api-patterns/versioning.md +22 -0
- package/.agent/skills/app-builder/SKILL.md +75 -0
- package/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/.agent/skills/app-builder/feature-building.md +53 -0
- package/.agent/skills/app-builder/project-detection.md +34 -0
- package/.agent/skills/app-builder/scaffolding.md +118 -0
- package/.agent/skills/app-builder/tech-stack.md +41 -0
- package/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/.agent/skills/architecture/SKILL.md +55 -0
- package/.agent/skills/architecture/context-discovery.md +43 -0
- package/.agent/skills/architecture/examples.md +94 -0
- package/.agent/skills/architecture/pattern-selection.md +68 -0
- package/.agent/skills/architecture/patterns-reference.md +50 -0
- package/.agent/skills/architecture/trade-off-analysis.md +77 -0
- package/.agent/skills/bash-linux/SKILL.md +199 -0
- package/.agent/skills/behavioral-modes/SKILL.md +242 -0
- package/.agent/skills/brainstorming/SKILL.md +163 -0
- package/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
- package/.agent/skills/clean-code/SKILL.md +201 -0
- package/.agent/skills/code-review-checklist/SKILL.md +109 -0
- package/.agent/skills/database-design/SKILL.md +52 -0
- package/.agent/skills/database-design/database-selection.md +43 -0
- package/.agent/skills/database-design/indexing.md +39 -0
- package/.agent/skills/database-design/migrations.md +48 -0
- package/.agent/skills/database-design/optimization.md +36 -0
- package/.agent/skills/database-design/orm-selection.md +30 -0
- package/.agent/skills/database-design/schema-design.md +56 -0
- package/.agent/skills/database-design/scripts/schema_validator.py +172 -0
- package/.agent/skills/deployment-procedures/SKILL.md +241 -0
- package/.agent/skills/doc.md +177 -0
- package/.agent/skills/documentation-templates/SKILL.md +194 -0
- package/.agent/skills/frontend-design/SKILL.md +452 -0
- package/.agent/skills/frontend-design/animation-guide.md +331 -0
- package/.agent/skills/frontend-design/color-system.md +311 -0
- package/.agent/skills/frontend-design/decision-trees.md +418 -0
- package/.agent/skills/frontend-design/motion-graphics.md +306 -0
- package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/.agent/skills/frontend-design/typography-system.md +345 -0
- package/.agent/skills/frontend-design/ux-psychology.md +1116 -0
- package/.agent/skills/frontend-design/visual-effects.md +383 -0
- package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/.agent/skills/game-development/SKILL.md +167 -0
- package/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +156 -0
- package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/.agent/skills/i18n-localization/SKILL.md +154 -0
- package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/.agent/skills/intelligent-routing/SKILL.md +335 -0
- package/.agent/skills/lint-and-validate/SKILL.md +45 -0
- package/.agent/skills/lint-and-validate/scripts/lint_runner.py +184 -0
- package/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/.agent/skills/mcp-builder/SKILL.md +176 -0
- package/.agent/skills/mobile-design/SKILL.md +394 -0
- package/.agent/skills/mobile-design/decision-trees.md +516 -0
- package/.agent/skills/mobile-design/mobile-backend.md +491 -0
- package/.agent/skills/mobile-design/mobile-color-system.md +420 -0
- package/.agent/skills/mobile-design/mobile-debugging.md +122 -0
- package/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/.agent/skills/mobile-design/mobile-navigation.md +458 -0
- package/.agent/skills/mobile-design/mobile-performance.md +767 -0
- package/.agent/skills/mobile-design/mobile-testing.md +356 -0
- package/.agent/skills/mobile-design/mobile-typography.md +433 -0
- package/.agent/skills/mobile-design/platform-android.md +666 -0
- package/.agent/skills/mobile-design/platform-ios.md +561 -0
- package/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/.agent/skills/mobile-design/touch-psychology.md +537 -0
- package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
- package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/.agent/skills/nextjs-react-expert/9-cache-components.md +103 -0
- package/.agent/skills/nextjs-react-expert/SKILL.md +293 -0
- package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
- package/.agent/skills/parallel-agents/SKILL.md +175 -0
- package/.agent/skills/performance-profiling/SKILL.md +143 -0
- package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/.agent/skills/plan-writing/SKILL.md +152 -0
- package/.agent/skills/powershell-windows/SKILL.md +167 -0
- package/.agent/skills/python-patterns/SKILL.md +441 -0
- package/.agent/skills/red-team-tactics/SKILL.md +199 -0
- package/.agent/skills/rust-pro/SKILL.md +176 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +129 -0
- package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/.agent/skills/server-management/SKILL.md +161 -0
- package/.agent/skills/systematic-debugging/SKILL.md +109 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +269 -0
- package/.agent/skills/tdd-workflow/SKILL.md +149 -0
- package/.agent/skills/testing-patterns/SKILL.md +178 -0
- package/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +292 -0
- package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-314.pyc +0 -0
- package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-314.pyc +0 -0
- package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/search.cpython-314.pyc +0 -0
- package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.agent/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
- package/.agent/skills/vulnerability-scanner/checklists.md +121 -0
- package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/.agent/skills/web-design-guidelines/SKILL.md +57 -0
- package/.agent/skills/webapp-testing/SKILL.md +187 -0
- package/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/.agent/tasks/lessons.md +40 -0
- package/.agent/tasks/todo.md +33 -0
- package/.agent/workflows/aside.md +164 -0
- package/.agent/workflows/brainstorm.md +113 -0
- package/.agent/workflows/build-fix.md +62 -0
- package/.agent/workflows/checkpoint.md +74 -0
- package/.agent/workflows/claw.md +51 -0
- package/.agent/workflows/code-review.md +40 -0
- package/.agent/workflows/context-budget.md +29 -0
- package/.agent/workflows/cpp-build.md +173 -0
- package/.agent/workflows/cpp-review.md +132 -0
- package/.agent/workflows/cpp-test.md +251 -0
- package/.agent/workflows/create.md +59 -0
- package/.agent/workflows/debug.md +103 -0
- package/.agent/workflows/deploy.md +176 -0
- package/.agent/workflows/devfleet.md +92 -0
- package/.agent/workflows/docs.md +31 -0
- package/.agent/workflows/e2e.md +365 -0
- package/.agent/workflows/enhance.md +63 -0
- package/.agent/workflows/eval.md +120 -0
- package/.agent/workflows/evolve.md +178 -0
- package/.agent/workflows/go-build.md +183 -0
- package/.agent/workflows/go-review.md +148 -0
- package/.agent/workflows/go-test.md +268 -0
- package/.agent/workflows/gradle-build.md +70 -0
- package/.agent/workflows/harness-audit.md +71 -0
- package/.agent/workflows/init-docs.md +46 -0
- package/.agent/workflows/instinct-export.md +66 -0
- package/.agent/workflows/instinct-import.md +114 -0
- package/.agent/workflows/instinct-status.md +59 -0
- package/.agent/workflows/kotlin-build.md +174 -0
- package/.agent/workflows/kotlin-review.md +140 -0
- package/.agent/workflows/kotlin-test.md +312 -0
- package/.agent/workflows/learn-eval.md +116 -0
- package/.agent/workflows/learn.md +70 -0
- package/.agent/workflows/loop-start.md +32 -0
- package/.agent/workflows/loop-status.md +24 -0
- package/.agent/workflows/model-route.md +26 -0
- package/.agent/workflows/multi-backend.md +158 -0
- package/.agent/workflows/multi-execute.md +315 -0
- package/.agent/workflows/multi-frontend.md +158 -0
- package/.agent/workflows/multi-plan.md +268 -0
- package/.agent/workflows/multi-workflow.md +191 -0
- package/.agent/workflows/orchestrate.md +231 -0
- package/.agent/workflows/plan.md +115 -0
- package/.agent/workflows/pm2.md +272 -0
- package/.agent/workflows/preview.md +81 -0
- package/.agent/workflows/projects.md +39 -0
- package/.agent/workflows/promote.md +41 -0
- package/.agent/workflows/prompt-optimize.md +38 -0
- package/.agent/workflows/prune.md +31 -0
- package/.agent/workflows/python-review.md +297 -0
- package/.agent/workflows/quality-gate.md +29 -0
- package/.agent/workflows/refactor-clean.md +80 -0
- package/.agent/workflows/resume-session.md +156 -0
- package/.agent/workflows/rules-distill.md +11 -0
- package/.agent/workflows/rust-build.md +187 -0
- package/.agent/workflows/rust-review.md +142 -0
- package/.agent/workflows/rust-test.md +308 -0
- package/.agent/workflows/save-session.md +275 -0
- package/.agent/workflows/sessions.md +333 -0
- package/.agent/workflows/setup-pm.md +80 -0
- package/.agent/workflows/skill-create.md +174 -0
- package/.agent/workflows/skill-health.md +54 -0
- package/.agent/workflows/status.md +86 -0
- package/.agent/workflows/tdd.md +328 -0
- package/.agent/workflows/test-coverage.md +69 -0
- package/.agent/workflows/test.md +144 -0
- package/.agent/workflows/ui-ux-pro-max.md +296 -0
- package/.agent/workflows/update-codemaps.md +72 -0
- package/.agent/workflows/update-docs.md +84 -0
- package/.agent/workflows/verify.md +59 -0
- package/LICENSE +176 -0
- package/README.md +136 -0
- package/RELEASE.md +36 -0
- package/package.json +79 -0
- package/scripts/release-check.js +55 -0
- package/src/bin/cli.js +78 -0
- package/src/lib/installer.js +140 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skill-create
|
|
3
|
+
description: Analyze local git history to extract coding patterns and generate SKILL.md files. Local version of the Skill Creator GitHub App.
|
|
4
|
+
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /skill-create - Local Skill Generation
|
|
8
|
+
|
|
9
|
+
Analyze your repository's git history to extract coding patterns and generate SKILL.md files that teach Claude your team's practices.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
/skill-create # Analyze current repo
|
|
15
|
+
/skill-create --commits 100 # Analyze last 100 commits
|
|
16
|
+
/skill-create --output ./skills # Custom output directory
|
|
17
|
+
/skill-create --instincts # Also generate instincts for continuous-learning-v2
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## What It Does
|
|
21
|
+
|
|
22
|
+
1. **Parses Git History** - Analyzes commits, file changes, and patterns
|
|
23
|
+
2. **Detects Patterns** - Identifies recurring workflows and conventions
|
|
24
|
+
3. **Generates SKILL.md** - Creates valid Claude Code skill files
|
|
25
|
+
4. **Optionally Creates Instincts** - For the continuous-learning-v2 system
|
|
26
|
+
|
|
27
|
+
## Analysis Steps
|
|
28
|
+
|
|
29
|
+
### Step 1: Gather Git Data
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Get recent commits with file changes
|
|
33
|
+
git log --oneline -n ${COMMITS:-200} --name-only --pretty=format:"%H|%s|%ad" --date=short
|
|
34
|
+
|
|
35
|
+
# Get commit frequency by file
|
|
36
|
+
git log --oneline -n 200 --name-only | grep -v "^$" | grep -v "^[a-f0-9]" | sort | uniq -c | sort -rn | head -20
|
|
37
|
+
|
|
38
|
+
# Get commit message patterns
|
|
39
|
+
git log --oneline -n 200 | cut -d' ' -f2- | head -50
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Step 2: Detect Patterns
|
|
43
|
+
|
|
44
|
+
Look for these pattern types:
|
|
45
|
+
|
|
46
|
+
| Pattern | Detection Method |
|
|
47
|
+
|---------|-----------------|
|
|
48
|
+
| **Commit conventions** | Regex on commit messages (feat:, fix:, chore:) |
|
|
49
|
+
| **File co-changes** | Files that always change together |
|
|
50
|
+
| **Workflow sequences** | Repeated file change patterns |
|
|
51
|
+
| **Architecture** | Folder structure and naming conventions |
|
|
52
|
+
| **Testing patterns** | Test file locations, naming, coverage |
|
|
53
|
+
|
|
54
|
+
### Step 3: Generate SKILL.md
|
|
55
|
+
|
|
56
|
+
Output format:
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
---
|
|
60
|
+
name: {repo-name}-patterns
|
|
61
|
+
description: Coding patterns extracted from {repo-name}
|
|
62
|
+
version: 1.0.0
|
|
63
|
+
source: local-git-analysis
|
|
64
|
+
analyzed_commits: {count}
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
# {Repo Name} Patterns
|
|
68
|
+
|
|
69
|
+
## Commit Conventions
|
|
70
|
+
{detected commit message patterns}
|
|
71
|
+
|
|
72
|
+
## Code Architecture
|
|
73
|
+
{detected folder structure and organization}
|
|
74
|
+
|
|
75
|
+
## Workflows
|
|
76
|
+
{detected repeating file change patterns}
|
|
77
|
+
|
|
78
|
+
## Testing Patterns
|
|
79
|
+
{detected test conventions}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Step 4: Generate Instincts (if --instincts)
|
|
83
|
+
|
|
84
|
+
For continuous-learning-v2 integration:
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
---
|
|
88
|
+
id: {repo}-commit-convention
|
|
89
|
+
trigger: "when writing a commit message"
|
|
90
|
+
confidence: 0.8
|
|
91
|
+
domain: git
|
|
92
|
+
source: local-repo-analysis
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
# Use Conventional Commits
|
|
96
|
+
|
|
97
|
+
## Action
|
|
98
|
+
Prefix commits with: feat:, fix:, chore:, docs:, test:, refactor:
|
|
99
|
+
|
|
100
|
+
## Evidence
|
|
101
|
+
- Analyzed {n} commits
|
|
102
|
+
- {percentage}% follow conventional commit format
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Example Output
|
|
106
|
+
|
|
107
|
+
Running `/skill-create` on a TypeScript project might produce:
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
---
|
|
111
|
+
name: my-app-patterns
|
|
112
|
+
description: Coding patterns from my-app repository
|
|
113
|
+
version: 1.0.0
|
|
114
|
+
source: local-git-analysis
|
|
115
|
+
analyzed_commits: 150
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
# My App Patterns
|
|
119
|
+
|
|
120
|
+
## Commit Conventions
|
|
121
|
+
|
|
122
|
+
This project uses **conventional commits**:
|
|
123
|
+
- `feat:` - New features
|
|
124
|
+
- `fix:` - Bug fixes
|
|
125
|
+
- `chore:` - Maintenance tasks
|
|
126
|
+
- `docs:` - Documentation updates
|
|
127
|
+
|
|
128
|
+
## Code Architecture
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
src/
|
|
132
|
+
├── components/ # React components (PascalCase.tsx)
|
|
133
|
+
├── hooks/ # Custom hooks (use*.ts)
|
|
134
|
+
├── utils/ # Utility functions
|
|
135
|
+
├── types/ # TypeScript type definitions
|
|
136
|
+
└── services/ # API and external services
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Workflows
|
|
140
|
+
|
|
141
|
+
### Adding a New Component
|
|
142
|
+
1. Create `src/components/ComponentName.tsx`
|
|
143
|
+
2. Add tests in `src/components/__tests__/ComponentName.test.tsx`
|
|
144
|
+
3. Export from `src/components/index.ts`
|
|
145
|
+
|
|
146
|
+
### Database Migration
|
|
147
|
+
1. Modify `src/db/schema.ts`
|
|
148
|
+
2. Run `pnpm db:generate`
|
|
149
|
+
3. Run `pnpm db:migrate`
|
|
150
|
+
|
|
151
|
+
## Testing Patterns
|
|
152
|
+
|
|
153
|
+
- Test files: `__tests__/` directories or `.test.ts` suffix
|
|
154
|
+
- Coverage target: 80%+
|
|
155
|
+
- Framework: Vitest
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## GitHub App Integration
|
|
159
|
+
|
|
160
|
+
For advanced features (10k+ commits, team sharing, auto-PRs), use the [Skill Creator GitHub App](https://github.com/apps/skill-creator):
|
|
161
|
+
|
|
162
|
+
- Install: [github.com/apps/skill-creator](https://github.com/apps/skill-creator)
|
|
163
|
+
- Comment `/skill-creator analyze` on any issue
|
|
164
|
+
- Receives PR with generated skills
|
|
165
|
+
|
|
166
|
+
## Related Commands
|
|
167
|
+
|
|
168
|
+
- `/instinct-import` - Import generated instincts
|
|
169
|
+
- `/instinct-status` - View learned instincts
|
|
170
|
+
- `/evolve` - Cluster instincts into skills/agents
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
*Part of [Everything Claude Code](https://github.com/affaan-m/everything-claude-code)*
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skill-health
|
|
3
|
+
description: Show skill portfolio health dashboard with charts and analytics
|
|
4
|
+
command: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Skill Health Dashboard
|
|
8
|
+
|
|
9
|
+
Shows a comprehensive health dashboard for all skills in the portfolio with success rate sparklines, failure pattern clustering, pending amendments, and version history.
|
|
10
|
+
|
|
11
|
+
## Implementation
|
|
12
|
+
|
|
13
|
+
Run the skill health CLI in dashboard mode:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ECC_ROOT="${CLAUDE_PLUGIN_ROOT:-$(node -e "var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(!f.existsSync(p.join(d,q))){try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q))){d=c;break}}}catch(x){}}console.log(d)")}"
|
|
17
|
+
node "$ECC_ROOT/scripts/skills-health.js" --dashboard
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
For a specific panel only:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
ECC_ROOT="${CLAUDE_PLUGIN_ROOT:-$(node -e "var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(!f.existsSync(p.join(d,q))){try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q))){d=c;break}}}catch(x){}}console.log(d)")}"
|
|
24
|
+
node "$ECC_ROOT/scripts/skills-health.js" --dashboard --panel failures
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For machine-readable output:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
ECC_ROOT="${CLAUDE_PLUGIN_ROOT:-$(node -e "var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(!f.existsSync(p.join(d,q))){try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q))){d=c;break}}}catch(x){}}console.log(d)")}"
|
|
31
|
+
node "$ECC_ROOT/scripts/skills-health.js" --dashboard --json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
/skill-health # Full dashboard view
|
|
38
|
+
/skill-health --panel failures # Only failure clustering panel
|
|
39
|
+
/skill-health --json # Machine-readable JSON output
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## What to Do
|
|
43
|
+
|
|
44
|
+
1. Run the skills-health.js script with --dashboard flag
|
|
45
|
+
2. Display the output to the user
|
|
46
|
+
3. If any skills are declining, highlight them and suggest running /evolve
|
|
47
|
+
4. If there are pending amendments, suggest reviewing them
|
|
48
|
+
|
|
49
|
+
## Panels
|
|
50
|
+
|
|
51
|
+
- **Success Rate (30d)** — Sparkline charts showing daily success rates per skill
|
|
52
|
+
- **Failure Patterns** — Clustered failure reasons with horizontal bar chart
|
|
53
|
+
- **Pending Amendments** — Amendment proposals awaiting review
|
|
54
|
+
- **Version History** — Timeline of version snapshots per skill
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Display agent and project status. Progress tracking and status board.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /status - Show Status
|
|
6
|
+
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Task
|
|
12
|
+
|
|
13
|
+
Show current project and agent status.
|
|
14
|
+
|
|
15
|
+
### What It Shows
|
|
16
|
+
|
|
17
|
+
1. **Project Info**
|
|
18
|
+
- Project name and path
|
|
19
|
+
- Tech stack
|
|
20
|
+
- Current features
|
|
21
|
+
|
|
22
|
+
2. **Agent Status Board**
|
|
23
|
+
- Which agents are running
|
|
24
|
+
- Which tasks are completed
|
|
25
|
+
- Pending work
|
|
26
|
+
|
|
27
|
+
3. **File Statistics**
|
|
28
|
+
- Files created count
|
|
29
|
+
- Files modified count
|
|
30
|
+
|
|
31
|
+
4. **Preview Status**
|
|
32
|
+
- Is server running
|
|
33
|
+
- URL
|
|
34
|
+
- Health check
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Example Output
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
=== Project Status ===
|
|
42
|
+
|
|
43
|
+
📁 Project: my-ecommerce
|
|
44
|
+
📂 Path: C:/projects/my-ecommerce
|
|
45
|
+
🏷️ Type: nextjs-ecommerce
|
|
46
|
+
📊 Status: active
|
|
47
|
+
|
|
48
|
+
🔧 Tech Stack:
|
|
49
|
+
Framework: next.js
|
|
50
|
+
Database: postgresql
|
|
51
|
+
Auth: clerk
|
|
52
|
+
Payment: stripe
|
|
53
|
+
|
|
54
|
+
✅ Features (5):
|
|
55
|
+
• product-listing
|
|
56
|
+
• cart
|
|
57
|
+
• checkout
|
|
58
|
+
• user-auth
|
|
59
|
+
• order-history
|
|
60
|
+
|
|
61
|
+
⏳ Pending (2):
|
|
62
|
+
• admin-panel
|
|
63
|
+
• email-notifications
|
|
64
|
+
|
|
65
|
+
📄 Files: 73 created, 12 modified
|
|
66
|
+
|
|
67
|
+
=== Agent Status ===
|
|
68
|
+
|
|
69
|
+
✅ database-architect → Completed
|
|
70
|
+
✅ backend-specialist → Completed
|
|
71
|
+
🔄 frontend-specialist → Dashboard components (60%)
|
|
72
|
+
⏳ test-engineer → Waiting
|
|
73
|
+
|
|
74
|
+
=== Preview ===
|
|
75
|
+
|
|
76
|
+
🌐 URL: http://localhost:3000
|
|
77
|
+
💚 Health: OK
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Technical
|
|
83
|
+
|
|
84
|
+
Status uses these scripts:
|
|
85
|
+
- `python .agent/scripts/session_manager.py status`
|
|
86
|
+
- `python .agent/scripts/auto_preview.py status`
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Enforce test-driven development workflow. Scaffold interfaces, generate tests FIRST, then implement minimal code to pass. Ensure 80%+ coverage.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# TDD Command
|
|
6
|
+
|
|
7
|
+
This command invokes the **tdd-guide** agent to enforce test-driven development methodology.
|
|
8
|
+
|
|
9
|
+
## What This Command Does
|
|
10
|
+
|
|
11
|
+
1. **Scaffold Interfaces** - Define types/interfaces first
|
|
12
|
+
2. **Generate Tests First** - Write failing tests (RED)
|
|
13
|
+
3. **Implement Minimal Code** - Write just enough to pass (GREEN)
|
|
14
|
+
4. **Refactor** - Improve code while keeping tests green (REFACTOR)
|
|
15
|
+
5. **Verify Coverage** - Ensure 80%+ test coverage
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
Use `/tdd` when:
|
|
20
|
+
- Implementing new features
|
|
21
|
+
- Adding new functions/components
|
|
22
|
+
- Fixing bugs (write test that reproduces bug first)
|
|
23
|
+
- Refactoring existing code
|
|
24
|
+
- Building critical business logic
|
|
25
|
+
|
|
26
|
+
## How It Works
|
|
27
|
+
|
|
28
|
+
The tdd-guide agent will:
|
|
29
|
+
|
|
30
|
+
1. **Define interfaces** for inputs/outputs
|
|
31
|
+
2. **Write tests that will FAIL** (because code doesn't exist yet)
|
|
32
|
+
3. **Run tests** and verify they fail for the right reason
|
|
33
|
+
4. **Write minimal implementation** to make tests pass
|
|
34
|
+
5. **Run tests** and verify they pass
|
|
35
|
+
6. **Refactor** code while keeping tests green
|
|
36
|
+
7. **Check coverage** and add more tests if below 80%
|
|
37
|
+
|
|
38
|
+
## TDD Cycle
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
RED → GREEN → REFACTOR → REPEAT
|
|
42
|
+
|
|
43
|
+
RED: Write a failing test
|
|
44
|
+
GREEN: Write minimal code to pass
|
|
45
|
+
REFACTOR: Improve code, keep tests passing
|
|
46
|
+
REPEAT: Next feature/scenario
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Example Usage
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
User: /tdd I need a function to calculate market liquidity score
|
|
53
|
+
|
|
54
|
+
Agent (tdd-guide):
|
|
55
|
+
# TDD Session: Market Liquidity Score Calculator
|
|
56
|
+
|
|
57
|
+
## Step 1: Define Interface (SCAFFOLD)
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// lib/liquidity.ts
|
|
61
|
+
export interface MarketData {
|
|
62
|
+
totalVolume: number
|
|
63
|
+
bidAskSpread: number
|
|
64
|
+
activeTraders: number
|
|
65
|
+
lastTradeTime: Date
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function calculateLiquidityScore(market: MarketData): number {
|
|
69
|
+
// TODO: Implementation
|
|
70
|
+
throw new Error('Not implemented')
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Step 2: Write Failing Test (RED)
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
// lib/liquidity.test.ts
|
|
78
|
+
import { calculateLiquidityScore } from './liquidity'
|
|
79
|
+
|
|
80
|
+
describe('calculateLiquidityScore', () => {
|
|
81
|
+
it('should return high score for liquid market', () => {
|
|
82
|
+
const market = {
|
|
83
|
+
totalVolume: 100000,
|
|
84
|
+
bidAskSpread: 0.01,
|
|
85
|
+
activeTraders: 500,
|
|
86
|
+
lastTradeTime: new Date()
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const score = calculateLiquidityScore(market)
|
|
90
|
+
|
|
91
|
+
expect(score).toBeGreaterThan(80)
|
|
92
|
+
expect(score).toBeLessThanOrEqual(100)
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
it('should return low score for illiquid market', () => {
|
|
96
|
+
const market = {
|
|
97
|
+
totalVolume: 100,
|
|
98
|
+
bidAskSpread: 0.5,
|
|
99
|
+
activeTraders: 2,
|
|
100
|
+
lastTradeTime: new Date(Date.now() - 86400000) // 1 day ago
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const score = calculateLiquidityScore(market)
|
|
104
|
+
|
|
105
|
+
expect(score).toBeLessThan(30)
|
|
106
|
+
expect(score).toBeGreaterThanOrEqual(0)
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
it('should handle edge case: zero volume', () => {
|
|
110
|
+
const market = {
|
|
111
|
+
totalVolume: 0,
|
|
112
|
+
bidAskSpread: 0,
|
|
113
|
+
activeTraders: 0,
|
|
114
|
+
lastTradeTime: new Date()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const score = calculateLiquidityScore(market)
|
|
118
|
+
|
|
119
|
+
expect(score).toBe(0)
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Step 3: Run Tests - Verify FAIL
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
npm test lib/liquidity.test.ts
|
|
128
|
+
|
|
129
|
+
FAIL lib/liquidity.test.ts
|
|
130
|
+
✕ should return high score for liquid market (2 ms)
|
|
131
|
+
Error: Not implemented
|
|
132
|
+
|
|
133
|
+
1 test failed, 0 passed
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
✅ Tests fail as expected. Ready to implement.
|
|
137
|
+
|
|
138
|
+
## Step 4: Implement Minimal Code (GREEN)
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
// lib/liquidity.ts
|
|
142
|
+
export function calculateLiquidityScore(market: MarketData): number {
|
|
143
|
+
// Handle zero volume edge case
|
|
144
|
+
if (market.totalVolume === 0) {
|
|
145
|
+
return 0
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Calculate component scores (0-100 scale)
|
|
149
|
+
const volumeScore = Math.min(market.totalVolume / 1000, 100)
|
|
150
|
+
const spreadScore = Math.max(100 - (market.bidAskSpread * 1000), 0)
|
|
151
|
+
const traderScore = Math.min(market.activeTraders / 10, 100)
|
|
152
|
+
|
|
153
|
+
// Recent activity bonus
|
|
154
|
+
const hoursSinceLastTrade = (Date.now() - market.lastTradeTime.getTime()) / (1000 * 60 * 60)
|
|
155
|
+
const recencyScore = Math.max(100 - (hoursSinceLastTrade * 10), 0)
|
|
156
|
+
|
|
157
|
+
// Weighted average
|
|
158
|
+
const score = (
|
|
159
|
+
volumeScore * 0.4 +
|
|
160
|
+
spreadScore * 0.3 +
|
|
161
|
+
traderScore * 0.2 +
|
|
162
|
+
recencyScore * 0.1
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
return Math.min(Math.max(score, 0), 100) // Clamp to 0-100
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Step 5: Run Tests - Verify PASS
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
npm test lib/liquidity.test.ts
|
|
173
|
+
|
|
174
|
+
PASS lib/liquidity.test.ts
|
|
175
|
+
✓ should return high score for liquid market (3 ms)
|
|
176
|
+
✓ should return low score for illiquid market (2 ms)
|
|
177
|
+
✓ should handle edge case: zero volume (1 ms)
|
|
178
|
+
|
|
179
|
+
3 tests passed
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
✅ All tests passing!
|
|
183
|
+
|
|
184
|
+
## Step 6: Refactor (IMPROVE)
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
// lib/liquidity.ts - Refactored with constants and better readability
|
|
188
|
+
const WEIGHTS = {
|
|
189
|
+
VOLUME: 0.4,
|
|
190
|
+
SPREAD: 0.3,
|
|
191
|
+
TRADERS: 0.2,
|
|
192
|
+
RECENCY: 0.1,
|
|
193
|
+
} as const
|
|
194
|
+
|
|
195
|
+
const SCALE_FACTORS = {
|
|
196
|
+
VOLUME: 1000,
|
|
197
|
+
SPREAD: 1000,
|
|
198
|
+
TRADERS: 10,
|
|
199
|
+
RECENCY_PENALTY: 10,
|
|
200
|
+
} as const
|
|
201
|
+
|
|
202
|
+
function clamp(value: number, min: number, max: number): number {
|
|
203
|
+
return Math.min(Math.max(value, min), max)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function calculateLiquidityScore(market: MarketData): number {
|
|
207
|
+
if (market.totalVolume === 0) return 0
|
|
208
|
+
|
|
209
|
+
const volumeScore = Math.min(market.totalVolume / SCALE_FACTORS.VOLUME, 100)
|
|
210
|
+
const spreadScore = clamp(100 - (market.bidAskSpread * SCALE_FACTORS.SPREAD), 0, 100)
|
|
211
|
+
const traderScore = Math.min(market.activeTraders / SCALE_FACTORS.TRADERS, 100)
|
|
212
|
+
|
|
213
|
+
const hoursSinceLastTrade = (Date.now() - market.lastTradeTime.getTime()) / (1000 * 60 * 60)
|
|
214
|
+
const recencyScore = clamp(100 - (hoursSinceLastTrade * SCALE_FACTORS.RECENCY_PENALTY), 0, 100)
|
|
215
|
+
|
|
216
|
+
const weightedScore =
|
|
217
|
+
volumeScore * WEIGHTS.VOLUME +
|
|
218
|
+
spreadScore * WEIGHTS.SPREAD +
|
|
219
|
+
traderScore * WEIGHTS.TRADERS +
|
|
220
|
+
recencyScore * WEIGHTS.RECENCY
|
|
221
|
+
|
|
222
|
+
return clamp(weightedScore, 0, 100)
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Step 7: Verify Tests Still Pass
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
npm test lib/liquidity.test.ts
|
|
230
|
+
|
|
231
|
+
PASS lib/liquidity.test.ts
|
|
232
|
+
✓ should return high score for liquid market (3 ms)
|
|
233
|
+
✓ should return low score for illiquid market (2 ms)
|
|
234
|
+
✓ should handle edge case: zero volume (1 ms)
|
|
235
|
+
|
|
236
|
+
3 tests passed
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
✅ Refactoring complete, tests still passing!
|
|
240
|
+
|
|
241
|
+
## Step 8: Check Coverage
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
npm test -- --coverage lib/liquidity.test.ts
|
|
245
|
+
|
|
246
|
+
File | % Stmts | % Branch | % Funcs | % Lines
|
|
247
|
+
---------------|---------|----------|---------|--------
|
|
248
|
+
liquidity.ts | 100 | 100 | 100 | 100
|
|
249
|
+
|
|
250
|
+
Coverage: 100% ✅ (Target: 80%)
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
✅ TDD session complete!
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## TDD Best Practices
|
|
257
|
+
|
|
258
|
+
**DO:**
|
|
259
|
+
- ✅ Write the test FIRST, before any implementation
|
|
260
|
+
- ✅ Run tests and verify they FAIL before implementing
|
|
261
|
+
- ✅ Write minimal code to make tests pass
|
|
262
|
+
- ✅ Refactor only after tests are green
|
|
263
|
+
- ✅ Add edge cases and error scenarios
|
|
264
|
+
- ✅ Aim for 80%+ coverage (100% for critical code)
|
|
265
|
+
|
|
266
|
+
**DON'T:**
|
|
267
|
+
- ❌ Write implementation before tests
|
|
268
|
+
- ❌ Skip running tests after each change
|
|
269
|
+
- ❌ Write too much code at once
|
|
270
|
+
- ❌ Ignore failing tests
|
|
271
|
+
- ❌ Test implementation details (test behavior)
|
|
272
|
+
- ❌ Mock everything (prefer integration tests)
|
|
273
|
+
|
|
274
|
+
## Test Types to Include
|
|
275
|
+
|
|
276
|
+
**Unit Tests** (Function-level):
|
|
277
|
+
- Happy path scenarios
|
|
278
|
+
- Edge cases (empty, null, max values)
|
|
279
|
+
- Error conditions
|
|
280
|
+
- Boundary values
|
|
281
|
+
|
|
282
|
+
**Integration Tests** (Component-level):
|
|
283
|
+
- API endpoints
|
|
284
|
+
- Database operations
|
|
285
|
+
- External service calls
|
|
286
|
+
- React components with hooks
|
|
287
|
+
|
|
288
|
+
**E2E Tests** (use `/e2e` command):
|
|
289
|
+
- Critical user flows
|
|
290
|
+
- Multi-step processes
|
|
291
|
+
- Full stack integration
|
|
292
|
+
|
|
293
|
+
## Coverage Requirements
|
|
294
|
+
|
|
295
|
+
- **80% minimum** for all code
|
|
296
|
+
- **100% required** for:
|
|
297
|
+
- Financial calculations
|
|
298
|
+
- Authentication logic
|
|
299
|
+
- Security-critical code
|
|
300
|
+
- Core business logic
|
|
301
|
+
|
|
302
|
+
## Important Notes
|
|
303
|
+
|
|
304
|
+
**MANDATORY**: Tests must be written BEFORE implementation. The TDD cycle is:
|
|
305
|
+
|
|
306
|
+
1. **RED** - Write failing test
|
|
307
|
+
2. **GREEN** - Implement to pass
|
|
308
|
+
3. **REFACTOR** - Improve code
|
|
309
|
+
|
|
310
|
+
Never skip the RED phase. Never write code before tests.
|
|
311
|
+
|
|
312
|
+
## Integration with Other Commands
|
|
313
|
+
|
|
314
|
+
- Use `/plan` first to understand what to build
|
|
315
|
+
- Use `/tdd` to implement with tests
|
|
316
|
+
- Use `/build-fix` if build errors occur
|
|
317
|
+
- Use `/code-review` to review implementation
|
|
318
|
+
- Use `/test-coverage` to verify coverage
|
|
319
|
+
|
|
320
|
+
## Related Agents
|
|
321
|
+
|
|
322
|
+
This command invokes the `tdd-guide` agent provided by ECC.
|
|
323
|
+
|
|
324
|
+
The related `tdd-workflow` skill is also bundled with ECC.
|
|
325
|
+
|
|
326
|
+
For manual installs, the source files live at:
|
|
327
|
+
- `agents/tdd-guide.md`
|
|
328
|
+
- `skills/tdd-workflow/SKILL.md`
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Test Coverage
|
|
2
|
+
|
|
3
|
+
Analyze test coverage, identify gaps, and generate missing tests to reach 80%+ coverage.
|
|
4
|
+
|
|
5
|
+
## Step 1: Detect Test Framework
|
|
6
|
+
|
|
7
|
+
| Indicator | Coverage Command |
|
|
8
|
+
|-----------|-----------------|
|
|
9
|
+
| `jest.config.*` or `package.json` jest | `npx jest --coverage --coverageReporters=json-summary` |
|
|
10
|
+
| `vitest.config.*` | `npx vitest run --coverage` |
|
|
11
|
+
| `pytest.ini` / `pyproject.toml` pytest | `pytest --cov=src --cov-report=json` |
|
|
12
|
+
| `Cargo.toml` | `cargo llvm-cov --json` |
|
|
13
|
+
| `pom.xml` with JaCoCo | `mvn test jacoco:report` |
|
|
14
|
+
| `go.mod` | `go test -coverprofile=coverage.out ./...` |
|
|
15
|
+
|
|
16
|
+
## Step 2: Analyze Coverage Report
|
|
17
|
+
|
|
18
|
+
1. Run the coverage command
|
|
19
|
+
2. Parse the output (JSON summary or terminal output)
|
|
20
|
+
3. List files **below 80% coverage**, sorted worst-first
|
|
21
|
+
4. For each under-covered file, identify:
|
|
22
|
+
- Untested functions or methods
|
|
23
|
+
- Missing branch coverage (if/else, switch, error paths)
|
|
24
|
+
- Dead code that inflates the denominator
|
|
25
|
+
|
|
26
|
+
## Step 3: Generate Missing Tests
|
|
27
|
+
|
|
28
|
+
For each under-covered file, generate tests following this priority:
|
|
29
|
+
|
|
30
|
+
1. **Happy path** — Core functionality with valid inputs
|
|
31
|
+
2. **Error handling** — Invalid inputs, missing data, network failures
|
|
32
|
+
3. **Edge cases** — Empty arrays, null/undefined, boundary values (0, -1, MAX_INT)
|
|
33
|
+
4. **Branch coverage** — Each if/else, switch case, ternary
|
|
34
|
+
|
|
35
|
+
### Test Generation Rules
|
|
36
|
+
|
|
37
|
+
- Place tests adjacent to source: `foo.ts` → `foo.test.ts` (or project convention)
|
|
38
|
+
- Use existing test patterns from the project (import style, assertion library, mocking approach)
|
|
39
|
+
- Mock external dependencies (database, APIs, file system)
|
|
40
|
+
- Each test should be independent — no shared mutable state between tests
|
|
41
|
+
- Name tests descriptively: `test_create_user_with_duplicate_email_returns_409`
|
|
42
|
+
|
|
43
|
+
## Step 4: Verify
|
|
44
|
+
|
|
45
|
+
1. Run the full test suite — all tests must pass
|
|
46
|
+
2. Re-run coverage — verify improvement
|
|
47
|
+
3. If still below 80%, repeat Step 3 for remaining gaps
|
|
48
|
+
|
|
49
|
+
## Step 5: Report
|
|
50
|
+
|
|
51
|
+
Show before/after comparison:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
Coverage Report
|
|
55
|
+
──────────────────────────────
|
|
56
|
+
File Before After
|
|
57
|
+
src/services/auth.ts 45% 88%
|
|
58
|
+
src/utils/validation.ts 32% 82%
|
|
59
|
+
──────────────────────────────
|
|
60
|
+
Overall: 67% 84% ✅
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Focus Areas
|
|
64
|
+
|
|
65
|
+
- Functions with complex branching (high cyclomatic complexity)
|
|
66
|
+
- Error handlers and catch blocks
|
|
67
|
+
- Utility functions used across the codebase
|
|
68
|
+
- API endpoint handlers (request → response flow)
|
|
69
|
+
- Edge cases: null, undefined, empty string, empty array, zero, negative numbers
|