thrivekit 2.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.
Files changed (164) hide show
  1. package/.claude/commands/explain.md +114 -0
  2. package/.claude/commands/idea.md +370 -0
  3. package/.claude/commands/my-dna.md +122 -0
  4. package/.claude/commands/prd.md +286 -0
  5. package/.claude/commands/review.md +167 -0
  6. package/.claude/commands/sign.md +32 -0
  7. package/.claude/commands/styleguide.md +450 -0
  8. package/.claude/commands/tour.md +301 -0
  9. package/.claude/commands/vibe-check.md +116 -0
  10. package/.claude/commands/vibe-help.md +47 -0
  11. package/.claude/commands/vibe-list.md +203 -0
  12. package/.claude/settings.json +75 -0
  13. package/.claude/settings.local.json +12 -0
  14. package/.pre-commit-hooks.yaml +102 -0
  15. package/LICENSE +21 -0
  16. package/README.md +214 -0
  17. package/bin/postinstall.sh +29 -0
  18. package/bin/ralph.sh +171 -0
  19. package/bin/thrivekit.sh +24 -0
  20. package/bin/vibe-check.js +19 -0
  21. package/dist/checks/check-any-types.d.ts +6 -0
  22. package/dist/checks/check-any-types.d.ts.map +1 -0
  23. package/dist/checks/check-any-types.js +73 -0
  24. package/dist/checks/check-any-types.js.map +1 -0
  25. package/dist/checks/check-commented-code.d.ts +6 -0
  26. package/dist/checks/check-commented-code.d.ts.map +1 -0
  27. package/dist/checks/check-commented-code.js +81 -0
  28. package/dist/checks/check-commented-code.js.map +1 -0
  29. package/dist/checks/check-console-error.d.ts +6 -0
  30. package/dist/checks/check-console-error.d.ts.map +1 -0
  31. package/dist/checks/check-console-error.js +41 -0
  32. package/dist/checks/check-console-error.js.map +1 -0
  33. package/dist/checks/check-debug-statements.d.ts +6 -0
  34. package/dist/checks/check-debug-statements.d.ts.map +1 -0
  35. package/dist/checks/check-debug-statements.js +120 -0
  36. package/dist/checks/check-debug-statements.js.map +1 -0
  37. package/dist/checks/check-deep-nesting.d.ts +6 -0
  38. package/dist/checks/check-deep-nesting.d.ts.map +1 -0
  39. package/dist/checks/check-deep-nesting.js +116 -0
  40. package/dist/checks/check-deep-nesting.js.map +1 -0
  41. package/dist/checks/check-docker-platform.d.ts +6 -0
  42. package/dist/checks/check-docker-platform.d.ts.map +1 -0
  43. package/dist/checks/check-docker-platform.js +42 -0
  44. package/dist/checks/check-docker-platform.js.map +1 -0
  45. package/dist/checks/check-dry-violations.d.ts +6 -0
  46. package/dist/checks/check-dry-violations.d.ts.map +1 -0
  47. package/dist/checks/check-dry-violations.js +124 -0
  48. package/dist/checks/check-dry-violations.js.map +1 -0
  49. package/dist/checks/check-empty-catch.d.ts +6 -0
  50. package/dist/checks/check-empty-catch.d.ts.map +1 -0
  51. package/dist/checks/check-empty-catch.js +111 -0
  52. package/dist/checks/check-empty-catch.js.map +1 -0
  53. package/dist/checks/check-function-length.d.ts +6 -0
  54. package/dist/checks/check-function-length.d.ts.map +1 -0
  55. package/dist/checks/check-function-length.js +152 -0
  56. package/dist/checks/check-function-length.js.map +1 -0
  57. package/dist/checks/check-hardcoded-ai-models.d.ts +10 -0
  58. package/dist/checks/check-hardcoded-ai-models.d.ts.map +1 -0
  59. package/dist/checks/check-hardcoded-ai-models.js +102 -0
  60. package/dist/checks/check-hardcoded-ai-models.js.map +1 -0
  61. package/dist/checks/check-hardcoded-urls.d.ts +6 -0
  62. package/dist/checks/check-hardcoded-urls.d.ts.map +1 -0
  63. package/dist/checks/check-hardcoded-urls.js +124 -0
  64. package/dist/checks/check-hardcoded-urls.js.map +1 -0
  65. package/dist/checks/check-magic-numbers.d.ts +6 -0
  66. package/dist/checks/check-magic-numbers.d.ts.map +1 -0
  67. package/dist/checks/check-magic-numbers.js +116 -0
  68. package/dist/checks/check-magic-numbers.js.map +1 -0
  69. package/dist/checks/check-secrets.d.ts +6 -0
  70. package/dist/checks/check-secrets.d.ts.map +1 -0
  71. package/dist/checks/check-secrets.js +138 -0
  72. package/dist/checks/check-secrets.js.map +1 -0
  73. package/dist/checks/check-snake-case-ts.d.ts +6 -0
  74. package/dist/checks/check-snake-case-ts.d.ts.map +1 -0
  75. package/dist/checks/check-snake-case-ts.js +78 -0
  76. package/dist/checks/check-snake-case-ts.js.map +1 -0
  77. package/dist/checks/check-todo-fixme.d.ts +6 -0
  78. package/dist/checks/check-todo-fixme.d.ts.map +1 -0
  79. package/dist/checks/check-todo-fixme.js +41 -0
  80. package/dist/checks/check-todo-fixme.js.map +1 -0
  81. package/dist/checks/check-unsafe-html.d.ts +6 -0
  82. package/dist/checks/check-unsafe-html.d.ts.map +1 -0
  83. package/dist/checks/check-unsafe-html.js +101 -0
  84. package/dist/checks/check-unsafe-html.js.map +1 -0
  85. package/dist/checks/index.d.ts +30 -0
  86. package/dist/checks/index.d.ts.map +1 -0
  87. package/dist/checks/index.js +57 -0
  88. package/dist/checks/index.js.map +1 -0
  89. package/dist/cli.d.ts +13 -0
  90. package/dist/cli.d.ts.map +1 -0
  91. package/dist/cli.js +206 -0
  92. package/dist/cli.js.map +1 -0
  93. package/dist/index.d.ts +9 -0
  94. package/dist/index.d.ts.map +1 -0
  95. package/dist/index.js +10 -0
  96. package/dist/index.js.map +1 -0
  97. package/dist/utils/file-reader.d.ts +24 -0
  98. package/dist/utils/file-reader.d.ts.map +1 -0
  99. package/dist/utils/file-reader.js +140 -0
  100. package/dist/utils/file-reader.js.map +1 -0
  101. package/dist/utils/patterns.d.ts +27 -0
  102. package/dist/utils/patterns.d.ts.map +1 -0
  103. package/dist/utils/patterns.js +84 -0
  104. package/dist/utils/patterns.js.map +1 -0
  105. package/dist/utils/reporters.d.ts +21 -0
  106. package/dist/utils/reporters.d.ts.map +1 -0
  107. package/dist/utils/reporters.js +115 -0
  108. package/dist/utils/reporters.js.map +1 -0
  109. package/dist/utils/types.d.ts +71 -0
  110. package/dist/utils/types.d.ts.map +1 -0
  111. package/dist/utils/types.js +5 -0
  112. package/dist/utils/types.js.map +1 -0
  113. package/package.json +82 -0
  114. package/ralph/api.sh +210 -0
  115. package/ralph/backup.sh +838 -0
  116. package/ralph/browser-verify/README.md +135 -0
  117. package/ralph/browser-verify/verify.ts +450 -0
  118. package/ralph/checks/check-fastapi-responses.py +155 -0
  119. package/ralph/hooks/hooks-config.json +72 -0
  120. package/ralph/hooks/inject-context.sh +44 -0
  121. package/ralph/hooks/install.sh +207 -0
  122. package/ralph/hooks/log-tools.sh +45 -0
  123. package/ralph/hooks/protect-prd.sh +27 -0
  124. package/ralph/hooks/save-learnings.sh +36 -0
  125. package/ralph/hooks/warn-debug.sh +54 -0
  126. package/ralph/hooks/warn-empty-catch.sh +63 -0
  127. package/ralph/hooks/warn-secrets.sh +89 -0
  128. package/ralph/hooks/warn-urls.sh +77 -0
  129. package/ralph/init.sh +388 -0
  130. package/ralph/loop.sh +570 -0
  131. package/ralph/playwright.sh +238 -0
  132. package/ralph/prd.sh +295 -0
  133. package/ralph/setup/feature-tour.sh +155 -0
  134. package/ralph/setup/quick-setup.sh +239 -0
  135. package/ralph/setup/tutorial.sh +159 -0
  136. package/ralph/setup/ui.sh +136 -0
  137. package/ralph/setup.sh +353 -0
  138. package/ralph/signs.sh +150 -0
  139. package/ralph/utils.sh +682 -0
  140. package/ralph/verify/browser.sh +324 -0
  141. package/ralph/verify/lint.sh +363 -0
  142. package/ralph/verify/review.sh +164 -0
  143. package/ralph/verify/tests.sh +81 -0
  144. package/ralph/verify.sh +224 -0
  145. package/templates/PROMPT.md +235 -0
  146. package/templates/config/fullstack.json +86 -0
  147. package/templates/config/go.json +81 -0
  148. package/templates/config/minimal.json +76 -0
  149. package/templates/config/node.json +81 -0
  150. package/templates/config/python.json +81 -0
  151. package/templates/config/rust.json +81 -0
  152. package/templates/examples/CLAUDE-django.md +174 -0
  153. package/templates/examples/CLAUDE-fastapi.md +270 -0
  154. package/templates/examples/CLAUDE-fastmcp.md +352 -0
  155. package/templates/examples/CLAUDE-fullstack.md +256 -0
  156. package/templates/examples/CLAUDE-node.md +246 -0
  157. package/templates/examples/CLAUDE-react.md +138 -0
  158. package/templates/optional/cursorrules.template +147 -0
  159. package/templates/optional/eslint.config.js +34 -0
  160. package/templates/optional/lint-staged.config.js +34 -0
  161. package/templates/optional/ruff.toml +125 -0
  162. package/templates/optional/vibe-check.yml +116 -0
  163. package/templates/optional/vscode-settings.json +127 -0
  164. package/templates/signs.json +46 -0
