@akjamie/agentic-sdlc 1.0.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.
@@ -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.
@@ -1,33 +1,42 @@
1
1
  ---
2
2
  name: grilling
3
- description: "High-efficiency batch design-tree interview (batch-grill-me) for Stage 2 of Agentic SDLC. Asks every frontier question at once round by round with recommended defaults, dispatches non-blocking fact explorations, settles clarifications.md, and stops only when shared understanding is confirmed."
3
+ description: "High-signal design-tree interview for Stage 2 of Agentic SDLC. Supports conversational grill-me (default, 1 decision at a time with anti-fatigue guardrails) and batch-grill-me (invoked via --batch-grill or /batch-grill-me) to settle clarifications.md before spec authoring."
4
4
  aliases:
5
- - batch-grill-me
6
5
  - grill-me
6
+ - batch-grill-me
7
7
  ---
8
8
 
9
- # Batch Grilling — Relentless Design-Tree Interview (`grilling`)
9
+ # Design-Tree Grilling (`grilling` / `grill-me` / `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. It operates between `asdlc new "<requirement>"` and spec authoring (`proposal.md` / `specs/**`).
12
12
 
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.
13
+ It supports two distinct execution styles depending on developer preference and CLI invocation:
14
+ 1. **Conversational `grill-me` (Default)**: Fast, iterative pair-programming dialogue. Presents **1 material decision at a time**, leading with a concrete codebase-grounded recommendation. Halts immediately when open forks hit zero or when the author fast-forwards.
15
+ 2. **`batch-grill-me` (Batch Mode, invoked via `--batch-grill` or `/batch-grill-me`)**: Presents the active decision frontier all at once in structured, numbered batches with trade-offs and recommendations.
14
16
 
15
17
  ---
16
18
 
17
19
  ## 1. Core Protocol: The Decision Tree & The Frontier
18
20
 
19
- 1. **Work the tree in rounds.**
20
- The **frontier** is every decision whose prerequisites are *already settled* — the questions you can ask *now* without guessing at answers you haven't heard yet. Ask the whole frontier in one round: number each question and give your recommended answer. Then wait for the author's answers before the next round.
21
+ 1. **Map the Design Tree**:
22
+ Every requirement branches into architectural decisions:
23
+ - Seams & Scope (data storage, protocols, domain models).
24
+ - Compatibility (breaking change vs deprecation).
25
+ - Failure & Resilience (fallback vs error propagation).
21
26
 
22
- 2. **No Tree-Flattening (CRITICAL RULE).**
23
- > **A question whose answer depends on another question still open in this round belongs to a *later* round, not this one.**
27
+ 2. **Work the Frontier**:
28
+ The **frontier** is every decision whose prerequisites are *already settled* — the questions you can address *now* without guessing at answers to dependent questions.
24
29
 
25
- - Never ask child or grandchild questions whose parent decision is still open in the current round.
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.
30
+ 3. **No Tree-Flattening (CRITICAL RULE)**:
31
+ > **A question whose answer depends on another open question belongs to a *later* round, not this one.**
32
+ Never ask child questions whose parent decision is still unsettled.
28
33
 
