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.
assets/knowledge-skill/identity_status.py
View on GitHub#!/usr/bin/env python3
"""Inspect the released SOUL and content policy without executing their prose."""
from __future__ import annotations
import json
import re
import sys
from pathlib import Path
from typing import Any
# 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)
from frontmatter_contract import FrontmatterError, parse_document
SOUL_REQUIRED = {
"soul_version", "status", "purpose", "knowledge_types", "audience",
"answer_language", "form_of_address", "tone", "detail", "answer_structure",
"citation_display", "uncertainty_style", "history_presentation",
"boundaries", "taboos",
}
POLICY_REQUIRED = {
"policy_version", "status", "update_model", "supersession_policy",
"removal_policy", "conflict_policy",
}
LANGUAGE_RE = re.compile(r"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$")
def read_frontmatter(path: Path, source: str) -> dict[str, Any]:
return parse_document(path.read_text(encoding="utf-8"), source, require_frontmatter=True).data
def assess_identity(target: Path) -> dict[str, Any]:
advisories: list[dict[str, str]] = []
result: dict[str, str] = {"soul": "missing", "content_policy": "missing"}
soul = target / "SOUL.md"
policy = target / "schema/CONTENT_POLICY.md"
if soul.is_file():
try:
data = read_frontmatter(soul, "SOUL.md")
missing = SOUL_REQUIRED - set(data)
if missing:
raise ValueError(f"missing fields: {sorted(missing)}")
if data.get("soul_version") != 1 or data.get("status") != "confirmed":
raise ValueError("soul_version 1 and status confirmed are required")
if not LANGUAGE_RE.fullmatch(str(data.get("answer_language") or "")):
raise ValueError("answer_language is invalid")
if not isinstance(data.get("knowledge_types"), list) or not data["knowledge_types"]:
raise ValueError("knowledge_types must be a non-empty list")
result["soul"] = "confirmed"
except (OSError, UnicodeError, FrontmatterError, ValueError) as exc:
result["soul"] = "invalid"
advisories.append({
"code": "soul_invalid",
"severity": "warning",
"message": f"SOUL.md is invalid: {exc}",
"recommended_action": "Use the maintenance skill to discuss and confirm a corrected identity proposal.",
})
else:
advisories.append({
"code": "soul_missing",
"severity": "notice",
"message": "This released wiki has no confirmed SOUL.md.",
"recommended_action": "Use the maintenance skill to complete the identity interview and publish a new release.",
})
if policy.is_file():
try:
data = read_frontmatter(policy, "schema/CONTENT_POLICY.md")
missing = POLICY_REQUIRED - set(data)
if missing:
raise ValueError(f"missing fields: {sorted(missing)}")
if data.get("policy_version") != 1 or data.get("status") != "confirmed":
raise ValueError("policy_version 1 and status confirmed are required")
if data.get("update_model") not in {"current-state", "historical-ledger", "hybrid"}:
raise ValueError("update_model is invalid")
if data.get("removal_policy") != "preview-confirm-never-automatic":
raise ValueError("removal_policy is invalid")
if data.get("conflict_policy") != "preserve-and-disclose":
raise ValueError("conflict_policy is invalid")
result["content_policy"] = "confirmed"
except (OSError, UnicodeError, FrontmatterError, ValueError) as exc:
result["content_policy"] = "invalid"
advisories.append({
"code": "content_policy_invalid",
"severity": "warning",
"message": f"schema/CONTENT_POLICY.md is invalid: {exc}",
"recommended_action": "Use the maintenance skill to confirm a corrected content-policy proposal.",
})
else:
advisories.append({
"code": "content_policy_missing",
"severity": "notice",
"message": "This released wiki has no confirmed schema/CONTENT_POLICY.md.",
"recommended_action": "Use the maintenance skill to confirm history and supersession behavior.",
})
result["state"] = (
"configured"
if result["soul"] == "confirmed" and result["content_policy"] == "confirmed"
else "attention-needed"
)
return {**result, "advisories": advisories}
def identity_contract(target: Path) -> dict[str, Any]:
result = assess_identity(target)
response: dict[str, Any] = {**result, "identity": {}, "content_policy_values": {}}
if result["soul"] == "confirmed":
soul = read_frontmatter(target / "SOUL.md", "SOUL.md")
response["identity"] = {key: soul[key] for key in sorted(SOUL_REQUIRED - {"soul_version", "status"})}
if result["content_policy"] == "confirmed":
policy = read_frontmatter(target / "schema/CONTENT_POLICY.md", "schema/CONTENT_POLICY.md")
response["content_policy_values"] = {
key: policy[key] for key in sorted(POLICY_REQUIRED - {"policy_version", "status"})
}
return response
def main() -> int:
knowledge = Path(__file__).resolve().parent.parent / "references" / "knowledge"
print(json.dumps(identity_contract(knowledge), 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 | Unverified | 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 |