Skip to content

feat(acul-screen-generator): add post-generation build validation phase#79

Open
subhankarmaiti wants to merge 10 commits into
mainfrom
feat/acul-build-validation-phase
Open

feat(acul-screen-generator): add post-generation build validation phase#79
subhankarmaiti wants to merge 10 commits into
mainfrom
feat/acul-build-validation-phase

Conversation

@subhankarmaiti
Copy link
Copy Markdown
Contributor

@subhankarmaiti subhankarmaiti commented May 8, 2026

Adds a new Phase 7: Build Validation & Iterative Fix to the ACUL screen generator skill. This phase runs automatically after code generation (Phase 6) to catch and fix common issues before handing off to the developer.

Problem

When generating ACUL screen code, the skill sometimes produces:

  • Incorrect import styles (default import instead of named {} import, or vice versa)
  • Wrong import paths for SDK hooks and project utilities
  • Invalid component props that don't exist on the target component
  • References to non-existent exports from SDK or project modules

These issues require manual debugging by the developer after generation.

Solution

A new mandatory validation phase that:

  1. Runs the project linter (npm run lint) and TypeScript type checker (tsc --noEmit)
  2. Runs the build (npm run build)
  3. Parses errors and applies targeted fixes using a documented error-pattern lookup table
  4. Repeats until the build succeeds (capped at 5 iterations to avoid infinite loops)

Includes a table of common error patterns mapped to root causes and fixes, plus a "common pitfalls" section documenting the specific issues observed in practice.

Summary by CodeRabbit

  • Documentation
    • ACUL screen generator updated to v1.0.1 with a strict 9-phase workflow and expanded step-by-step guidance.
    • Reference flow now prefers local samples; if absent, skips CLI and falls back to SDK/examples or templates; CLI-scaffolded output is canonical when available.
    • Node.js requirement raised to ≥22; added explicit auth and tenant/domain validation before generation.
    • Phases refined: enforced config and samples checks, dummy-page fallback, three generation paths, stricter pre-output validation, and iterative lint/build loop with a 5-iteration cap.

Review Change Stack

subhankarmaiti and others added 2 commits May 8, 2026 08:34
…nce CLI-first workflow details

Co-authored-by: Copilot <copilot@github.com>
… validation phase

Co-authored-by: Copilot <copilot@github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

✅ claudelint — All checks passed

Full report
Linting Claude plugins in: /home/runner/work/agent-skills/agent-skills


Summary:
  Errors:   0
  Warnings: 0

✓ All checks passed!

claudelint 0.3.6 · config · custom rules · run

@frederikprijck
Copy link
Copy Markdown
Member

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Updated ACUL screen generator SKILL.md to v1.0.1: nine-phase workflow, Node ≥22 and auth0 login/config verification, samples-first CLI gating with a dummy-page fallback, local-first modify rules, three generation paths (A/B/C), and an expanded lint/typecheck/build iterative validation loop with a 5-iteration cap.

Changes

ACUL Screen Generator v1.0.1 Documentation

