You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some valid skill packages intentionally group opt-in asset bundles under paths
such as assets/components/<name>/. Flattening those bundles only to satisfy the
generic deep-nesting warning makes the package harder to maintain.
This PR adds --allow-nested-paths to validate structure and check. The
option suppresses only deep-nesting warnings within explicitly selected,
skill-relative subtrees. Other structure, frontmatter, orphan, token, Markdown,
and link checks continue unchanged.
Paths are normalized across operating systems, matched on path boundaries, and
rejected when absolute or when they escape the skill root. A visible info result
is emitted whenever an exception is applied.
The main implementation lives in:
structure/paths.go — portable relative-path validation and subtree matching
cmd/{validate_structure,check}.go — matching CLI flags and option propagation
structure/*_test.go, cmd/exitcode_integration_test.go, and testdata/nested-paths-skill/ — boundary, CLI, and output-format coverage
How to test
go test -race ./... -count=1
golangci-lint run
The integration tests cover both commands, comma-separated paths, Windows
separators, invalid absolute/traversal paths, similar-prefix siblings, and text,
JSON, and Markdown output.
Thank you @choplin — and not just for this PR. Getting three well-scoped, well-tested contributions in a row is a rare treat for this repo, and each one of them reads like it was written by someone who took the time to understand how the codebase is put together. The path-boundary matching (with a fixture specifically covering assets/components vs assets/components-extra), the eager CLI-side validation with clear error messages, and the visible info result when an exception is applied are all exactly how I'd want this feature built.
Reviewed and verified locally: full suite under go test -race ./... -count=1, vet and gofmt clean. Merging as-is once CI confirms.
One heads-up on sequencing: this merges first of your three. #83 shares structure/paths.go with this PR (plus some overlap with the recently-merged #78 in tokens.go), so I'll rebase it myself rather than bounce it back to you — the conflicts are from merge ordering on our side, not anything in your work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Some valid skill packages intentionally group opt-in asset bundles under paths
such as
assets/components/<name>/. Flattening those bundles only to satisfy thegeneric deep-nesting warning makes the package harder to maintain.
This PR adds
--allow-nested-pathstovalidate structureandcheck. Theoption suppresses only deep-nesting warnings within explicitly selected,
skill-relative subtrees. Other structure, frontmatter, orphan, token, Markdown,
and link checks continue unchanged.
Paths are normalized across operating systems, matched on path boundaries, and
rejected when absolute or when they escape the skill root. A visible info result
is emitted whenever an exception is applied.
The main implementation lives in:
structure/paths.go— portable relative-path validation and subtree matchingstructure/checks.go— scoped deep-nesting exception handlingcmd/{validate_structure,check}.go— matching CLI flags and option propagationstructure/*_test.go,cmd/exitcode_integration_test.go, andtestdata/nested-paths-skill/— boundary, CLI, and output-format coverageHow to test
go test -race ./... -count=1 golangci-lint runThe integration tests cover both commands, comma-separated paths, Windows
separators, invalid absolute/traversal paths, similar-prefix siblings, and text,
JSON, and Markdown output.
Checklist
go test -race ./... -count=1)golangci-lint run)