Skip to content

AI Tooling - #302

Draft
jason-capsule42 wants to merge 10 commits into
devfrom
jbaker/AITooling
Draft

AI Tooling#302
jason-capsule42 wants to merge 10 commits into
devfrom
jbaker/AITooling

Conversation

@jason-capsule42

@jason-capsule42 jason-capsule42 commented Jul 24, 2026

Copy link
Copy Markdown
Member

Alaska Airlines Pull Request

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

Summary by Sourcery

Add AI-focused tooling and static metadata to the Auro CLI to improve discoverability and machine-readable access to Auro components.

New Features:

  • Introduce auro context command to generate an AI assistant context document for the Auro Design System to stdout or a file.
  • Add auro cem command to aggregate Custom Elements Manifests for all published Auro components into a single manifest file.
  • Add auro component <name> command to retrieve a single component’s API from its published Custom Elements Manifest, with optional JSON output.

Enhancements:

  • Document the new AI-related CLI commands and examples in the README.
  • Add static metadata files describing Auro components and an AI context to support the new CLI commands.

Build:

  • Extend module resolution aliases and package/TypeScript path mappings to include the new #static directory used by the AI tooling.

lindseyo1123 and others added 8 commits July 7, 2026 15:26
…B#1592463

Adds a new 'auro context' command that prints an AI-ready context document
describing the Auro Design System — component list, package names, usage
patterns, and rules — for priming AI coding assistants (Claude, Cursor,
Copilot, etc.).

- src/static/auroContext.ts: the context document, exposed via a new
  #static/* import alias
- src/commands/context.ts: the command, supporting stdout and --output <file>
- Wires #static/* into package.json imports, tsconfig paths, and the esbuild
  build config
- Documents the command in the README

Inspired by prior art in Meta's Astryx design system (npx astryx init).
…92463

Addresses review findings — the doc shipped examples that would mislead the
AI assistants it exists to ground:
- auro-formkit: label is a slot, not an attribute; import via subpath
  (no root export) instead of a bare package import
- auro-icon: use a real icon name (plane-side-fill) and drop the non-existent
  customSize property
- design tokens: correct prefixes to --ds-basic-* / --ds-advanced-*
- auro-pane and auro-nav: accurate descriptions
Reconcile the component set with llms.txt and the auro cem component list so
all three sources agree.
…592463

Adds 'auro cem' which fetches each published Auro component's
custom-elements.json from unpkg and merges them into a single aggregated
Custom Elements Manifest. Components that don't publish a manifest are
skipped with a warning. Source module paths are namespaced by package so
consumers can trace each declaration to its component.

Produces one machine-readable API index for IDEs, docs tooling, and AI
assistants.

- src/static/auroComponents.ts: list of component packages to aggregate
- src/commands/cem.ts: the command (--output, --aggregate)
- registers the command and documents it in the README
…B#1592463

Addresses review feedback on the cem aggregation command:
- Deep-namespace internal module references (exports' declaration.module,
  references, etc.), not just the top-level module path, so the merged
  manifest's internal references stay valid. External references (those with
  a package) are left untouched.
- Distinguish genuine 404s (component has no CEM yet) from transient
  network/5xx failures; exit non-zero when the aggregate is incomplete due to
  transient errors so CI can retry.
- Defer skip messages until after the spinner so output isn't garbled.
- Warn on mixed CEM schema versions.
- Drop the no-op --aggregate flag and the empty readme field.
- Correct the component-list doc comment (not all components publish a CEM).
feat(context): add auro context command for AI assistant onboarding
feat(cem): add auro cem command to aggregate component manifests
@jason-capsule42
jason-capsule42 requested a review from a team as a code owner July 24, 2026 20:15
@sourcery-ai

sourcery-ai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds AI-focused CLI tooling to the Auro Design System CLI: a context generator, a Custom Elements Manifest aggregator, and a per-component API lookup command, backed by new static metadata files and updated module resolution aliases.

Sequence diagram for the new auro component CLI API lookup

sequenceDiagram
  actor User
  participant AuroCLI
  participant Unpkg

  User->>AuroCLI: auro component <name> [commander action]
  AuroCLI->>AuroCLI: toPackageName(name)
  AuroCLI->>Unpkg: fetch custom-elements.json
  Unpkg-->>AuroCLI: manifest JSON or 404/error
  AuroCLI->>AuroCLI: formatDeclaration(pkg, declaration)
  alt options.json
    AuroCLI->>User: write JSON declarations to stdout
  else formatted text
    AuroCLI->>User: write formatted API summary to stdout
    AuroCLI->>User: Logger.info full docs URL
  end
