thachvd-kit 1.0.13 → 1.0.15
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/backend-specialist.md +263 -0
- package/.agent/agents/code-archaeologist.md +106 -0
- package/.agent/agents/database-architect.md +226 -0
- package/.agent/agents/debugger.md +225 -0
- package/.agent/agents/devops-engineer.md +242 -0
- package/.agent/agents/documentation-writer.md +104 -0
- package/.agent/agents/explorer-agent.md +73 -0
- package/.agent/agents/frontend-specialist.md +593 -0
- package/.agent/agents/game-developer.md +162 -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/product-manager.md +112 -0
- package/.agent/agents/product-owner.md +95 -0
- package/.agent/agents/project-planner.md +406 -0
- package/.agent/agents/qa-automation-engineer.md +103 -0
- package/.agent/agents/security-auditor.md +170 -0
- package/.agent/agents/seo-specialist.md +111 -0
- package/.agent/agents/test-engineer.md +158 -0
- package/.agent/rules/GEMINI.md +207 -0
- package/.agent/skills/api-design/SKILL.md +156 -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 +40 -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/desktop-design/SKILL.md +25 -0
- package/.agent/skills/dispatching-parallel-agents/SKILL.md +112 -0
- package/.agent/skills/doc.md +177 -0
- package/.agent/skills/docker-patterns/SKILL.md +232 -0
- package/.agent/skills/documentation-templates/SKILL.md +194 -0
- package/.agent/skills/executing-plans/SKILL.md +61 -0
- package/.agent/skills/finishing-a-development-branch/SKILL.md +135 -0
- package/.agent/skills/frontend-design/SKILL.md +418 -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/golang-patterns/SKILL.md +226 -0
- package/.agent/skills/golang-testing/SKILL.md +182 -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/laravel-patterns/SKILL.md +224 -0
- package/.agent/skills/laravel-security/SKILL.md +171 -0
- package/.agent/skills/laravel-tdd/SKILL.md +149 -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 +312 -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/SKILL.md +286 -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/project-onboarding/SKILL.md +62 -0
- package/.agent/skills/python-patterns/SKILL.md +441 -0
- package/.agent/skills/react-frontend/SKILL.md +25 -0
- package/.agent/skills/receiving-code-review/SKILL.md +120 -0
- package/.agent/skills/red-team-tactics/SKILL.md +199 -0
- package/.agent/skills/requesting-code-review/SKILL.md +67 -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/subagent-driven-development/SKILL.md +76 -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/using-git-worktrees/SKILL.md +122 -0
- package/.agent/skills/verification-before-completion/SKILL.md +99 -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/skills/writing-skills/SKILL.md +110 -0
- package/.agent/workflows/brainstorm.md +113 -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/enhance.md +63 -0
- package/.agent/workflows/orchestrate.md +237 -0
- package/.agent/workflows/plan.md +89 -0
- package/.agent/workflows/preview.md +81 -0
- package/.agent/workflows/status.md +86 -0
- package/.agent/workflows/test.md +144 -0
- package/.agent/workflows/ui-ux-pro-max.md +296 -0
- package/bin/cli.js +73 -6
- package/package.json +3 -3
- package/PROJECT_CONTEXT.template.md +0 -68
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Test Runner - Unified test execution and coverage reporting
|
|
4
|
+
Runs tests and generates coverage report based on project type.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
python test_runner.py <project_path> [--coverage]
|
|
8
|
+
|
|
9
|
+
Supports:
|
|
10
|
+
- Node.js: npm test, jest, vitest
|
|
11
|
+
- Python: pytest, unittest
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import subprocess
|
|
15
|
+
import sys
|
|
16
|
+
import json
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
from datetime import datetime
|
|
19
|
+
|
|
20
|
+
# Fix Windows console encoding
|
|
21
|
+
try:
|
|
22
|
+
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
|
|
23
|
+
except:
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def detect_test_framework(project_path: Path) -> dict:
|
|
28
|
+
"""Detect test framework and commands."""
|
|
29
|
+
result = {
|
|
30
|
+
"type": "unknown",
|
|
31
|
+
"framework": None,
|
|
32
|
+
"cmd": None,
|
|
33
|
+
"coverage_cmd": None
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
# Node.js project
|
|
37
|
+
package_json = project_path / "package.json"
|
|
38
|
+
if package_json.exists():
|
|
39
|
+
result["type"] = "node"
|
|
40
|
+
try:
|
|
41
|
+
pkg = json.loads(package_json.read_text(encoding='utf-8'))
|
|
42
|
+
scripts = pkg.get("scripts", {})
|
|
43
|
+
deps = {**pkg.get("dependencies", {}), **pkg.get("devDependencies", {})}
|
|
44
|
+
|
|
45
|
+
# Check for test script
|
|
46
|
+
if "test" in scripts:
|
|
47
|
+
result["framework"] = "npm test"
|
|
48
|
+
result["cmd"] = ["npm", "test"]
|
|
49
|
+
|
|
50
|
+
# Try to detect specific framework for coverage
|
|
51
|
+
if "vitest" in deps:
|
|
52
|
+
result["framework"] = "vitest"
|
|
53
|
+
result["coverage_cmd"] = ["npx", "vitest", "run", "--coverage"]
|
|
54
|
+
elif "jest" in deps:
|
|
55
|
+
result["framework"] = "jest"
|
|
56
|
+
result["coverage_cmd"] = ["npx", "jest", "--coverage"]
|
|
57
|
+
elif "vitest" in deps:
|
|
58
|
+
result["framework"] = "vitest"
|
|
59
|
+
result["cmd"] = ["npx", "vitest", "run"]
|
|
60
|
+
result["coverage_cmd"] = ["npx", "vitest", "run", "--coverage"]
|
|
61
|
+
elif "jest" in deps:
|
|
62
|
+
result["framework"] = "jest"
|
|
63
|
+
result["cmd"] = ["npx", "jest"]
|
|
64
|
+
result["coverage_cmd"] = ["npx", "jest", "--coverage"]
|
|
65
|
+
|
|
66
|
+
except:
|
|
67
|
+
pass
|
|
68
|
+
|
|
69
|
+
# Python project
|
|
70
|
+
if (project_path / "pyproject.toml").exists() or (project_path / "requirements.txt").exists():
|
|
71
|
+
result["type"] = "python"
|
|
72
|
+
result["framework"] = "pytest"
|
|
73
|
+
result["cmd"] = ["python", "-m", "pytest", "-v"]
|
|
74
|
+
result["coverage_cmd"] = ["python", "-m", "pytest", "--cov", "--cov-report=term-missing"]
|
|
75
|
+
|
|
76
|
+
return result
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def run_tests(cmd: list, cwd: Path) -> dict:
|
|
80
|
+
"""Run tests and return results."""
|
|
81
|
+
result = {
|
|
82
|
+
"passed": False,
|
|
83
|
+
"output": "",
|
|
84
|
+
"error": "",
|
|
85
|
+
"tests_run": 0,
|
|
86
|
+
"tests_passed": 0,
|
|
87
|
+
"tests_failed": 0
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
try:
|
|
91
|
+
proc = subprocess.run(
|
|
92
|
+
cmd,
|
|
93
|
+
cwd=str(cwd),
|
|
94
|
+
capture_output=True,
|
|
95
|
+
text=True,
|
|
96
|
+
encoding='utf-8',
|
|
97
|
+
errors='replace',
|
|
98
|
+
timeout=300 # 5 min timeout for tests
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
result["output"] = proc.stdout[:3000] if proc.stdout else ""
|
|
102
|
+
result["error"] = proc.stderr[:500] if proc.stderr else ""
|
|
103
|
+
result["passed"] = proc.returncode == 0
|
|
104
|
+
|
|
105
|
+
# Try to parse test counts from output
|
|
106
|
+
output = proc.stdout or ""
|
|
107
|
+
|
|
108
|
+
# Jest/Vitest pattern: "Tests: X passed, Y failed, Z total"
|
|
109
|
+
if "passed" in output.lower() and "failed" in output.lower():
|
|
110
|
+
import re
|
|
111
|
+
match = re.search(r'(\d+)\s+passed', output, re.IGNORECASE)
|
|
112
|
+
if match:
|
|
113
|
+
result["tests_passed"] = int(match.group(1))
|
|
114
|
+
match = re.search(r'(\d+)\s+failed', output, re.IGNORECASE)
|
|
115
|
+
if match:
|
|
116
|
+
result["tests_failed"] = int(match.group(1))
|
|
117
|
+
result["tests_run"] = result["tests_passed"] + result["tests_failed"]
|
|
118
|
+
|
|
119
|
+
# Pytest pattern: "X passed, Y failed"
|
|
120
|
+
if "pytest" in str(cmd):
|
|
121
|
+
import re
|
|
122
|
+
match = re.search(r'(\d+)\s+passed', output)
|
|
123
|
+
if match:
|
|
124
|
+
result["tests_passed"] = int(match.group(1))
|
|
125
|
+
match = re.search(r'(\d+)\s+failed', output)
|
|
126
|
+
if match:
|
|
127
|
+
result["tests_failed"] = int(match.group(1))
|
|
128
|
+
result["tests_run"] = result["tests_passed"] + result["tests_failed"]
|
|
129
|
+
|
|
130
|
+
except FileNotFoundError:
|
|
131
|
+
result["error"] = f"Command not found: {cmd[0]}"
|
|
132
|
+
except subprocess.TimeoutExpired:
|
|
133
|
+
result["error"] = "Timeout after 300s"
|
|
134
|
+
except Exception as e:
|
|
135
|
+
result["error"] = str(e)
|
|
136
|
+
|
|
137
|
+
return result
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def main():
|
|
141
|
+
project_path = Path(sys.argv[1] if len(sys.argv) > 1 else ".").resolve()
|
|
142
|
+
with_coverage = "--coverage" in sys.argv
|
|
143
|
+
|
|
144
|
+
print(f"\n{'='*60}")
|
|
145
|
+
print(f"[TEST RUNNER] Unified Test Execution")
|
|
146
|
+
print(f"{'='*60}")
|
|
147
|
+
print(f"Project: {project_path}")
|
|
148
|
+
print(f"Coverage: {'enabled' if with_coverage else 'disabled'}")
|
|
149
|
+
print(f"Time: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
|
|
150
|
+
|
|
151
|
+
# Detect test framework
|
|
152
|
+
test_info = detect_test_framework(project_path)
|
|
153
|
+
print(f"Type: {test_info['type']}")
|
|
154
|
+
print(f"Framework: {test_info['framework']}")
|
|
155
|
+
print("-"*60)
|
|
156
|
+
|
|
157
|
+
if not test_info["cmd"]:
|
|
158
|
+
print("No test framework found for this project.")
|
|
159
|
+
output = {
|
|
160
|
+
"script": "test_runner",
|
|
161
|
+
"project": str(project_path),
|
|
162
|
+
"type": test_info["type"],
|
|
163
|
+
"framework": None,
|
|
164
|
+
"passed": True,
|
|
165
|
+
"message": "No tests configured"
|
|
166
|
+
}
|
|
167
|
+
print(json.dumps(output, indent=2))
|
|
168
|
+
sys.exit(0)
|
|
169
|
+
|
|
170
|
+
# Choose command
|
|
171
|
+
cmd = test_info["coverage_cmd"] if with_coverage and test_info["coverage_cmd"] else test_info["cmd"]
|
|
172
|
+
|
|
173
|
+
print(f"Running: {' '.join(cmd)}")
|
|
174
|
+
print("-"*60)
|
|
175
|
+
|
|
176
|
+
# Run tests
|
|
177
|
+
result = run_tests(cmd, project_path)
|
|
178
|
+
|
|
179
|
+
# Print output (truncated)
|
|
180
|
+
if result["output"]:
|
|
181
|
+
lines = result["output"].split("\n")
|
|
182
|
+
for line in lines[:30]:
|
|
183
|
+
print(line)
|
|
184
|
+
if len(lines) > 30:
|
|
185
|
+
print(f"... ({len(lines) - 30} more lines)")
|
|
186
|
+
|
|
187
|
+
# Summary
|
|
188
|
+
print("\n" + "="*60)
|
|
189
|
+
print("SUMMARY")
|
|
190
|
+
print("="*60)
|
|
191
|
+
|
|
192
|
+
if result["passed"]:
|
|
193
|
+
print("[PASS] All tests passed")
|
|
194
|
+
else:
|
|
195
|
+
print("[FAIL] Some tests failed")
|
|
196
|
+
if result["error"]:
|
|
197
|
+
print(f"Error: {result['error'][:200]}")
|
|
198
|
+
|
|
199
|
+
if result["tests_run"] > 0:
|
|
200
|
+
print(f"Tests: {result['tests_run']} total, {result['tests_passed']} passed, {result['tests_failed']} failed")
|
|
201
|
+
|
|
202
|
+
output = {
|
|
203
|
+
"script": "test_runner",
|
|
204
|
+
"project": str(project_path),
|
|
205
|
+
"type": test_info["type"],
|
|
206
|
+
"framework": test_info["framework"],
|
|
207
|
+
"tests_run": result["tests_run"],
|
|
208
|
+
"tests_passed": result["tests_passed"],
|
|
209
|
+
"tests_failed": result["tests_failed"],
|
|
210
|
+
"passed": result["passed"]
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
print("\n" + json.dumps(output, indent=2))
|
|
214
|
+
|
|
215
|
+
sys.exit(0 if result["passed"] else 1)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
if __name__ == "__main__":
|
|
219
|
+
main()
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-git-worktrees
|
|
3
|
+
description: Use when starting feature work that needs isolation from current workspace or before executing implementation plans — creates isolated git worktrees with smart directory selection and safety verification
|
|
4
|
+
allowed-tools: Bash, Read
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Using Git Worktrees
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
|
|
12
|
+
|
|
13
|
+
**Core principle:** Systematic directory selection + safety verification = reliable isolation.
|
|
14
|
+
|
|
15
|
+
**Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace."
|
|
16
|
+
|
|
17
|
+
## Directory Selection Process
|
|
18
|
+
|
|
19
|
+
Follow this priority order:
|
|
20
|
+
|
|
21
|
+
### 1. Check Existing Directories
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ls -d .worktrees 2>/dev/null # Preferred (hidden)
|
|
25
|
+
ls -d worktrees 2>/dev/null # Alternative
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**If found:** Use that directory. If both exist, `.worktrees` wins.
|
|
29
|
+
|
|
30
|
+
### 2. Check CLAUDE.md / GEMINI.md
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
grep -i "worktree.*director" CLAUDE.md 2>/dev/null
|
|
34
|
+
grep -i "worktree.*director" GEMINI.md 2>/dev/null
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**If preference specified:** Use it without asking.
|
|
38
|
+
|
|
39
|
+
### 3. Ask User
|
|
40
|
+
|
|
41
|
+
If no directory exists and no config preference:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
No worktree directory found. Where should I create worktrees?
|
|
45
|
+
|
|
46
|
+
1. .worktrees/ (project-local, hidden)
|
|
47
|
+
2. ~/.config/worktrees/<project-name>/ (global location)
|
|
48
|
+
|
|
49
|
+
Which would you prefer?
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Creation Steps
|
|
53
|
+
|
|
54
|
+
### 1. Detect Project Name
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
project=$(basename "$(git rev-parse --show-toplevel)")
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 2. Create Worktree
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git worktree add "$path" -b "$BRANCH_NAME"
|
|
64
|
+
cd "$path"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 3. Run Project Setup
|
|
68
|
+
|
|
69
|
+
Auto-detect and run appropriate setup:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Node.js
|
|
73
|
+
if [ -f package.json ]; then npm install; fi
|
|
74
|
+
|
|
75
|
+
# PHP / Laravel
|
|
76
|
+
if [ -f composer.json ]; then composer install; fi
|
|
77
|
+
|
|
78
|
+
# Python
|
|
79
|
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
80
|
+
if [ -f pyproject.toml ]; then poetry install; fi
|
|
81
|
+
|
|
82
|
+
# Go
|
|
83
|
+
if [ -f go.mod ]; then go mod download; fi
|
|
84
|
+
|
|
85
|
+
# Rust
|
|
86
|
+
if [ -f Cargo.toml ]; then cargo build; fi
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 4. Verify Clean Baseline
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm test # Node
|
|
93
|
+
php artisan test # Laravel
|
|
94
|
+
pytest # Python
|
|
95
|
+
go test ./... # Go
|
|
96
|
+
cargo test # Rust
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**If tests fail:** Report failures, ask whether to proceed or investigate.
|
|
100
|
+
**If tests pass:** Continue.
|
|
101
|
+
|
|
102
|
+
### 5. Report Location
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Worktree ready at <full-path>
|
|
106
|
+
Tests passing (<N> tests, 0 failures)
|
|
107
|
+
Ready to implement <feature-name>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Common Mistakes
|
|
111
|
+
|
|
112
|
+
- **Skipping ignore verification** — Always check `.gitignore` includes `.worktrees/`
|
|
113
|
+
- **Assuming directory location** — Always follow the priority selection process
|
|
114
|
+
- **Proceeding with failing tests** — Always verify baseline before implementing
|
|
115
|
+
- **Hardcoding setup commands** — Auto-detect from project files
|
|
116
|
+
|
|
117
|
+
## Integration
|
|
118
|
+
|
|
119
|
+
**Pairs with:**
|
|
120
|
+
- `executing-plans` — Set up workspace before plan execution
|
|
121
|
+
- `subagent-driven-development` — Isolated workspace for each feature
|
|
122
|
+
- `finishing-a-development-branch` — Cleans up worktree after completion
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification-before-completion
|
|
3
|
+
description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
|
|
4
|
+
allowed-tools: Bash, Read
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Verification Before Completion
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Claiming work is complete without verification is dishonesty, not efficiency.
|
|
12
|
+
|
|
13
|
+
**Core principle:** Evidence before claims, always.
|
|
14
|
+
|
|
15
|
+
## The Iron Law
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If you haven't run the verification command in this message, you cannot claim it passes.
|
|
22
|
+
|
|
23
|
+
## The Gate Function
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
BEFORE claiming any status or expressing satisfaction:
|
|
27
|
+
|
|
28
|
+
1. IDENTIFY: What command proves this claim?
|
|
29
|
+
2. RUN: Execute the FULL command (fresh, complete)
|
|
30
|
+
3. READ: Full output, check exit code, count failures
|
|
31
|
+
4. VERIFY: Does output confirm the claim?
|
|
32
|
+
- If NO: State actual status with evidence
|
|
33
|
+
- If YES: State claim WITH evidence
|
|
34
|
+
5. ONLY THEN: Make the claim
|
|
35
|
+
|
|
36
|
+
Skip any step = lying, not verifying
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Common Failures
|
|
40
|
+
|
|
41
|
+
| Claim | Requires | Not Sufficient |
|
|
42
|
+
|-------|----------|----------------|
|
|
43
|
+
| Tests pass | Test command output: 0 failures | Previous run, "should pass" |
|
|
44
|
+
| Linter clean | Linter output: 0 errors | Partial check, extrapolation |
|
|
45
|
+
| Build succeeds | Build command: exit 0 | Linter passing, logs look good |
|
|
46
|
+
| Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
|
|
47
|
+
| Regression test works | Red-green cycle verified | Test passes once |
|
|
48
|
+
| Agent completed | VCS diff shows changes | Agent reports "success" |
|
|
49
|
+
| Requirements met | Line-by-line checklist | Tests passing |
|
|
50
|
+
|
|
51
|
+
## Red Flags - STOP
|
|
52
|
+
|
|
53
|
+
- Using "should", "probably", "seems to"
|
|
54
|
+
- Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
|
|
55
|
+
- About to commit/push/PR without verification
|
|
56
|
+
- Trusting agent success reports
|
|
57
|
+
- Relying on partial verification
|
|
58
|
+
- **ANY wording implying success without having run verification**
|
|
59
|
+
|
|
60
|
+
## Rationalization Prevention
|
|
61
|
+
|
|
62
|
+
| Excuse | Reality |
|
|
63
|
+
|--------|---------|
|
|
64
|
+
| "Should work now" | RUN the verification |
|
|
65
|
+
| "I'm confident" | Confidence ≠ evidence |
|
|
66
|
+
| "Just this once" | No exceptions |
|
|
67
|
+
| "Linter passed" | Linter ≠ compiler |
|
|
68
|
+
| "Agent said success" | Verify independently |
|
|
69
|
+
| "Partial check is enough" | Partial proves nothing |
|
|
70
|
+
|
|
71
|
+
## Key Patterns
|
|
72
|
+
|
|
73
|
+
**Tests:**
|
|
74
|
+
```
|
|
75
|
+
✅ [Run test command] [See: 34/34 pass] "All tests pass"
|
|
76
|
+
❌ "Should pass now" / "Looks correct"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Build:**
|
|
80
|
+
```
|
|
81
|
+
✅ [Run build] [See: exit 0] "Build passes"
|
|
82
|
+
❌ "Linter passed" (linter doesn't check compilation)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Requirements:**
|
|
86
|
+
```
|
|
87
|
+
✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
|
|
88
|
+
❌ "Tests pass, phase complete"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## When To Apply
|
|
92
|
+
|
|
93
|
+
**ALWAYS before:**
|
|
94
|
+
- ANY variation of success/completion claims
|
|
95
|
+
- Committing, PR creation, task completion
|
|
96
|
+
- Moving to next task
|
|
97
|
+
- Delegating to agents
|
|
98
|
+
|
|
99
|
+
**The Bottom Line:** Run the command. Read the output. THEN claim the result.
|