agent/claude
Snider 5d62464627
feat: Add initial structure for /core:refactor command (#91)
This commit introduces the initial framework for the `/core:refactor` command.

Summary of work:
- Created the command definition in `claude/code/commands/refactor.md`.
- Implemented a PHP script, `claude/code/scripts/refactor.php`, to handle the refactoring logic.
- Set up a PHP environment with `composer` and added the `nikic/php-parser` dependency for AST manipulation.
- Implemented a proof-of-concept for the `extract-method` subcommand.

Challenges and Implementation Details:
The initial implementation attempt using shell scripting (`sed`, `awk`, `perl`) proved to be unreliable for source code manipulation, resulting in corrupted files. This approach was abandoned in favor of a more robust solution using a proper PHP parser.

The current implementation uses the `nikic/php-parser` library to traverse the Abstract Syntax Tree (AST) of a PHP file. A `MethodExtractor` visitor identifies a hardcoded selection of code within a test file (`Test.php`), extracts the relevant AST nodes into a new method, and replaces the original nodes with a call to the new method.

This is a non-functional proof-of-concept and requires further development to become a dynamic, user-driven tool. The file path, selection, and new method name are currently hardcoded for demonstration purposes.
2026-02-02 07:23:32 +00:00
..
api feat: /core:api generate API client from routes (#84) 2026-02-02 07:20:47 +00:00
ci feat: add README and flesh out all plugins 2026-02-01 19:48:51 +00:00
code feat: Add initial structure for /core:refactor command (#91) 2026-02-02 07:23:32 +00:00
collect feat(collect): add Borg-powered collection commands 2026-02-02 00:22:19 +00:00
core feat: /core:release version and release workflow (#87) 2026-02-02 07:21:59 +00:00
issue feat(plugin): add github issues integration (#69) 2026-02-02 07:14:21 +00:00
qa feat(qa): add /core:qa command for iterative QA loop (#74) 2026-02-02 07:17:23 +00:00
review feat: add README and flesh out all plugins 2026-02-01 19:48:51 +00:00
verify feat: add README and flesh out all plugins 2026-02-01 19:48:51 +00:00