chore: add CLAUDE.md and gitignore
- Add project context file for Claude - Ignore nix result symlink Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
result
|
||||||
31
CLAUDE.md
31
CLAUDE.md
@@ -78,18 +78,32 @@ The first MCP server provides search and query capabilities for NixOS configurat
|
|||||||
- Support friendly aliases: `nixos-unstable`, `nixos-24.05`, `nixos-23.11`, etc.
|
- Support friendly aliases: `nixos-unstable`, `nixos-24.05`, `nixos-23.11`, etc.
|
||||||
- Can be used in place of git hashes in all tools
|
- Can be used in place of git hashes in all tools
|
||||||
|
|
||||||
## Database Schema (Planned)
|
## Database Schema
|
||||||
|
|
||||||
**Tables:**
|
**Tables:**
|
||||||
- `revisions` - nixpkgs git hash, date, channel name, metadata
|
|
||||||
- `options` - per revision: name, type, default, example, description
|
1. `revisions` - Indexed nixpkgs versions
|
||||||
- `declarations` - file paths where options are declared
|
- id, git_hash (unique), channel_name, commit_date, indexed_at, option_count
|
||||||
- `files` - cached nixpkgs file contents for `get_file` tool
|
|
||||||
|
2. `options` - NixOS options with hierarchy support
|
||||||
|
- id, revision_id (FK), name, parent_path, type, default_value (JSON text), example (JSON text), description, read_only
|
||||||
|
- parent_path enables efficient "list children" queries (derived from name)
|
||||||
|
|
||||||
|
3. `declarations` - File paths where options are declared
|
||||||
|
- id, option_id (FK), file_path, line_number
|
||||||
|
|
||||||
|
4. `files` - Cached file contents
|
||||||
|
- id, revision_id (FK), file_path, extension, content
|
||||||
|
- Configurable whitelist of extensions (default: .nix, .json, .md, .txt, .toml, .yaml, .yml)
|
||||||
|
|
||||||
**Indexes:**
|
**Indexes:**
|
||||||
- Full-text search on option names and descriptions
|
- Full-text search: PostgreSQL (tsvector/GIN), SQLite (FTS5)
|
||||||
- B-tree indexes on revision + option name
|
- B-tree on (revision_id, name) and (revision_id, parent_path)
|
||||||
- Namespace prefix indexes for category filtering
|
- B-tree on (revision_id, file_path) for file lookups
|
||||||
|
|
||||||
|
**Cross-DB Compatibility:**
|
||||||
|
- JSON stored as TEXT (not JSONB) for SQLite compatibility
|
||||||
|
- Separate FTS implementations per database engine
|
||||||
|
|
||||||
## Repository Structure (Planned)
|
## Repository Structure (Planned)
|
||||||
|
|
||||||
@@ -168,3 +182,4 @@ labmcp/
|
|||||||
- Nix flake must provide importable packages for other repos
|
- Nix flake must provide importable packages for other repos
|
||||||
- Use `database/sql` interface for database abstraction
|
- Use `database/sql` interface for database abstraction
|
||||||
- File paths in responses should use format `path/to/file.go:123`
|
- File paths in responses should use format `path/to/file.go:123`
|
||||||
|
- **Always run `go fmt ./...` before committing Go code**
|
||||||
|
|||||||
Reference in New Issue
Block a user