@codyswann/lisa 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/utils/postinstall-trampoline.d.ts +3 -1
  2. package/dist/utils/postinstall-trampoline.d.ts.map +1 -1
  3. package/dist/utils/postinstall-trampoline.js +9 -2
  4. package/dist/utils/postinstall-trampoline.js.map +1 -1
  5. package/package.json +1 -1
  6. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  7. package/plugins/lisa/agents/confluence-prd-intake.md +63 -0
  8. package/plugins/lisa/commands/intake.md +3 -3
  9. package/plugins/lisa/skills/confluence-prd-intake/SKILL.md +259 -0
  10. package/plugins/lisa/skills/confluence-to-jira/SKILL.md +318 -0
  11. package/plugins/lisa/skills/intake/SKILL.md +16 -4
  12. package/plugins/lisa/skills/jira-validate-ticket/SKILL.md +53 -4
  13. package/plugins/lisa/skills/notion-prd-intake/SKILL.md +56 -13
  14. package/plugins/lisa/skills/notion-to-jira/SKILL.md +18 -1
  15. package/plugins/lisa/skills/plan/SKILL.md +3 -1
  16. package/plugins/lisa/skills/prd-ticket-coverage/SKILL.md +31 -11
  17. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  18. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  19. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  20. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  21. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  22. package/plugins/src/base/agents/confluence-prd-intake.md +63 -0
  23. package/plugins/src/base/commands/intake.md +3 -3
  24. package/plugins/src/base/skills/confluence-prd-intake/SKILL.md +259 -0
  25. package/plugins/src/base/skills/confluence-to-jira/SKILL.md +318 -0
  26. package/plugins/src/base/skills/intake/SKILL.md +16 -4
  27. package/plugins/src/base/skills/jira-validate-ticket/SKILL.md +53 -4
  28. package/plugins/src/base/skills/notion-prd-intake/SKILL.md +56 -13
  29. package/plugins/src/base/skills/notion-to-jira/SKILL.md +18 -1
  30. package/plugins/src/base/skills/plan/SKILL.md +3 -1
  31. package/plugins/src/base/skills/prd-ticket-coverage/SKILL.md +31 -11
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: prd-ticket-coverage
3
- description: "Verifies that every requirement in a Notion PRD is covered by at least one created JIRA ticket — no silent drops. Parses the PRD into atomic items (goals, user stories, functional/non-functional requirements, acceptance criteria, important notes), maps each to the created tickets, and produces a coverage matrix and verdict (COMPLETE / COMPLETE_WITH_SCOPE_CREEP / GAPS_FOUND / NO_TICKETS_FOUND). Used by notion-prd-intake post-write to gate the Status=Ticketed transition; can also be invoked standalone for after-the-fact audits."
4
- allowed-tools: ["Skill", "mcp__claude_ai_Notion__notion-fetch", "mcp__claude_ai_Notion__notion-get-comments", "mcp__atlassian__getJiraIssue", "mcp__atlassian__searchJiraIssuesUsingJql", "mcp__atlassian__getAccessibleAtlassianResources"]
3
+ description: "Verifies that every requirement in a PRD (Notion or Confluence) is covered by at least one created JIRA ticket — no silent drops. Parses the PRD into atomic items (goals, user stories, functional/non-functional requirements, acceptance criteria, important notes), maps each to the created tickets, and produces a coverage matrix and verdict (COMPLETE / COMPLETE_WITH_SCOPE_CREEP / GAPS_FOUND / NO_TICKETS_FOUND). Used by notion-prd-intake / confluence-prd-intake post-write to gate the Ticketed transition; can also be invoked standalone for after-the-fact audits."
4
+ allowed-tools: ["Skill", "mcp__claude_ai_Notion__notion-fetch", "mcp__claude_ai_Notion__notion-get-comments", "mcp__atlassian__getConfluencePage", "mcp__atlassian__getConfluencePageDescendants", "mcp__atlassian__getConfluencePageFooterComments", "mcp__atlassian__getConfluencePageInlineComments", "mcp__atlassian__getConfluenceCommentChildren", "mcp__atlassian__getJiraIssue", "mcp__atlassian__searchJiraIssuesUsingJql", "mcp__atlassian__getAccessibleAtlassianResources"]
5
5
  ---
6
6
 
7
7
  # PRD Ticket Coverage Audit: $ARGUMENTS
