feat: Dynamic skill selection for analysis (AIIA-98) #4

Merged
Remmer merged 2 commits from feat/aiia-98-dynamic-skill-selection into master 2026-04-13 20:44:21 +00:00
Owner

Refactors analysis to use DB-driven skills instead of hardcoded Analysemodus. Builds on the Skills settings UI from AIIA-97.

Includes:

  • Dynamic skill selection in analysis
  • DB-driven skill configuration

Part of AIIA-96/AIIA-98.

Refactors analysis to use DB-driven skills instead of hardcoded Analysemodus. Builds on the Skills settings UI from AIIA-97. Includes: - Dynamic skill selection in analysis - DB-driven skill configuration Part of AIIA-96/AIIA-98.
Remmer added 3 commits 2026-04-13 20:25:08 +00:00
- Skill types (src/types/skill.ts) with form data, slugify helper
- Skills settings component with list view (drag-and-drop reorder),
  editor form (name, slug, prompt, output type, JSON schema, context
  requirements, active toggle), system skill protection
- API routes: GET/POST /api/settings/skills, GET/PATCH/DELETE
  /api/settings/skills/[id], PATCH /api/settings/skills/reorder
- Integrated into /einstellungen page (admin only)
- API routes depend on `skills` table from AIIA-94 schema migration

Co-Authored-By: Paperclip <noreply@paperclip.ing>
- Add GET /api/skills read-only endpoint for fetching active tenant skills
- Update analyse-form.tsx to fetch skills dynamically, show description
  as helper text, and render structured data results as table
- Extract SkillCards client component for the skill info cards
- Send skillId alongside mode slug for forward compatibility

Depends on: AIIA-97 (skills schema/API) and backend analysis integration.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Replace hardcoded ANALYSIS_MODES lookups with database-driven skill loading:
- Add skills table to Drizzle schema with tenant-scoped, configurable skills
- Add analyses.skill_id FK and structured_result JSONB column
- Refactor runAnalysis()/runAnalysisSync() to resolve skills from DB
- Support skillId, skillSlug, or legacy mode enum (with fallback)
- Add structured data output via generateObject() + jsonSchema() for
  skills with output_type = structured_data
- Update /api/analyses POST to accept skillId/skillSlug alongside mode
- Migration 0005: creates skills table, seeds system skills, backfills

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Remmer merged commit a5e58aa142 into master 2026-04-13 20:44:21 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Remmer/StageAI#4
No description provided.