GodModeAI2025/SkillSafeWerkstatt / query-llm-wiki
query-llm-wiki
UnverifiedSearch, filter, inventory, and answer from a verified SkillSafeWerkstatt release with claim-level source locators and read-only quality assessment. Use whenever the user asks about this wiki, requests original sources or citations, compares current and historical claims, filters metadata, inspects schema drift, or checks wiki quality without modifying it in Claude Code, Claude Cowork, or Codex.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 18.2 KB |
| evals/evals.json | config | 19.1 KB |
| references/answer-contract.md | markdown | 46.1 KB |
| references/query-filters.md | markdown | 2.6 KB |
| scripts/assess_quality.py | script | 1.8 KB |
| scripts/bm25.py | script | 8.2 KB |
| scripts/describe_actions.py | script | 4.4 KB |
| scripts/freshness.py | script | 3.6 KB |
| scripts/frontmatter_contract.py | script | 10.0 KB |
| scripts/identity_status.py | script | 6.0 KB |
| scripts/inventory_wiki.py | script | 6.5 KB |
| scripts/quality_core.py | script | 15.9 KB |
| scripts/search_core.py | script | 221.1 KB |
| scripts/search_wiki.py | script | 4.8 KB |
| scripts/sync_artifacts.py | script | 14.2 KB |
| scripts/trust_contract.py | script | 5.2 KB |
| scripts/verify_release.py | script | 12.1 KB |
| scripts/wiki_filters.py | script | 6.6 KB |
| scripts/wordforms.py | script | 56.0 KB |
scripts/search_wiki.py
View on GitHub#!/usr/bin/env python3
"""Rank relevant Markdown files in an initialized SkillSafeWerkstatt without modifying it.
This is the command-line wrapper of the query skill. It verifies the release
before and after the search; ranking, claims, snippets, reformulations and the
coverage block come from `search_core.py`, which exported knowledge skills share
byte for byte. The query and up to four reformulations come from `--query` and
`--also`, or as one JSON object on standard input with `--request -`. With
`--exhaustive` the same call also ranks the sources and scans every passage for
all words of all searches before an absence statement; every report carries
`search_record` and `absence_check`.
"""
from __future__ import annotations
import argparse
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 search_core
from verify_release import verify_snapshot
def exit_code(release: dict) -> int:
return {"wiki_busy": 2, "snapshot_changed": 3}.get(str(release.get("state")), 4)
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--target", required=True, help="Target wiki directory")
search_core.add_search_arguments(
parser,
history=True,
limit_help="Maximum number of results (1-100)",
exhaustive_help="Also rank sources and scan every passage of the wiki pages, meta/questions.md and the source "
"Markdown (with --include-history also the history snapshots) for all words of all searches; "
"returns at most 100,000 printed characters of matching passages under exhaustive_hits; "
"required before stating that the wiki holds nothing on a question",
manifest_help="Release manifest hash retained from verify_release.py; a different release reports snapshot_changed",
)
args = search_core.parse_search_arguments(parser)
# The request is read and checked before the target is touched.
try:
query, also, request_filter = search_core.query_from_arguments(args, sys.stdin)
except search_core.RequestError as exc:
raise SystemExit(str(exc)) from exc
target = Path(args.target).expanduser().resolve()
if not (target / "WIKI.md").is_file() or not (target / "wiki/index.md").is_file():
raise SystemExit("Target is not an initialized SkillSafeWerkstatt")
initial_release = verify_snapshot(target, args.expect_manifest_sha256)
if initial_release.get("state") != "ready":
print(search_core.report_json({"release": initial_release, "results": []}))
return exit_code(initial_release)
if args.limit < 1 or args.limit > 100:
raise SystemExit("limit must be between 1 and 100")
# The exhaustive scan ranks the sources too; the report prints the effective value.
include_sources = args.include_sources or args.exhaustive
try:
selector = search_core.selector_from(request_filter, args.filter_json)
found = search_core.search(
target,
query,
also=also,
limit=args.limit,
include_sources=include_sources,
include_history=args.include_history,
selector=selector,
exhaustive=args.exhaustive,
)
except (search_core.QueryError, search_core.RequestError) as exc:
raise SystemExit(str(exc)) from exc
if found["parser_errors"]:
final_release = verify_snapshot(target, str(initial_release.get("manifest_sha256") or ""))
release = final_release if final_release.get("state") != "ready" else initial_release
print(search_core.report_json({"state": "invalid_frontmatter", "release": release, "parser_errors": found["parser_errors"], "results": []}))
return 5 if final_release.get("state") == "ready" else exit_code(final_release)
report = {
"target": ".",
**search_core.report_body(
found,
initial_release,
selector,
{"include_sources": include_sources, "include_history": args.include_history},
),
}
final_release = verify_snapshot(target, str(initial_release.get("manifest_sha256") or ""))
if final_release.get("state") != "ready":
print(search_core.report_json({"release": final_release, "results": []}))
return exit_code(final_release)
print(search_core.report_json(report))
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 |