Skip to content

refactor(skill): replace LocalBackend with FilesystemBackend based on filesystem.Backend interface#753

Merged
hi-pender merged 10 commits intoalpha/08from
gcb/skill_filesystem
Feb 4, 2026
Merged

refactor(skill): replace LocalBackend with FilesystemBackend based on filesystem.Backend interface#753
hi-pender merged 10 commits intoalpha/08from
gcb/skill_filesystem

Conversation

@hi-pender
Copy link
Contributor

Summary

Refactor the skill middleware to use filesystem.Backend interface instead of direct os package operations, making the implementation more unified and testable.

Changes

  • Remove LocalBackend that directly uses os package for file operations
  • Add filesystemBackend (unexported) that wraps filesystem.Backend interface
  • Simplify list() method by directly attempting to read SKILL.md files
  • Export Backend interface, unexport implementation details
  • Rename files: local.gofilesystem_backend.go, local_test.gofilesystem_backend_test.go
  • Update tests to use filesystem.InMemoryBackend for better testability

Benefits

  • Unified interface: Both Filesystem and Skill middlewares now use filesystem.Backend interface
  • Better testability: Can use InMemoryBackend for testing without real filesystem
  • Extensibility: Easy to switch to other Backend implementations (e.g., remote filesystem)
  • Simplified logic: Removed complex directory detection logic by relying on Read method behavior

@hi-pender hi-pender force-pushed the gcb/skill_filesystem branch from f41614c to 20e9211 Compare February 4, 2026 08:40
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (alpha/08@2eeb557). Learn more about missing BASE report.

Files with missing lines Patch % Lines
adk/middlewares/skill/filesystem_backend.go 96.87% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             alpha/08     #753   +/-   ##
===========================================
  Coverage            ?   80.29%           
===========================================
  Files               ?      145           
  Lines               ?    15628           
  Branches            ?        0           
===========================================
  Hits                ?    12549           
  Misses              ?     2106           
  Partials            ?      973           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hi-pender hi-pender force-pushed the gcb/skill_filesystem branch from fceac2f to e5f0cb8 Compare February 4, 2026 10:31
…d on filesystem.Backend interface

- Remove LocalBackend that directly uses os package
- Add filesystemBackend that wraps filesystem.Backend interface
- Simplify list() method by directly attempting to read SKILL.md
- Export Backend interface, unexport implementation details
- Update tests to use filesystem.InMemoryBackend
- Use GlobInfo with pattern '*/SKILL.md' to find skill files
- Fix InMemoryBackend.GlobInfo to match relative paths correctly
- Fix test expectation in TestInMemoryBackend_GlobInfo
@hi-pender hi-pender force-pushed the gcb/skill_filesystem branch from e5f0cb8 to da0bc81 Compare February 4, 2026 12:12
…esystem and remove Read Limit

- Rename NewFilesystemBackend to NewBackendFromFilesystem for clarity
- Remove explicit Limit parameter in Read, use default behavior
@hi-pender hi-pender changed the title refactor(adk/skill): replace LocalBackend with FilesystemBackend based on filesystem.Backend interface refactor(skill): replace LocalBackend with FilesystemBackend based on filesystem.Backend interface Feb 4, 2026
@hi-pender hi-pender merged commit 32a57da into alpha/08 Feb 4, 2026
15 of 16 checks passed
@hi-pender hi-pender deleted the gcb/skill_filesystem branch February 4, 2026 12:42
hi-pender added a commit that referenced this pull request Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants