Skip to content
Back to skills

Provenance Query

ASecurity

Query provenance chains to trace artifact derivation and impact

  • 207 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 27, 2026
data-aigo

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add jmagly/aiwg --skill provenance-query --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Provenance Query?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Provenance Query
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jmagly-provenance-query/badge)](https://www.skillsdirectory.com/skills/jmagly-provenance-query)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
namespace: aiwg
name: provenance-query
platforms: [all]
description: Query provenance chains to trace artifact derivation and impact
commandHint:
  category: provenance
---

# Provenance Query Command

Query provenance chains to understand artifact derivation, impact, and attribution.

## Instructions

When invoked, query provenance graph:

1. **Load provenance graph**
   - Read all records from `.aiwg/research/provenance/records/`
   - Build in-memory graph of entity relationships
   - Index by entity URN for fast lookup

2. **Execute query** (based on subcommand)

   **trace** - Full derivation chain for an artifact:
   - Follow wasDerivedFrom relationships backward to root sources
   - Display as indented tree showing derivation types
   - Include depth limiting with `--depth`

   **impact** - What depends on this artifact:
   - Follow wasDerivedFrom relationships forward
   - Show all artifacts that derive from the queried artifact
   - Useful for understanding change impact

   **orphans** - Find artifacts without provenance:
   - Scan `.aiwg/` and `src/` for files
   - Compare against provenance records
   - List untracked artifacts

   **agents** - Show agent attribution:
   - Group provenance records by agent
   - Show what each agent created/modified
   - Include activity counts and timestamps

3. **Format output**
   - Default: indented tree
   - `--format table`: Markdown table
   - `--format mermaid`: Mermaid diagram
   - `--format json`: Raw JSON

4. **Display results**
   - Show query results
   - Include summary statistics

## Subcommands

- `trace [path]` - Full derivation chain for artifact
- `impact [path]` - What depends on this artifact
- `orphans` - Find artifacts without provenance
- `agents` - Show agent attribution summary

## Arguments

- `[artifact-path]` - Path to artifact (required for trace/impact)
- `--direction [forward|backward|both]` - Traversal direction (default: both)
- `--depth [n]` - Maximum traversal depth (default: unlimited)
- `--format [tree|table|mermaid|json]` - Output format (default: tree)

## References

- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/agents/provenance-manager.md - Provenance Manager agent
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/schemas/provenance/prov-record.yaml - PROV record schema
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/schemas/provenance/prov-query.yaml - Query schema
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/rules/provenance-tracking.md - Provenance tracking rules

Attribution

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

Loading comments…