create-agentic-pdlc 2.2.1 → 2.3.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 (33) hide show
  1. package/.agentic-pdlc/SETUP_PROMPT.md +3 -4
  2. package/.agentic-pdlc/metrics/raw/2026-W18.jsonl +2 -0
  3. package/.agentic-pdlc/metrics/raw/2026-W21.jsonl +68 -0
  4. package/.agentic-pdlc/templates/.github/workflows/agent-trigger.yml +2 -2
  5. package/.agentic-pdlc/templates/.github/workflows/agentic-metrics.yml +16 -9
  6. package/.agentic-pdlc/templates/.github/workflows/ci.yml +14 -0
  7. package/.agentic-pdlc/templates/.github/workflows/pdlc-health-check.yml +0 -2
  8. package/.agentic-pdlc/templates/.github/workflows/project-automation.yml +1 -5
  9. package/.agentic-pdlc/templates/.github/workflows/qa-agent.yml +4 -4
  10. package/.agentic-pdlc/templates/AGENTS.md +24 -1
  11. package/.agentic-pdlc/templates/docs/pdlc.md +21 -13
  12. package/.agentic-setup-prompt.md +3 -4
  13. package/.agentic-setup.md +3 -4
  14. package/.github/workflows/agentic-metrics.yml +21 -11
  15. package/.github/workflows/pdlc-health-check.yml +0 -2
  16. package/.github/workflows/project-automation.yml +31 -7
  17. package/.github/workflows/qa-agent.yml +4 -4
  18. package/AGENTS.md +1 -1
  19. package/CLAUDE.md +51 -3
  20. package/SETUP.md +2 -0
  21. package/adapters/claude-code/skill.md +13 -10
  22. package/adapters/hooks/pdlc-stage-gate.sh +3 -3
  23. package/bin/cli.js +18 -7
  24. package/docs/flow.md +8 -21
  25. package/docs/pdlc.md +21 -13
  26. package/package.json +1 -1
  27. package/templates/.github/workflows/agent-trigger.yml +2 -2
  28. package/templates/.github/workflows/ci.yml +14 -0
  29. package/templates/.github/workflows/pdlc-health-check.yml +0 -2
  30. package/templates/.github/workflows/project-automation.yml +24 -6
  31. package/templates/.github/workflows/qa-agent.yml +6 -4
  32. package/templates/AGENTS.md +25 -2
  33. package/templates/docs/pdlc.md +21 -13
package/CLAUDE.md CHANGED
@@ -1,9 +1,57 @@
1
+ # agentic-pdlc
2
+
3
+ **What it is:** npm CLI (`npx create-agentic-pdlc`) that installs a PDLC workflow for AI agent projects. Stack: Markdown + GitHub Actions YAML only — never complex Node/Python/Bash scripts.
4
+
5
+ **Workflow:** `stage:brainstorming` → `stage:detailing` → `spec:approved` → `stage:development` → PR → merge. Labels move the board automatically.
6
+
7
+ ## Session Startup
8
+
9
+ Read: `AGENTS.md` (mandatory contract), `docs/pdlc.md` (board + labels — only when operating on the board).
10
+ Run: `gh issue list --state open --label "stage:development" --json number,title --jq '.[] | "#\(.number) \(.title)"'`
11
+
1
12
  # PDLC Stage Gate
2
13
 
3
14
  NEVER run `gh pr create` unless one of these is true:
4
- - The linked issue has label `stage:approval`
15
+ - The linked issue has label `spec:approved`
5
16
  - The branch name starts with `hotfix/`
6
17
 
7
- Advance stages first: `exploration` `brainstorming` `detailing` `approval`
18
+ NEVER edit files, create branches, or commit unless the linked issue has label `spec:approved` (set by human PM only) or the branch name starts with `hotfix/`.
19
+
20
+ Advance stages first: `brainstorming` → `detailing` → `approval` → (human adds `spec:approved`) → `development`
21
+
22
+ The PreToolUse hook will block `gh pr create` automatically if this rule is violated.
23
+
24
+ ## Human-in-the-Loop
25
+
26
+ | Transition | Gate |
27
+ |---|---|
28
+ | → `stage:brainstorming` | Autonomous — apply immediately |
29
+ | → `stage:detailing` | Ask user — present problem summary + options, wait for choice |
30
+ | → `stage:approval` | **Autonomous** — agent completes spec end-to-end, advances without asking |
31
+ | `spec:approved` | **Human PM only** — agent waits; never adds this label |
32
+ | → `stage:development` | Human applies `spec:approved` label — that IS the gate |
33
+
34
+ **Detailing is fully autonomous.** Write the complete spec, add it to the issue, advance to `stage:approval` — no confirmation needed. Then **stop and wait** for human to add `spec:approved` before any implementation.
35
+
36
+ ## Stage Transition Rules (non-negotiable)
37
+
38
+ MUST apply `stage:brainstorming` label immediately on starting work — before
39
+ reading any code, before invoking any skill. Then read context and present
40
+ problem summary + 2–3 solution options in a single message.
41
+
42
+ MUST NOT add `stage:detailing` label until the user has explicitly selected
43
+ an approach in the current conversation turn. Work done in a prior
44
+ planning session does NOT count as confirmation.
45
+
46
+ MUST NOT add `spec:approved` or any approval-trigger label under any
47
+ circumstances — these are set by the PM (human) only, after reviewing the spec
48
+ in the issue body. Adding them triggers irreversible automation (Jules dispatch,
49
+ board move).
50
+
51
+ MUST NOT add or remove `stage:development`, `spec:approved`, or `qa:*` labels —
52
+ these are owned by GitHub Actions automation and the PM. The agent is responsible
53
+ for applying `stage:brainstorming`, `stage:detailing`, and `stage:approval` as
54
+ part of the prescribed workflow above.
8
55
 
