@hustle-together/api-dev-tools 3.10.1 → 3.11.1
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/.claude/api-dev-state.json +159 -0
- package/.claude/commands/README.md +185 -0
- package/.claude/commands/add-command.md +209 -0
- package/.claude/commands/api-create.md +499 -0
- package/.claude/commands/api-env.md +50 -0
- package/.claude/commands/api-interview.md +331 -0
- package/.claude/commands/api-research.md +331 -0
- package/.claude/commands/api-status.md +259 -0
- package/.claude/commands/api-verify.md +231 -0
- package/.claude/commands/beepboop.md +97 -0
- package/.claude/commands/busycommit.md +112 -0
- package/.claude/commands/commit.md +83 -0
- package/.claude/commands/cycle.md +142 -0
- package/.claude/commands/gap.md +86 -0
- package/.claude/commands/green.md +142 -0
- package/.claude/commands/issue.md +192 -0
- package/.claude/commands/plan.md +168 -0
- package/.claude/commands/pr.md +122 -0
- package/.claude/commands/red.md +142 -0
- package/.claude/commands/refactor.md +142 -0
- package/.claude/commands/spike.md +142 -0
- package/.claude/commands/summarize.md +94 -0
- package/.claude/commands/tdd.md +144 -0
- package/.claude/commands/worktree-add.md +315 -0
- package/.claude/commands/worktree-cleanup.md +281 -0
- package/.claude/hooks/api-workflow-check.py +227 -0
- package/.claude/hooks/enforce-deep-research.py +185 -0
- package/.claude/hooks/enforce-disambiguation.py +155 -0
- package/.claude/hooks/enforce-documentation.py +192 -0
- package/.claude/hooks/enforce-environment.py +253 -0
- package/.claude/hooks/enforce-external-research.py +328 -0
- package/.claude/hooks/enforce-interview.py +421 -0
- package/.claude/hooks/enforce-refactor.py +189 -0
- package/.claude/hooks/enforce-research.py +159 -0
- package/.claude/hooks/enforce-schema.py +186 -0
- package/.claude/hooks/enforce-scope.py +160 -0
- package/.claude/hooks/enforce-tdd-red.py +250 -0
- package/.claude/hooks/enforce-verify.py +186 -0
- package/.claude/hooks/periodic-reground.py +154 -0
- package/.claude/hooks/session-startup.py +151 -0
- package/.claude/hooks/track-tool-use.py +626 -0
- package/.claude/hooks/verify-after-green.py +282 -0
- package/.claude/hooks/verify-implementation.py +225 -0
- package/.claude/research/index.json +6 -0
- package/.claude/settings.json +93 -0
- package/.claude/settings.local.json +11 -0
- package/.claude-plugin/marketplace.json +112 -0
- package/.skills/README.md +291 -0
- package/.skills/_shared/convert-commands.py +192 -0
- package/.skills/_shared/hooks/api-workflow-check.py +227 -0
- package/.skills/_shared/hooks/enforce-deep-research.py +185 -0
- package/.skills/_shared/hooks/enforce-disambiguation.py +155 -0
- package/.skills/_shared/hooks/enforce-documentation.py +192 -0
- package/.skills/_shared/hooks/enforce-environment.py +253 -0
- package/.skills/_shared/hooks/enforce-external-research.py +328 -0
- package/.skills/_shared/hooks/enforce-interview.py +421 -0
- package/.skills/_shared/hooks/enforce-refactor.py +189 -0
- package/.skills/_shared/hooks/enforce-research.py +159 -0
- package/.skills/_shared/hooks/enforce-schema.py +186 -0
- package/.skills/_shared/hooks/enforce-scope.py +160 -0
- package/.skills/_shared/hooks/enforce-tdd-red.py +250 -0
- package/.skills/_shared/hooks/enforce-verify.py +186 -0
- package/.skills/_shared/hooks/periodic-reground.py +154 -0
- package/.skills/_shared/hooks/session-startup.py +151 -0
- package/.skills/_shared/hooks/track-tool-use.py +626 -0
- package/.skills/_shared/hooks/verify-after-green.py +282 -0
- package/.skills/_shared/hooks/verify-implementation.py +225 -0
- package/.skills/_shared/install.sh +114 -0
- package/.skills/_shared/settings.json +93 -0
- package/.skills/add-command/SKILL.md +222 -0
- package/.skills/api-create/SKILL.md +512 -0
- package/.skills/api-env/SKILL.md +63 -0
- package/.skills/api-interview/SKILL.md +344 -0
- package/.skills/api-research/SKILL.md +344 -0
- package/.skills/api-status/SKILL.md +272 -0
- package/.skills/api-verify/SKILL.md +244 -0
- package/.skills/beepboop/SKILL.md +110 -0
- package/.skills/busycommit/SKILL.md +125 -0
- package/.skills/commit/SKILL.md +96 -0
- package/.skills/cycle/SKILL.md +155 -0
- package/.skills/gap/SKILL.md +99 -0
- package/.skills/green/SKILL.md +155 -0
- package/.skills/issue/SKILL.md +205 -0
- package/.skills/plan/SKILL.md +181 -0
- package/.skills/pr/SKILL.md +135 -0
- package/.skills/red/SKILL.md +155 -0
- package/.skills/refactor/SKILL.md +155 -0
- package/.skills/spike/SKILL.md +155 -0
- package/.skills/summarize/SKILL.md +107 -0
- package/.skills/tdd/SKILL.md +157 -0
- package/.skills/update-todos/SKILL.md +228 -0
- package/.skills/worktree-add/SKILL.md +328 -0
- package/.skills/worktree-cleanup/SKILL.md +294 -0
- package/CHANGELOG.md +97 -0
- package/README.md +58 -17
- package/package.json +22 -11
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Hook: SessionStart
|
|
4
|
+
Purpose: Inject current state and context at the beginning of each session
|
|
5
|
+
|
|
6
|
+
This hook runs when Claude Code starts a new session or resumes.
|
|
7
|
+
It reads the api-dev-state.json and injects a summary into Claude's context,
|
|
8
|
+
helping to re-ground Claude on:
|
|
9
|
+
- Current endpoint being developed
|
|
10
|
+
- Which phases are complete/in-progress
|
|
11
|
+
- Key decisions from interviews
|
|
12
|
+
- Research cache location and freshness
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
- JSON with additionalContext to inject into Claude's context
|
|
16
|
+
"""
|
|
17
|
+
import json
|
|
18
|
+
import sys
|
|
19
|
+
import os
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
# State file is in .claude/ directory (sibling to hooks/)
|
|
24
|
+
STATE_FILE = Path(__file__).parent.parent / "api-dev-state.json"
|
|
25
|
+
RESEARCH_INDEX = Path(__file__).parent.parent / "research" / "index.json"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def main():
|
|
29
|
+
# Read hook input from stdin
|
|
30
|
+
try:
|
|
31
|
+
input_data = json.load(sys.stdin)
|
|
32
|
+
except json.JSONDecodeError:
|
|
33
|
+
input_data = {}
|
|
34
|
+
|
|
35
|
+
cwd = input_data.get("cwd", os.getcwd())
|
|
36
|
+
|
|
37
|
+
# Check if state file exists
|
|
38
|
+
if not STATE_FILE.exists():
|
|
39
|
+
# No active workflow - just continue without injection
|
|
40
|
+
print(json.dumps({"continue": True}))
|
|
41
|
+
sys.exit(0)
|
|
42
|
+
|
|
43
|
+
try:
|
|
44
|
+
state = json.loads(STATE_FILE.read_text())
|
|
45
|
+
except json.JSONDecodeError:
|
|
46
|
+
print(json.dumps({"continue": True}))
|
|
47
|
+
sys.exit(0)
|
|
48
|
+
|
|
49
|
+
# Check if there's an active workflow
|
|
50
|
+
endpoint = state.get("endpoint")
|
|
51
|
+
if not endpoint:
|
|
52
|
+
# No active endpoint - just continue
|
|
53
|
+
print(json.dumps({"continue": True}))
|
|
54
|
+
sys.exit(0)
|
|
55
|
+
|
|
56
|
+
# Build context summary
|
|
57
|
+
context_parts = []
|
|
58
|
+
context_parts.append("## API Development Session Context")
|
|
59
|
+
context_parts.append("")
|
|
60
|
+
context_parts.append(f"**Active Endpoint:** {endpoint}")
|
|
61
|
+
|
|
62
|
+
# Get phase status
|
|
63
|
+
phases = state.get("phases", {})
|
|
64
|
+
completed = []
|
|
65
|
+
in_progress = []
|
|
66
|
+
not_started = []
|
|
67
|
+
|
|
68
|
+
phase_order = [
|
|
69
|
+
"disambiguation", "scope", "research_initial", "interview",
|
|
70
|
+
"research_deep", "schema_creation", "environment_check",
|
|
71
|
+
"tdd_red", "tdd_green", "verify", "tdd_refactor", "documentation"
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
for phase_name in phase_order:
|
|
75
|
+
phase = phases.get(phase_name, {})
|
|
76
|
+
status = phase.get("status", "not_started")
|
|
77
|
+
if status == "complete":
|
|
78
|
+
completed.append(phase_name)
|
|
79
|
+
elif status == "in_progress":
|
|
80
|
+
in_progress.append(phase_name)
|
|
81
|
+
else:
|
|
82
|
+
not_started.append(phase_name)
|
|
83
|
+
|
|
84
|
+
context_parts.append("")
|
|
85
|
+
context_parts.append("**Phase Status:**")
|
|
86
|
+
if completed:
|
|
87
|
+
context_parts.append(f" - Completed: {', '.join(completed)}")
|
|
88
|
+
if in_progress:
|
|
89
|
+
context_parts.append(f" - In Progress: {', '.join(in_progress)}")
|
|
90
|
+
|
|
91
|
+
# Current phase (first in_progress or first not_started)
|
|
92
|
+
current_phase = in_progress[0] if in_progress else (not_started[0] if not_started else "documentation")
|
|
93
|
+
context_parts.append(f" - Current: **{current_phase}**")
|
|
94
|
+
|
|
95
|
+
# Key decisions from interview
|
|
96
|
+
interview = phases.get("interview", {})
|
|
97
|
+
decisions = interview.get("decisions", {})
|
|
98
|
+
if decisions:
|
|
99
|
+
context_parts.append("")
|
|
100
|
+
context_parts.append("**Key Interview Decisions:**")
|
|
101
|
+
for key, value in decisions.items():
|
|
102
|
+
response = value.get("response", value.get("value", "N/A"))
|
|
103
|
+
if response:
|
|
104
|
+
context_parts.append(f" - {key}: {str(response)[:100]}")
|
|
105
|
+
|
|
106
|
+
# Research cache info
|
|
107
|
+
research_index = state.get("research_index", {})
|
|
108
|
+
if endpoint in research_index:
|
|
109
|
+
entry = research_index[endpoint]
|
|
110
|
+
days_old = entry.get("days_old", 0)
|
|
111
|
+
context_parts.append("")
|
|
112
|
+
context_parts.append("**Research Cache:**")
|
|
113
|
+
context_parts.append(f" - Location: .claude/research/{endpoint}/CURRENT.md")
|
|
114
|
+
context_parts.append(f" - Last Updated: {entry.get('last_updated', 'Unknown')}")
|
|
115
|
+
if days_old > 7:
|
|
116
|
+
context_parts.append(f" - WARNING: Research is {days_old} days old. Consider re-researching.")
|
|
117
|
+
|
|
118
|
+
# Turn count for re-grounding awareness
|
|
119
|
+
turn_count = state.get("turn_count", 0)
|
|
120
|
+
if turn_count > 0:
|
|
121
|
+
context_parts.append("")
|
|
122
|
+
context_parts.append(f"**Session Info:** Turn {turn_count} of previous session")
|
|
123
|
+
|
|
124
|
+
# Important file locations
|
|
125
|
+
context_parts.append("")
|
|
126
|
+
context_parts.append("**Key Files:**")
|
|
127
|
+
context_parts.append(" - State: .claude/api-dev-state.json")
|
|
128
|
+
context_parts.append(" - Research: .claude/research/")
|
|
129
|
+
context_parts.append(" - Manifest: src/app/api-test/api-tests-manifest.json (if exists)")
|
|
130
|
+
|
|
131
|
+
# Workflow reminder
|
|
132
|
+
context_parts.append("")
|
|
133
|
+
context_parts.append("**Workflow Reminder:** This project uses interview-driven API development.")
|
|
134
|
+
context_parts.append("Phases loop back if verification fails. Research before answering API questions.")
|
|
135
|
+
|
|
136
|
+
# Build the output
|
|
137
|
+
additional_context = "\n".join(context_parts)
|
|
138
|
+
|
|
139
|
+
output = {
|
|
140
|
+
"hookSpecificOutput": {
|
|
141
|
+
"hookEventName": "SessionStart",
|
|
142
|
+
"additionalContext": additional_context
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
print(json.dumps(output))
|
|
147
|
+
sys.exit(0)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
if __name__ == "__main__":
|
|
151
|
+
main()
|