@@ -9,9 +9,16 @@ allowed-tools: ["Skill", "mcp__claude_ai_Notion__notion-fetch", "mcp__claude_ai_
9
9
  `$ARGUMENTS` is one of:
10
10
 
11
11
  1. A PRD URL alone — auto-discover created tickets via the PRD's epic remote link.
12
- 2. A PRD URL plus an explicit list of ticket keys — `<PRD URL> tickets=[KEY-1,KEY-2,...]`. Use this when called from `lisa:notion-prd-intake` (which knows the keys it just created).
12
+ 2. A PRD URL plus an explicit list of ticket keys — `<PRD URL> tickets=[KEY-1,KEY-2,...]`. Use this when called from `lisa:notion-prd-intake` or `lisa:confluence-prd-intake` (which know the keys they just created).
13
13
 
14
- Verify that every atomic item in the PRD is covered by at least one of the listed/discovered JIRA tickets. The output gates whether the PRD's `Status` should remain `Ticketed` or revert to `Blocked`.
14
+ The PRD URL can be a **Notion page URL** or a **Confluence page URL**. Detect the vendor from the host:
15
+
16
+ - `notion.so` / `notion.site` → Notion. Fetch with `mcp__claude_ai_Notion__notion-fetch` (`include_discussions: true`) and `mcp__claude_ai_Notion__notion-get-comments`.
17
+ - Atlassian Confluence host (e.g. `*.atlassian.net/wiki/...`) → Confluence. Fetch with `mcp__atlassian__getConfluencePage`, `mcp__atlassian__getConfluencePageDescendants` (for child epic pages), `mcp__atlassian__getConfluencePageFooterComments`, `mcp__atlassian__getConfluencePageInlineComments`, and `mcp__atlassian__getConfluenceCommentChildren` for nested replies.
18
+
19
+ Both vendors produce the same downstream artifact-extraction and coverage-matrix logic — only the fetch surface differs. The rest of this skill is vendor-agnostic.
20
+
21
+ Verify that every atomic item in the PRD is covered by at least one of the listed/discovered JIRA tickets. The output gates whether the PRD's lifecycle should remain at `Ticketed` (Notion `Status = Ticketed`, Confluence `prd-ticketed` label) or revert to `Blocked`.
15
22
 
16
23
  ## Why this exists
17
24
 
@@ -22,12 +29,17 @@ Per-ticket gates (`lisa:jira-validate-ticket`) prove each created ticket is well
22
29
  ### Phase 1 — Resolve inputs
23
30
 
24
31
  1. Parse `$ARGUMENTS`:
25
- - PRD URL → extract page ID.
32
+ - PRD URL → detect vendor from host, extract page ID.
26
33
  - Optional `tickets=[...]` → list of explicit ticket keys.
27
- 2. Fetch the PRD via `notion-fetch` with `include_discussions: true`. Capture: title, body, child Epic pages, all comment threads.
28
- 3. If the PRD has child Epic sub-pages (a multi-epic PRD like Home revamp), fetch each in parallel with `include_discussions: true`. The audit walks the full PRD tree.
34
+ 2. Fetch the PRD using the vendor-appropriate tool surface:
35
+ - **Notion**: `notion-fetch` with `include_discussions: true`. Capture: title, body, child Epic pages, all comment threads.
36
+ - **Confluence**: `getConfluencePage` (capture title, body, labels), `getConfluencePageFooterComments` + `getConfluencePageInlineComments` (capture all comments; walk replies via `getConfluenceCommentChildren` for any thread with children).
37
+ 3. If the PRD has child Epic sub-pages (a multi-epic PRD), fetch each in parallel:
38
+ - **Notion**: `notion-fetch` per child page with `include_discussions: true`.
39
+ - **Confluence**: enumerate descendants via `getConfluencePageDescendants`, then `getConfluencePage` per child plus its comment streams.
40
+ The audit walks the full PRD tree.
29
41
  4. If `tickets=[...]` not provided, locate the JIRA epic by:
30
- - Looking for a JIRA URL in the PRD body, comments, or the PRD's most recent "Ticketed by Claude" comment posted by `lisa:notion-prd-intake`.
42
+ - Looking for a JIRA URL in the PRD body, comments, or the PRD's most recent "Ticketed by Claude" comment posted by `lisa:notion-prd-intake` / `lisa:confluence-prd-intake`.
31
43
  - Searching JIRA via `searchJiraIssuesUsingJql` for an epic whose summary or description references the PRD title or page ID.
32
44
  - If no epic found, return verdict `NO_TICKETS_FOUND` with a clear remediation — coverage cannot be assessed without the ticket set.
33
45
  5. Once the epic is known, fetch all child stories and sub-tasks via JQL: `"Epic Link" = <EPIC-KEY>` and recursively for sub-tasks.
@@ -115,9 +127,13 @@ Atomic PRD items extracted: <n>
115
127
  | ... | ... |
116
128
 
117
129
  ### Gaps (PRD items with zero ticket coverage — blocks Ticketed status)
118
- - <item-id> (<type>) — <text>
119
- - *Source:* <PRD section reference>
120
- - *Suggested fix:* <add a ticket scoped to X / extend ticket Y to cover this / clarify whether this is in scope>
130
+ - item: <item-id> (<type>)
131
+ text: <text>
132
+ prd_section: "<heading text from the PRD>"
133
+ prd_anchor: "<first ~10 chars>...<last ~10 chars>" # for selection_with_ellipsis; null if no specific section
134
+ category: <product-clarity|acceptance-criteria|design-ux|scope|dependency|data|technical|structural>
135
+ what: <plain-language description of the gap, no JIRA jargon — written for the product team>
136
+ recommendation: <1–3 candidate resolutions: add a ticket scoped to X / extend ticket Y to cover this / mark out-of-scope explicitly. Never "clarify this".>
121
137
 
122
138
  ### Scope creep (tickets without PRD trace — informational, does not block)
123
139
  - <ticket-key> — <summary>
@@ -128,6 +144,10 @@ Atomic PRD items extracted: <n>
128
144
  ### Scope-creep count: <n>
129
145
  ```
130
146
 
147
+ `prd_anchor` and `prd_section` are built the same way as in `lisa:notion-to-jira` / `lisa:confluence-to-jira`. For Notion, `prd_anchor` is the `selection_with_ellipsis` start/end snippet; for Confluence, it's the inline-comment selection text accepted by `createConfluenceInlineComment`. The downstream caller knows which vendor it's writing to and uses the right API; this skill just emits the anchor that vendor expects. Set both to `null` only when the gap is not anchored to any specific section (rare).
148
+
149
+ `category` is drawn from the same fixed taxonomy used by `lisa:jira-validate-ticket` so downstream callers can apply one consistent comment-formatting policy. Most coverage gaps map to `scope` (item not represented in any ticket) or `product-clarity` (item too vague to map). Use `acceptance-criteria` for missing pass/fail conditions and `design-ux` for missing visuals.
150
+
131
151
  ## Rules
132
152
 
133
153
  - Read-only — never write to JIRA, never write to Notion (callers do that based on the verdict).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: confluence-prd-intake
3
+ description: PRD intake agent for Confluence-hosted PRDs. Runs one intake cycle against a Confluence space or parent page — claims `prd-ready` PRDs (relabels to `prd-in-review`), validates each through the dry-run pipeline, and routes to `prd-blocked` (with clarifying comments) or `prd-ticketed` (with JIRA tickets created). Confluence counterpart of `notion-prd-intake`. Designed to be invoked manually via /confluence-prd-intake or autonomously via a scheduled cron.
4
+ skills:
5
+ - confluence-prd-intake
6
+ - confluence-to-jira
7
+ - jira-validate-ticket
8
+ - jira-source-artifacts
9
+ - product-walkthrough
10
+ - jira-write-ticket
11
+ - prd-ticket-coverage
12
+ ---
13
+
14
+ # PRD Intake Agent (Confluence)
15
+
16
+ You are a PRD intake agent. Your single job is to run one intake cycle against the Confluence scope (a space or a parent page) given to you, then report what happened.
17
+
18
+ This agent is the Confluence counterpart of `notion-prd-intake`. The behavior is identical apart from the source-of-truth tool surface; if you have a Notion database, use the Notion agent instead.
19
+
20
+ ## Confirmation policy
21
+
22
+ Once you have a space or parent-page URL, RUN. Do not ask the caller whether to proceed, do not preview projected scope, do not offer "proceed / skip / dry-run" choices. The caller has already authorized the run by invoking you; re-prompting defeats the purpose of a background batch. `prd-blocked` is a valid terminal state of the lifecycle, not a failure mode — large PRDs and PRDs full of open questions are exactly what this skill is for. The `confluence-prd-intake` skill defines the only legitimate early-exit conditions (missing scope, unreachable space/parent, empty Ready set); ask only when one of those applies.
23
+
24
+ ## Workflow
25
+
26
+ ### 1. Receive the scope URL or key
27
+
28
+ The invoking caller (a slash command, a scheduled cron, or a parent agent) hands you a Confluence space URL/key or a parent page URL/ID. You do not pick the scope yourself.
29
+
30
+ If no scope is provided, stop and ask. Never run intake against a default or guessed scope — the side effects (label changes, JIRA tickets created) are too high to act without an explicit target.
31
+
32
+ ### 2. Run the intake skill
33
+
34
+ Invoke the `confluence-prd-intake` skill with the scope as `$ARGUMENTS`. The skill owns the cycle logic — claim, dry-run, branch, write or comment, label transitions, summary. Do not duplicate that logic here.
35
+
36
+ Treat the skill's output as the source of truth. If it reports `prd-ticketed: 3 / prd-blocked: 1 / Errors: 0`, that's what you report.
37
+
38
+ ### 3. Surface the summary
39
+
40
+ Pass the skill's summary block through to the caller verbatim — do not paraphrase or condense. The caller (often a human running `/confluence-prd-intake` ad-hoc, or a scheduled cron) needs the structured record:
41
+
42
+ - Total processed
43
+ - Per-PRD outcomes (`prd-ticketed` → which tickets created; `prd-blocked` → how many gate failures; Errors → reason)
44
+ - JIRA ticket count
45
+
46
+ If the cycle errored before processing any PRDs (e.g. space unreachable, missing config, label convention not yet adopted), surface the failure cause in plain language and stop.
47
+
48
+ ### 4. Suggest next actions when warranted
49
+
50
+ After a successful cycle, if any PRDs ended in `prd-blocked`, mention to the caller that those PRDs need product attention before they can be re-ticketed. Do not auto-notify product — Confluence comments on the PRDs are the channel; the caller decides whether to ping anyone.
51
+
52
+ When reporting `prd-blocked` outcomes, distinguish the cause: **pre-write gate failure** (per-ticket validator caught a problem before any tickets were created) vs **post-write coverage gap** (tickets were created and remain in JIRA, but the PRD has uncovered requirements that the next intake cycle will address). Both result in `prd-blocked`, but the implication for product is different — coverage gaps mean some tickets are already real and product should not re-author the PRD from scratch.
53
+
54
+ If all PRDs ended in `prd-ticketed` with coverage `COMPLETE`, mention that the next step is for product to monitor the created tickets and apply the `prd-shipped` label after delivery. If any are `COMPLETE_WITH_SCOPE_CREEP`, point that out so product can review the flagged tickets.
55
+
56
+ ## Rules
57
+
58
+ - **Never run a cycle without an explicit scope.** Side effects are too high to default.
59
+ - **Never modify the lifecycle**: only `prd-ready → prd-in-review → prd-blocked|prd-ticketed`. Never touch `prd-draft` or `prd-shipped`. Never invent new labels.
60
+ - **Never write JIRA tickets directly.** All writes go through the skill chain (intake → confluence-to-jira → jira-write-ticket).
61
+ - **Never edit a PRD's body.** Communication with product happens only via Confluence comments on the PRD.
62
+ - **Never start a second cycle while one is in flight against the same scope.** Serial execution; the scheduling layer is responsible for not double-firing.
63
+ - **Stop and surface failures rather than retry-loop.** If `confluence-to-jira` returns an error, the skill records it under `Errors` in the summary; pass that through.
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: "Vendor-agnostic batch scanner for Status=Ready queues. Notion PRD database URL → finds Ready PRDs and runs lisa:plan per item. JIRA project key or JQL → finds Ready tickets and runs lisa:implement per item. Designed as the cron target for /schedule."
3
- argument-hint: "<Notion-PRD-database-URL | JIRA-project-key | JQL-filter>"
2
+ description: "Vendor-agnostic batch scanner for Ready queues. Notion PRD database URL → finds Status=Ready PRDs and runs lisa:plan per item. Confluence space or parent-page URL → finds prd-ready PRDs and runs lisa:plan per item. JIRA project key or JQL → finds Ready tickets and runs lisa:implement per item. Designed as the cron target for /schedule."
3
+ argument-hint: "<Notion-PRD-database-URL | Confluence-space-URL | Confluence-parent-page-URL | JIRA-project-key | JQL-filter>"
4
4
  ---
5
5
 
6
- Use the /lisa:intake skill to scan the queue for Status=Ready items and dispatch each one through the appropriate single-item lifecycle skill. $ARGUMENTS
6
+ Use the /lisa:intake skill to scan the queue for Ready items and dispatch each one through the appropriate single-item lifecycle skill. $ARGUMENTS
@@ -0,0 +1,259 @@
1
+ ---
2
+ name: confluence-prd-intake
3
+ description: "Scans a Confluence space (or a parent page) for PRD pages labelled `prd-ready` and runs each one through the dry-run validation pipeline. PRDs that pass every gate get tickets written and the label flipped to `prd-ticketed`; PRDs that fail get clarifying-question comments and the label flipped to `prd-blocked`. Confluence counterpart of `lisa:notion-prd-intake` — the workflow is identical; only the source-of-truth tools differ. Composes existing skills (confluence-to-jira, jira-validate-ticket, jira-source-artifacts, product-walkthrough)."
4
+ allowed-tools: ["Skill", "Bash", "mcp__atlassian__getConfluencePage", "mcp__atlassian__getConfluenceSpaces", "mcp__atlassian__getPagesInConfluenceSpace", "mcp__atlassian__getConfluencePageDescendants", "mcp__atlassian__searchConfluenceUsingCql", "mcp__atlassian__updateConfluencePage", "mcp__atlassian__createConfluenceFooterComment", "mcp__atlassian__createConfluenceInlineComment", "mcp__atlassian__getConfluencePageFooterComments", "mcp__atlassian__getConfluencePageInlineComments", "mcp__atlassian__getAccessibleAtlassianResources"]
5
+ ---
6
+
7
+ # Confluence PRD Intake: $ARGUMENTS
8
+
9
+ `$ARGUMENTS` is one of:
10
+
11
+ - A Confluence **space** URL or space key — scans every page in the space whose labels include `prd-ready`. Example: `https://mycompany.atlassian.net/wiki/spaces/PRD` or `PRD`.
12
+ - A Confluence **parent page** URL or page ID — scans every descendant of the parent whose labels include `prd-ready`. Example: `https://mycompany.atlassian.net/wiki/spaces/PRD/pages/123456789/PRDs`.
13
+
14
+ Run one intake cycle against that scope. Each PRD with the `prd-ready` label is claimed, validated, and routed to either `prd-blocked` (with clarifying comments) or `prd-ticketed` (with JIRA tickets created).
15
+
16
+ This skill is the Confluence counterpart of `lisa:notion-prd-intake`. The phases, gates, comment templates, and rules are identical — the only differences are (1) the lifecycle is encoded as **page labels** instead of a Status property, and (2) the fetch / comment / update tools are Confluence MCP instead of Notion MCP. Keep the two skills behaviorally aligned: when changing intake logic, change BOTH skills together.
17
+
18
+ ## Confirmation policy
19
+
20
+ Do NOT ask the caller whether to proceed. Once invoked with a space or parent-page URL, run the cycle to completion — claim, validate, branch to `prd-blocked` or `prd-ticketed`, write the summary. The caller (a human or a cron) has already authorized the run by invoking the skill; re-prompting defeats the purpose of a background batch.
21
+
22
+ Specifically forbidden:
23
+
24
+ - Previewing projected scope (epic count, story count, write count) and asking whether to continue.
25
+ - Offering A/B/C-style choices like "proceed / skip / dry-run only" — the documented behavior IS the default.
26
+ - Pausing because a PRD looks large, has many open questions, or is likely to end in `prd-blocked`. `prd-blocked` is a valid terminal state of this lifecycle, not a failure mode — routing a PRD to `prd-blocked` with gate-failure comments is exactly how this skill communicates "the PRD needs more work before it can be ticketed." That outcome is success.
27
+ - Pausing because the dry-run validation looks expensive. The cost of one cycle is bounded; the cost of stalling a scheduled cron waiting on a human is unbounded.
28
+
29
+ The only legitimate reasons to stop early:
30
+
31
+ - Missing space/parent argument or required configuration (`JIRA_PROJECT`, `JIRA_SERVER`, `E2E_BASE_URL`, etc.). Surface the missing value and exit.
32
+ - Space/parent unreachable, or the labelling convention not yet adopted (no PRDs carry any of `prd-ready` / `prd-in-review` / `prd-blocked` / `prd-ticketed`). Surface and exit.
33
+ - Empty `prd-ready` set. Exit cleanly with `"No PRDs labelled prd-ready. Nothing to do."`
34
+
35
+ ## Lifecycle assumed
36
+
37
+ The Confluence PRD lifecycle is encoded as **page labels** (Confluence has no native status field). Exactly one of these labels is expected on a PRD page at any time:
38
+
39
+ ```text
40
+ prd-draft → prd-ready → prd-in-review → prd-blocked | prd-ticketed → prd-shipped
41
+ (product) (us) (us) (product)
42
+ ```
43
+
44
+ This skill ONLY transitions:
45
+
46
+ - `prd-ready` → `prd-in-review` (claim)
47
+ - `prd-in-review` → `prd-blocked` (gate failures or coverage gaps)
48
+ - `prd-in-review` → `prd-ticketed` (success)
49
+
50
+ It never adds, removes, or touches `prd-draft` or `prd-shipped`. Those labels are owned by product.
51
+
52
+ A "transition" means: remove the old lifecycle label and add the new one in a single `updateConfluencePage` call. The skill MUST verify that exactly one lifecycle label exists on the page after the update — having two simultaneously breaks idempotency.
53
+
54
+ If the project does not yet use `prd-*` labels, this skill cannot run. Adopting the convention is a one-time setup the project owner does (see "Adoption" at the bottom of this file).
55
+
56
+ ## Phases
57
+
58
+ ### Phase 1 — Resolve the scope
59
+
60
+ 1. Parse `$ARGUMENTS`:
61
+ - Space URL → extract space key from `/wiki/spaces/<KEY>`.
62
+ - Bare space key → use as-is.
63
+ - Parent page URL → extract numeric page ID from `/pages/<ID>/...`.
64
+ - Bare page ID → use as-is.
65
+ 2. Resolve Atlassian cloud ID via `mcp__atlassian__getAccessibleAtlassianResources` (downstream tools need it).
66
+ 3. Verify the scope is reachable:
67
+ - For a space: call `mcp__atlassian__getConfluenceSpaces` and confirm the key resolves.
68
+ - For a parent page: call `mcp__atlassian__getConfluencePage` on the ID and confirm it loads.
69
+
70
+ ### Phase 2 — Find Ready PRDs
71
+
72
+ Build a CQL query and call `mcp__atlassian__searchConfluenceUsingCql`:
73
+
74
+ - For a space: `space = "<KEY>" AND label = "prd-ready" AND type = page`
75
+ - For a parent: `ancestor = <PARENT-ID> AND label = "prd-ready" AND type = page`
76
+
77
+ The query returns the list of candidate pages with IDs and titles. For each candidate, confirm the label set on the page (CQL hits should be authoritative, but a follow-up `getConfluencePage` with labels included guards against eventual-consistency lag) and ensure exactly one lifecycle label is present.
78
+
79
+ If the result set is empty, run a secondary CQL to distinguish between a genuinely empty queue and a project that has not yet adopted the label convention:
80
+
81
+ - Secondary query (space scope): `space = "<KEY>" AND (label = "prd-ready" OR label = "prd-in-review" OR label = "prd-blocked" OR label = "prd-ticketed") AND type = page`
82
+ - Secondary query (parent scope): `ancestor = <PARENT-ID> AND (label = "prd-ready" OR label = "prd-in-review" OR label = "prd-blocked" OR label = "prd-ticketed") AND type = page`
83
+
84
+ If the secondary query also returns nothing → the `prd-*` label convention has not been adopted. Surface a misconfiguration message: `"No pages in this scope carry prd-* labels. If this is a new project, apply the prd-ready label to PRDs that are ready for ticketing (see Adoption section)."` Exit with an error — this is a setup issue, not a normal idle cycle.
85
+
86
+ If the secondary query returns results → the queue is genuinely empty (all PRDs are already in-review, blocked, ticketed, or shipped). Exit cleanly with `"No PRDs labelled prd-ready. Nothing to do."`
87
+
88
+ ### Phase 3 — Process each Ready PRD
89
+
90
+ For each PRD page (process serially to keep label transitions auditable):
91
+
92
+ #### 3a. Claim
93
+
94
+ Transition labels via `mcp__atlassian__updateConfluencePage`: remove `prd-ready`, add `prd-in-review`. This is the idempotency lock — a re-entrant cycle running concurrently won't see this PRD because its CQL query filters on `label = "prd-ready"`.
95
+
96
+ If the update fails (permission error, version conflict / 409 race), log it and skip this PRD. Do not proceed to validation on a PRD you didn't successfully claim.
97
+
98
+ The `updateConfluencePage` call must preserve the page body; only the labels change. (If the MCP tool requires a full body in the update payload, fetch the current body via `getConfluencePage` immediately before the update and pass it back unchanged — preserving body content is non-negotiable, this skill never edits PRD content.)
99
+
100
+ #### 3b. Dry-run validation
101
+
102
+ Invoke the `lisa:confluence-to-jira` skill with `dry_run: true` and the PRD's URL. The skill returns a structured report containing:
103
+ - The planned ticket hierarchy
104
+ - Per-ticket validation verdicts and remediation
105
+ - An overall PASS / FAIL verdict
106
+ - A failure count
107
+
108
+ This call also indirectly invokes `lisa:jira-source-artifacts` (artifact extraction + classification) and `lisa:product-walkthrough` (when the PRD touches existing user-facing surfaces). All gate logic lives in `lisa:jira-validate-ticket`, which `lisa:confluence-to-jira` calls per ticket.
109
+
110
+ #### 3c. Branch on the verdict
111
+
112
+ **If `PASS`** (every planned ticket passed every applicable gate):
113
+
114
+ 1. Re-invoke `lisa:confluence-to-jira` with `dry_run: false` to actually write the tickets. This re-runs Phases 1-5 and runs the preservation gate (Phase 5.5).
115
+ 2. Capture the created ticket keys from the skill's output.
116
+ 3. Post a Confluence **footer comment** on the PRD via `mcp__atlassian__createConfluenceFooterComment` listing the created tickets (epic, stories, sub-tasks) with their JIRA URLs. Lead with: `"Ticketed by Claude. Created N JIRA issues — see below. Add the prd-shipped label after the work is delivered."`
117
+ 4. Transition labels: remove `prd-in-review`, add `prd-ticketed` via `updateConfluencePage`.
118
+ 5. **Run Phase 3e (coverage audit)** before considering this PRD done.
119
+
120
+ **If `FAIL`** (one or more planned tickets failed one or more gates):
121
+
122
+ The audience for these comments is the **product team**, not engineers. They are not familiar with JIRA gate IDs, validator vocabulary, or skill internals. Follow the rules below strictly — the goal is for a non-engineer product owner to read a comment, understand what is unclear, and know what to do next.
123
+
124
+ ##### 3c.1 Partition failures
125
+
126
+ 1. Drop every failure where `product_relevant = false`. Those are internal data-quality problems — the agent should fix its own spec rather than ask product to clarify a missing core field. Record the dropped failures under `Errors` in the cycle summary so engineers can see them; never surface them on the PRD.
127
+ 2. Group the remaining product-relevant failures by `prd_anchor` (the inline-comment anchor from `confluence-to-jira`'s dry-run report). Failures that share an anchor become one comment thread on that block. Failures with `prd_anchor: null` are batched into one footer comment, since they have no source section to attach to.
128
+
129
+ ##### 3c.2 Render each comment
130
+
131
+ For each anchored group, post via `mcp__atlassian__createConfluenceInlineComment` with:
132
+ - `page_id`: the PRD page ID
133
+ - `inline_text` (or whatever the MCP tool calls the selection-anchor parameter): the `prd_anchor` value
134
+ - `body`: the comment body, formatted using the template below
135
+
136
+ For the unanchored group, post a single footer comment via `mcp__atlassian__createConfluenceFooterComment` using the same template, prefixed with `Issues without a specific section anchor:` and one block per failure.
137
+
138
+ If `createConfluenceInlineComment` returns "anchor not found" (the page text changed between fetch and post), fall back to a footer comment for that group. Do not silently drop the failure.
139
+
140
+ ##### 3c.3 Comment template
141
+
142
+ Each comment body MUST contain these four parts, in this order, no exceptions:
143
+
144
+ ```text
145
+ [<Category badge>] <prd_section heading text>
146
+
147
+ **What's unclear:** <validator's `what` field, verbatim — already product-readable>
148
+
149
+ **Recommendation:** <validator's `recommendation` field, verbatim — must contain 1–3 concrete options, never a generic "please clarify">
150
+
151
+ **Action:** Update this section in the PRD, then replace the `prd-blocked` label with `prd-ready` and Claude will re-run intake.
152
+ ```
153
+
154
+ If multiple failures share an anchor, render each as its own `**What's unclear:** ... **Recommendation:** ...` block within the same comment, separated by horizontal lines (`---`). Keep the single `[Category badge]` heading at the top using the most-severe / most-blocking category from the group.
155
+
156
+ ##### 3c.4 Category badges
157
+
158
+ Use these exact badge labels — they are the validator's category values translated for product readers:
159
+
160
+ | Validator category | Badge label |
161
+ |---------------------|-------------|
162
+ | `product-clarity` | `[Product clarity]` |
163
+ | `acceptance-criteria` | `[Acceptance criteria]` |
164
+ | `design-ux` | `[Design / UX]` |
165
+ | `scope` | `[Scope]` |
166
+ | `dependency` | `[Dependency]` |
167
+ | `data` | `[Data]` |
168
+ | `technical` | `[Technical]` |
169
+
170
+ `structural` failures must never reach this step (filtered in 3c.1). If you see one here, treat it as an Error and surface internally.
171
+
172
+ ##### 3c.5 Forbidden in product comments
173
+
174
+ - Gate IDs (`S4`, `F2`, etc.). Never appear in a comment body.
175
+ - JIRA terminology that has no product meaning (e.g. "Gherkin", "epic parent", "issue link", "validation journey", "sub-task hierarchy"). Paraphrase before posting.
176
+ - Internal skill names (`lisa:jira-validate-ticket`, `confluence-to-jira`).
177
+ - Engineering shorthand (`AC`, `OOS`, `repo`, `env var`).
178
+ - "Clarify this" / "Please specify" without candidate resolutions. The validator is required to provide candidates; if `recommendation` is empty or vague, treat the failure as an Error and surface internally rather than posting a useless comment.
179
+
180
+ ##### 3c.6 Label transition
181
+
182
+ After all comments are posted (anchored groups + the optional footer summary), transition labels: remove `prd-in-review`, add `prd-blocked` via `updateConfluencePage`. Do NOT write any JIRA tickets.
183
+
184
+ #### 3d. Continue
185
+
186
+ Move to the next Ready PRD. One PRD failing does not affect others.
187
+
188
+ #### 3e. Coverage audit (mandatory after prd-ticketed)
189
+
190
+ Per-ticket gates prove each ticket is well-formed; they do NOT prove the *set* of created tickets covers the *whole* PRD. Silent drops happen — invoke the `lisa:prd-ticket-coverage` skill to catch them.
191
+
192
+ 1. Invoke `lisa:prd-ticket-coverage` with `<PRD URL> tickets=[<created ticket keys from 3c step 2>]`. The coverage skill auto-detects the PRD vendor from the URL.
193
+ 2. Read the verdict:
194
+
195
+ | Verdict | Action |
196
+ |---------|--------|
197
+ | `COMPLETE` | Done. Leave label as `prd-ticketed`. Move to next PRD. |
198
+ | `COMPLETE_WITH_SCOPE_CREEP` | Post an advisory footer comment naming the scope-creep tickets (so product can decide whether to close them as out-of-scope). Leave label as `prd-ticketed`. |
199
+ | `GAPS_FOUND` | The created ticket set is incomplete. (a) For each gap, post a comment using the same product-facing template as Phase 3c.3 — inline-anchored when `prd_anchor` is non-null, footer otherwise; category badge from the gap's `category` field; `What's unclear` and `Recommendation` from the audit report's `what` and `recommendation` fields. Apply the same forbidden-language rules from Phase 3c.5. (b) Post one footer summary comment listing the tickets that *were* successfully created (so product knows what to keep vs. what to extend). (c) Transition labels from `prd-ticketed` back to `prd-blocked` via `updateConfluencePage`. |
200
+ | `NO_TICKETS_FOUND` | Should not happen if step 2 succeeded. If it does, log it as an Error in the cycle summary and leave label as `prd-ticketed` with a comment flagging the audit failure for human review. |
201
+
202
+ 3. The created tickets remain in JIRA regardless of the verdict — they are valid in their own right. The audit only tells us whether *more* are needed.
203
+
204
+ ### Phase 4 — Summary report
205
+
206
+ After processing every Ready PRD, emit a summary:
207
+
208
+ ```text
209
+ ## confluence-prd-intake summary
210
+
211
+ Scope: <space-key | parent-page-title> (<URL>)
212
+ Cycle started: <ISO timestamp>
213
+ Cycle completed: <ISO timestamp>
214
+
215
+ PRDs processed: <n>
216
+ - prd-ticketed: <n>
217
+ - <PRD title> → <epic-key> + <story-count> stories + <subtask-count> sub-tasks (coverage: COMPLETE | COMPLETE_WITH_SCOPE_CREEP)
218
+ - prd-blocked: <n>
219
+ - <PRD title> → <gate-failure-count> gate failures (pre-write) OR <gap-count> coverage gaps (post-write)
220
+ - Errors (claim failed, etc): <n>
221
+ - <PRD title> — <reason>
222
+
223
+ Total JIRA tickets created: <n>
224
+ Coverage audit summary: <n> COMPLETE / <n> COMPLETE_WITH_SCOPE_CREEP / <n> GAPS_FOUND
225
+ ```
226
+
227
+ Print to the agent's output. Do not write this summary to Confluence or JIRA — it's an operational record for the human.
228
+
229
+ ## Idempotency & safety
230
+
231
+ - **Single-cycle scope**: this skill processes the `prd-ready` set as it exists at the start of Phase 2. New `prd-ready` PRDs added mid-cycle are picked up next run.
232
+ - **No writes outside the lifecycle**: this skill only ever writes to JIRA via `lisa:confluence-to-jira` (which delegates to `lisa:jira-write-ticket`), and only ever changes Confluence labels among `prd-in-review`, `prd-blocked`, `prd-ticketed`. It never edits PRD body content, never touches `prd-draft` or `prd-shipped`, never deletes pages.
233
+ - **Claim-first ordering**: the label flip to `prd-in-review` happens BEFORE validation runs, so a re-entrant call won't double-process.
234
+ - **Failure isolation**: an exception processing one PRD must not stop the cycle. Catch, record under "Errors" in the summary, continue to the next PRD. The PRD that errored is left labelled `prd-in-review` — the human investigates from there.
235
+ - **Single-label invariant**: after every transition, verify exactly one lifecycle label is present on the page. If two are present (rare race), surface as an Error and skip — do NOT auto-resolve, the human decides.
236
+
237
+ ## Configuration
238
+
239
+ Same env vars as `lisa:confluence-to-jira` — `JIRA_PROJECT`, `JIRA_SERVER`, `CONFLUENCE_HOST`, `E2E_BASE_URL`, `E2E_TEST_PHONE`, `E2E_TEST_OTP`, `E2E_TEST_ORG`, `E2E_GRAPHQL_URL`. If any required value is missing, surface the missing key(s) and exit this cycle — never invent values.
240
+
241
+ ## Rules
242
+
243
+ - Never write to JIRA outside of `lisa:confluence-to-jira` → `lisa:jira-write-ticket`. The validator's verdict gates progress; bypassing it produces broken tickets.
244
+ - Never add or remove a label this skill doesn't own (`prd-in-review`, `prd-blocked`, `prd-ticketed`). Product owns `prd-draft`, `prd-ready`, `prd-shipped`.
245
+ - Never edit the PRD's body. Communication with product happens only through Confluence comments. If `updateConfluencePage` requires a body in the payload, refetch and pass it back unchanged.
246
+ - Never post a single page-level dump of all gate failures. One inline comment per `prd_anchor` group (or one footer summary for unanchored failures only). Comments must be inline-anchored where possible, categorized, plain-language, and contain a concrete recommendation.
247
+ - Never include a gate ID, internal skill name, or engineering shorthand in a comment body.
248
+ - Never run more than one intake cycle concurrently against the same scope. This skill assumes serial execution.
249
+ - If `lisa:confluence-to-jira` returns errors, treat them as gate failures: comment + `prd-blocked`. Don't silently fail.
250
+
251
+ ## Adoption (one-time per project)
252
+
253
+ Before this skill can run against a project, the project must adopt the `prd-*` label convention:
254
+
255
+ 1. Apply `prd-ready` to PRDs that are ready for ticketing (replaces the Notion `Status = Ready` flip).
256
+ 2. Reserve `prd-in-review`, `prd-blocked`, `prd-ticketed` for this skill — humans should not set them manually except to recover from an error.
257
+ 3. (Optional but recommended) Add `prd-draft` for in-progress PRDs and `prd-shipped` for delivered work, so the full lifecycle is visible at a glance.
258
+
259
+ If the project hasn't adopted these labels, the first run exits with a label-convention error (not the idle empty-set message) — this distinguishes a setup issue from a genuinely empty queue so operators know to apply the convention rather than assuming the queue is drained. See Phase 2 for how the skill detects this case.