9
- The PreToolUse hook will block the action automatically if this rule is violated.
56
+ Each stage transition requires a fresh explicit signal from the user in the same
57
+ session where the transition happens. These rules have no exceptions.
package/SETUP.md CHANGED
@@ -12,6 +12,8 @@ Estimated time: 2-3 hours (including GitHub Projects setup).
12
12
  - GitHub Projects enabled on your account/organization
13
13
  - Implementation agent connected to the repository (e.g., Jules: github.com/google-labs/jules)
14
14
 
15
+ > **Jules users:** After installing the Jules GitHub App at [github.com/settings/installations](https://github.com/settings/installations), set `JULES_ENABLED=true` at **repo → Settings → Variables → Actions** to enable Jules dispatch. If this variable is absent, agent comments are silently skipped — no false "dispatched" messages.
16
+
15
17
  ---
16
18
 
17
19
  ## Step 1 — Create the GitHub Project Board
@@ -48,6 +48,10 @@ If any of these files are missing, you are in **Setup Mode**. Do not proceed wit
48
48
  - a) **No** — *No autonomous implementation agent.*
49
49
  - b) **@google-labs-jules** — *Jules (recommended if you don't have one).*
50
50
  - c) **Other** — *Enter the agent's handle.*
51
+
52
+ When writing `agent-trigger.yml`, set `{{IMPLEMENTATION_AGENT_LABEL}}` as follows:
53
+ - Jules (`@google-labs-jules`): use `jules` — this is the native label the Jules GitHub App watches. **Do NOT use `agent:jules`** — Jules does not watch that label and the trigger will silently fail.
54
+ - Other agents: use the handle without `@`, lowercase (e.g. `@my-agent` → `my-agent`).
51
55
  5. Generate and write the missing files replacing the `{{SCREAMING_SNAKE_CASE}}` placeholders using the templates in `.agentic-pdlc/templates/`.
52
56
  6. Offer to run the `gh` commands for labels (`spec:approved`, `pr:in-review`, `pr:approved`, `architecture-violation`).
53
57
  7. **`PROJECT_PAT` secret (required for board automation):**
@@ -98,9 +102,9 @@ If `AGENTS.md` and `docs/pdlc.md` are present, you are in **Execution Mode**.
98
102
 
99
103
  ### 0. [FIRST] Issue Type Identification
100
104
 
101
- **Run before anything else — before `stage:exploration`, before reading code.**
105
+ **Run before anything else — before reading code.**
102
106
 
103
- Reading the issue title and body for type inference is exempt from the `stage:exploration` requirement: it is metadata already present in the request, not code reading or skill invocation.
107
+ Reading the issue title and body for type inference is exempt from the initial label requirement: it is metadata already present in the request, not code reading or skill invocation.
104
108
 
105
109
  1. Check if issue already has a `type:*` label (`type:us`, `type:task`, `type:bug`, `type:spike`) → if yes, skip to Section 0.1.
106
110
  2. Read issue title + body (metadata only — no code reading at this step).
@@ -116,10 +120,10 @@ Reading the issue title and body for type inference is exempt from the `stage:ex
116
120
 
117
121
  | Type | Flow |
118
122
  |---|---|
119
- | `type:us` | Full flow: exploration → brainstorming → Gate 1 → detailing → approval |
120
- | `type:task` | Skip brainstorming: exploration → detailing → approval |
121
- | `type:bug` | Skip brainstorming: exploration → detailing → approval |
122
- | `type:spike` | Skip brainstorming: exploration → detailing → conclusion comment (never reaches Development) |
123
+ | `type:us` | brainstorming → Gate 1 → detailing → approval |
124
+ | `type:task` | brainstorming Gate 1 → detailing → approval |
125
+ | `type:bug` | brainstorming Gate 1 → detailing → approval |
126
+ | `type:spike` | brainstorming Gate 1 → detailing → conclusion comment (never reaches Development) |
123
127
 
124
128
  ### 0.1 Board Labels — Mandatory at Every State Transition
125
129
 
@@ -127,11 +131,10 @@ These label commands are non-negotiable. They run **before** the activity they a
127
131
 
128
132
  | When | Command |
129
133
  |---|---|
130
- | Before reading any code / invoking any skill | `gh issue edit <N> --add-label "stage:exploration"` |
131
- | Before presenting architecture approaches | `gh issue edit <N> --add-label "stage:brainstorming" --remove-label "stage:exploration"` |
134
+ | Before reading any code / invoking any skill | `gh issue edit <N> --add-label "stage:brainstorming"` |
132
135
  | Before writing the technical spec | `gh issue edit <N> --add-label "stage:detailing" --remove-label "stage:brainstorming"` |
133
136
 
134
- No investigation, no skill invocation, no code reading happens before `stage:exploration` is applied. No architecture presentation starts before `stage:brainstorming` is set (and `stage:exploration` removed). No spec writing starts before `stage:detailing` is set (and `stage:brainstorming` removed).
137
+ No investigation, no skill invocation, no code reading happens before `stage:brainstorming` is applied. No spec writing starts before `stage:detailing` is set (and `stage:brainstorming` removed).
135
138
 
136
139
  ### 0.1 PR Stage Gate — Non-Negotiable
137
140
 
@@ -147,7 +150,7 @@ git checkout -b hotfix/<N>-<description>
147
150
  ```
