Repository navigation
feat(agent): paca-analyst skill that drafts tasks in Refinement - #721
Conversation
There was a problem hiding this comment.
Important
The skill, routing and tests look sound, but the persona users actually get from the Business Analyst preset still tells the agent to create_task with no statusId, which the new Analyst role denies — so the documented setup (Business Analyst preset + Analyst role) fails on its first write.
Reviewed changes
- New
paca-analystbundled skill (bundledskills/content/paca-analyst.md): draft-only PM/BA intake in chat that writes to a refinement-category status, never approves or assigns, and reads code read-only. - Catalog and flavour derivation: new catalog entry; the agent flavour is derived (compatibility line →
triggers: /paca-analyst, MCP fallback block stripped), covered by the existing flavour tests. - Router rows: both
pacaflavours offer the skill for requirements/bug intake, and the agent flavour's Step 0.5 status table routes Refinement drafts to it. - Two new guards:
TestPacaAnalyst_ToolReferenceNamesRealTools(every backticked tool in the reference is registered inapps/mcp/src/tools) andTestPacaAgentRouter_RoutesRefinementToAnalyst. - Server
baskill template: new "Working in Paca" section pointing atpaca-analystand the Analyst role. - Docs:
pm-agent.mdstatus → implemented,default-skills.md,docs/README.mdindex,ROADMAP.md.
I checked the skill against the real MCP schemas and the Analyst-role tests: every tool name, the relates_to/duplicates link types, create_task.statusId, write_doc path handling and each quoted permission guarantee hold.
⚠️ The Business Analyst preset still creates tasks directly, bypassing Refinement
The user-facing preset is AGENT_PRESETS in apps/web/src/lib/agent-api.ts, and its business-analyst defaultSystemPrompt is copied into the agent when the preset is picked (create-agent-dialog.tsx:362-363). That prompt still instructs create_task with type Story/Epic but no statusId, and routing assigned tasks to paca-clarify — exactly what the Analyst role refuses, so a preset agent holding that role gets a 403 on its first create instead of drafting in Refinement. The template this PR did update (skill_templates.go) is served by GET /agents/skill-templates, which the web never reads, so the claim in docs/ai-agent/pm-agent.md:187 that the ba template "defers to paca-analyst so the two do not drift" does not hold for the preset users actually start from.
Technical details
# BA preset bypasses the paca-analyst flow
## Affected sites
- `apps/web/src/lib/agent-api.ts:81-89` — `business-analyst` preset `defaultSystemPrompt` tells the agent to create Story/Epic tasks directly and to skip routing in favour of `paca-clarify`.
- `apps/web/src/components/projects/agents/create-agent-dialog.tsx:344-363` — the preset's prompt is applied to the new agent's system prompt, so this text ships.
- `services/api/internal/service/agent/skill_templates.go:84-86` — the template updated by this PR; only exposed via `GET /agents/skill-templates` (pm-agent.md:185 notes nothing in the web consumes it).
## Required outcome
- An agent created from the Business Analyst preset with the Analyst role behaves like `paca-analyst`: it drafts in the refinement-category status (with `statusId`), never creates backlog tasks, and routes Refinement work to `paca-analyst` rather than `paca-clarify`.
- Either update the preset prompt accordingly, or state explicitly that presets are out of scope and adjust the "do not drift" wording in `pm-agent.md`.
## Suggested approach (optional)
Replace the `business-analyst` preset prompt's create instructions with a deferral mirroring the `skill_templates.go` change (`load_skill`/follow the `paca-analyst` skill; pass the refinement status id; recommend the Analyst role), keeping the existing "skip routing on assignment" sentence consistent with the new skill.ℹ️ The new /paca-analyst command is missing from the install and command reference
paca-analyst is installed and routable exactly like the other bundled skills, but docs/guides/install-skills.md, which has a ### /paca-<name> section for every command including /paca-role-policy, and the README "Available commands" table do not mention it. Users browsing setup docs will not discover the new workflow, even though docs/ai-agent/pm-agent.md documents it.
Technical details
# Missing command reference entries for /paca-analyst
## Affected sites
- `docs/guides/install-skills.md:118-251` — one section per bundled command; no `/paca-analyst` section.
- `README.md:441-462` — "Available commands" table; no `/paca-analyst` row.
## Required outcome
- A command-reference entry describing `/paca-analyst <idea or bug>`, the Analyst-role prerequisite, and that it drafts in Refinement for human approval.deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
The create-agent dialog's Business Analyst preset told the agent to create Story/Epic tasks with no statusId and to route assigned tasks to paca-clarify, so a preset agent holding the Analyst role was refused on its first write. Its prompt now defers to paca-analyst, drafts in the refinement-category status, and routes assigned tasks to paca-analyst; the preset description recommends the Analyst role. paca-analyst: reuse an existing checkout (workspace_prepare's default) and clone only into an empty directory, since the workspace persists; quote text evidence in drafts and ask the user to attach files on the board, since chat has no path to task attachments. Docs: /paca-analyst in the install guide and README command table, and pm-agent.md names the preset as well as the ba template.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed 3d2b5c7, the commit that resolves the prior review's feedback.
- Business Analyst preset fixed: the
AGENT_PRESETSprompt inapps/web/src/lib/agent-api.tsnow defers topaca-analystviaload_skill, callslist_task_statuses, and passes the refinement-category status id asstatusIdon everycreate_task, so a preset agent holding the Analyst role drafts instead of getting a 403. - Command reference added:
/paca-analyst <idea or bug>now appears in the README "Available commands" table and as a full section indocs/guides/install-skills.md, including the Analyst-role prerequisite and the draft-only behaviour. - Code-read guidance corrected: the skill now tells the agent to
workspace_inspectfirst, callworkspace_preparewith the defaultreusestrategy when a checkout exists, andcloneonly into an empty directory. - Bug-intake evidence corrected: the skill now quotes text evidence pasted in chat and asks the user to attach files/screenshots to the draft on the board, since chat has no attachment path.
- Docs wording aligned:
pm-agent.mdnow describes the preset and thebatemplate both deferring topaca-analyst, matching what ships.
I verified the preset's tool names (search_tasks, list_task_statuses, create_task) exist, that list_task_statuses returns Category so the agent can find the refinement status, and that the board supports task attachments. Both inline threads from the prior review are addressed and resolved.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
pikann
left a comment
There was a problem hiding this comment.
LGTM! Thank you for the contribution! 🚀