29
- 3. **Dynamic Tree Reshaping.**
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.
34
+ 4. **Early Exit / Fast-Forward Protocol**:
35
+ The author is always sovereign. If the author says:
36
+ - *"Proceed with your defaults"*
37
+ - *"LGTM / Looks good"*
38
+ - *"I trust your recommendations"*
39
+ 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/**`.
31
40
 
32
41
  ---
33
42
 
@@ -83,9 +92,26 @@ Before emitting a batch round to the author, verify these 3 conditions:
83
92
 
84
93
  ---
85
94
 
86
- ## 5. Batch Presentation Format
95
+ ## 5. Presentation Formats
96
+
97
+ ### 5.1 Conversational `grill-me` Format (Default)
98
+ Present **1 focused decision at a time** with a concrete recommended default:
99
+
100
+ ```markdown
101
+ ### 🎯 Architectural Decision: <Decision Title>
102
+
103
+ <1-2 sentences explaining the architectural fork and the trade-offs>
104
+
105
+ - **Option A**: <Description of Option A>
106
+ - **Option B**: <Description of Option B>
107
+
108
+ ➡️ **Recommendation**: **Option A** — <Fact-backed rationale grounded in codebase/explore.md>
109
+
110
+ *Reply "Agree" to proceed with Option A, specify an alternative (e.g. "Option B"), or type "proceed with all defaults" to fast-forward.*
111
+ ```
87
112
 
88
- Format each round of the interview strictly as follows:
113
+ ### 5.2 Batch Presentation Format (`--batch-grill` or `/batch-grill-me`)
114
+ When `--batch-grill` is passed, present all independent active frontier decisions in a single structured round:
89
115
 
90
116
  ```markdown
91
117
  ### 🎯 Batch Decision Frontier (Round <N>)
@@ -113,7 +139,7 @@ Active Frontier: <N> independent decisions ready for resolution.
113
139
 
114
140
  ---
115
141
 
116
- 💡 *To proceed efficiently, reply **"Approve all recommendations"**, or specify adjustments (e.g. `Q1: B, Q2: accept`).*
142
+ 💡 *To proceed efficiently, reply **"Approve all recommendations"**, specify adjustments (e.g. `Q1: B, Q2: accept`), or type "proceed with defaults".*
117
143
  ```
118
144
 
119
145
  ---
package/bin/asdlc.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akjamie/agentic-sdlc",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Enterprise Agentic SDLC governance CLI: a 7-stage spec-driven flow on top of OpenSpec + Graphify, enforced by CI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,7 +27,7 @@
27
27
  "README.md"
28
28
  ],
29
29
  "scripts": {
30
- "test": "node --test \"test/*.test.js\"",
30
+ "test": "node --test",
31
31
  "lint": "node --check bin/asdlc.js"
32
32
  },
33
33
  "keywords": [
package/src/cli.js CHANGED
@@ -6,6 +6,7 @@ import { register as registerLint } from './commands/lint.js';
6
6
  import { register as registerPr } from './commands/pr.js';
7
7
  import { register as registerApprove } from './commands/approve.js';
8
8
  import { register as registerApply } from './commands/apply.js';
9
+ import { register as registerTest } from './commands/test.js';
9
10
  import { register as registerVerify } from './commands/verify.js';
10
11
  import { register as registerArchive } from './commands/archive.js';
11
12
  import { register as registerStatus } from './commands/status.js';
@@ -32,6 +33,7 @@ export function buildCli() {
32
33
  registerPr(program); // 3.5 open the Spec PR automatically
33
34
  registerApprove(program); // 4. record approval (after the spec PR merges or in-place)
34
35
  registerApply(program); // 5. start implementing
36
+ registerTest(program); // 5.5 run acceptance tests mapped from change specs (TDD & CI gate)
35
37
  registerVerify(program); // 6. check the implementation
36
38
  registerArchive(program); // 7. finish (sync living specs to openspec/specs/)
37
39
 
@@ -50,6 +52,7 @@ The flow:
50
52
  asdlc pr <ID> <targetBranch> open the Spec PR (pushes branch + auto-creates PR via CLI or API)
51
53
  asdlc approve <ID> record approval (on PR / merge / in-place) + mark READY_FOR_IMPL
52
54
  asdlc apply <ID> guard, then /opsx-apply (task-level TDD loop)
55
+ asdlc test <ID> run acceptance tests mapped from change specs (TDD & CI gate)
53
56
  asdlc verify <ID> check the implementation (artifacts, tasks, tests, AI)
54
57
  asdlc archive <ID> finish: archive change + sync living specs to openspec/specs/
55
58
 
@@ -4,6 +4,7 @@ import { changeDir } from '../lib/paths.js';
4
4
  import { requireRepo, toChangeSlug } from '../lib/cliutil.js';
5
5
  import { runOpenspec } from '../lib/openspec.js';
6
6
  import { refreshAgents } from '../lib/agents.js';
7
+ import { ensureFreshGraph } from '../lib/graphify.js';
7
8
  import { git } from '../lib/git.js';
8
9
  import { fail } from '../lib/errors.js';
9
10
  import { log } from '../lib/log.js';
@@ -88,12 +89,38 @@ export function archiveChange(changeId, opts = {}) {
88
89
 
89
90
  syncReadme(repoRoot, slug, proposalText);
90
91
 
91
- // Constitutional change check: normal spec changes sync to openspec/specs/ and README.
92
- // AGENTS.md is updated ONLY if constitutional governance files were touched.
93
- const shouldUpdateAgents = opts.agents === true || (opts.agents !== false && isConstitutionalChange(repoRoot, opts));
92
+ // Refresh AST knowledge graph if Graphify is available
93
+ if (opts.graph !== false) {
94
+ try {
95
+ const g = ensureFreshGraph(repoRoot);
96
+ if (g.status === 'missing' || g.status === 'stale') {
97
+ log.ok(`rebuilt knowledge graph (graphify ${g.status} -> fresh)`);
98
+ }
99
+ } catch (err) {
100
+ log.warn(`knowledge graph refresh skipped: ${err.message}`);
101
+ }
102
+ }
103
+
104
+ // AGENTS.md update:
105
+ // - If AGENTS.md does not exist, create and initialize it.
106
+ // - If AGENTS.md exists, refresh the system status (knowledge graph god nodes)
107
+ // and routing block so the agentic IDE stays grounded in current architecture.
108
+ // - If constitutional change or explicit --agents, log governance refresh.
109
+ // - If --no-agents was explicitly passed, skip updating AGENTS.md.
110
+ const agentsPath = path.join(repoRoot, 'AGENTS.md');
111
+ const agentsMissing = !exists(agentsPath);
112
+ const constitutional = isConstitutionalChange(repoRoot, opts);
113
+ const shouldUpdateAgents = opts.agents !== false;
114
+
94
115
  if (shouldUpdateAgents) {
95
- refreshAgents(repoRoot, { systemStatus: false });
96
- log.ok(`updated AGENTS.md (constitutional change detected on governance paths)`);
116
+ refreshAgents(repoRoot, { systemStatus: true });
117
+ if (agentsMissing) {
118
+ log.ok('created AGENTS.md (was missing) and initialized system status');
119
+ } else if (constitutional) {
120
+ log.ok('updated AGENTS.md (constitutional change detected on governance paths)');
121
+ } else {
122
+ log.ok('refreshed AGENTS.md system status (knowledge graph hubs)');
123
+ }
97
124
  }
98
125
 
99
126
  log.ok(`archive complete for ${slug}`);
@@ -103,10 +130,11 @@ export function archiveChange(changeId, opts = {}) {
103
130
  export function register(program) {
104
131
  program
105
132
  .command('archive <changeId>')
106
- .description('finish: archive change + sync living specs to openspec/specs/ + update README (and AGENTS.md if constitutional)')
133
+ .description('finish: archive change + sync living specs to openspec/specs/ + update README & AGENTS.md')
107
134
  .option('--repo-root <path>')
108
135
  .option('--agents', 'force refresh AGENTS.md')
109
136
  .option('--no-agents', 'skip updating AGENTS.md')
137
+ .option('--no-graph', 'skip rebuilding knowledge graph')
110
138
  .option('--no-openspec', 'skip the openspec archive step')
111
139
  .action((changeId, opts) => {
112
140
  process.exitCode = archiveChange(changeId, opts);
@@ -56,8 +56,37 @@ export function runLint(changeId, opts = {}) {
56
56
  add('change', 'pass', slug);
57
57
  add('explore.md (stage 1)', exists(path.join(cdir, 'explore.md')) ? 'pass' : 'fail',
58
58
  exists(path.join(cdir, 'explore.md')) ? '' : 'run `asdlc new <ID>` (explore is the first stage)');
59
- add('proposal.md', exists(path.join(cdir, 'proposal.md')) ? 'pass' : 'fail',
60
- exists(path.join(cdir, 'proposal.md')) ? '' : 'proposal.md missing');
59
+ const proposalPath = path.join(cdir, 'proposal.md');
60
+ const proposalText = exists(proposalPath) ? readText(proposalPath) : '';
61
+ add('proposal.md', exists(proposalPath) ? 'pass' : 'fail',
62
+ exists(proposalPath) ? '' : 'proposal.md missing');
63
+
64
+ const specFiles = exists(path.join(cdir, 'specs'))
65
+ ? walkFiles(path.join(cdir, 'specs')).filter((f) => f.endsWith('spec.md'))
66
+ : [];
67
+ add('spec delta', specFiles.length > 0 ? 'pass' : 'fail', specFiles.length > 0 ? `${specFiles.length} file(s)` : 'no spec delta present');
68
+
69
+ const combinedSpecText = specFiles.map((f) => readText(path.join(cdir, 'specs', f))).join('\n');
70
+ const fullIntentText = `${proposalText}\n${combinedSpecText}`;
71
+
72
+ // Deterministic detection for UI and 3rd-party/external API scope
73
+ const UI_OR_EXTERNAL_API = /\b(ui|ux|frontend|web|screen|page|view|component|css|style|html|layout|dialog|modal|button|table|card|form|itinerary|3rd-party|third-party|external api|vendor api|geocode|amap|weather api|maps api|payment gateway|stripe|oauth|webhook)\b/i;
74
+ const requiresDesign = UI_OR_EXTERNAL_API.test(fullIntentText);
75
+
76
+ const designPath = path.join(cdir, 'design.md');
77
+ if (!exists(designPath)) {
78
+ if (requiresDesign) {
79
+ add('design.md', 'fail', 'design.md is mandatory for UI and external API changes (run `asdlc new --design` or author design.md)');
80
+ }
81
+ } else {
82
+ const text = readText(designPath);
83
+ const nonComment = text.replace(/<!--[\s\S]*?-->/g, '').trim();
84
+ if (nonComment.length < 150) {
85
+ add('design.md', 'fail', 'design.md contains only unedited template placeholders; fill in technical design');
86
+ } else {
87
+ add('design.md', 'pass', 'technical design documented');
88
+ }
89
+ }
61
90
 
62
91
  const reviewPath = path.join(cdir, 'review.md');
63
92
  if (!exists(reviewPath)) {
@@ -71,11 +100,6 @@ export function runLint(changeId, opts = {}) {
71
100
  add('blocking findings', hasBlockingFindings(text) ? 'fail' : 'pass', hasBlockingFindings(text) ? 'blocking findings present' : '');
72
101
  }
73
102
 
74
- const specFiles = exists(path.join(cdir, 'specs'))
75
- ? walkFiles(path.join(cdir, 'specs')).filter((f) => f.endsWith('spec.md'))
76
- : [];
77
- add('spec delta', specFiles.length > 0 ? 'pass' : 'fail', specFiles.length > 0 ? `${specFiles.length} file(s)` : 'no spec delta present');
78
-
79
103
  const { rules } = readLintConfig(repoRoot);
80
104
  const findings = [];
81
105
  for (const file of specFiles) {
@@ -1,6 +1,6 @@
1
1
  import path from 'node:path';
2
- import { exists, readText, writeText } from '../lib/fs.js';
3
- import { changeDir } from '../lib/paths.js';
2
+ import { exists, readText, writeText, ensureDir } from '../lib/fs.js';
3
+ import { changeDir, schemaAssetDir } from '../lib/paths.js';
4
4
  import { requireRepo, deriveChangeSlug, extractRequirementTerms } from '../lib/cliutil.js';
5
5
  import { ensureGraphify, ensureFreshGraph, graphifyQuery } from '../lib/graphify.js';
6
6
  import { runOpenspec } from '../lib/openspec.js';
@@ -18,16 +18,25 @@ export function newChange(requirement, opts = {}) {
18
18
  const cdir = changeDir(repoRoot, slug);
19
19
  if (exists(cdir)) fail(`change '${slug}' already exists`, { hint: 'use a new requirement/id, or iterate the existing change' });
20
20
 
21
- const res = runOpenspec(['new', 'change', slug], repoRoot);
22
- if (res.missing) fail('OpenSpec CLI not found', { hint: 'run `asdlc init`' });
23
- if (res.status !== 0) fail(`openspec new change failed: ${(res.stderr || res.stdout || '').slice(0, 300)}`);
24
- log.ok(`created change '${slug}' (derived from: "${requirement}")`);
21
+ if (opts.openspec !== false) {
22
+ const res = runOpenspec(['new', 'change', slug], repoRoot);
23
+ if (res.missing) fail('OpenSpec CLI not found', { hint: 'run `asdlc init`' });
24
+ if (res.status !== 0) fail(`openspec new change failed: ${(res.stderr || res.stdout || '').slice(0, 300)}`);
25
+ log.ok(`created change '${slug}' (derived from: "${requirement}")`);
26
+ } else {
27
+ ensureDir(cdir);
28
+ writeText(path.join(cdir, '.openspec.yaml'), 'schema: agentic-repo-change\n');
29
+ log.ok(`created change '${slug}' (derived from: "${requirement}")`);
30
+ }
25
31
 
26
- // Record requirement in change metadata (.openspec.yaml)
32
+ // Determine grill mode: 'none' (--no-grill), 'batch' (--batch-grill), or 'interactive' (default grill-me)
33
+ const grillMode = opts.grill === false ? 'none' : (opts.batchGrill ? 'batch' : 'interactive');
34
+
35
+ // Record requirement and grill mode in change metadata (.openspec.yaml)
27
36
  const metaPath = path.join(cdir, '.openspec.yaml');
28
37
  if (exists(metaPath)) {
29
38
  const existing = readText(metaPath).trimEnd();
30
- writeText(metaPath, `${existing}\nrequirement: ${JSON.stringify(requirement)}\n`);
39
+ writeText(metaPath, `${existing}\nrequirement: ${JSON.stringify(requirement)}\ngrillMode: "${grillMode}"\n`);
31
40
  }
32
41
 
33
42
  const g = ensureGraphify();
@@ -91,18 +100,20 @@ _(unavailable - graph query error)_
91
100
  }
92
101
  }
93
102
 
94
- // Seed the grilling interview (skill: grilling / batch-grill-me). The agent runs it
95
- // with the author in batch mode to resolve the decision frontier in 1-2 turns.
103
+ // Seed the grilling interview / clarification record.
96
104
  const clar = path.join(cdir, 'clarifications.md');
97
105
  if (!exists(clar)) {
98
- writeText(clar, `# Clarifications: ${slug}
106
+ let clarContent = '';
107
+ if (grillMode === 'batch') {
108
+ clarContent = `# Clarifications: ${slug}
99
109
 
100
110
  > Requirement: "${requirement}"
111
+ > Mode: batch-grill
101
112
  > Before writing proposal.md / specs, the agent MUST run a **batch-grill-me** interview
102
- > with the author (skill: \`grilling\`) and record the settled decisions here.
103
- > Use batch-grill-me for maximum efficiency: evaluate the design tree, present the ENTIRE
104
- > frontier in one structured batch (numbered Q1..Qn with concrete recommended defaults),
105
- > allowing the author to approve or selectively adjust decisions in 1-2 rounds.
113
+ > with the author (skill: \`batch-grill-me\`) and record the settled decisions here.
114
+ > Evaluate the design tree, present the ENTIRE active frontier in structured batches
115
+ > (numbered Q1..Qn with concrete recommended defaults and trade-offs), allowing the author
116
+ > to approve or adjust decisions.
106
117
  > Facts are the agent's job to look up; decisions are the author's to make.
107
118
 
108
119
  ## Requirement
@@ -113,19 +124,94 @@ _(unavailable - graph query error)_
113
124
 
114
125
  ## Open questions
115
126
  <!-- must be empty before the spec is written -->
116
- `);
117
- log.ok('seeded clarifications.md (run batch-grill-me interview)');
127
+ `;
128
+ } else if (grillMode === 'none') {
129
+ clarContent = `# Clarifications: ${slug}
130
+
131
+ > Requirement: "${requirement}"
132
+ > Mode: no-grill (self-settled)
133
+ > Interactive grilling was skipped via \`--no-grill\`.
134
+ > The agent MUST ground decisions in codebase facts, AST (\`explore.md\`), and existing patterns,
135
+ > and record all settled assumptions below BEFORE authoring proposal.md / specs.
136
+
137
+ ## Requirement
138
+ "${requirement}"
139
+
140
+ ## Settled decisions
141
+ <!-- record all context-inferred decisions and assumptions here -->
142
+
143
+ ## Open questions
144
+ <!-- (none) -->
145
+ `;
146
+ } else {
147
+ // Default: interactive (grill-me)
148
+ clarContent = `# Clarifications: ${slug}
149
+
150
+ > Requirement: "${requirement}"
151
+ > Mode: interactive (grill-me)
152
+ > Before writing proposal.md / specs, the agent runs a high-signal conversational **grill-me** interview
153
+ > with the author (skill: \`grilling\`) and records settled decisions here.
154
+ >
155
+ > **Anti-Fatigue Guardrails**:
156
+ > 1. Codebase-first: Look up facts in AST/code; NEVER ask what can be inspected.
157
+ > 2. Material forks only: Ask only about real architectural trade-offs; decide implementation details yourself.
158
+ > 3. Recommendation-led: Ask 1 focused question at a time with a concrete recommended default and rationale.
159
+ > 4. Early-exit: Stop questioning immediately when material forks are settled or the author says "proceed".
160
+
161
+ ## Requirement
162
+ "${requirement}"
163
+
164
+ ## Settled decisions
165
+ <!-- one entry per settled decision: decision -> answer, with the reason -->
166
+
167
+ ## Open questions
168
+ <!-- must be empty before the spec is written -->
169
+ `;
170
+ }
171
+ writeText(clar, clarContent);
172
+ log.ok(`seeded clarifications.md (${grillMode === 'batch' ? 'batch-grill mode' : (grillMode === 'none' ? 'no-grill mode' : 'conversational grill-me mode')})`);
173
+ }
174
+
175
+ // Technical design (design.md) scaffolding:
176
+ // Auto-seed if requirement implies UI, frontend, API integration, security, NFR, or technical complexity,
177
+ // or if explicitly requested via opts.design === true.
178
+ const UI_OR_TECH_KEYWORDS = /\b(ui|ux|frontend|web|screen|page|view|component|css|style|api|endpoint|service|client|integration|database|db|schema|model|architecture|refactor|migration|auth|payment|cache|gateway|protocol|security|threat|nfr|performance|rate.?limit|sanitize|encryption)\b/i;
179
+ const shouldSeedDesign = opts.design === true || (opts.design !== false && UI_OR_TECH_KEYWORDS.test(requirement));
180
+ const designPath = path.join(cdir, 'design.md');
181
+ if (shouldSeedDesign && !exists(designPath)) {
182
+ const tmplPath = path.join(schemaAssetDir, 'templates', 'design.md');
183
+ let tmpl = exists(tmplPath) ? readText(tmplPath) : `# Technical Design: ${slug}\n\n`;
184
+ tmpl = tmpl.replace('<!-- change id -->', slug);
185
+ tmpl = tmpl.replace('<!-- requirement summary -->', requirement.replace(/"/g, '\\"'));
186
+ writeText(designPath, tmpl);
187
+ log.ok('seeded design.md (technical design for architecture/UI/API/security/NFR)');
118
188
  }
119
189
 
120
190
  log.info('');
121
191
  log.info('[ASDLC PROTOCOL: IMMEDIATE ACTION REQUIRED FOR AGENT]');
122
192
  log.info(' ▶ DO NOT pause or ask the author if you should begin grilling.');
123
- log.info(' ▶ IMMEDIATELY invoke the `batch-grill-me` (or `grilling`) skill in this turn:');
124
- log.info(' 1. Ground yourself in `explore.md` and research codebase facts first.');
125
- log.info(' 2. Present Batch 1 questions (Q1..Qn with concrete recommended defaults) to the author.');
126
- log.info(' 3. Record agreed decisions into `clarifications.md`.');
127
- log.info(' 4. ONLY AFTER clarifications are settled: author `proposal.md` and `specs/**`.');
128
- log.info(` 5. Run \`asdlc lint ${slug}\`.`);
193
+ log.info(' ▶ Ground yourself in `explore.md` and research codebase facts first.');
194
+ log.info(' ▶ Perform external search for 3rd-party APIs, vendor SDKs, and UI design patterns (enabled by default).');
195
+ log.info(' (If search fails or offline: emit \'[WARN] External search failed or offline: <reason>. Continuing with defined steps.\' and continue without blocking).');
196
+ if (grillMode === 'batch') {
197
+ log.info(' ▶ [MODE: BATCH-GRILL] Formulate decision frontier and invoke `batch-grill-me` to present structured batches with recommended defaults.');
198
+ log.info(' ▶ Record agreed decisions into `clarifications.md`.');
199
+ log.info(' ▶ ONLY AFTER clarifications are settled: author `proposal.md`, `specs/**`, and `design.md` (if seeded/needed).');
200
+ } else if (grillMode === 'none') {
201
+ log.info(' ▶ [MODE: NO-GRILL] Interactive grilling bypassed via `--no-grill`.');
202
+ log.info(' ▶ Ground decisions in code/AST facts, record settled assumptions into `clarifications.md`, and proceed to `proposal.md`, `specs/**`, and `design.md` (if seeded/needed).');
203
+ } else {
204
+ log.info(' ▶ [MODE: GRILL-ME] Formulate decision frontier and run conversational, recommendation-led grilling (1 material decision at a time).');
205
+ log.info(' (Anti-fatigue: look up code facts first; skip micro-trivia; halt questioning when author says proceed or forks hit zero).');
206
+ log.info(' ▶ Record agreed decisions into `clarifications.md`.');
207
+ log.info(' ▶ ONLY AFTER clarifications are settled: author `proposal.md`, `specs/**`, and `design.md` (if seeded/needed).');
208
+ }
209
+ if (shouldSeedDesign) {
210
+ log.info(' ▶ [ARCHITECTURE] Generate architecture diagram (embedded Mermaid flowchart / sequenceDiagram).');
211
+ log.info(' ▶ [API DESIGN] Follow `api-design` skill (RESTful nouns, Stripe-style / RFC 7807 errors, idempotency, cursor pagination).');
212
+ log.info(' ▶ [UI/UX DESIGN] Ground visual specs in `frontend-design` (Anthropic) & Vercel Web Interface Guidelines.');
213
+ }
214
+ log.info(` ▶ Run \`asdlc lint ${slug}\`.`);
129
215
  return slug;
130
216
  }
131
217
 
@@ -135,6 +221,10 @@ export function register(program) {
135
221
  .description('start a spec: scaffold + refresh the graph + explore.md + clarifications.md (for grilling)')
136
222
  .option('--id <slug>', 'explicit change slug (override auto-derivation)')
137
223
  .option('--query <q>', 'graph query terms (default: extracted requirement terms)')
224
+ .option('--design', 'explicitly generate technical design (design.md)')
225
+ .option('--no-design', 'skip generating technical design (design.md)')
226
+ .option('--batch-grill', 'use batch-grill-me (present entire decision frontier in structured batches)')
227
+ .option('--no-grill', 'skip interactive grilling interview (self-settle decisions in clarifications.md)')
138
228
  .option('--repo-root <path>')
139
229
  .action((requirement, opts) => {
140
230
  newChange(requirement, opts);