Skip to content

feat: editable system task prompts (#636)#795

Merged
chubes4 merged 2 commits intomainfrom
feat/editable-system-task-prompts
Mar 13, 2026
Merged

feat: editable system task prompts (#636)#795
chubes4 merged 2 commits intomainfrom
feat/editable-system-task-prompts

Conversation

@chubes4
Copy link
Member

@chubes4 chubes4 commented Mar 13, 2026

Summary

Makes all AI prompts in system tasks editable — users can override defaults via REST API or CLI without touching PHP code.

  • Prompt framework in SystemTask base class: getPromptDefinitions(), resolvePrompt(), interpolatePrompt(), buildPromptFromTemplate(), plus static CRUD methods for overrides stored in wp_options
  • 4 tasks refactored (5 prompts total):
    • AltTextTaskgenerate prompt
    • MetaDescriptionTaskgenerate prompt
    • InternalLinkingTaskinsert_link prompt
    • DailyMemoryTaskdaily_summary + memory_cleanup prompts
  • REST API at /datamachine/v1/system/tasks/prompts — GET (list all), GET/PUT/DELETE per task/prompt
  • CLI commands on wp datamachine systemprompts, prompt-get, prompt-set, prompt-reset

How it works

Each task declares prompts with getPromptDefinitions() — key, label, description, default template, and {{variable}} descriptions. At runtime, resolvePrompt() checks for a user override in datamachine_task_prompts option, falls back to the default. interpolatePrompt() replaces {{variable}} placeholders with runtime values.

Override storage: wp_options key datamachine_task_prompts[task_type][prompt_key] => string. Empty string removes the override (reverts to default).

Testing

All endpoints and CLI commands tested on live site:

  • wp datamachine system prompts — lists all 5 prompts across 4 tasks
  • wp datamachine system prompt-get <task> <key> — shows effective prompt with override status
  • wp datamachine system prompt-set <task> <key> "..." — sets override, verified in subsequent get
  • wp datamachine system prompt-reset <task> <key> — clears override, reverts to default
  • REST GET/PUT/DELETE all return correct responses with proper error handling for invalid task/prompt combinations
  • Build passes (homeboy build data-machine)

Closes #636

Extracts hardcoded AI prompts from 4 system tasks into a configurable
template framework. Prompts are stored as overrides in wp_options with
automatic fallback to defaults. Each prompt declares its template
variables so users know what placeholders are available.

Tasks refactored: AltTextTask (1 prompt), MetaDescriptionTask (1),
InternalLinkingTask (1), DailyMemoryTask (2 — daily_summary and
memory_cleanup).

Adds REST endpoints (GET/PUT/DELETE) at /system/tasks/prompts and
CLI subcommands (prompts, prompt-get, prompt-set, prompt-reset)
to SystemCommand.

Closes #636
@github-actions
Copy link

github-actions bot commented Mar 13, 2026

Homeboy Results — data-machine

Lint

⚡ Scope: changed files only

lint (changed files only)

Test

⚡ Scope: changed files only

test (changed files only)

Audit

⚡ Scope: changed files only

audit (changed files only)

Tooling versions
  • Homeboy CLI: homeboy 0.74.1+2bfad35d
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v1

Homeboy Action v1

Removes chubes.net-specific guidance from the default prompt (PR
histories, version number rules, Lessons Learned sprawl) and
replaces with principle-driven language that works for any site.

The old specific guidance is now set as a site-level override on
chubes.net via the prompt override system.
@chubes4 chubes4 merged commit 68df914 into main Mar 13, 2026
3 checks passed
@chubes4 chubes4 deleted the feat/editable-system-task-prompts branch March 13, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System tasks: make AI prompts editable (framework, not per-task hack)

1 participant