Skip to content

fix(cli): validate the folder of a SKILL.md or workflow-rules.mdc argument - #556

Merged
rng1995 merged 13 commits into
mainfrom
naren/port-cli-validate-manifest-file
Nov 16, 2026
Merged

rng1995 merged 13 commits into
mainfrom
naren/port-cli-validate-manifest-file

Conversation

@rng1995

@rng1995 rng1995 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

skillevaluator validate path/to/SKILL.md passed the file itself to Tier 1 and Tier 2, while Tier 3 already used the folder that holds it. The schema, version and quality checks failed with No skills found and the run exited 1, even for a clean skill. A run narrowed with --checks (for example --checks code-integrity or --checks unicode) could pass with exit 0 without scanning the skill's scripts, while the folder form failed. Results named the skill SKILL.md, and a run from inside the skill wrote its reports into the skill. validate path/to/workflow-rules.mdc failed the same way, with No workflow directories found from the schema check, and Tier 3 also received the workflow file itself.

Now a SKILL.md argument (any case, such as skill.md) or a workflow-rules.mdc argument is validated as the folder that holds it, for every tier, the publication name and the report location. The argument's own name decides this, so with --no-dedup a SKILL.md that is a symlink to a file with another name, such as shared/guide.md, also validates its folder. A --type that names another type keeps the file. The file form now gets the same refusals as the folder form. An explicit --output-dir inside the skill is refused, as it is for the folder argument. When the folder is a symlink or reparse point, the run is refused unless --no-dedup is passed, even with --tiers 1.

Changes

  • validate keeps the argument as typed. A file argument named SKILL.md (case-insensitive) is a skill manifest, and one named workflow-rules.mdc is a workflow manifest, by the name as typed. With --type auto, that name gives the type, so detection does not read the file a link points to. Other files are detected as before.
  • With --type auto, or a --type that names the manifest's own type, validate takes the folder of the typed path, resolves it, and recomputes the publication name from it. A --type that names another type keeps the file, as before: --type workflows on a SKILL.md, or --type rules on a workflow-rules.mdc, gives Tier 1 the file with that type.
  • The folder comes from the typed path, not from the resolved one, so a symlinked SKILL.md validates the folder that holds the link, the same as passing that folder. This also holds when the link points to a file with another name. Before, with --no-dedup, a SKILL.md linked to shared/guide.md was detected as unknown and validated alone, so --checks unicode exited 0 while the folder exited 1, and a workflow-rules.mdc linked to shared/rules.mdc was validated as a lone rules file.
  • Unless --no-dedup is passed, that folder goes through the same linked-root guard as a folder argument. validate linked-skill/SKILL.md, where linked-skill is a symlink or reparse point, is refused with exit 2, the same as validate linked-skill, so Tier 2 never reads the folder behind the link.
  • Tier 3 now also receives the folder of a workflow-rules.mdc argument. Before, it received the file; it already received the folder of a SKILL.md.
  • The report location guard now sees the folder. When the default report folder would fall inside the skill, as when the run starts from inside it, the reports go to <skill>-reports next to the skill, and an explicit --output-dir inside the skill is refused with Report output must be outside the publication target, as for the folder argument. Before, the file form wrote its reports into the skill in both cases.
  • The change is in validate(): a manifest name check that feeds type detection, and the folder mapping after it. The target resolution and Tier 3 path lines are untouched.
  • New tests/cli/test_validate_manifest_file.py, and test_default_autopilot_receives_skill_directory_for_file_input now asserts that Tier 1 and Tier 2 also receive the skill folder instead of stubbing them away.
  • One Fixed entry in the CHANGELOG.md Unreleased section.

