Skip to main content
Glama

Semantic Context MCP

Official
CONTRIBUTING.mdβ€’8.24 kB
# Contributing to Semantic Context MCP Thank you for your interest in contributing! This project serves as a **reference implementation** of Semantic Intent patterns, so contributions should maintain these principles. ## 🎯 Code of Conduct This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to conduct@semanticintent.dev. ## πŸš€ How to Contribute ### Reporting Bugs Before creating bug reports, please check existing issues. When creating a bug report, include: - **Clear title and description** - **Steps to reproduce** - **Expected vs actual behavior** - **Environment details** (Node version, OS, Wrangler version) - **Code samples or test cases** **Template:** ```markdown **Describe the bug** A clear description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Run command '...' 2. See error **Expected behavior** What you expected to happen. **Environment** - Node.js version: [e.g., 20.x] - Wrangler version: [e.g., 4.27.0] - OS: [e.g., Windows 11] ``` ### Suggesting Enhancements Enhancement suggestions are tracked as GitHub issues. Include: - **Clear title and description** - **Use case** - WHY is this needed? - **Semantic intent** - HOW does this preserve semantic meaning? - **Examples** of how it would work ### Pull Requests 1. **Fork the repository** ```bash git clone https://github.com/semanticintent/semantic-context-mcp.git cd semantic-context-mcp ``` 2. **Create a feature branch** ```bash git checkout -b feature/amazing-feature ``` 3. **Make your changes following our standards:** - βœ… Follow semantic intent patterns - βœ… Add tests for new functionality - βœ… Update documentation - βœ… Follow TypeScript best practices - βœ… Include semantic comments (WHY, not just WHAT) 4. **Run all checks locally** ```bash npm run type-check # TypeScript compilation npm test # All 70+ tests npm run format # Code formatting ``` 5. **Commit with semantic intent** ```bash git commit -m "feat: Add semantic feature X 🎯 SEMANTIC INTENT: Explain WHY this preserves semantic meaning - What problem does this solve? - How does it maintain semantic integrity? - What business value does it provide?" ``` 6. **Push and create PR** ```bash git push origin feature/amazing-feature ``` ## πŸ“‹ Development Standards ### Semantic Intent Documentation Every significant code addition should include semantic intent comments: ```typescript /** * 🎯 SEMANTIC INTENT: Brief purpose statement * * WHY: Why does this exist? What semantic meaning does it preserve? * WHAT: What business value does it provide? * HOW: How does it maintain semantic integrity? */ ``` ### Architectural Layers Maintain the hexagonal architecture: ``` domain/ - Pure business logic (no infrastructure dependencies) application/ - Orchestration and use cases infrastructure/- Technical adapters (D1, AI, HTTP) presentation/ - Routing and HTTP concerns ``` **Rules:** - βœ… Domain layer NEVER depends on infrastructure - βœ… Use dependency injection - βœ… Program to interfaces (ports), not implementations ### Testing Requirements All contributions must include tests: - **Unit tests** for business logic - **Mock external dependencies** (D1, AI services) - **Test coverage** should not decrease - **Follow AAA pattern** (Arrange, Act, Assert) Example: ```typescript describe('FeatureName', () => { it('should preserve semantic intent when...', () => { // Arrange const input = createTestInput(); // Act const result = feature.execute(input); // Assert expect(result).toPreserveSemanticIntent(); }); }); ``` ### Commit Message Format We follow semantic commit messages: ``` <type>(<scope>): <subject> <body - explain WHY, not just WHAT> <footer - breaking changes, references> ``` **Types:** - `feat`: New feature (semantic enhancement) - `fix`: Bug fix - `refactor`: Code restructuring (preserving semantics) - `test`: Adding/updating tests - `docs`: Documentation updates - `ci`: CI/CD changes - `security`: Security improvements **Example:** ``` feat(domain): Add context versioning support 🎯 SEMANTIC INTENT: Preserve historical context evolution Enables tracking of how context meaning evolves over time, maintaining semantic integrity across versions. - Adds ContextVersion entity - Implements version comparison logic - Maintains backward compatibility Closes #123 ``` ## πŸ—οΈ Project Structure ``` semantic-context-mcp/ β”œβ”€β”€ .github/ β”‚ β”œβ”€β”€ workflows/ # CI/CD automation β”‚ β”œβ”€β”€ ISSUE_TEMPLATE/ # Issue templates β”‚ └── PULL_REQUEST_TEMPLATE.md β”œβ”€β”€ migrations/ # Database schema versions β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ domain/ # Business logic (pure) β”‚ β”œβ”€β”€ application/ # Use cases & orchestration β”‚ β”œβ”€β”€ infrastructure/ # Technical adapters β”‚ └── presentation/ # HTTP routing β”œβ”€β”€ docs/ # Additional documentation └── tests/ # Integration tests (if any) ``` ## πŸ” Code Review Process All PRs require: 1. βœ… **All CI checks passing** (tests, type-check, lint) 2. βœ… **Code review approval** from maintainer 3. βœ… **Semantic intent documentation** 4. βœ… **Tests included** 5. βœ… **No breaking changes** (or documented if necessary) Reviewers will check: - Semantic intent clarity - Architectural consistency - Test coverage - Documentation quality - Type safety ## 🎨 Style Guide ### TypeScript - Use **strict mode** (`strict: true` in tsconfig) - Prefer **readonly** for immutability - Use **interfaces** for contracts - Avoid `any` - use `unknown` if needed - **Explicit return types** for public methods ### Naming Conventions - **Classes**: PascalCase (`ContextSnapshot`) - **Interfaces**: PascalCase with `I` prefix for ports (`IContextRepository`) - **Variables/functions**: camelCase (`generateSummary`) - **Constants**: UPPER_SNAKE_CASE (`MAX_RETRY_COUNT`) - **Files**: Match class name (`ContextSnapshot.ts`) ### File Organization - Co-locate tests: `FeatureName.test.ts` next to `FeatureName.ts` - One class per file - Export at file level, not inline - Group imports: stdlib β†’ external β†’ internal ## πŸ§ͺ Testing Guidelines ### What to Test - βœ… Business logic in domain layer - βœ… Orchestration in application layer - βœ… Adapter implementations - βœ… Error handling - βœ… Edge cases - βœ… Validation rules ### What NOT to Test - ❌ External services (mock them) - ❌ TypeScript type system - ❌ Third-party libraries ### Test Naming ```typescript describe('ClassName', () => { describe('methodName()', () => { it('should <expected behavior> when <condition>', () => { // Test implementation }); }); }); ``` ## πŸ“š Documentation Standards ### Code Comments **Good:** ```typescript // 🎯 SEMANTIC INTENT: Preserve summary when content changes // WHY: Summaries represent semantic essence, must be immutable const snapshot = ContextSnapshot.create({ summary }); ``` **Bad:** ```typescript // Create snapshot const snapshot = ContextSnapshot.create({ summary }); ``` ### README Updates When adding features, update: - Feature list - Usage examples - Architecture diagrams (if structure changes) - API documentation ## πŸ”’ Security - Never commit secrets or credentials - Use `wrangler.jsonc.example` for templates - Follow SECURITY.md guidelines - Report vulnerabilities privately ## 🀝 Getting Help - **Questions**: Open a GitHub Discussion - **Bugs**: Create an issue with bug template - **Security**: Email security@semanticintent.dev - **Chat**: Join our community (link TBD) ## πŸ“„ License By contributing, you agree that your contributions will be licensed under the MIT License. ## πŸ™ Recognition Contributors are recognized in: - GitHub contributors page - CHANGELOG.md (for significant contributions) - Release notes Thank you for helping make this project a world-class reference implementation! πŸš€ --- **Questions?** Open a discussion or reach out to maintainers.

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/semanticintent/semantic-context-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server