Code Wiki RU
Use this skill to create, refresh, validate, and safely apply Russian Obsidian-compatible code wikis under docs/wiki or a user-specified wiki path.
Default variables used below:
SKILL_DIR="${SKILL_DIR:-$HOME/.codex/skills/code-wiki-ru}"
REPO_ROOT="${REPO_ROOT:-$(pwd)}"
WIKI_PATH="${WIKI_PATH:-docs/wiki}"
META_PATH="${META_PATH:-docs/wiki/_meta}"
Safety
- Do not read, print, summarize, store, or commit secrets.
- Treat
.env,.env.*, private keys, certificates, credential stores, tokens, cookies, auth files, production dumps, and credential-bearing logs as redacted paths. - Keep code identifiers, paths, commands, package names, API names, config keys, schema names, and ADR titles exactly as written.
- Prefer deterministic scripts before model analysis.
- DeepSeek output is draft material only. Do not apply it until it is reviewed and validated by the host agent.
- Do not ask DeepSeek or OpenCode to modify files, stage files, commit files, run deployment commands, or execute destructive commands.
- Preserve user changes. Do not revert unrelated work in the repository.
Repository Inspection
- Identify
REPO_ROOTfrom the user request or current working directory. - Read repository-local instructions before generating wiki content, especially
AGENTS.md,README.md, ADR indexes, docs indexes, and architecture notes when present. - Inspect dependency/configuration files relevant to the repository type before writing architecture claims.
- Identify existing wiki location. Use
docs/wikiby default unless the user or repository config clearly points elsewhere. - Identify source documents and ADRs, but treat code as authoritative for runtime behavior.
Init/Index
Run the indexer before planning or drafting. It initializes wiki metadata and records bounded, non-secret source inventory.
python3 "$SKILL_DIR/scripts/build_repo_index.py" --repo "$REPO_ROOT" --wiki-path "${WIKI_PATH:-docs/wiki}" --meta-path "${META_PATH:-docs/wiki/_meta}"
Expected output is metadata under ${META_PATH:-docs/wiki/_meta}. If the command fails, fix the invocation or report the failure before proceeding.
Plan
Run the planner after the index exists. It creates update chunks for bounded analysis.
python3 "$SKILL_DIR/scripts/plan_wiki_update.py" --repo "$REPO_ROOT" --wiki-path "${WIKI_PATH:-docs/wiki}" --meta-path "${META_PATH:-docs/wiki/_meta}"
Use the generated plan to choose the smallest chunk set that satisfies the request. Keep unrelated chunks out of scope.
Analyze
- Read
references/wiki-taxonomy.mdbefore designing page structure. - Read
references/drift-policy.mdbefore classifying mismatches. - Prefer verified source references over broad summaries.
- Use Russian prose for wiki pages.
- Use Obsidian
[[wiki-links]]for internal links and relative Markdown links for source docs and ADRs. - Use Mermaid only when the available source context supports the diagram.
- Keep pages focused: one subsystem, component, flow, API surface, data concept, integration, operation, decision, or glossary topic per page.
Draft
For each selected CHUNK_ID, render a context pack:
python3 "$SKILL_DIR/scripts/render_context_pack.py" --repo "$REPO_ROOT" --wiki-path "${WIKI_PATH:-docs/wiki}" --meta-path "${META_PATH:-docs/wiki/_meta}" --chunk-id "$CHUNK_ID" --output "$CONTEXT_PACK"
Before invoking OpenCode, read:
references/opencode-deepseek.mdreferences/prompt-contracts.md
Use OpenCode only with the bounded context pack:
opencode run --model deepseek/deepseek-v4-pro --dir "$REPO_ROOT" --title "code-wiki-ru:$CHUNK_ID" "$(cat "$CONTEXT_PACK")"
Use deepseek/deepseek-v4-flash only for smoke tests. Stage model-authored page drafts under ${META_PATH:-docs/wiki/_meta}/drafts/; do not apply them directly.
Drift
Classify drift using references/drift-policy.md:
code-docs: docs disagree with verified runtime code.code-adr: code no longer follows accepted ADR intent.docs-adr: docs disagree with ADR intent.
Every drift candidate must include:
- drift class
- severity
- source file references
- short evidence summary
- recommended action
If evidence is insufficient, do not invent drift. State that the available context does not confirm a mismatch.
Validate
Run validation before applying staged pages or reporting completion:
python3 "$SKILL_DIR/scripts/validate_wiki.py" --repo "$REPO_ROOT" --wiki-path "${WIKI_PATH:-docs/wiki}" --meta-path "${META_PATH:-docs/wiki/_meta}"
Validation should check structure, links, required metadata, and staged output consistency. Report exact command output or the failure reason.
Apply
Apply drafted wiki changes only after the user explicitly asks for application or the current task clearly requires it.
Before applying:
- Review staged drafts in
${META_PATH:-docs/wiki/_meta}/drafts/. - Confirm proposed page paths match
references/wiki-taxonomy.md. - Confirm drift findings include source references and recommended actions.
- Confirm no secret-bearing content is present.
- Re-run validation after applying.
Do not stage or commit repository changes unless the user explicitly requests it.
Resume
When resuming an interrupted wiki update:
- Re-read repository-local instructions.
- Re-run the index command to refresh metadata.
- Re-run the plan command and compare the current chunks with any existing drafts.
- Continue from the smallest unfinished chunk.
- Validate before applying or reporting completion.
Discard stale drafts only when they are proven obsolete or the user authorizes cleanup.
References
references/wiki-taxonomy.md: wiki hierarchy, page naming, links, diagrams, and page focus rules.references/drift-policy.md: source-of-truth order, drift classes, severity levels, and required finding fields.references/opencode-deepseek.md: safe OpenCode invocation and DeepSeek handling rules.references/prompt-contracts.md: required Markdown sections and staged-output contract for model drafts.