Kept from public

  • The Tier 2 guard that refuses a symlinked or reparse-point root is reused as is, with the same message and exit code. It still also checks the argument as typed, so a SKILL.md that is itself a symlink is refused unless --no-dedup is passed, as before, while its folder is not refused.
  • The report location guard is reused as is; it now receives the folder.
  • Tier 3 already mapped a SKILL.md argument to its folder. That line stays; for a manifest argument it now receives the folder directly.
  • Only the manifest names are mapped. Tier 1 and Tier 2 validate any other file as given. For a file inside a skill, such as skills/x/scripts/y.py, Tier 3 and its dataset generation still receive that file's parent folder, as before.
  • Rules files stay single-file targets, plugin manifest files keep their current handling, and the standalone security-scan, tier1, tier2 and tier3 commands keep their own file handling.
  • Catalog runs are unchanged: each child already receives a skill folder.
  • The docs already say auto-detection recognizes a SKILL.md for skills and workflow-rules.mdc for workflows, so no docs change was needed.

Known trade-offs

  • A SKILL.md inside a symlinked folder is now refused unless --no-dedup is passed, even with --tiers 1, the same as passing that folder. The guard runs before --tiers narrows the run. Before, validate linked-skill/SKILL.md --tiers 1 --checks unicode exited 0; it now exits 2. Pass --no-dedup, or pass the real path instead of the linked one.
  • With --no-dedup, a SKILL.md or workflow-rules.mdc that is itself a symlink to a file outside its folder is no longer read by the Gitleaks secret scan, the same as for the folder argument: Gitleaks does not follow the link when it scans a folder. Before, the linked file was scanned on its own. With a GitHub token in shared/guide.md, validate simple/SKILL.md --no-dedup --tiers 1 --checks code-integrity exited 1 on Secrets Detection; it now exits 0, as validate simple --no-dedup --tiers 1 --checks code-integrity does before and after. A workflow-rules.mdc linked to shared/rules.mdc behaves the same way. The unicode and pii checks still read the linked file. Without --no-dedup, such a link is refused, as before. To scan the linked file itself, pass it, as in validate shared/guide.md.

Tests

  • New: 18 tests in tests/cli/test_validate_manifest_file.py:
    • skill parity of findings and exit code for schema,version,quality;
    • the same parity for a skill whose manifest is named skill.md;
    • whole-skill scan parity with --checks unicode;
    • workflow parity;
    • a workflow-rules.mdc argument sends its folder to Tier 1 and Tier 3;
    • a symlinked SKILL.md validates the link's own folder;
    • with --no-dedup, a SKILL.md or skill.md linked to shared/guide.md gives the same exit code and report as the folder with --checks unicode, with the auto type and with --type skill (4 cases);
    • without --no-dedup, a SKILL.md linked to shared/guide.md is refused with exit 2, even with --tiers 1, and validation never runs;
    • with --no-dedup, a workflow-rules.mdc linked to shared/rules.mdc gives the same exit code and report as the folder;
    • a SKILL.md inside a symlinked skill folder is refused with exit 2, like the folder, with the default tiers and with --tiers 1 (2 cases), and validation never runs;
    • with --no-dedup, a SKILL.md inside a symlinked skill folder gives the same report as the folder;
    • default reports from inside the skill go to <skill>-reports;
    • an explicit --output-dir inside the skill is refused, like the folder, and nothing is written there;
    • with --tiers 1, a non-manifest file inside a skill reaches Tier 1 as given.
  • Changed: 1 test in tests/cli/test_validate_defaults.py.
  • Fail-before on main 8b19b2fe3: 17 failed, 2 passed. The 16 parity, refusal, report location and Tier 3 target cases and the changed test fail. Two cases pass on main by design, as guards: the non-manifest file test and the refusal of a SKILL.md linked to shared/guide.md without --no-dedup.
  • Mutation checks in tests/cli/test_validate_manifest_file.py: with the manifest name compared case-sensitively, the skill.md test and the two linked skill.md cases fail and the other 15 pass. With auto-detection reading the resolved file again, only the three linked auto-type cases fail.
  • On HEAD: tests/cli/test_validate_manifest_file.py and tests/cli/test_validate_defaults.py: 41 passed.
  • Targeted modules on HEAD: tests/cli/test_validate_manifest_file.py, tests/cli/test_validate_defaults.py, tests/cli/test_content_type_detection.py, tests/test_artifact_applicability.py, tests/test_cli.py, tests/test_ci_workflows.py, tests/test_oss_packaging.py, tests/test_ci_change_classifier.py, tests/reporting/test_tier3_completed_agent_docs.py, tests/reporting/test_tier3_token_usage_reports.py, tests/reporting/test_tier3_incomplete_arms.py, tests/test_harbor_claude_refusal_fallback.py: 513 passed, 17 failed. The 17 failures come from the local Harbor version, which is older than the pinned one: 15 in tests/test_harbor_claude_refusal_fallback.py (No module named 'harbor.agents.agent_auth_resolution'), test_harbor_environment_kwarg_contract_matches_installed_source and test_validate_tier3_writes_the_same_report_pair. The same 17 fail on main 8b19b2fe3.
  • tests/test_commands.py, tests/cli/test_validate_plugin.py, tests/cli/test_tier_workflows.py, tests/test_catalog_discovery.py: 244 passed.
  • ruff check and ruff format --check pass on the changed Python files. The OSS boundary scan passes.
  • Merge checks: the branch included main 8b19b2fe3 and merged into main without conflicts.
  • The full suite is run separately.

