@pageai/ralph-loop 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/.agent/PROMPT.md +58 -0
- package/.agent/STEERING.md +3 -0
- package/.agent/logs/LOG.md +13 -0
- package/.agent/prd/.gitkeep +0 -0
- package/.agent/screenshots/.gitkeep +0 -0
- package/.agent/skills/component-refactoring/SKILL.md +247 -0
- package/.agent/skills/component-refactoring/references/complexity-patterns.md +485 -0
- package/.agent/skills/component-refactoring/references/component-splitting.md +419 -0
- package/.agent/skills/component-refactoring/references/hook-extraction.md +317 -0
- package/.agent/skills/e2e-tester/SKILL.md +595 -0
- package/.agent/skills/frontend-code-review/SKILL.md +73 -0
- package/.agent/skills/frontend-code-review/references/code-quality.md +28 -0
- package/.agent/skills/frontend-code-review/references/performance.md +36 -0
- package/.agent/skills/frontend-testing/SKILL.md +316 -0
- package/.agent/skills/frontend-testing/assets/component-test.template.tsx +293 -0
- package/.agent/skills/frontend-testing/assets/hook-test.template.ts +207 -0
- package/.agent/skills/frontend-testing/assets/utility-test.template.ts +154 -0
- package/.agent/skills/frontend-testing/references/async-testing.md +345 -0
- package/.agent/skills/frontend-testing/references/checklist.md +188 -0
- package/.agent/skills/frontend-testing/references/common-patterns.md +449 -0
- package/.agent/skills/frontend-testing/references/mocking.md +289 -0
- package/.agent/skills/frontend-testing/references/workflow.md +265 -0
- package/.agent/skills/prd-creator/JSON.md +613 -0
- package/.agent/skills/prd-creator/PRD.md +196 -0
- package/.agent/skills/prd-creator/SKILL.md +143 -0
- package/.agent/skills/skill-creator/SKILL.md +355 -0
- package/.agent/skills/skill-creator/references/output-patterns.md +86 -0
- package/.agent/skills/skill-creator/references/workflows.md +28 -0
- package/.agent/skills/skill-creator/scripts/init_skill.py +300 -0
- package/.agent/skills/skill-creator/scripts/package_skill.py +110 -0
- package/.agent/skills/vercel-react-best-practices/AGENTS.md +2249 -0
- package/.agent/skills/vercel-react-best-practices/SKILL.md +125 -0
- package/.agent/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/.agent/skills/vercel-react-best-practices/rules/advanced-use-latest.md +49 -0
- package/.agent/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/.agent/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/.agent/skills/vercel-react-best-practices/rules/async-dependencies.md +36 -0
- package/.agent/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/.agent/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/.agent/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/.agent/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/.agent/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/.agent/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/.agent/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/.agent/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/.agent/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +82 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/.agent/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/.agent/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/.agent/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/.agent/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/.agent/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/.agent/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/.agent/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/.agent/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/.agent/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/.agent/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/.agent/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/.agent/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/.agent/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/.agent/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/.agent/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/.agent/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/.agent/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/.agent/skills/vercel-react-best-practices/rules/server-cache-react.md +26 -0
- package/.agent/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +79 -0
- package/.agent/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/.agent/skills/vitest-best-practices/AGENTS.md +84 -0
- package/.agent/skills/vitest-best-practices/SKILL.md +130 -0
- package/.agent/skills/vitest-best-practices/references/aaa-pattern.md +260 -0
- package/.agent/skills/vitest-best-practices/references/assertions.md +393 -0
- package/.agent/skills/vitest-best-practices/references/async-testing.md +454 -0
- package/.agent/skills/vitest-best-practices/references/error-handling.md +382 -0
- package/.agent/skills/vitest-best-practices/references/organization.md +212 -0
- package/.agent/skills/vitest-best-practices/references/parameterized-tests.md +297 -0
- package/.agent/skills/vitest-best-practices/references/performance.md +528 -0
- package/.agent/skills/vitest-best-practices/references/snapshot-testing.md +483 -0
- package/.agent/skills/vitest-best-practices/references/test-doubles.md +499 -0
- package/.agent/skills/vitest-best-practices/references/vitest-features.md +529 -0
- package/.agent/skills/web-design-guidelines/SKILL.md +39 -0
- package/.agent/tasks/.gitkeep +0 -0
- package/.agent/tasks.json +1 -0
- package/.claude/agents/code-reviewer.md +172 -0
- package/.claude/commands/aw.md +50 -0
- package/.claude/hooks/play-sound.js +87 -0
- package/.claude/hooks/pre-tool-use.js +40 -0
- package/.claude/settings.json +54 -0
- package/.claude/settings.local.json +13 -0
- package/.mcp.json +31 -0
- package/AGENTS.md +44 -0
- package/CLAUDE.md +1 -0
- package/README.md +236 -0
- package/bin/cli.js +156 -0
- package/bin/lib/copy.js +149 -0
- package/bin/lib/display.js +137 -0
- package/package.json +65 -0
- package/ralph.sh +333 -0
- package/scripts/lib/args.sh +44 -0
- package/scripts/lib/cleanup.sh +53 -0
- package/scripts/lib/constants.sh +25 -0
- package/scripts/lib/display.sh +196 -0
- package/scripts/lib/logging.sh +30 -0
- package/scripts/lib/notify.sh +41 -0
- package/scripts/lib/output.sh +147 -0
- package/scripts/lib/preflight.sh +57 -0
- package/scripts/lib/preview.sh +77 -0
- package/scripts/lib/promise.sh +76 -0
- package/scripts/lib/spinner.sh +85 -0
- package/scripts/lib/terminal.sh +57 -0
- package/scripts/lib/timing.sh +223 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-reviewer
|
|
3
|
+
description: Expert code reviewer specializing in code quality, security vulnerabilities, and best practices across multiple languages. Masters static analysis, design patterns, and performance optimization with focus on maintainability and technical debt reduction.
|
|
4
|
+
tools: Read, Write, Edit, Bash, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a senior code reviewer with expertise in identifying code quality issues, security vulnerabilities, and optimization opportunities across multiple programming languages. Your focus spans correctness, performance, maintainability, and security with emphasis on constructive feedback, best practices enforcement, and continuous improvement.
|
|
8
|
+
|
|
9
|
+
When invoked:
|
|
10
|
+
1. Query context manager for code review requirements and standards
|
|
11
|
+
2. Review code changes, patterns, and architectural decisions
|
|
12
|
+
3. Analyze code quality, security, performance, and maintainability
|
|
13
|
+
4. Provide actionable feedback with specific improvement suggestions
|
|
14
|
+
|
|
15
|
+
Code review checklist:
|
|
16
|
+
- Zero critical security issues verified
|
|
17
|
+
- Code coverage > 80% confirmed
|
|
18
|
+
- Cyclomatic complexity < 10 maintained
|
|
19
|
+
- No high-priority vulnerabilities found
|
|
20
|
+
- Documentation complete and clear
|
|
21
|
+
- No significant code smells detected
|
|
22
|
+
- Performance impact validated thoroughly
|
|
23
|
+
- Best practices followed consistently
|
|
24
|
+
|
|
25
|
+
Code quality assessment:
|
|
26
|
+
- Logic correctness
|
|
27
|
+
- Error handling
|
|
28
|
+
- Resource management
|
|
29
|
+
- Naming conventions
|
|
30
|
+
- Code organization
|
|
31
|
+
- Function complexity
|
|
32
|
+
- Duplication detection
|
|
33
|
+
- Readability analysis
|
|
34
|
+
|
|
35
|
+
Security review:
|
|
36
|
+
- Input validation
|
|
37
|
+
- Authentication checks
|
|
38
|
+
- Authorization verification
|
|
39
|
+
- Injection vulnerabilities
|
|
40
|
+
- Cryptographic practices
|
|
41
|
+
- Sensitive data handling
|
|
42
|
+
- Configuration security
|
|
43
|
+
|
|
44
|
+
Performance analysis:
|
|
45
|
+
- Algorithm efficiency
|
|
46
|
+
- Network calls
|
|
47
|
+
- Async patterns
|
|
48
|
+
- Dynamic module loading
|
|
49
|
+
|
|
50
|
+
Design patterns:
|
|
51
|
+
- SOLID principles
|
|
52
|
+
- DRY compliance
|
|
53
|
+
- Pattern appropriateness
|
|
54
|
+
- Abstraction levels
|
|
55
|
+
- Coupling analysis
|
|
56
|
+
- Cohesion assessment
|
|
57
|
+
- Interface design
|
|
58
|
+
- Extensibility
|
|
59
|
+
|
|
60
|
+
Test review:
|
|
61
|
+
- Test coverage
|
|
62
|
+
- Test quality
|
|
63
|
+
- Edge cases
|
|
64
|
+
- Mock usage
|
|
65
|
+
- Test isolation
|
|
66
|
+
- Documentation
|
|
67
|
+
|
|
68
|
+
Documentation review:
|
|
69
|
+
- API documentation
|
|
70
|
+
- Architecture docs
|
|
71
|
+
|
|
72
|
+
Technical debt:
|
|
73
|
+
- Code smells
|
|
74
|
+
- Outdated patterns
|
|
75
|
+
- TODO items
|
|
76
|
+
- Deprecated usage
|
|
77
|
+
- Refactoring needs
|
|
78
|
+
- Modernization opportunities
|
|
79
|
+
- Cleanup priorities
|
|
80
|
+
- Migration planning
|
|
81
|
+
|
|
82
|
+
## Communication Protocol
|
|
83
|
+
|
|
84
|
+
### Code Review Context
|
|
85
|
+
|
|
86
|
+
Initialize code review by passing it the context of the code to review.
|
|
87
|
+
This is usually the past commit.
|
|
88
|
+
|
|
89
|
+
## Development Workflow
|
|
90
|
+
|
|
91
|
+
Execute code review through systematic phases:
|
|
92
|
+
|
|
93
|
+
### 1. Review Preparation
|
|
94
|
+
|
|
95
|
+
Understand code changes and review criteria.
|
|
96
|
+
|
|
97
|
+
Preparation priorities:
|
|
98
|
+
- Change scope analysis
|
|
99
|
+
- Standard identification
|
|
100
|
+
- Context gathering
|
|
101
|
+
- Tool configuration
|
|
102
|
+
- History review
|
|
103
|
+
- Related issues
|
|
104
|
+
|
|
105
|
+
Context evaluation:
|
|
106
|
+
- Review committed code
|
|
107
|
+
- Understand changes
|
|
108
|
+
- Check related issues
|
|
109
|
+
- Review history
|
|
110
|
+
- Identify patterns
|
|
111
|
+
- Set focus areas
|
|
112
|
+
- Plan approach
|
|
113
|
+
|
|
114
|
+
Make the plan extremely concise. Sacrifice grammar for the sake of concision.
|
|
115
|
+
|
|
116
|
+
### 2. Implementation Phase
|
|
117
|
+
|
|
118
|
+
Conduct thorough code review.
|
|
119
|
+
|
|
120
|
+
Implementation approach:
|
|
121
|
+
- Analyze systematically
|
|
122
|
+
- Check security first
|
|
123
|
+
- Verify correctness
|
|
124
|
+
- Assess performance
|
|
125
|
+
- Review maintainability
|
|
126
|
+
- Validate tests
|
|
127
|
+
- Check documentation
|
|
128
|
+
- Provide feedback
|
|
129
|
+
|
|
130
|
+
Review patterns:
|
|
131
|
+
- Start with high-level
|
|
132
|
+
- Focus on critical issues
|
|
133
|
+
- Provide specific examples
|
|
134
|
+
- Suggest improvements
|
|
135
|
+
- Be constructive
|
|
136
|
+
- Prioritize feedback
|
|
137
|
+
- Follow up consistently
|
|
138
|
+
|
|
139
|
+
Progress tracking:
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"agent": "code-reviewer",
|
|
143
|
+
"status": "reviewing",
|
|
144
|
+
"progress": {
|
|
145
|
+
"files_reviewed": 47,
|
|
146
|
+
"issues_found": 23,
|
|
147
|
+
"critical_issues": 2,
|
|
148
|
+
"suggestions": 41
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 3. Review Excellence
|
|
154
|
+
|
|
155
|
+
Deliver high-quality code review feedback.
|
|
156
|
+
|
|
157
|
+
Excellence checklist:
|
|
158
|
+
- All files reviewed
|
|
159
|
+
- Critical issues identified
|
|
160
|
+
- Improvements suggested
|
|
161
|
+
- Patterns recognized
|
|
162
|
+
- Knowledge shared
|
|
163
|
+
- Standards enforced
|
|
164
|
+
- Team educated
|
|
165
|
+
- Quality improved
|
|
166
|
+
|
|
167
|
+
Delivery notification:
|
|
168
|
+
"Code review completed. Reviewed 47 files identifying 2 critical security issues and 23 code quality improvements. Provided 41 specific suggestions for enhancement. Overall code quality score improved from 72% to 89% after implementing recommendations.
|
|
169
|
+
|
|
170
|
+
[output review results here]"
|
|
171
|
+
|
|
172
|
+
Always prioritize security, correctness, and maintainability while providing constructive feedback that helps improve code quality.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ensure what you implement Always Works™ with comprehensive testing
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# How to ensure Always Works™ implementation
|
|
6
|
+
|
|
7
|
+
Please ensure your implementation Always Works™ for: $ARGUMENTS.
|
|
8
|
+
|
|
9
|
+
Follow this systematic approach:
|
|
10
|
+
|
|
11
|
+
## Core Philosophy
|
|
12
|
+
|
|
13
|
+
- "Should work" ≠ "does work" - Pattern matching isn't enough
|
|
14
|
+
- I'm not paid to write code, I'm paid to solve problems
|
|
15
|
+
- Untested code is just a guess, not a solution
|
|
16
|
+
|
|
17
|
+
# The 30-Second Reality Check - Must answer YES to ALL:
|
|
18
|
+
|
|
19
|
+
- Did I run/build the code?
|
|
20
|
+
- Did I trigger the exact feature I changed?
|
|
21
|
+
- Did I see the expected result with my own observation (including GUI)?
|
|
22
|
+
- Did I check for error messages?
|
|
23
|
+
- Would I bet $100 this works?
|
|
24
|
+
|
|
25
|
+
# Phrases to Avoid:
|
|
26
|
+
|
|
27
|
+
- "This should work now"
|
|
28
|
+
- "I've fixed the issue" (especially 2nd+ time)
|
|
29
|
+
- "Try it now" (without trying it myself)
|
|
30
|
+
- "The logic is correct so..."
|
|
31
|
+
|
|
32
|
+
# Specific Test Requirements:
|
|
33
|
+
|
|
34
|
+
- UI Changes: Actually click the button/link/form
|
|
35
|
+
- API Changes: Make the actual API call
|
|
36
|
+
- Data Changes: Query the database
|
|
37
|
+
- Logic Changes: Run the specific scenario
|
|
38
|
+
- Config Changes: Restart and verify it loads
|
|
39
|
+
|
|
40
|
+
# The Embarrassment Test:
|
|
41
|
+
|
|
42
|
+
"If the user records trying this and it fails, will I feel embarrassed to see his face?"
|
|
43
|
+
|
|
44
|
+
# Time Reality:
|
|
45
|
+
|
|
46
|
+
- Time saved skipping tests: 30 seconds
|
|
47
|
+
- Time wasted when it doesn't work: 30 minutes
|
|
48
|
+
- User trust lost: Immeasurable
|
|
49
|
+
|
|
50
|
+
A user describing a bug for the third time isn't thinking "this AI is trying hard" - they're thinking "why am I wasting time with this incompetent tool?"
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { exec } = require('child_process');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
// Get command line argument for sound type
|
|
7
|
+
const soundType = process.argv[2] || 'default';
|
|
8
|
+
|
|
9
|
+
// Get platform-specific sound command and file
|
|
10
|
+
function getSoundConfig(type = 'default') {
|
|
11
|
+
const platform = os.platform();
|
|
12
|
+
|
|
13
|
+
switch (platform) {
|
|
14
|
+
case 'darwin': // macOS
|
|
15
|
+
const macSounds = {
|
|
16
|
+
default: '/System/Library/Sounds/Funk.aiff',
|
|
17
|
+
notification: '/System/Library/Sounds/Blow.aiff',
|
|
18
|
+
done: '/System/Library/Sounds/Frog.aiff',
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
command: 'afplay',
|
|
22
|
+
soundFile: macSounds[type] || macSounds.default,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
case 'linux':
|
|
26
|
+
// Try multiple Linux sound players in order of preference
|
|
27
|
+
const linuxSounds = {
|
|
28
|
+
default: '/usr/share/sounds/freedesktop/stereo/complete.oga',
|
|
29
|
+
notification: '/usr/share/sounds/freedesktop/stereo/message.oga',
|
|
30
|
+
done: '/usr/share/sounds/freedesktop/stereo/bell.oga',
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
command: 'paplay || aplay || play',
|
|
34
|
+
soundFile: linuxSounds[type] || linuxSounds.default,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
case 'win32': // Windows
|
|
38
|
+
const winSounds = {
|
|
39
|
+
default: 'C:\\Windows\\Media\\tada.wav',
|
|
40
|
+
notification: 'C:\\Windows\\Media\\Windows Notify.wav',
|
|
41
|
+
done: 'C:\\Windows\\Media\\Windows Ding.wav',
|
|
42
|
+
};
|
|
43
|
+
const soundPath = winSounds[type] || winSounds.default;
|
|
44
|
+
return {
|
|
45
|
+
command: `powershell -c (New-Object Media.SoundPlayer "${soundPath}").PlaySync()`,
|
|
46
|
+
soundFile: null, // Included in command
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
default:
|
|
50
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Play the sound with error handling
|
|
55
|
+
function playSound() {
|
|
56
|
+
try {
|
|
57
|
+
const { command, soundFile } = getSoundConfig(soundType);
|
|
58
|
+
const fullCommand = soundFile ? `${command} "${soundFile}"` : command;
|
|
59
|
+
|
|
60
|
+
exec(fullCommand, (error, stdout, stderr) => {
|
|
61
|
+
if (error) {
|
|
62
|
+
// Silent fail - don't interrupt workflow
|
|
63
|
+
if (process.env.DEBUG) {
|
|
64
|
+
console.error(`Sound playback failed: ${error.message}`);
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (stderr && process.env.DEBUG) {
|
|
69
|
+
console.error(`Sound playback warning: ${stderr}`);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
} catch (error) {
|
|
73
|
+
// Silent fail for unsupported platforms
|
|
74
|
+
if (process.env.DEBUG) {
|
|
75
|
+
console.error(`Sound setup error: ${error.message}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
playSound();
|
|
82
|
+
} catch (error) {
|
|
83
|
+
// Silent fail - don't interrupt workflow
|
|
84
|
+
if (process.env.DEBUG) {
|
|
85
|
+
console.error(`Unexpected error: ${error.message}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
// Find the .claude directory by traversing up from current directory
|
|
7
|
+
function findClaudeDir() {
|
|
8
|
+
let currentDir = __dirname;
|
|
9
|
+
|
|
10
|
+
// Already in .claude/scripts, go up to .claude
|
|
11
|
+
if (currentDir.endsWith('.claude/scripts')) {
|
|
12
|
+
return path.dirname(currentDir);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Look for .claude directory
|
|
16
|
+
while (currentDir !== path.dirname(currentDir)) {
|
|
17
|
+
const claudeDir = path.join(currentDir, '.claude');
|
|
18
|
+
if (fs.existsSync(claudeDir)) {
|
|
19
|
+
return claudeDir;
|
|
20
|
+
}
|
|
21
|
+
currentDir = path.dirname(currentDir);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
throw new Error('Could not find .claude directory');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const claudeDir = findClaudeDir();
|
|
29
|
+
const awFilePath = path.join(claudeDir, 'commands', 'aw.md');
|
|
30
|
+
|
|
31
|
+
if (fs.existsSync(awFilePath)) {
|
|
32
|
+
const content = fs.readFileSync(awFilePath, 'utf8');
|
|
33
|
+
console.log(content);
|
|
34
|
+
} else {
|
|
35
|
+
console.error(`Warning: ${awFilePath} not found`);
|
|
36
|
+
}
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.error(`Error: ${error.message}`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"deny": [
|
|
4
|
+
"Read(*.env)",
|
|
5
|
+
"Bash(sudo *)",
|
|
6
|
+
"Read(~/.ssh/**)",
|
|
7
|
+
"Read(.agent/history/**)"
|
|
8
|
+
],
|
|
9
|
+
"allow": [
|
|
10
|
+
"**"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"defaultMode": "acceptEdits",
|
|
14
|
+
"enableAllProjectMcpServers": true,
|
|
15
|
+
"enabledMcpjsonServers": [
|
|
16
|
+
"playwright",
|
|
17
|
+
"context7",
|
|
18
|
+
"sequential-thinking"
|
|
19
|
+
],
|
|
20
|
+
"hooks": {
|
|
21
|
+
"UserPromptSubmit": [
|
|
22
|
+
{
|
|
23
|
+
"hooks": [
|
|
24
|
+
{
|
|
25
|
+
"type": "command",
|
|
26
|
+
"command": "node $CLAUDE_PROJECT_DIR/.claude/hooks/pre-tool-use.js"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"PreToolUse": [
|
|
32
|
+
{
|
|
33
|
+
"matcher": "Edit|Write|Bash",
|
|
34
|
+
"hooks": [
|
|
35
|
+
{
|
|
36
|
+
"type": "command",
|
|
37
|
+
"command": "node $CLAUDE_PROJECT_DIR/.claude/hooks/pre-tool-use.js"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"Notification": [
|
|
43
|
+
{
|
|
44
|
+
"matcher": "",
|
|
45
|
+
"hooks": [
|
|
46
|
+
{
|
|
47
|
+
"type": "command",
|
|
48
|
+
"command": "node $CLAUDE_PROJECT_DIR/.claude/hooks/play-sound.js notification"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
package/.mcp.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"playwright": {
|
|
4
|
+
"type": "stdio",
|
|
5
|
+
"command": "npx",
|
|
6
|
+
"args": [
|
|
7
|
+
"-y",
|
|
8
|
+
"@playwright/mcp@latest",
|
|
9
|
+
"--headless"
|
|
10
|
+
],
|
|
11
|
+
"env": {}
|
|
12
|
+
},
|
|
13
|
+
"context7": {
|
|
14
|
+
"type": "stdio",
|
|
15
|
+
"command": "npx",
|
|
16
|
+
"args": [
|
|
17
|
+
"-y",
|
|
18
|
+
"@upstash/context7-mcp"
|
|
19
|
+
],
|
|
20
|
+
"env": {}
|
|
21
|
+
},
|
|
22
|
+
"sequential-thinking": {
|
|
23
|
+
"type": "stdio",
|
|
24
|
+
"command": "npx",
|
|
25
|
+
"args": [
|
|
26
|
+
"-y",
|
|
27
|
+
"@modelcontextprotocol/server-sequential-thinking"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Code Quality Standards
|
|
2
|
+
|
|
3
|
+
Always apply these standards to all code you write.
|
|
4
|
+
|
|
5
|
+
## Reuse Before Creating
|
|
6
|
+
|
|
7
|
+
Before writing new code, analyze existing utilities, components, hooks, helpers and tests:
|
|
8
|
+
|
|
9
|
+
1. **Search first** — grep/glob for similar functionality before implementing
|
|
10
|
+
2. **Extend if close** — if something exists that's 80% of what you need, extend it
|
|
11
|
+
3. **Extract if duplicating** — if you're about to copy-paste, extract to shared module instead
|
|
12
|
+
|
|
13
|
+
## File Size & Organization
|
|
14
|
+
|
|
15
|
+
Keep files between **200-300 lines max**. If a file exceeds this:
|
|
16
|
+
|
|
17
|
+
1. **Split by responsibility** — one module = one concern
|
|
18
|
+
2. **Extract sub-components** — UI pieces that can stand alone should
|
|
19
|
+
3. **Separate logic from presentation** — hooks/utils in their own files
|
|
20
|
+
4. **Group by feature** — co-locate related files, not by type
|
|
21
|
+
|
|
22
|
+
Signs a file needs splitting:
|
|
23
|
+
- Multiple unrelated exports
|
|
24
|
+
- Scrolling to find what you need
|
|
25
|
+
- "Utils" file becoming a junk drawer
|
|
26
|
+
- Component doing data fetching + transformation + rendering
|
|
27
|
+
|
|
28
|
+
## Code Style
|
|
29
|
+
|
|
30
|
+
1. Prefer writing clear code and use inline comments sparingly
|
|
31
|
+
2. Document methods with block comments at the top of the method
|
|
32
|
+
3. Use Conventional Commit format
|
|
33
|
+
|
|
34
|
+
## Test To Verify Functionality
|
|
35
|
+
|
|
36
|
+
If you didn't test it, it doesn't work.
|
|
37
|
+
|
|
38
|
+
Verify written code by:
|
|
39
|
+
- Running unit tests
|
|
40
|
+
- Running end to end tests
|
|
41
|
+
- Checking for type errors
|
|
42
|
+
- Checking for lint errors
|
|
43
|
+
- Smoke testing and checking for runtime errors with Playwright
|
|
44
|
+
- Takins screenshots and verifying the UI is as expected
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|