Loading

Sequence diagram for the new auro cem CLI manifest aggregation

sequenceDiagram
  actor User
  participant AuroCLI
  participant Unpkg
  participant FileSystem

  User->>AuroCLI: auro cem [commander action]
  AuroCLI->>AuroCLI: iterate AURO_COMPONENT_PACKAGES
  AuroCLI->>Unpkg: fetchManifest(pkg)
  Unpkg-->>AuroCLI: manifest or skip reason
  AuroCLI->>AuroCLI: mergeManifests(sources)
  AuroCLI->>FileSystem: writeFile(outputPath, aggregate)
  FileSystem-->>AuroCLI: write success or error
  alt write success
    AuroCLI->>User: spinner.succeed aggregated summary
    AuroCLI->>User: Logger.info skipped components
    AuroCLI->>User: Logger.error if transientFailures
  else write failure
    AuroCLI->>User: spinner.fail error message
  end
Loading

File-Level Changes

Change Details Files
Introduce auro component CLI command to fetch and present a single component’s Custom Elements Manifest from unpkg.
  • Register new component command in the CLI entrypoint.
  • Implement unpkg-based manifest fetching with robust error handling for 404s and network issues.
  • Filter manifest declarations to only real registered custom elements with tag names.
  • Provide both JSON (raw declarations) and formatted human-readable output, including attributes, members, slots, events, and CSS styling hooks.
  • Implement helper utilities for package-name normalization, text cleaning, deprecation tagging, and list rendering.
src/index.ts
src/commands/component.ts
Add auro cem CLI command to aggregate all Auro component Custom Elements Manifests into a single namespaced manifest file.
  • Register new cem command in the CLI entrypoint.
  • Implement manifest fetching for a list of known Auro component packages, distinguishing 404s from transient errors.
  • Namespace module paths and internal module references by owning package to avoid collisions in the merged manifest.
  • Merge per-package manifests into a single manifest while warning on mixed schema versions.
  • Write the aggregated manifest to disk with a configurable output path and clear logging of skipped/failed packages.
src/index.ts
src/commands/cem.ts
src/static/auroComponents.ts
Add auro context CLI command that outputs a curated AI-assistant context document for the Auro Design System.
  • Register new context command in the CLI entrypoint.
  • Create a static, markdown-formatted Auro context string covering usage rules, component catalog, patterns, and accessibility notes.
  • Implement CLI behavior to either print the context to stdout or write it to a specified file path, with spinner feedback and error handling.
src/index.ts
src/commands/context.ts
src/static/auroContext.ts
Update documentation and build/TypeScript configuration to support the new commands and static resources.
  • Extend README with usage documentation, options, and examples for auro context, auro cem, and auro component.
  • Add a new #static alias for static resources in build config, package.json exports, and tsconfig path mappings.
README.md
build-scripts/build-config.js
package.json
tsconfig.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@jason-capsule42 jason-capsule42 changed the title Jbaker/ai tooling AI Tooling Jul 24, 2026

@sourcery-ai sourcery-ai Bot 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.

Hey - I've left some high level feedback:

  • The CEM-related type definitions are duplicated between component.ts and cem.ts; consider extracting shared interfaces/types into a common module to keep them consistent and easier to maintain.
  • The commands call process.exit directly in multiple error paths, which makes programmatic reuse and testing harder; consider centralizing error handling or returning non-zero exit codes via commander instead of exiting inside actions.
  • The large AURO_CONTEXT markdown blob is embedded as a template string in code; consider moving it into a standalone .md asset that is read at runtime so it can be edited and linted as documentation without touching the CLI source.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The CEM-related type definitions are duplicated between `component.ts` and `cem.ts`; consider extracting shared interfaces/types into a common module to keep them consistent and easier to maintain.
- The commands call `process.exit` directly in multiple error paths, which makes programmatic reuse and testing harder; consider centralizing error handling or returning non-zero exit codes via commander instead of exiting inside actions.
- The large `AURO_CONTEXT` markdown blob is embedded as a template string in code; consider moving it into a standalone `.md` asset that is read at runtime so it can be edited and linted as documentation without touching the CLI source.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jason-capsule42
jason-capsule42 marked this pull request as draft July 24, 2026 21:08
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