🤖 Generated with Claude Code

rng1995 and others added 6 commits November 13, 2026 12:41
…ument

`validate path/to/SKILL.md` passed the file itself to Tier 1 and Tier 2,
while Tier 3 already used the folder that holds it. The schema, version
and quality checks then failed with "No skills found", a run narrowed
with --checks could pass without scanning the skill's other files, the
results carried the file name as the skill name, and a run from inside
the skill wrote its default reports into it. A workflow-rules.mdc
argument failed the same way with "No workflow directories found".

When the detected or forced type is skill and the argument is a SKILL.md
(any case), or the type is workflows and the argument is
workflow-rules.mdc, validate now uses the folder that holds the argument
for every tier, the publication name and the default report location.
The folder is taken from the path as given before it is resolved, so a
linked manifest validates the folder that holds the link. Other files,
such as a script inside a skill, are still validated as given, and
rules and plugin manifests are unchanged.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Passing a SKILL.md or workflow-rules.mdc now makes the folder that holds
it the Tier 1 and Tier 2 root. The Tier 2 guard that refuses a symlinked
or reparse-point root still checked only the argument as typed, so
`validate linked-skill/SKILL.md` sent the whole folder behind the link to
Tier 2, while `validate linked-skill` is refused. Check that folder with
the same guard before using it, so the file form is refused the same way.

The changelog entry now says Tier 1 and Tier 2 received the file itself,
which is what happened before.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fest argument

A SKILL.md or workflow-rules.mdc argument now stands for the folder that
holds it, so the checks that apply to a folder argument apply to it too.
Pin the two that change what a user sees:

- A SKILL.md inside a symlinked skill folder is refused with exit 2, the
  same as passing that folder, with the default tiers and with --tiers 1,
  because the guard runs before --tiers narrows the run. With --no-dedup
  the file form gives the same report as the folder form.
- An explicit --output-dir inside the skill is refused, the same as for
  the folder argument, instead of writing the reports into the skill.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The entry for SKILL.md and workflow-rules.mdc arguments said only that
schema, version and quality failed with "No skills found". A
workflow-rules.mdc argument failed the schema check with "No workflow
directories found" instead, so name both messages.

