Skip to content

feat(structure): allow deep nesting at selected paths - #82

Merged
dacharyc merged 1 commit into
agent-ecosystem:mainfrom
choplin:feature/allow-nested-paths
Aug 4, 2026
Merged

feat(structure): allow deep nesting at selected paths#82
dacharyc merged 1 commit into
agent-ecosystem:mainfrom
choplin:feature/allow-nested-paths

Conversation

@choplin

@choplin choplin commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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 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
  • structure/checks.go — scoped deep-nesting exception handling
  • 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.

Checklist

  • Tests pass locally (go test -race ./... -count=1)
  • Lint passes locally (golangci-lint run)
  • New functionality includes tests
  • Breaking changes are noted above (if any)

@dacharyc

dacharyc commented Aug 4, 2026

Copy link
Copy Markdown
Member

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.

@dacharyc
dacharyc merged commit a64f2f7 into agent-ecosystem:main Aug 4, 2026
3 checks passed
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