Skip to content

Commit d5b41c9

Browse files
chore(skills): pushy descriptions + extract pull-request monitor loop
Apply skill-creator audit findings (descriptions were too passive — the harness needs concrete triggers to route reliably): - verify, create-module, pull-request, naming, update-stack: reframe frontmatter descriptions with explicit trigger phrases ("when the user asks to ship this", "when creating a new module", etc.). - pull-request: extract §6 monitor loop body to references/monitor-loop.md; SKILL.md keeps a 7-step inline summary. Loads the heavy procedure only when the loop actually runs.
1 parent a484b95 commit d5b41c9

6 files changed

Lines changed: 182 additions & 104 deletions

File tree

.claude/skills/create-module/SKILL.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
name: create-module
3-
description: Create a new feature module by duplicating the canonical `tasks` module template. Use when adding a new module to the application, scaffolding a new domain area from scratch, or generating the boilerplate for a new feature.
3+
description: >
4+
Use this whenever the user asks to "create a module", "scaffold a feature",
5+
"add a domain", "new module called X", or starts work on a brand-new
6+
vertical (controller + service + repo + model + routes + tests). Duplicates
7+
the canonical `modules/tasks` template, applies kebab/Pascal/camel renames,
8+
and registers config-driven enums. Module stays self-contained — never
9+
modify shared `lib/` or `config/` to bolt on module logic.
410
---
511

612
# Create Module Skill

.claude/skills/naming/SKILL.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
name: naming
3-
description: Check or apply file and folder naming conventions for this Node project. Use when creating new files or folders, renaming existing ones, auditing a module for naming consistency, or any time the correct name/path for a file is unclear.
3+
description: >
4+
Use this whenever a new file/folder is created or renamed in this Node
5+
project, when reviewing a module for consistency, or when the right path
6+
for a file is unclear. Also triggers on "what should I name this?", "is
7+
this file named correctly?", "audit module naming". Enforces kebab-case
8+
folders, `{module}[.{entity}].{type}.js` files, multi-entity rules, and
9+
the layer order Routes → Controllers → Services → Repositories → Models.
410
---
511

612
# Naming Skill

.claude/skills/pull-request/SKILL.md

Lines changed: 27 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
---
22
name: pull-request
3-
description: Full PR lifecycle — branch, commit, issue, draft PR, CI, ready, autonomous monitor loop (fix comments, resolve threads, iterate until CI green and zero unresolved threads).
3+
description: >
4+
Use this whenever the user asks to "open a PR", "ship this", "create the
5+
pull request", "make a PR", or once a feature/fix is verified and ready to
6+
push. Full lifecycle: branch → commit (commitizen) → issue → draft PR → CI
7+
→ ready → autonomous monitor loop (fix comments, resolve threads, iterate
8+
until CI green + zero unresolved threads). `--perfect` adds a CodeRabbit
9+
convergence loop on top. Never works on `main`/`master`, never uses
10+
`--no-verify`.
411
---
512

