Skip to content

Refactor: Extract validation to shared utils module#19

Open
redwing509 wants to merge 1 commit intoApexOpsStudio:mainfrom
redwing509:autoclaw/issue-3-extract-validation
Open

Refactor: Extract validation to shared utils module#19
redwing509 wants to merge 1 commit intoApexOpsStudio:mainfrom
redwing509:autoclaw/issue-3-extract-validation

Conversation

@redwing509
Copy link

Summary

  • Extracts all scattered validation functions (validate_description, validate_task_id, validate_task_file) into utils/validation.py
  • Moves duplicated get_tasks_file() helper into utils/paths.py
  • Updates all command modules to import from shared utilities
  • Adds new tests for utils module (8 tests, all passing)
  • Pure refactor — no behavior changes

Closes #3

Changes

File Change
utils/__init__.py New — package init
utils/validation.py New — all validation logic
utils/paths.py New — shared path helpers
commands/add.py Removed local validation + path helpers, imports from utils
commands/list.py Removed local validation + path helpers, imports from utils
commands/done.py Removed local validation + path helpers, imports from utils
test_task.py Updated imports, added utils tests

Test plan

  • All 8 tests pass (pytest test_task.py -v)
  • CLI works (python task.py list, python task.py add, python task.py done)
  • No duplicate validation code remains in command files
  • No behavior changes — pure refactor

🤖 Generated with Claude Code

…odule

Moves scattered validation functions (validate_description, validate_task_id,
validate_task_file) into utils/validation.py and the duplicated get_tasks_file
helper into utils/paths.py. Updates all command modules to import from shared
utilities. Adds new tests for the utils module. Closes ApexOpsStudio#3.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Extract validation to utils module

1 participant