@softspark/ai-toolkit 1.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/AGENTS.md +412 -0
- package/CHANGELOG.md +68 -0
- package/LICENSE +21 -0
- package/README.md +632 -0
- package/action.yml +53 -0
- package/app/.claude-plugin/plugin.json +44 -0
- package/app/ARCHITECTURE.md +306 -0
- package/app/CLAUDE.md.template +23 -0
- package/app/agents/ai-engineer.md +128 -0
- package/app/agents/backend-specialist.md +193 -0
- package/app/agents/business-intelligence.md +54 -0
- package/app/agents/chaos-monkey.md +67 -0
- package/app/agents/chief-of-staff.md +51 -0
- package/app/agents/code-archaeologist.md +127 -0
- package/app/agents/code-reviewer.md +184 -0
- package/app/agents/command-expert.md +131 -0
- package/app/agents/data-analyst.md +205 -0
- package/app/agents/data-scientist.md +151 -0
- package/app/agents/database-architect.md +317 -0
- package/app/agents/debugger.md +238 -0
- package/app/agents/devops-implementer.md +194 -0
- package/app/agents/documenter.md +364 -0
- package/app/agents/explorer-agent.md +145 -0
- package/app/agents/fact-checker.md +172 -0
- package/app/agents/frontend-specialist.md +209 -0
- package/app/agents/game-developer.md +216 -0
- package/app/agents/incident-responder.md +226 -0
- package/app/agents/infrastructure-architect.md +127 -0
- package/app/agents/infrastructure-validator.md +247 -0
- package/app/agents/llm-ops-engineer.md +237 -0
- package/app/agents/mcp-expert.md +228 -0
- package/app/agents/mcp-server-architect.md +195 -0
- package/app/agents/mcp-testing-engineer.md +292 -0
- package/app/agents/meta-architect.md +58 -0
- package/app/agents/ml-engineer.md +136 -0
- package/app/agents/mobile-developer.md +190 -0
- package/app/agents/night-watchman.md +55 -0
- package/app/agents/nlp-engineer.md +154 -0
- package/app/agents/orchestrator.md +437 -0
- package/app/agents/performance-optimizer.md +254 -0
- package/app/agents/predictive-analyst.md +57 -0
- package/app/agents/product-manager.md +194 -0
- package/app/agents/project-planner.md +287 -0
- package/app/agents/prompt-engineer.md +103 -0
- package/app/agents/qa-automation-engineer.md +182 -0
- package/app/agents/rag-engineer.md +201 -0
- package/app/agents/research-synthesizer.md +138 -0
- package/app/agents/search-specialist.md +101 -0
- package/app/agents/security-architect.md +62 -0
- package/app/agents/security-auditor.md +293 -0
- package/app/agents/seo-specialist.md +111 -0
- package/app/agents/system-governor.md +57 -0
- package/app/agents/tech-lead.md +62 -0
- package/app/agents/technical-researcher.md +103 -0
- package/app/agents/test-engineer.md +264 -0
- package/app/constitution.md +38 -0
- package/app/hooks/_profile-check.sh +11 -0
- package/app/hooks/guard-destructive.sh +74 -0
- package/app/hooks/guard-path.sh +73 -0
- package/app/hooks/post-tool-use.sh +35 -0
- package/app/hooks/pre-compact.sh +31 -0
- package/app/hooks/quality-check.sh +22 -0
- package/app/hooks/quality-gate.sh +49 -0
- package/app/hooks/save-session.sh +24 -0
- package/app/hooks/session-end.sh +37 -0
- package/app/hooks/session-start.sh +29 -0
- package/app/hooks/subagent-start.sh +16 -0
- package/app/hooks/subagent-stop.sh +16 -0
- package/app/hooks/track-usage.sh +50 -0
- package/app/hooks/user-prompt-submit.sh +25 -0
- package/app/hooks.json +178 -0
- package/app/mcp-defaults.json +23 -0
- package/app/output-styles/golden-rules.md +43 -0
- package/app/plugins/README.md +19 -0
- package/app/plugins/csharp-pack/README.md +11 -0
- package/app/plugins/csharp-pack/plugin.json +18 -0
- package/app/plugins/enterprise-pack/README.md +16 -0
- package/app/plugins/enterprise-pack/hooks/output-style.sh +6 -0
- package/app/plugins/enterprise-pack/hooks/status-line.sh +8 -0
- package/app/plugins/enterprise-pack/plugin.json +24 -0
- package/app/plugins/frontend-pack/README.md +14 -0
- package/app/plugins/frontend-pack/plugin.json +22 -0
- package/app/plugins/java-pack/README.md +11 -0
- package/app/plugins/java-pack/plugin.json +18 -0
- package/app/plugins/kotlin-pack/README.md +11 -0
- package/app/plugins/kotlin-pack/plugin.json +18 -0
- package/app/plugins/memory-pack/README.md +24 -0
- package/app/plugins/memory-pack/hooks/observation-capture.sh +67 -0
- package/app/plugins/memory-pack/hooks/session-summary.sh +71 -0
- package/app/plugins/memory-pack/plugin.json +22 -0
- package/app/plugins/memory-pack/scripts/init_db.py +81 -0
- package/app/plugins/memory-pack/scripts/strip_private.py +22 -0
- package/app/plugins/memory-pack/skills/mem-search/SKILL.md +70 -0
- package/app/plugins/research-pack/README.md +14 -0
- package/app/plugins/research-pack/plugin.json +22 -0
- package/app/plugins/ruby-pack/README.md +11 -0
- package/app/plugins/ruby-pack/plugin.json +18 -0
- package/app/plugins/rust-pack/README.md +11 -0
- package/app/plugins/rust-pack/plugin.json +18 -0
- package/app/plugins/security-pack/README.md +15 -0
- package/app/plugins/security-pack/plugin.json +23 -0
- package/app/plugins/swift-pack/README.md +11 -0
- package/app/plugins/swift-pack/plugin.json +18 -0
- package/app/rules/claude-toolkit-rules.md +21 -0
- package/app/rules/git-conventions.md +5 -0
- package/app/rules/quality-gates.md +10 -0
- package/app/skills/_lib/__init__.py +1 -0
- package/app/skills/_lib/detect_utils.py +150 -0
- package/app/skills/agent-creator/SKILL.md +82 -0
- package/app/skills/analyze/SKILL.md +92 -0
- package/app/skills/analyze/scripts/complexity.py +165 -0
- package/app/skills/api-patterns/SKILL.md +305 -0
- package/app/skills/app-builder/SKILL.md +187 -0
- package/app/skills/architecture-audit/SKILL.md +141 -0
- package/app/skills/architecture-decision/SKILL.md +55 -0
- package/app/skills/architecture-decision/templates/adr-template.md +36 -0
- package/app/skills/biz-scan/SKILL.md +30 -0
- package/app/skills/briefing/SKILL.md +27 -0
- package/app/skills/build/SKILL.md +97 -0
- package/app/skills/build/scripts/detect-build.py +151 -0
- package/app/skills/chaos/SKILL.md +32 -0
- package/app/skills/ci/SKILL.md +77 -0
- package/app/skills/ci/scripts/ci-detect.py +135 -0
- package/app/skills/ci/templates/github-actions-node.yml +38 -0
- package/app/skills/ci/templates/github-actions-python.yml +42 -0
- package/app/skills/ci-cd-patterns/SKILL.md +299 -0
- package/app/skills/clean-code/SKILL.md +110 -0
- package/app/skills/clean-code/reference/dart.md +18 -0
- package/app/skills/clean-code/reference/go.md +23 -0
- package/app/skills/clean-code/reference/php.md +32 -0
- package/app/skills/clean-code/reference/python.md +180 -0
- package/app/skills/clean-code/reference/typescript.md +26 -0
- package/app/skills/command-creator/SKILL.md +83 -0
- package/app/skills/commit/SKILL.md +98 -0
- package/app/skills/commit/scripts/pre-commit-check.py +87 -0
- package/app/skills/commit/templates/conventional-commit.md +52 -0
- package/app/skills/csharp-patterns/SKILL.md +450 -0
- package/app/skills/database-patterns/SKILL.md +297 -0
- package/app/skills/debug/SKILL.md +154 -0
- package/app/skills/debug/scripts/error-parser.py +187 -0
- package/app/skills/debugging-tactics/SKILL.md +136 -0
- package/app/skills/deploy/SKILL.md +130 -0
- package/app/skills/deploy/scripts/pre_deploy_check.py +171 -0
- package/app/skills/deploy/templates/deployment-checklist.md +31 -0
- package/app/skills/design-an-interface/SKILL.md +105 -0
- package/app/skills/design-engineering/SKILL.md +260 -0
- package/app/skills/docker-devops/SKILL.md +303 -0
- package/app/skills/docs/SKILL.md +145 -0
- package/app/skills/docs/scripts/doc-inventory.py +176 -0
- package/app/skills/docs/templates/adr-template.md +36 -0
- package/app/skills/docs/templates/readme-template.md +67 -0
- package/app/skills/documentation-standards/SKILL.md +191 -0
- package/app/skills/ecommerce-patterns/SKILL.md +209 -0
- package/app/skills/evaluate/SKILL.md +132 -0
- package/app/skills/evolve/SKILL.md +27 -0
- package/app/skills/explain/SKILL.md +54 -0
- package/app/skills/explain/scripts/dependency-graph.py +215 -0
- package/app/skills/explore/SKILL.md +112 -0
- package/app/skills/explore/scripts/visualize.py +117 -0
- package/app/skills/fix/SKILL.md +78 -0
- package/app/skills/fix/scripts/error-classifier.py +191 -0
- package/app/skills/flutter-patterns/SKILL.md +254 -0
- package/app/skills/git-mastery/SKILL.md +70 -0
- package/app/skills/grill-me/SKILL.md +38 -0
- package/app/skills/health/SKILL.md +91 -0
- package/app/skills/health/scripts/health_check.py +162 -0
- package/app/skills/hive-mind/SKILL.md +56 -0
- package/app/skills/hook-creator/SKILL.md +107 -0
- package/app/skills/index/SKILL.md +74 -0
- package/app/skills/instinct-review/SKILL.md +77 -0
- package/app/skills/java-patterns/SKILL.md +442 -0
- package/app/skills/kotlin-patterns/SKILL.md +446 -0
- package/app/skills/lint/SKILL.md +103 -0
- package/app/skills/lint/scripts/detect-linters.py +112 -0
- package/app/skills/mcp-patterns/SKILL.md +270 -0
- package/app/skills/mem-search/SKILL.md +70 -0
- package/app/skills/migrate/SKILL.md +90 -0
- package/app/skills/migrate/scripts/migration-status.py +195 -0
- package/app/skills/migration-patterns/SKILL.md +260 -0
- package/app/skills/night-watch/SKILL.md +28 -0
- package/app/skills/observability-patterns/SKILL.md +203 -0
- package/app/skills/onboard/SKILL.md +76 -0
- package/app/skills/orchestrate/SKILL.md +86 -0
- package/app/skills/panic/SKILL.md +30 -0
- package/app/skills/performance-profiling/SKILL.md +59 -0
- package/app/skills/plan/SKILL.md +110 -0
- package/app/skills/plan/templates/plan-template.md +40 -0
- package/app/skills/plan-writing/SKILL.md +201 -0
- package/app/skills/plugin-creator/SKILL.md +78 -0
- package/app/skills/pr/SKILL.md +129 -0
- package/app/skills/pr/scripts/pr-summary.py +175 -0
- package/app/skills/prd-to-issues/SKILL.md +108 -0
- package/app/skills/prd-to-plan/SKILL.md +120 -0
- package/app/skills/predict/SKILL.md +30 -0
- package/app/skills/qa-session/SKILL.md +110 -0
- package/app/skills/rag-patterns/SKILL.md +203 -0
- package/app/skills/refactor/SKILL.md +124 -0
- package/app/skills/refactor/scripts/refactor-scan.py +210 -0
- package/app/skills/refactor-plan/SKILL.md +112 -0
- package/app/skills/repeat/SKILL.md +149 -0
- package/app/skills/research-mastery/SKILL.md +56 -0
- package/app/skills/review/SKILL.md +141 -0
- package/app/skills/review/scripts/diff-analyzer.py +170 -0
- package/app/skills/rollback/SKILL.md +87 -0
- package/app/skills/rollback/scripts/rollback_info.py +149 -0
- package/app/skills/ruby-patterns/SKILL.md +454 -0
- package/app/skills/rust-patterns/SKILL.md +446 -0
- package/app/skills/search/SKILL.md +64 -0
- package/app/skills/security-patterns/SKILL.md +91 -0
- package/app/skills/security-patterns/reference/authentication.md +37 -0
- package/app/skills/security-patterns/reference/authorization.md +22 -0
- package/app/skills/security-patterns/reference/input-validation.md +30 -0
- package/app/skills/security-patterns/reference/oauth-csrf-audit.md +131 -0
- package/app/skills/skill-creator/SKILL.md +154 -0
- package/app/skills/skill-creator/templates/dashboard/index.html +130 -0
- package/app/skills/skill-creator/templates/reasoning-engine/assets/example.json +12 -0
- package/app/skills/skill-creator/templates/reasoning-engine/search.py +110 -0
- package/app/skills/subagent-development/SKILL.md +225 -0
- package/app/skills/subagent-development/reference/code-quality-reviewer-prompt.md +145 -0
- package/app/skills/subagent-development/reference/implementer-prompt.md +118 -0
- package/app/skills/subagent-development/reference/spec-reviewer-prompt.md +100 -0
- package/app/skills/swarm/SKILL.md +81 -0
- package/app/skills/swift-patterns/SKILL.md +500 -0
- package/app/skills/tdd/SKILL.md +174 -0
- package/app/skills/tdd/reference/deep-modules.md +32 -0
- package/app/skills/tdd/reference/interface-design.md +32 -0
- package/app/skills/tdd/reference/mocking.md +52 -0
- package/app/skills/tdd/reference/refactoring.md +10 -0
- package/app/skills/tdd/reference/tests.md +59 -0
- package/app/skills/teams/SKILL.md +101 -0
- package/app/skills/test/SKILL.md +107 -0
- package/app/skills/test/scripts/detect-runner.py +113 -0
- package/app/skills/testing-patterns/SKILL.md +73 -0
- package/app/skills/testing-patterns/reference/flutter-testing.md +33 -0
- package/app/skills/testing-patterns/reference/go-testing.md +52 -0
- package/app/skills/testing-patterns/reference/php-phpunit.md +39 -0
- package/app/skills/testing-patterns/reference/python-pytest.md +228 -0
- package/app/skills/testing-patterns/reference/typescript-vitest.md +50 -0
- package/app/skills/triage-issue/SKILL.md +120 -0
- package/app/skills/typescript-patterns/SKILL.md +256 -0
- package/app/skills/ubiquitous-language/SKILL.md +74 -0
- package/app/skills/verification-before-completion/SKILL.md +108 -0
- package/app/skills/workflow/SKILL.md +250 -0
- package/app/skills/write-a-prd/SKILL.md +129 -0
- package/app/skills/write-a-prd/reference/visual-companion.md +78 -0
- package/app/skills/write-a-prd/scripts/frame-template.html +111 -0
- package/app/skills/write-a-prd/scripts/visual-server.cjs +79 -0
- package/app/templates/skill/generator/SKILL.md.template +40 -0
- package/app/templates/skill/knowledge/SKILL.md.template +52 -0
- package/app/templates/skill/linter/SKILL.md.template +34 -0
- package/app/templates/skill/reviewer/SKILL.md.template +51 -0
- package/app/templates/skill/workflow/SKILL.md.template +49 -0
- package/benchmarks/README.md +111 -0
- package/benchmarks/ecosystem-dashboard.json +148 -0
- package/benchmarks/ecosystem-harvest.json +148 -0
- package/benchmarks/results.json +38 -0
- package/benchmarks/run.py +351 -0
- package/bin/ai-toolkit.js +345 -0
- package/kb/best-practices/README.md +11 -0
- package/kb/howto/README.md +11 -0
- package/kb/procedures/maintenance-sop.md +306 -0
- package/kb/reference/agents-catalog.md +124 -0
- package/kb/reference/anti-pattern-registry-format.md +221 -0
- package/kb/reference/architecture-overview.md +232 -0
- package/kb/reference/benchmark-config.md +62 -0
- package/kb/reference/ci-integration.md +66 -0
- package/kb/reference/claude-ecosystem-benchmark-snapshot.md +80 -0
- package/kb/reference/claude-ecosystem-expansion-foundations.md +102 -0
- package/kb/reference/commands-catalog.md +21 -0
- package/kb/reference/distribution-model.md +63 -0
- package/kb/reference/global-install-model.md +56 -0
- package/kb/reference/hierarchical-override-pattern.md +200 -0
- package/kb/reference/hooks-catalog.md +306 -0
- package/kb/reference/integrations.md +88 -0
- package/kb/reference/language-packs.md +52 -0
- package/kb/reference/merge-friendly-install-model.md +58 -0
- package/kb/reference/plugin-pack-conventions.md +151 -0
- package/kb/reference/quick-wins-implementation-summary.md +70 -0
- package/kb/reference/skill-templates.md +50 -0
- package/kb/reference/skills-catalog.md +215 -0
- package/kb/reference/skills-unification.md +57 -0
- package/kb/reference/stats.md +69 -0
- package/kb/reference/sync.md +76 -0
- package/kb/troubleshooting/README.md +11 -0
- package/llms-full.txt +3068 -0
- package/llms.txt +39 -0
- package/package.json +75 -0
- package/scripts/_common.py +160 -0
- package/scripts/add_rule.py +50 -0
- package/scripts/benchmark_config.py +127 -0
- package/scripts/benchmark_ecosystem.py +288 -0
- package/scripts/check_deps.py +260 -0
- package/scripts/create_skill.py +118 -0
- package/scripts/doctor.py +504 -0
- package/scripts/eject.py +113 -0
- package/scripts/emission.py +256 -0
- package/scripts/evaluate_skills.py +260 -0
- package/scripts/frontmatter.py +58 -0
- package/scripts/generate_agents_md.py +91 -0
- package/scripts/generate_aider_conf.py +51 -0
- package/scripts/generate_cline.py +35 -0
- package/scripts/generate_copilot.py +30 -0
- package/scripts/generate_cursor_rules.py +35 -0
- package/scripts/generate_gemini.py +28 -0
- package/scripts/generate_llms_txt.py +164 -0
- package/scripts/generate_roo_modes.py +80 -0
- package/scripts/generate_windsurf.py +35 -0
- package/scripts/generator_base.py +140 -0
- package/scripts/harvest_ecosystem.py +50 -0
- package/scripts/inject_rule_cli.py +101 -0
- package/scripts/inject_section_cli.py +47 -0
- package/scripts/injection.py +180 -0
- package/scripts/install.py +236 -0
- package/scripts/install_git_hooks.py +71 -0
- package/scripts/install_steps/__init__.py +5 -0
- package/scripts/install_steps/ai_tools.py +261 -0
- package/scripts/install_steps/hooks.py +90 -0
- package/scripts/install_steps/markers.py +79 -0
- package/scripts/install_steps/symlinks.py +87 -0
- package/scripts/merge-hooks.py +192 -0
- package/scripts/plugin.py +642 -0
- package/scripts/plugin_schema.py +138 -0
- package/scripts/remove_rule.py +58 -0
- package/scripts/stats.py +81 -0
- package/scripts/sync.py +215 -0
- package/scripts/uninstall.py +292 -0
- package/scripts/validate.py +700 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Generate a structured PR summary from the git log.
|
|
3
|
+
|
|
4
|
+
Parses commits between a base branch and HEAD using the Conventional
|
|
5
|
+
Commits format, groups them by type, detects breaking changes, counts
|
|
6
|
+
file and test statistics, and suggests a PR title. Outputs a JSON
|
|
7
|
+
object suitable for populating a PR template.
|
|
8
|
+
|
|
9
|
+
Usage::
|
|
10
|
+
|
|
11
|
+
python3 pr-summary.py [base_branch]
|
|
12
|
+
# Default base branch: main
|
|
13
|
+
"""
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import re
|
|
18
|
+
import subprocess
|
|
19
|
+
import sys
|
|
20
|
+
from typing import Any
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
CONVENTIONAL_TYPES: dict[str, str] = {
|
|
24
|
+
"feat": "Features",
|
|
25
|
+
"fix": "Bug Fixes",
|
|
26
|
+
"docs": "Documentation",
|
|
27
|
+
"style": "Style",
|
|
28
|
+
"refactor": "Refactoring",
|
|
29
|
+
"perf": "Performance",
|
|
30
|
+
"test": "Tests",
|
|
31
|
+
"build": "Build",
|
|
32
|
+
"ci": "CI/CD",
|
|
33
|
+
"chore": "Chores",
|
|
34
|
+
"revert": "Reverts",
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def run(cmd: str) -> str:
|
|
39
|
+
"""Run a shell command and return stripped stdout.
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
cmd: Shell command string to execute.
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
Stripped standard output of the command.
|
|
46
|
+
"""
|
|
47
|
+
r = subprocess.run(cmd, shell=True, capture_output=True, text=True)
|
|
48
|
+
return r.stdout.strip()
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def parse_conventional_commit(message: str) -> dict[str, Any]:
|
|
52
|
+
"""Parse a conventional commit message into type, scope, and description.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
message: Single-line commit message.
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
Dictionary with ``type``, ``scope``, ``breaking``, and
|
|
59
|
+
``description`` keys.
|
|
60
|
+
"""
|
|
61
|
+
m = re.match(
|
|
62
|
+
r"^(\w+)(?:\(([^)]+)\))?(!)?:\s*(.+)$", message
|
|
63
|
+
)
|
|
64
|
+
if m:
|
|
65
|
+
return {
|
|
66
|
+
"type": m.group(1),
|
|
67
|
+
"scope": m.group(2) or "",
|
|
68
|
+
"breaking": bool(m.group(3)),
|
|
69
|
+
"description": m.group(4),
|
|
70
|
+
}
|
|
71
|
+
return {"type": "other", "scope": "", "breaking": False, "description": message}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def main() -> None:
|
|
75
|
+
"""Entry point: generate PR summary and print JSON to stdout."""
|
|
76
|
+
base = sys.argv[1] if len(sys.argv) > 1 else "main"
|
|
77
|
+
|
|
78
|
+
# Get oneline log
|
|
79
|
+
log_output = run(f"git log --oneline {base}..HEAD 2>/dev/null")
|
|
80
|
+
if not log_output:
|
|
81
|
+
print(json.dumps({"error": f"No commits found between {base} and HEAD."}))
|
|
82
|
+
return
|
|
83
|
+
|
|
84
|
+
# Parse commits
|
|
85
|
+
commits: list[dict[str, Any]] = []
|
|
86
|
+
for line in log_output.split("\n"):
|
|
87
|
+
if not line.strip():
|
|
88
|
+
continue
|
|
89
|
+
parts = line.split(" ", 1)
|
|
90
|
+
if len(parts) < 2:
|
|
91
|
+
continue
|
|
92
|
+
sha = parts[0]
|
|
93
|
+
message = parts[1]
|
|
94
|
+
parsed = parse_conventional_commit(message)
|
|
95
|
+
commits.append({"sha": sha, "message": message, **parsed})
|
|
96
|
+
|
|
97
|
+
# Check full commit bodies for BREAKING CHANGE
|
|
98
|
+
body_output = run(f"git log --format='%B---COMMIT_SEP---' {base}..HEAD 2>/dev/null")
|
|
99
|
+
breaking_changes: list[str] = []
|
|
100
|
+
for block in (body_output or "").split("---COMMIT_SEP---"):
|
|
101
|
+
for bline in block.strip().split("\n"):
|
|
102
|
+
if bline.startswith("BREAKING CHANGE:") or bline.startswith("BREAKING-CHANGE:"):
|
|
103
|
+
breaking_changes.append(bline.split(":", 1)[1].strip())
|
|
104
|
+
# Also check for ! in commit type
|
|
105
|
+
for c in commits:
|
|
106
|
+
if c["breaking"] and c["description"] not in breaking_changes:
|
|
107
|
+
breaking_changes.append(c["description"])
|
|
108
|
+
|
|
109
|
+
# Group by type
|
|
110
|
+
groups: dict[str, list[str]] = {}
|
|
111
|
+
for c in commits:
|
|
112
|
+
label = CONVENTIONAL_TYPES.get(c["type"], "Other")
|
|
113
|
+
groups.setdefault(label, []).append(c["description"])
|
|
114
|
+
|
|
115
|
+
# Summary bullets
|
|
116
|
+
summary_bullets: list[str] = []
|
|
117
|
+
for label, descriptions in groups.items():
|
|
118
|
+
if len(descriptions) == 1:
|
|
119
|
+
summary_bullets.append(f"{label}: {descriptions[0]}")
|
|
120
|
+
else:
|
|
121
|
+
summary_bullets.append(f"{label}: {len(descriptions)} changes")
|
|
122
|
+
|
|
123
|
+
# File stats
|
|
124
|
+
diff_stat = run(f"git diff --stat {base}...HEAD 2>/dev/null")
|
|
125
|
+
files_changed = 0
|
|
126
|
+
test_files = 0
|
|
127
|
+
stat_lines = diff_stat.split("\n") if diff_stat else []
|
|
128
|
+
for sl in stat_lines:
|
|
129
|
+
sl = sl.strip()
|
|
130
|
+
if "|" in sl:
|
|
131
|
+
files_changed += 1
|
|
132
|
+
fname = sl.split("|")[0].strip()
|
|
133
|
+
if re.search(r"(test_|_test\.|\.test\.|spec\.|__tests__)", fname, re.IGNORECASE):
|
|
134
|
+
test_files += 1
|
|
135
|
+
|
|
136
|
+
# Suggest title from most common type + scope
|
|
137
|
+
type_counts: dict[str, int] = {}
|
|
138
|
+
scope_counts: dict[str, int] = {}
|
|
139
|
+
for c in commits:
|
|
140
|
+
type_counts[c["type"]] = type_counts.get(c["type"], 0) + 1
|
|
141
|
+
if c["scope"]:
|
|
142
|
+
scope_counts[c["scope"]] = scope_counts.get(c["scope"], 0) + 1
|
|
143
|
+
|
|
144
|
+
dominant_type = max(type_counts, key=type_counts.get) if type_counts else "feat"
|
|
145
|
+
dominant_scope = max(scope_counts, key=scope_counts.get) if scope_counts else ""
|
|
146
|
+
|
|
147
|
+
if len(commits) == 1:
|
|
148
|
+
title_suggestion = commits[0]["message"]
|
|
149
|
+
else:
|
|
150
|
+
scope_part = f"({dominant_scope})" if dominant_scope else ""
|
|
151
|
+
# Use the description of the first commit of dominant type as hint
|
|
152
|
+
dominant_descs = [c["description"] for c in commits if c["type"] == dominant_type]
|
|
153
|
+
brief = dominant_descs[0] if dominant_descs else "multiple changes"
|
|
154
|
+
if len(brief) > 50:
|
|
155
|
+
brief = brief[:47] + "..."
|
|
156
|
+
title_suggestion = f"{dominant_type}{scope_part}: {brief}"
|
|
157
|
+
|
|
158
|
+
result: dict[str, Any] = {
|
|
159
|
+
"base": base,
|
|
160
|
+
"total_commits": len(commits),
|
|
161
|
+
"title_suggestion": title_suggestion,
|
|
162
|
+
"commits": commits,
|
|
163
|
+
"groups": groups,
|
|
164
|
+
"summary_bullets": summary_bullets,
|
|
165
|
+
"has_breaking": len(breaking_changes) > 0,
|
|
166
|
+
"breaking_changes": breaking_changes,
|
|
167
|
+
"files_changed": files_changed,
|
|
168
|
+
"test_files_changed": test_files,
|
|
169
|
+
"has_tests": test_files > 0,
|
|
170
|
+
}
|
|
171
|
+
print(json.dumps(result, indent=2))
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
if __name__ == "__main__":
|
|
175
|
+
main()
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prd-to-issues
|
|
3
|
+
description: "Break a PRD into independently-grabbable GitHub issues using vertical slices with HITL/AFK tagging and dependency ordering. Use when user wants to convert a PRD to issues, create tickets, or break down a PRD into work items."
|
|
4
|
+
effort: medium
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
argument-hint: "[PRD issue number]"
|
|
7
|
+
allowed-tools: Read, Grep, Glob, Bash
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# PRD to Issues
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Break a PRD into independently-grabbable GitHub issues using vertical slices (tracer bullets).
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
/prd-to-issues [PRD issue number]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## What This Command Does
|
|
23
|
+
|
|
24
|
+
1. **Fetches** PRD from GitHub issue
|
|
25
|
+
2. **Explores** codebase for context
|
|
26
|
+
3. **Drafts** vertical slices with HITL/AFK classification
|
|
27
|
+
4. **Quizzes** user on breakdown
|
|
28
|
+
5. **Creates** GitHub issues in dependency order via `gh issue create`
|
|
29
|
+
|
|
30
|
+
## Process
|
|
31
|
+
|
|
32
|
+
### 1. Locate the PRD
|
|
33
|
+
|
|
34
|
+
Fetch with `gh issue view <number>` (with comments). If no number provided, ask.
|
|
35
|
+
|
|
36
|
+
### 2. Draft Vertical Slices
|
|
37
|
+
|
|
38
|
+
Each issue is a thin vertical slice cutting through ALL layers end-to-end.
|
|
39
|
+
|
|
40
|
+
| Classification | Description |
|
|
41
|
+
|---------------|-------------|
|
|
42
|
+
| **AFK** | Can be implemented and merged without human interaction (prefer) |
|
|
43
|
+
| **HITL** | Requires human decision — architectural choice, design review, etc. |
|
|
44
|
+
|
|
45
|
+
### 3. Quiz the User
|
|
46
|
+
|
|
47
|
+
Present as numbered list. For each slice show:
|
|
48
|
+
|
|
49
|
+
- **Title**: short descriptive name
|
|
50
|
+
- **Type**: HITL / AFK
|
|
51
|
+
- **Blocked by**: which other slices must complete first
|
|
52
|
+
- **User stories covered**: which stories from the PRD
|
|
53
|
+
|
|
54
|
+
Ask:
|
|
55
|
+
- Granularity right? (too coarse / too fine)
|
|
56
|
+
- Dependency relationships correct?
|
|
57
|
+
- HITL vs AFK classification correct?
|
|
58
|
+
- Any slices to merge or split?
|
|
59
|
+
|
|
60
|
+
Iterate until approved.
|
|
61
|
+
|
|
62
|
+
### 4. Create GitHub Issues
|
|
63
|
+
|
|
64
|
+
Create in dependency order (blockers first) so real issue numbers can be referenced.
|
|
65
|
+
|
|
66
|
+
Use `gh issue create` with the template below for each slice.
|
|
67
|
+
|
|
68
|
+
## Issue Template
|
|
69
|
+
|
|
70
|
+
<issue-template>
|
|
71
|
+
|
|
72
|
+
## Parent PRD
|
|
73
|
+
|
|
74
|
+
#{prd-issue-number}
|
|
75
|
+
|
|
76
|
+
## What to build
|
|
77
|
+
|
|
78
|
+
Concise description of this vertical slice. End-to-end behavior, not layer-by-layer. Reference parent PRD sections, don't duplicate.
|
|
79
|
+
|
|
80
|
+
## Acceptance criteria
|
|
81
|
+
|
|
82
|
+
- [ ] Criterion 1
|
|
83
|
+
- [ ] Criterion 2
|
|
84
|
+
- [ ] Criterion 3
|
|
85
|
+
|
|
86
|
+
## Blocked by
|
|
87
|
+
|
|
88
|
+
- Blocked by #{issue-number} (if any)
|
|
89
|
+
|
|
90
|
+
Or "None — can start immediately" if no blockers.
|
|
91
|
+
|
|
92
|
+
## User stories addressed
|
|
93
|
+
|
|
94
|
+
Reference by number from the parent PRD:
|
|
95
|
+
|
|
96
|
+
- User story 3
|
|
97
|
+
- User story 7
|
|
98
|
+
|
|
99
|
+
</issue-template>
|
|
100
|
+
|
|
101
|
+
## Rules
|
|
102
|
+
|
|
103
|
+
- Every issue must be a VERTICAL slice — never horizontal
|
|
104
|
+
- Create in dependency order for real issue number references
|
|
105
|
+
- Do NOT close or modify the parent PRD issue
|
|
106
|
+
- Do NOT ask user to review before creating — file and share URLs
|
|
107
|
+
- Maximize parallelism — independent issues should have no blockers
|
|
108
|
+
- No file paths or line numbers in issue bodies
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prd-to-plan
|
|
3
|
+
description: "Convert a PRD into a phased implementation plan using tracer-bullet vertical slices. Use when user wants to break down a PRD, create an implementation plan, plan phases from a PRD, or mentions tracer bullets."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
effort: high
|
|
6
|
+
argument-hint: "[PRD issue number or paste PRD]"
|
|
7
|
+
allowed-tools: Read, Grep, Glob, Bash, Agent
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# PRD to Plan
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Break a PRD into a phased implementation plan using vertical slices (tracer bullets). Output is a Markdown file in `./plans/`.
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
/prd-to-plan [PRD issue number or description]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## What This Command Does
|
|
23
|
+
|
|
24
|
+
1. **Loads** the PRD (from GitHub issue or conversation)
|
|
25
|
+
2. **Explores** the codebase to understand architecture
|
|
26
|
+
3. **Identifies** durable architectural decisions
|
|
27
|
+
4. **Drafts** vertical slices (tracer bullets)
|
|
28
|
+
5. **Quizzes** user on granularity
|
|
29
|
+
6. **Writes** plan file to `./plans/`
|
|
30
|
+
|
|
31
|
+
## Process
|
|
32
|
+
|
|
33
|
+
### 1. Confirm PRD is in Context
|
|
34
|
+
|
|
35
|
+
If not provided, ask for the PRD GitHub issue number or content. Fetch with `gh issue view <number>` if needed.
|
|
36
|
+
|
|
37
|
+
### 2. Explore the Codebase
|
|
38
|
+
|
|
39
|
+
Use Agent (subagent_type=Explore) to understand current architecture, existing patterns, and integration layers.
|
|
40
|
+
|
|
41
|
+
### 3. Identify Durable Architectural Decisions
|
|
42
|
+
|
|
43
|
+
Before slicing, identify decisions unlikely to change:
|
|
44
|
+
- Route structures / URL patterns
|
|
45
|
+
- Database schema shape
|
|
46
|
+
- Key data models
|
|
47
|
+
- Authentication / authorization approach
|
|
48
|
+
- Third-party service boundaries
|
|
49
|
+
|
|
50
|
+
### 4. Draft Vertical Slices
|
|
51
|
+
|
|
52
|
+
Break PRD into **tracer bullet** phases. Each phase is a thin vertical slice cutting through ALL layers end-to-end.
|
|
53
|
+
|
|
54
|
+
| Rule | Description |
|
|
55
|
+
|------|-------------|
|
|
56
|
+
| Complete path | Each slice delivers narrow but COMPLETE path through every layer (schema, API, UI, tests) |
|
|
57
|
+
| Demoable | A completed slice is demoable or verifiable on its own |
|
|
58
|
+
| Thin over thick | Prefer many thin slices over few thick ones |
|
|
59
|
+
| Durable | Do NOT include file names, function names, or implementation details likely to change |
|
|
60
|
+
| Include decisions | DO include durable decisions: route paths, schema shapes, data model names |
|
|
61
|
+
|
|
62
|
+
### 5. Quiz the User
|
|
63
|
+
|
|
64
|
+
Present breakdown as numbered list. For each phase show:
|
|
65
|
+
- **Title**: short descriptive name
|
|
66
|
+
- **User stories covered**: which stories from the PRD
|
|
67
|
+
|
|
68
|
+
Ask:
|
|
69
|
+
- Does the granularity feel right? (too coarse / too fine)
|
|
70
|
+
- Should any phases be merged or split?
|
|
71
|
+
|
|
72
|
+
Iterate until approved.
|
|
73
|
+
|
|
74
|
+
### 6. Write Plan File
|
|
75
|
+
|
|
76
|
+
Create `./plans/` if needed. Write as `./plans/{feature-name}.md`.
|
|
77
|
+
|
|
78
|
+
## Plan Template
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
# Plan: {Feature Name}
|
|
82
|
+
|
|
83
|
+
> Source PRD: #{issue-number}
|
|
84
|
+
|
|
85
|
+
## Architectural Decisions
|
|
86
|
+
|
|
87
|
+
Durable decisions that apply across all phases:
|
|
88
|
+
|
|
89
|
+
- **Routes**: ...
|
|
90
|
+
- **Schema**: ...
|
|
91
|
+
- **Key models**: ...
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Phase 1: {Title}
|
|
96
|
+
|
|
97
|
+
**User stories**: {list from PRD}
|
|
98
|
+
|
|
99
|
+
### What to build
|
|
100
|
+
|
|
101
|
+
Concise description of this vertical slice. End-to-end behavior, not layer-by-layer.
|
|
102
|
+
|
|
103
|
+
### Acceptance criteria
|
|
104
|
+
|
|
105
|
+
- [ ] Criterion 1
|
|
106
|
+
- [ ] Criterion 2
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Phase 2: {Title}
|
|
111
|
+
|
|
112
|
+
(repeat for each phase)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Rules
|
|
116
|
+
|
|
117
|
+
- Every phase must be a VERTICAL slice (all layers), never HORIZONTAL (one layer)
|
|
118
|
+
- No file paths or implementation details that couple to current code
|
|
119
|
+
- Each phase must be independently demoable
|
|
120
|
+
- Get user approval before writing the plan file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: predict
|
|
3
|
+
description: "Predict regressions and impact before changes land"
|
|
4
|
+
effort: medium
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
argument-hint: "[change description]"
|
|
7
|
+
agent: predictive-analyst
|
|
8
|
+
context: fork
|
|
9
|
+
allowed-tools: Read, Grep, Glob
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Predict Command
|
|
13
|
+
|
|
14
|
+
$ARGUMENTS
|
|
15
|
+
|
|
16
|
+
Triggers the Predictive Analyst to assess impact.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
/predict [path_or_diff]
|
|
22
|
+
# Example: /predict src/auth
|
|
23
|
+
# Example: /predict --diff (analyzes uncommitted changes)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Protocol
|
|
27
|
+
1. **Scope**: Identify target files.
|
|
28
|
+
2. **Trace**: Build dependency graph.
|
|
29
|
+
3. **Assess**: Calculate risk score.
|
|
30
|
+
4. **Report**: Generate Impact Prediction.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qa-session
|
|
3
|
+
description: "Interactive QA session where user reports bugs conversationally and agent files GitHub issues with domain language. Explores codebase in background for context. Use when user wants to report bugs, do QA, file issues conversationally, or mentions QA session."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
effort: high
|
|
6
|
+
argument-hint: "[area to QA or first bug report]"
|
|
7
|
+
allowed-tools: Read, Grep, Glob, Bash, Agent
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# QA Session
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Interactive QA session. User describes problems, agent clarifies, explores codebase, and files GitHub issues.
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
/qa-session [area to QA or first bug report]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## What This Command Does
|
|
23
|
+
|
|
24
|
+
1. **Listens** to user's bug report
|
|
25
|
+
2. **Clarifies** with 2-3 focused questions max
|
|
26
|
+
3. **Explores** codebase in background for context and domain language
|
|
27
|
+
4. **Assesses** scope — single issue or breakdown
|
|
28
|
+
5. **Files** GitHub issues via `gh issue create`
|
|
29
|
+
6. **Continues** until user says done
|
|
30
|
+
|
|
31
|
+
## For Each Issue
|
|
32
|
+
|
|
33
|
+
### 1. Listen and Lightly Clarify
|
|
34
|
+
|
|
35
|
+
Let user describe the problem. Ask **at most 2-3 short questions** on:
|
|
36
|
+
- Expected vs actual behavior
|
|
37
|
+
- Steps to reproduce
|
|
38
|
+
- Consistent or intermittent
|
|
39
|
+
|
|
40
|
+
Don't over-interview. If clear enough, move on.
|
|
41
|
+
|
|
42
|
+
### 2. Explore Codebase in Background
|
|
43
|
+
|
|
44
|
+
Kick off Agent (subagent_type=Explore) in background to:
|
|
45
|
+
- Learn domain language (check UBIQUITOUS_LANGUAGE.md)
|
|
46
|
+
- Understand what the feature should do
|
|
47
|
+
- Identify behavior boundaries
|
|
48
|
+
|
|
49
|
+
This helps write better issues — but issues must NOT reference files/lines.
|
|
50
|
+
|
|
51
|
+
### 3. Assess Scope
|
|
52
|
+
|
|
53
|
+
| Decision | When |
|
|
54
|
+
|----------|------|
|
|
55
|
+
| **Single issue** | One behavior wrong in one place |
|
|
56
|
+
| **Breakdown** | Multiple independent areas, separable concerns, distinct failure modes |
|
|
57
|
+
|
|
58
|
+
### 4. File GitHub Issues
|
|
59
|
+
|
|
60
|
+
Use `gh issue create`. Do NOT ask to review — file and share URLs.
|
|
61
|
+
|
|
62
|
+
**Single issue template:**
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
## What happened
|
|
66
|
+
[Actual behavior in plain language]
|
|
67
|
+
|
|
68
|
+
## What I expected
|
|
69
|
+
[Expected behavior]
|
|
70
|
+
|
|
71
|
+
## Steps to reproduce
|
|
72
|
+
1. [Concrete numbered steps]
|
|
73
|
+
2. [Use domain terms, not module names]
|
|
74
|
+
|
|
75
|
+
## Additional context
|
|
76
|
+
[Extra observations using domain language]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Breakdown template** (for each sub-issue):
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
## Parent issue
|
|
83
|
+
#{parent-issue-number} or "Reported during QA session"
|
|
84
|
+
|
|
85
|
+
## What's wrong
|
|
86
|
+
[This specific behavior problem]
|
|
87
|
+
|
|
88
|
+
## What I expected
|
|
89
|
+
[Expected behavior for this slice]
|
|
90
|
+
|
|
91
|
+
## Steps to reproduce
|
|
92
|
+
1. [Steps specific to THIS issue]
|
|
93
|
+
|
|
94
|
+
## Blocked by
|
|
95
|
+
- #{issue-number} or "None — can start immediately"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 5. Continue Session
|
|
99
|
+
|
|
100
|
+
After filing, share URLs and ask: "Next issue, or are we done?"
|
|
101
|
+
|
|
102
|
+
## Rules
|
|
103
|
+
|
|
104
|
+
- **No file paths or line numbers** in issues — they go stale
|
|
105
|
+
- **Use project domain language** (check UBIQUITOUS_LANGUAGE.md)
|
|
106
|
+
- **Describe behaviors, not code** — "sync service fails to apply patch" not "applyPatch() throws"
|
|
107
|
+
- **Reproduction steps mandatory** — ask if you can't determine them
|
|
108
|
+
- **Keep concise** — developer should read issue in 30 seconds
|
|
109
|
+
- **Maximize parallelism** — independent issues have no blockers
|
|
110
|
+
- **Create in dependency order** — blockers first for real issue numbers
|