Archon/migrations/017_drop_command_templates.sql
Rasmus Widing 7dc2e444f9
Deprecate database command templates (#425)
* Fix: Deprecate database command templates (#231)

Database command templates still influenced routing and /command-invoke, preventing file-based commands from fully replacing them.

Changes:
- Remove template routing, handlers, and DB module
- Add .archon/commands fallback for /command-invoke
- Drop template table from schema/migrations and update docs/tests

Fixes #231

* docs: update CLAUDE.md and README.md for template deprecation

Remove all references to deprecated database command templates:
- Update table count from 8 to 7 tables
- Remove command_templates table from database schema sections
- Remove "Command Templates (Global)" section from README
- Remove /template-add, /template-delete, /templates command docs
- Update "Custom command templates" to "Custom commands"
- Remove references to global templates stored in database

* Fix review findings: error handling, tests, migration guidance

- Fix commandFileExists to only catch ENOENT, throw on unexpected
  errors (permissions, I/O) instead of silently returning false
- Add test for file read failure after successful existence check
- Add test for path traversal rejection via isValidCommandName
- Add test for registered command taking precedence over fallback
- Add migration guidance comments for users with existing templates
2026-02-17 16:55:17 +02:00

11 lines
540 B
SQL

-- Migration: Drop deprecated command templates table
-- Command templates were replaced by file-based commands in .archon/commands
--
-- BREAKING CHANGE: If you have existing templates, export them before upgrading:
-- SELECT name, content FROM remote_agent_command_templates;
-- Then save each as .archon/commands/<name>.md in your repositories.
--
-- After this migration, use /command-invoke <name> instead of /<name>
DROP TABLE IF EXISTS remote_agent_command_templates;
DROP INDEX IF EXISTS idx_remote_agent_command_templates_name;