Contributing to Compose-Lang
November 23, 2025 ยท View on GitHub
Thank you for your interest in contributing to Compose-Lang! This guide will help you get started.
๐ฏ Vision
Compose-Lang is building the universal architecture definition language - a way to describe modern applications in natural language and generate production-ready code for any tech stack.
๐ Quick Start
Prerequisites
- Node.js 20+
- Git
- A Gemini API key (for testing LLM features)
Setup
git clone https://github.com/darula-hpp/compose-lang.git
cd compose-lang
npm install
npm link # Make 'compose' command available globally
Test Your Setup
cd demo
export GEMINI_API_KEY="your-api-key"
compose build
๐ ๏ธ Project Structure
compose-lang/
โโโ cli/ # Command-line interface
โ โโโ commands/ # Individual commands (init, build, dev)
โโโ compiler/
โ โโโ lexer/ # Tokenization
โ โโโ parser/ # AST generation
โ โโโ analyzer/ # Semantic analysis
โ โโโ ir/ # Intermediate representation
โ โโโ emitter/ # Code generation
โ โโโ loader/ # Module loading
โโโ language/ # Language specification
โโโ tests/ # Test suite
โโโ docs/ # Documentation
๐จ How to Contribute
1. Add a New Framework Adapter
Example: Adding Fastify Support
- Update Framework Analyzer (
compiler/emitter/framework-analyzer.js):
// Detect Fastify
if (pkg.dependencies?.fastify) {
return {
type: 'node',
framework: 'fastify',
routing: 'explicit',
routesDir: 'routes',
entryPoint: 'server.js'
};
}
- Add Merge Strategy (
compiler/emitter/code-merger.js):
case 'fastify':
return mergeFastifyCode(generatedFiles, frameworkInfo, targetDir);
- Test It:
npm test -- tests/compiler/framework-analyzer.test.js
2. Add Language Features
Example: Adding frontend.form Support
- Update Tokens (
compiler/lexer/token-types.js):
FRONTEND_FORM: 'FRONTEND_FORM',
- Update Keywords:
'frontend.form': TokenType.FRONTEND_FORM,
- Update Parser (
compiler/parser/parser.js):
case TokenType.FRONTEND_FORM:
return this.parseFrontendForm();
- Update IR Builder (
compiler/ir/ir-builder.js):
visitFrontendForm(node) {
// Convert to IR
}
- Document It (
language/semantics.md)
3. Add LLM Provider
Example: Adding Anthropic Claude
- Create Client (
compiler/emitter/anthropic-client.js):
export class AnthropicClient {
constructor(config, cacheManager) {
// Initialize Anthropic SDK
}
async generate(systemPrompt, userPrompt, options) {
// Call Claude API
}
}
- Register in Factory (
compiler/emitter/llm-client.js):
case 'anthropic': {
const { AnthropicClient } = await import('./anthropic-client.js');
return new AnthropicClient(config, cacheManager);
}
- Update Docs (
docs/llm-integration.md)
๐งช Testing
Run All Tests
npm test
Run Specific Test
npm test -- tests/compiler/parser.test.js
Add a New Test
describe('MyNewFeature', () => {
it('should parse correctly', () => {
const source = 'frontend.form "Login"';
const result = compile(source);
expect(result.success).toBe(true);
});
});
๐ Documentation
- Update
README.mdfor user-facing changes - Update
language/semantics.mdfor syntax changes - Add examples to
examples/directory - Update
CHANGELOG.md
๐ Reporting Issues
Use GitHub Issues with these labels:
bug- Something isn't workingenhancement- New feature requestdocumentation- Documentation improvementsgood first issue- Great for newcomers
๐ก Good First Issues
Looking for a place to start? Try these:
Easy
- Add syntax highlighting for VS Code
- Improve error messages
- Add more examples to
examples/ - Fix typos in documentation
Medium
- Add SolidJS framework support
- Add Anthropic Claude LLM provider
- Implement
frontend.modalcomponent type - Add prettier plugin for
.composefiles
Advanced
- Implement hot module replacement for
compose dev - Add TypeScript type generation
- Build VS Code extension with intellisense
- Implement
compose ingest(reverse compiler)
๐ค Code Style
- Use ESM imports (
import/export) - Follow existing patterns in the codebase
- Add JSDoc comments for public APIs
- Keep functions focused and small
- Write descriptive commit messages
๐ Commit Messages
feat: add Fastify framework support
fix: resolve import path doubling issue
docs: update contributing guide
test: add parser tests for forms
๐ Pull Request Process
- Fork the repository
- Create a feature branch (
git checkout -b feat/amazing-feature) - Make your changes
- Run tests (
npm test) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to your fork (
git push origin feat/amazing-feature) - Open a Pull Request
PR Checklist
- Tests pass
- Documentation updated
- Examples added (if applicable)
- CHANGELOG.md updated
๐ Recognition
Contributors will be:
- Listed in
CONTRIBUTORS.md - Thanked in release notes
- Given credit in documentation
๐ฌ Community
- GitHub Discussions: Ask questions, share ideas
- Issues: Report bugs, request features
- Twitter: Share what you're building with Compose
๐ License
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for helping build the future of application development! ๐