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.
|
||||
- Can be used in place of git hashes in all tools
|
||||
|
||||
## Database Schema (Planned)
|
||||
## Database Schema
|
||||
|
||||
**Tables:**
|
||||
- `revisions` - nixpkgs git hash, date, channel name, metadata
|
||||
- `options` - per revision: name, type, default, example, description
|
||||
- `declarations` - file paths where options are declared
|
||||
- `files` - cached nixpkgs file contents for `get_file` tool
|
||||
|
||||
1. `revisions` - Indexed nixpkgs versions
|
||||
- id, git_hash (unique), channel_name, commit_date, indexed_at, option_count
|
||||
|
||||
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:**
|
||||
- Full-text search on option names and descriptions
|
||||
- B-tree indexes on revision + option name
|
||||
- Namespace prefix indexes for category filtering
|
||||
- Full-text search: PostgreSQL (tsvector/GIN), SQLite (FTS5)
|
||||
- B-tree on (revision_id, name) and (revision_id, parent_path)
|
||||
- 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)
|
||||
|
||||
@@ -168,3 +182,4 @@ labmcp/
|
||||
- Nix flake must provide importable packages for other repos
|
||||
- Use `database/sql` interface for database abstraction
|
||||
- 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