@@ -0,0 +1,75 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "Edit|Write",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "/Users/allierays/Sites/vibe-and-thrive/ralph/hooks/protect-prd.sh",
10
+ "timeout": 5
11
+ }
12
+ ]
13
+ }
14
+ ],
15
+ "PostToolUse": [
16
+ {
17
+ "matcher": "Edit|Write",
18
+ "hooks": [
19
+ {
20
+ "type": "command",
21
+ "command": "/Users/allierays/Sites/vibe-and-thrive/ralph/hooks/warn-debug.sh",
22
+ "timeout": 5
23
+ },
24
+ {
25
+ "type": "command",
26
+ "command": "/Users/allierays/Sites/vibe-and-thrive/ralph/hooks/warn-secrets.sh",
27
+ "timeout": 5
28
+ },
29
+ {
30
+ "type": "command",
31
+ "command": "/Users/allierays/Sites/vibe-and-thrive/ralph/hooks/warn-urls.sh",
32
+ "timeout": 5
33
+ },
34
+ {
35
+ "type": "command",
36
+ "command": "/Users/allierays/Sites/vibe-and-thrive/ralph/hooks/warn-empty-catch.sh",
37
+ "timeout": 5
38
+ }
39
+ ]
40
+ },
41
+ {
42
+ "matcher": "*",
43
+ "hooks": [
44
+ {
45
+ "type": "command",
46
+ "command": "/Users/allierays/Sites/vibe-and-thrive/ralph/hooks/log-tools.sh",
47
+ "timeout": 3
48
+ }
49
+ ]
50
+ }
51
+ ],
52
+ "SessionStart": [
53
+ {
54
+ "hooks": [
55
+ {
56
+ "type": "command",
57
+ "command": "/Users/allierays/Sites/vibe-and-thrive/ralph/hooks/inject-context.sh",
58
+ "timeout": 5
59
+ }
60
+ ]
61
+ }
62
+ ],
63
+ "Stop": [
64
+ {
65
+ "hooks": [
66
+ {
67
+ "type": "command",
68
+ "command": "/Users/allierays/Sites/vibe-and-thrive/ralph/hooks/save-learnings.sh",
69
+ "timeout": 10
70
+ }
71
+ ]
72
+ }
73
+ ]
74
+ }
75
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "WebFetch(domain:x.com)",
5
+ "WebSearch",
6
+ "WebFetch(domain:creatoreconomy.so)",
7
+ "Bash(cat:*)"
8
+ ],
9
+ "deny": [],
10
+ "ask": []
11
+ }
12
+ }
@@ -0,0 +1,102 @@
1
+ # thrivekit pre-commit hooks
2
+ # All hooks use language: node for consistency
3
+
4
+ # Database backup (non-blocking - creates backup before commit)
5
+ - id: backup-db
6
+ name: Backup databases
7
+ entry: bash -c 'npx --yes ralph backup --quiet 2>/dev/null || true'
8
+ language: system
9
+ pass_filenames: false
10
+ always_run: true
11
+ stages: [pre-commit]
12
+
13
+ # Build check (blocking - ensures code compiles)
14
+ # Checks common locations for build script: root, frontend/, client/, apps/web/
15
+ - id: build
16
+ name: Build check
17
+ entry: bash -c 'if grep -q "\"build\":" package.json 2>/dev/null; then npm run build; elif grep -q "\"build\":" frontend/package.json 2>/dev/null; then cd frontend && npm run build; elif grep -q "\"build\":" client/package.json 2>/dev/null; then cd client && npm run build; elif grep -q "\"build\":" apps/web/package.json 2>/dev/null; then cd apps/web && npm run build; else echo "No build script found, skipping"; fi'
18
+ language: system
19
+ pass_filenames: false
20
+ always_run: true
21
+
22
+ # Security checks (blocking - these will fail the commit)
23
+ - id: check-env-files
24
+ name: Block .env files from commit
25
+ entry: bash -c 'echo "ERROR: .env files should not be committed. Add to .gitignore." && exit 1'
26
+ language: system
27
+ files: '\.env($|\.)'
28
+ pass_filenames: false
29
+
30
+ - id: check-secrets
31
+ name: Check for hardcoded secrets
32
+ entry: npx vibe-check --only secrets --fail-on error
33
+ language: node
34
+ types_or: [python, javascript, ts, json, yaml]
35
+ pass_filenames: true
36
+
37
+ - id: check-hardcoded-urls
38
+ name: Check for hardcoded URLs
39
+ entry: npx vibe-check --only urls --fail-on error
40
+ language: node
41
+ types_or: [python, javascript, ts]
42
+ pass_filenames: true
43
+
44
+ - id: check-unsafe-html
45
+ name: Check for unsafe HTML manipulation
46
+ entry: npx vibe-check --only unsafe-html --fail-on error
47
+ language: node
48
+ types_or: [javascript, ts]
49
+ pass_filenames: true
50
+
51
+ # Code quality checks (warnings - informational)
52
+ - id: check-debug
53
+ name: Check for debug statements
54
+ entry: npx vibe-check --only debug --fail-on error
55
+ language: node
56
+ types_or: [python, javascript, ts]
57
+ pass_filenames: true
58
+
59
+ - id: check-empty-catch
60
+ name: Check for empty catch blocks
61
+ entry: npx vibe-check --only empty-catch --fail-on warning
62
+ language: node
63
+ types_or: [python, javascript, ts]
64
+ pass_filenames: true
65
+
66
+ - id: check-any-types
67
+ name: Check for any types in TypeScript
68
+ entry: npx vibe-check --only any-types --fail-on warning
69
+ language: node
70
+ types: [ts]
71
+ pass_filenames: true
72
+
73
+ - id: check-snake-case
74
+ name: Check for snake_case in TypeScript
75
+ entry: npx vibe-check --only snake-case --fail-on warning
76
+ language: node
77
+ types: [ts]
78
+ pass_filenames: true
79
+
80
+ # Comprehensive check (all hooks)
81
+ - id: vibe-check
82
+ name: Vibe Check (all)
83
+ entry: npx vibe-check
84
+ language: node
85
+ types_or: [python, javascript, ts, json, yaml]
86
+ pass_filenames: true
87
+
88
+ # Quick security-only check
89
+ - id: vibe-check-security
90
+ name: Vibe Check (security only)
91
+ entry: npx vibe-check --only secrets,urls,unsafe-html --fail-on error
92
+ language: node
93
+ types_or: [python, javascript, ts, json, yaml]
94
+ pass_filenames: true
95
+
96
+ # Quality-only check (non-blocking)
97
+ - id: vibe-check-quality
98
+ name: Vibe Check (quality only)
99
+ entry: npx vibe-check --skip secrets,urls,unsafe-html --fail-on none
100
+ language: node
101
+ types_or: [python, javascript, ts]
102
+ pass_filenames: true
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 AllThrive AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,214 @@
1
+ # ThriveKit
2
+
3
+ **Tools to thrive with agentic coding.**
4
+
5
+ A toolkit for implementing [RALPH](https://ghuntley.com/ralph/) with [Claude Code](https://docs.anthropic.com/en/docs/claude-code) that helps you go from idea to shipped code.
6
+
7
+ > You focus on what matters: your ideas. Brainstorm with `/idea`, then let Ralph handle the rest - coding, testing, and committing in an iterative loop until everything passes.
8
+
9
+ ### This repo includes:
10
+ #### Customize
11
+ - **`/my-dna`** - Add your own voice and values to your claude.md (This helps you personalize your experience and output)
12
+ - **`/styleguide`** - Generate a UI component reference for consistent design (Stop AI from generating everything in purple add your unique style in an html and then reference it)
13
+
14
+ #### Autonomous Code Loops with RALPH principles
15
+ Run this in the terminal not in a claude cli session. It will use your claude subscription not an API key.
16
+ - **`npx thrivekit run`** - RALPH Autonomous loop: Brainstorm ideas → turn ideas into atomic prds → implement → verify → commit → repeat
17
+
18
+ #### Guardrails
19
+ - **`/vibe-check`** - manually run the same automated tests and guardrail checks at any time
20
+ - **`/review`** - manually run the same automated Security-focused code review with OWASP checks
21
+ - **Pre-commit hooks** - Automatically block secrets, hardcoded URLs, and security issues with precommit hooks from entering into your git repo. Catch and fix issues before your CI/CD does
22
+ - **Claude Code hooks** - Real-time warnings while coding (debug statements, secrets, hardcoded URLs)
23
+
24
+ ---
25
+ See More for on how the [RALPH loop](docs/RALPH.md) works in this repo
26
+
27
+ ---
28
+
29
+
30
+ ## Getting Started
31
+
32
+ ### Prerequisites
33
+
34
+ - Node.js 18+
35
+ - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI installed and authenticated
36
+ - `jq` (for config management): `brew install jq` or `apt install jq`
37
+ - Optional: [Playwright](https://playwright.dev/) for browser verification (installed automatically by `/tour`)
38
+
39
+
40
+ ## Step 0: Install
41
+
42
+ ```bash
43
+ cd [your-project]
44
+ npm install thrivekit
45
+ npx thrivekit setup
46
+ ```
47
+
48
+ This sets up:
49
+ - Slash commands (`/idea`, `/review`, etc.)
50
+ - Pre-commit hooks (secrets, URLs, debug statements)
51
+ - Claude Code hooks (real-time warnings)
52
+ - Ralph configuration files
53
+
54
+ > **Note:** Claude Code hooks require `jq`. On macOS with Homebrew, it's installed automatically. On Linux, if you see a warning, run `sudo apt install jq` (or your package manager) then `npx thrivekit setup`.
55
+
56
+ ## Step 1: Start claude (--dangerously-skip-permissions is optional)
57
+
58
+ ```bash
59
+ claude --dangerously-skip-permissions
60
+ ```
61
+
62
+ ## Step 1b: Optional run tour and customizations
63
+ Inside of a claude session run
64
+ ```
65
+ /tour
66
+ ```
67
+ 1. The tour auto-detects your project settings and walks you through the workflow.
68
+ 2. You can set up your own styleguide for all your frontend work to reference. I highly recommend you do this.
69
+ 3. run /my-dna to add your own writing style, core values, and things you want represented in your application so that your app represents you and what you want.
70
+
71
+ ### Step 2: Brainstorm Your Idea
72
+
73
+ ```
74
+ /idea [describe your next feature]
75
+ ```
76
+
77
+ Claude asks clarifying questions, explores your codebase, then generates:
78
+ - `docs/ideas/your-feature.md` - The documented idea
79
+ - `.ralph/prd.json` - Atomic stories for Ralph
80
+
81
+ Review and approve when prompted.
82
+
83
+ > **Note:** If Claude skips writing to `docs/ideas/`, tell it: "Please write the idea to docs/ideas/ and generate the PRD as the /idea command specifies"
84
+
85
+ ### Step 3: Execute with Ralph
86
+
87
+ Type `/exit` or open a new terminal, then run:
88
+
89
+ ```bash
90
+ npx thrivekit run
91
+ ```
92
+
93
+ Ralph loops through stories one at a time, writes tests, verifies, and commits.
94
+
95
+ > **Pro tip:** Use two terminals - plan with Claude in one, run Ralph in another.
96
+
97
+ ## Ralph Details
98
+
99
+ ```
100
+ ┌─────────────────────────────────────────────────────────────┐
101
+ │ RALPH LOOP │
102
+ ├─────────────────────────────────────────────────────────────┤
103
+ │ │
104
+ │ 1. Read prd.json → find next story where passes=false │
105
+ │ 2. Build prompt (story + context + failures + signs) │
106
+ │ 3. Spawn Claude with prompt │
107
+ │ 4. Run verification (build, tests, browser, code review) │
108
+ │ 5. Pass? → commit, next story │
109
+ │ Fail? → save error, retry with failure context │
110
+ │ 6. Repeat until all stories pass │
111
+ │ │
112
+ └─────────────────────────────────────────────────────────────┘
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Documentation
118
+
119
+ | Doc | Description |
120
+ |-----|-------------|
121
+ | [How Ralph Works](docs/RALPH.md) | Architecture, config, troubleshooting |
122
+ | [Cheatsheet](docs/CHEATSHEET.md) | All commands, quick reference |
123
+ | [Workflow Guide](docs/WORKFLOW.md) | End-to-end development process |
124
+ | [Hooks Reference](docs/HOOKS.md) | Pre-commit and Claude Code hooks |
125
+ | [Bad Patterns](docs/BAD-PATTERNS.md) | AI code issues to avoid |
126
+ | [Prompting Guide](docs/PROMPTING-GUIDE.md) | Writing effective PROMPT.md |
127
+ | [TDD Guide](docs/TDD.md) | Test-driven development with Ralph |
128
+ | [Styleguide](docs/STYLEGUIDE.md) | Creating UI component references |
129
+ | [Contributing](docs/CONTRIBUTING.md) | How to contribute |
130
+
131
+ ## Project Structure
132
+
133
+ ```
134
+ thrivekit/
135
+ ├── .claude/commands/ # Slash commands (/idea, /review, etc.)
136
+ ├── ralph/ # Autonomous loop (Bash)
137
+ │ ├── hooks/ # Claude Code hooks (real-time warnings)
138
+ │ ├── browser-verify/ # Playwright verification
139
+ │ └── setup/ # Setup wizards (/tour)
140
+ ├── src/ # Pre-commit checks (TypeScript)
141
+ │ └── checks/ # Check implementations (secrets, urls, etc.)
142
+ ├── templates/ # Files for user projects
143
+ │ ├── PROMPT.md # Base prompt for Ralph sessions
144
+ │ ├── config/ # Project type configs (node, python)
145
+ │ ├── optional/ # Extra configs (eslint, vscode, etc.)
146
+ │ └── examples/ # Example CLAUDE.md files by stack
147
+ ├── docs/ # Documentation
148
+ └── bin/ # CLI entry points (thrivekit, vibe-check)
149
+ ```
150
+
151
+ ### Three Layers of Quality Checks
152
+
153
+ | Layer | When | What |
154
+ |-------|------|------|
155
+ | **Slash commands** | In Claude Code CLI | `/vibe-check`, `/review` - on-demand checks |
156
+ | **Claude Code hooks** | While Claude writes code | Real-time warnings (debug statements, secrets) |
157
+ | **Pre-commit hooks** | At `git commit` | Blocks secrets, URLs, debug statements |
158
+
159
+ ---
160
+
161
+ ## Troubleshooting
162
+
163
+ ### "SessionStart: startup hook error"
164
+
165
+ This means Claude Code hooks are configured but the hook scripts can't be found. Fix with:
166
+
167
+ ```bash
168
+ # Reinstall project hooks
169
+ npx thrivekit setup
170
+ ```
171
+
172
+ ### Hooks not working after moving project
173
+
174
+ Claude Code hooks use absolute paths. After moving a project or cloning on a new machine, reinstall hooks:
175
+
176
+ ```bash
177
+ npx thrivekit setup
178
+ ```
179
+
180
+ ### Team members getting hook errors
181
+
182
+ `.claude/settings.json` contains machine-specific paths and should not be committed to git. The setup script automatically adds it to `.gitignore`. Each team member's hooks are configured when they run `npx thrivekit setup`.
183
+
184
+ If `.claude/settings.json` was accidentally committed:
185
+ ```bash
186
+ git rm --cached .claude/settings.json
187
+ echo ".claude/settings.json" >> .gitignore
188
+ git commit -m "Remove machine-specific settings from git"
189
+ ```
190
+
191
+ ### jq not installed
192
+
193
+ Claude Code hooks require `jq` for JSON manipulation. On macOS with Homebrew, the setup installs it automatically. On Linux:
194
+
195
+ ```bash
196
+ # Ubuntu/Debian
197
+ sudo apt install jq
198
+
199
+ # Fedora/RHEL
200
+ sudo dnf install jq
201
+
202
+ # Then run setup
203
+ npx thrivekit setup
204
+ ```
205
+
206
+ ---
207
+
208
+ ## License
209
+
210
+ MIT - see [LICENSE](LICENSE)
211
+
212
+ ---
213
+
214
+ Built by [AllThrive AI](https://allthrive.ai)
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env bash
2
+ # Postinstall: just show next step message
3
+
4
+ set -euo pipefail
5
+
6
+ # Skip in CI environments
7
+ if [[ "${CI:-}" == "true" ]] || [[ "${GITHUB_ACTIONS:-}" == "true" ]]; then
8
+ exit 0
9
+ fi
10
+
11
+ # Get the package directory (where thrivekit is installed)
12
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13
+ PKG_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
14
+
15
+ # Get the project root (go up from node_modules/thrivekit)
16
+ PROJECT_ROOT="$(cd "$PKG_ROOT/../.." && pwd)"
17
+
18
+ # Don't run in the thrivekit package itself
19
+ if [[ -f "$PROJECT_ROOT/package.json" ]] && grep -q '"name": "thrivekit"' "$PROJECT_ROOT/package.json" 2>/dev/null; then
20
+ exit 0
21
+ fi
22
+
23
+ # Just show the next step
24
+ echo "" >&2
25
+ echo " ✨ thrivekit installed!" >&2
26
+ echo "" >&2
27
+ echo " Run setup:" >&2
28
+ echo " npx thrivekit setup" >&2
29
+ echo "" >&2
package/bin/ralph.sh ADDED
@@ -0,0 +1,171 @@
1
+ #!/usr/bin/env bash
2
+ # shellcheck shell=bash
3
+ # ralph.sh - Autonomous AI Development Loop
4
+ #
5
+ # A CLI tool that orchestrates Claude CLI for autonomous development loops.
6
+ # Part of thrivekit: https://github.com/allthriveai/thrivekit
7
+
8
+ set -euo pipefail
9
+
10
+ # Handle Ctrl+C - kill all child processes
11
+ trap 'echo ""; echo "Interrupted. Stopping..."; kill 0 2>/dev/null; exit 130' INT TERM
12
+
13
+ # Get the directory where ralph.sh is installed (works even via symlink)
14
+ get_script_dir() {
15
+ local source="${BASH_SOURCE[0]}"
16
+ while [[ -L "$source" ]]; do
17
+ local dir
18
+ dir=$(cd -P "$(dirname "$source")" && pwd)
19
+ source=$(readlink "$source")
20
+ [[ "$source" != /* ]] && source="$dir/$source"
21
+ done
22
+ cd -P "$(dirname "$source")" && pwd
23
+ }
24
+
25
+ SCRIPT_DIR="$(get_script_dir)"
26
+ RALPH_LIB="$SCRIPT_DIR/../ralph"
27
+ RALPH_TEMPLATES="$SCRIPT_DIR/../templates"
28
+
29
+ # Project-local directories (can be overridden by environment)
30
+ RALPH_DIR="${RALPH_DIR:-.ralph}"
31
+ PROMPT_FILE="${PROMPT_FILE:-PROMPT.md}"
32
+
33
+ # Export for use in sourced files
34
+ export RALPH_DIR PROMPT_FILE RALPH_LIB RALPH_TEMPLATES
35
+
36
+ # Ensure minimal setup exists (in case postinstall was skipped or global install)
37
+ if [[ ! -d ".ralph" ]]; then
38
+ mkdir -p ".ralph/archive" ".ralph/screenshots"
39
+ fi
40
+ # Always ensure config.json exists and run auto-detection if newly created
41
+ if [[ ! -f ".ralph/config.json" ]]; then
42
+ echo '{}' > ".ralph/config.json"
43
+ # Run auto-detection (function is in init.sh, sourced below)
44
+ _ralph_needs_autoconfig=true
45
+ fi
46
+ [[ ! -f ".ralph/signs.json" ]] && echo '{"signs": []}' > ".ralph/signs.json"
47
+ if [[ ! -f "PROMPT.md" ]] && [[ -f "$RALPH_TEMPLATES/PROMPT.md" ]]; then
48
+ cp "$RALPH_TEMPLATES/PROMPT.md" "PROMPT.md"
49
+ fi
50
+
51
+ # Source function libraries
52
+ source "$RALPH_LIB/utils.sh"
53
+ source "$RALPH_LIB/init.sh"
54
+ source "$RALPH_LIB/setup.sh"
55
+ source "$RALPH_LIB/loop.sh"
56
+ source "$RALPH_LIB/verify.sh"
57
+ source "$RALPH_LIB/prd.sh"
58
+ source "$RALPH_LIB/signs.sh"
59
+
60
+ # Run auto-config if config.json was just created
61
+ if [[ "${_ralph_needs_autoconfig:-}" == "true" ]]; then
62
+ echo "Auto-detecting project configuration..." >&2
63
+ auto_configure_project
64
+ unset _ralph_needs_autoconfig
65
+ fi
66
+
67
+ # Main entry point
68
+ main() {
69
+ local cmd="${1:-help}"
70
+ shift || true
71
+
72
+ case "$cmd" in
73
+ setup)
74
+ ralph_setup "$@"
75
+ ;;
76
+ init)
77
+ ralph_init "$@"
78
+ ;;
79
+ prd)
80
+ ralph_prd "$@"
81
+ ;;
82
+ run)
83
+ # Clear any previous stop signal
84
+ rm -f "$RALPH_DIR/.stop"
85
+ run_loop "$@"
86
+ ;;
87
+ stop)
88
+ # Signal the loop to stop after current story
89
+ mkdir -p "$RALPH_DIR"
90
+ touch "$RALPH_DIR/.stop"
91
+ echo "Stop signal sent. Ralph will stop after current story completes."
92
+ echo "(Use Ctrl+C to force stop immediately)"
93
+ ;;
94
+ status)
95
+ ralph_status "$@"
96
+ ;;
97
+ check)
98
+ ralph_check "$@"
99
+ ;;
100
+ verify)
101
+ if [[ $# -lt 1 ]]; then
102
+ print_error "Usage: ralph verify <story-id>"
103
+ exit 1
104
+ fi
105
+ run_verification "$1"
106
+ ;;
107
+ sign)
108
+ ralph_sign "$@"
109
+ ;;
110
+ signs)
111
+ ralph_signs "$@"
112
+ ;;
113
+ unsign)
114
+ ralph_unsign "$@"
115
+ ;;
116
+ notify)
117
+ ralph_notify "$@"
118
+ ;;
119
+ backup)
120
+ source "$RALPH_LIB/backup.sh"
121
+ ralph_backup "$@"
122
+ ;;
123
+ restore)
124
+ source "$RALPH_LIB/backup.sh"
125
+ ralph_restore "$@"
126
+ ;;
127
+ backups)
128
+ source "$RALPH_LIB/backup.sh"
129
+ ralph_list_backups
130
+ ;;
131
+ hooks)
132
+ bash "$RALPH_LIB/hooks/install.sh" "$@"
133
+ ;;
134
+ progress)
135
+ if [[ -f "$RALPH_DIR/progress.txt" ]]; then
136
+ tail -50 "$RALPH_DIR/progress.txt"
137
+ else
138
+ echo "No progress log found. Run 'ralph init' first."
139
+ fi
140
+ ;;
141
+ config)
142
+ if [[ ! -f "$RALPH_DIR/config.json" ]]; then
143
+ print_error "Ralph not initialized. Run 'ralph init' first."
144
+ exit 1
145
+ fi
146
+ echo "Auto-detecting project configuration..."
147
+ auto_configure_project
148
+ echo ""
149
+ echo "Current config:"
150
+ jq '.' "$RALPH_DIR/config.json"
151
+ ;;
152
+ help|-h|--help)
153
+ ralph_help
154
+ ;;
155
+ version|-v|--version)
156
+ # Read version from package.json
157
+ local version
158
+ version=$(jq -r '.version // "unknown"' "$SCRIPT_DIR/../package.json" 2>/dev/null || echo "unknown")
159
+ echo "ralph $version (thrivekit)"
160
+ ;;
161
+ *)
162
+ print_error "Unknown command: $cmd"
163
+ echo ""
164
+ ralph_help
165
+ exit 1
166
+ ;;
167
+ esac
168
+ }
169
+
170
+ # Run main
171
+ main "$@"
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env bash
2
+ # shellcheck shell=bash
3
+ # thrivekit - Tools to thrive with agentic coding
4
+ #
5
+ # Main CLI - wraps ralph.sh for the autonomous dev loop.
6
+
7
+ set -euo pipefail
8
+
9
+ # Get the directory where this script is installed (handles symlinks)
10
+ get_script_dir() {
11
+ local source="${BASH_SOURCE[0]}"
12
+ while [[ -L "$source" ]]; do
13
+ local dir
14
+ dir=$(cd -P "$(dirname "$source")" && pwd)
15
+ source=$(readlink "$source")
16
+ [[ "$source" != /* ]] && source="$dir/$source"
17
+ done
18
+ cd -P "$(dirname "$source")" && pwd
19
+ }
20
+
21
+ SCRIPT_DIR="$(get_script_dir)"
22
+
23
+ # Pass through to ralph.sh
24
+ exec "$SCRIPT_DIR/ralph.sh" "$@"
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * vibe-check CLI
5
+ *
6
+ * Usage:
7
+ * npx vibe-check .
8
+ * npx vibe-check src/app.ts
9
+ * npx vibe-check . --only secrets,urls
10
+ * npx vibe-check . --skip any-types
11
+ * npx vibe-check . --format json
12
+ */
13
+
14
+ import { main } from '../dist/cli.js';
15
+
16
+ main(process.argv.slice(2)).catch((error) => {
17
+ console.error('Fatal error:', error.message);
18
+ process.exit(2);
19
+ });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Check for 'any' type usage in TypeScript
3
+ */
4
+ import type { Hook } from '../utils/types.js';
5
+ export declare const checkAnyTypes: Hook;
6
+ //# sourceMappingURL=check-any-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-any-types.d.ts","sourceRoot":"","sources":["../../src/checks/check-any-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAA2B,MAAM,mBAAmB,CAAC;AAEvE,eAAO,MAAM,aAAa,EAAE,IA8E3B,CAAC"}