Skip to content

feat: respect flat skill layouts#24

Closed
philoserf wants to merge 1 commit intoagent-ecosystem:mainfrom
x3c3:feature/flat-skill-layouts
Closed

feat: respect flat skill layouts#24
philoserf wants to merge 1 commit intoagent-ecosystem:mainfrom
x3c3:feature/flat-skill-layouts

Conversation

@philoserf
Copy link
Contributor

Summary

  • Root-level support files alongside SKILL.md now receive equivalent treatment to files in references/, scripts/, and assets/ subdirectories
  • Adds classifyRootFile() to categorize root files as reference (.md), script, asset, or extraneous
  • Extracts shared IsExtraneousFile() helper to util package
  • Token counting, orphan detection, markdown validation, and reference analysis all respect flat layouts
  • Root .md files are deduplicated against references/ (subdirectory takes precedence)

Closes #23

Test plan

  • All existing tests pass (no regressions)
  • New unit tests for classification, token counting, orphan detection, markdown fence checking, and reference reading
  • Integration test with testdata/flat-skill/ fixture
  • go vet, golangci-lint, gofumpt all clean
  • Manual verification: ./skill-validator check testdata/flat-skill/ shows only README.md warning

🤖 Generated with Claude Code

Root-level support files alongside SKILL.md now receive equivalent
treatment to files in references/, scripts/, and assets/ subdirectories.

- Add classifyRootFile() to categorize root files as reference (.md),
  script, asset, or extraneous
- Extract shared IsExtraneousFile() helper to util package
- Count root .md files as reference tokens with per-file limits,
  deduplicate against references/ directory
- Count root text assets in standard token table
- Detect orphaned root support files in BFS reachability analysis
- Check root .md files for unclosed code fences
- Include non-extraneous root .md files in reference analysis
- Add testdata/flat-skill/ fixture for integration testing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@philoserf
Copy link
Contributor Author

philoserf commented Mar 4, 2026

I know that is a lot of change. I like flat skills until I need structure. I come from the one file until you need another. one folder until you need another, school. There were existing fumpt/lint as well. Since they were not in my change I left them.

@philoserf
Copy link
Contributor Author

Closing. We can reconstruct if the conversation on the issue is resolved in favor of flexibility.

@philoserf philoserf closed this Mar 5, 2026
@philoserf philoserf deleted the feature/flat-skill-layouts branch March 5, 2026 02:24
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.

Respect flat skill layouts — subdirectories are optional per spec

1 participant