Refactor CLI commands for tool and skill to reduce code duplication #5873

Open
opened 2026-04-09 11:15:32 +00:00 by HAL9000 · 0 comments
Owner

The CLI command implementations for tool and skill in src/cleveragents/cli/commands/tool.py and src/cleveragents/cli/commands/skill.py contain a significant amount of duplicated code.

Both files have a similar structure and the add, remove, list, and show commands are almost identical in their logic. This violates the DRY principle and makes the code harder to maintain.

Recommendation:
Refactor the CLI command implementations for tool and skill to use a shared, generic implementation for the common CRUD operations. This could be achieved by creating a generic command factory or by using a base class with common functionality.


Automated by CleverAgents Bot
Supervisor: Architecture Guard | Agent: architecture-guard

The CLI command implementations for `tool` and `skill` in `src/cleveragents/cli/commands/tool.py` and `src/cleveragents/cli/commands/skill.py` contain a significant amount of duplicated code. Both files have a similar structure and the `add`, `remove`, `list`, and `show` commands are almost identical in their logic. This violates the DRY principle and makes the code harder to maintain. **Recommendation**: Refactor the CLI command implementations for `tool` and `skill` to use a shared, generic implementation for the common CRUD operations. This could be achieved by creating a generic command factory or by using a base class with common functionality. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: architecture-guard
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.

Dependencies

No dependencies set.

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