feat(skills): reworked skills and rules
CI / CI configuration security checks (push) Successful in 3s
CI / Capabilities and shell quality (push) Successful in 14s
CI / Python tests and compilation (push) Successful in 26s
CI / QMD unit tests (push) Successful in 5s
CI / Build and inspect generated packages (push) Successful in 14s
CI / PowerShell tests on Ubuntu (push) Successful in 1m4s
CI / Installed client configuration smoke tests (push) Successful in 33s
CI / Bash integration and installation guards (push) Successful in 1m1s

This commit is contained in:
Julian Lechner committed 2026-11-18 14:17:49 +01:00
1 parent 29632ff0ce
commit f5d8f6f11b
124 files changed
+1250 -8138

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ This directory contains registered hooks and optional utilities. They do not byp
When Flashbang is enabled, both clients register `Stop` (`flashbang`) for finish notifications. Claude also registers `PreCompact` (`Record-Compact`/`record-compact.sh`) and `SessionStart` (`Show-SessionStatePointer`/`show-session-state-pointer.sh`). PreCompact records its timestamp under the installed configuration root. Both session hooks point to an existing workspace `.ai-session/state.json`, using event `cwd` or the process working directory. The main agent owns that state; hooks never write it or print its contents. Missing state is a successful no-op.
Both clients register `PreToolUse` (`Validate-CommandSafety`/`validate-command-safety.sh`), which blocks clearly destructive shell commands by exiting 2; it parses command text, so it is a guard rail rather than a security boundary, and it fails open. Both clients also register `Stop` (`Check-CompletionEvidence`/`check-completion-evidence.sh`) and `UserPromptSubmit` (`Show-CorrectionPrompt`/`show-correction-prompt.sh`). Both call `agent-guards.py`, store nothing, and fail open. The first pushes back once on a completion claim without a named check while non-prose changes exist; the second asks the agent to propose a durable rule after a likely correction. A second `PreToolUse` hook (`Show-SearchReminder`/`show-search-reminder.sh`, also through `agent-guards.py`) reminds the agent once per session to run `semantic-search` before the first open search; it never blocks, stays silent once the session ran `qmd-search.mjs`, does nothing unless QMD is installed, and keeps only hashed per-session markers under `~/.my-ai-configuration/state/search-reminder/`.
Both clients register `PreToolUse` (`Validate-CommandSafety`/`validate-command-safety.sh`), which blocks clearly destructive shell commands by exiting 2; it parses command text, so it is a guard rail rather than a security boundary, and it fails open. Both clients also register `Stop` (`Check-CompletionEvidence`/`check-completion-evidence.sh`) and `UserPromptSubmit` (`Show-CorrectionPrompt`/`show-correction-prompt.sh`). Both call `agent-guards.py`, store nothing, and fail open. The first pushes back once on a completion claim without a named check while non-prose changes exist; the second asks the agent to propose a durable rule after a likely correction. A second `PreToolUse` hook (`Show-SearchReminder`/`show-search-reminder.sh`, also through `agent-guards.py`) reminds the agent to run `semantic-search` before the first open search and again after every 10 open searches without `qmd-search.mjs`, which also covers context lost to compaction; it never blocks, stays silent while the session keeps using `qmd-search.mjs`, does nothing unless QMD is installed, and keeps only hashed per-session markers under `~/.my-ai-configuration/state/search-reminder/`.
`Invoke-PostChangeVerification`/`invoke-post-change-verification.sh` is not registered or invoked automatically; it runs the repository build only when explicitly invoked. Python-based hooks resolve their interpreter through `Resolve-Python.ps1`/`resolve-python.sh` and are silently skipped without Python 3.11+. `Test-SessionConfig`/`test-session-config.sh` checks repository inputs during a build.
+15 -5
View File
@@ -35,7 +35,9 @@ SEARCH_TOOLS = ('Grep', 'Glob')
# shortcut: matches command text, not parsed shells; a wrapped or aliased search slips through, which only skips a reminder.
SEARCH_COMMAND = re.compile(r'(?:^|[\s;&|(])(?:rg|grep|egrep|fgrep|findstr|find|fd|ag|ack|select-string|sls|git\s+grep|'
r'(?:get-childitem|gci|ls|dir)\b[^|;&]*\s-(?:recurse|r)\b)(?=\s|$)', re.I)
SEARCH_CONTEXT = ('Search reminder (once per session): for open searches - unknown locations or identifiers, behavior '
# Searches without qmd-search before the reminder repeats; covers long sessions and context lost to compaction.
REMIND_EVERY = 10
SEARCH_CONTEXT = ('Search reminder: for open searches - unknown locations or identifiers, behavior '
'questions, discovery, or claims that something is absent - run `semantic-search` first: '
'node "$HOME/' + QMD_SEARCH + '" --query "<full question>" --top-k 5. Known paths, symbols, and exact '
'strings may use rg/Grep directly. An empty pattern search does not prove absence.')
@@ -102,11 +104,19 @@ def remind_search(event):
if not used_qmd and tool not in SEARCH_TOOLS and not SEARCH_COMMAND.search(command):
return
marker = search_marker(session)
if marker.is_symlink() or marker.exists():
if marker.is_symlink():
return
prune_markers(marker.parent, time.time())
marker.touch()
if not used_qmd:
if marker.exists():
try:
count = int(marker.read_text(encoding='utf-8') or '0') + 1
except ValueError:
count = 1
else:
prune_markers(marker.parent, time.time())
count = REMIND_EVERY
remind = not used_qmd and count >= REMIND_EVERY
marker.write_text('0' if used_qmd or remind else str(count), encoding='utf-8')
if remind:
print(json.dumps({'hookSpecificOutput': {'hookEventName': 'PreToolUse', 'additionalContext': SEARCH_CONTEXT}}))