create-agentic-pdlc 1.0.13 → 1.1.1
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.
|
@@ -5,25 +5,94 @@ on:
|
|
|
5
5
|
types: [opened, reopened, closed]
|
|
6
6
|
pull_request_review:
|
|
7
7
|
types: [submitted]
|
|
8
|
+
issue_comment:
|
|
9
|
+
types: [created]
|
|
8
10
|
|
|
9
11
|
env:
|
|
10
12
|
PROJECT_ID: "{{PROJECT_ID}}"
|
|
11
13
|
STATUS_FIELD_ID: "{{STATUS_FIELD_ID}}"
|
|
14
|
+
STATUS_EXPLORATION: "{{ID_EXPLORATION}}"
|
|
15
|
+
STATUS_BRAINSTORMING: "{{ID_BRAINSTORMING}}"
|
|
16
|
+
STATUS_DETAILING: "{{ID_DETAILING}}"
|
|
17
|
+
STATUS_APPROVAL: "{{ID_APPROVAL}}"
|
|
12
18
|
STATUS_CODE_REVIEW: "{{ID_CODE_REVIEW}}"
|
|
13
19
|
STATUS_PULL_REQUEST: "{{ID_PULL_REQUEST}}"
|
|
14
20
|
STATUS_PRODUCAO: "{{ID_PRODUCAO}}"
|
|
15
21
|
|
|
16
22
|
jobs:
|
|
23
|
+
# Issue Comment → Move Upstream
|
|
24
|
+
move-card-on-comment:
|
|
25
|
+
name: Upstream Comment Marker → Move Card
|
|
26
|
+
if: github.event_name == 'issue_comment' && github.event.action == 'created'
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
env:
|
|
29
|
+
PROJECT_TOKEN: ${{ secrets.PROJECT_TOKEN }}
|
|
30
|
+
steps:
|
|
31
|
+
- name: Detect Marker and Move Issue
|
|
32
|
+
if: ${{ env.PROJECT_TOKEN != '' }}
|
|
33
|
+
uses: actions/github-script@v7
|
|
34
|
+
with:
|
|
35
|
+
github-token: ${{ env.PROJECT_TOKEN }}
|
|
36
|
+
script: |
|
|
37
|
+
const body = context.payload.comment.body;
|
|
38
|
+
let targetStatusId = null;
|
|
39
|
+
let stageName = null;
|
|
40
|
+
|
|
41
|
+
if (body.includes('<!-- PDLC:stage:exploration -->')) {
|
|
42
|
+
targetStatusId = process.env.STATUS_EXPLORATION;
|
|
43
|
+
stageName = 'Exploration';
|
|
44
|
+
} else if (body.includes('<!-- PDLC:stage:brainstorming -->')) {
|
|
45
|
+
targetStatusId = process.env.STATUS_BRAINSTORMING;
|
|
46
|
+
stageName = 'Brainstorming';
|
|
47
|
+
} else if (body.includes('<!-- PDLC:stage:detailing -->')) {
|
|
48
|
+
targetStatusId = process.env.STATUS_DETAILING;
|
|
49
|
+
stageName = 'Detailing';
|
|
50
|
+
} else if (body.includes('<!-- PDLC:stage:approval -->')) {
|
|
51
|
+
targetStatusId = process.env.STATUS_APPROVAL;
|
|
52
|
+
stageName = 'Approval';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!targetStatusId) {
|
|
56
|
+
console.log('No upstream PDLC marker found. Skipping.');
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const { issue: { number, node_id } } = context.payload;
|
|
61
|
+
|
|
62
|
+
const moveItem = async (nodeId, statusId) => {
|
|
63
|
+
const { addProjectV2ItemById: { item } } = await github.graphql(`
|
|
64
|
+
mutation($p: ID!, $c: ID!) {
|
|
65
|
+
addProjectV2ItemById(input: {projectId: $p, contentId: $c}) { item { id } }
|
|
66
|
+
}`, { p: process.env.PROJECT_ID, c: nodeId });
|
|
67
|
+
|
|
68
|
+
await github.graphql(`
|
|
69
|
+
mutation($p: ID!, $i: ID!, $f: ID!, $v: ProjectV2FieldValue!) {
|
|
70
|
+
updateProjectV2ItemFieldValue(input: {projectId: $p, itemId: $i, fieldId: $f, value: $v}) {
|
|
71
|
+
projectV2Item { id }
|
|
72
|
+
}
|
|
73
|
+
}`, {
|
|
74
|
+
p: process.env.PROJECT_ID, i: item.id, f: process.env.STATUS_FIELD_ID,
|
|
75
|
+
v: { singleSelectOptionId: statusId }
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
await moveItem(node_id, targetStatusId);
|
|
80
|
+
console.log(`Issue #${number} moved to ${stageName}`);
|
|
81
|
+
|
|
82
|
+
|
|
17
83
|
# PR Opened → Move linked issue to Code Review
|
|
18
84
|
move-card-on-pr-open:
|
|
19
85
|
name: Open PR → Code Review
|
|
20
86
|
if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')
|
|
21
87
|
runs-on: ubuntu-latest
|
|
88
|
+
env:
|
|
89
|
+
PROJECT_TOKEN: ${{ secrets.PROJECT_TOKEN }}
|
|
22
90
|
steps:
|
|
23
91
|
- name: Move linked issue to Code Review
|
|
92
|
+
if: ${{ env.PROJECT_TOKEN != '' }}
|
|
24
93
|
uses: actions/github-script@v7
|
|
25
94
|
with:
|
|
26
|
-
github-token: ${{
|
|
95
|
+
github-token: ${{ env.PROJECT_TOKEN }}
|
|
27
96
|
script: |
|
|
28
97
|
const prNumber = context.payload.pull_request.number;
|
|
29
98
|
const { owner, repo } = context.repo;
|
|
@@ -70,11 +139,14 @@ jobs:
|
|
|
70
139
|
name: Approved PR → Pull Request
|
|
71
140
|
if: github.event_name == 'pull_request_review' && github.event.review.state == 'approved'
|
|
72
141
|
runs-on: ubuntu-latest
|
|
142
|
+
env:
|
|
143
|
+
PROJECT_TOKEN: ${{ secrets.PROJECT_TOKEN }}
|
|
73
144
|
steps:
|
|
74
145
|
- name: Move issue to Pull Request
|
|
146
|
+
if: ${{ env.PROJECT_TOKEN != '' }}
|
|
75
147
|
uses: actions/github-script@v7
|
|
76
148
|
with:
|
|
77
|
-
github-token: ${{
|
|
149
|
+
github-token: ${{ env.PROJECT_TOKEN }}
|
|
78
150
|
script: |
|
|
79
151
|
const prNumber = context.payload.pull_request.number;
|
|
80
152
|
const { owner, repo } = context.repo;
|
|
@@ -113,11 +185,14 @@ jobs:
|
|
|
113
185
|
name: Merged PR → Production
|
|
114
186
|
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
|
|
115
187
|
runs-on: ubuntu-latest
|
|
188
|
+
env:
|
|
189
|
+
PROJECT_TOKEN: ${{ secrets.PROJECT_TOKEN }}
|
|
116
190
|
steps:
|
|
117
191
|
- name: Move issue to Production
|
|
192
|
+
if: ${{ env.PROJECT_TOKEN != '' }}
|
|
118
193
|
uses: actions/github-script@v7
|
|
119
194
|
with:
|
|
120
|
-
github-token: ${{
|
|
195
|
+
github-token: ${{ env.PROJECT_TOKEN }}
|
|
121
196
|
script: |
|
|
122
197
|
const prNumber = context.payload.pull_request.number;
|
|
123
198
|
const { owner, repo } = context.repo;
|
package/AGENTS.md
CHANGED
|
@@ -26,6 +26,7 @@ Always start from the current `main` HEAD. Never work over stale snapshots.
|
|
|
26
26
|
|
|
27
27
|
## Mandatory Workflow
|
|
28
28
|
|
|
29
|
+
0. **Identity**: Always prefix your GitHub comments with `🤖 **Agent:** ` to distinguish yourself.
|
|
29
30
|
1. Read the issue entirely — understand its type (US/BUG/TASK/SPIKE) and the Acceptance Criteria.
|
|
30
31
|
2. Read `docs/pdlc.md` — understand the PDLC and the Definition of Done in this project.
|
|
31
32
|
3. Read all files mentioned in the issue's technical context.
|
package/package.json
CHANGED
|
@@ -5,25 +5,94 @@ on:
|
|
|
5
5
|
types: [opened, reopened, closed]
|
|
6
6
|
pull_request_review:
|
|
7
7
|
types: [submitted]
|
|
8
|
+
issue_comment:
|
|
9
|
+
types: [created]
|
|
8
10
|
|
|
9
11
|
env:
|
|
10
12
|
PROJECT_ID: "{{PROJECT_ID}}"
|
|
11
13
|
STATUS_FIELD_ID: "{{STATUS_FIELD_ID}}"
|
|
14
|
+
STATUS_EXPLORATION: "{{ID_EXPLORATION}}"
|
|
15
|
+
STATUS_BRAINSTORMING: "{{ID_BRAINSTORMING}}"
|
|
16
|
+
STATUS_DETAILING: "{{ID_DETAILING}}"
|
|
17
|
+
STATUS_APPROVAL: "{{ID_APPROVAL}}"
|
|
12
18
|
STATUS_CODE_REVIEW: "{{ID_CODE_REVIEW}}"
|
|
13
19
|
STATUS_PULL_REQUEST: "{{ID_PULL_REQUEST}}"
|
|
14
20
|
STATUS_PRODUCAO: "{{ID_PRODUCAO}}"
|
|
15
21
|
|
|
16
22
|
jobs:
|
|
23
|
+
# Issue Comment → Move Upstream
|
|
24
|
+
move-card-on-comment:
|
|
25
|
+
name: Upstream Comment Marker → Move Card
|
|
26
|
+
if: github.event_name == 'issue_comment' && github.event.action == 'created'
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
env:
|
|
29
|
+
PROJECT_TOKEN: ${{ secrets.PROJECT_TOKEN }}
|
|
30
|
+
steps:
|
|
31
|
+
- name: Detect Marker and Move Issue
|
|
32
|
+
if: ${{ env.PROJECT_TOKEN != '' }}
|
|
33
|
+
uses: actions/github-script@v7
|
|
34
|
+
with:
|
|
35
|
+
github-token: ${{ env.PROJECT_TOKEN }}
|
|
36
|
+
script: |
|
|
37
|
+
const body = context.payload.comment.body;
|
|
38
|
+
let targetStatusId = null;
|
|
39
|
+
let stageName = null;
|
|
40
|
+
|
|
41
|
+
if (body.includes('<!-- PDLC:stage:exploration -->')) {
|
|
42
|
+
targetStatusId = process.env.STATUS_EXPLORATION;
|
|
43
|
+
stageName = 'Exploration';
|
|
44
|
+
} else if (body.includes('<!-- PDLC:stage:brainstorming -->')) {
|
|
45
|
+
targetStatusId = process.env.STATUS_BRAINSTORMING;
|
|
46
|
+
stageName = 'Brainstorming';
|
|
47
|
+
} else if (body.includes('<!-- PDLC:stage:detailing -->')) {
|
|
48
|
+
targetStatusId = process.env.STATUS_DETAILING;
|
|
49
|
+
stageName = 'Detailing';
|
|
50
|
+
} else if (body.includes('<!-- PDLC:stage:approval -->')) {
|
|
51
|
+
targetStatusId = process.env.STATUS_APPROVAL;
|
|
52
|
+
stageName = 'Approval';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!targetStatusId) {
|
|
56
|
+
console.log('No upstream PDLC marker found. Skipping.');
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const { issue: { number, node_id } } = context.payload;
|
|
61
|
+
|
|
62
|
+
const moveItem = async (nodeId, statusId) => {
|
|
63
|
+
const { addProjectV2ItemById: { item } } = await github.graphql(`
|
|
64
|
+
mutation($p: ID!, $c: ID!) {
|
|
65
|
+
addProjectV2ItemById(input: {projectId: $p, contentId: $c}) { item { id } }
|
|
66
|
+
}`, { p: process.env.PROJECT_ID, c: nodeId });
|
|
67
|
+
|
|
68
|
+
await github.graphql(`
|
|
69
|
+
mutation($p: ID!, $i: ID!, $f: ID!, $v: ProjectV2FieldValue!) {
|
|
70
|
+
updateProjectV2ItemFieldValue(input: {projectId: $p, itemId: $i, fieldId: $f, value: $v}) {
|
|
71
|
+
projectV2Item { id }
|
|
72
|
+
}
|
|
73
|
+
}`, {
|
|
74
|
+
p: process.env.PROJECT_ID, i: item.id, f: process.env.STATUS_FIELD_ID,
|
|
75
|
+
v: { singleSelectOptionId: statusId }
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
await moveItem(node_id, targetStatusId);
|
|
80
|
+
console.log(`Issue #${number} moved to ${stageName}`);
|
|
81
|
+
|
|
82
|
+
|
|
17
83
|
# PR Opened → Move linked issue to Code Review
|
|
18
84
|
move-card-on-pr-open:
|
|
19
85
|
name: Open PR → Code Review
|
|
20
86
|
if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')
|
|
21
87
|
runs-on: ubuntu-latest
|
|
88
|
+
env:
|
|
89
|
+
PROJECT_TOKEN: ${{ secrets.PROJECT_TOKEN }}
|
|
22
90
|
steps:
|
|
23
91
|
- name: Move linked issue to Code Review
|
|
92
|
+
if: ${{ env.PROJECT_TOKEN != '' }}
|
|
24
93
|
uses: actions/github-script@v7
|
|
25
94
|
with:
|
|
26
|
-
github-token: ${{
|
|
95
|
+
github-token: ${{ env.PROJECT_TOKEN }}
|
|
27
96
|
script: |
|
|
28
97
|
const prNumber = context.payload.pull_request.number;
|
|
29
98
|
const { owner, repo } = context.repo;
|
|
@@ -70,11 +139,14 @@ jobs:
|
|
|
70
139
|
name: Approved PR → Pull Request
|
|
71
140
|
if: github.event_name == 'pull_request_review' && github.event.review.state == 'approved'
|
|
72
141
|
runs-on: ubuntu-latest
|
|
142
|
+
env:
|
|
143
|
+
PROJECT_TOKEN: ${{ secrets.PROJECT_TOKEN }}
|
|
73
144
|
steps:
|
|
74
145
|
- name: Move issue to Pull Request
|
|
146
|
+
if: ${{ env.PROJECT_TOKEN != '' }}
|
|
75
147
|
uses: actions/github-script@v7
|
|
76
148
|
with:
|
|
77
|
-
github-token: ${{
|
|
149
|
+
github-token: ${{ env.PROJECT_TOKEN }}
|
|
78
150
|
script: |
|
|
79
151
|
const prNumber = context.payload.pull_request.number;
|
|
80
152
|
const { owner, repo } = context.repo;
|
|
@@ -113,11 +185,14 @@ jobs:
|
|
|
113
185
|
name: Merged PR → Production
|
|
114
186
|
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
|
|
115
187
|
runs-on: ubuntu-latest
|
|
188
|
+
env:
|
|
189
|
+
PROJECT_TOKEN: ${{ secrets.PROJECT_TOKEN }}
|
|
116
190
|
steps:
|
|
117
191
|
- name: Move issue to Production
|
|
192
|
+
if: ${{ env.PROJECT_TOKEN != '' }}
|
|
118
193
|
uses: actions/github-script@v7
|
|
119
194
|
with:
|
|
120
|
-
github-token: ${{
|
|
195
|
+
github-token: ${{ env.PROJECT_TOKEN }}
|
|
121
196
|
script: |
|
|
122
197
|
const prNumber = context.payload.pull_request.number;
|
|
123
198
|
const { owner, repo } = context.repo;
|
package/templates/AGENTS.md
CHANGED
|
@@ -29,6 +29,7 @@ Always start from the current `main` HEAD. Never work over stale snapshots.
|
|
|
29
29
|
|
|
30
30
|
## Mandatory Workflow
|
|
31
31
|
|
|
32
|
+
0. **Identity**: Always prefix your GitHub comments with `🤖 **Agent:** ` to distinguish yourself.
|
|
32
33
|
1. Read the issue entirely — understand its type (US/BUG/TASK/SPIKE) and the Acceptance Criteria.
|
|
33
34
|
2. Read `docs/pdlc.md` — understand the PDLC and the Definition of Done in this project.
|
|
34
35
|
3. Read all files mentioned in the issue's technical context.
|