Summary
Second of two PRs for the PM / business analyst agent (part of #719). #720 added the permission model (Refinement status and the Analyst role); this one adds the agent skill that uses it.
What changes:
paca-analyst(bundledskills/content/paca-analyst.md): the agent discusses a feature request or bug with the user in plain or technical terms, reads the code, checks the board for overlapping tasks, and writes the result as draft tasks in a refinement-category status for a human to approve. Ground rules: drafts only (it always passes the refinement status id, never the Backlog default), never approves or moves a draft out of Refinement, leaves drafts unassigned and out of sprints, read-only on code, and treats a 403 as final instead of retrying another way. It uses the real Paca MCP tool names (create_task,write_doc,search_tasks, …).pacarouter skill (CLI and agent flavours) listspaca-analystfor requirements and bug triage, and the agent flavour's task-status table routes tasks in Refinement topaca-analyst(keep refining, never move out).skill_templates.go) points at the bundled skill and recommends giving the agent the project's Analyst role.docs/ai-agent/pm-agent.md(setup and usage),docs/ai-agent/default-skills.md,docs/README.mdandROADMAP.md.Type of Change
Tests
TestPacaAnalyst_ToolReferenceNamesRealTools: every Paca tool the skill names exists on the MCP server.TestPacaAgentRouter_RoutesRefinementToAnalyst: the agent router sends Refinement tasks topaca-analyst.go build ./...andgo test ./internal/...inservices/apipass on top of the feat(iam): Refinement drafts and an Analyst role that cannot approve them #720 merge (2e93cee2).Checklist
docs/ai-agent/pm-agent.md).