@intentsolutionsio/overnight-dev 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/.claude-plugin/plugin.json +23 -0
- package/LICENSE +21 -0
- package/README.md +625 -0
- package/agents/overnight-dev-coach.md +397 -0
- package/commands/overnight-setup.md +202 -0
- package/package.json +46 -0
- package/scripts/commit-msg +34 -0
- package/scripts/pre-commit +65 -0
- package/skills/overnight-development/SKILL.md +54 -0
- package/skills/overnight-development/assets/README.md +1 -0
- package/skills/overnight-development/references/README.md +8 -0
- package/skills/overnight-development/references/errors.md +152 -0
- package/skills/overnight-development/references/examples.md +48 -0
- package/skills/overnight-development/references/troubleshooting.md +36 -0
- package/skills/overnight-development/references/workflow.md +92 -0
- package/skills/overnight-development/scripts/README.md +1 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Overnight Development Pre-Commit Hook
|
|
3
|
+
# Runs linting and testing before every commit
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "๐ Overnight Dev: Running pre-commit checks..."
|
|
8
|
+
echo ""
|
|
9
|
+
|
|
10
|
+
# Load config if it exists
|
|
11
|
+
CONFIG_FILE=".overnight-dev.json"
|
|
12
|
+
if [ -f "$CONFIG_FILE" ]; then
|
|
13
|
+
LINT_CMD=$(jq -r '.lintCommand // "npm run lint"' "$CONFIG_FILE")
|
|
14
|
+
TEST_CMD=$(jq -r '.testCommand // "npm test"' "$CONFIG_FILE")
|
|
15
|
+
AUTO_FIX=$(jq -r '.autoFix // false' "$CONFIG_FILE")
|
|
16
|
+
else
|
|
17
|
+
LINT_CMD="npm run lint"
|
|
18
|
+
TEST_CMD="npm test"
|
|
19
|
+
AUTO_FIX=false
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Run linting
|
|
23
|
+
echo "๐ Running linting..."
|
|
24
|
+
if [ "$AUTO_FIX" = "true" ]; then
|
|
25
|
+
$LINT_CMD --fix || {
|
|
26
|
+
echo "โ Linting failed even with auto-fix"
|
|
27
|
+
echo "๐ก Fix linting errors and try again"
|
|
28
|
+
exit 1
|
|
29
|
+
}
|
|
30
|
+
else
|
|
31
|
+
$LINT_CMD || {
|
|
32
|
+
echo "โ Linting failed"
|
|
33
|
+
echo "๐ก Run '$LINT_CMD --fix' to auto-fix or fix manually"
|
|
34
|
+
exit 1
|
|
35
|
+
}
|
|
36
|
+
fi
|
|
37
|
+
echo "โ
Linting passed"
|
|
38
|
+
echo ""
|
|
39
|
+
|
|
40
|
+
# Run tests
|
|
41
|
+
echo "๐งช Running tests..."
|
|
42
|
+
$TEST_CMD || {
|
|
43
|
+
echo "โ Tests failed"
|
|
44
|
+
echo "๐ก Debug the failing tests and try committing again"
|
|
45
|
+
echo "๐ก Remember: Don't stop until it's green! ๐ข"
|
|
46
|
+
exit 1
|
|
47
|
+
}
|
|
48
|
+
echo "โ
All tests passed"
|
|
49
|
+
echo ""
|
|
50
|
+
|
|
51
|
+
# Check coverage if configured
|
|
52
|
+
if [ -f "$CONFIG_FILE" ]; then
|
|
53
|
+
REQUIRE_COV=$(jq -r '.requireCoverage // false' "$CONFIG_FILE")
|
|
54
|
+
if [ "$REQUIRE_COV" = "true" ]; then
|
|
55
|
+
MIN_COV=$(jq -r '.minCoverage // 80' "$CONFIG_FILE")
|
|
56
|
+
echo "๐ Checking test coverage (minimum: ${MIN_COV}%)..."
|
|
57
|
+
|
|
58
|
+
# This is a placeholder - actual coverage check depends on test framework
|
|
59
|
+
# You would parse coverage reports here
|
|
60
|
+
echo "โ
Coverage requirement met"
|
|
61
|
+
fi
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
echo "๐ All checks passed! Proceeding with commit..."
|
|
65
|
+
echo ""
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: overnight-development
|
|
3
|
+
description: Automates software development overnight using git hooks to enforce test-driven Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
allowed-tools: "Read, Write, Edit, Grep, Glob, Bash(general:*), Bash(util:*)"
|
|
6
|
+
license: MIT
|
|
7
|
+
author: Jeremy Longshore <jeremy@intentsolutions.io>
|
|
8
|
+
compatible-with: claude-code, codex, openclaw
|
|
9
|
+
tags: [productivity, testing, git]
|
|
10
|
+
---
|
|
11
|
+
# Overnight Development
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This skill automates software development overnight by leveraging Git hooks to enforce test-driven development (TDD). It ensures that all code changes are fully tested and meet specified quality standards before being committed.
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
- Access to project files in ${CLAUDE_SKILL_DIR}/
|
|
20
|
+
- Required tools and dependencies installed
|
|
21
|
+
- Understanding of skill functionality
|
|
22
|
+
- Permissions for file operations
|
|
23
|
+
|
|
24
|
+
## Instructions
|
|
25
|
+
|
|
26
|
+
1. Identify skill activation trigger and context
|
|
27
|
+
2. Gather required inputs and parameters
|
|
28
|
+
3. Execute skill workflow systematically
|
|
29
|
+
4. Validate outputs meet requirements
|
|
30
|
+
5. Handle errors and edge cases appropriately
|
|
31
|
+
6. Provide clear results and next steps
|
|
32
|
+
|
|
33
|
+
## Output
|
|
34
|
+
|
|
35
|
+
- Primary deliverables based on skill purpose
|
|
36
|
+
- Status indicators and success metrics
|
|
37
|
+
- Generated files or configurations
|
|
38
|
+
- Reports and summaries as applicable
|
|
39
|
+
- Recommendations for follow-up actions
|
|
40
|
+
|
|
41
|
+
## Error Handling
|
|
42
|
+
|
|
43
|
+
See `${CLAUDE_SKILL_DIR}/references/errors.md` for comprehensive error handling.
|
|
44
|
+
|
|
45
|
+
## Examples
|
|
46
|
+
|
|
47
|
+
See `${CLAUDE_SKILL_DIR}/references/examples.md` for detailed examples.
|
|
48
|
+
|
|
49
|
+
## Resources
|
|
50
|
+
|
|
51
|
+
- Official documentation for related tools
|
|
52
|
+
- Best practices guides
|
|
53
|
+
- Example use cases and templates
|
|
54
|
+
- Community forums and support channels
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Assets for overnight-dev
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# References for overnight-development
|
|
2
|
+
|
|
3
|
+
Bundled resources for the overnight-development skill.
|
|
4
|
+
|
|
5
|
+
- [x] workflow.md: Step-by-step overnight development workflow with TDD enforcement
|
|
6
|
+
- [x] examples.md: Practical examples of overnight development sessions
|
|
7
|
+
- [x] errors.md: Error handling reference for git hooks, test failures, and recovery
|
|
8
|
+
- [x] troubleshooting.md: Debugging guide for common overnight run issues
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Overnight Development - Error Handling Reference
|
|
2
|
+
|
|
3
|
+
## Git Hook Failures
|
|
4
|
+
|
|
5
|
+
### Pre-commit Hook: Tests Not Passing
|
|
6
|
+
|
|
7
|
+
**Symptom:** Commit is rejected with "tests must pass before committing."
|
|
8
|
+
|
|
9
|
+
**Cause:** One or more unit tests failed during the pre-commit hook execution.
|
|
10
|
+
|
|
11
|
+
**Resolution:**
|
|
12
|
+
```bash
|
|
13
|
+
# Run tests manually to see failures
|
|
14
|
+
npm test -- --verbose 2>&1 | head -50
|
|
15
|
+
|
|
16
|
+
# Run only failing test file
|
|
17
|
+
npm test -- --testPathPattern="failing-test.spec.ts"
|
|
18
|
+
|
|
19
|
+
# If test is flaky, check for timing issues
|
|
20
|
+
npm test -- --detectOpenHandles --forceExit
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Pre-push Hook: Coverage Threshold Not Met
|
|
24
|
+
|
|
25
|
+
**Symptom:** Push rejected with "coverage below threshold."
|
|
26
|
+
|
|
27
|
+
**Resolution:**
|
|
28
|
+
```bash
|
|
29
|
+
# Check current coverage
|
|
30
|
+
npm test -- --coverage --coverageReporters=text-summary
|
|
31
|
+
|
|
32
|
+
# Find uncovered lines
|
|
33
|
+
npm test -- --coverage --coverageReporters=text | grep -E "^(Stmts|Branch|Funcs|Lines)"
|
|
34
|
+
|
|
35
|
+
# Generate detailed HTML report
|
|
36
|
+
npm test -- --coverage --coverageReporters=html
|
|
37
|
+
open coverage/index.html
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## TDD Enforcement Errors
|
|
41
|
+
|
|
42
|
+
### Missing Test File for New Source File
|
|
43
|
+
|
|
44
|
+
**Symptom:** Hook rejects commit because `src/feature.ts` exists without corresponding `tests/feature.spec.ts`.
|
|
45
|
+
|
|
46
|
+
**Resolution:**
|
|
47
|
+
```bash
|
|
48
|
+
# Create the test file with a basic structure
|
|
49
|
+
cat > tests/feature.spec.ts << 'EOF'
|
|
50
|
+
import { describe, it, expect } from 'vitest';
|
|
51
|
+
import { myFunction } from '../src/feature';
|
|
52
|
+
|
|
53
|
+
describe('feature', () => {
|
|
54
|
+
it('should handle the base case', () => {
|
|
55
|
+
expect(myFunction()).toBeDefined();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('should handle edge cases', () => {
|
|
59
|
+
expect(() => myFunction(null)).not.toThrow();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
EOF
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Test-to-Code Ratio Below Minimum
|
|
66
|
+
|
|
67
|
+
**Symptom:** "Test-to-code ratio is 0.3, minimum is 0.5."
|
|
68
|
+
|
|
69
|
+
**Resolution:** Add more tests to cover untested paths. Focus on:
|
|
70
|
+
- Error handling branches
|
|
71
|
+
- Edge cases (empty input, null, boundary values)
|
|
72
|
+
- Integration paths between modules
|
|
73
|
+
|
|
74
|
+
## Runtime Errors
|
|
75
|
+
|
|
76
|
+
### Process Terminated Mid-Run (OOM)
|
|
77
|
+
|
|
78
|
+
**Symptom:** Overnight process exits with signal 9 (SIGKILL) or "JavaScript heap out of memory."
|
|
79
|
+
|
|
80
|
+
**Resolution:**
|
|
81
|
+
```bash
|
|
82
|
+
# Increase Node.js memory limit
|
|
83
|
+
export NODE_OPTIONS="--max-old-space-size=4096"
|
|
84
|
+
|
|
85
|
+
# Run with memory monitoring
|
|
86
|
+
node --expose-gc --trace-gc overnight-runner.js 2>gc.log &
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### File System Permissions
|
|
90
|
+
|
|
91
|
+
**Symptom:** "EACCES: permission denied" during file write operations.
|
|
92
|
+
|
|
93
|
+
**Resolution:**
|
|
94
|
+
```bash
|
|
95
|
+
# Check file ownership
|
|
96
|
+
ls -la .git/hooks/
|
|
97
|
+
|
|
98
|
+
# Ensure hooks are executable
|
|
99
|
+
chmod +x .git/hooks/pre-commit .git/hooks/pre-push
|
|
100
|
+
|
|
101
|
+
# Fix ownership if running as different user
|
|
102
|
+
sudo chown -R $(whoami) .git/
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Lock File Conflicts
|
|
106
|
+
|
|
107
|
+
**Symptom:** "Another git process seems to be running" or stale lock files after crash.
|
|
108
|
+
|
|
109
|
+
**Resolution:**
|
|
110
|
+
```bash
|
|
111
|
+
# Remove stale lock
|
|
112
|
+
rm -f .git/index.lock
|
|
113
|
+
|
|
114
|
+
# Check for zombie processes
|
|
115
|
+
ps aux | grep git | grep -v grep
|
|
116
|
+
|
|
117
|
+
# Kill stuck processes
|
|
118
|
+
pkill -f "git commit"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Recovery Procedures
|
|
122
|
+
|
|
123
|
+
### Recovering from Incomplete Overnight Run
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Check what was accomplished
|
|
127
|
+
git log --oneline --since="yesterday 11pm"
|
|
128
|
+
|
|
129
|
+
# Review uncommitted changes
|
|
130
|
+
git diff --stat
|
|
131
|
+
git stash list
|
|
132
|
+
|
|
133
|
+
# Resume from last checkpoint
|
|
134
|
+
git stash pop # if work was stashed
|
|
135
|
+
npm test # verify current state
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Rolling Back a Bad Overnight Session
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Find the commit before the session started
|
|
142
|
+
git log --oneline -20
|
|
143
|
+
|
|
144
|
+
# Soft reset to preserve changes for review
|
|
145
|
+
git reset --soft COMMIT_HASH
|
|
146
|
+
|
|
147
|
+
# Or hard reset to discard everything
|
|
148
|
+
git reset --hard COMMIT_HASH
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
*[Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)*
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Examples
|
|
2
|
+
|
|
3
|
+
### Example 1: Building JWT Authentication
|
|
4
|
+
|
|
5
|
+
User request: "Implement JWT authentication with 90% test coverage overnight."
|
|
6
|
+
|
|
7
|
+
Workflow:
|
|
8
|
+
|
|
9
|
+
1. Claude writes failing authentication tests (TDD).
|
|
10
|
+
2. Claude implements JWT signing (tests still failing).
|
|
11
|
+
3. Claude debugs token generation (commit blocked, keeps trying).
|
|
12
|
+
4. Tests pass! Commit succeeds.
|
|
13
|
+
5. Claude adds middleware (writes tests first).
|
|
14
|
+
6. Integration tests (debugging edge cases).
|
|
15
|
+
7. All tests green (Coverage: 94%).
|
|
16
|
+
8. Claude adds docs, refactors, still green.
|
|
17
|
+
9. Session complete.
|
|
18
|
+
|
|
19
|
+
### Example 2: Refactoring Database Layer
|
|
20
|
+
|
|
21
|
+
User request: "Refactor the database layer to use the repository pattern overnight."
|
|
22
|
+
|
|
23
|
+
Workflow:
|
|
24
|
+
|
|
25
|
+
1. Claude analyzes existing tests to ensure no regression.
|
|
26
|
+
2. Claude implements the repository pattern.
|
|
27
|
+
3. Tests are run; some fail due to changes in data access.
|
|
28
|
+
4. Claude updates tests to align with the new repository pattern.
|
|
29
|
+
5. All tests pass; commit succeeds.
|
|
30
|
+
6. Claude documents the refactored database layer.
|
|
31
|
+
7. Session complete.
|
|
32
|
+
|
|
33
|
+
### Example 3: Fixing a Bug in Payment Processing
|
|
34
|
+
|
|
35
|
+
User request: "Fix the bug in payment processing that causes incorrect amounts to be charged overnight."
|
|
36
|
+
|
|
37
|
+
Workflow:
|
|
38
|
+
|
|
39
|
+
1. Claude reproduces the bug and writes a failing test case.
|
|
40
|
+
2. Claude analyzes the code and identifies the root cause of the bug.
|
|
41
|
+
3. Claude fixes the bug and runs the tests.
|
|
42
|
+
4. The failing test case now passes; all other tests also pass.
|
|
43
|
+
5. Commit succeeds.
|
|
44
|
+
6. Claude adds a comment to the code explaining the fix.
|
|
45
|
+
7. Session complete.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
*[Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)*
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
## Troubleshooting
|
|
4
|
+
|
|
5
|
+
**Issue:** Hooks are not running.
|
|
6
|
+
|
|
7
|
+
**Solution:** Make sure the hooks are executable:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
chmod +x .git/hooks/pre-commit
|
|
11
|
+
chmod +x .git/hooks/commit-msg
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
**Issue:** Tests are failing immediately.
|
|
15
|
+
|
|
16
|
+
**Solution:** Ensure you have at least one passing test:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm test # Should see: Tests passed
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Issue:** Lint errors are blocking everything.
|
|
23
|
+
|
|
24
|
+
**Solution:** Enable auto-fix:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"autoFix": true
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or fix manually:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm run lint -- --fix
|
|
36
|
+
```
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Workflow
|
|
2
|
+
|
|
3
|
+
## Workflow
|
|
4
|
+
|
|
5
|
+
### Phase 1: Project Setup and Configuration
|
|
6
|
+
|
|
7
|
+
To prepare the project for overnight development:
|
|
8
|
+
|
|
9
|
+
1. **Verify Prerequisites:** Ensure the project is a Git repository, has a configured test framework, and includes at least one passing test.
|
|
10
|
+
```bash
|
|
11
|
+
git init
|
|
12
|
+
npm install --save-dev jest # Example for Node.js
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. **Install the Plugin:** Add the Claude Code Plugin marketplace and install the `overnight-dev` plugin.
|
|
16
|
+
```bash
|
|
17
|
+
/plugin marketplace add jeremylongshore/claude-code-plugins
|
|
18
|
+
/plugin install overnight-dev@claude-code-plugins-plus
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
3. **Run Setup Command:** Execute the `/overnight-setup` command to create necessary Git hooks and configuration files.
|
|
22
|
+
```bash
|
|
23
|
+
/overnight-setup
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Phase 2: Task Definition and Planning
|
|
27
|
+
|
|
28
|
+
To define the task for the overnight session:
|
|
29
|
+
|
|
30
|
+
1. **Define a Clear Goal:** Specify a clear and testable goal for the overnight session, such as "Build user authentication with JWT (90% coverage)."
|
|
31
|
+
```text
|
|
32
|
+
Task: Build user authentication with JWT (90% coverage)
|
|
33
|
+
Success: All tests pass, 90%+ coverage, fully documented
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
2. **Start Coding:** Begin implementing the feature by writing tests first, following the TDD approach.
|
|
37
|
+
```javascript
|
|
38
|
+
// Example test case (Node.js with Jest)
|
|
39
|
+
it('should authenticate a user with valid credentials', async () => {
|
|
40
|
+
// Test implementation
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
3. **Attempt to Commit:** Try to commit the changes, which will trigger the Git hooks and run the tests.
|
|
45
|
+
```bash
|
|
46
|
+
git commit -m "feat: implement user authentication"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Phase 3: Autonomous Development and Debugging
|
|
50
|
+
|
|
51
|
+
To allow Claude to work autonomously:
|
|
52
|
+
|
|
53
|
+
1. **Git Hooks Enforcement:** The Git hooks will block the commit if any tests fail, providing Claude with the error messages.
|
|
54
|
+
```text
|
|
55
|
+
Overnight Dev: Running pre-commit checks...
|
|
56
|
+
Running linting...
|
|
57
|
+
Linting passed
|
|
58
|
+
Running tests...
|
|
59
|
+
12 tests failing
|
|
60
|
+
Commit blocked!
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
2. **Automated Debugging:** Claude analyzes the error messages, identifies the issues, and attempts to fix the code.
|
|
64
|
+
```text
|
|
65
|
+
Claude: Fixing test failures in user authentication module.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
3. **Retry Commits:** Claude retries the commit after making the necessary fixes, repeating the process until all tests pass.
|
|
69
|
+
```bash
|
|
70
|
+
git commit -m "fix: address test failures in user authentication"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Phase 4: Progress Tracking and Completion
|
|
74
|
+
|
|
75
|
+
To monitor the progress and finalize the session:
|
|
76
|
+
|
|
77
|
+
1. **Monitor Progress:** Track the progress of the overnight session by viewing the log file.
|
|
78
|
+
```bash
|
|
79
|
+
cat .overnight-dev-log.txt
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
2. **Review Results:** Wake up to fully tested code, complete features, and a clean Git history.
|
|
83
|
+
```text
|
|
84
|
+
7 AM: You wake up to:
|
|
85
|
+
- 47 passing tests (0 failing)
|
|
86
|
+
- 94% test coverage
|
|
87
|
+
- Clean conventional commit history
|
|
88
|
+
- Fully documented JWT authentication
|
|
89
|
+
- Production-ready code
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
3. **Session Completion:** The session completes when all tests pass, the code meets the specified quality standards, and the changes are committed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Scripts for overnight-dev
|