Thank you for considering contributing to MCP Task Tracker! This document provides guidelines for contributing to the project.
-
Fork the repository
git clone https://github.com/techbuzzz/agent-shaker.git cd agent-shaker -
Set up development environment
# Install Go 1.21 or later # Install PostgreSQL 15 or later # Install Docker and Docker Compose (optional)
-
Install dependencies
make deps
-
Start development services
docker-compose up -d postgres export DATABASE_URL="postgres://mcp:secret@localhost:5432/mcp_tracker?sslmode=disable"
make buildmake runOr with Docker:
make docker-upmake testmake fmtmake lintagent-shaker/
├── cmd/server/ # Main application entry point
├── internal/
│ ├── database/ # Database connection
│ ├── handlers/ # HTTP handlers for API endpoints
│ ├── models/ # Data models
│ └── websocket/ # WebSocket hub
├── migrations/ # Database migrations
├── web/
│ └── static/ # Web UI files
├── docs/ # Documentation
└── docker-compose.yml # Docker setup
- Add model (if needed) in
internal/models/ - Add handler in
internal/handlers/ - Register route in
cmd/server/main.go - Update documentation in
docs/API.md - Add tests
// internal/models/comment.go
type Comment struct {
ID uuid.UUID `json:"id" db:"id"`
TaskID uuid.UUID `json:"task_id" db:"task_id"`
Content string `json:"content" db:"content"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
}
// internal/handlers/comments.go
type CommentHandler struct {
db *database.DB
hub *websocket.Hub
}
func (h *CommentHandler) CreateComment(w http.ResponseWriter, r *http.Request) {
// Implementation
}
// cmd/server/main.go
commentHandler := handlers.NewCommentHandler(db, hub)
api.HandleFunc("/comments", commentHandler.CreateComment).Methods("POST")- Create a new migration file in
migrations/with formatXXX_description.sql - Update the migration runner in
cmd/server/main.go
Example migration:
-- migrations/002_add_comments.sql
CREATE TABLE IF NOT EXISTS comments (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
task_id UUID NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
content TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_comments_task ON comments(task_id);When adding new features that should trigger real-time updates:
// Broadcast to project
h.hub.BroadcastToProject(projectID, "event_type", payload)Event types should be documented in docs/API.md.
- Follow standard Go conventions
- Use
gofmtfor formatting - Add comments for exported functions
- Keep functions small and focused
- Use meaningful variable names
- Write unit tests for business logic
- Test error cases
- Use table-driven tests where appropriate
- Mock external dependencies
Example test:
func TestCreateProject(t *testing.T) {
tests := []struct {
name string
input CreateProjectRequest
wantErr bool
}{
{
name: "valid project",
input: CreateProjectRequest{
Name: "Test Project",
Description: "Test Description",
},
wantErr: false,
},
// Add more test cases
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Test implementation
})
}
}- Update README.md for user-facing changes
- Update API.md for API changes
- Add code comments for complex logic
- Include examples in documentation
-
Create a feature branch
git checkout -b feature/my-new-feature
-
Make your changes
- Write code
- Add tests
- Update documentation
-
Test your changes
make test make build -
Commit your changes
git add . git commit -m "feat: add my new feature"
Follow Conventional Commits:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changesrefactor:- Code refactoringtest:- Adding testschore:- Maintenance tasks
-
Push to your fork
git push origin feature/my-new-feature
-
Create a Pull Request
- Provide a clear description
- Reference any related issues
- Include screenshots for UI changes
When reporting bugs, please include:
- Description - Clear description of the bug
- Steps to reproduce - Detailed steps to reproduce the issue
- Expected behavior - What you expected to happen
- Actual behavior - What actually happened
- Environment - OS, Go version, etc.
- Logs - Relevant error messages or logs
When requesting features, please include:
- Use case - Why is this feature needed?
- Proposed solution - How should it work?
- Alternatives - Other approaches you've considered
- Additional context - Any other relevant information
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
- Maintain a positive community
- Open an issue for questions
- Check existing documentation
- Review closed issues and PRs
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to MCP Task Tracker! 🚀