feat: add canonical workflow prompt library to web UI (Closes #428)

Expose short copy/paste operator prompts on /prompts derived from canonical
workflow files with workflow path and SHA-256 hash. Adds JSON export at
/api/prompts, copy buttons, and tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
2026-07-07 13:31:40 -04:00
co-authored by Claude Opus 4.8
parent 6f7b57cffb
commit e62c9f07ae
7 changed files with 410 additions and 8 deletions
+8 -4
View File
@@ -12,6 +12,8 @@ from starlette.routing import Route
from webui.layout import render_page
from webui.project_registry import find_project, load_registry, registry_to_dict
from webui.project_views import render_project_detail, render_projects_list
from webui.prompt_library import library_to_dict
from webui.prompt_views import render_prompts_page
_READ_ONLY_METHODS = frozenset({"GET", "HEAD", "OPTIONS"})
@@ -80,10 +82,11 @@ async def api_projects(_request: Request) -> JSONResponse:
async def prompts(_request: Request) -> HTMLResponse:
return _stub_page(
"Prompts",
"Prompt library will surface canonical workflows from skills/llm-project-workflow/.",
)
return HTMLResponse(render_prompts_page())
async def api_prompts(_request: Request) -> JSONResponse:
return JSONResponse(library_to_dict())
async def runtime(_request: Request) -> HTMLResponse:
@@ -134,6 +137,7 @@ def create_app() -> Starlette:
Route("/projects/{project_id}", project_detail, methods=["GET"]),
Route("/api/projects", api_projects, methods=["GET"]),
Route("/prompts", prompts, methods=["GET"]),
Route("/api/prompts", api_prompts, methods=["GET"]),
Route("/runtime", runtime, methods=["GET"]),
Route("/audit", audit, methods=["GET"]),
Route("/worktrees", worktrees, methods=["GET"]),