Layer / File(s) Summary
Version, workflow, and reference hierarchy
plugins/auth0/skills/acul-screen-generator/SKILL.md
Version updated to 1.0.1; workflow redesignated as strict 9-phase process; Reference Hierarchy reordered to require auth0-acul-samples availability check before attempting CLI scaffolding.
Phase 0 — prerequisites and verification
plugins/auth0/skills/acul-screen-generator/SKILL.md
Node requirement raised to ≥ 22; added explicit Node major-version verification that halts with install/upgrade instructions; added auth0 login and tenant/custom-domain validation via auth0 acul config list.
Phase 2B — Add Screen (samples-first, gated CLI, dummy-page fallback)
plugins/auth0/skills/acul-screen-generator/SKILL.md
Replaced Phase 2B with a step-based flow: verify acul_config.json, check auth0-acul-samples (catalog + GitHub path) before invoking CLI; treat CLI-scaffolded output as canonical when available; defined manual dummy-page fallback and SDK example–based generation.
Phase 2C — Modify Screen (local-first references)
plugins/auth0/skills/acul-screen-generator/SKILL.md
Local customer code is the primary reference; GitHub fetching limited to cases where local code lacks SDK patterns needed to determine hooks/actions.
Phase 6 — Structured code generation paths (A, B, C)
plugins/auth0/skills/acul-screen-generator/SKILL.md
Clarified Path A (CLI-scaffolded preferred, preserve SDK imports/hook/action patterns), Path B (samples-based modular generation using dummy-page-derived wiring), and Path C (single-file component route for non-samples screens).
Validation and Phase 7 iteration loop
plugins/auth0/skills/acul-screen-generator/SKILL.md
Tightened pre-output validation (hook/action sourcing, action/payload shapes, SDK-backed error states, no hardcoded UI strings, applyAuth0Theme() expectations) and converted Phase 7 into a lint/typecheck/build iterative-fix loop with lockfile-based dependency handling, structured error parsing, a 5-iteration cap with plateau detection/early stop, and Phase 8 dev-mode wiring commands.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • NandanPrabhu

Poem

🐰 Nine hops, a checklist tight and bright,
Samples first, then CLI takes flight,
Dummy pages sketch the hidden frame,
Lint and builds call each error's name,
A rabbit nods: the steps are right.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary change: adding a post-generation build validation phase (Phase 7) to the acul-screen-generator workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/acul-build-validation-phase

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/auth0/skills/acul-screen-generator/SKILL.md`:
- Around line 21-43: The markdown in SKILL.md contains unlabeled fenced code
blocks (MD040); update both opening fences so they include a language identifier
(e.g., change ``` to ```text) for the large instructional block starting with
"1. Check auth0-acul-samples availability..." and the smaller fenced block that
lists the React/React-JS GitHub URLs (the block containing "React:
https://github.com/auth0-samples/..."); ensure both opening fences are labeled
(e.g., ```text) so markdownlint MD040 is satisfied.
- Line 455: Update the malformed import example in the "Common pitfalls" section
so it uses the correct module path and matching quotes: replace the incorrect
backticked/mismatched snippet that shows `@auth0/auth0-acul-react/login-id'`
with the correct import `import { useLoginId } from '@auth0/auth0-acul-react'`
(referencing useLoginId) ensuring quotes match and the sub-path is not used.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3af5cfbf-ea1f-4555-a8ce-da6eaf801692

📥 Commits

Reviewing files that changed from the base of the PR and between f7724bf and 3f26548.

📒 Files selected for processing (1)
  • plugins/auth0/skills/acul-screen-generator/SKILL.md

