kumo-engine / fsutil
AGENTS.md34 starsChanged 23 days agoApache-2.0View on GitHub
Applies to io_utils/fsutil/*/.py, with naming guidance specifically for ioutils/fsutil/impl*.py.
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
If a narrow compatibility bridge must temporarily remain in a legacy file, you should keep it minimal and document why it cannot yet be …
- Distinctive: line 30
Avoid isinstance checks, type-safe behaviors should be handled by ParseURI and type hints
- Distinctive: line 54
If a backend does not support an API contract, you should codify that explicitly in that backend registration.
- Distinctive: line 78
If an import must remain local due to unavoidable environment/bootstrap constraints, you should keep it narrowly scoped and add a brief …
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fsutil Guidance
Applies to io_utils/fsutil/**/*.py, with naming guidance specifically for io_utils/fsutil/impl_*.py.
Fsutil File Roles and Refactor Direction
api.py: Public fsutil surface area and dispatch entrypoints. Keep this focused on typed APIs, normalization, and shared routing/guardrails.impl_*.py: Backend-specific behavior registered to the API dispatch functions.uri.py: URI parsing and backend URI type definitions used by dispatch and implementation modules.common.py: Shared fsutil helpers and cross-backend utilities that are intentionally backend-agnostic.compat_fsspec.py: Compatibility adapters for fsspec integration points.logging_policy.py: fsutil logging controls/policy helpers.__init__.py: Package exports and module initialization wiring.benchmark/*.py: Performance and stress tooling only; not part of the runtime fsutil API contract.
Legacy Modules
generic.pyands3_filesystem.pyare legacy modules.- For new feature development, you should not add new logic to these files wherever possible.
- During refactors, you should migrate behavior out of these legacy modules into
api.py+impl_*.py(and related typed/shared modules) and remove legacy code as it is replaced. - If a narrow compatibility bridge must temporarily remain in a legacy file, you should keep it minimal and document why it cannot yet be moved.
Type Safety from api.py
- Public fsutil entrypoints should expose precise type signatures and typed return values.
- APIs with mode-dependent return types should use
@overloadwithLiteral[...]selectors rather than loose unions at call sites. - Shared behavior contracts should use typed abstractions (
Protocol, boundedTypeVar,Generic,ABC) instead ofAny/objectplaceholders. - In
api.py, public signatures should avoidNone | str | ConcreteUri-style unions; preferstrfor external inputs, orAnyURIwhen URI objects must be accepted, and avoid concrete backend URI types in API-level annotations. - Type escapes should be rare and narrowly scoped; if unavoidable, they should include a brief why-comment and the narrowest possible ignore.
- Avoid isinstance checks, type-safe behaviors should be handled by ParseURI and type hints
Singledispatch Handling from api.py
- Public API functions should accept
strpaths and should immediately normalize viaParseURI(...)before backend-specific behavior. @singledispatchbase implementations should define only generic routing/validation logic; backend semantics should live in registeredimpl_*.pyhandlers.- In
api.py, acceptable first-argument forms for top-level@singledispatchfunctions are:str,None-inclusive forms (for exampleOptional[str]), or no annotation. - Unsupported URI/backends should be handled explicitly in base dispatch with clear failures (typically
NotImplementedError), not silent fallbacks. - Backend-specific behavior should remain explicit per registered URI type so differences are deliberate and reviewable.
- Wrapper APIs should preserve sync/async safety boundaries (for example via
@blocking_func/@blocking_method) rather than hiding blocking behavior.
Interface Pattern: Bare Functions + impl_* Registrations
- Most fsutil interfaces should be plain module-level functions in
api.py, not class-heavy service layers. - These interface functions should act as stable API entrypoints and should delegate backend-specific work through
@singledispatch. - Each backend implementation file (
impl_local.py,impl_s3.py,impl_gcs.py, etc.) should register handlers for the relevant API functions. - New backend behavior should usually be added by registering in the corresponding
impl_*.pyfile, not by branching on backend types insideapi.py. - This split should keep
api.pyfocused on typing, normalization, and shared guardrails, whileimpl_*files hold concrete backend semantics.
Explicit Dispatch Per Backend
- You should not rely on broad
singledispatchfallback behavior to define backend semantics. - You should define backend behavior explicitly in each relevant
impl_*.pyregistration so outcomes are deliberate and visible. - You should keep behavior local to backend implementation modules, similar to other explicit fsutil registrations.
- If a backend does not support an API contract, you should codify that explicitly in that backend registration.
# Avoid: behavior implied by broad fallback
@singledispatch
def some_api(path):
raise NotImplementedError# Prefer: explicit backend behavior in each impl_*.py
@api.some_api.register
def some_api_backend_a(uri: BackendAURI):
return perform_backend_a_action(uri)
@api.some_api.register
def some_api_backend_b(uri: BackendBURI):
return NoneImport Placement
- You should not add lazy function-local imports in
io_utils/fsutilby default. - You should prefer top-level imports so dependencies are explicit, code paths are clearer, and import behavior is consistent.
- If an import must remain local due to unavoidable environment/bootstrap constraints, you should keep it narrowly scoped and add a brief why-comment.
- You should not use local imports as a style preference or to hide optional behavior.
# Avoid
def run_operation(...):
import dependency_a
import dependency_b
from package import dependency_c
...# Prefer
import dependency_a
import dependency_b
from package import dependency_c
def run_operation(...):
...Impl Module Naming
- In
io_utils/fsutil/impl_*.py, you should avoid underscore-prefixed module-level implementation function names when there is no special reason. - You should keep names simple and readable because module scoping already namespaces these functions.
- You should prefer plain descriptive names and let registration decorators establish API mapping.
- You should use a leading underscore only when the symbol is truly private helper logic and not a primary implementation entrypoint.
# Avoid
@api.some_interface.register
def _handle_backend_a(uri: BackendAURI):
return BackendAResult(uri)# Prefer
@api.some_interface.register
def handle_backend_a(uri: BackendAURI):
return BackendAResult(uri)Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/development/agents.mdAGENTS.md
- kumo/pquery/AGENTS.mdAGENTS.md
- packages/diskgraph/diskgraph-train-table/AGENTS.mdAGENTS.md
- packages/kumo-pql/AGENTS.mdAGENTS.md
- ui/AGENTS.mdAGENTS.md
- io_utils/fsutil/CLAUDE.mdCLAUDE.md
- kumo/pquery/CLAUDE.mdCLAUDE.md
- packages/kumo-ui-catalog/CLAUDE.mdCLAUDE.md
- ui/CLAUDE.mdCLAUDE.md
- kumoai-referenceSkill
- kumo-custom-populationsSkill
- kumo-data-scienceSkill
- kumo-model-explanationsSkill
- kumo-model-persistenceSkill
- kumo-model-tuningSkill
- kumo-training-diagnosticsSkill
- build-uiSkill
- check-logsSkill
- code-uiSkill
- debug-issueSkill
- investigate-training-stageSkill
- preflightSkill
- review-mlSkill
- review-uiSkill
- code-ui-catalogSkill
- review-ui-catalogSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

