create-agentic-pdlc 1.0.13 → 1.1.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.
|
@@ -5,15 +5,79 @@ 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
|
+
steps:
|
|
29
|
+
- name: Detect Marker and Move Issue
|
|
30
|
+
if: ${{ secrets.PROJECT_TOKEN != '' }}
|
|
31
|
+
uses: actions/github-script@v7
|
|
32
|
+
with:
|
|
33
|
+
github-token: ${{ secrets.PROJECT_TOKEN }}
|
|
34
|
+
script: |
|
|
35
|
+
const body = context.payload.comment.body;
|
|
36
|
+
let targetStatusId = null;
|
|
37
|
+
let stageName = null;
|
|
38
|
+
|
|
39
|
+
if (body.includes('<!-- PDLC:stage:exploration -->')) {
|
|
40
|
+
targetStatusId = process.env.STATUS_EXPLORATION;
|
|
41
|
+
stageName = 'Exploration';
|
|
42
|
+
} else if (body.includes('<!-- PDLC:stage:brainstorming -->')) {
|
|
43
|
+
targetStatusId = process.env.STATUS_BRAINSTORMING;
|
|
44
|
+
stageName = 'Brainstorming';
|
|
45
|
+
} else if (body.includes('<!-- PDLC:stage:detailing -->')) {
|
|
46
|
+
targetStatusId = process.env.STATUS_DETAILING;
|
|
47
|
+
stageName = 'Detailing';
|
|
48
|
+
} else if (body.includes('<!-- PDLC:stage:approval -->')) {
|
|
49
|
+
targetStatusId = process.env.STATUS_APPROVAL;
|
|
50
|
+
stageName = 'Approval';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!targetStatusId) {
|
|
54
|
+
console.log('No upstream PDLC marker found. Skipping.');
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const { issue: { number, node_id } } = context.payload;
|
|
59
|
+
|
|
60
|
+
const moveItem = async (nodeId, statusId) => {
|
|
61
|
+
const { addProjectV2ItemById: { item } } = await github.graphql(`
|
|
62
|
+
mutation($p: ID!, $c: ID!) {
|
|
63
|
+
addProjectV2ItemById(input: {projectId: $p, contentId: $c}) { item { id } }
|
|
64
|
+
}`, { p: process.env.PROJECT_ID, c: nodeId });
|
|
65
|
+
|
|
66
|
+
await github.graphql(`
|
|
67
|
+
mutation($p: ID!, $i: ID!, $f: ID!, $v: ProjectV2FieldValue!) {
|
|
68
|
+
updateProjectV2ItemFieldValue(input: {projectId: $p, itemId: $i, fieldId: $f, value: $v}) {
|
|
69
|
+
projectV2Item { id }
|
|
70
|
+
}
|
|
71
|
+
}`, {
|
|
72
|
+
p: process.env.PROJECT_ID, i: item.id, f: process.env.STATUS_FIELD_ID,
|
|
73
|
+
v: { singleSelectOptionId: statusId }
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
await moveItem(node_id, targetStatusId);
|
|
78
|
+
console.log(`Issue #${number} moved to ${stageName}`);
|
|
79
|
+
|
|
80
|
+
|
|
17
81
|
# PR Opened → Move linked issue to Code Review
|
|
18
82
|
move-card-on-pr-open:
|
|
19
83
|
name: Open PR → Code Review
|
|
@@ -21,6 +85,7 @@ jobs:
|
|
|
21
85
|
runs-on: ubuntu-latest
|
|
22
86
|
steps:
|
|
23
87
|
- name: Move linked issue to Code Review
|
|
88
|
+
if: ${{ secrets.PROJECT_TOKEN != '' }}
|
|
24
89
|
uses: actions/github-script@v7
|
|
25
90
|
with:
|
|
26
91
|
github-token: ${{ secrets.PROJECT_TOKEN }}
|
|
@@ -72,6 +137,7 @@ jobs:
|
|
|
72
137
|
runs-on: ubuntu-latest
|
|
73
138
|
steps:
|
|
74
139
|
- name: Move issue to Pull Request
|
|
140
|
+
if: ${{ secrets.PROJECT_TOKEN != '' }}
|
|
75
141
|
uses: actions/github-script@v7
|
|
76
142
|
with:
|
|
77
143
|
github-token: ${{ secrets.PROJECT_TOKEN }}
|
|
@@ -115,6 +181,7 @@ jobs:
|
|
|
115
181
|
runs-on: ubuntu-latest
|
|
116
182
|
steps:
|
|
117
183
|
- name: Move issue to Production
|
|
184
|
+
if: ${{ secrets.PROJECT_TOKEN != '' }}
|
|
118
185
|
uses: actions/github-script@v7
|
|
119
186
|
with:
|
|
120
187
|
github-token: ${{ secrets.PROJECT_TOKEN }}
|
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,15 +5,79 @@ 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
|
+
steps:
|
|
29
|
+
- name: Detect Marker and Move Issue
|
|
30
|
+
if: ${{ secrets.PROJECT_TOKEN != '' }}
|
|
31
|
+
uses: actions/github-script@v7
|
|
32
|
+
with:
|
|
33
|
+
github-token: ${{ secrets.PROJECT_TOKEN }}
|
|
34
|
+
script: |
|
|
35
|
+
const body = context.payload.comment.body;
|
|
36
|
+
let targetStatusId = null;
|
|
37
|
+
let stageName = null;
|
|
38
|
+
|
|
39
|
+
if (body.includes('<!-- PDLC:stage:exploration -->')) {
|
|
40
|
+
targetStatusId = process.env.STATUS_EXPLORATION;
|
|
41
|
+
stageName = 'Exploration';
|
|
42
|
+
} else if (body.includes('<!-- PDLC:stage:brainstorming -->')) {
|
|
43
|
+
targetStatusId = process.env.STATUS_BRAINSTORMING;
|
|
44
|
+
stageName = 'Brainstorming';
|
|
45
|
+
} else if (body.includes('<!-- PDLC:stage:detailing -->')) {
|
|
46
|
+
targetStatusId = process.env.STATUS_DETAILING;
|
|
47
|
+
stageName = 'Detailing';
|
|
48
|
+
} else if (body.includes('<!-- PDLC:stage:approval -->')) {
|
|
49
|
+
targetStatusId = process.env.STATUS_APPROVAL;
|
|
50
|
+
stageName = 'Approval';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!targetStatusId) {
|
|
54
|
+
console.log('No upstream PDLC marker found. Skipping.');
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const { issue: { number, node_id } } = context.payload;
|
|
59
|
+
|
|
60
|
+
const moveItem = async (nodeId, statusId) => {
|
|
61
|
+
const { addProjectV2ItemById: { item } } = await github.graphql(`
|
|
62
|
+
mutation($p: ID!, $c: ID!) {
|
|
63
|
+
addProjectV2ItemById(input: {projectId: $p, contentId: $c}) { item { id } }
|
|
64
|
+
}`, { p: process.env.PROJECT_ID, c: nodeId });
|
|
65
|
+
|
|
66
|
+
await github.graphql(`
|
|
67
|
+
mutation($p: ID!, $i: ID!, $f: ID!, $v: ProjectV2FieldValue!) {
|
|
68
|
+
updateProjectV2ItemFieldValue(input: {projectId: $p, itemId: $i, fieldId: $f, value: $v}) {
|
|
69
|
+
projectV2Item { id }
|
|
70
|
+
}
|
|
71
|
+
}`, {
|
|
72
|
+
p: process.env.PROJECT_ID, i: item.id, f: process.env.STATUS_FIELD_ID,
|
|
73
|
+
v: { singleSelectOptionId: statusId }
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
await moveItem(node_id, targetStatusId);
|
|
78
|
+
console.log(`Issue #${number} moved to ${stageName}`);
|
|
79
|
+
|
|
80
|
+
|
|
17
81
|
# PR Opened → Move linked issue to Code Review
|
|
18
82
|
move-card-on-pr-open:
|
|
19
83
|
name: Open PR → Code Review
|
|
@@ -21,6 +85,7 @@ jobs:
|
|
|
21
85
|
runs-on: ubuntu-latest
|
|
22
86
|
steps:
|
|
23
87
|
- name: Move linked issue to Code Review
|
|
88
|
+
if: ${{ secrets.PROJECT_TOKEN != '' }}
|
|
24
89
|
uses: actions/github-script@v7
|
|
25
90
|
with:
|
|
26
91
|
github-token: ${{ secrets.PROJECT_TOKEN }}
|
|
@@ -72,6 +137,7 @@ jobs:
|
|
|
72
137
|
runs-on: ubuntu-latest
|
|
73
138
|
steps:
|
|
74
139
|
- name: Move issue to Pull Request
|
|
140
|
+
if: ${{ secrets.PROJECT_TOKEN != '' }}
|
|
75
141
|
uses: actions/github-script@v7
|
|
76
142
|
with:
|
|
77
143
|
github-token: ${{ secrets.PROJECT_TOKEN }}
|
|
@@ -115,6 +181,7 @@ jobs:
|
|
|
115
181
|
runs-on: ubuntu-latest
|
|
116
182
|
steps:
|
|
117
183
|
- name: Move issue to Production
|
|
184
|
+
if: ${{ secrets.PROJECT_TOKEN != '' }}
|
|
118
185
|
uses: actions/github-script@v7
|
|
119
186
|
with:
|
|
120
187
|
github-token: ${{ secrets.PROJECT_TOKEN }}
|
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.
|