@hustle-together/api-dev-tools 3.10.0 → 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.
Files changed (97) hide show
  1. package/.claude/api-dev-state.json +159 -0
  2. package/.claude/commands/README.md +185 -0
  3. package/.claude/commands/add-command.md +209 -0
  4. package/.claude/commands/api-create.md +499 -0
  5. package/.claude/commands/api-env.md +50 -0
  6. package/.claude/commands/api-interview.md +331 -0
  7. package/.claude/commands/api-research.md +331 -0
  8. package/.claude/commands/api-status.md +259 -0
  9. package/.claude/commands/api-verify.md +231 -0
  10. package/.claude/commands/beepboop.md +97 -0
  11. package/.claude/commands/busycommit.md +112 -0
  12. package/.claude/commands/commit.md +83 -0
  13. package/.claude/commands/cycle.md +142 -0
  14. package/.claude/commands/gap.md +86 -0
  15. package/.claude/commands/green.md +142 -0
  16. package/.claude/commands/issue.md +192 -0
  17. package/.claude/commands/plan.md +168 -0
  18. package/.claude/commands/pr.md +122 -0
  19. package/.claude/commands/red.md +142 -0
  20. package/.claude/commands/refactor.md +142 -0
  21. package/.claude/commands/spike.md +142 -0
  22. package/.claude/commands/summarize.md +94 -0
  23. package/.claude/commands/tdd.md +144 -0
  24. package/.claude/commands/worktree-add.md +315 -0
  25. package/.claude/commands/worktree-cleanup.md +281 -0
  26. package/.claude/hooks/api-workflow-check.py +227 -0
  27. package/.claude/hooks/enforce-deep-research.py +185 -0
  28. package/.claude/hooks/enforce-disambiguation.py +155 -0
  29. package/.claude/hooks/enforce-documentation.py +192 -0
  30. package/.claude/hooks/enforce-environment.py +253 -0
  31. package/.claude/hooks/enforce-external-research.py +328 -0
  32. package/.claude/hooks/enforce-interview.py +421 -0
  33. package/.claude/hooks/enforce-refactor.py +189 -0
  34. package/.claude/hooks/enforce-research.py +159 -0
  35. package/.claude/hooks/enforce-schema.py +186 -0
  36. package/.claude/hooks/enforce-scope.py +160 -0
  37. package/.claude/hooks/enforce-tdd-red.py +250 -0
  38. package/.claude/hooks/enforce-verify.py +186 -0
  39. package/.claude/hooks/periodic-reground.py +154 -0
  40. package/.claude/hooks/session-startup.py +151 -0
  41. package/.claude/hooks/track-tool-use.py +626 -0
  42. package/.claude/hooks/verify-after-green.py +282 -0
  43. package/.claude/hooks/verify-implementation.py +225 -0
  44. package/.claude/research/index.json +6 -0
  45. package/.claude/settings.json +93 -0
  46. package/.claude/settings.local.json +11 -0
  47. package/.claude-plugin/marketplace.json +112 -0
  48. package/.skills/README.md +291 -0
  49. package/.skills/_shared/convert-commands.py +192 -0
  50. package/.skills/_shared/hooks/api-workflow-check.py +227 -0
  51. package/.skills/_shared/hooks/enforce-deep-research.py +185 -0
  52. package/.skills/_shared/hooks/enforce-disambiguation.py +155 -0
  53. package/.skills/_shared/hooks/enforce-documentation.py +192 -0
  54. package/.skills/_shared/hooks/enforce-environment.py +253 -0
  55. package/.skills/_shared/hooks/enforce-external-research.py +328 -0
  56. package/.skills/_shared/hooks/enforce-interview.py +421 -0
  57. package/.skills/_shared/hooks/enforce-refactor.py +189 -0
  58. package/.skills/_shared/hooks/enforce-research.py +159 -0
  59. package/.skills/_shared/hooks/enforce-schema.py +186 -0
  60. package/.skills/_shared/hooks/enforce-scope.py +160 -0
  61. package/.skills/_shared/hooks/enforce-tdd-red.py +250 -0
  62. package/.skills/_shared/hooks/enforce-verify.py +186 -0
  63. package/.skills/_shared/hooks/periodic-reground.py +154 -0
  64. package/.skills/_shared/hooks/session-startup.py +151 -0
  65. package/.skills/_shared/hooks/track-tool-use.py +626 -0
  66. package/.skills/_shared/hooks/verify-after-green.py +282 -0
  67. package/.skills/_shared/hooks/verify-implementation.py +225 -0
  68. package/.skills/_shared/install.sh +114 -0
  69. package/.skills/_shared/settings.json +93 -0
  70. package/.skills/add-command/SKILL.md +222 -0
  71. package/.skills/api-create/SKILL.md +512 -0
  72. package/.skills/api-env/SKILL.md +63 -0
  73. package/.skills/api-interview/SKILL.md +344 -0
  74. package/.skills/api-research/SKILL.md +344 -0
  75. package/.skills/api-status/SKILL.md +272 -0
  76. package/.skills/api-verify/SKILL.md +244 -0
  77. package/.skills/beepboop/SKILL.md +110 -0
  78. package/.skills/busycommit/SKILL.md +125 -0
  79. package/.skills/commit/SKILL.md +96 -0
  80. package/.skills/cycle/SKILL.md +155 -0
  81. package/.skills/gap/SKILL.md +99 -0
  82. package/.skills/green/SKILL.md +155 -0
  83. package/.skills/issue/SKILL.md +205 -0
  84. package/.skills/plan/SKILL.md +181 -0
  85. package/.skills/pr/SKILL.md +135 -0
  86. package/.skills/red/SKILL.md +155 -0
  87. package/.skills/refactor/SKILL.md +155 -0
  88. package/.skills/spike/SKILL.md +155 -0
  89. package/.skills/summarize/SKILL.md +107 -0
  90. package/.skills/tdd/SKILL.md +157 -0
  91. package/.skills/update-todos/SKILL.md +228 -0
  92. package/.skills/worktree-add/SKILL.md +328 -0
  93. package/.skills/worktree-cleanup/SKILL.md +294 -0
  94. package/CHANGELOG.md +97 -0
  95. package/README.md +66 -20
  96. package/bin/cli.js +7 -6
  97. 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()