agentsclimarketplace

Analysis provenance

Skill rjmurillo/ai-agents/.claude/skills/analysis-provenance

Identify code ownership before modifying validators or linters. Checks file headers for provenance indicators, reviews documentation, and determines provenance as UPSTREAM, LOCAL, VENDOR, or UNKNOWN. Prevents accidental modification of upstream tools.From its SKILL.md

Install
npx -y skills add rjmurillo/ai-agents --skill analysis-provenance

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

8.5 KB, as published. Nobody here has run it

Analysis Provenance

Identify code ownership before modifying validators, linters, or tool configurations.

Triggers

  • check provenance before modifying
  • is this file upstream or local
  • who owns this validator
  • check code ownership
  • analyze provenance

Quick Start

# Check provenance of a single file
python3 .claude/skills/analysis-provenance/scripts/check_provenance.py --target .config/markdownlint.json

# Check provenance of a directory
python3 .claude/skills/analysis-provenance/scripts/check_provenance.py --target .config/

# JSON output for automation
python3 .claude/skills/analysis-provenance/scripts/check_provenance.py --target PSScriptAnalyzerSettings.psd1 --format json

Quick Reference

CategoryMeaningAction
UPSTREAMExternal dependency (npm, pip, NuGet)Configure, do not modify
LOCALProject-owned codeModify as needed
VENDORCopied/vendored upstream codeAvoid modification, track upstream
UNKNOWNCannot determineInvestigate before modifying

When to Use

Use this skill before:

  • Modifying any validator or linter behavior
  • Changing tool configuration files
  • Investigating unexpected validation failures
  • Updating analyzer settings

Process

graph TD
    A[Target file or directory] --> B["1. Target Resolution<br/>Resolve paths, check exists"]
    B --> C["2. Directory Analysis<br/>node_modules, .venv, vendor,<br/>.gitmodules"]
    C --> D["3. Package Manifest Analysis<br/>package.json, requirements,<br/>lockfiles"]
    D --> E["4. File Header Analysis<br/>First 20 lines: generated<br/>markers, copyright notices"]
    E --> F["5. Provenance Determination<br/>Weight signals, return<br/>category + evidence"]
    F --> G["Decision:<br/>UPSTREAM - configure only<br/>LOCAL - safe to modify<br/>VENDOR - track upstream<br/>UNKNOWN - investigate first"]

Decision Tree

Need to modify a validator/linter?
│
├─ Run: python3 .claude/skills/analysis-provenance/scripts/check_provenance.py --target <file>
│
├─ Result: UPSTREAM
│  ├─ Do NOT modify the tool/file directly
│  ├─ Adjust local configuration instead
│  ├─ Check for configuration override options
│  └─ If no override exists, document why the rule is suppressed
│
└─ Result: LOCAL
   ├─ Safe to modify as needed
   ├─ Follow project coding standards
   └─ Test changes before committing

Command Reference

From the repository root, run:

python3 .claude/skills/analysis-provenance/scripts/check_provenance.py --target <path> [options]
ParameterRequiredDefaultDescription
--targetYes-File or directory to analyze
--formatNotextOutput format: text, json
--verboseNofalseInclude all evidence details
Exit CodeMeaning
0Provenance determined successfully
1Script error (file not found, invalid arguments)

Anti-Patterns

AvoidWhyInstead
Modifying files in node_modulesChanges lost on npm installConfigure via local config files
Editing vendored codeBreaks upstream trackingDocument suppression, fork if needed
Skipping provenance checkAccidental upstream modificationAlways check before modifying
Assuming config is localMay be generated or vendoredVerify with this skill

Verification

After running provenance check:

  • Category determined (UPSTREAM/LOCAL/VENDOR/UNKNOWN)
  • Evidence provided with signal types
  • Recommendation matches category
  • Exit code is 0 (successful analysis)

Related Skills

