@akjamie/agentic-sdlc 1.1.0 → 1.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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: asdlc-impl-review
3
- description: "Independent AI Implementation Review (Stage 6.5): evaluate an Impl PR for spec conformance, code quality, test fidelity, and production readiness before human lead approval. Accepts a GitHub PR URL or local CHANGE_ID."
3
+ description: "Independent AI Implementation Review (Stage 6.5): evaluate an Impl PR for spec conformance, code quality, test fidelity, and production readiness before human lead approval. Incorporates Anthropic code review principles (anti-thrashing convergence, 3-round cap, repo-level REVIEW.md contracts, introduced-vs-preexisting defect attribution, and risk tiering). Accepts a GitHub PR URL or local CHANGE_ID."
4
4
  aliases:
5
5
  - impl-review
6
6
  - code-review-asdlc
@@ -13,6 +13,16 @@ It posts its findings as a **markdown PR comment** via the GitHub API so the hum
13
13
 
14
14
  It applies the **Player ≠ Referee** principle: the reviewing agent MUST NOT be the agent that authored the implementation.
15
15
 
16
+ ### Core Philosophy: Protecting Human Time & Attention
17
+
18
+ Drawing from Anthropic's engineering practices for scaling AI code reviews, this reviewer enforces:
19
+ 1. **Convergence Protocol**: Review loops must converge, not thrash. Capped at **3 rounds** max; re-reviews inspect **incremental diffs only**.
20
+ 2. **Defect Attribution**: Clearly separates defects introduced by this PR (`[Blocker: Introduced]`) from pre-existing legacy issues (`[Tech Debt: Pre-existing]`). Pre-existing flaws **never block** the PR.
21
+ 3. **Repository Contract (`REVIEW.md`)**: Respects repository-defined domain rules, failure modes, and ignore paths from the trusted base branch over generic AI opinions.
22
+ 4. **Risk-Based Tiering**: Scrutiny scales with the change's risk profile (Tier 1 Docs/Style, Tier 2 Standard, Tier 3 Critical/Auth/Billing). Highest-risk file sets the PR tier.
23
+ 5. **Class-of-Bug Grouping**: Defect patterns are grouped into singular findings rather than fragmented into line-by-line spam.
24
+ 6. **Structural & Actionable Findings**: Every finding provides explicit Location, Defect, Impact, and Action Required for instant clarity to both AI agents and human leads.
25
+
16
26
  > [!IMPORTANT]
17
27
  > **Scope**: Reviews *implementation conformance and code quality* — spec adherence, test rigor, architecture, and production safety.
18
28
  > Requires `asdlc verify <CHANGE_ID>` to have passed (12 gates) before this review is meaningful.
