wiki-init
wiki-init
Use this skill to initialize or migrate a repo into the wiki + QMD + agent hook pattern.
The user may use natural language. Route intent like this:
- "como esta a estrutura?", "preciso migrar?", "doctor", "qmd esta ok?" -> run
doctor. - "instala", "prepara esse repo", "configura hooks" -> run
installas dry-run first, then ask the user to confirm the suggested wiki location and index before--write. - "migrar para o formato novo" -> run
migrateas dry-run first, then ask the user to confirm the suggested wiki location and index before--write. - "corrigir qmd", "managed qmd", "patch qmd" -> run
doctor, then useinstall --writeorupdate-hooks --writewith explicit approval to prepare the managed QMD checkout and wrappers.
Workflow
- Run
scripts/wiki-init.ts doctor --project <path>first. - Read the report: wiki layout, AGENTS/CLAUDE, harnesses, hooks, cache migration, installed drift, and QMD status.
- For changes, run
installormigratewithout--writeand show the planned file actions plus the suggested topology. - Ask the user explicitly: local wiki or shared wiki? Do not silently default to a sibling path. Use the harness's structured-question tool (see Prompting).
- Local — wiki lives inside this repo at
wiki/. Default for standalone projects and private experiments. - Shared — wiki lives outside this repo (sibling, central knowledge base, monorepo location). When the user picks shared, ask for the absolute or relative path in free-form text; detected siblings (
../knowledge-base, etc.) are suggestions the user must confirm or replace.
- Local — wiki lives inside this repo at
- Confirm the QMD index name with the user (free-form input). Suggest a sensible default (project basename for local, organization or product name for shared) but let the user override.
- Only run with
--writeafter passing explicit--wikiand--index. The script blocks writes without those flags. - Re-run
doctorafter writes. --writeprepares the managed QMD checkout under the skill cache (~/.local/share/skills/qmd/checkouts/qmd) and points project wrappers at that checkout. It cloneshttps://github.com/tobi/qmd.gitwhen missing and installs dependencies there.- If the target project needs an index, initialize QMD with the generated wrapper:
<wrapper> collection add <wiki-path> --name <index> --mask "**/*.md", then<wrapper> updateand<wrapper> embed. - Run
scripts/validate-wiki-init.tsbefore changing reusable templates or scripts.
Prompting
Follow the project-wide convention in CLAUDE.md / AGENTS.md ("Skill Prompting Conventions"). Use the harness's structured-question tool — AskUserQuestion (Claude Code), ask_user_question (Codex), or question (OpenCode) — for the decision points below. Use free-form text only where a path or identifier is needed.
| Decision point | Why structured | Suggested options |
|---|---|---|
| Wiki location | Branches the whole install: paths, hooks, presets | Local (in-repo wiki/) · Shared (separate path) |
| Cache migration when legacy detected | Hard-to-undo copy operation | Copy now (preserve legacy) · Skip migration |
| Drift remediation when installed files diverge | Triggers update-hooks --write |
Update all · Show diffs first · Ignore |
| Harness selection (multi-select) when more than one is detected | Avoids configuring agents the user doesn't want | claude · codex · opencode |
After the answer, restate the choice in your own words before running --write.
Free-form prompts (no structured tool):
- The shared wiki path
- The QMD index name
- Any custom QMD command (
--qmd-command) - Any field where the user needs to type a value the skill cannot enumerate
What the doctor reports
doctor is the always-safe entry point. It reports:
- wiki_path, qmd_index, recommended topology, and harness coverage.
- Presence of canonical files (
AGENTS.md,CLAUDE.md,.wiki-guardrails.yml, MCP/agent configs). - Markdown drift — tracked
.mdfiles outside the configured wiki path. - Cache migration — detects a legacy
~/.local/share/essential-skills/qmdcache and reports whether--writewill copy it to the current~/.local/share/skills/qmdlocation. The legacy directory is preserved (never deleted) for safety. - Installed drift — for every file the latest templates would generate, compares the on-disk content against the desired content. Reports stale paths (e.g., references to the legacy cache), outdated managed blocks in
AGENTS.md/CLAUDE.md, and hooks/configs that fall behind the templates. The recommended fix iswiki-init update-hooks --write. - QMD status — managed checkout location, version, patch report, index status.
- Planned actions — every file the next
install/migrate/update-hooksrun would create or update.
Script
Primary script:
bun skills/wiki-init/scripts/wiki-init.ts doctor --project .
QMD-focused alias:
bun skills/wiki-init/scripts/qmd-doctor.ts --project .
The script is intentionally dry-run by default. It writes only with --write.
Common examples:
bun skills/wiki-init/scripts/wiki-init.ts doctor --project /path/to/project
bun test skills/wiki-init/scripts/wiki-init.test.ts
bun skills/wiki-init/scripts/wiki-init.ts migrate --project /path/to/project --wiki ../knowledge-base --index my-index
bun skills/wiki-init/scripts/wiki-init.ts install --project /path/to/project
bun skills/wiki-init/scripts/wiki-init.ts install --project /path/to/project --wiki ../knowledge-base --index my-project --harness claude,codex,opencode --write
Presets
Use references/presets.md for the supported project shapes: local wiki, central sibling wiki, multi-repo org wiki, and docs-only migration.
Boundaries
- Do not auto-ingest wiki content. Hooks only raise signal; the agent decides semantically.
- Do not patch or install QMD globally.
- Prefer a managed project wrapper for QMD over shell aliases or
bunx. The wrapper must be accompanied by a provenance manifest recording the managed checkout, upstream repo/ref, wrapped binary, version, patch report, language, and embedding model. - Keep reusable skill files free of user-specific absolute paths. Local absolute paths may appear only in generated per-machine wrappers/manifests/config after install.
- Keep templates inside this skill directory.
More from djalmajr/skills
wiki-ingest
Processes a new source from raw/ into the wiki. Activates when the user asks to ingest, process, add, or incorporate a source into the knowledge base.
8agile-onboarding
Onboarding guide for new team members in the agile flow with AI. Use when someone new joins the team and needs to understand how the planning, execution, and tracking flow works with AI agents.
7agile-intake
Structures new and vague problems into clear intake documents. Use when the problem is not yet mature enough for the backlog, when someone brings an idea or need without defined scope, or when you need to decide what the next artifact in the flow should be.
7wiki-query
Answers questions about the wiki knowledge base. Activates when the user asks about concepts, processes, entities, or any wiki content.
7agile-status
Tracks delivery progress in three modes — checkpoint (daily), consolidation (period report), and closure (post-implementation). Use when you need to record progress, consolidate a period, or formally close a delivery.
7agile-story
Creates execution plan with tasks for a single story or a localized standalone change. Use when the work fits in one cycle — either a story already scoped by an epic, or a small/localized change that doesn't need decomposition.
7