Skip to content

Commit 3b1ef4b

Browse files
Initial commit: codebrain v0.1.0
Persistent context index for AI coding agents. Packages: - core: Configuration, storage, and type definitions - cli: Command-line interface - extraction: AI-powered knowledge extraction - parsers: Source parsers (Claude Code, meetings) - mcp-server: Model Context Protocol server Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0 parents  commit 3b1ef4b

30 files changed

Lines changed: 3706 additions & 0 deletions

.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
dist/
6+
*.tsbuildinfo
7+
8+
# Codebrain data (user's local index)
9+
.codebrain/
10+
11+
# Environment
12+
.env
13+
.env.local
14+
.env.*.local
15+
16+
# IDE
17+
.idea/
18+
.vscode/
19+
*.swp
20+
*.swo
21+
22+
# OS
23+
.DS_Store
24+
Thumbs.db
25+
26+
# Logs
27+
*.log
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
32+
# Test coverage
33+
coverage/
34+
35+
# Package manager locks (use one)
36+
# package-lock.json
37+
# yarn.lock
38+
# pnpm-lock.yaml

CONTRIBUTING.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Contributing to Codebrain
2+
3+
Thanks for your interest in contributing to Codebrain!
4+
5+
## Development Setup
6+
7+
1. Clone the repo:
8+
```bash
9+
git clone https://github.com/YOUR_USERNAME/codebrain.git
10+
cd codebrain
11+
```
12+
13+
2. Install dependencies:
14+
```bash
15+
npm install
16+
```
17+
18+
3. Build all packages:
19+
```bash
20+
npm run build
21+
```
22+
23+
4. Run in development mode:
24+
```bash
25+
npm run dev
26+
```
27+
28+
## Project Structure
29+
30+
```
31+
packages/
32+
├── core/ # Types, config, storage interface
33+
├── parsers/ # Source parsers (Claude Code, meetings, git)
34+
├── extraction/ # LLM signal extraction
35+
├── mcp-server/ # MCP server for Claude Code integration
36+
└── cli/ # Command line interface
37+
```
38+
39+
## Making Changes
40+
41+
1. Create a branch for your feature:
42+
```bash
43+
git checkout -b feature/your-feature
44+
```
45+
46+
2. Make your changes
47+
48+
3. Run type checking:
49+
```bash
50+
npm run typecheck
51+
```
52+
53+
4. Run linting:
54+
```bash
55+
npm run lint
56+
```
57+
58+
5. Test your changes locally
59+
60+
6. Commit with a descriptive message:
61+
```bash
62+
git commit -m "feat: add support for X"
63+
```
64+
65+
## Commit Convention
66+
67+
We use conventional commits:
68+
- `feat:` New feature
69+
- `fix:` Bug fix
70+
- `docs:` Documentation
71+
- `refactor:` Code refactoring
72+
- `test:` Tests
73+
- `chore:` Maintenance
74+
75+
## Pull Requests
76+
77+
1. Push your branch
78+
2. Open a PR against `main`
79+
3. Fill out the PR template
80+
4. Wait for review
81+
82+
## Adding a New Parser
83+
84+
1. Create a new file in `packages/parsers/src/`
85+
2. Export a parse function that returns `RawDocument`
86+
3. Add to `packages/parsers/src/index.ts`
87+
4. Add tests
88+
89+
Example:
90+
```typescript
91+
import type { RawDocument } from '@codebrain/core';
92+
93+
export async function parseMySource(filePath: string): Promise<RawDocument> {
94+
// Parse the file
95+
return {
96+
id: '...',
97+
type: 'my_source',
98+
path: filePath,
99+
content: '...',
100+
metadata: {},
101+
indexedAt: new Date(),
102+
hash: '...',
103+
};
104+
}
105+
```
106+
107+
## Adding a Custom Signal Type
108+
109+
1. Update `packages/core/src/types.ts` if it's a built-in type
110+
2. Add extraction prompt in `packages/extraction/src/prompts.ts`
111+
3. Document in README
112+
113+
## Questions?
114+
115+
Open an issue or start a discussion.
116+
117+
## License
118+
119+
By contributing, you agree that your contributions will be licensed under the MIT License.

0 commit comments

Comments
 (0)