Skip to content

feat: bundle analyzer, realtime guidance, and artifact checks#22

Merged
smiggleworth merged 7 commits into
mainfrom
fix/bundle-cli-analyzer-stream
Jul 26, 2026
Merged

feat: bundle analyzer, realtime guidance, and artifact checks#22
smiggleworth merged 7 commits into
mainfrom
fix/bundle-cli-analyzer-stream

Conversation

@smiggleworth

Copy link
Copy Markdown
Contributor

Summary

  • expand askr analyze with lifecycle, stream, data, island, action, invalidation, execution, and allocation contracts
  • update realtime skill/guardrail/template guidance to use the public async stream() contract
  • add deterministic repair/check fixtures, benchmarks, packed artifact verification, and template coverage

Closes #19
Closes #20
Closes #21

Verification

  • npm run check
  • npm run fmt
  • npm test -- --reporter=dot

The framework stream runtime is supplied by askrjs/askr#135.

Copilot AI review requested due to automatic review settings July 26, 2026 21:59
@smiggleworth

Copy link
Copy Markdown
Contributor Author

/copilot review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the CLI’s static analysis and recovery loop by introducing askr analyze plus unified guardrail commands (doctor, repair, check), adds analyzer benchmarks/budget enforcement, and updates templates/docs/skills to align with the new workflow and stream-era guidance.

Changes:

  • Add a workspace-aware analyzer with rule catalog expansion, deterministic JSON output, and transactional “safe fix” application.
  • Add doctor / repair / check guardrails that gate project scripts on clean analysis and report actionable findings.
  • Add analyzer benchmarking (Vitest bench config + budget reporter) and update templates/docs to use askr analyze --check and askr check.

Reviewed changes