Comment thread plugins/auth0/skills/acul-screen-generator/SKILL.md Outdated
Comment thread plugins/auth0/skills/acul-screen-generator/SKILL.md Outdated
@subhankarmaiti
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/auth0/skills/acul-screen-generator/SKILL.md`:
- Line 450: The documentation currently allows raising the iteration cap from 5
to 10 under certain conditions; change this to enforce a strict, non-negotiable
hard cap of 5 iterations by removing or replacing the clause that permits
increasing to 10 and any conditional language about extending iterations in the
"Iteration cap" section of SKILL.md; ensure the text reads that iteration cap
defaults to and must not exceed 5 iterations and that if errors plateau across 2
consecutive iterations or the cap is reached, work stops and remaining errors
are presented to the customer for guidance (reference the "Iteration cap"
heading for the edit).
- Line 256: Update the Phase 2C guidance in SKILL.md to remove the contradiction
by making the reference hierarchy match the updated workflow: change the text
that currently reads "CLI first → samples → SDK examples" to "samples first →
CLI → SDK examples" (or equivalent wording that explicitly prioritizes samples
before any CLI attempts) so the line for "Only fetch from GitHub references..."
aligns with the samples-first policy; ensure the change is made in the Phase 2C
paragraph mentioning fetching from GitHub and verify any nearby sentences that
reference the old order are updated to the new "samples → CLI → SDK examples"
order.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d51a3b0-92df-4247-a536-587b3f14aee2

📥 Commits

Reviewing files that changed from the base of the PR and between cc0f217 and d3e5f5f.

📒 Files selected for processing (1)
  • plugins/auth0/skills/acul-screen-generator/SKILL.md

Comment thread plugins/auth0/skills/acul-screen-generator/SKILL.md Outdated
Comment thread plugins/auth0/skills/acul-screen-generator/SKILL.md Outdated
@subhankarmaiti
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
plugins/auth0/skills/acul-screen-generator/SKILL.md (2)

353-353: ⚡ Quick win

Clarify Path B heading to avoid confusion.

The heading "Screen from auth0-acul-samples (only when CLI doesn't support the screen)" is contradictory—if a screen is in auth0-acul-samples, the CLI should support it per the Reference Hierarchy (lines 22-28).

Path B actually applies when:

  1. Screen is in samples but CLI failed for environmental reasons (auth, version mismatch), OR
  2. Using the samples architecture pattern (modular structure) populated with SDK example data

Consider revising to: "Path B — Modular architecture using samples pattern (when CLI is unavailable or fails)" to clarify that you're using the architectural approach, not the actual samples code.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/auth0/skills/acul-screen-generator/SKILL.md` at line 353, Update the
Path B heading in SKILL.md to remove the contradictory implication that the CLI
doesn't support a screen that exists in auth0-acul-samples; change the heading
text and brief description to indicate this path is for using the
modular/samples architecture pattern or when the CLI is unavailable/fails (e.g.,
auth/version/env issues). Specifically, replace the current heading "Screen from
auth0-acul-samples (only when CLI doesn't support the screen)" with a clearer
label such as "Path B — Modular architecture using samples pattern (when CLI is
unavailable or fails)" and update any adjacent sentence(s) that mention CLI
support to reflect the two cases: (1) sample exists but CLI failed for
environmental reasons, or (2) using the samples architecture pattern with SDK
example data.

217-222: ⚡ Quick win

Consider edge case: what if the target screen is login-id?

The dummy-page strategy uses login-id as a temporary scaffold to capture the project structure. If the user is actually adding login-id as their target screen (or if login-id already exists), the instruction to "delete the login-id/ screen directory" could be problematic.

Consider adding a conditional: "Choose a different dummy screen (e.g., signup or login-password) if login-id is your target screen or already exists in the project."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/auth0/skills/acul-screen-generator/SKILL.md` around lines 217 - 222,
Update the dummy-page instructions to handle the edge case where the target
screen is "login-id" or a "login-id" screen already exists: replace the fixed
example "auth0 acul screen add login-id -d <project-dir>" and the subsequent
"delete the `login-id/` screen directory" guidance with a conditional note that
advises choosing an alternate dummy name (e.g., "signup" or "login-password"),
or first checking for an existing "login-id" directory before creating/deleting;
reference the command example string "auth0 acul screen add login-id -d
<project-dir>", the directory name `login-id/`, and suggested alternates
"signup" and "login-password" so readers know what to change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/auth0/skills/acul-screen-generator/SKILL.md`:
- Line 398: Update the validation note that currently limits applyAuth0Theme()
to Path B so it applies to all modular architecture paths: change the constraint
text to require applyAuth0Theme(sdkInstance) to be invoked in the standard
index.tsx pattern for any modular scaffold (both Path A and Path B) and ensure
the SKILL.md guidance references the function name applyAuth0Theme(sdkInstance)
and index.tsx entrypoint as the canonical place to call it for all modular
paths.

---