It also gave no hint that a file inside a symlinked folder is now
refused unless --no-dedup is passed, as that folder already is. Before,
such a run with --tiers 1 passed; a CI job that validates a SKILL.md
through a symlinked skills folder now stops with exit 2.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a real problem cleanly. A SKILL.md or workflow-rules.mdc argument is now mapped to its folder in one small block, so every tier, the report name and the report location match the folder form. The symlink refusal and the report location check are reused rather than copied, and the tests compare the file form against the folder form for findings, refusals and report placement. What remains is minor. Nothing pins the any-case SKILL.md match. The new code comment calls the mapping existing Tier 3 behavior, but for workflows it is new. And the claim that other files are never widened to a folder holds only for Tier 1 and Tier 2.

Comment thread src/skillevaluator/cli.py Resolved
Comment thread src/skillevaluator/cli.py Resolved
rng1995 and others added 5 commits November 14, 2026 11:06
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
skill.md is a supported manifest name, and a path typed in lowercase
reaches the same check on case-insensitive filesystems. Validate a skill
whose manifest is named skill.md through that file and through its
folder, and require the same report. An exact-case match on SKILL.md
would validate the file alone and fail with No skills found.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A workflow-rules.mdc argument now stands for its workflow folder in
every tier. Run Tier 1 and Tier 3 on that file and require both to
receive the folder. Before, Tier 3 received the file itself.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tier 3 already took the folder of a SKILL.md argument, but it received
a workflow-rules.mdc argument as the file. Say so in the code comment,
and note in the CHANGELOG entry that Tier 3 now receives the workflow
folder too.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed: yes. On current main validate path/SKILL.md fails with 'No skills found' on a clean skill, validate wf/workflow-rules.mdc fails the same way, and a run from inside the skill writes reports/ into it. Worse, with --checks unicode the file form exits 0 on a skill that hides characters in a script where the folder form exits 1, because only SKILL.md gets scanned. The change is small, and the symlink and --output-dir refusals are reused rather than copied.

What I raised earlier is fixed: the CHANGELOG conflict is gone, a lowercase skill.md now has a test (I checked that making the comparison case-sensitive fails it), and the Tier 3 change for workflows is in the code comment, the CHANGELOG and the description. The new tests pass here (35 passed) and 12 of them fail against current main, so they do check the fix. CI is green and the branch merges cleanly into main.

One small gap, not blocking: a SKILL.md that is a symlink to a file with a different name (for example guide.md) is still not mapped when --no-dedup is passed, because the type is detected on the resolved path. The file form then exits 0 as unknown while the folder form runs the manifest checks. I left an inline note with the repro. Fine to merge as is, or fix it here. Looks good to merge otherwise.

Comment thread src/skillevaluator/cli.py Resolved
validate detected the content type on the resolved path, so a SKILL.md that is
a symlink to a file with another name, such as shared/guide.md, read as an
unknown type and was validated as that single file. With --no-dedup, which
lets a linked manifest through, the folder exited 1 on a script with hidden
characters while the file argument exited 0.

A file passed as SKILL.md or workflow-rules.mdc is now a manifest by the name
it was passed under. With the auto type, or a --type that matches the
manifest, it validates the folder that holds the link. The linked-root
refusal in the default run is unchanged.

Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
@chrisknvidia

Copy link
Copy Markdown
Collaborator

Review follow-up on b2e36a288815.

No new PR-introduced defect confirmed. The previous symlink-to-differently-named-file issue is fixed by retaining the requested manifest name before type resolution. All 41 manifest/default CLI tests pass. Real subprocess runs with folder and SKILL.md arguments both detected hidden Unicode in a bundled script, exited 1 and wrote whole-skill JSON/terminal reports. Paid Tier 3 execution and dedup embeddings were not run. Please resolve the current merge conflict and retain the manifest/type/symlink/report-placement behavior.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rng1995
rng1995 enabled auto-merge (squash) November 16, 2026 12:22
@rng1995
rng1995 merged commit 602cbc0 into main Nov 16, 2026
27 checks passed
@rng1995
rng1995 deleted the naren/port-cli-validate-manifest-file branch November 16, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants