feat: bundle analyzer, realtime guidance, and artifact checks#22
Merged
Conversation
Contributor
Author
|
/copilot review |
There was a problem hiding this comment.
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/checkguardrails 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 --checkandaskr 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 usecreateRouteRegistry(...)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.
Contributor
Author
|
/copilot review |
Contributor
Author
|
/copilot review |
Contributor
Author
|
/copilot review |
Contributor
Author
|
/copilot review |
Contributor
Author
|
/copilot review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
askr analyzewith lifecycle, stream, data, island, action, invalidation, execution, and allocation contractsstream()contractCloses #19
Closes #20
Closes #21
Verification
npm run checknpm run fmtnpm test -- --reporter=dotThe framework stream runtime is supplied by askrjs/askr#135.