Nitpick comments:
In `@plugins/auth0/skills/acul-screen-generator/SKILL.md`:
- Line 353: Update the Path B heading in SKILL.md to remove the contradictory
implication that the CLI doesn't support a screen that exists in
auth0-acul-samples; change the heading text and brief description to indicate
this path is for using the modular/samples architecture pattern or when the CLI
is unavailable/fails (e.g., auth/version/env issues). Specifically, replace the
current heading "Screen from auth0-acul-samples (only when CLI doesn't support
the screen)" with a clearer label such as "Path B — Modular architecture using
samples pattern (when CLI is unavailable or fails)" and update any adjacent
sentence(s) that mention CLI support to reflect the two cases: (1) sample exists
but CLI failed for environmental reasons, or (2) using the samples architecture
pattern with SDK example data.
- Around line 217-222: Update the dummy-page instructions to handle the edge
case where the target screen is "login-id" or a "login-id" screen already
exists: replace the fixed example "auth0 acul screen add login-id -d
<project-dir>" and the subsequent "delete the `login-id/` screen directory"
guidance with a conditional note that advises choosing an alternate dummy name
(e.g., "signup" or "login-password"), or first checking for an existing
"login-id" directory before creating/deleting; reference the command example
string "auth0 acul screen add login-id -d <project-dir>", the directory name
`login-id/`, and suggested alternates "signup" and "login-password" so readers
know what to change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 924f0106-f315-4c11-8d65-ccaa9897ebc9

📥 Commits

Reviewing files that changed from the base of the PR and between cc0f217 and 68fb7bb.

📒 Files selected for processing (1)
  • plugins/auth0/skills/acul-screen-generator/SKILL.md

Comment thread plugins/auth0/skills/acul-screen-generator/SKILL.md Outdated
@github-actions
Copy link
Copy Markdown

✅ skillsaw — All checks passed

Full report
Linting: /home/runner/work/agent-skills/agent-skills


Summary:
  Errors:   0
  Warnings: 0

✓ All checks passed!

skillsaw 0.4.3 · config · custom rules · run

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/auth0/skills/acul-screen-generator/SKILL.md`:
- Around line 414-420: The table and the priority list use inconsistent notation
for Bun lockfiles (one uses "bun.lockb / bun.lock", the other uses
"bun.lock(b)"); pick one style (recommend "bun.lockb" and optionally "bun.lock"
separated by " / ") and update both the lockfile table row (the entry currently
showing `bun.lockb` / `bun.lock`) and the priority list reference (currently
"bun.lock(b)") to use that exact same notation so both places match; update any
other occurrences in SKILL.md to the chosen notation for consistency.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 193af00b-2e27-4abf-b65c-521668ff9abb

📥 Commits

Reviewing files that changed from the base of the PR and between ef9d6b3 and 9d3faf0.

📒 Files selected for processing (1)
  • plugins/auth0/skills/acul-screen-generator/SKILL.md

Comment on lines +414 to +420
| Lockfile | Package manager | Install command |
|----------|-----------------|-----------------|
| `pnpm-lock.yaml` | pnpm | `pnpm install` |
| `yarn.lock` | Yarn | `yarn install` |
| `package-lock.json` | npm | `npm install` |
| `bun.lockb` / `bun.lock` | Bun | `bun install` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use consistent notation for bun lockfiles.

The table at line 419 uses bun.lockb / bun.lock (slash notation), but line 420 uses bun.lock(b) (parenthetical notation) in the priority list. Choose one notation style and apply it consistently.

📝 Proposed fix for consistent notation
-If multiple lockfiles exist, prefer in this priority: `pnpm-lock.yaml` → `yarn.lock` → `package-lock.json` → `bun.lock(b)`.
+If multiple lockfiles exist, prefer in this priority: `pnpm-lock.yaml` → `yarn.lock` → `package-lock.json` → `bun.lockb` / `bun.lock`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/auth0/skills/acul-screen-generator/SKILL.md` around lines 414 - 420,
The table and the priority list use inconsistent notation for Bun lockfiles (one
uses "bun.lockb / bun.lock", the other uses "bun.lock(b)"); pick one style
(recommend "bun.lockb" and optionally "bun.lock" separated by " / ") and update
both the lockfile table row (the entry currently showing `bun.lockb` /
`bun.lock`) and the priority list reference (currently "bun.lock(b)") to use
that exact same notation so both places match; update any other occurrences in
SKILL.md to the chosen notation for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants