create-agentic-pdlc 2.1.5 → 2.2.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.
- package/.agentic-pdlc/SETUP_PROMPT.md +73 -0
- package/.agentic-pdlc/hooks/pdlc-stage-gate.sh +39 -0
- package/.agentic-pdlc/metrics/.gitkeep +0 -0
- package/.agentic-pdlc/metrics/2026-W19.md +21 -0
- package/.agentic-pdlc/metrics/raw/2026-W19.jsonl +6 -0
- package/.agentic-pdlc/metrics/raw/2026-W20.jsonl +1 -0
- package/.agentic-pdlc/templates/.github/CODEOWNERS +5 -0
- package/.agentic-pdlc/templates/.github/copilot-instructions.md +12 -0
- package/.agentic-pdlc/templates/.github/workflows/add-to-board.yml +38 -0
- package/.agentic-pdlc/templates/.github/workflows/agent-trigger.yml +146 -0
- package/.agentic-pdlc/templates/.github/workflows/agentic-metrics.yml +412 -0
- package/.agentic-pdlc/templates/.github/workflows/auto-approve.yml +16 -0
- package/.agentic-pdlc/templates/.github/workflows/ci.yml +40 -0
- package/.agentic-pdlc/templates/.github/workflows/pdlc-health-check.yml +123 -0
- package/.agentic-pdlc/templates/.github/workflows/pdlc-stage-gate.yml +51 -0
- package/.agentic-pdlc/templates/.github/workflows/project-automation.yml +278 -0
- package/.agentic-pdlc/templates/.github/workflows/protect-workflows.yml +21 -0
- package/.agentic-pdlc/templates/.github/workflows/qa-agent.yml +128 -0
- package/.agentic-pdlc/templates/AGENTS.md +81 -0
- package/.agentic-pdlc/templates/docs/pdlc.md +15 -5
- package/.agentic-setup-prompt.md +73 -0
- package/.agentic-setup.md +73 -0
- package/.claude/settings.json +15 -0
- package/.cursorrules +9 -0
- package/.github/ISSUE_TEMPLATE/pulse-feedback.md +11 -0
- package/.github/workflows/add-to-board.yml +38 -0
- package/.github/workflows/agent-trigger.yml +30 -43
- package/.github/workflows/agentic-metrics.yml +412 -0
- package/.github/workflows/pdlc-health-check.yml +10 -10
- package/.github/workflows/pdlc-stage-gate.yml +51 -0
- package/.github/workflows/project-automation.yml +68 -18
- package/.github/workflows/qa-agent.yml +112 -11
- package/CLAUDE.md +9 -0
- package/README.md +8 -0
- package/SETUP.md +28 -0
- package/adapters/claude-code/skill.md +41 -3
- package/adapters/hooks/pdlc-stage-gate.sh +44 -0
- package/bin/cli.js +28 -5
- package/docs/pdlc.md +15 -5
- package/package.json +1 -1
- package/pr_comments.json +20 -0
- package/templates/.github/workflows/add-to-board.yml +38 -0
- package/templates/.github/workflows/agent-trigger.yml +34 -4
- package/templates/.github/workflows/pdlc-stage-gate.yml +51 -0
- package/templates/.github/workflows/project-automation.yml +78 -54
- package/templates/.github/workflows/qa-agent.yml +14 -13
- package/templates/AGENTS.md +10 -0
- package/templates/docs/pdlc.md +15 -5
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentic-pdlc
|
|
3
|
+
description: Orchestrates the Agentic Product Development Life Cycle (PDLC) upstream stages (Idea -> Spec) and includes an interactive Setup Mode to initialize the framework.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agentic PDLC Orchestrator
|
|
7
|
+
|
|
8
|
+
You are the upstream brainstorm partner and orchestrator for the Agentic PDLC framework. Your role is primarily to define technical specs based on user ideas.
|
|
9
|
+
|
|
10
|
+
## SETUP MODE
|
|
11
|
+
|
|
12
|
+
If the user invokes you in a new project, you must first check if the PDLC artifacts are present in the repository.
|
|
13
|
+
Specifically, check for:
|
|
14
|
+
- `AGENTS.md`
|
|
15
|
+
- `docs/pdlc.md`
|
|
16
|
+
- `.github/CODEOWNERS`
|
|
17
|
+
- `.github/workflows/project-automation.yml`
|
|
18
|
+
- `.github/workflows/agent-trigger.yml`
|
|
19
|
+
- `.github/workflows/pdlc-health-check.yml`
|
|
20
|
+
|
|
21
|
+
If any of these files are missing, you are in **Setup Mode**. Do not proceed with feature requests until setup is complete.
|
|
22
|
+
1. **Language Detection:** Analyze the user's previous prompts and preferred language. Conduct this entire Setup Mode and ask all your interactive questions in that same language.
|
|
23
|
+
2. Acknowledge that the framework is not yet set up.
|
|
24
|
+
3. Interactively ask the user for required values **one group at a time**:
|
|
25
|
+
- **Project basics:** Project Name, Description, Technical Stack (Structure), and GitHub Username (for CODEOWNERS security).
|
|
26
|
+
- **Commands:** Test command, Lint command, Build command.
|
|
27
|
+
- **Invariants:** Critical business rules agents must never violate (e.g. Human-in-the-loop).
|
|
28
|
+
- **Board IDs:** PROJECT_ID, STATUS_FIELD_ID, column option IDs (provide standard PDLC options: Idea, Exploration, Brainstorming, Detail Solution, Approval, Development, Testing, Code Review / PR, Production). Allow user to answer "skip", which means you leave the placeholders intact.
|
|
29
|
+
- **Architecture Violation:** Ask "Does your project use an automated architecture auditing tool (e.g., a CI job that creates issues with an `architecture-violation` label)?". If yes, uncomment the `move-violation-to-board` job inside `project-automation.yml`. If no, ask if they would like help implementing one, reminding them that it significantly improves their agentic development process. If they decline, you can leave the job commented out.
|
|
30
|
+
- **QA Agent (Variant B):** Ask "Do you plan to use an AI QA Agent (e.g. QAWolf or a secondary script) to verify your PRs before Code Review?". If yes, explain you will adopt Variant B: you will change `STATUS_CODE_REVIEW_PR` to `STATUS_TESTING` inside the `move-card-on-pr-open` job in `project-automation.yml` and uncomment the `move-card-on-qa-pass` job. If no, leave the workflow as Variant A (default) and delete the optional `.github/workflows/qa-agent.yml` template.
|
|
31
|
+
- **Implementation agent handle:** e.g., `@google-labs-jules`, or "none".
|
|
32
|
+
3. Generate and write the missing files replacing the `{{SCREAMING_SNAKE_CASE}}` placeholders using the templates logic you know (usually they reside in standard Agentic PDLC templates).
|
|
33
|
+
4. Offer to run the `gh` commands for labels (`spec:approved`, `pr:in-review`, `pr:approved`, `architecture-violation`).
|
|
34
|
+
5. Commit everything with the message: `chore: setup agentic-pdlc framework`.
|
|
35
|
+
6. **IMPORTANT:** Delete this setup prompt file (e.g., `.agentic-setup.md`, `.agentic-setup-prompt.md`, or `.agentic-pdlc/SETUP_PROMPT.md`) from the root or `.agentic-pdlc/` directory to clean up the workspace.
|
|
36
|
+
7. Conclude Setup Mode.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## EXECUTION MODE
|
|
41
|
+
|
|
42
|
+
If `AGENTS.md` and `docs/pdlc.md` are present, you are in **Execution Mode**.
|
|
43
|
+
|
|
44
|
+
### 1. Daily Upstream Loop
|
|
45
|
+
Your job is to move issues from "Idea" to "Detail Solution".
|
|
46
|
+
When asked to work on a feature, you will:
|
|
47
|
+
- Explore the code context.
|
|
48
|
+
- Present architectural approaches (Brainstorming).
|
|
49
|
+
- Stop and wait for the human PM's explicit approval (Gate 1).
|
|
50
|
+
|
|
51
|
+
### 2. Creating the Spec
|
|
52
|
+
Once approved, you will detail the solution directly into the GitHub Issue body. Focus on precise Acceptance Criteria.
|
|
53
|
+
**IMPORTANT:** You must always rewrite the full issue body to include both the user story and the Acceptance Criteria. Do not simply append the ACs to the existing text. Use this format:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
**As** [user],
|
|
57
|
+
**I want** [action],
|
|
58
|
+
**so that** [benefit].
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Acceptance Criteria
|
|
63
|
+
...
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 3. Handoff
|
|
67
|
+
Do not write code for downstream features! Your goal is to refine the Spec, so the human Tech Lead can label the issue `spec:approved`. This label triggers the downstream agent via `agent-trigger.yml`.
|
|
68
|
+
|
|
69
|
+
### 4. Moving the Board (Upstream States)
|
|
70
|
+
As you actively work with the user advancing the feature, you MUST use the GitHub CLI to update internal state labels. This triggers GitHub Actions behind the scenes.
|
|
71
|
+
- Starting context evaluation: Run `gh issue edit <N> --add-label "stage:exploration"`
|
|
72
|
+
- Presenting architecture/approaches: Run `gh issue edit <N> --add-label "stage:brainstorming"`
|
|
73
|
+
- Starting to write the technical spec: Run `gh issue edit <N> --add-label "stage:detailing"`
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# PDLC Stage Gate — blocks gh pr create without stage:approval on linked issue.
|
|
3
|
+
# Bypass: branch prefix hotfix/ skips all checks.
|
|
4
|
+
|
|
5
|
+
INPUT=$(cat)
|
|
6
|
+
COMMAND=$(echo "$INPUT" | node -e "const d=JSON.parse(require('fs').readFileSync(0)); console.log(d.command || '')" 2>/dev/null || echo "")
|
|
7
|
+
|
|
8
|
+
if ! echo "$COMMAND" | grep -q "gh pr create"; then
|
|
9
|
+
exit 0
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
BRANCH=$(git branch --show-current 2>/dev/null || echo "")
|
|
13
|
+
|
|
14
|
+
if echo "$BRANCH" | grep -qE "^hotfix/"; then
|
|
15
|
+
echo "✅ PDLC: Hotfix branch — stage gate bypassed."
|
|
16
|
+
exit 0
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
ISSUE_NUM=$(echo "$BRANCH" | grep -oE '[0-9]+' | head -1)
|
|
20
|
+
|
|
21
|
+
if [ -z "$ISSUE_NUM" ]; then
|
|
22
|
+
echo "❌ PDLC Stage Gate: Cannot determine issue from branch '$BRANCH'."
|
|
23
|
+
echo " Use: feat/<issue-number>-<description> or hotfix/<issue-number>-<description>"
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
LABELS=$(gh issue view "$ISSUE_NUM" --json labels --jq '[.labels[].name] | join(" ")' 2>/dev/null || echo "")
|
|
28
|
+
|
|
29
|
+
if echo "$LABELS" | grep -qw "stage:approval"; then
|
|
30
|
+
echo "✅ PDLC: Issue #$ISSUE_NUM approved — gate passed."
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
STAGE=$(echo "$LABELS" | tr ' ' '\n' | grep "^stage:" | head -1 || echo "none")
|
|
35
|
+
echo "❌ PDLC Stage Gate: Issue #$ISSUE_NUM is not approved."
|
|
36
|
+
echo " Current stage: $STAGE"
|
|
37
|
+
echo " Required: stage:approval label on the issue."
|
|
38
|
+
echo " Emergency bypass: rename branch to hotfix/<issue-number>-<description>."
|
|
39
|
+
exit 1
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Agentic Metrics — 2026-W19
|
|
2
|
+
|
|
3
|
+
> Métricas agentic-specific geradas automaticamente pelo [agentic-pdlc](https://github.com/rafaeltcosta86/agentic-pdlc).
|
|
4
|
+
|
|
5
|
+
## 🔄 Stage Residence Time
|
|
6
|
+
|
|
7
|
+
Tempo médio que issues passaram em cada fase do PDLC esta semana (transições completas).
|
|
8
|
+
|
|
9
|
+
| Stage | Avg | N | vs semana passada |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| **Exploration** | 0d | 1 issue | — |
|
|
12
|
+
| **Brainstorming** | 0d | 1 issue | — |
|
|
13
|
+
| **Detailing** | 0d | 1 issue | — |
|
|
14
|
+
| **Approval** | 0d | 1 issue | — |
|
|
15
|
+
| **Development** | 0.3d | 1 issue | — |
|
|
16
|
+
| **Testing** | 0d | 1 issue | — |
|
|
17
|
+
|
|
18
|
+
> **Insight:** `Development` é o maior gargalo (0.3d avg). Issues acumulam aqui. Considere quebrar specs ou aumentar cadência de revisão nessa fase.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
*Gerado em 2026-05-10 · [Ver histórico](.)*
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{"issueNumber":58,"stage":"stage:exploration","durationDays":0}
|
|
2
|
+
{"issueNumber":58,"stage":"stage:brainstorming","durationDays":0}
|
|
3
|
+
{"issueNumber":58,"stage":"stage:detailing","durationDays":0}
|
|
4
|
+
{"issueNumber":58,"stage":"stage:approval","durationDays":0}
|
|
5
|
+
{"issueNumber":58,"stage":"stage:development","durationDays":0.3}
|
|
6
|
+
{"issueNumber":58,"stage":"stage:testing","durationDays":0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"issueNumber":66,"stage":"stage:exploration","durationDays":0}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Agentic PDLC Instructions for GitHub Copilot Workspace
|
|
2
|
+
|
|
3
|
+
Hello! You are operating within the Agentic PDLC framework.
|
|
4
|
+
|
|
5
|
+
Before addressing the user's prompt or executing any task in this workspace, you MUST:
|
|
6
|
+
|
|
7
|
+
1. Read the `AGENTS.md` file located at the root of this repository. It contains the primary instructions, definitions of done, and absolute invariants you must respect.
|
|
8
|
+
2. Read `docs/pdlc.md` to understand your role in the project lifecycle.
|
|
9
|
+
|
|
10
|
+
Never violate the invariants described in those files. If a user asks you to do something that contradicts `AGENTS.md`, you must refuse and point out the conflict.
|
|
11
|
+
|
|
12
|
+
Focus on delivering the absolute minimum required to satisfy the immediate technical specs. Start!
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Add to Board on Open
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issues:
|
|
5
|
+
types: [opened]
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
PROJECT_ID: "{{PROJECT_ID}}"
|
|
9
|
+
STATUS_FIELD_ID: "{{STATUS_FIELD_ID}}"
|
|
10
|
+
STATUS_IDEA: "{{ID_IDEA}}"
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
add-to-board:
|
|
14
|
+
name: Auto-add new issue to board
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
env:
|
|
17
|
+
PROJECT_PAT: ${{ secrets.PROJECT_PAT }}
|
|
18
|
+
steps:
|
|
19
|
+
- name: Add issue to project board
|
|
20
|
+
if: ${{ env.PROJECT_PAT != '' && env.PROJECT_ID != '{{PROJECT_ID}}' }}
|
|
21
|
+
uses: actions/github-script@v7
|
|
22
|
+
with:
|
|
23
|
+
github-token: ${{ env.PROJECT_PAT }}
|
|
24
|
+
script: |
|
|
25
|
+
const nodeId = context.payload.issue.node_id;
|
|
26
|
+
const number = context.payload.issue.number;
|
|
27
|
+
const { addProjectV2ItemById: { item } } = await github.graphql(`
|
|
28
|
+
mutation($p: ID!, $c: ID!) {
|
|
29
|
+
addProjectV2ItemById(input: {projectId: $p, contentId: $c}) { item { id } }
|
|
30
|
+
}`, { p: process.env.PROJECT_ID, c: nodeId });
|
|
31
|
+
await github.graphql(`
|
|
32
|
+
mutation($p: ID!, $i: ID!, $f: ID!, $v: ProjectV2FieldValue!) {
|
|
33
|
+
updateProjectV2ItemFieldValue(input: {projectId: $p, itemId: $i, fieldId: $f, value: $v}) {
|
|
34
|
+
projectV2Item { id }
|
|
35
|
+
}
|
|
36
|
+
}`, { p: process.env.PROJECT_ID, i: item.id, f: process.env.STATUS_FIELD_ID,
|
|
37
|
+
v: { singleSelectOptionId: process.env.STATUS_IDEA } });
|
|
38
|
+
console.log(`Issue #${number} added to board → Idea`);
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
name: Trigger Implementation Agent
|
|
2
|
+
|
|
3
|
+
# Triggers when spec:approved is added to an issue (Gate 2)
|
|
4
|
+
# or when an architecture-violation issue is modified (Sentinel flow)
|
|
5
|
+
on:
|
|
6
|
+
issues:
|
|
7
|
+
types: [labeled]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
trigger-implementation-agent:
|
|
11
|
+
name: Trigger {{IMPLEMENTATION_AGENT_NAME}} for implementation
|
|
12
|
+
# Runs only when spec:approved is added
|
|
13
|
+
if: github.event.label.name == 'spec:approved'
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
issues: write
|
|
17
|
+
pull-requests: write
|
|
18
|
+
contents: read
|
|
19
|
+
env:
|
|
20
|
+
PROJECT_PAT: ${{ secrets.PROJECT_PAT }}
|
|
21
|
+
PROJECT_ID: "{{PROJECT_ID}}"
|
|
22
|
+
STATUS_FIELD_ID: "{{STATUS_FIELD_ID}}"
|
|
23
|
+
STATUS_DEVELOPMENT: "{{ID_DEVELOPMENT}}"
|
|
24
|
+
steps:
|
|
25
|
+
- name: Update Labels
|
|
26
|
+
uses: actions/github-script@v7
|
|
27
|
+
with:
|
|
28
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
29
|
+
script: |
|
|
30
|
+
const { owner, repo } = context.repo;
|
|
31
|
+
const issue_number = context.payload.issue.number;
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
await github.rest.issues.removeLabel({
|
|
35
|
+
owner,
|
|
36
|
+
repo,
|
|
37
|
+
issue_number,
|
|
38
|
+
name: 'stage:approval'
|
|
39
|
+
});
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.log('Label stage:approval not found or could not be removed');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const agentLabel = '{{IMPLEMENTATION_AGENT_LABEL}}';
|
|
45
|
+
const labelsToAdd = ['stage:development'];
|
|
46
|
+
if (!agentLabel.includes('{{')) labelsToAdd.push(agentLabel, 'agent:working');
|
|
47
|
+
|
|
48
|
+
await github.rest.issues.addLabels({
|
|
49
|
+
owner,
|
|
50
|
+
repo,
|
|
51
|
+
issue_number,
|
|
52
|
+
labels: labelsToAdd
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
- name: Move board card to Development
|
|
56
|
+
if: ${{ env.PROJECT_PAT != '' && env.PROJECT_ID != '{{PROJECT_ID}}' }}
|
|
57
|
+
continue-on-error: true
|
|
58
|
+
uses: actions/github-script@v7
|
|
59
|
+
with:
|
|
60
|
+
github-token: ${{ env.PROJECT_PAT }}
|
|
61
|
+
script: |
|
|
62
|
+
const nodeId = context.payload.issue.node_id;
|
|
63
|
+
const number = context.payload.issue.number;
|
|
64
|
+
const { addProjectV2ItemById: { item } } = await github.graphql(`
|
|
65
|
+
mutation($p: ID!, $c: ID!) {
|
|
66
|
+
addProjectV2ItemById(input: {projectId: $p, contentId: $c}) { item { id } }
|
|
67
|
+
}`, { p: process.env.PROJECT_ID, c: nodeId });
|
|
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
|
+
}`, { p: process.env.PROJECT_ID, i: item.id, f: process.env.STATUS_FIELD_ID,
|
|
74
|
+
v: { singleSelectOptionId: process.env.STATUS_DEVELOPMENT } });
|
|
75
|
+
console.log(`Issue #${number} → Development`);
|
|
76
|
+
|
|
77
|
+
- name: Comment on issue to trigger agent and prevent race conditions
|
|
78
|
+
if: ${{ !contains('{{IMPLEMENTATION_AGENT_LABEL}}', '{{') }}
|
|
79
|
+
uses: actions/github-script@v7
|
|
80
|
+
with:
|
|
81
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
82
|
+
script: |
|
|
83
|
+
const issueNumber = context.payload.issue.number;
|
|
84
|
+
const issueTitle = context.payload.issue.title;
|
|
85
|
+
|
|
86
|
+
const body = [
|
|
87
|
+
`🤖 **Agentic PDLC Orchestrator:** I have dispatched the implementation agent. Please wait for the Pull Request and avoid making concurrent commits on this task to prevent race conditions.`,
|
|
88
|
+
'',
|
|
89
|
+
`{{AGENT_HANDLE}} The spec for this issue has been approved. Please implement it exactly as described in the body above.`,
|
|
90
|
+
'',
|
|
91
|
+
'**Mandatory steps before you begin:**',
|
|
92
|
+
'1. `git fetch origin && git checkout main && git pull` — always start from the current HEAD',
|
|
93
|
+
'2. Read `AGENTS.md` — mandatory rules for agents in this repository',
|
|
94
|
+
'3. Read `docs/pdlc.md` — Definition of Done and invariants reference',
|
|
95
|
+
'',
|
|
96
|
+
'**Rules:**',
|
|
97
|
+
'- Implement strictly what the Acceptance Criteria describes',
|
|
98
|
+
'- Run `{{TEST_COMMAND}}` before opening the Pull Request',
|
|
99
|
+
`- Include \`Closes #${issueNumber}\` in the PR body`,
|
|
100
|
+
'- Create a descriptive branch branching from `main`',
|
|
101
|
+
].join('\n');
|
|
102
|
+
|
|
103
|
+
await github.rest.issues.createComment({
|
|
104
|
+
owner: context.repo.owner,
|
|
105
|
+
repo: context.repo.repo,
|
|
106
|
+
issue_number: issueNumber,
|
|
107
|
+
body,
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
trigger-agent-on-violation:
|
|
111
|
+
name: Trigger {{IMPLEMENTATION_AGENT_NAME}} for architecture violation
|
|
112
|
+
# Runs when architecture-violation is added (Sentinel flow)
|
|
113
|
+
if: github.event.label.name == 'architecture-violation'
|
|
114
|
+
runs-on: ubuntu-latest
|
|
115
|
+
permissions:
|
|
116
|
+
issues: write
|
|
117
|
+
pull-requests: write
|
|
118
|
+
contents: read
|
|
119
|
+
steps:
|
|
120
|
+
- name: Comment on issue to trigger agent
|
|
121
|
+
if: ${{ !contains('{{IMPLEMENTATION_AGENT_LABEL}}', '{{') }}
|
|
122
|
+
uses: actions/github-script@v7
|
|
123
|
+
with:
|
|
124
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
125
|
+
script: |
|
|
126
|
+
const issueNumber = context.payload.issue.number;
|
|
127
|
+
|
|
128
|
+
const body = [
|
|
129
|
+
`{{AGENT_HANDLE}} Please fix the architecture violation described in this issue.`,
|
|
130
|
+
'',
|
|
131
|
+
'**Mandatory steps before you begin:**',
|
|
132
|
+
'1. `git fetch origin && git checkout main && git pull` — always start from the current HEAD',
|
|
133
|
+
'2. Read `AGENTS.md` — mandatory rules for agents in this repository',
|
|
134
|
+
'',
|
|
135
|
+
'**Rules:**',
|
|
136
|
+
'- Fix only what the violation points out — do not refactor unrelated code',
|
|
137
|
+
'- Run `{{TEST_COMMAND}}` before opening the Pull Request',
|
|
138
|
+
`- Include \`Closes #${issueNumber}\` in the PR body`,
|
|
139
|
+
].join('\n');
|
|
140
|
+
|
|
141
|
+
await github.rest.issues.createComment({
|
|
142
|
+
owner: context.repo.owner,
|
|
143
|
+
repo: context.repo.repo,
|
|
144
|
+
issue_number: issueNumber,
|
|
145
|
+
body,
|
|
146
|
+
});
|