install
source · Clone the upstream repo
git clone https://github.com/jmagly/aiwg
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/jmagly/aiwg "$T" && mkdir -p ~/.claude/skills && cp -r "$T/agentic/code/frameworks/sdlc-complete/skills/provenance-query" ~/.claude/skills/jmagly-aiwg-provenance-query-ae6c9b && rm -rf "$T"
manifest:
agentic/code/frameworks/sdlc-complete/skills/provenance-query/SKILL.mdsource content
Provenance Query Command
Query provenance chains to understand artifact derivation, impact, and attribution.
Instructions
When invoked, query provenance graph:
-
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
- Read all records from
-
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
and.aiwg/
for filessrc/ - 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
-
Format output
- Default: indented tree
: Markdown table--format table
: Mermaid diagram--format mermaid
: Raw JSON--format json
-
Display results
- Show query results
- Include summary statistics
Subcommands
- Full derivation chain for artifacttrace [path]
- What depends on this artifactimpact [path]
- Find artifacts without provenanceorphans
- Show agent attribution summaryagents
Arguments
- Path to artifact (required for trace/impact)[artifact-path]
- Traversal direction (default: both)--direction [forward|backward|both]
- Maximum traversal depth (default: unlimited)--depth [n]
- Output format (default: tree)--format [tree|table|mermaid|json]
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