613
# Pull Request Skill
@@ -108,112 +115,32 @@ gh pr ready <number>
108115
109116
## 6. Monitor loop (autonomous)
110117
111-
Set these variables once before running any loop command:
118+
After `gh pr ready`, run an autonomous polling loop until either CI is green
119+
with zero unresolved threads for 3 consecutive passes (~9 min) or the safety
120+
limit (10 iterations) trips.
112121
113122
```bash
114123
OWNER=$(gh repo view --json owner -q .owner.login)
115124
REPO=$(gh repo view --json name -q .name)
116125
PR=<number>
117126
```
118127
119-
After `gh pr ready`, enter an autonomous polling loop. Do not wait for the user — drive the loop yourself until the stop condition is met.
120-
121-
### Loop procedure
122-
123-
```text
124-
consecutive_zero = 0
125-
126-
REPEAT:
127-
1. Wait for CI → sleep 30 then gh pr checks $PR --watch
128-
2. If CI fails → fix, /verify, commit, push, consecutive_zero=0, GOTO 1
129-
2b. Check mergeable status → STATUS=$(gh pr view $PR --json mergeable --jq .mergeable)
130-
if STATUS == "UNKNOWN" → sleep 10, retry up to 3 times
131-
if STATUS == "CONFLICTING" → report to user and STOP
132-
3. Grace period → sleep 180 + adaptive check (see 6b)
133-
4. Re-check pending review checks → gh pr checks $PR — if any still pending, GOTO 3
134-
5. Read all feedback → unresolved threads only (see 6b)
135-
6. If actionable comments → fix all, /verify, commit, push, reply, resolve, consecutive_zero=0, GOTO 1
136-
7. If non-actionable unresolved → reply all explaining why, resolve all, consecutive_zero=0, GOTO 5
137-
8. If zero unresolved threads → consecutive_zero++
138-
if consecutive_zero >= 3 (~9 min) → check branch protection (see 6f), then STOP ✓
139-
else GOTO 3
140-
```
141-
142-
### 6a. Wait for CI
143-
144-
After any push, wait 30s then watch:
145-
146-
```bash
147-
sleep 30
148-
gh pr checks "$PR" --watch
149-
```
150-
151-
If `no checks reported`, retry up to 5 times (30s apart). If still no checks after 5 retries, report to user and stop.
152-
153-
**If any check fails** → fix, `/verify`, commit, push, restart loop. Do not read review feedback until CI passes.
154-
155-
### 6b. Read all feedback — unresolved threads only
156-
157-
Grace period: `sleep 180`. If 0 bot comments after 3 min, wait 2 more min.
158-
159-
Read **only unresolved threads** (resolved = ignored). Use `references/monitoring.md` as source of truth.
160-
161-
```bash
162-
# Optional context only (do not drive action from these):
163-
# gh pr view $PR --json reviews,comments
164-
# gh api repos/$OWNER/$REPO/pulls/$PR/comments --paginate | jq 'map({id, user: .user.login, body})'
165-
# gh api repos/$OWNER/$REPO/issues/$PR/comments --paginate | jq 'map({id, user: .user.login, body})'
166-
# Action source of truth: unresolved threads query in references/monitoring.md
167-
```
168-
169-
**Actionable** (must fix): change requests, bug reports, missing tests, security issues, code suggestions.
170-
171-
**Informational** (reply + resolve, no code change): approvals, coverage reports, style preferences without change request, false positives. PR-level comments (codecov, approvals) cannot be resolved via thread API — don't count as unresolved.
172-
173-
### 6b-bis. Classify stack-level vs downstream comments (downstream projects only)
174-
175-
Skip when running directly on the stack repo. Requires `devkit-node` remote (set up by `/update-stack`) — if missing, stop and report.
176-
177-
For each actionable comment, check if the file exists unmodified in upstream:
178-
179-
```bash
180-
STACK_REPO=$(git remote get-url devkit-node 2>/dev/null | sed 's|.*github.com[:/]||;s|\.git$||')
181-
STACK_DEFAULT_BRANCH=$(git remote show devkit-node 2>/dev/null | sed -n '/HEAD branch/s/.*: //p')
182-
git fetch devkit-node "$STACK_DEFAULT_BRANCH" --quiet 2>/dev/null
183-
# STACK if exists in upstream AND no local diff; else DOWNSTREAM
184-
git cat-file -e "devkit-node/$STACK_DEFAULT_BRANCH:<file-path>" 2>/dev/null && \
185-
git diff --quiet "devkit-node/$STACK_DEFAULT_BRANCH" -- <file-path> 2>/dev/null
186-
```
187-
188-
- **Stack-level** → create issue on stack repo with review comment details, reply with issue link, resolve thread. If `gh issue create` fails, fix locally instead.
189-
- **Downstream** → fix locally (section 6c).
190-
191-
### 6c. Fix all actionable comments from this pass
192-
193-
Fix all actionable comments in one batch: `/verify` → commit → push → reply with SHA → resolve threads via GraphQL (see `references/monitoring.md`). One commit per pass.
194-
195-
### 6d. Coverage gaps
196-
197-
Add missing tests — **never lower thresholds**. Include in the same commit batch.
198-
199-
### 6e. After pushing fixes
200-
201-
Wait 30s before watching CI (regular or force-push). Loop back to 6a. Never post `@copilot review` — it invokes the coding agent, not the reviewer.
202-
203-
### 6f. Stop condition
204-
205-
CI green **and** 3 consecutive passes (~9 min of grace periods) with zero unresolved threads. Mergeable status is also checked after every CI pass (step 2b) — conflicts cause an early stop. Final branch protection check:
206-
207-
```bash
208-
gh pr view "$PR" --json reviewDecision,mergeable | jq '{reviewDecision, mergeable}'
209-
```
210-
211-
- `APPROVED` + `MERGEABLE`**STOP ✓**
212-
- `REVIEW_REQUIRED` → report to user, stop
213-
- `CHANGES_REQUESTED` → report to user, stop
214-
- `BLOCKED` → report details to user
215-
216-
**Safety limit:** 10 iterations max — report to user if still unresolved.
128+
Per pass:
129+
1. Wait CI → fix + /verify + commit + push if red, else continue
130+
2. Check mergeable — `CONFLICTING` stops, `UNKNOWN` retries
131+
3. Grace `sleep 180` + adaptive recheck of pending review checks
132+
4. Read **only unresolved threads** (see `references/monitoring.md`)
133+
5. Actionable → batch-fix in one commit, /verify, push, reply with SHA,
134+
resolve via GraphQL. Never resolve silently — reply is audit trail.
135+
6. Non-actionable → reply explaining why, resolve, continue
136+
7. Zero unresolved 3 passes in a row + CI green + branch protection
137+
`APPROVED`+`MERGEABLE` → STOP ✓
138+
139+
Downstream projects: classify stack-level vs downstream comments via the
140+
`devkit-node` remote and open issues upstream for stack-level findings.
141+
142+
**Full procedure (commands, classification rules, stop condition matrix):**
143+
see `references/monitor-loop.md`. Load when running the loop.
217144
218145
## 7. Perfect mode (`--perfect`)
219146
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Monitor loop — full procedure
2+
3+
Full body of the autonomous monitor loop referenced from §6 of `SKILL.md`.
4+
Load only when actively running the loop on a PR.
5+
6+
## Setup
7+
8+
```bash
9+
OWNER=$(gh repo view --json owner -q .owner.login)
10+
REPO=$(gh repo view --json name -q .name)
11+
PR=<number>
12+
```
13+
14+
After `gh pr ready`, run this loop yourself — do not wait for the user.
15+
16+
## Loop procedure
17+
18+
```text
19+
consecutive_zero = 0
20+
21+
REPEAT:
22+
1. Wait for CI → sleep 30 then gh pr checks $PR --watch
23+
2. If CI fails → fix, /verify, commit, push, consecutive_zero=0, GOTO 1
24+
2b. Check mergeable status → STATUS=$(gh pr view $PR --json mergeable --jq .mergeable)
25+
if STATUS == "UNKNOWN" → sleep 10, retry up to 3 times
26+
if STATUS == "CONFLICTING" → report to user and STOP
27+
3. Grace period → sleep 180 + adaptive check (see 6b)
28+
4. Re-check pending review checks → gh pr checks $PR — if any still pending, GOTO 3
29+
5. Read all feedback → unresolved threads only (see 6b)
30+
6. If actionable comments → fix all, /verify, commit, push, reply, resolve, consecutive_zero=0, GOTO 1
31+
7. If non-actionable unresolved → reply all explaining why, resolve all, consecutive_zero=0, GOTO 5
32+
8. If zero unresolved threads → consecutive_zero++
33+
if consecutive_zero >= 3 (~9 min) → check branch protection (see 6f), then STOP ✓
34+
else GOTO 3
35+
```
36+
37+
## 6a. Wait for CI
38+
39+
After any push, wait 30s then watch:
40+
41+
```bash
42+
sleep 30
43+
gh pr checks "$PR" --watch
44+
```
45+
46+
If `no checks reported`, retry up to 5 times (30s apart). If still no checks
47+
after 5 retries, report to user and stop.
48+
49+
If any check fails → fix, `/verify`, commit, push, restart loop. Do not read
50+
review feedback until CI passes.
51+
52+
## 6b. Read all feedback — unresolved threads only
53+
54+
Grace period: `sleep 180`. If 0 bot comments after 3 min, wait 2 more min.
55+
56+
Read **only unresolved threads** (resolved = ignored). Use `monitoring.md` as
57+
source of truth.
58+
59+
```bash
60+
# Optional context only (do not drive action from these):
61+
# gh pr view $PR --json reviews,comments
62+
# gh api repos/$OWNER/$REPO/pulls/$PR/comments --paginate | jq 'map({id, user: .user.login, body})'
63+
# gh api repos/$OWNER/$REPO/issues/$PR/comments --paginate | jq 'map({id, user: .user.login, body})'
64+
# Action source of truth: unresolved threads query in monitoring.md
65+
```
66+
67+
**Actionable** (must fix): change requests, bug reports, missing tests,
68+
security issues, code suggestions.
69+
70+
**Informational** (reply + resolve, no code change): approvals, coverage
71+
reports, style preferences without change request, false positives. PR-level
72+
comments (codecov, approvals) cannot be resolved via thread API — don't count
73+
as unresolved.
74+
75+
## 6b-bis. Classify stack-level vs downstream comments (downstream projects only)
76+
77+
Skip when running directly on the stack repo. Requires `devkit-node` remote
78+
(set up by `/update-stack`) — if missing, stop and report.
79+
80+
For each actionable comment, check if the file exists unmodified in upstream:
81+
82+
```bash
83+
STACK_REPO=$(git remote get-url devkit-node 2>/dev/null | sed 's|.*github.com[:/]||;s|\.git$||')
84+
STACK_DEFAULT_BRANCH=$(git remote show devkit-node 2>/dev/null | sed -n '/HEAD branch/s/.*: //p')
85+
git fetch devkit-node "$STACK_DEFAULT_BRANCH" --quiet 2>/dev/null
86+
# STACK if exists in upstream AND no local diff; else DOWNSTREAM
87+
git cat-file -e "devkit-node/$STACK_DEFAULT_BRANCH:<file-path>" 2>/dev/null && \
88+
git diff --quiet "devkit-node/$STACK_DEFAULT_BRANCH" -- <file-path> 2>/dev/null
89+
```
90+
91+
- **Stack-level** → create issue on stack repo with review comment details,
92+
reply with issue link, resolve thread. If `gh issue create` fails, fix
93+
locally instead.
94+
- **Downstream** → fix locally (section 6c).
95+
96+
## 6c. Fix all actionable comments from this pass
97+
98+
Fix all actionable comments in one batch: `/verify` → commit → push → reply
99+
with SHA → resolve threads via GraphQL (see `monitoring.md`). One commit per
100+
pass. You MUST reply to every thread before resolving it — never resolve a
101+
thread silently. The reply serves as audit trail.
102+
103+
## 6d. Coverage gaps
104+
105+
Add missing tests — never lower thresholds. Include in the same commit batch.
106+
107+
## 6e. After pushing fixes
108+
109+
Wait 30s before watching CI (regular or force-push). Loop back to 6a. Never
110+
post `@copilot review` — it invokes the coding agent, not the reviewer.
111+
112+
## 6f. Stop condition
113+
114+
CI green AND 3 consecutive passes (~9 min of grace periods) with zero
115+
unresolved threads. Mergeable status is also checked after every CI pass
116+
(step 2b) — conflicts cause an early stop. Final branch protection check:
117+
118+
```bash
119+
gh pr view "$PR" --json reviewDecision,mergeable | jq '{reviewDecision, mergeable}'
120+
```
121+
122+
- `APPROVED` + `MERGEABLE` → STOP ✓
123+
- `REVIEW_REQUIRED` → report to user, stop
124+
- `CHANGES_REQUESTED` → report to user, stop
125+
- `BLOCKED` → report details to user
126+
127+
Safety limit: 10 iterations max — report to user if still unresolved.

