一键导入
cqs-bootstrap
One-command setup for cqs in a new project — skills, tears infrastructure, CLAUDE.md, init, index.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
One-command setup for cqs in a new project — skills, tears infrastructure, CLAUDE.md, init, index.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run a multi-category code audit on the cqs codebase. Spawns parallel agents per batch.
Trust-boundary security audit of cqs — fans out unbiddable-auditor agents across 6 categories (RT-INJ/RT-FS/RT-RES/RT-DATA/RT-RELAY/RT-EXFIL), attacker mindset, run-the-attack PoC + regression guard.
Run the retrieval recall gate with dead-gold triage and the binary A/B regression test. Required before release tags; use after any retrieval-adjacent merge.
Run after making changes, before committing — reviews the current git diff for impact and risk via cqs review.
Release a new version of cqs. Bumps version, updates changelog, runs the recall gate, publishes to crates.io, creates GitHub release.
Comment-archaeology sweep - find work items hiding in TODO/FIXME/for-now comments and plan-doc ledgers, judge them, file issues, queue trivial fixes. Good idle-loop activity.
| 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] |
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.
cqs binary installed (check with which cqs)docs/ directory if needed# 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
## 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
<!-- When this grows past ~100 lines, archive completed phases to docs/roadmap-archive.md -->
## Current Phase
### Done
- [ ] ...
### Next
- [ ] ...
Create .claude/skills/ directory
Copy 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 upgradesland — land a ready branch: push, PR, pinned CI watch, squash-merge, issue verification, cleanupidle — the idle work loop: enumerate issues + triage rows, classify, pick, dispatcharcheo — comment-archaeology sweep: TODO/FIXME/deferral language → issues or trivial fixesrecall-gate — retrieval recall gate with dead-gold triage + binary A/B regression testred-team — adversarial testing against cqsaudit — code audit with parallel category agentspr — WSL-safe PR creation (always --body-file)release — version bump, changelog, publish, GitHub releaseCreate .claude/agents/ directory
Copy 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)lane-implementer — implementation lane with the full gate battery baked in (private target dir, all-targets clippy, targeted tests, provenance lint, commit-don't-push)explorer — codebase exploration via cqs semantic searchauditor — code audit agent with cqs tools built inseam-auditor — composition adversary (finds two correct units whose join lies)property-auditor — property-based testing lane (proptest: invariant + generator finds the input examples miss)interleaving-auditor — concurrency adversary (loom/stress: finds the schedule that breaks a shared invariant)cqs init (creates .cqs/ directory with database)cqs index (indexes all source files + notes)cqs stats — should show chunk count > 0.cqs/ to .gitignore if not already present (the index database is local, not shared)Check for existing sections first — don't duplicate if the user already has cqs config in their 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
cqs test-map <function_name> --json
cqs scout "task description" --json
cqs onboard "concept" --json
cqs gather "query" --json
cqs "search query" --json
cqs "function_name" --name-only --json
cqs "query" --include-type function --json # filter by chunk type
cqs "query" --exclude-type test --json # exclude chunk types
cqs read <path>
cqs read --focus <function>
cqs scout "description" — pre-investigation dashboard: search + callers/tests counts + staleness + notescqs task "description" — one-shot implementation context: scout + code + impact + placement + notescqs explain <fn> — function card: signature, callers, callees, similarcqs callers <fn> / cqs callees <fn> — call graph navigation (add --cross-project for 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 entriesRun cqs watch --serve in a separate terminal (or a systemd user service) to keep the index fresh AND serve fast daemon queries; cqs index for one-time refresh. CQS_NO_DAEMON=1 forces CLI mode.
cqs results carry calibration metadata. Act on it directly instead of paying a defensive re-read tax for what's already answered:
edge_kind on callers/callees/impact entries): call is syntactic ground truth; macro_heuristic / doc_reference are guesses (a token-tree match or a mention in prose, not a real call). Weight a heuristic edge lower than a call edge without opening the file. Absent ⇒ call.cqs dead --verdict): the tool classifies its own output — test-only / low-confidence-live / known-gap / dead. Trust the verdict; only dead is a confident absence claim. Use Type::method qualified queries to disambiguate same-named functions.rank_signals per JSON result): why a hit ranked — dense (concept match) / fts (literal-string match) / name_match / note_boost. A concept match justifies reading the chunk; a string match on a conceptual query is a known false friend; a note_boost is a prior opinion, not evidence. Suppress with --no-rank-signals on tight-budget calls.When working inside a git worktree, cqs search (and a bare query) is overlay-aware by default — it reflects your uncommitted/committed edits, not the parent branch's index (opt out with --no-overlay or CQS_WORKTREE_OVERLAY=0). The overlay is search-only: graph and scout commands (callers, impact, scout, gather, dead, …) still serve the parent index in a worktree, so re-read the actual files before acting on their output there.
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).
"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
13. Run `cqs stats` to confirm indexing worked
14. Test a search: `cqs "main entry point" --json` (should return results)
15. 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