|
1 |
| -# Contributing |
| 1 | +# Contributing to MyCoder |
2 | 2 |
|
3 |
| -Key points: |
| 3 | +First off, thank you for considering contributing to MyCoder! It's people like you that make MyCoder such a great tool. |
4 | 4 |
|
5 |
| -- Run build, test, and lint before submitting changes |
6 |
| -- Use TypeScript types over interfaces |
7 |
| -- Maintain test coverage |
8 |
| -- Keep documentation updated |
9 |
| -- Use the logger system for output |
| 5 | +## Code of Conduct |
| 6 | + |
| 7 | +This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. |
10 | 8 |
|
11 | 9 | ## Development Setup
|
12 | 10 |
|
13 |
| -```bash |
14 |
| -# Clone the repository |
15 |
| -git clone https://github.com/bhouston/mycoder.git |
| 11 | +### Prerequisites |
| 12 | + |
| 13 | +- Node.js >= 20.0.0 |
| 14 | +- pnpm >= 10.2.1 |
| 15 | +- PostgreSQL (for Dashboard) |
| 16 | +- Google Cloud SDK (for cloud features) |
| 17 | +- Git |
| 18 | + |
| 19 | +### Getting Started |
| 20 | + |
| 21 | +1. Fork the repository |
| 22 | +2. Clone your fork: |
| 23 | + ```bash |
| 24 | + git clone https://github.com/your-username/mycoder-monorepo.git |
| 25 | + cd mycoder-monorepo |
| 26 | + ``` |
| 27 | +3. Install dependencies: |
| 28 | + ```bash |
| 29 | + pnpm install |
| 30 | + ``` |
| 31 | +4. Build all packages: |
| 32 | + ```bash |
| 33 | + pnpm build |
| 34 | + ``` |
| 35 | +5. Start development servers: |
| 36 | + ```bash |
| 37 | + pnpm dev |
| 38 | + ``` |
| 39 | + |
| 40 | +## Project Architecture |
| 41 | + |
| 42 | +### Monorepo Structure |
| 43 | + |
| 44 | +- `/packages/*` - All project packages |
| 45 | + - `agent` - Core AI agent system |
| 46 | + - `cli` - Command-line interface |
16 | 47 |
|
17 |
| -# Change directory |
18 |
| -cd mycoder |
| 48 | +## Development Workflow |
19 | 49 |
|
20 |
| -# Install dependencies |
21 |
| -pnpm install |
| 50 | +1. Create a new branch for your feature/fix: |
22 | 51 |
|
23 |
| -# Create a .env with your API key |
24 |
| -echo "ANTHROPIC_API_KEY=[your-api-key]" > .env |
25 |
| -``` |
| 52 | + ```bash |
| 53 | + git checkout -b feature/your-feature-name |
| 54 | + ``` |
26 | 55 |
|
27 |
| -### Development Commands |
| 56 | +2. Make your changes, following our coding standards: |
28 | 57 |
|
29 |
| -- `pnpm run build` - Build the TypeScript code |
30 |
| -- `pnpm start` - Run the application |
31 |
| -- `pnpm test` - Run tests |
32 |
| -- `pnpm run lint` - Lint the code |
33 |
| -- `pnpm run format` - Format the code |
34 |
| -- `pnpm run clean` - Clean build artifacts |
| 58 | + - Use TypeScript for all new code |
| 59 | + - Follow the existing code style |
| 60 | + - Add tests for new functionality |
| 61 | + - Update documentation as needed |
35 | 62 |
|
36 |
| -## Architecture |
| 63 | +3. Run tests and checks: |
37 | 64 |
|
38 |
| -### Core Components |
| 65 | + ```bash |
| 66 | + pnpm test # Run tests |
| 67 | + pnpm typecheck # Type checking |
| 68 | + pnpm lint # Linting |
| 69 | + pnpm format # Code formatting |
| 70 | + ``` |
39 | 71 |
|
40 |
| -1. **Tool System** |
| 72 | +4. Commit your changes: |
41 | 73 |
|
42 |
| - - Modular tools for specific functionalities |
43 |
| - - Categories: Interaction, I/O, System, Data Management |
44 |
| - - Parallel execution capability |
45 |
| - - Type-safe definitions |
| 74 | + ```bash |
| 75 | + git commit -m "feat: add your feature description" |
| 76 | + ``` |
46 | 77 |
|
47 |
| -2. **Agent System** |
| 78 | + Follow [Conventional Commits](https://www.conventionalcommits.org/) specification. |
48 | 79 |
|
49 |
| - - Main agent for orchestration |
50 |
| - - Sub-agents for parallel task execution |
51 |
| - - Anthropic Claude API integration |
52 |
| - - Hierarchical logging |
| 80 | +5. Push to your fork and create a Pull Request |
53 | 81 |
|
54 |
| -3. **Logger System** |
55 |
| - - Color-coded component output |
56 |
| - - Hierarchical indentation |
57 |
| - - Multiple log levels (info, verbose, warn, error) |
58 |
| - - Structured data logging |
| 82 | +## Package-Specific Guidelines |
59 | 83 |
|
60 |
| -## Project Structure |
| 84 | +### Agent Development |
61 | 85 |
|
62 |
| -``` |
63 |
| -src/ |
64 |
| -├── core/ # Core agent and executor logic |
65 |
| -├── interfaces/ # Type definitions and interfaces |
66 |
| -├── tools/ # Tool implementations |
67 |
| -│ ├── interaction/ |
68 |
| -│ ├── io/ |
69 |
| -│ ├── system/ |
70 |
| -│ └── record/ |
71 |
| -└── utils/ # Utilities including logger |
72 |
| -``` |
| 86 | +- Test all new tools thoroughly |
| 87 | +- Document tool interfaces completely |
| 88 | +- Consider parallel execution opportunities |
| 89 | +- Add comprehensive error handling |
73 | 90 |
|
74 |
| -## Coding Style |
| 91 | +### CLI Development |
75 | 92 |
|
76 |
| -### Terse and Simple |
| 93 | +- Follow command naming conventions |
| 94 | +- Include help text for all commands |
| 95 | +- Add examples to documentation |
| 96 | +- Test interactive features thoroughly |
77 | 97 |
|
78 |
| -Favor a terse coding style that focuses on simplicity and readability. |
| 98 | +### Dashboard & Website |
79 | 99 |
|
80 |
| -## Prefer Types over Interfaces |
| 100 | +- Follow component architecture |
| 101 | +- Use existing UI components |
| 102 | +- Add Storybook stories for new components |
| 103 | +- Ensure responsive design |
81 | 104 |
|
82 |
| -When writing types please use type rather than interfaces as they are more robust. |
| 105 | +### GitHub Integration |
83 | 106 |
|
84 |
| -### Use Logger in Tools/Agents for Output |
| 107 | +- Test webhook handlers thoroughly |
| 108 | +- Document API interactions |
| 109 | +- Follow security best practices |
| 110 | +- Add integration tests |
85 | 111 |
|
86 |
| -The project uses a hierarchical logging system (Logger) that helps distinguish between different agents and tools in the output. The logging system has the following features: |
| 112 | +## Testing Guidelines |
87 | 113 |
|
88 |
| -- `verbose`: Detailed debug information (dimmed version of agent/tool color) |
89 |
| -- `info`: Normal operational messages (colored according to agent/tool color) |
90 |
| -- `warn`: Warning messages (yellow) |
91 |
| -- `error`: Error messages (red) |
| 114 | +1. Write tests for new features |
| 115 | +2. Maintain existing test coverage |
| 116 | +3. Use appropriate testing tools: |
| 117 | + - Vitest for unit tests |
| 118 | + - Playwright for E2E tests |
| 119 | + - Component testing where appropriate |
92 | 120 |
|
93 |
| -## Check Build Works after Changes |
| 121 | +## Documentation |
94 | 122 |
|
95 |
| -Ensure that `pnpm run build` works after making changes to the code, otherwise you need to make fixes. |
| 123 | +- Update README.md files as needed |
| 124 | +- Document new features and changes |
| 125 | +- Include code examples |
| 126 | +- Update API documentation |
96 | 127 |
|
97 |
| -## Keep Tests & Lint & Format Up-to-Date With Changes |
| 128 | +## Getting Help |
98 | 129 |
|
99 |
| -Please add tests when making changes to the code. Try to sensible tests that a senior dev would write, try to avoid useless tests that don't add value. |
| 130 | +- Check existing issues and discussions |
| 131 | +- Join our community chat |
| 132 | +- Ask questions in pull requests |
| 133 | +- Reach out to maintainers |
100 | 134 |
|
101 |
| -Ensure that the `pnpm test` passes after making changes to the code as well as `pnpm run lint` passes with no warnings or errors. Also run `pnpm run format` to ensure the code is formatted correctly. |
| 135 | +## Review Process |
102 | 136 |
|
103 |
| -If a test fails, but it is not clear why, you can add more tests around that test as well as add more verbose messages to the failed test to help you identify the cause. This will both help you and help others going forward. |
| 137 | +1. All changes require review |
| 138 | +2. Address review feedback promptly |
| 139 | +3. Maintain civil and professional discourse |
| 140 | +4. Be patient with the process |
104 | 141 |
|
105 |
| -## Keep Documentation Up-to-Date with Changes |
| 142 | +## Release Process |
106 | 143 |
|
107 |
| -When making changes to the code, please ensure that the documentation in these files says up to date: |
| 144 | +1. Maintainers will handle releases |
| 145 | +2. Follow semantic versioning |
| 146 | +3. Update changelog entries |
| 147 | +4. Tag releases appropriately |
108 | 148 |
|
109 |
| -- `README.md` |
110 |
| -- `ARCHITECTURE.md` |
111 |
| -- `CONTRIBUTING.md` |
112 |
| -- `TOOLS.md` |
| 149 | +Thank you for contributing to MyCoder! 👍 |
0 commit comments