Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Kb Audit Query

ASecurity

Filter and summarise the cross-library KB audit log. Reports confidentiality events (attribution drops, synthesis aborts, dispatcher failures, no-evidence markers, cross-library promotions) over a date range, by event type, and by source handle.

41 stars
0 votes
0 copies
0 views
Added 9/19/2026
researchpythonbash

Security Analysis

A100/100

Scanned 9/19/2026

Install to Claude Code

$npx -y skills add SteveGJones/ai-first-sdlc-practices --skill kb-audit-query --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Kb Audit Query?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Kb Audit Query
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/stevegjones-kb-audit-query/badge)](https://www.skillsdirectory.com/skills/stevegjones-kb-audit-query)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: kb-audit-query
description: Filter and summarise the cross-library KB audit log. Reports confidentiality events (attribution drops, synthesis aborts, dispatcher failures, no-evidence markers, cross-library promotions) over a date range, by event type, and by source handle.
disable-model-invocation: false
argument-hint: "[--since <ISO-date>] [--until <ISO-date>] [--event-type <type>] [--source <handle>] [--summary]"
---

# Audit Log Query

> **Lightweight**: This skill reads only index metadata (timestamps / audit log entries). Inline execution is acceptable.

Filter and summarise events from `library/audit.log` for the current project. The audit log is project-scope (lives in the project's library directory) and append-only; this skill is read-only.

## Arguments

All optional:

- `--since <ISO-date>` — events at or after this timestamp (e.g., `2026-01-01T00:00:00Z`)
- `--until <ISO-date>` — events at or before this timestamp
- `--event-type <type>` — one of: `attribution_drop_retrieval`, `synthesis_aborted_attribution`, `synthesis_aborted_dispatcher_error`, `source_dispatch_failed`, `no_evidence_marker`, `cross_library_promotion`
- `--source <handle>` — events for this library handle only
- `--summary` — emit count-by-type summary instead of detailed event list

## Steps

### Preflight: verify scripts package importable

```bash
python3 -c "
import sys, os, importlib.util
PLUGIN_ROOT = os.environ.get('CLAUDE_PLUGIN_ROOT', '')
SCRIPTS = os.path.join(PLUGIN_ROOT, 'scripts')
INIT = os.path.join(SCRIPTS, '__init__.py')
if os.path.isfile(INIT) and 'sdlc_knowledge_base_scripts' not in sys.modules:
    spec = importlib.util.spec_from_file_location(
        'sdlc_knowledge_base_scripts',
        INIT,
        submodule_search_locations=[SCRIPTS],
    )
    if spec and spec.loader:
        module = importlib.util.module_from_spec(spec)
        sys.modules['sdlc_knowledge_base_scripts'] = module
        spec.loader.exec_module(module)
try:
    import sdlc_knowledge_base_scripts.audit  # noqa: F401
    print('OK')
except ImportError:
    print('MISSING')
"
```

If output is `MISSING`, see kb-query for the install fallback. Otherwise prepend the importlib preamble to subsequent snippets.

### 1. Read and filter

```bash
python3 -c "
import sys, os, importlib.util, json
PLUGIN_ROOT = os.environ.get('CLAUDE_PLUGIN_ROOT', '')
SCRIPTS = os.path.join(PLUGIN_ROOT, 'scripts')
INIT = os.path.join(SCRIPTS, '__init__.py')
if os.path.isfile(INIT) and 'sdlc_knowledge_base_scripts' not in sys.modules:
    spec = importlib.util.spec_from_file_location(
        'sdlc_knowledge_base_scripts',
        INIT,
        submodule_search_locations=[SCRIPTS],
    )
    if spec and spec.loader:
        module = importlib.util.module_from_spec(spec)
        sys.modules['sdlc_knowledge_base_scripts'] = module
        spec.loader.exec_module(module)

from pathlib import Path
from sdlc_knowledge_base_scripts.audit import read_log

events = read_log(
    Path('library/audit.log'),
    event_type=<event-type or None>,
    source_handle=<source or None>,
    since=<since or None>,
    until=<until or None>,
)
print(json.dumps([e.__dict__ for e in events], indent=2))
"
```

Substitute the actual argument values into the read_log call. Quote string args; use Python None literal for unspecified ones.

### 2. Summarise (if --summary)

If `--summary` was specified, group results by event_type and count:

```python
from collections import Counter
counts = Counter(e.event_type for e in events)
for event_type, count in counts.most_common():
    print(f"{event_type}: {count}")
```

### 3. Render results

Render either:

- **Detailed view** (default): one block per event with timestamp, event_type, source_handle, reason, detail summary
- **Summary view** (`--summary`): count by type, then "see kb-audit-query --event-type X for details"

## Examples

Show all events in the last 90 days:

```
/sdlc-knowledge-base:kb-audit-query --since 2026-01-26T00:00:00Z
```

Count events by type for the last quarter:

```
/sdlc-knowledge-base:kb-audit-query --since 2026-01-01T00:00:00Z --summary
```

Investigate attribution drops on a specific source:

```
/sdlc-knowledge-base:kb-audit-query --event-type attribution_drop_retrieval --source corp-semi
```

## What this skill does NOT do

- It does not modify the audit log (read-only)
- It does not query other projects' audit logs (project-scope)
- It does not export audit data to external systems (the JSON output can be redirected if needed)

## Errors

- **Audit log file missing** — emit "No audit log at library/audit.log. Either no events have been logged yet, or this project has no library/ directory."
- **Malformed log file** — read_log skips malformed lines; the output may be smaller than expected

Attribution

SteveGJonesSteveGJones
View sourceMore from SteveGJones →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Competitor Analysis

This skill provides comprehensive analysis of competitor SEO and GEO strategies, revealing what's working in your market and identifying opportunities to outperform the competition.

1823 votes

Deep Research

Universal deep research agent team. 13-agent pipeline for rigorous academic research on any topic. 7 modes: full research, quick brief, paper review, lit-review, fact-check, Socratic guided research dialogue, and systematic review with optional meta-analysis. Covers research question formulation, Socratic mentoring, methodology design, systematic literature search, source verification, cross-source synthesis, risk of bias assessment, meta-analysis, APA 7.0 report compilation, editorial review...

452202 votes

Paperclip Distill

Use when an operation issue is a Paperclip cursor-window, distill, or backfill — `operationType: "distill"` or `"backfill"` and the body references a Paperclip source bundle for a project or root issue. Turn raw Paperclip activity into a wiki-insightful project page, decisions log, and history note. This skill exists specifically to replace the stiff, datestamp-heavy templated output that the deterministic distiller produces.

798221 votes

Academic Pipeline

Orchestrator for the full academic research pipeline: research -> write -> integrity check -> review -> revise -> re-review -> re-revise -> final integrity check -> finalize. Coordinates deep-research, academic-paper, and academic-paper-reviewer into a seamless 10-stage workflow with mandatory integrity verification, two-stage peer review, and reproducible quality gates. Triggers on: academic pipeline, research to paper, full paper workflow, paper pipeline, end-to-end paper, research-to-publi...

452201 votes

Exa Search

Semantic search, similar content discovery, and structured research using Exa API

304951 votes
View all in research →