Thank you for your interest in contributing to Cognitive Mesh! We're excited to have you join us in building an enterprise-grade AI transformation framework. This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- How Can I Contribute?
- Getting Started
- Development Workflow
- PRD-Driven Development
- Coding Standards
- Testing Guidelines
- Commit Message Guidelines
- Pull Request Process
- Architecture Guidelines
- Documentation
- Community and Support
By participating in this project, you agree to maintain a respectful, inclusive, and professional environment. We are committed to:
- Respect: Treat all contributors with respect and courtesy
- Inclusivity: Welcome contributors from all backgrounds and experience levels
- Collaboration: Work together constructively to improve the project
- Professionalism: Maintain high standards of technical and interpersonal conduct
There are many ways to contribute to Cognitive Mesh:
- Check existing issues to avoid duplicates
- Use the issue template (if available) to provide all necessary information
- Include:
- Clear description of the problem
- Steps to reproduce
- Expected vs. actual behavior
- Environment details (.NET version, OS, etc.)
- Relevant logs or error messages
- Search existing issues to see if your idea has been proposed
- Open a new issue with the
enhancementlabel - Provide:
- Clear use case and motivation
- Proposed solution or approach
- Potential impact and benefits
- Examples or mockups (if applicable)
- Fix bugs listed in issues
- Implement features aligned with our PRDs
- Improve documentation
- Enhance test coverage
- Optimize performance
- Fix typos or clarify existing documentation
- Add examples or tutorials
- Update outdated information
- Translate documentation (if multilingual support is planned)
Before you begin, ensure you have the following installed:
- .NET 9.0 SDK or later
- Visual Studio 2022 or VS Code with the C# Dev Kit extension
- Git
- (Optional) Azure Subscription for cloud-native feature development
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/cognitive-mesh.git cd cognitive-mesh -
Add upstream remote:
git remote add upstream https://github.com/JustAGhosT/cognitive-mesh.git
-
Install dependencies and build:
dotnet restore CognitiveMesh.sln dotnet build CognitiveMesh.sln
-
Run tests to verify your setup:
dotnet test CognitiveMesh.sln -
Set up environment variables (if needed):
- Copy
.env.exampleto.env - Configure any necessary API keys or settings
- Copy
Always create a new branch for your work:
# Update your local main branch
git checkout main
git pull upstream main
# Create a new feature branch
git checkout -b feature/your-feature-name
# or for bug fixes
git checkout -b fix/issue-descriptionfeature/- New features or enhancementsfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test additions or improvementschore/- Maintenance tasks
Example: feature/add-ethical-reasoning-engine or fix/security-policy-null-check
- Make your changes following the coding standards
- Write or update tests for your changes
- Run tests locally to ensure everything passes
- Update documentation if needed
- Commit your changes using proper commit messages
Regularly sync your branch with the upstream main:
git fetch upstream
git rebase upstream/mainCognitive Mesh follows a PRD-Driven Development approach. All major features and architectural decisions are guided by Product Requirement Documents (PRDs).
- Review the PRD Priority & Status document
- Check if there's a PRD for the feature you want to implement
- If no PRD exists for a significant feature, consider opening an issue to discuss creating one
- Understand the architecture - review the relevant layer's README in
./src/
When working on PRD-tracked features:
- Understand the objectives and requirements
- Follow the architectural patterns specified
- Consider dependencies on other PRDs
- Align with security and compliance requirements
- Follow Microsoft C# Coding Conventions
- Use meaningful names for variables, methods, and classes
- Keep methods focused and concise (single responsibility principle)
- Use XML documentation comments for public APIs
- Prefer async/await for asynchronous operations
Cognitive Mesh follows a Layered Hexagonal Architecture:
- FoundationLayer: Core infrastructure (security, persistence, logging)
- ReasoningLayer: Cognitive engines (analytical, creative, ethical reasoning)
- MetacognitiveLayer: Self-monitoring and continuous learning
- AgencyLayer: Autonomous agents and task execution
- BusinessApplications: APIs and business logic
Key Principles:
- Maintain separation of concerns between layers
- Use dependency injection for loose coupling
- Implement ports and adapters pattern for external integrations
- Follow Zero-Trust security principles
- Place new code in the appropriate layer
- Use namespaces that reflect the folder structure
- Keep files focused on a single responsibility
- Organize related functionality into cohesive modules
Testing is crucial for maintaining quality and reliability.
- Unit Tests: Test individual components in isolation
- Integration Tests: Test interactions between components
- End-to-End Tests: Test complete workflows
- Every new feature should include tests
- Bug fixes should include regression tests
- Use descriptive test names that explain what is being tested
- Follow Arrange-Act-Assert (AAA) pattern
- Mock external dependencies to ensure test isolation
# Run all tests
dotnet test CognitiveMesh.sln
# Run tests for a specific project
dotnet test tests/YourTestProject/YourTestProject.csproj
# Run tests with coverage
dotnet test CognitiveMesh.sln /p:CollectCoverage=trueTests should be placed in the tests/ directory, mirroring the structure of the src/ directory:
tests/
FoundationLayer/
ReasoningLayer/
MetacognitiveLayer/
AgencyLayer/
BusinessApplications/
For more details, see docs/TESTING.md.
We follow the Conventional Commits specification.
<type>(<scope>): <subject>
<body>
<footer>
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, no logic change)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks (dependencies, build, etc.)perf: Performance improvementsci: CI/CD configuration changes
feat(reasoning): add ethical reasoning engine
Implement the ethical reasoning engine as specified in PRD-03.
The engine evaluates decisions against ethical frameworks and
compliance requirements.
Closes #123
fix(security): resolve null reference in policy evaluation
Handle null context objects in security policy engine to prevent
crashes during authorization checks.
Fixes #456
- Use present tense ("add feature" not "added feature")
- Use imperative mood ("move cursor to..." not "moves cursor to...")
- Keep the subject line under 72 characters
- Reference issues and PRs in the footer
- ✅ All tests pass locally
- ✅ Code follows coding standards
- ✅ Documentation is updated (if applicable)
- ✅ Commits are clean and follow commit message guidelines
- ✅ Branch is up-to-date with upstream main
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub from your fork to the upstream repository
-
Fill out the PR template with:
- Clear description of changes
- Related issue numbers
- Testing performed
- Screenshots or examples (if applicable)
Follow the same format as commit messages:
feat(scope): brief description of changes
- Maintainers will review your PR
- Address feedback promptly and professionally
- Make requested changes in new commits (don't force-push during review)
- Respond to comments to facilitate discussion
- Once approved, a maintainer will merge your PR
Your PR must pass:
- ✅ Build verification
- ✅ All tests
- ✅ Code linting (if configured)
- ✅ Security scans
- Focus on infrastructure concerns (security, persistence, communication)
- Ensure Zero-Trust security principles are maintained
- Provide clear abstractions for other layers
- Implement cognitive engines for various reasoning types
- Maintain statistical rigor in reasoning algorithms
- Ensure auditability of reasoning processes
- Focus on self-monitoring and continuous improvement
- Implement performance optimization strategies
- Handle incident response and anomaly detection
- Create autonomous agents that execute tasks
- Integrate with external tools safely and securely
- Implement workflow orchestration
- Expose well-designed APIs
- Follow API versioning best practices (see docs/API_VERSIONING.md)
- Implement proper error handling and validation
- Never commit secrets or sensitive information
- Use secure coding practices to prevent vulnerabilities
- Follow Zero-Trust security principles
- Validate and sanitize all inputs
- Implement proper authentication and authorization
Good documentation is essential for the success of the project.
- Code Comments: For complex logic or non-obvious implementations
- XML Documentation: For all public APIs
- README files: In each major directory explaining the component
- Architecture docs: In the
./docs/directory - API Documentation: Generated from code comments
- Use clear, concise language
- Include examples where helpful
- Keep documentation up-to-date with code changes
- Follow markdown best practices
When making changes that affect:
- Public APIs: Update XML documentation
- Architecture: Update relevant docs in
./docs/ - User-facing features: Update README or user guides
- Configuration: Update configuration documentation
- Documentation: Start with the README and docs in
./docs/ - Issues: Search existing issues for similar questions
- Discussions: Use GitHub Discussions (if enabled) for general questions
- Watch the repository for updates
- Star the repository if you find it useful
- Follow the project for announcements
All contributors are valued and recognized:
- Contributors are listed in the project
- Significant contributions are highlighted in release notes
- We appreciate all forms of contribution, from code to documentation to bug reports
Thank you for contributing to Cognitive Mesh! Your efforts help build a better, more robust AI transformation framework for the enterprise community. Every contribution, no matter how small, makes a difference.
If you have questions or need assistance, don't hesitate to reach out by opening an issue.
Happy Coding! 🚀
By contributing to Cognitive Mesh, you agree that your contributions will be licensed under the MIT License that covers this project.