# Tasks: Map Context Retrieval ## Status | Field | Value | |---|---| | Phase | **Tasks** | | Based on | [Design](design.md) | | Next | Apply | ## Tasks 1. [ ] Add Pi tool support for `project-map context` with `query` as the main input 2. [ ] Add retrieval module for scoring paired index/map metadata 3. [ ] Reuse or extend shared paired-artifact parsing/model code 4. [ ] Rank candidate directories from indexes first, then expand to maps/files/symbols 5. [ ] Emit compact markdown-first context bundles with stable section order and retrieval-specific `Context bundle` title 6. [ ] Add tests for retrieval ranking, top-3 default behavior, and output shape 7. [ ] Add CLI support after the tool contract is stable 8. [ ] Update docs and skill guidance for retrieval usage ## Acceptance checklist - [ ] Tool works for natural-language queries via `query` - [ ] Output includes relevant indexes, strongest-match maps, likely files, symbols when useful, and instructions - [ ] Retrieval depends on paired metadata rather than raw source scanning - [ ] Ranking follows the index-first routing model with a top-3 default - [ ] `npm run typecheck` passes - [ ] `npm test` passes - [ ] `npm run lint` passes ## Sequencing note This change is intentionally follow-up work. It should start after the layered map protocol produces reliable paired routing metadata. The first delivery surface is the Pi tool. CLI support follows the stabilized tool contract.