Copilot reviewed 51 out of 59 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vitest.bench.config.ts Adds dedicated Vitest benchmark config with budget reporter.
vite.config.ts Packs new analyze entry and adjusts packed asset copying.
tsconfig.json Includes benchmark sources and bench config in TS project.
tests/update.range.test.ts Updates planner tests to use force flag wiring.
tests/update.cli.test.ts Verifies analyze entry and runtime TS dependency in packed surface.
tests/guardrails.test.ts Adds end-to-end tests for doctor/repair/check behavior and template cleanliness.
tests/generate.test.ts Tightens OpenAPI escape fixture (file URL case).
tests/cli.smoke.test.ts Updates CLI help expectations; adds TS runtime dependency assertion; adjusts SSG config expectations.
tests/analyze.rules.test.ts Adds analyzer rule fixtures for new/expanded contracts and configuration handling.
tests/analyze.cli.test.ts Adds CLI-level tests for askr analyze parsing, JSON determinism, and transactional fixes.
templates/startkit/src/routes/workspace/index.ts Replaces route constant usage with literal paths in startkit routes.
templates/startkit/src/routes/workspace/accounts.ts Replaces route constant usage with literal paths for accounts route.
templates/startkit/src/routes/public.ts Replaces route constant usage with literal public path.
templates/startkit/src/routes/auth.ts Replaces route constant usage with literal auth path.
templates/startkit/package.json Adds analyze script and switches check to askr check.
templates/startkit/AGENTS.md Adds recovery guidance for askr repair / askr check.
templates/ssr/package.json Adds analyze script and switches check to askr check.
templates/ssr/AGENTS.md Adds recovery and completion section for guardrails loop.
templates/ssg/src/pages/example.tsx Switches example input to @askrjs/ui Input component.
templates/ssg/package.json Adds analyze script and switches check to askr check.
templates/ssg/AGENTS.md Adds recovery and completion section for guardrails loop.
templates/spa/src/main.tsx Reorders imports (registry import moved below styles).
templates/spa/README.md Updates wording to “route registry” terminology.
templates/spa/package.json Adds analyze script and switches check to askr check.
templates/spa/AGENTS.md Updates routing description and adds recovery/completion guidance.
templates/full-stack/package.json Adds analyze script and switches check to askr check.
templates/full-stack/AGENTS.md Adds recovery and completion guidance for guardrails loop.
src/update/types.ts Introduces DiscoveredWorkspaceProject type for workspace discovery.
src/update/planner.ts Adds deprecated force?: boolean option and tweaks memo signature logic.
src/update/discovery.ts Extracts discoverWorkspaceProject and refactors discoverProject around it.
src/guardrails/types.ts Defines JSON schema for doctor/check/repair reports.
src/guardrails/runner.ts Implements runDoctor, runRepair, runCheck orchestration and script gating.
src/generate/generator.ts Changes local OpenAPI reference escape check logic.
src/bin/ssg.ts Allows either routes or registry config source (exactly one).
src/bin/skills.ts Adds byte-level bundled skill freshness checking via directory fingerprints.
src/bin/skill-review.ts Updates review prompt set (removes accessibility prompt; removes suppression filtering).
src/bin/guardrails.ts Adds CLI entry module for guardrail commands with JSON/human output.
src/bin/cli.ts Adds new top-level commands (analyze, doctor, repair, check) and dispatch wiring.
src/bin/analyze.ts Adds askr analyze CLI with deterministic JSON and human output.
src/analyze/types.ts Adds analyzer report/diagnostic schema types.
src/analyze/runner.ts Implements analysis pipeline, sorting, safe fix preparation, and transactional writes.
src/analyze/rules.ts Adds expanded analyzer rule set, caching, and contract checks.
src/analyze/project.ts Builds TS programs per workspace, applies exclusions, and avoids loading external decl graphs.
src/analyze/catalog.ts Defines Askr concept inventory and import matching patterns.
skills/askr-ssr-ssg/SKILL.md Updates SSR/SSG skill guidance snippet (route registration shape).
README.md Documents analyze and guardrail commands and the recovery loop.
package.json Adds runtime typescript dependency; adjusts scripts; changes package version.
package-lock.json Aligns lockfile with dependency moves and package version change.
guidance-manifest.json Removes legacy guidance manifest file.
docs/workflows.md Adds recovery workflow steps; links to guardrails docs.
docs/skill-review-prompts.md Removes references to dropped accessibility review prompt.
docs/README.md Adds documentation index entries for analyze/guardrails.
docs/overview.md Adds overview entries for analyze and guardrail commands.
docs/guardrails.md Adds guardrails command reference and JSON contract overview.
docs/analyze.md Adds analyzer command reference and rule catalog documentation.
benchmarks/cli.mjs Adds cold analyze benchmark sample and budgets.
benchmarks/analyze.bench.ts Adds analyzer benchmarks for workspace/monorepo sizes.
benchmarks/analyze-budget-reporter.ts Enforces analyzer mean-time budgets via custom reporter.
.github/workflows/publish.yml Updates reusable publish workflow reference SHA.
Comments suppressed due to low confidence (1)

skills/askr-ssr-ssg/SKILL.md:41

  • The skill’s “Copy This Shape” uses registerRoutes(...), but the templates and analyzer guidance in this repo consistently use createRouteRegistry(...) for route registration. As written, the snippet references an API that doesn’t appear elsewhere in the codebase and may mislead users.
registerRoutes(() => {
  page("/docs/{slug}", DocsPage, {
    entries: async () => [{ slug: "getting-started" }, { slug: "routing" }],
  });
});

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/generate/generator.ts
Comment thread docs/analyze.md Outdated
Comment thread package.json Outdated
@smiggleworth

Copy link
Copy Markdown
Contributor Author

/copilot review

@smiggleworth

Copy link
Copy Markdown
Contributor Author

/copilot review

@smiggleworth

Copy link
Copy Markdown
Contributor Author

/copilot review

@smiggleworth
smiggleworth requested a review from Copilot July 26, 2026 22:12
@smiggleworth

Copy link
Copy Markdown
Contributor Author

/copilot review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 49 out of 57 changed files in this pull request and generated 3 comments.

Comment thread src/update/planner.ts
Comment thread skills/askr-ssr-ssg/SKILL.md Outdated
Comment thread docs/analyze.md Outdated
@smiggleworth

Copy link
Copy Markdown
Contributor Author

/copilot review

@smiggleworth
smiggleworth merged commit 20dba0c into main Jul 26, 2026
8 checks passed
@smiggleworth
smiggleworth deleted the fix/bundle-cli-analyzer-stream branch July 26, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants