GodModeAI2025/SkillSafeWerkstatt / maintain-llm-wiki
maintain-llm-wiki
UnverifiedCreate, maintain, inventory, migrate, recover, quality-review, optionally clean, release, or export an evidence-linked SkillSafeWerkstatt Markdown wiki. Use whenever the user wants to initialize or extend this wiki, ingest documents as Markdown, curate claims, clusters or concepts, clean metadata, restore files, record who reviewed which pages, resolve a OneDrive or SharePoint conflict copy, publish a release, or export a frozen read-only knowledge skill or an Open Knowledge Format bundle in Claude Code, Claude Cowork, or Codex.
scripts/apply_identity.py
View on GitHub#!/usr/bin/env python3
"""Apply one confirmed identity proposal to an initialized wiki."""
from __future__ import annotations
import argparse
import json
import os
import sys
from pathlib import Path
# Siblings are imported from this folder even where the interpreter leaves it
# off sys.path: python -I, python -P, PYTHONSAFEPATH=1.
_SCRIPT_DIR = str(Path(__file__).resolve().parent)
if _SCRIPT_DIR not in sys.path:
sys.path.insert(0, _SCRIPT_DIR)
import portable_io
from uuid import uuid4
from identity_contract import IdentityError, load_plan, profile_wiki_language, require_plan_language
from snapshot_wiki import create_snapshot
from wiki_lock import require_lock
def atomic_write(path: Path, text: str) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
temporary = path.with_name(f".{path.name}.{uuid4().hex}.tmp")
descriptor = os.open(str(temporary), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
try:
with os.fdopen(descriptor, "w", encoding="utf-8") as handle:
handle.write(text)
handle.flush()
os.fsync(handle.fileno())
portable_io.replace_with_retry(temporary, path)
finally:
if temporary.exists():
temporary.unlink()
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--target", required=True)
parser.add_argument("--lock-token", required=True)
parser.add_argument("--plan-file", required=True)
parser.add_argument("--expect-proposal-sha256", required=True)
parser.add_argument("--confirm-replace", action="store_true")
args = parser.parse_args()
target = Path(args.target).expanduser().resolve()
require_lock(target, args.lock_token)
try:
plan = load_plan(Path(args.plan_file), args.expect_proposal_sha256)
require_plan_language(
plan, profile_wiki_language(target), "the wiki language in schema/WIKI_PROFILE.md"
)
except IdentityError as exc:
raise SystemExit(str(exc)) from exc
paths = (target / "SOUL.md", target / "schema/CONTENT_POLICY.md")
if any(path.exists() for path in paths) and not args.confirm_replace:
raise SystemExit("identity files already exist; confirmed replacement requires --confirm-replace")
snapshot = create_snapshot(
target,
args.lock_token,
operation="apply-confirmed-identity",
selected_files=("SOUL.md", "schema/CONTENT_POLICY.md"),
)
atomic_write(paths[0], str(plan["soul_markdown"]))
atomic_write(paths[1], str(plan["content_policy_markdown"]))
print(json.dumps({
"state": "identity_applied",
"proposal_sha256": plan["proposal_sha256"],
"files": ["SOUL.md", "schema/CONTENT_POLICY.md"],
"snapshot": snapshot,
}, ensure_ascii=False, indent=2))
return 0
if __name__ == "__main__":
# Windows pipes default to the ANSI code page; output is UTF-8 everywhere.
for _stream in (sys.stdout, sys.stderr):
if hasattr(_stream, "reconfigure"):
_stream.reconfigure(encoding="utf-8", errors=_stream.errors)
raise SystemExit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |