feat: add web UI prompt library from canonical workflows (#428)

Surface short copy/paste operator prompts derived from canonical workflow
files with workflow path and SHA-256 citations. Adds /prompts, /prompts/{id},
and /api/prompts with one-click copy.

Closes #428
This commit is contained in:
2026-07-07 13:32:05 -04:00
parent e62c9f07ae
commit db248af8f1
4 changed files with 127 additions and 87 deletions
+20 -15
View File
@@ -128,7 +128,7 @@ def load_prompt_library() -> tuple[PromptEntry, ...]:
),
_static_entry(
slug="comment-issue",
label="Comment issue",
label="Comment on issue",
workflow_path=str(_WORKFLOW_ROOT / "create-issue.md"),
prompt_text=(
"Comment on the target Gitea issue only if exact comment_issue "
@@ -140,16 +140,14 @@ def load_prompt_library() -> tuple[PromptEntry, ...]:
),
_static_entry(
slug="cleanup",
label="PR queue cleanup",
workflow_path=str(_WORKFLOW_ROOT / "pr-queue-cleanup.md"),
label="Post-merge cleanup",
workflow_path="skills/llm-project-workflow/templates/worktree-cleanup.md",
prompt_text=(
"Run PR-only queue cleanup: build a complete open-PR inventory "
"with pagination proof, select exactly one eligible PR, dispatch "
"one canonical review for that PR, then stop after any terminal "
"review mutation. Load pr-queue-cleanup.md and review-merge-pr.md "
"before any mutation."
"Task: clean up branch/worktree for PR #<pr> / issue #<n> after merge. "
"Confirm the merge on remote master before any deletion; never "
"force-remove a dirty worktree."
),
source_note="Derived from pr-queue-cleanup.md; composes with review-merge-pr.md.",
source_note="Full cleanup steps live in templates/worktree-cleanup.md.",
),
_entry_from_workflow(
slug="audit",
@@ -159,19 +157,26 @@ def load_prompt_library() -> tuple[PromptEntry, ...]:
_static_entry(
slug="onboarding",
label="Project onboarding",
workflow_path="docs/webui-local-dev.md",
workflow_path="skills/llm-project-workflow/SKILL.md",
prompt_text=(
"Start a new MCP Control Plane session: call mcp_get_control_plane_guide, "
"prove identity and task capability, then complete the onboarding checklist "
"for this project at /projects. Keep Gitea, MCP tools, and canonical "
"workflows as the source of truth."
"Onboard this repository into the MCP Control Plane: prove identity "
"and task capability, configure author/reviewer/reconciler profiles "
"in separate namespaces, then complete the checklist at /projects. "
"Canonical router: skills/llm-project-workflow/SKILL.md."
),
source_note="Operator onboarding; checklist details live in the project registry UI.",
source_note="Checklist details live in webui/data/projects.registry.json and /projects.",
),
)
return entries
def find_prompt(slug: str) -> PromptEntry | None:
for entry in load_prompt_library():
if entry.slug == slug:
return entry
return None
def prompt_to_dict(entry: PromptEntry) -> dict[str, Any]:
return {
"slug": entry.slug,