Skip to content
Back to skills

Ck Doctor

ASecurity

Knowledge-base hygiene: setup doctor, schema lint, rebuild the index, freshness stamp. Run: /ck-doctor

  • 30 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 25, 2026
ai-agentspythonbash

Security analysis

A100/100

Scanned November 25, 2026

npx -y skills add majiayu000/claude-skill-registry-data --skill ck-doctor --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ck Doctor?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ck Doctor
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-ck-doctor/badge)](https://www.skillsdirectory.com/skills/majiayu000-ck-doctor)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ck-doctor
description: "Knowledge-base hygiene: setup doctor, schema lint, rebuild the index, freshness stamp. Run: /ck-doctor"
disable-model-invocation: true
---

# ck-doctor

Keeps the "second brain" consistent. Deterministic checks run in a script; then report the findings.

> If `.claude/contextkit/` is missing (script or `contextkit.config.json` not found) →
> ContextKit is not installed here: stop, and install via `/ck-setup` in the hub.

## Resolve project root

```bash
CK_ROOT="${CLAUDE_PROJECT_DIR:-}"; [ -d "$CK_ROOT/.claude/contextkit" ] || CK_ROOT="$(d="$PWD"; while [ "$d" != "/" ] && [ ! -d "$d/.claude/contextkit" ]; do d="$(dirname "$d")"; done; echo "$d")"; [ -d "$CK_ROOT/.claude/contextkit" ] || { echo "ContextKit not found: no .claude/contextkit in this directory or any parent"; exit 1; }
echo "$CK_ROOT"
```

1. **Check the setup:**
   ```bash
   CK_ROOT="${CLAUDE_PROJECT_DIR:-}"; [ -d "$CK_ROOT/.claude/contextkit" ] || CK_ROOT="$(d="$PWD"; while [ "$d" != "/" ] && [ ! -d "$d/.claude/contextkit" ]; do d="$(dirname "$d")"; done; echo "$d")"; [ -d "$CK_ROOT/.claude/contextkit" ] || { echo "ContextKit not found: no .claude/contextkit in this directory or any parent"; exit 1; }
   python3 "$CK_ROOT/.claude/contextkit/scripts/doctor.py"
   ```
2. **Lint + index** (lint first — required fields `id` / `type` / `summary`, a valid `status`, `id` equal to the filename, dangling or one-sided `related` edges; rebuilds `INDEX.md` when the schema is clean, otherwise stops with the errors):
   ```bash
   CK_ROOT="${CLAUDE_PROJECT_DIR:-}"; [ -d "$CK_ROOT/.claude/contextkit" ] || CK_ROOT="$(d="$PWD"; while [ "$d" != "/" ] && [ ! -d "$d/.claude/contextkit" ]; do d="$(dirname "$d")"; done; echo "$d")"; [ -d "$CK_ROOT/.claude/contextkit" ] || { echo "ContextKit not found: no .claude/contextkit in this directory or any parent"; exit 1; }
   python3 "$CK_ROOT/.claude/contextkit/scripts/knowledge.py"
   ```
3. **Content** (model judgment, report only — do not rewrite in bulk without approval).
   Use this fixed rubric every session:
   - **Missing Definition of Done**: a `ticket` without a `## Definition of Done` section → add it on the next edit (see `ck-create-note`).
   - **Duplicate / overlap**: same `type` and the same topic or a similar `summary` → propose a merge. Do not merge automatically.
   - **Contradiction**: two `related` entries, or two entries on the same topic (especially `decision`s), assert opposite facts, or a decision that is not `superseded` contradicts a newer one → mark it in the findings and ask for a resolution.
   - **LOG.md as a trace**: read the last 20 `## [` headings of `<knowledgePath>/LOG.md`. The same `id` several times in a short span is a signal that the entry was created too early or is still half-formed, beyond the audit trail itself.
   (Stale `proposed` / `open`, and dangling or one-sided `related` edges, are already caught deterministically in step 2 — only sharpen the content here.)
4. **Freshness stamp + log:**
   ```bash
   CK_ROOT="${CLAUDE_PROJECT_DIR:-}"; [ -d "$CK_ROOT/.claude/contextkit" ] || CK_ROOT="$(d="$PWD"; while [ "$d" != "/" ] && [ ! -d "$d/.claude/contextkit" ]; do d="$(dirname "$d")"; done; echo "$d")"; [ -d "$CK_ROOT/.claude/contextkit" ] || { echo "ContextKit not found: no .claude/contextkit in this directory or any parent"; exit 1; }
   mkdir -p "$CK_ROOT/.claude/contextkit/cache" && date > "$CK_ROOT/.claude/contextkit/cache/.last-knowledge-check"
   python3 "$CK_ROOT/.claude/contextkit/scripts/knowledge.py" --log lint "<n> entries · <m> warnings"
   ```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.