148
151
 
149
152
  ### 1. Daily Upstream Loop
150
- Your job is to move issues from "💡 Idea - don't move manually to Exploration" to "📐 Detail Solution".
153
+ Your job is to move issues from "💡 Idea" to "📐 Detail Solution".
151
154
  When asked to work on a feature, you will:
152
155
  - Explore the code context.
153
156
  - Present architectural approaches (Brainstorming).
@@ -26,8 +26,8 @@ fi
26
26
 
27
27
  LABELS=$(gh issue view "$ISSUE_NUM" --json labels --jq '[.labels[].name] | join(" ")' 2>/dev/null || echo "")
28
28
 
29
- if echo "$LABELS" | grep -qw "stage:approval"; then
30
- echo "✅ PDLC: Issue #$ISSUE_NUM approved — gate passed."
29
+ if echo "$LABELS" | grep -qw "spec:approved"; then
30
+ echo "✅ PDLC: Issue #$ISSUE_NUM spec approved by PM — gate passed."
31
31
  exit 0
32
32
  fi
33
33
 
@@ -39,6 +39,6 @@ fi
39
39
  STAGE=$(echo "$LABELS" | tr ' ' '\n' | grep "^stage:" | head -1 || echo "none")
40
40
  echo "❌ PDLC Stage Gate: Issue #$ISSUE_NUM is not approved."
41
41
  echo " Current stage: $STAGE"
42
- echo " Required: stage:approval or stage:development label on the issue."
42
+ echo " Required: spec:approved (set by human PM) or stage:development label on the issue."
43
43
  echo " Emergency bypass: rename branch to hotfix/<issue-number>-<description>."
44
44
  exit 1
package/bin/cli.js CHANGED
@@ -227,6 +227,16 @@ async function runSetup() {
227
227
  }
228
228
  }
229
229
 
230
+ const defaultLabels = [
231
+ 'bug', 'documentation', 'duplicate', 'enhancement',
232
+ 'good first issue', 'help wanted', 'invalid', 'question', 'wontfix'
233
+ ];
234
+ for (const label of defaultLabels) {
235
+ try {
236
+ execFileSync('gh', ['label', 'delete', label, '--repo', repo, '--yes'], { stdio: 'ignore' });
237
+ } catch (_) {}
238
+ }
239
+
230
240
  // Project V2
231
241
  console.log(`\n${cyan}${i18n.creating_project}${reset}`);
232
242
  let ownerId, projectId, projectNumber;
@@ -240,13 +250,13 @@ async function runSetup() {
240
250
  }
241
251
 
242
252
  const projectCreateRaw = execFileSync('gh', ['api', 'graphql', '-f', 'query=mutation($owner: ID!, $title: String!) { createProjectV2(input: {ownerId: $owner, title: $title}) { projectV2 { id number } } }', '-f', `owner=${ownerId}`, '-f', `title=${boardName}`], { stdio: ['ignore', 'pipe', 'pipe'] }).toString().trim();
