Skip to content

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

Open
choplin wants to merge 1 commit into
agent-ecosystem:mainfrom
choplin:feature/allow-nested-paths
Open

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

Conversation

@choplin

@choplin choplin commented Jul 24, 2026

Copy link
Copy Markdown

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)

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.

1 participant