@@ -53,24 +63,50 @@ stage('Implementation AI Review') {
53
63
 
54
64
  ## Workflow Sequence
55
65
 
56
- ### Step 1: Acquire PR Context
66
+ ### Step 1: Acquire PR Context & Discover Repo Contract
57
67
 
58
- Run the following commands to collect everything needed for review:
68
+ Run the following commands to collect PR metadata, history, and repo review contracts:
59
69
 
60
70
  ```bash
61
- # List changed files and metadata
62
- gh pr view $PR_NUMBER --repo $REPO --json title,body,baseRefName,headRefName,files
63
-
64
- # Read the full implementation diff
65
- gh pr diff $PR_NUMBER --repo $REPO
71
+ # 1. Fetch PR metadata and previous review comments
72
+ gh pr view $PR_NUMBER --repo $REPO --json title,body,baseRefName,headRefName,headRefOid,comments,files
73
+
74
+ # 2. Check for repository-level REVIEW.md contract from trusted base branch
75
+ # Checked in order: .asdlc/REVIEW.md -> openspec/REVIEW.md -> REVIEW.md
76
+ # IMPORTANT: Always read from origin/<baseRefName>, NEVER from PR HEAD,
77
+ # to prevent self-review bypasses (e.g., PR injecting path exclusions or rewriting failure definitions).
78
+ git show origin/<baseRefName>:.asdlc/REVIEW.md 2>/dev/null || \
79
+ git show origin/<baseRefName>:openspec/REVIEW.md 2>/dev/null || \
80
+ git show origin/<baseRefName>:REVIEW.md 2>/dev/null || true
66
81
  ```
67
82
 
68
- Extract from the PR body or branch:
69
- - `CHANGE_ID` from the `**Change ID**:` field or branch name
70
- - `specSha` from `.openspec.yaml` (read from the base branch or PR file list)
71
-
72
- Then read the approved spec to use as ground truth:
73
-
83
+ Extract from the PR body, comments, and repo contract:
84
+ - `CHANGE_ID` from the `**Change ID**:` field or branch name (`asdlc/impl/<CHANGE_ID>`)
85
+ - `specSha` from `.openspec.yaml` (read from base branch or PR files)
86
+ - `headRefOid`: Current commit SHA under review
87
+ - `reviewRound`: Count previous `## 🤖 AI Implementation Review` comments on this PR:
88
+ - If 0 previous comments → **Round 1 (Initial Review)**
89
+ - If 1 previous comment → **Round 2 (Re-review)**
90
+ - If 2 previous comments → **Round 3 (Final Automated Round)**
91
+ - If 3+ previous comments → **ESCALATED TO HUMAN** (Anti-thrashing limit reached: do NOT post another review comment; set CI status to failure pointing to previous escalation).
92
+ - `lastReviewedSha`: Extracted from the `> **Commit SHA**:` line of the most recent AI review comment.
93
+
94
+ #### Repository Review Contract (`REVIEW.md`)
95
+ If a `REVIEW.md` exists on the base branch, parse and enforce its declared specifications:
96
+ - **What failure looks like**: Domain-specific definitions of defect (e.g., "for billing: currency precision loss; for router: unhandled 404 fallback").
97
+ - **Path Exclusions / Ignores**: Exclude auto-generated files, lockfiles, or fixture dumps from review scrutiny.
98
+ - **Non-Negotiable Invariants**: Explicit architectural rules that supersede generic style preferences.
99
+
100
+ #### Risk-Based Tiering
101
+ Classify the PR into one of three risk tiers based on files changed (**highest-risk file sets the PR tier**):
102
+ - **Tier 1 (Low Risk)**: Documentation, comments, copy, purely additive test fixtures, styling/CSS.
103
+ *Protocol*: Single-pass lightweight check for factual accuracy, typos, and broken links. Skip the AC Conformance Matrix unless specific ACs were defined in the spec.
104
+ - **Tier 2 (Standard Risk)**: Standard application features, domain services, UI state, API endpoints.
105
+ *Protocol*: Full 5-dimension review, AC Conformance Matrix, test fidelity check.
106
+ - **Tier 3 (High Risk)**: Auth/security, payment/billing, cryptography, DB migrations, core CI/governance engine, or **any PR modifying `REVIEW.md` or governance files**.
107
+ *Protocol*: Rigorous scrutiny, failure-mode analysis, strict zero-tolerance for untested edge cases, mandatory human lead sign-off. Flag governance modification explicitly in the review body.
108
+
109
+ #### Read Approved Spec Ground Truth
74
110
  ```bash
75
111
  # Read the approved spec from the base branch
76
112
  git show origin/<baseRefName>:openspec/changes/<CHANGE_ID>/specs/<capability>/spec.md
@@ -86,21 +122,70 @@ asdlc test <CHANGE_ID> --json
86
122
 
87
123
  ---
88
124
 
89
- ### Step 2: Apply the Five Review Dimensions
125
+ ### Step 2: Determine Diff Scope & Anti-Thrashing Protocol
126
+
127
+ To prevent infinite review-author thrashing and fatigue:
128
+
129
+ #### A. Diff-Only Re-Review (Rounds 2 & 3)
130
+ - **Round 1**: Inspect the full PR diff:
131
+ ```bash
132
+ gh pr diff $PR_NUMBER --repo $REPO
133
+ ```
134
+ - **Round 2+**: Inspect **ONLY** the incremental diff since the last reviewed commit:
135
+ ```bash
136
+ # Ensure lastReviewedSha is available in shallow CI clones
137
+ git cat-file -e $lastReviewedSha^{commit} 2>/dev/null || \
138
+ git fetch origin $lastReviewedSha --depth=1 2>/dev/null || \
139
+ git fetch origin $baseRefName --depth=50 2>/dev/null || true
140
+
141
+ # Check for force-push / history rewrite:
142
+ # If lastReviewedSha is not an ancestor of headRefOid, reset to fresh Round 1 full diff
143
+ if ! git merge-base --is-ancestor $lastReviewedSha $headRefOid 2>/dev/null; then
144
+ echo "Force-push or rebase detected: commit history was rewritten. Resetting to full-diff review."
145
+ gh pr diff $PR_NUMBER --repo $REPO
146
+ else
147
+ git diff $lastReviewedSha...$headRefOid
148
+ fi
149
+ ```
150
+ *Never re-review unchanged baseline code or lines previously deemed acceptable.*
151
+
152
+ #### B. Thread Resolution & Accounting
153
+ On re-reviews (Rounds 2 & 3), audit each previously reported Blocker and Major finding using stable IDs (`R1-#1`, `R1-#2`, `R2-#1`):
154
+ - **✅ Resolved**: Explicitly verified as fixed in the incremental diff.
155
+ - **⚠️ Disputed / Justified**: Author provided clear architectural justification or documented trade-off in PR comments.
156
+ - **❌ Unresolved**: Finding remains unaddressed without justification.
157
+
158
+ #### C. Class-of-Bug Grouping
159
+ Do not post 10 separate line comments for the same recurring pattern (e.g., missing timeout on HTTP requests or unhandled nulls).
160
+ Roll them up into a single finding citing all affected locations:
161
+ > *"Class of Bug: Missing timeoutMs on outbound fetch calls in 4 handlers (`api/users.ts:42`, `api/billing.ts:88`, ...)"*
162
+
163
+ #### D. No-Repeat Suppression
164
+ Do not re-surface previously posted findings unless the author explicitly claimed to fix them in the current commit and failed.
165
+
166
+ #### E. 3-Round Convergence Cap
167
+ If Round 3 completes with unresolved blockers:
168
+ - Set verdict to `⚠️ ESCALATED_TO_HUMAN`.
169
+ - Do not trigger further automated loops.
170
+ - Provide a concise summary of the impasse for the human lead.
90
171
 
91
- Evaluate the full diff against all five dimensions. Mark each `PASS`, `CONCERN`, or `FAIL`.
172
+ ---
173
+
174
+ ### Step 3: Apply the Five Review Dimensions
175
+
176
+ Evaluate the diff against all five dimensions, informed by `REVIEW.md` and spec ground truth. Mark each `PASS`, `CONCERN`, or `FAIL`.
92
177
 
93
178
  #### D1 — Spec Conformance (AC-by-AC)
94
- - **Acceptance Test Gate**: Did `asdlc test <CHANGE_ID>` pass with exit code 0? If any mapped test failed or is missing, mark as **🔴 Blocker**.
179
+ - **Acceptance Test Gate**: Did `asdlc test <CHANGE_ID>` pass with exit code 0? If any mapped test failed or is missing, mark as **🔴 Blocker: Introduced**.
95
180
  - For every `ACn:` in `specs/**/*.md`:
96
181
  - Does the implementation satisfy the exact acceptance criterion as written?
97
182
  - Is the behavior exercised in the mapped `(test: <path>)` test?
98
183
  - Are there any requirements in the spec with **no implementation coverage**?
99
184
  - Are there any implemented behaviors with **no corresponding AC** (scope creep)?
100
-
101
- Flag scope creep as Major: it bypasses the governance gate and introduces untested surface area.
185
+ - Flag scope creep as Major: it bypasses the governance gate and introduces untested surface area.
102
186
 
103
187
  #### D2 — Code Quality & Architecture
188
+ - **REVIEW.md Compliance**: Adheres to all repository-declared architectural invariants.
104
189
  - **Deep modules**: Does each new module expose a simple interface hiding a complex interior? Flag shallow wrappers that leak implementation detail.
105
190
  - **Single Responsibility**: Does each function / class do one thing? Flag functions mixing IO and business logic in the same body.
106
191
  - **Error propagation**: Are errors surfaced explicitly (typed error objects or Result types), not swallowed silently?
@@ -112,7 +197,7 @@ Flag scope creep as Major: it bypasses the governance gate and introduces untest
112
197
  - Are mocks **minimal and scoped**? A mock replacing an entire subsystem and always returning a happy-path fixture is a vacuous test.
113
198
  - Does each test exercise the **failure path** as well as the happy path?
114
199
  - Does `tasks.md` contain real test runner output for every `[x]` task (not just "✅ done")?
115
- - Are edge cases from the spec (e.g. rainy-day ranking, high-temp advisory, upstream-API-unavailable fallback) each exercised by a distinct test case?
200
+ - Are edge cases from the spec each exercised by a distinct test case?
116
201
 
117
202
  #### D4 — Production Readiness & Performance
118
203
  - **NFRs met**: If the spec declares a latency SLA, is there a test or benchmark that fails when the SLA is violated?
@@ -128,31 +213,20 @@ Flag scope creep as Major: it bypasses the governance gate and introduces untest
128
213
 
129
214
  ---
130
215
 
131
- ### Step 3: Build the AC Conformance Matrix
216
+ ### Step 4: Formulate Structural Findings with Defect Attribution
132
217
 
133
- For each `ACn:` in the approved spec, produce one row:
218
+ Every finding must follow a structured schema with explicit defect attribution so that findings are unambiguously actionable for both AI agents and human engineers:
134
219
 
135
- | AC | Spec Assertion | Implemented In | Test File | Status |
136
- | :--- | :--- | :--- | :--- | :--- |
137
- | AC1 | <assertion text> | src/<module>.ts | test/<feature>.test.ts | ✅ PASS / ❌ MISSING |
138
-
139
- Mark `❌ MISSING` for any AC whose implementation or test cannot be located in the diff.
140
-
141
- ---
142
-
143
- ### Step 4: Formulate Findings
144
-
145
- Classify each finding:
146
-
147
- - **🔴 Blocker** — AC not implemented, test always passes regardless of code, hard-coded secret, resource leak, spec-forbidden behavior present. Blocks merge.
148
- - **🟡 Major** — Scope creep (code not covered by any AC), vacuous mock, missing timeout on upstream HTTP call, PII in logs.
149
- - **🟢 Advisory** — Naming clarity, minor refactor opportunity, optional performance improvement.
220
+ - **🔴 [Blocker: Introduced]** — Broken AC, test cheating/vacuous mock, regression, hardcoded secret, or resource leak **introduced by this PR**. **Blocks merge.**
221
+ - **🟡 [Major: Introduced]** — Material defect introduced by this PR (scope creep, missing error handling, unhandled edge case). Requires resolution or author justification.
222
+ - **⚪ [Tech Debt: Pre-existing]** — Existing legacy codebase flaw or code smell observed in touched files but **not introduced by this PR**. **DOES NOT block merge.** Documented separately for backlog tracking.
223
+ - **🟢 [Advisory]** — Non-blocking suggestions for readability, naming clarity, or optional polish.
150
224
 
151
225
  ---
152
226
 
153
227
  ### Step 5: Post PR Comment
154
228
 
155
- Compose the review as markdown and post it as a PR comment using the GitHub API:
229
+ Compose the review markdown and post it as a PR comment using the GitHub API:
156
230
 
157
231
  ```bash
158
232
  gh pr comment $PR_NUMBER --repo $REPO --body "$(cat <<'EOF'
@@ -167,8 +241,11 @@ Format the comment body strictly as:
167
241
  ## 🤖 AI Implementation Review — `<CHANGE_ID>`
168
242
 
169
243
  > **Reviewer**: AI Independent Implementation Reviewer (`asdlc-impl-review`)
244
+ > **Commit SHA**: `<headRefOid>`
170
245
  > **Base spec SHA**: `<specSha>`
171
- > **Verdict**: ✅ APPROVE | 🔴 REQUEST_CHANGES
246
+ > **Risk Tier**: Tier 1 (Low) | Tier 2 (Standard) | Tier 3 (High)
247
+ > **Review Round**: Round 1 of 3 | Round 2 of 3 | Round 3 of 3 (Final)
248
+ > **Verdict**: ✅ APPROVE | 🔴 REQUEST_CHANGES | ⚠️ ESCALATED_TO_HUMAN
172
249
 
173
250
  ### Dimension Scores
174
251
 
@@ -181,21 +258,49 @@ Format the comment body strictly as:
181
258
  | D5 Security & Secret Hygiene | ✅ / ⚠️ / ❌ | <one-line summary> |
182
259
 
183
260
  ### AC Conformance Matrix
261
+ <!-- For Tier 1 changes with no spec ACs, replace table with: "*Tier 1 change — AC Conformance Matrix omitted.*" -->
184
262
 
185
263
  | AC | Spec Assertion | Implemented In | Test File | Status |
186
264
  | :--- | :--- | :--- | :--- | :--- |
187
265
  | AC1 | <assertion text> | src/<module>.ts | test/<feature>.test.ts | ✅ PASS |
188
266
 
189
- ### 🔴 Blocking Findings
190
- <!-- Omit section if none -->
191
- 1. **[Blocker]** `<file>:<line-range>` — AC<n>: <description of gap or violation>
192
-
193
- ### 🟡 Major Findings
267
+ <!-- On Rounds 2 and 3, include Thread Resolution Accounting -->
268
+ ### 🔄 Re-Review Accounting (Round <round>)
269
+ | Finding ID | Previous Finding Summary | Status | Resolution / Author Rationale |
270
+ | :---: | :--- | :---: | :--- |
271
+ | `R1-#1` | Missing 5000ms timeout in fetch | ✅ Resolved | Added `AbortSignal.timeout(5000)` in `src/http.ts:24` |
272
+ | `R1-#2` | Scope creep helper `parseAmount` | ⚠️ Justified | Author rationale: Shared utility required for currency normalization |
273
+
274
+ ### 🔴 Blocking Findings (Introduced)
275
+ <!-- Omit section if none. Use structural format for AI/Human clarity -->
276
+ - **ID**: `R<round>-#<num>`
277
+ - **Category**: `Spec Conformance` | `Code Quality` | `Test Fidelity` | `Production Readiness` | `Security`
278
+ - **Rule / AC**: `<ACn or REVIEW.md invariant or Dimension D1-D5>`
279
+ - **Location**: `<file>:<line-range>`
280
+ - **Defect**: `<concise statement of what is broken>`
281
+ - **Impact**: `<why this breaks correctness, security, or production>`
282
+ - **Action Required**: `<exact condition or code fix required to resolve>`
283
+
284
+ ### 🟡 Major Findings (Introduced)
194
285
  <!-- Omit section if none -->
195
- 1. **[Major]** <description>
286
+ - **ID**: `R<round>-#<num>`
287
+ - **Category**: `<category>`
288
+ - **Location**: `<file>:<line-range>`
289
+ - **Defect**: `<description>`
290
+ - **Impact**: `<impact>`
291
+ - **Action Required**: `<action required>`
292
+
293
+ ### ⚪ Tech Debt: Pre-existing Codebase Observations
294
+ <!-- Non-blocking; omit section if none -->
295
+ - **ID**: `DEBT-#<num>`
296
+ - **Location**: `<file>:<line-range>`
297
+ - **Defect**: `<description of pre-existing legacy issue, untouched by PR>`
298
+ - **Attribution**: Pre-existing code untouched by this PR diff.
299
+ - **Status**: Non-blocking. Logged for tech debt backlog.
196
300
 
197
301
  ### 🟢 Advisory Notes
198
302
  <!-- Omit section if none -->
303
+ 1. **[Advisory]** <description>
199
304
 
200
305
  ---
201
306
  *Human lead: review the findings above, then merge when satisfied. After merge, run `asdlc archive <CHANGE_ID>`.*
@@ -205,15 +310,16 @@ Format the comment body strictly as:
205
310
 
206
311
  ### Step 6: Set CI Status
207
312
 
208
- After posting the comment:
313
+ After posting the comment, set the commit status check:
209
314
 
210
315
  - **If APPROVE**: set CI check status to `success` (green). The PR is unblocked for lead approval and merge.
211
316
  - **If REQUEST_CHANGES**: set CI check status to `failure` (red). The PR is blocked until blockers are resolved.
317
+ - **If ESCALATED_TO_HUMAN**: set CI check status to `failure` (red) with description noting human arbitration is required.
212
318
 
213
319
  ```bash
214
320
  gh api repos/$REPO/statuses/$SHA \
215
321
  -f state="success|failure" \
216
322
  -f context="asdlc/impl-ai-review" \
217
- -f description="AI Impl Review: APPROVE|REQUEST_CHANGES" \
323
+ -f description="AI Impl Review: APPROVE | REQUEST_CHANGES | ESCALATED_TO_HUMAN" \
218
324
  -f target_url="$PR_URL"
219
325
  ```
@@ -15,19 +15,22 @@ This skill executes **Stage 2 (New)** of the Agentic SDLC. It transforms a natur
15
15
  When the user invokes `/asdlc:new "<requirement>"`:
16
16
 
17
17
  ```powershell
18
- asdlc new "<requirement>"
18
+ asdlc new "<requirement>" [--batch-grill] [--no-grill]
19
19
  ```
20
20
 
21
21
  The CLI:
22
22
  1. Derives a clean canonical slug (e.g. `jwt-authentication-payment-api` or content-hashed `change-<id>`).
23
23
  2. Creates `openspec/changes/<SLUG>/`.
24
24
  3. Runs Graphify queries using the extracted requirement terms to discover real codebase AST nodes and call chains.
25
- 4. Generates `explore.md` and seeds `clarifications.md`.
25
+ 4. Generates `explore.md` and seeds `clarifications.md` configured for the chosen grilling mode:
26
+ - **Default (conversational)**: Runs high-signal, recommendation-led `grill-me` (1 material decision at a time).
27
+ - **`--batch-grill`**: Evaluates the entire design tree and presents the active frontier in structured batches.
28
+ - **`--no-grill`**: Bypasses interactive grilling for self-evident fixes and pre-aligned tasks.
26
29
  5. **Technical Design Auto-Detection**: If the requirement touches UI/UX, frontend, APIs, services, databases, or architecture (or if `--design` is passed), seeds `design.md` with enterprise-grade technical design scaffolding.
27
30
 
28
31
  > [!IMPORTANT]
29
32
  > **NO PAUSE / CONTINUOUS EXECUTION**: Do NOT stop after `asdlc new` to ask the author "Should I start grilling?".
30
- > You MUST proceed immediately to Step 2 and Step 3 (**batch-grill-me** interview) in the same turn!
33
+ > You MUST proceed immediately to Step 2 and Step 3 in the same turn!
31
34
  > Only after `clarifications.md` has all questions settled may you draft `proposal.md`, `design.md`, and `specs/**`.
32
35
 
33
36
  ### Step 2: Ground Yourself in Codebase & External Context (Strict Order)
@@ -52,18 +55,25 @@ Follow this strict discovery sequence:
52
55
  Tag any unverified external API assumptions, endpoints, schemas, or rate limits in `clarifications.md` and `design.md` with `[UNVERIFIED: <reason>]`.
53
56
  These will be explicitly surfaced on the PR review by CI/D7 for mandatory human confirmation before merge.
54
57
 
55
- ### Step 3: Run the `batch-grill-me` Interview
56
- Before authoring any spec markdown, run the **`batch-grill-me`** protocol:
57
- 1. Evaluate the open decision frontier for this feature:
58
- - **Functional Seams**: Primary user flows, alternate paths, domain states, and interface contracts.
59
- - **Security & Operational NFRs (When Applicable)**: For changes introducing public endpoints, handling sensitive data, or integrating external rate-limited APIs, evaluate auth boundaries and operational limits. (Do not invent synthetic numbers for simple changes where SLAs do not apply).
60
- 2. Present all architectural forks and boundary questions in **one structured batch**:
61
- - Number each question (`Q1`, `Q2`, `Q3`...).
62
- - Provide concrete options (A / B / C).
63
- - Supply a fact-backed **Recommended Default** grounded in codebase evidence.
64
- 3. Invite the author to batch-approve (`"Approve all recommendations"`) or provide selective overrides.
58
+ ### Step 3: Run the Grilling Phase (Mode-Aware)
59
+ Before authoring any spec markdown, settle all open architectural questions into `clarifications.md`:
60
+
61
+ 1. **If Mode is `interactive` (Default `grill-me`)**:
62
+ - Run conversational, recommendation-led grilling (skill: `grilling`).
63
+ - **Anti-Fatigue Guardrails**:
64
+ - *Codebase-first*: Never ask questions that can be answered by reading the code or AST.
65
+ - *Material forks only*: Ask only about real architectural trade-offs (e.g. storage options, error policies, backwards compatibility); decide implementation micro-details yourself.
66
+ - *Lead with recommendations*: Frame each question with a concrete recommended default and rationale (e.g. "Recommend Option A because... Agree, or prefer Option B?").
67
+ - *Early Exit*: Immediately halt questioning if the author says "proceed", "use defaults", or when open forks hit zero.
68
+
69
+ 2. **If Mode is `batch` (`--batch-grill` passed)**:
70
+ - Run `batch-grill-me` protocol: evaluate the active decision frontier and present all independent trade-offs in one structured numbered batch with recommended options.
71
+ - Author approves all or adjusts specific choices.
72
+
73
+ 3. **If Mode is `none` (`--no-grill` passed)**:
74
+ - Ground assumptions in AST / codebase facts, record context-inferred decisions in `clarifications.md`, leave open questions as none, and proceed directly to Step 4.
75
+
65
76
  4. Record every agreed answer in `openspec/changes/<SLUG>/clarifications.md` under `## Settled decisions`.
66
- 5. If overrides unblock child questions, run Batch Round 2; otherwise close the interview.
67
77
 
68
78
  ### Step 4: Author Approved Intent Artifacts
69
79
  Once `## Open questions` in `clarifications.md` is empty, author the change documents:
@@ -74,16 +84,24 @@ Once `## Open questions` in `clarifications.md` is empty, author the change docu
74
84
 
75
85
  2. **`design.md` (Technical Design Document - Mandatory for UI & Complex Systems)**:
76
86
  - When a change touches UI/frontend, external APIs, databases, or services, author `design.md` to define **HOW**:
77
- - **Architecture & Component Interaction**: Mermaid sequence/flowchart diagrams.
78
- - **Interface Contracts & Schemas**: TypeScript interfaces or JSON schemas for all requests/responses.
79
- - **External API Integration**: Endpoints, authentication, rate limits, client-level in-memory/TTL caching (never recreate clients per request), error taxonomy & fallbacks.
80
- - **Security & Operational NFRs (Optional / When Applicable)**: Document authentication, boundary validation, secret lifecycles, and performance budgets/quotas when the architecture demands them (omit or mark N/A for changes without external dependencies or strict SLAs).
81
- - **UI/UX Design Reference & Tokens (Zero tolerance for unstyled HTML)**:
82
- - **Required Ground Truth Reference**: Link to human-provided mockup, Figma URL, brand styleguide, or existing CSS tokens. Do NOT invent palettes or fonts in isolation.
83
- - Concrete design tokens derived from reference (colors, typography, spacing/radii).
84
- - Component hierarchy (Hero/Search, Filters, Data Cards, Detail views).
85
- - Responsive breakpoints: Mobile (<= 640px), Tablet (<= 1024px), Desktop (> 1024px).
86
- - Mandatory interaction states: Default, Hover/Focus, Loading Skeleton, Empty State with prompt, Error Banner with retry.
87
+ - **Architecture & Component Interaction**:
88
+ - Embed clean, self-contained Mermaid flowcharts, sequence diagrams, or state transitions directly in `design.md`. Keep diagrams focused on component boundaries, responsibilities, and request/response lifecycles.
89
+ - **Interface Contracts & Schemas (`api-design` recommended)**:
90
+ - Follow the `api-design` skill for RESTful conventions (plural nouns, kebab-case, hierarchical nesting, zero verbs in URLs).
91
+ - Specify exact TypeScript interfaces or JSON schemas for request/response payloads.
92
+ - Standardize on structured error envelopes (Stripe-style `{ error: { code, message, details } }` or RFC 7807 problem details `{ type, title, status, detail, instance }`). Never return `200 OK` with an error body.
93
+ - Define explicit pagination strategy: cursor-based (`cursor`, `limit`, `has_more`) or offset-based.
94
+ - **External API Integration & Resilience**:
95
+ - Endpoints, authentication, rate limits (`X-RateLimit-*`), client-level in-memory/TTL caching (never recreate clients per request).
96
+ - Mutating endpoints must specify `Idempotency-Key` header with deduplication cache.
97
+ - Error taxonomy, fallback degradation, and exponential backoff retry with jitter.
98
+ - **Security & Operational NFRs (Optional / When Applicable)**: Document authentication, boundary validation, secret lifecycles, and performance budgets/quotas when the architecture demands them.
99
+ - **UI/UX Design Specifications (`frontend-design` & Vercel Guidelines)**:
100
+ - **Anti-AI Slop Mandate**: Zero tolerance for cliché glowing cards, arbitrary gradient text highlights, uniform pill buttons, or monotonous card grids.
101
+ - **Design Direction & Subject Grounding**: Real subject matter, vernacular, and domain tone (e.g., high-density analytical dashboard vs consumer app). Link to mockup, brand tokens, or benchmark URL.
102
+ - **Concrete Palettes & Typography**: 4–6 deliberate Hex color tokens (`--color-primary`, `--color-background`, `--color-surface`, etc.) and distinct font pairings (heading + body) with WCAG AA/AAA contrast.
103
+ - **Hero Treatment & Layout**: Opening hero element, responsive breakpoints (Mobile <= 640px, Tablet 641-1024px, Desktop > 1024px).
104
+ - **5 Mandatory States**: Default, Hover/Focus (150-200ms ease, `:focus-visible`), Loading Skeleton (never blank screens), Empty State with prompt, Error Banner with retry.
87
105
 
88
106
  3. **`specs/<capability>/spec.md`**:
89
107
  - `## Purpose`: Clear capability statement (50+ chars).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: batch-grill-me
3
- description: "A relentless design-tree interview that asks every frontier question at once, round by round, with recommended defaults and non-blocking fact discovery."
3
+ description: "A relentless design-tree interview that evaluates the active frontier and asks questions in structured batches with recommended defaults and non-blocking fact discovery. Invoked via asdlc new --batch-grill or /batch-grill-me."
4
4
  aliases:
5
5
  - grilling
6
6
  - grill-me
@@ -8,7 +8,7 @@ aliases:
8
8
 
9
9
  # Batch Grilling — Relentless Design-Tree Interview (`batch-grill-me`)
10
10
 
11
- This skill drives the **Grilling phase** (Stage 2) of the Agentic SDLC. It operates between `asdlc new "<requirement>"` and spec authoring (`proposal.md` / `specs/**`). It can also be invoked standalone via `/batch-grill-me` or `/grill-me` for any architectural design.
11
+ This skill drives the **Grilling phase** (Stage 2) of the Agentic SDLC when invoked in batch mode (via `asdlc new "<requirement>" --batch-grill` or `/batch-grill-me`). For interactive 1-by-1 dialogue, use `/grill-me`.
12
12
 
13
13
  Interview the author relentlessly until you reach a shared understanding. Map the requirement as a **design tree**: every decision branches into the decisions that hang off it.
14
14
 
@@ -24,11 +24,16 @@ Interview the author relentlessly until you reach a shared understanding. Map th
24
24
 
25
25
  - Never ask child or grandchild questions whose parent decision is still open in the current round.
26
26
  - If Question C1 asks *"Should we support internationalization (en + zh)?"*, you **CANNOT** ask *"Which fields should be translated?"* or *"What format should the message catalog use?"* in the same round! Those depend on C1 being answered.
27
- - Asking child questions prematurely forces you to guess at parent answers, which leads directly to pseudo-questions and fake choices. Hold them for Round 2.
27
+ - Asking child questions prematurely forces you to guess at parent answers, which leads directly to pseudo-questions and fake choices. Hold them for later rounds.
28
28
 
29
29
  3. **Dynamic Tree Reshaping.**
30
30
  Each round the author answers reshapes the tree — settled decisions push the frontier outward and unblock questions that depended on them. Recompute the frontier and ask the next round.
31
31
 
32
+ 4. **Early Exit / Fast-Forward Protocol**:
33
+ If the author says:
34
+ - *"Approve all recommendations"* / *"Proceed with defaults"* / *"LGTM"*
35
+ The agent must **immediately halt questioning**, resolve any remaining open decisions using its stated engineering recommendations, write them into `clarifications.md`, and proceed directly to drafting `proposal.md` and `specs/**`.
36
+
32
37
  ---
33
38
 
34
39
  ## 2. Fact-Finding vs. Human Decisions
@@ -113,7 +118,7 @@ Active Frontier: <N> independent decisions ready for resolution.
113
118
 
114
119
  ---
115
120
 
116
- 💡 *To proceed efficiently, reply **"Approve all recommendations"**, or specify adjustments (e.g. `Q1: B, Q2: accept`).*
121
+ 💡 *To proceed efficiently, reply **"Approve all recommendations"**, specify adjustments (e.g. `Q1: B, Q2: accept`), or type "proceed with defaults".*
117
122
  ```
118
123
 
119
124
  ---
@@ -123,8 +128,7 @@ Active Frontier: <N> independent decisions ready for resolution.
123
128
  The session is done when the **frontier is empty**:
124
129
  1. Every branch of the design tree has been visited.
125
130
  2. Nothing is left silently assumed.
126
- 3. **Do not act until the author confirms you have reached a shared understanding** (e.g. by approving recommendations or answering all questions).
127
- 4. Record all settled decisions in `openspec/changes/<SLUG>/clarifications.md`:
131
+ 3. Record all settled decisions in `openspec/changes/<SLUG>/clarifications.md`:
128
132
  ```markdown
129
133
  ## Settled decisions
130
134
 
@@ -133,4 +137,4 @@ The session is done when the **frontier is empty**:
133
137
  - **<Decision 2 Title>**: <Chosen Option>
134
138
  - *Rationale*: <Why this was chosen>
135
139
  ```
136
- 5. Only after `clarifications.md` is settled may you transition to authoring `proposal.md` and `specs/**`.
140
+ 4. Only after `clarifications.md` is settled may you transition to authoring `proposal.md` and `specs/**`.
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: frontend-design
3
+ description: "Guidance for distinctive, production-grade visual UI/UX design. Based on Anthropic official frontend-design and Vercel Web Interface Guidelines: anti-AI slop, bespoke color palettes, typography, hero moments, and complete interactive states."
4
+ license: MIT
5
+ metadata:
6
+ origin: "anthropics/skills (frontend-design) + vercel-labs/agent-skills (web-design-guidelines)"
7
+ ---
8
+
9
+ # Frontend Design & UI/UX Guidelines
10
+
11
+ This skill guides coding agents to create production-grade, intentional, and visually distinct user interfaces. It actively prevents generic, predictable "AI slop" and template defaults.
12
+
13
+ ---
14
+
15
+ ## 1. Core Mindset: Lead Design Studio
16
+
17
+ Approach every UI task as the lead design technologist at an award-winning design studio. The client has rejected cliché, cookie-cutter templates and is paying for a distinct, memorable visual identity.
18
+
19
+ ### 🚫 Anti-AI Slop Mandate
20
+ Steer clear of default AI aesthetic tropes:
21
+ - **NO Generic Glowing Cards**: Stop putting purple/blue glowing borders and arbitrary gradient backdrops on every single card.
22
+ - **NO Arbitrary Headline Highlights**: Do not randomly wrap a single word in a headline with a bright neon gradient unless specifically requested.
23
+ - **NO Uniform Pill Buttons Everywhere**: Use button shapes and sizes that match visual hierarchy (primary, secondary, subtle ghost, destructive).
24
+ - **NO Monotonous Card Grids**: Vary the layout rhythm. Combine asymmetric columns, split panels, dense tables, and focused detail views.
25
+ - **NO Default Font Fallbacks**: Avoid defaulting immediately to system sans-serif or unconfigured Inter without intentional typographic pairing.
26
+
27
+ ---
28
+
29
+ ## 2. Grounding in the Subject Matter & Audience
30
+
31
+ Distinctive visual choices originate from the subject's industry, domain vernacular, and target audience:
32
+ - **Financial/DevOps Analytics**: High-density typography, tabular numbers (`font-variant-numeric: tabular-nums`), restrained palettes, clear status badges, minimal ornamentation.
33
+ - **Consumer / Lifestyle**: Generous whitespace, expressive typography, rich photography, tactile micro-interactions.
34
+ - **Creative / Dev Tools**: Sharp geometric accents, mono font pairings, dark/terminal aesthetic with high contrast and fast keyboard navigation.
35
+
36
+ ---
37
+
38
+ ## 3. Deliberate Palettes & Typography
39
+
40
+ ### 🎨 Color Palette (4–6 Concrete Hex Codes)
41
+ Define a dedicated CSS variable palette in `design.md`:
42
+ 1. `--color-background`: Deep canvas base (e.g., `#0b0f19` or `#fafafa`).
43
+ 2. `--color-surface`: Card/panel elevated surface (e.g., `#111827` or `#ffffff`).
44
+ 3. `--color-border`: Subtle boundary definition (e.g., `#1f2937` or `#e5e7eb`).
45
+ 4. `--color-primary`: Signature brand hue (deliberate, e.g., `#4f46e5` or `#0ea5e9`).
46
+ 5. `--color-accent`: High-contrast secondary accent for badges and active states.
47
+ 6. `--color-text-primary` & `--color-text-muted`: Ensure WCAG AA (≥4.5:1) or AAA (≥7:1) contrast against background.
48
+
49
+ ### 🔤 Typography Hierarchy
50
+ - Pair an intentional **Display/Heading** font (e.g., *Outfit*, *Plus Jakarta Sans*, *Syne*, or *Playfair Display*) with a legible **Body** font (*Inter*, *Geist*, *IBM Plex Sans*).
51
+ - Establish a clear type scale:
52
+ - Display / Hero: 32px – 48px, bold, tight letter-spacing (`-0.02em`).
53
+ - Section Headings: 20px – 24px, semibold.
54
+ - Body Text: 14px – 16px, line-height 1.5 – 1.6.
55
+ - Microcopy / Metadata: 12px – 13px, muted contrast.
56
+
57
+ ---
58
+
59
+ ## 4. The Hero Element & Visual Rhythm
60
+
61
+ - Open with the most characteristic artifact of the domain: a live interactive preview, dynamic metrics dashboard, real-time query bar, or focused illustration.
62
+ - Use deliberate spatial composition: asymmetric two-column splits, sticky sidebars, or layered cards that break the grid intentionally.
63
+
64
+ ---
65
+
66
+ ## 5. Five Mandatory Interactive Component States
67
+
68
+ Every UI component in `design.md` and implementation MUST define all 5 states:
69
+ 1. **Default State**: Clean, token-governed visual styling.
70
+ 2. **Hover / Focus State**: Subdued, purposeful transitions (150ms–200ms ease); explicit `:focus-visible` outline for keyboard accessibility.
71
+ 3. **Loading State**: Content-shaped skeleton loaders or micro-spinners — **never a blank screen or raw unformatted layout shift**.
72
+ 4. **Empty State**: Domain-specific icon/illustration, empathetic explanation, and a single obvious call-to-action button.
73
+ 5. **Error State**: Non-blocking inline banner or card with an actionable explanation and a retry trigger.
74
+
75
+ ---
76
+
77
+ ## 6. Vercel Web Interface Guidelines Compliance
78
+
79
+ - **Spring & Micro-Motions**: Transitions should feel snappy (150ms–250ms), using cubic-bezier curves (`ease-out` or spring physics); never sluggish.
80
+ - **Accessibility & Contrast**: All interactive elements must support `Tab` navigation, visible focus rings, and screen-reader labels (`aria-label`).
81
+ - **Responsive Breakpoints**:
82
+ - Mobile (`<= 640px`): Single-column, thumb-friendly tap targets (≥ 44px).
83
+ - Tablet (`641px - 1024px`): Adaptive 2-column grid.
84
+ - Desktop (`> 1024px`): Full multi-column dashboard with sticky navigation.