Terima kasih telah tertarik untuk berkontribusi pada PromptCraft! 🎉
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Commit Guidelines
- Pull Request Process
- Bug Reports
- Feature Requests
Dengan berpartisipasi dalam project ini, Anda setuju untuk menjaga lingkungan yang ramah dan inklusif. Harap bersikap sopan dan menghormati semua kontributor.
- Node.js 14+ installed
- Git installed
- Supabase account
- OpenRouter API key
- Code editor (VS Code recommended)
-
Fork repository
# Click "Fork" di GitHub -
Clone fork Anda
git clone https://github.com/YOUR_USERNAME/promptcraft.git cd promptcraft -
Add upstream remote
git remote add upstream https://github.com/ORIGINAL_OWNER/promptcraft.git
-
Install dependencies
npm install
-
Setup environment
copy .env.example .env.local # Edit .env.local dengan credentials Anda -
Run development server
npm run dev
# Update main branch
git checkout main
git pull upstream main
# Create feature branch
git checkout -b feature/amazing-feature
# or
git checkout -b fix/bug-descriptionfeature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringstyle/- UI/styling changestest/- Adding testschore/- Maintenance tasks
- Write clean, readable code
- Follow coding standards (see below)
- Add comments for complex logic
- Update documentation if needed
- Test your changes thoroughly
# Run linter
npm run lint
# Build project
npm run build
# Test locally
npm run devgit add .
git commit -m "feat: add amazing feature"See Commit Guidelines for commit message format.
git push origin feature/amazing-feature- Go to your fork on GitHub
- Click "New Pull Request"
- Select your branch
- Fill in PR template
- Submit PR
- Use ES6+ syntax
- Use functional components with hooks
- Use arrow functions
- Use destructuring where appropriate
- Avoid nested ternaries
- Keep functions small and focused
// ✅ Good
const MyComponent = ({ user, onUpdate }) => {
const [loading, setLoading] = useState(false);
const handleSubmit = async (data) => {
setLoading(true);
try {
await onUpdate(data);
} catch (error) {
console.error(error);
} finally {
setLoading(false);
}
};
return (
<div className="glass-card">
{loading ? <Spinner /> : <Form onSubmit={handleSubmit} />}
</div>
);
};
// ❌ Bad
function MyComponent(props) {
var loading = false;
function handleSubmit(data) {
loading = true;
props.onUpdate(data).then(function () {
loading = false;
});
}
return (
<div>
{loading == true ? <Spinner /> : <Form onSubmit={handleSubmit} />}
</div>
);
}- Use Tailwind utility classes first
- Create custom classes in
globals.cssfor reusable patterns - Follow mobile-first approach
- Use CSS variables for theming
- Keep specificity low
// ✅ Good
<button className="glass-card hover-scale px-6 py-3 rounded-lg">
Click me
</button>
// ❌ Bad
<button style={{
background: 'rgba(255,255,255,0.1)',
padding: '12px 24px',
borderRadius: '8px'
}}>
Click me
</button>app/
feature/
page.jsx # Main page component
layout.jsx # Layout if needed
loading.jsx # Loading state
error.jsx # Error boundary
components/
FeatureName.jsx # Component file
lib/
featureName.js # Utility functions
- Components: PascalCase (
MyComponent.jsx) - Functions: camelCase (
handleSubmit) - Constants: UPPER_SNAKE_CASE (
API_URL) - Files: camelCase (
utils.js) or PascalCase (MyComponent.jsx) - CSS Classes: kebab-case (
glass-card)
We follow Conventional Commits.
<type>(<scope>): <subject>
<body>
<footer>
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringperf: Performance improvementstest: Adding testschore: Maintenance tasksci: CI/CD changes
# Feature
git commit -m "feat(auth): add Google OAuth integration"
# Bug fix
git commit -m "fix(navbar): resolve mobile menu closing issue"
# Documentation
git commit -m "docs(readme): update installation instructions"
# Refactor
git commit -m "refactor(hooks): simplify useDebounce implementation"
# Multiple changes
git commit -m "feat(marketplace): add template filtering
- Add category filter
- Add search functionality
- Add sorting options
Closes #123"- Code follows style guidelines
- Self-review completed
- Comments added for complex code
- Documentation updated
- No console errors
- Tested on multiple browsers
- Tested on mobile devices
- Build succeeds (
npm run build)
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## How to Test
1. Step 1
2. Step 2
3. Expected result
## Screenshots (if applicable)
Add screenshots here
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-reviewed
- [ ] Commented complex code
- [ ] Updated documentation
- [ ] No new warnings
- [ ] Tested thoroughly- Maintainer reviews code
- Automated tests run
- Feedback provided (if needed)
- Changes requested (if needed)
- Approved and merged
- Search existing issues
- Try latest version
- Collect error messages
- Prepare reproduction steps
**Describe the bug**
Clear description of the bug
**To Reproduce**
1. Go to '...'
2. Click on '...'
3. See error
**Expected behavior**
What should happen
**Screenshots**
If applicable
**Environment:**
- OS: [e.g. Windows 11]
- Browser: [e.g. Chrome 120]
- Version: [e.g. 2.0.0]
**Additional context**
Any other information- Search existing requests
- Check roadmap
- Consider if it fits project scope
**Is your feature request related to a problem?**
Clear description of the problem
**Describe the solution you'd like**
Clear description of desired solution
**Describe alternatives you've considered**
Alternative solutions
**Additional context**
Mockups, examples, etc.# Check code style
npm run lint
# Build for production
npm run build
# Start production server
npm run start
# Clear cache
rm -rf .next// Use console.log sparingly
console.log("Debug:", variable);
// Use debugger
debugger;
// Use React DevTools
// Install browser extension- Test in development mode
- Test production build
- Test on different browsers
- Test on mobile devices
- Test with slow network
- Test with disabled JavaScript
- 📧 Email: dev@promptcraft.app
- 💬 Discord: https://discord.gg/promptcraft
- 📖 Docs: README.md
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to PromptCraft! 🎉
Every contribution, no matter how small, is appreciated!