243
- const projectCreateResponse = JSON.parse(projectCreateRaw);
244
- if (projectCreateResponse.errors) {
253
+ const projectCreateResponse = projectCreateRaw ? JSON.parse(projectCreateRaw) : null;
254
+ if (projectCreateResponse?.errors) {
245
255
  throw new Error(projectCreateResponse.errors.map(e => e.message).join('; '));
246
256
  }
247
- const projectCreateData = projectCreateResponse.data.createProjectV2.projectV2;
248
- projectId = projectCreateData.id;
249
- projectNumber = projectCreateData.number;
257
+ const projectCreateData = projectCreateResponse?.data?.createProjectV2?.projectV2;
258
+ projectId = projectCreateData?.id;
259
+ projectNumber = projectCreateData?.number;
250
260
 
251
261
  console.log(` ${i18n.project_ok}${projectId})`);
252
262
 
@@ -280,7 +290,7 @@ async function runSetup() {
280
290
 
281
291
  if (statusFieldId) {
282
292
  const columns = [
283
- { name: "💡 Idea", description: "Backlog every new issue lands here", color: "GRAY" },
293
+ { name: "💡 Idea - No move to Exploration directly", description: "Just tell your agent to work on issue #XX", color: "GRAY" },
284
294
  { name: "🔍 Exploration", description: "AI is analyzing code and context", color: "PURPLE" },
285
295
  { name: "🧠 Brainstorming", description: "AI proposed approaches and trade-offs", color: "PINK" },
286
296
  { name: "📐 Detail Solution", description: "AI is writing the technical spec", color: "BLUE" },
@@ -314,7 +324,8 @@ async function runSetup() {
314
324
 
315
325
  const updateOutput = execFileSync('gh', ['api', 'graphql', '--input', '-'], { input: queryPayload }).toString().trim();
316
326
  const jsonResponse = updateOutput ? JSON.parse(updateOutput) : null;
317
- const returnedOptions = jsonResponse?.data?.updateProjectV2Field?.projectV2Field?.options || [];
327
+ const returnedOptions = jsonResponse?.data?.updateProjectV2Field?.projectV2Field?.options ||
328
+ jsonResponse?.data?.updateProjectV2SingleSelectField?.projectV2SingleSelectField?.options || [];
318
329
 
319
330
  for (const opt of returnedOptions) {
320
331
  optionMap[opt.name] = opt.id;
package/docs/flow.md CHANGED
@@ -5,8 +5,7 @@ This document describes the full lifecycle of a card on the agentic-pdlc board
5
5
  ```mermaid
6
6
  stateDiagram-v2
7
7
  direction LR
8
- Idea --> Exploration : stage:exploration
9
- Exploration --> Brainstorming : stage:brainstorming
8
+ Idea --> Brainstorming : stage:brainstorming
10
9
  Brainstorming --> Detailing : Gate 1 (PM)
11
10
  Detailing --> Approval : stage:approval
12
11
  Approval --> Development : Gate 2 (spec:approved)
@@ -23,7 +22,7 @@ stateDiagram-v2
23
22
  |------|---------------|
24
23
  | **PM** (human) | Selects issues for the sprint, approves brainstorm (Gate 1), approves spec (Gate 2) |
25
24
  | **TL / Reviewer** (human) | Co-approves spec for technical decisions (Gate 2), reviews and approves the PR (Gate 3) |
26
- | **Claude** | Exploration, brainstorming, spec writing — acts on PM instruction via chat or via upstream label |
25
+ | **Claude** | Brainstorming (context reading + approaches), spec writing — acts on PM instruction via chat or via upstream label |
27
26
  | **Implementation Agent** | Implementation, running tests, opening the PR |
28
27
  | **Workflow** | All label swaps and card movements — the source of truth for board state |
29
28
 
@@ -38,33 +37,22 @@ Issue exists in the backlog with no `stage:` label.
38
37
 
39
38
  ---
40
39
 
41
- ### 🔍 Exploration
42
-
43
- **Trigger (two equivalent paths):**
44
- - PM tells Claude directly in chat → Claude adds `stage:exploration` to the issue, OR
45
- - PM adds `stage:exploration` directly to the issue
46
-
47
- **Workflow:** `project-automation.yml` detects `stage:exploration` → moves card to Exploration.
48
-
49
- **Who works:** Claude reads relevant code and context.
50
-
51
- ---
52
-
53
40
  ### 🧠 Brainstorming
54
41
 
55
- **Trigger:** Claude, after exploration.
42
+ **Trigger:** PM tells Claude to work on the issue (in chat) or applies `stage:brainstorming` directly.
56
43
 
57
44
  **Actions:**
58
- - Claude posts a comment on the issue with findings and 2–3 proposed approaches
59
- - Claude swaps `stage:exploration` `stage:brainstorming`
45
+ - Claude applies `stage:brainstorming` immediately
46
+ - Claude reads relevant code and context
47
+ - Claude posts a single comment with: (1) brief problem summary, (2) 2–3 proposed approaches with trade-offs
60
48
 
61
- **Workflow:** `project-automation.yml` moves card to Brainstorming.
49
+ **Workflow:** `project-automation.yml` detects `stage:brainstorming` → moves card to Brainstorming.
62
50
 
63
51
  **⏸ Human gate (Gate 1 — PM):** PM reads the brainstorming comment and selects an approach. This can be done:
64
52
  - By commenting on the issue (e.g., "Option A", "Go with B", "approved", "lgtm")
65
53
  - By telling Claude in chat
66
54
 
67
- **Note on implicit approval:** If Claude presented multiple options, selecting one (e.g., "Option A") counts as implicit approval. The `upstream-gate.yml` detects option-selection patterns in addition to explicit approval words.
55
+ **Note on implicit approval:** Selecting one option (e.g., "Option A") counts as implicit approval. The `upstream-gate.yml` detects option-selection patterns in addition to explicit approval words.
68
56
 
69
57
  ---
70
58
 
@@ -141,7 +129,6 @@ Issue exists in the backlog with no `stage:` label.
141
129
 
142
130
  | Label | Added by | Removed by |
143
131
  |-------|----------|------------|
144
- | `stage:exploration` | PM (human) or Claude | Claude |
145
132
  | `stage:brainstorming` | Claude | `upstream-gate.yml` |
146
133
  | `stage:detailing` | `upstream-gate.yml` | Claude |
147
134
  | `stage:approval` | Claude | `agent-trigger.yml` |
package/docs/pdlc.md CHANGED
@@ -4,9 +4,8 @@
4
4
 
5
5
  | Column | Meaning | Who moves the card |
6
6
  |---|---|---|
7
- | 💡 Idea — don't move manually to Exploration | Backlog — tell agent: "work on issue #XX" | Don't move manually |
8
- | 🔍 Exploration | AI is analyzing code and context | Label `stage:exploration` |
9
- | 🧠 Brainstorming | AI proposed approaches and trade-offs | Label `stage:brainstorming` |
7
+ | 💡 Idea | Backlog — tell agent: "work on issue #XX" | Don't move manually |
8
+ | 🧠 Brainstorming | AI reading context, proposing approaches and trade-offs | Label `stage:brainstorming` |
10
9
  | 📐 Detail Solution | AI is writing the technical spec | Label `stage:detailing` |
11
10
  | ✅ Approval | Your turn, awaiting `spec:approved` label | Label `spec:approved` |
12
11
  | ⚙️ Development | AI implementing the spec | Label `stage:development` |
@@ -32,7 +31,6 @@ REPO = {{REPO_OWNER}}/{{REPO_NAME}}
32
31
  | Column | Option ID |
33
32
  |---|---|
34
33
  | 💡 Idea | `{{ID_IDEA}}` |
35
- | 🔍 Exploration | `{{ID_EXPLORATION}}` |
36
34
  | 🧠 Brainstorming | `{{ID_BRAINSTORMING}}` |
37
35
  | 📐 Detail Solution | `{{ID_DETAIL}}` |
38
36
  | ✅ Approval | `{{ID_APPROVAL}}` |
@@ -65,7 +63,6 @@ REPO = {{REPO_OWNER}}/{{REPO_NAME}}
65
63
 
66
64
  | Label | Entity | Color | Meaning |
67
65
  |---|---|---|---|
68
- | `stage:exploration` | Issue | Purple | Issue is being evaluated |
69
66
  | `stage:brainstorming` | Issue | Pink | Proposed approaches awaiting PM gate |
70
67
  | `stage:detailing` | Issue | Blue | Technical spec is being written |
71
68
  | `stage:development` | Issue | Orange | Agent is implementing the spec |
@@ -73,15 +70,15 @@ REPO = {{REPO_OWNER}}/{{REPO_NAME}}
73
70
  | `pr:in-review` | PR | Yellow | Awaiting code review |
74
71
  | `pr:approved` | PR | Green | Code review approved |
75
72
  | `type:us` | Issue | Blue | New feature or behavioral change — full flow |
76
- | `type:task` | Issue | Yellow | Operational/non-functional change — skips brainstorming |
77
- | `type:bug` | Issue | Red | Something broken — skips brainstorming |
73
+ | `type:task` | Issue | Yellow | Operational/non-functional change — full flow |
74
+ | `type:bug` | Issue | Red | Something broken — full flow |
78
75
  | `type:spike` | Issue | Gray | Research/evaluation — never reaches Development |
79
76
 
80
77
  ## Approval Gates
81
78
 
82
79
  **Gate 1 — PM/Ideation (Brainstorming):**
83
- You comment on the issue approving one of the approaches proposed by the ideation agent.
84
- Format: *"Approved — proceed with option X."*
80
+ Agent presents problem summary + 2–3 solution options in a single message. You select an approach.
81
+ Format: *"Option X"* or *"Go with B"* or *"Approved — proceed with option X."*
85
82
 
86
83
  **Gate 2 — Tech Lead (Spec):**
87
84
  You add the `spec:approved` label to the issue after reviewing the technical spec in the body.
@@ -93,13 +90,24 @@ The `type:*` label is the authoritative signal — set automatically by the agen
93
90
 
94
91
  | Label | Flow |
95
92
  |---|---|
96
- | `type:us` | Full flow — exploration → brainstorming → Gate 1 → detailing → approval |
97
- | `type:task` | Skips brainstorming exploration → detailing → approval |
98
- | `type:bug` | Skips brainstorming exploration → detailing → approval |
99
- | `type:spike` | Skips brainstorming exploration → detailing → conclusion comment (never reaches Development) |
93
+ | `type:us` | brainstorming → Gate 1 → detailing → approval |
94
+ | `type:task` | brainstorming Gate 1 → detailing → approval |
95
+ | `type:bug` | brainstorming Gate 1 → detailing → approval |
96
+ | `type:spike` | brainstorming Gate 1 → detailing → conclusion comment (never reaches Development) |
100
97
 
101
98
  If no `type:*` label present and agent confidence < 85%, defaults to `type:us` (safe fallback — never skips gates by omission).
102
99
 
100
+ ## Bypass Mechanism
101
+
102
+ Agents MUST NOT skip any stage. The ONLY authorized bypasses are:
103
+
104
+ | Mechanism | Who authorizes | What it bypasses |
105
+ |---|---|---|
106
+ | `human-approved` label on issue | PM (human) only | All stage gates |
107
+ | Branch prefix `hotfix/` | PM (human) only | PR gate only |
108
+
109
+ Agents MUST NOT self-authorize a bypass. Stop and ask the PM explicitly.
110
+
103
111
  ## Definition of Done
104
112
 
105
113
  An issue is truly done when:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-agentic-pdlc",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Agentic PDLC Framework - Conversational setup for your AI coding assistants",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -75,7 +75,7 @@ jobs:
75
75
  console.log(`Issue #${number} → Development`);
76
76
 
77
77
  - name: Comment on issue to trigger agent and prevent race conditions
78
- if: ${{ !contains('{{IMPLEMENTATION_AGENT_LABEL}}', '{{') }}
78
+ if: ${{ !contains('{{IMPLEMENTATION_AGENT_LABEL}}', '{{') && vars.JULES_ENABLED == 'true' }}
79
79
  uses: actions/github-script@v7
80
80
  with:
81
81
  github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -118,7 +118,7 @@ jobs:
118
118
  contents: read
119
119
  steps:
120
120
  - name: Comment on issue to trigger agent
121
- if: ${{ !contains('{{IMPLEMENTATION_AGENT_LABEL}}', '{{') }}
121
+ if: ${{ !contains('{{IMPLEMENTATION_AGENT_LABEL}}', '{{') && vars.JULES_ENABLED == 'true' }}
122
122
  uses: actions/github-script@v7
123
123
  with:
124
124
  github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -38,3 +38,17 @@ jobs:
38
38
  if: ${{ !contains('{{TEST_COMMAND}}', '{{') }}
39
39
  run: |
40
40
  {{TEST_COMMAND}}
41
+
42
+ ci-status:
43
+ name: Sentinel / CI
44
+ needs: [validate]
45
+ if: always()
46
+ runs-on: ubuntu-latest
47
+ steps:
48
+ - name: Check validate result
49
+ run: |
50
+ result="${{ needs.validate.result }}"
51
+ if [[ "$result" != "success" && "$result" != "skipped" ]]; then
52
+ echo "CI failed: validate=$result"
53
+ exit 1
54
+ fi
@@ -8,7 +8,6 @@ on:
8
8
  env:
9
9
  PROJECT_ID: "{{PROJECT_ID}}"
10
10
  STATUS_FIELD_ID: "{{STATUS_FIELD_ID}}"
11
- STATUS_EXPLORATION: "{{ID_EXPLORATION}}"
12
11
  STATUS_BRAINSTORMING: "{{ID_BRAINSTORMING}}"
13
12
  STATUS_DETAILING: "{{ID_DETAILING}}"
14
13
  STATUS_APPROVAL: "{{ID_APPROVAL}}"
@@ -35,7 +34,6 @@ jobs:
35
34
  const projectId = process.env.PROJECT_ID;
36
35
  const statusFieldId = process.env.STATUS_FIELD_ID;
37
36
  const envVars = {
38
- 'STATUS_EXPLORATION': process.env.STATUS_EXPLORATION,
39
37
  'STATUS_BRAINSTORMING': process.env.STATUS_BRAINSTORMING,
40
38
  'STATUS_DETAILING': process.env.STATUS_DETAILING,
41
39
  'STATUS_APPROVAL': process.env.STATUS_APPROVAL,
@@ -6,13 +6,12 @@ on:
6
6
  pull_request_review:
7
7
  types: [submitted]
8
8
  issues:
9
- types: [labeled, edited]
9
+ types: [labeled, edited, closed]
10
10
 
11
11
  env:
12
12
  PROJECT_ID: "{{PROJECT_ID}}"
13
13
  STATUS_FIELD_ID: "{{STATUS_FIELD_ID}}"
14
14
  STATUS_IDEA: "{{ID_IDEA}}"
15
- STATUS_EXPLORATION: "{{ID_EXPLORATION}}"
16
15
  STATUS_BRAINSTORMING: "{{ID_BRAINSTORMING}}"
17
16
  STATUS_DETAILING: "{{ID_DETAILING}}"
18
17
  STATUS_APPROVAL: "{{ID_APPROVAL}}"
@@ -40,10 +39,7 @@ jobs:
40
39
  let targetStatusId = null;
41
40
  let stageName = null;
42
41
 
43
- if (labelName === 'stage:exploration') {
44
- targetStatusId = process.env.STATUS_EXPLORATION;
45
- stageName = 'Exploration';
46
- } else if (labelName === 'stage:brainstorming') {
42
+ if (labelName === 'stage:brainstorming') {
47
43
  targetStatusId = process.env.STATUS_BRAINSTORMING;
48
44
  stageName = 'Brainstorming';
49
45
  } else if (labelName === 'stage:detailing') {
@@ -302,3 +298,25 @@ jobs:
302
298
  } else {
303
299
  await moveItem(pr.node_id);
304
300
  }
301
+
302
+ cleanup-labels-on-close:
303
+ name: Issue closed → strip stage/agent labels
304
+ if: github.event_name == 'issues' && github.event.action == 'closed'
305
+ runs-on: ubuntu-latest
306
+ steps:
307
+ - name: Remove transient labels
308
+ uses: actions/github-script@v7
309
+ with:
310
+ github-token: ${{ secrets.GITHUB_TOKEN }}
311
+ script: |
312
+ const { owner, repo } = context.repo;
313
+ const issue_number = context.payload.issue.number;
314
+ const toRemove = [
315
+ 'stage:brainstorming', 'stage:detailing',
316
+ 'stage:approval', 'stage:development', 'stage:testing',
317
+ 'agent:working', 'qa:needs-work', 'pr:in-review', 'jules'
318
+ ];
319
+ for (const label of toRemove) {
320
+ await github.rest.issues.removeLabel({ owner, repo, issue_number, name: label }).catch(() => {});
321
+ }
322
+ console.log(`Issue #${issue_number} labels cleaned up`);
@@ -13,6 +13,8 @@ jobs:
13
13
  qa:
14
14
  name: AC Coverage Verification (GitHub Models)
15
15
  runs-on: ubuntu-latest
16
+ env:
17
+ PROJECT_PAT: ${{ secrets.PROJECT_PAT }}
16
18
  steps:
17
19
  - uses: actions/checkout@v4
18
20
  with:
@@ -59,7 +61,7 @@ jobs:
59
61
  --max-time 30 || echo "API_ERROR")
60
62
 
61
63
  if [ "$RESPONSE" = "API_ERROR" ]; then
62
- gh pr edit "$PR_NUMBER" --add-label "infra:qa-broken"
64
+ GH_TOKEN="$PROJECT_PAT" gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/labels" --method POST -f 'labels[]=infra:qa-broken'
63
65
  gh pr comment "$PR_NUMBER" --body "🤖 **QA Agent:** Could not reach GitHub Models API. Manual review required."
64
66
  exit 0
65
67
  fi
@@ -68,12 +70,12 @@ jobs:
68
70
  EXPLANATION=$(echo "$RESPONSE" | python3 -c 'import json,sys; d=json.load(sys.stdin); t=d.get("choices",[{}])[0].get("message",{}).get("content","").strip(); lines=t.split("\n",1); print(lines[1].strip() if len(lines)>1 else "")')
69
71
 
70
72
  if echo "$VERDICT" | grep -q "^PASS"; then
71
- gh pr edit "$PR_NUMBER" --add-label "qa:approved"
73
+ GH_TOKEN="$PROJECT_PAT" gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/labels" --method POST -f 'labels[]=qa:approved'
72
74
  gh pr comment "$PR_NUMBER" --body "🤖 **QA Agent:** AC coverage verified. ${EXPLANATION}"
73
75
  elif echo "$VERDICT" | grep -q "^FAIL"; then
74
- gh pr edit "$PR_NUMBER" --add-label "qa:needs-work"
76
+ GH_TOKEN="$PROJECT_PAT" gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/labels" --method POST -f 'labels[]=qa:needs-work'
75
77
  gh pr comment "$PR_NUMBER" --body "🤖 **QA Agent:** AC coverage insufficient. ${EXPLANATION}"
76
78
  else
77
- gh pr edit "$PR_NUMBER" --add-label "infra:qa-broken"
79
+ GH_TOKEN="$PROJECT_PAT" gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/labels" --method POST -f 'labels[]=infra:qa-broken'
78
80
  gh pr comment "$PR_NUMBER" --body "🤖 **QA Agent:** Could not parse GitHub Models response. Manual review required."
79
81
  fi
@@ -30,7 +30,7 @@ Always start from the current `main` HEAD. Never work over stale snapshots.
30
30
  ## Mandatory Workflow
31
31
 
32
32
  0. **Identity**: Always prefix your GitHub comments with `🤖 **Agent:** ` to distinguish yourself.
33
- 1. **Initial State**: When beginning work on a new issue, your very first action must be to apply the `stage:exploration` label using the GitHub CLI (`gh issue edit <N> --add-label "stage:exploration"`).
33
+ 1. **Initial State**: When beginning work on a new issue, your very first action must be to apply the `stage:brainstorming` label using the GitHub CLI (`gh issue edit <N> --add-label "stage:brainstorming"`).
34
34
  2. Read the issue entirely — understand its type (US/BUG/TASK/SPIKE) and the Acceptance Criteria.
35
35
  3. Read `docs/pdlc.md` — understand the PDLC and the Definition of Done in this project.
36
36
  4. Read all files mentioned in the issue's technical context.
@@ -64,6 +64,25 @@ When detailing a solution in an issue body, you must **always** include both the
64
64
  - `path/to/file.ts` — what changes
65
65
  ```
66
66
 
67
+ ## Stage Transition Rules (non-negotiable)
68
+
69
+ MUST apply `stage:brainstorming` label immediately on starting work — before reading
70
+ any code, before invoking any skill. Then read context and present problem summary
71
+ + 2–3 solution options in a single message.
72
+
73
+ MUST NOT add `stage:detailing` label until the user has explicitly selected
74
+ an approach in the current conversation turn. Work done in a prior
75
+ planning session does NOT count as confirmation.
76
+
77
+ MUST NOT add `spec:approved`, `stage:development`, or manually add
78
+ `stage:approval` — these represent final human approval or the result of it.
79
+ `stage:approval` is only set by system automation after you provide a complete
80
+ spec for human review. Adding them manually triggers irreversible automation
81
+ (Jules dispatch, board move).
82
+
83
+ Each stage transition requires a fresh explicit signal from the user in the same
84
+ session where the transition happens. These rules have no exceptions.
85
+
67
86
  ## Pipeline Updates
68
87
 
69
88
  To add or configure optional agents (Jules, QA Agent, Sentinel) at any time:
@@ -80,7 +99,11 @@ Run this when the user says anything like "update the pipeline", "update the boa
80
99
  - Never open a PR without passing the tests.
81
100
  - Never implement beyond the immediate scope of the issue.
82
101
  - Never create future-proofing abstractions for hypothetical features.
83
- - Never add or remove `stage:*` or `qa:*` labels manually. These are owned by GitHub Actions automation and the PM only.
102
+ - The agent MUST NOT apply these labels under any circumstances (PM only):
103
+ - `spec:approved`: triggers Jules dispatch + board move to Development.
104
+ - `qa:approved`: triggers board move to Code Review.
105
+ - `qa:needs-work`: signals the PR requires changes and halts the flow.
106
+ - Never add or remove stage:* labels manually, except for stage:brainstorming as the initial label when starting work. All other stage transitions are owned by GitHub Actions automation and the PM.
84
107
  {{EXTRA_DONT}}
85
108
 
86
109
  ## Project Standards
@@ -4,9 +4,8 @@
4
4
 
5
5
  | Column | Meaning | Who moves the card |
6
6
  |---|---|---|
7
- | 💡 Idea — don't move manually to Exploration | Backlog — tell agent: "work on issue #XX" | Don't move manually |
8
- | 🔍 Exploration | Claude is analyzing code and context | Label `stage:exploration` |
9
- | 🧠 Brainstorming | Claude proposed approaches, awaiting PM gate | Label `stage:brainstorming` |
7
+ | 💡 Idea | Backlog — tell agent: "work on issue #XX" | Don't move manually |
8
+ | 🧠 Brainstorming | AI reading context, proposing approaches and trade-offs | Label `stage:brainstorming` |
10
9
  | 📐 Detail Solution | Claude is writing the technical spec | Label `stage:detailing` |
11
10
  | ✅ Approval | Spec ready, awaiting `spec:approved` label | Label `spec:approved` |
12
11
  | ⚙️ Development | Agent implementing the spec | Label `stage:development` |
@@ -37,7 +36,6 @@ REPO = {{REPO_OWNER}}/{{REPO_NAME}}
37
36
  | Column | Option ID |
38
37
  |---|---|
39
38
  | 💡 Idea | `{{ID_IDEA}}` |
40
- | 🔍 Exploration | `{{ID_EXPLORATION}}` |
41
39
  | 🧠 Brainstorming | `{{ID_BRAINSTORMING}}` |
42
40
  | 📐 Detail Solution | `{{ID_DETAIL}}` |
43
41
  | ✅ Approval | `{{ID_APPROVAL}}` |
@@ -70,7 +68,6 @@ REPO = {{REPO_OWNER}}/{{REPO_NAME}}
70
68
 
71
69
  | Label | Entity | Color | Meaning |
72
70
  |---|---|---|---|
73
- | `stage:exploration` | Issue | Purple | Issue is being evaluated |
74
71
  | `stage:brainstorming` | Issue | Pink | Proposed approaches awaiting PM gate |
75
72
  | `stage:detailing` | Issue | Blue | Technical spec is being written |
76
73
  | `stage:development` | Issue | Orange | Agent is implementing the spec |
@@ -81,15 +78,15 @@ REPO = {{REPO_OWNER}}/{{REPO_NAME}}
81
78
  | `qa:needs-work` | PR | Red | QA Agent failed — PR needs changes |
82
79
  | `infra:qa-broken` | PR | Orange | QA Agent error — manual review required |
83
80
  | `type:us` | Issue | Blue | New feature or behavioral change — full flow |
84
- | `type:task` | Issue | Yellow | Operational/non-functional change — skips brainstorming |
85
- | `type:bug` | Issue | Red | Something broken — skips brainstorming |
81
+ | `type:task` | Issue | Yellow | Operational/non-functional change — full flow |
82
+ | `type:bug` | Issue | Red | Something broken — full flow |
86
83
  | `type:spike` | Issue | Gray | Research/evaluation — never reaches Development |
87
84
 
88
85
  ## Approval Gates
89
86
 
90
87
  **Gate 1 — PM/Ideation (Brainstorming):**
91
- You comment on the issue approving one of the approaches proposed by the ideation agent.
92
- Format: *"Approved — proceed with option X."*
88
+ Agent presents problem summary + 2–3 solution options in a single message. You select an approach.
89
+ Format: *"Option X"* or *"Go with B"* or *"Approved — proceed with option X."*
93
90
 
94
91
  **Gate 2 — Tech Lead (Spec):**
95
92
  You add the `spec:approved` label to the issue after reviewing the technical spec in the body.
@@ -101,13 +98,24 @@ The `type:*` label is the authoritative signal — set automatically by the agen
101
98
 
102
99
  | Label | Flow |
103
100
  |---|---|
104
- | `type:us` | Full flow — exploration → brainstorming → Gate 1 → detailing → approval |
105
- | `type:task` | Skips brainstorming exploration → detailing → approval |
106
- | `type:bug` | Skips brainstorming exploration → detailing → approval |
107
- | `type:spike` | Skips brainstorming exploration → detailing → conclusion comment (never reaches Development) |
101
+ | `type:us` | brainstorming → Gate 1 → detailing → approval |
102
+ | `type:task` | brainstorming Gate 1 → detailing → approval |
103
+ | `type:bug` | brainstorming Gate 1 → detailing → approval |
104
+ | `type:spike` | brainstorming Gate 1 → detailing → conclusion comment (never reaches Development) |
108
105
 
109
106
  If no `type:*` label present and agent confidence < 85%, defaults to `type:us` (safe fallback — never skips gates by omission).
110
107
 
108
+ ## Bypass Mechanism
109
+
110
+ Agents MUST NOT skip any stage. The ONLY authorized bypasses are:
111
+
112
+ | Mechanism | Who authorizes | What it bypasses |
113
+ |---|---|---|
114
+ | `human-approved` label on issue | PM (human) only | All stage gates |
115
+ | Branch prefix `hotfix/` | PM (human) only | PR gate only |
116
+
117
+ Agents MUST NOT self-authorize a bypass. Stop and ask the PM explicitly.
118
+
111
119
  ## Definition of Done
112
120
 
113
121
  An issue is truly done when: