.agents/memory/2026-02-28-skills-routes-extraction-plan-approved.md

1.6 KiB

2026-02-28 Session Notes

Skills Routes Extraction Plan Approved

Nicholai approved a detailed plan for extracting the Skills routes from the monolithic daemon.ts file as part of the daemon-refactor specification. The work has not yet begun—the assistant just started reading the relevant code sections.

Extraction Scope

The Skills module comprises ~470 lines of code (lines ~4170-4638 of daemon.ts) with zero database dependencies, making it an ideal first extraction candidate. The new module will be created at packages/daemon/src/routes/skills.ts and will implement six HTTP routes:

  • GET /api/skills (list installed)
  • GET /api/skills/browse (browse catalog)
  • GET /api/skills/search (search skills)
  • GET /api/skills/:name (get single skill)
  • POST /api/skills/install (install a skill)
  • DELETE /api/skills/:name (uninstall a skill)

Implementation Pattern

The extraction follows the existing mount pattern used in the codebase: a single exported function mountSkillsRoutes(app: Hono) that registers all routes and manages private module state (cache, AGENTS_DIR, SKILLS_DIR). This approach keeps extracted modules self-contained with no coupling back to daemon.ts.

Testing Strategy

New test coverage will include unit tests for helper functions (parseSkillFrontmatter, listInstalledSkills, formatInstalls) with edge cases, plus route integration tests validating basic CRUD operations and security (path traversal rejection on DELETE).

Next Steps

Create the new routes file, update daemon.ts to import and mount the routes, write tests, then verify with build, test, typecheck, lint, and manual API verification.