.claude/skills/update-stack/SKILL.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
name: update-stack
3-
description: Merge the latest changes from the Devkit Node stack repository into a downstream project. Use when pulling stack updates, syncing with upstream via `git merge devkit-node/master`, or resolving merge conflicts from stack updates.
3+
description: >
4+
Use this whenever a downstream Node project needs to absorb upstream Devkit
5+
Node changes — triggers on "update stack", "sync with devkit", "merge
6+
upstream", "pull stack updates", "resolve stack conflicts". Two-phase: ISO
7+
merge (stack modules + lib stay byte-identical to upstream) then project
8+
alignment (apply MIGRATIONS.md, diff project modules vs `tasks` reference,
9+
/verify). Stack-code failures get an issue on `pierreb-devkit/Node`.
410
---
511

612
# Update Stack Skill

.claude/skills/verify/SKILL.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
name: verify
3-
description: Run quality loop (audit + lint + tests) to verify code quality, correctness, and security. Use after making changes and before committing.
3+
description: >
4+
Run this after every code change in this Node project, before committing,
5+
before opening a PR, or whenever the user says "verify", "check", "lint",
6+
"run tests", "audit". Diff audit (architecture, security, naming, error
7+
handling) → lint → tests + coverage gate. Coverage drops → add tests, never
8+
lower thresholds. Triggers on "is this ready to commit?", "any issues?",
9+
"tests passing?".
410
---
511

612
# Verify Skill

0 commit comments

Comments
 (0)