home / skills / bdambrosio / cognitive_workbench / fs-list
This skill lists files and directories under scenarios/world_name/fs and returns a structured Collection for easy navigation.
npx playbooks add skill bdambrosio/cognitive_workbench --skill fs-listReview the files below or copy the command above to add this skill to your agents.
---
name: fs-list
type: python
description: "List files and directories under scenarios/<world_name>/fs and return a Collection."
schema_hint: {"path": "string (relative)", "recursive": "bool", "include_files": "bool", "include_dirs": "bool", "max_entries": "int"}
---
# fs-list
List files and directories within the filesystem sandbox for the current world.
## Input
- `path`: Relative path under `scenarios/<world_name>/fs` (default: root)
- `recursive`: Whether to recurse into subdirectories (default: false)
- `include_files`: Include files (default: true)
- `include_dirs`: Include subdirectories as Collections (default: true)
- `max_entries`: Max entries created across recursion (default: 200)
## Output
Success returns:
- `resource_id`: Collection ID
- Collection items are Notes (files) and Collections (subdirectories)
## Examples
```json
{"type":"fs-list","path":".","out":"$root"}
{"type":"fs-list","path":"docs","recursive":true,"out":"$docs_tree"}
```
This skill lists files and directories under scenarios/<world_name>/fs and returns the results as a Collection. It produces Collection items where files become Notes and subdirectories become nested Collections. The output includes a resource_id referencing the created Collection for further use.
You provide a relative path under scenarios/<world_name>/fs and optional flags: recursive, include_files, include_dirs, and max_entries. The skill walks the specified directory (optionally recursively), converts files to Notes and directories to Collections, and stops when max_entries is reached. On success it returns a resource_id for the Collection containing the discovered items.
Can I list paths outside scenarios/<world_name>/fs?
No. The path must be relative and confined to scenarios/<world_name>/fs for the current world.
What happens if the filesystem has more entries than max_entries?
The listing stops once max_entries entries are created. Increase max_entries or narrow the path/disable recursion to capture everything you need.