home / skills / bdambrosio / cognitive_workbench / fs-head
This skill reads the first N lines of a text file from the filesystem sandbox to help you preview logs and configs quickly.
npx playbooks add skill bdambrosio/cognitive_workbench --skill fs-headReview the files below or copy the command above to add this skill to your agents.
---
name: fs-head
type: python
description: "Read the first N lines of a text file under scenarios/<world_name>/fs."
schema_hint: {"path": "string (relative)", "lines": "int"}
---
# fs-head
Return the first N lines of a text file from the filesystem sandbox.
## Input
- `path`: Relative path under `scenarios/<world_name>/fs` (required)
- `lines`: Number of lines to return (default: 20)
## Output
Success returns:
- `resource_id`: Note ID containing the head slice and metadata
## Examples
```json
{"type":"fs-head","path":"logs/app.log","lines":50,"out":"$log_head"}
```
This skill reads the first N lines of a text file located in the sandbox filesystem under scenarios/<world_name>/fs. It returns a small, shareable note resource containing the requested head slice and basic metadata. Use it to quickly inspect logs, config snippets, or other text artifacts without loading entire files.
Provide a relative path under scenarios/<world_name>/fs and an optional lines count (default 20). The skill opens the target file, reads up to the requested number of lines from the start, and creates a note resource containing the slice and metadata such as source path and actual lines returned. On success it returns a resource_id referencing the stored head content.
What path format should I use?
Use a relative path under scenarios/<world_name>/fs, for example logs/app.log.
What happens if the file has fewer lines than requested?
The skill returns all available lines and notes the actual number returned in the metadata.