Skip to content

Commit 98f2baa

Browse files
shikendonclaude
andauthored
docs: add CONTRIBUTING.md and CLAUDE.md (#14)
- Download CONTRIBUTING.md from source of truth - Create CLAUDE.md with AI assistant guidelines - Include project-specific workflow and standards Co-authored-by: Claude <[email protected]>
1 parent 39fe389 commit 98f2baa

File tree

2 files changed

+192
-0
lines changed

2 files changed

+192
-0
lines changed

CLAUDE.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Claude AI Assistant Guidelines
2+
3+
This document provides guidelines for AI assistants (particularly Claude) when working on the coreprotect-ruby project.
4+
5+
## Project Overview
6+
7+
**coreprotect-ruby** is a Ruby utility for purging old CoreProtect data in production environments.
8+
9+
- **Language**: Ruby
10+
- **Purpose**: Database cleanup utility for Minecraft CoreProtect plugin data
11+
- **Status**: In development - use with caution
12+
13+
## Critical Prerequisites
14+
15+
### 1. ALWAYS Verify CONTRIBUTING.md First
16+
17+
Before ANY work:
18+
```bash
19+
# Check if CONTRIBUTING.md is up-to-date
20+
curl -s https://denpaio.github.io/CONTRIBUTING.md | diff CONTRIBUTING.md -
21+
22+
# If outdated, update it first
23+
curl -o CONTRIBUTING.md https://denpaio.github.io/CONTRIBUTING.md
24+
```
25+
26+
**Source of Truth**: https://denpaio.github.io/CONTRIBUTING.md
27+
28+
### 2. Follow Contribution Standards
29+
30+
All standards in `CONTRIBUTING.md` are MANDATORY:
31+
- ✅ Code comments in English (or follow existing context)
32+
- ✅ Follow Rubocop conventions (`.rubocop.yml`)
33+
- ✅ Use Conventional Commits format
34+
- ✅ Run linters before committing
35+
- ✅ Ensure all tests pass
36+
37+
## Development Workflow
38+
39+
### Before Making Changes
40+
41+
1. **Verify CONTRIBUTING.md** is current (see above)
42+
2. **Read relevant code** - Never propose changes to unread code
43+
3. **Check existing conventions** in the codebase
44+
4. **Run linters** to understand current state
45+
46+
### During Development
47+
48+
```bash
49+
# Run Rubocop with auto-fix
50+
rubocop -A
51+
52+
# Run tests (if available)
53+
bundle exec rake test
54+
# or
55+
bundle exec rspec
56+
```
57+
58+
### Before Committing
59+
60+
1. **Lint the code**:
61+
```bash
62+
rubocop -A
63+
```
64+
65+
2. **Verify tests pass**
66+
67+
3. **Use Conventional Commit format**:
68+
```
69+
type(scope): description
70+
71+
Examples:
72+
feat(purge): add support for filtering by action type
73+
fix(database): resolve connection timeout issue
74+
docs(readme): update installation instructions
75+
refactor(cli): simplify argument parsing
76+
```
77+
78+
### Commit Types
79+
- `feat`: New feature
80+
- `fix`: Bug fix
81+
- `docs`: Documentation changes
82+
- `style`: Code style changes (formatting, etc.)
83+
- `refactor`: Code refactoring
84+
- `test`: Adding or updating tests
85+
- `chore`: Maintenance tasks
86+
87+
## Project-Specific Guidelines
88+
89+
### Ruby Standards
90+
- Follow Rubocop rules defined in `.rubocop.yml`
91+
- Prefer self-documenting code over comments
92+
- Use Ruby idioms and best practices
93+
94+
### Database Operations
95+
- Be extremely careful with purge operations
96+
- Always validate timestamps and filters
97+
- Consider data safety in all changes
98+
99+
### CLI Interface
100+
- Maintain consistency with existing Thor command structure
101+
- Provide clear help messages
102+
- Validate user input thoroughly
103+
104+
## Code Review Checklist
105+
106+
Before marking work complete:
107+
- [ ] CONTRIBUTING.md is up-to-date
108+
- [ ] All changes follow Rubocop conventions
109+
- [ ] Tests pass (if applicable)
110+
- [ ] Commit messages follow Conventional Commits
111+
- [ ] Code is self-documenting
112+
- [ ] No security vulnerabilities introduced
113+
- [ ] Database operations are safe and validated
114+
115+
## Resources
116+
117+
- **CONTRIBUTING.md**: Project contribution guidelines (MUST be current)
118+
- **README.md**: Project documentation and usage examples
119+
- **Conventional Commits**: https://www.conventionalcommits.org/
120+
- **Rubocop**: https://rubocop.org/
121+
122+
---
123+
124+
**Remember**: Quality over speed. Always verify standards compliance before completing any task.

CONTRIBUTING.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Contributing Guidelines
2+
3+
> **⚠️ Source of Truth**: [CONTRIBUTING.md](https://denpaio.github.io/CONTRIBUTING.md)
4+
>
5+
> **MANDATORY: Version Check Before Any Work**:
6+
> - **ALWAYS verify this file matches the source before making any changes**
7+
> - If outdated, MUST update to latest version first via PR
8+
> - To check: `curl -s https://denpaio.github.io/CONTRIBUTING.md | diff CONTRIBUTING.md -`
9+
> - To sync: `curl -o CONTRIBUTING.md https://denpaio.github.io/CONTRIBUTING.md`
10+
> - DO NOT modify this file directly - all changes must be made in the source
11+
> - After source updates, submit a PR to update this repository's copy
12+
13+
## Code Standards
14+
15+
### Language & Documentation
16+
- **Code comments**: English preferred, but follow existing context
17+
- **Documentation**: English preferred
18+
- **Principle**: Self-documenting code over redundant comments
19+
20+
### Style Enforcement
21+
- **Ruby**: Follow Rubocop conventions (`.rubocop.yml`)
22+
- **JavaScript**: Follow ESLint conventions (`.eslintrc`)
23+
- **Python**: Follow PEP 8 conventions
24+
- **Go**: Follow gofmt conventions
25+
- **Java**: Follow [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html)
26+
27+
### Commit Messages
28+
- Follow [Conventional Commits](https://www.conventionalcommits.org/) specification
29+
30+
## Workflow
31+
32+
1. Run linters before committing:
33+
```bash
34+
# Ruby
35+
rubocop -A
36+
37+
# JavaScript
38+
eslint --fix .
39+
40+
# Python
41+
black . && isort .
42+
43+
# Go
44+
gofmt -w .
45+
46+
# Java
47+
# Use google-java-format plugin in your IDE or:
48+
# java -jar google-java-format.jar --replace src/**/*.java
49+
50+
# Terraform
51+
terraform fmt -recursive
52+
terraform validate
53+
tflint
54+
55+
# Helm
56+
helm lint helm/*/
57+
58+
# YAML
59+
yamllint .
60+
```
61+
62+
2. Ensure all tests pass
63+
3. Write clear, self-documenting code
64+
4. Commit with conventional format: `type(scope): description`
65+
66+
---
67+
68+
<!-- For Claude Code: CRITICAL - Before any work, verify CONTRIBUTING.md is up-to-date with source. If outdated, stop and request update via PR first. Strictly follow all standards above. Verify linter compliance before marking tasks complete. -->

0 commit comments

Comments
 (0)