Thank you for your interest in contributing to CircleCare! This guide will help you get started with contributing to our care-centered expense sharing platform built on Stacks.
We are committed to making participation in our project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy towards other community members
- Node.js 18+ and npm/yarn
- Clarinet 2.x installed
- Git for version control
- Basic understanding of Clarity smart contracts
- Familiarity with TypeScript/React (for frontend contributions)
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/circlecare.git - Install dependencies:
cd circlecare/contracts && npm install - Run tests:
npm test - Create a feature branch:
git checkout -b feature/your-feature-name
- Use the bug report template
- Include steps to reproduce
- Provide expected vs actual behavior
- Include environment details (OS, Node version, etc.)
- Use the feature request template
- Explain the problem you're solving
- Describe your proposed solution
- Consider alternative solutions
- Fix typos and improve clarity
- Add examples and use cases
- Update outdated information
- Translate documentation
- Smart contract improvements
- Frontend enhancements
- Test coverage improvements
- Performance optimizations
- Check existing issues before creating new ones
- Comment on issues you'd like to work on
- Wait for maintainer assignment before starting work
- Ask questions if requirements are unclear
feature/issue-number-short-description
bugfix/issue-number-short-description
docs/issue-number-short-description
Follow conventional commits format:
type(scope): description
feat(contracts): add expense expiration functionality
fix(frontend): resolve wallet connection issue
docs(api): update contract function documentation
test(treasury): add settlement validation tests
- Ensure all tests pass
- Update documentation if needed
- Add tests for new functionality
- Use the PR template
- Request review from maintainers
- Use descriptive function and variable names
- Include comprehensive error handling
- Add inline documentation for complex logic
- Follow Clarity naming conventions (kebab-case)
- Optimize for gas efficiency
- Validate all inputs
- Use
unwrap!andtry!appropriately - Implement proper access controls
- Consider reentrancy attacks
- Test edge cases thoroughly
;; Title: Contract Name
;; Version: 1.0.0
;; Summary: Brief description
;; Description: Detailed explanation
;; Constants
(define-constant ERR_UNAUTHORIZED (err u401))
(define-constant ERR_NOT_FOUND (err u404))
;; Data Variables
(define-data-var contract-owner principal tx-sender)
;; Data Maps
(define-map circles uint {
name: (string-ascii 50),
creator: principal,
created-at: uint
})
;; Public Functions
(define-public (create-circle (name (string-ascii 50)))
;; Implementation with proper validation
)
;; Read-Only Functions
(define-read-only (get-circle (circle-id uint))
;; Implementation
)
;; Private Functions
(define-private (validate-circle-name (name (string-ascii 50)))
;; Implementation
)- Use functional components with hooks
- Implement proper TypeScript types
- Follow React best practices
- Use consistent naming conventions
- Implement proper error boundaries
// Example contract interaction
import { openContractCall } from '@stacks/connect';
const createCircle = async (name: string) => {
await openContractCall({
contractAddress: CONTRACTS.CIRCLE_FACTORY.address,
contractName: CONTRACTS.CIRCLE_FACTORY.name,
functionName: 'create-circle',
functionArgs: [stringAsciiCV(name)],
onFinish: (data) => {
console.log('Transaction submitted:', data.txId);
}
});
};- Unit tests for all public functions
- Edge case testing
- Error condition validation
- Gas usage optimization tests
- Component unit tests
- Integration tests for contract interactions
- E2E tests for critical user flows
- Accessibility testing
// contracts/tests/circle-factory.test.ts
import { describe, expect, it } from 'vitest';
import { Cl } from '@stacks/transactions';
describe('CircleFactory', () => {
it('should create a new circle', () => {
const { result } = simnet.callPublicFn(
'circle-factory',
'create-circle',
[Cl.stringAscii('Test Circle')],
address1
);
expect(result).toBeOk();
});
});- Document all public functions
- Explain complex algorithms
- Include usage examples
- Keep documentation up-to-date
;; Creates a new care circle
;; @param name: Circle name (max 50 characters)
;; @returns: Circle ID on success, error code on failure
(define-public (create-circle (name (string-ascii 50)))
;; Implementation
)- Code quality and readability
- Test coverage and quality
- Documentation completeness
- Security considerations
- Performance implications
- Initial review within 48 hours
- Follow-up reviews within 24 hours
- Maintainer approval required for merge
- Automated checks must pass
We follow semantic versioning (SemVer):
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
- Patch releases: As needed for critical bugs
- Minor releases: Monthly feature releases
- Major releases: Quarterly with breaking changes
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: General questions and ideas
- Discord: Real-time community chat
- Twitter: Updates and announcements
- Check existing documentation first
- Search closed issues for similar problems
- Ask questions in GitHub Discussions
- Join our Discord for real-time help
All contributors are recognized in our README and release notes.
Active contributors may be invited to become maintainers with additional responsibilities:
- Code review privileges
- Issue triage
- Release management
- Community moderation
By contributing, you agree that your contributions will be licensed under the MIT License.
First-time contributors will be asked to sign our CLA to ensure we can use your contributions.
Thank you for contributing to CircleCare! Together, we're building the future of care-centered expense sharing. 🌟