Skip to content

Commit 044a61c

Browse files
nullcoderclaude
andauthored
docs: add CONTRIBUTING.md and update documentation references (#44)
- Create comprehensive CONTRIBUTING.md with: - Getting started guide - Development workflow - Code guidelines and standards - Testing requirements - PR process and checklist - Code of conduct - Communication channels - Update references in: - README.md: Update contributing section and add to docs list - docs/TODO.md: Mark contribution guidelines as completed - docs/LOCAL_DEVELOPMENT.md: Update Next Steps section - CLAUDE.md: Add reference to follow contribution guidelines 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5506a4a commit 044a61c

File tree

5 files changed

+272
-3
lines changed

5 files changed

+272
-3
lines changed

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ See `.env.example` for required Cloudflare R2 configuration.
6565
3. **Check limits**: Enforce size limits (500KB/file, 5MB/gist, 20 files)
6666
4. **Validate inputs**: Especially for user-provided content
6767
5. **Handle errors**: Provide clear error messages to users
68+
6. **Follow guidelines**: See `CONTRIBUTING.md` for development workflow
6869

6970
For detailed architecture, API specs, and data models, refer to `docs/SPEC.md`.
7071

CONTRIBUTING.md

Lines changed: 266 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
1+
# Contributing to GhostPaste
2+
3+
Thank you for your interest in contributing to GhostPaste! We welcome contributions from the community.
4+
5+
## 🚀 Getting Started
6+
7+
### Prerequisites
8+
9+
- Node.js 20+
10+
- npm 10+
11+
- Git
12+
- A Cloudflare account (for R2 storage testing)
13+
14+
### Local Development Setup
15+
16+
1. **Clone the repository**
17+
18+
```bash
19+
git clone https://github.com/nullcoder/ghostpaste.git
20+
cd ghostpaste
21+
```
22+
23+
2. **Install dependencies**
24+
25+
```bash
26+
npm install
27+
```
28+
29+
3. **Set up environment variables**
30+
31+
```bash
32+
cp .env.example .env.local
33+
```
34+
35+
Fill in your Cloudflare R2 credentials in `.env.local`
36+
37+
4. **Run development server**
38+
```bash
39+
npm run dev
40+
```
41+
42+
For detailed local development instructions, see [docs/LOCAL_DEVELOPMENT.md](docs/LOCAL_DEVELOPMENT.md).
43+
44+
## 📝 Development Workflow
45+
46+
### 1. Create an Issue
47+
48+
Before starting work:
49+
50+
- Check existing issues to avoid duplicates
51+
- Create a new issue describing your proposed change
52+
- Wait for maintainer feedback/approval
53+
54+
### 2. Create a Branch
55+
56+
```bash
57+
git checkout main
58+
git pull origin main
59+
git checkout -b feat/your-feature-name
60+
```
61+
62+
Branch naming conventions:
63+
64+
- `feat/` - New features
65+
- `fix/` - Bug fixes
66+
- `docs/` - Documentation changes
67+
- `refactor/` - Code refactoring
68+
- `test/` - Test additions/changes
69+
- `chore/` - Maintenance tasks
70+
71+
### 3. Make Your Changes
72+
73+
- Follow the existing code style
74+
- Add tests for new functionality
75+
- Update documentation as needed
76+
- Keep commits focused and atomic
77+
78+
### 4. Run Tests and Linting
79+
80+
Before committing:
81+
82+
```bash
83+
npm run test # Run unit tests
84+
npm run lint # Run ESLint
85+
npm run typecheck # Run TypeScript checks
86+
```
87+
88+
### 5. Commit Your Changes
89+
90+
We follow conventional commits:
91+
92+
```bash
93+
git commit -m "feat: add encryption key rotation"
94+
git commit -m "fix: resolve PIN validation issue"
95+
git commit -m "docs: update API documentation"
96+
```
97+
98+
### 6. Push and Create PR
99+
100+
```bash
101+
git push origin feat/your-feature-name
102+
```
103+
104+
Then create a pull request on GitHub with:
105+
106+
- Clear description of changes
107+
- Reference to related issue(s)
108+
- Screenshots for UI changes
109+
- Test results
110+
111+
## 🏗️ Code Guidelines
112+
113+
### TypeScript
114+
115+
- Use strict TypeScript settings
116+
- Define interfaces for all data structures
117+
- Avoid `any` types
118+
- Document complex types
119+
120+
### React/Next.js
121+
122+
- Use functional components with hooks
123+
- Follow Next.js 15 app router patterns
124+
- Keep components small and focused
125+
- Use shadcn/ui components when possible
126+
127+
### Security
128+
129+
- **NEVER** log encryption keys or sensitive data
130+
- **NEVER** send keys to the server
131+
- **ALWAYS** validate user input
132+
- **ALWAYS** use HTTPS in production
133+
- Follow zero-knowledge encryption principles
134+
135+
### Edge Runtime Compatibility
136+
137+
All code must be compatible with Cloudflare Workers:
138+
139+
- No Node.js-specific APIs
140+
- Use Web APIs (fetch, crypto, etc.)
141+
- Keep bundle sizes small
142+
- Respect CPU time limits (50ms)
143+
144+
## 🧪 Testing
145+
146+
### Unit Tests
147+
148+
- Write tests for all utility functions
149+
- Test error cases and edge conditions
150+
- Use Vitest for testing
151+
- Maintain >80% coverage for critical paths
152+
153+
### Integration Tests
154+
155+
- Test complete user flows
156+
- Verify encryption/decryption
157+
- Test API endpoints
158+
- Check error handling
159+
160+
### Manual Testing
161+
162+
Before submitting PR:
163+
164+
- [ ] Create a new gist
165+
- [ ] View shared gist
166+
- [ ] Edit with PIN
167+
- [ ] Test expiry features
168+
- [ ] Verify mobile responsiveness
169+
170+
## 📚 Documentation
171+
172+
### Code Documentation
173+
174+
- Add JSDoc comments for public APIs
175+
- Document complex algorithms
176+
- Include usage examples
177+
- Update README for new features
178+
179+
### Project Documentation
180+
181+
Update relevant docs:
182+
183+
- `README.md` - Project overview
184+
- `docs/SPEC.md` - Technical specifications
185+
- `docs/TODO.md` - Mark completed tasks
186+
- `CLAUDE.md` - AI assistant guidelines
187+
188+
## 🎯 Pull Request Process
189+
190+
1. **PR Title**: Use conventional commit format
191+
2. **Description**: Explain what and why
192+
3. **Testing**: Describe how you tested
193+
4. **Screenshots**: Include for UI changes
194+
5. **Review**: Address feedback promptly
195+
196+
### PR Checklist
197+
198+
- [ ] Tests pass locally
199+
- [ ] Linting passes
200+
- [ ] TypeScript checks pass
201+
- [ ] Documentation updated
202+
- [ ] No console.logs left
203+
- [ ] No commented code
204+
- [ ] Follows security guidelines
205+
206+
## 💡 Feature Requests
207+
208+
We welcome feature suggestions! Please:
209+
210+
- Open an issue with `[Feature Request]` prefix
211+
- Describe the use case
212+
- Explain expected behavior
213+
- Consider security implications
214+
215+
## 🐛 Bug Reports
216+
217+
When reporting bugs:
218+
219+
- Use the bug report template
220+
- Include reproduction steps
221+
- Provide browser/OS information
222+
- Include error messages
223+
- Add screenshots if applicable
224+
225+
## 🤝 Code of Conduct
226+
227+
### Be Respectful
228+
229+
- Treat everyone with respect
230+
- Welcome newcomers
231+
- Be patient with questions
232+
- Give constructive feedback
233+
234+
### Be Professional
235+
236+
- Stay on topic
237+
- Avoid offensive language
238+
- Respect differing opinions
239+
- Focus on what's best for the project
240+
241+
## 📬 Communication
242+
243+
- **Issues**: Bug reports and feature requests
244+
- **Discussions**: General questions and ideas
245+
- **Pull Requests**: Code contributions
246+
247+
## 🏆 Recognition
248+
249+
Contributors will be:
250+
251+
- Listed in the README
252+
- Credited in release notes
253+
- Thanked in commit messages
254+
255+
## ❓ Questions?
256+
257+
If you have questions:
258+
259+
1. Check existing documentation
260+
2. Search closed issues
261+
3. Ask in GitHub Discussions
262+
4. Tag @nullcoder for help
263+
264+
---
265+
266+
Thank you for contributing to GhostPaste! 👻

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,12 @@ npm run deploy
121121
- [Technical Specification](docs/SPEC.md) - Detailed architecture and implementation details
122122
- [AI Development Guide](CLAUDE.md) - Guidelines for AI-assisted development
123123
- [Implementation TODO](docs/TODO.md) - Development roadmap and progress tracking
124+
- [Contributing Guide](CONTRIBUTING.md) - How to contribute to the project
125+
- [Local Development](docs/LOCAL_DEVELOPMENT.md) - Setting up your development environment
124126

125127
## 🤝 Contributing
126128

127-
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) (coming soon).
129+
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for detailed information on how to contribute to this project.
128130

129131
1. Fork the repository
130132
2. Create a feature branch (`git checkout -b feature/amazing-feature`)

docs/LOCAL_DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,4 @@ For faster development of UI components, use `npm run dev` for Next.js hot reloa
186186

187187
- Check out the [Architecture Guide](./SPEC.md) to understand the system design
188188
- Review [Security Guidelines](./SPEC.md#security-considerations) for encryption implementation
189-
- See [Contributing Guide](../README.md#contributing) for code standards
189+
- See [Contributing Guide](../CONTRIBUTING.md) for code standards and development workflow

docs/TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ This document tracks the implementation progress of GhostPaste. Check off tasks
286286

287287
- [ ] Document API endpoints
288288
- [ ] Create architecture diagrams
289-
- [ ] Write contribution guidelines
289+
- [x] Write contribution guidelines
290290
- [ ] Add code style guide
291291
- [ ] Create development setup guide
292292

0 commit comments

Comments
 (0)