Overview
Create the crates/rskim-search/ crate with public API types, core traits, and CLI subcommand skeleton.
What to Build
New crate: crates/rskim-search/
Cargo.toml depending on rskim-core, thiserror, serde, serde_json, anyhow, rayon
src/lib.rs — public API re-exports (~50 lines)
src/types.rs — core types (~150 lines):
SearchResult { file_path, line_range, score, matched_field, snippet, match_positions }
SearchField enum: TypeDefinition, FunctionSignature, SymbolName, ImportExport, FunctionBody, Comment, StringLiteral
SearchQuery { text_query, ast_pattern, temporal_flags, limit, offset }
IndexStats { file_count, total_ngrams, index_size_bytes, last_updated }
SearchError enum (thiserror, following SkimError pattern)
src/traits.rs — core traits (~100 lines):
SearchLayer: fn search(&self, query: &SearchQuery) -> Result<Vec<(FileId, f32)>>
LayerBuilder: fn add_file(&mut self, path, content, lang) -> Result<()>; fn build(self) -> Result<Box<dyn SearchLayer>>
FieldClassifier: fn classify_node(&self, node, source) -> SearchField
Modify existing files
Cargo.toml (workspace root, line 2): add "crates/rskim-search" to members
crates/rskim/Cargo.toml: add rskim-search dependency
crates/rskim/src/cmd/mod.rs (line 33): add "search" to KNOWN_SUBCOMMANDS
crates/rskim/src/cmd/mod.rs (line 275+): add routing in dispatch()
crates/rskim/src/main.rs (line 45): update is_flag_with_value() for --build, --rebuild, --update, --ast, --blast-radius, --limit
- Create
crates/rskim/src/cmd/search.rs with help text and stub
Dependencies
None — this is the root of the dependency graph.
Acceptance Criteria
Implementation Guidelines Checklist
Overview
Create the
crates/rskim-search/crate with public API types, core traits, and CLI subcommand skeleton.What to Build
New crate:
crates/rskim-search/Cargo.tomldepending onrskim-core,thiserror,serde,serde_json,anyhow,rayonsrc/lib.rs— public API re-exports (~50 lines)src/types.rs— core types (~150 lines):SearchResult { file_path, line_range, score, matched_field, snippet, match_positions }SearchFieldenum: TypeDefinition, FunctionSignature, SymbolName, ImportExport, FunctionBody, Comment, StringLiteralSearchQuery { text_query, ast_pattern, temporal_flags, limit, offset }IndexStats { file_count, total_ngrams, index_size_bytes, last_updated }SearchErrorenum (thiserror, following SkimError pattern)src/traits.rs— core traits (~100 lines):SearchLayer:fn search(&self, query: &SearchQuery) -> Result<Vec<(FileId, f32)>>LayerBuilder:fn add_file(&mut self, path, content, lang) -> Result<()>;fn build(self) -> Result<Box<dyn SearchLayer>>FieldClassifier:fn classify_node(&self, node, source) -> SearchFieldModify existing files
Cargo.toml(workspace root, line 2): add"crates/rskim-search"to memberscrates/rskim/Cargo.toml: add rskim-search dependencycrates/rskim/src/cmd/mod.rs(line 33): add"search"to KNOWN_SUBCOMMANDScrates/rskim/src/cmd/mod.rs(line 275+): add routing in dispatch()crates/rskim/src/main.rs(line 45): update is_flag_with_value() for --build, --rebuild, --update, --ast, --blast-radius, --limitcrates/rskim/src/cmd/search.rswith help text and stubDependencies
None — this is the root of the dependency graph.
Acceptance Criteria
cargo checkpasses for workspace with new crateskim search --helpprints help textskim search "test"prints "not yet implemented" to stderrImplementation Guidelines Checklist