qmd-knowledge-base
Maintain a markdown knowledge base at ~/git/knowledge-base/. Use when the user asks to interact with 'kb' or 'knowledge base' - adding content, deleting obsolete information, searching, or maintaining organization. Triggers on phrases like "add this to the kb", "delete from kb", "update kb", "maintain kb", "search kb", or any knowledge base operation.
What this skill does
# Knowledge Base Management
Maintain a structured markdown knowledge base for project documentation, code references, and learnings.
**Tool split**:
- **Write operations** (add, edit, delete files): direct file system tools
- **Read/search operations**: qmd MCP tools (`qmd_search`, `qmd_vector_search`, `qmd_deep_search`,
`qmd_get`, `qmd_multi_get`, `qmd_status`)
- **After any write**: run `qmd update` in the terminal to re-index so future searches reflect
the change
## Knowledge Base Structure
```text
~/git/knowledge-base/
├── index.md # Central index with references to all content
└── repos/ # Repository-specific documentation
├── <repo-name>/ # One directory per repository
│ ├── overview.md # Repository overview
│ ├── architecture.md # Code structure and architecture
│ ├── testing.md # How to run tests
│ └── ... # Additional repo-specific docs
└── ...
```
## Operation Modes
### Add Content
When the user asks to add content to the knowledge base:
1. **Determine target location**
- If repo-specific: `~/git/knowledge-base/repos/<repo-name>/`
- If general knowledge: `~/git/knowledge-base/`
- Ask user only if ambiguous
2. **Identify appropriate file using qmd**
- Use `qmd_search` (or `qmd_deep_search` for semantic matching) to find existing files
covering the same topic
- If a matching file is found, use `qmd_get` to read its full content
- Create a new file only when no existing file matches the topic
- Default to `overview.md` for general repo information
3. **Intelligent merge (CRITICAL)**
- **DO NOT simply append** - this creates duplication
- Read the destination file via `qmd_get` before editing
- Check if similar content already exists
- If content exists:
- Update/enhance existing content with new information
- Merge bullet points without duplication
- Replace outdated information
- If content is new:
- Find the most logical section to insert it
- Add to appropriate heading or create new heading
- Maintain existing document structure
4. **Write the file** using file system tools (create or edit)
5. **Maintain structure**
- Use clear markdown headings
- Group related information together
- Keep consistent formatting
- Use bullet points for lists
- Use code blocks for commands/code snippets
6. **Update index.md**
- Add reference to new file if created
- Keep index organized by category
- Use descriptive link text
7. **Verify and confirm**
- Show user what was added/updated
- Report location of changes
### Delete Content
When the user asks to delete content from the knowledge base:
1. **Locate content using qmd**
- Use `qmd_search` for keyword matches or `qmd_deep_search` for semantic search
- Call `qmd_get` on the returned document(s) to read the full context
- Confirm with user if multiple matches found
2. **Remove precisely** using file system tools
- Delete the specific content, not entire files unless requested
- Remove associated headings if section becomes empty
- Clean up orphaned references
3. **Update index.md**
- Remove references to deleted files
- Update references if content was moved/consolidated
4. **Re-index** by running `qmd update`
5. **Report changes**
- Show what was deleted
- Confirm completion
### Search Content
When the user asks to search the knowledge base, use qmd MCP tools exclusively:
| Use case | Tool |
|---|---|
| Exact keyword / phrase | `qmd_search` |
| Semantic / natural language | `qmd_vector_search` |
| Best quality, hybrid | `qmd_deep_search` |
| Retrieve a specific file | `qmd_get <path>` |
| Retrieve multiple files | `qmd_multi_get <glob>` |
| Check index health | `qmd_status` |
Show the user the document paths, scores, and relevant snippets returned by qmd. For deep
dives, follow up with `qmd_get` on the most relevant results.
### Maintain Knowledge Base
When the user asks to maintain or clean up the knowledge base:
1. **Check index health** with `qmd_status`
- Review collection info and any warnings
2. **Scan entire structure**
- Use `qmd_multi_get "**/*.md"` to read all files in the knowledge base
- Use `qmd_get index.md` to understand documented structure
- Identify files not referenced in index
3. **Check for duplication**
- Use `qmd_deep_search` with topic keywords to surface similar content across files
- Flag sections that appear in multiple places
- **Consolidate duplicates** using file system tools:
- Keep the most comprehensive version
- Delete redundant content
- Add cross-references if needed
4. **Verify organization**
- Ensure repo-specific content is in `repos/<repo-name>/`
- Move misplaced files to correct locations
- Verify file naming follows conventions:
- `overview.md` - general repo information
- `architecture.md` - code structure
- `testing.md` - test instructions
- `setup.md` - environment setup
- `troubleshooting.md` - common issues
- `commands.md` - useful commands
5. **Check index.md completeness**
- Ensure all files are referenced
- Remove broken links
- Add missing files
- Organize by logical categories:
- General Knowledge
- Repository Documentation
- Troubleshooting
- References
6. **Improve formatting**
- Ensure consistent heading levels
- Fix markdown linting issues
- Standardize code block formatting
- Normalize bullet point styles
7. **Re-index** by running `qmd update`
8. **Generate report**
- Summary of changes made
- List of duplicates consolidated
- Files moved or renamed
- Items added to index
- Recommendations for user review
## Directory Creation
**Always create missing directories automatically** without asking permission:
```bash
mkdir -p ~/git/knowledge-base/repos/<repo-name>
```
If `index.md` doesn't exist, create it with initial structure:
```markdown
# Knowledge Base Index
## Repository Documentation
- [Repository Name](repos/repository-name/overview.md)
## General Knowledge
(No entries yet)
```
## Best Practices
### Content Quality
- **Be specific**: Include file paths, function names, exact commands
- **Be concise**: Remove unnecessary verbosity
- **Be current**: Delete outdated information during updates
- **Cross-reference**: Link related topics across files
### File Organization
- One repo = one directory under `repos/`
- Split large files by topic (don't create 1000+ line files)
- Use descriptive filenames
- Keep `index.md` current
### Merge Strategy
When adding content that partially overlaps with existing content:
1. **Identify overlap**: What's new vs what exists
2. **Enhance existing**: Add new details to existing sections
3. **Avoid redundancy**: Don't repeat information
4. **Preserve context**: Keep related information together
**Example**:
Existing content:
```markdown
## Running Tests
- Run `npm test` for unit tests
```
New content to add: "Integration tests are in `tests/integration/` and run with `npm run test:integration`"
**Correct merge**:
```markdown
## Running Tests
- Run `npm test` for unit tests
- Run `npm run test:integration` for integration tests (located in `tests/integration/`)
```
**Incorrect (simple append)**:
```markdown
## Running Tests
- Run `npm test` for unit tests
## Running Tests
- Integration tests are in `tests/integration/` and run with `npm run test:integration`
```
## Common Patterns
### Adding repo-specific knowledge
```text
User: "Add to kb: The auth service is in src/services/auth/"
Steps:
1. Check current working directory or ask which repo
2. qmd_search "auth service" to find any existing file covering this
3. qmd_get the best match (e.g. repos/<repo>/architecture.md) to read current content
4. Add/update section about auth service location
5. Run qmd update to re-indexRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.