SkillRelationship
style-enforcementConfigure vs modify validators
programming-advisorEvaluate external solutions
analyzeBroad codebase investigation

<details> <summary><strong>Detection Signals Reference</strong></summary>

Upstream Indicators

SignalLocationExample
Package manifest entrypackage.json"markdownlint-cli2": "^0.12.1"
Node modules pathnode_modules/Any file under this directory
Python site-packages.venv/, site-packages/Any file under these directories
NuGet cache.nuget/, packages/Any file under these directories
File header commentFirst 20 lines"Generated by", "DO NOT EDIT", copyright notice
Git submodule.gitmodulesPath matches submodule

Local Indicators

SignalLocationExample
Under project rootOutside dependency directoriessrc/, .config/, scripts/
No external versionNot in lockfilesCustom script
Project copyrightFile headerProject-specific copyright
Git tracked.git/In project git history

Vendor Indicators

SignalLocationExample
vendor/ directoryProject rootvendor/third-party/
Vendor commentFile header"Vendored from <URL>"
VENDORED.md referenceSame directoryDocuments upstream source
</details> <details> <summary><strong>Examples</strong></summary>

Check Validator Config (LOCAL)

python3 .claude/skills/analysis-provenance/scripts/check_provenance.py --target .markdownlint.json
Provenance Check: .markdownlint.json
====================================
Category: LOCAL
Confidence: HIGH
Evidence:
  - File is under project root
  - File is tracked in git
  - No external package reference found
Recommendation: Safe to modify as needed.

Check External Tool (UPSTREAM)

python3 .claude/skills/analysis-provenance/scripts/check_provenance.py --target node_modules/markdownlint-cli2/lib/main.js
Provenance Check: node_modules/markdownlint-cli2/lib/main.js
============================================================
Category: UPSTREAM
Confidence: HIGH
Evidence:
  - Located in node_modules directory
  - Package: [email protected] (package.json)
  - npm registry: https://registry.npmjs.org/
Recommendation: Do NOT modify. Configure via .markdownlint.json instead.

JSON Output

python3 .claude/skills/analysis-provenance/scripts/check_provenance.py --target PSScriptAnalyzerSettings.psd1 --format json
{
  "target": "PSScriptAnalyzerSettings.psd1",
  "category": "LOCAL",
  "confidence": "HIGH",
  "evidence": [
    {"signal": "project_root", "value": true},
    {"signal": "git_tracked", "value": true},
    {"signal": "external_package", "value": false}
  ],
  "recommendation": "Safe to modify as needed."
}
</details> <details> <summary><strong>Common Validator/Linter Files</strong></summary>
ToolConfig FilesTypical Provenance
markdownlint.markdownlint.json, .markdownlint-cli2.jsoncLOCAL
PSScriptAnalyzerPSScriptAnalyzerSettings.psd1LOCAL
ESLint.eslintrc.json, eslint.config.jsLOCAL
Prettier.prettierrc, .prettierrc.jsonLOCAL
StyleCop.stylecop.jsonLOCAL
EditorConfig.editorconfigLOCAL
Tool binariesnode_modules/, .venv/UPSTREAM
</details> <details> <summary><strong>Integration with Agent Workflow</strong></summary>

Before Modifying Validators

# Check provenance FIRST
python3 .claude/skills/analysis-provenance/scripts/check_provenance.py \
  --target <validator-file>

# If UPSTREAM: adjust config
# If LOCAL: modify file

In Pre-commit Hooks

# Prevent accidental upstream modifications
- id: provenance-check
  name: Provenance Check
  entry: python3 .claude/skills/analysis-provenance/scripts/check_provenance.py
  args: [--target, node_modules, --exit-on-upstream]
  language: python
</details>

Timelessness: 8/10

Dependency management and provenance tracking are fundamental software engineering practices. The upstream vs local distinction applies regardless of package manager or language. Configuration over modification is a timeless pattern for external dependencies.

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.