feat(skill): add file operation skills #298

Closed
opened 2026-02-22 23:41:03 +00:00 by freemo · 0 comments
Owner

Metadata

  • Commit: feat(skill): add file operation skills
  • Branch: feature/m3-skill-file-search

Subtasks

  • Implement ReadFile, WriteFile, EditFile, and DeleteFile tools with read_only enforcement.
  • Register tools in Tool Registry with resource bindings for fs/git resources and sandbox path rewrite.
  • Add content size limits and encoding normalization (UTF-8) for file tools.
  • Add path traversal guards (reject .. and absolute paths outside sandbox root) and include rejected path in error.
  • Make Write/Edit operations atomic (write temp file then replace) to avoid partial writes on failures.
  • Add newline normalization option (preserve or enforce LF) with default preserve.
  • Add binary file detection for ReadFile and emit explicit error for binary content.
  • Add docs/reference/skills_file.md with examples and error cases.
  • Document file size limits and binary file behavior.
  • Tests (Behave): Add features/skill_file_ops.feature for read/write/edit/delete flows.
  • Tests (Robot): Add robot/skill_file_ops.robot for file ops integration.
  • Tests (ASV): Add benchmarks/file_tool_bench.py for read/write throughput.
  • Verify coverage >=97% via nox -s coverage_report. If coverage is <97% then review the current unit test coverage report at build/coverage.xml and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun nox -s coverage_report to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.
  • Run nox (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.

Section: ### Section 5: Actors, Skills & Tool Execution [WORKSTREAM C - Aditya Lead]
Status: Completed

## Metadata - **Commit**: `feat(skill): add file operation skills` - **Branch**: `feature/m3-skill-file-search` ## Subtasks - [x] Implement ReadFile, WriteFile, EditFile, and DeleteFile tools with read_only enforcement. - [x] Register tools in Tool Registry with resource bindings for fs/git resources and sandbox path rewrite. - [x] Add content size limits and encoding normalization (UTF-8) for file tools. - [x] Add path traversal guards (reject `..` and absolute paths outside sandbox root) and include rejected path in error. - [x] Make Write/Edit operations atomic (write temp file then replace) to avoid partial writes on failures. - [x] Add newline normalization option (preserve or enforce LF) with default preserve. - [x] Add binary file detection for ReadFile and emit explicit error for binary content. - [x] Add `docs/reference/skills_file.md` with examples and error cases. - [x] Document file size limits and binary file behavior. - [x] Tests (Behave): Add `features/skill_file_ops.feature` for read/write/edit/delete flows. - [x] Tests (Robot): Add `robot/skill_file_ops.robot` for file ops integration. - [x] Tests (ASV): Add `benchmarks/file_tool_bench.py` for read/write throughput. - [x] Verify coverage >=97% via `nox -s coverage_report`. If coverage is <97% then review the current unit test coverage report at `build/coverage.xml` and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun `nox -s coverage_report` to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%. - [x] Run `nox` (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across **entire** code base, do not ignore any failure even if it seems unrelated to this commit, fix it. **Section**: ### Section 5: Actors, Skills & Tool Execution [WORKSTREAM C - Aditya Lead] **Status**: Completed
freemo added this to the v3.1.0 milestone 2026-02-22 23:41:03 +00:00
freemo self-assigned this 2026-02-22 23:41:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#298
No description provided.