name: cqs-bootstrap description: One-command setup for cqs in a new project — skills, tears infrastructure, CLAUDE.md, init, index. disable-model-invocation: false argument-hint: "[project_path]"
Bootstrap Project
Fully self-contained setup for cqs in a new project. After running this, the project has semantic search, notes, continuity tracking, and all skills working.
Prerequisites
cqsbinary installed (check withwhich cqs)- Project has a git repo initialized
- Running inside Claude Code in the target project directory (or pass project path as argument)
Process
Phase 1: Tears Infrastructure
- Check if files already exist — don't overwrite
- Create
docs/directory if needed - Write each file:
docs/notes.toml
# Notes - unified memory for AI collaborators
# Surprises (prediction errors) worth remembering
# sentiment: DISCRETE values only: -1, -0.5, 0, 0.5, 1
# -1 = serious pain, -0.5 = notable pain, 0 = neutral, 0.5 = notable gain, 1 = major win
[[note]]
sentiment = 0
text = "Project bootstrapped with cqs tears infrastructure."
mentions = ["docs/notes.toml", "PROJECT_CONTINUITY.md"]
PROJECT_CONTINUITY.md
# Project Continuity
## Right Now
(active task - update when starting something)
### What happened this session
### Tracked issues
### What's next
## Parked
(threads to revisit later)
## Open Issues
## Architecture
(version, languages, tests, key tech decisions)
ROADMAP.md
# Roadmap
<!-- When this grows past ~100 lines, archive completed phases to docs/roadmap-archive.md -->
## Current Phase
### Done
- [ ] ...
### Next
- [ ] ...
Phase 2: Skills
Create
.claude/skills/directoryCopy all portable skills from
/mnt/c/Projects/cqs/.claude/skills/:cqs— unified CLI dispatcher (search, graph, quality, notes, infrastructure — all subcommands)cqs-bootstrap— this skill (for nested projects)cqs-batch— batch mode: persistent Store + Embedder, stdin commands, JSONL output, pipeline syntaxcqs-plan— task planning with scout data + task-type templatescqs-verify— exercise all command categories, catch regressionsbefore-edit— run before modifying a function (impact + test-map + explain → checklist)investigate— run before starting a task (scout + gather → implementation brief)check-my-work— run after changes (review diff → risk checklist)update-tears— session state capturegroom-notes— note cleanupdocs-review— check docs for stalenessreindex— rebuild index with statstroubleshoot— diagnose common cqs issuesmigrate— handle schema version upgradesred-team— adversarial testing against cqsaudit— 14-category code audit with parallel agentspr— WSL-safe PR creation (always --body-file)release— version bump, changelog, publish, GitHub release
Create
.claude/agents/directoryCopy all agent definitions from
/mnt/c/Projects/cqs/.claude/agents/:investigator— pre-implementation investigation (scout + gather → brief)code-reviewer— diff review (review + impact → risk report)test-finder— test coverage lookup (test-map + impact → coverage report)implementer— implementation with cqs checkpoints (scout before, review after)explorer— codebase exploration via cqs semantic searchauditor— code audit agent with cqs tools built in
Phase 3: cqs Init & Index
- Run
cqs init(creates.cqs/directory with database) - Run
cqs index(indexes all source files + notes) - Verify with
cqs stats— should show chunk count > 0
Phase 4: .gitignore
- Add
.cqs/to.gitignoreif not already present (the index database is local, not shared)
Phase 5: CLAUDE.md Integration
- If CLAUDE.md exists, append the cqs sections below. If it doesn't exist, create it with these sections plus a basic header.
Check for existing sections first — don't duplicate if the user already has cqs config in their CLAUDE.md.
Sections to add to CLAUDE.md:
## Read First
* `PROJECT_CONTINUITY.md` -- what's happening right now
* `docs/notes.toml` -- observations indexed by cqs (warnings, patterns)
* `ROADMAP.md` -- what's done, what's next
## Skills
Project skills in `.claude/skills/`. Use `/skill-name` to invoke.
Skills are auto-discovered — they appear in `/` autocomplete automatically.
## Code Intelligence — When to Use What
**Use these cqs commands at the right moments.** They replace multiple manual searches with a single call. Workflow skills are even easier:
- `/before-edit <function>` — impact + tests + callers → modification checklist
- `/investigate <task>` — scout + gather → implementation brief
- `/check-my-work` — review current diff → risk assessment
### Before modifying a function:
```bash
cqs impact <function_name> --json
Before writing tests:
cqs test-map <function_name> --json
Before starting any implementation task:
cqs scout "task description" --json
Exploring unfamiliar code:
cqs onboard "concept" --json
cqs gather "query" --json
Searching (use instead of grep/glob):
cqs "search query" --json
cqs "function_name" --name-only --json
cqs "query" --include-type function --json # filter by chunk type (29 types)
cqs "query" --exclude-type test --json # exclude chunk types
cqs read <path>
cqs read --focus <function>
Full command reference
cqs explain <fn>— function card: signature, callers, callees, similarcqs callers <fn>/cqs callees <fn>— call graph navigation (add--cross-projectfor multi-repo)cqs deps <type>— type dependenciescqs impact <fn> --type-impact— impact analysis with type dependenciescqs similar <fn>— find similar codecqs related <fn>— co-occurrence: shared callers, callees, typescqs where "description"— placement suggestioncqs trace <source> <target>— shortest call pathcqs context <file>— module overviewcqs impact-diff [--base REF]— diff-aware impactcqs review— diff review with risk scoringcqs ci [--base REF] [--gate high|medium|off]— CI gatecqs blame <fn>— semantic git blamecqs dead— find dead codecqs health— codebase quality snapshotcqs stale— check index freshnesscqs notes add/update/remove/list— manage project notescqs stats— index statisticscqs batch— batch mode with pipeline syntaxcqs brief <file>— one-line-per-function summarycqs affected [--base REF]— diff -> changed functions -> callers -> testscqs neighbors <fn>— embedding-space nearest neighborscqs plan "description"— task planning with templatescqs test-map <fn>— find tests that exercise a functioncqs doctor [--fix]— check model, index, hardwarecqs diff <ref>/cqs drift <ref>— semantic diff/driftcqs suggest— auto-suggest notes from patternscqs chat— interactive REPLcqs audit-mode on/off— toggle audit modecqs gc— clean stale index entries
Run cqs watch in a separate terminal to keep the index fresh, or cqs index for one-time refresh.
Audit Mode
Before audits or fresh-eyes reviews:
cqs audit-mode on to exclude notes and force direct code examination.
After: cqs audit-mode off or let it auto-expire (30 min default).
Continuity (Tears)
"Update tears" = capture state before context compacts.
PROJECT_CONTINUITY.md-- right now, parked, blockers, open questions, pendingdocs/notes.toml-- observations with sentiment (indexed by cqs)
Use cqs notes add to add notes — it is available immediately. Direct file edits require cqs index to sync to SQLite.
Sentiment is DISCRETE — only 5 valid values: -1, -0.5, 0, 0.5, 1
### Phase 6: Verify
11. Run `cqs stats` to confirm indexing worked
12. Test a search: `cqs "main entry point" --json` (should return results)
13. Report summary: files created, chunks indexed, skills installed
## Rules
- **Never overwrite** existing files — skip with a message
- **Append, don't replace** CLAUDE.md content
- **Ask before** modifying `.gitignore` if it has complex rules
- If `cqs` binary isn't found, stop and tell the user to install it first
---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/jamie8johnson) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->