Skip to content

docs: update AI rules#52

Merged
vancura merged 2 commits intomainfrom
al-191-update-ai-rules
Jan 10, 2026
Merged

docs: update AI rules#52
vancura merged 2 commits intomainfrom
al-191-update-ai-rules

Conversation

@vancura
Copy link
Copy Markdown
Collaborator

@vancura vancura commented Jan 9, 2026

This PR updates the AI rules documentation for the repository with comprehensive revisions across four configuration files.

ambilab-website.mdc introduces Code Highlighting via Expressive Code (Shiki-based) to the architecture documentation. It adds a new Semantic Design Tokens section covering CSS custom properties, Tailwind color mapping, usage patterns, and dark mode support. The styling guidance is expanded to formalize token-based theming, and the Common Mistakes to Avoid list is updated to include "Hardcoding colors" alongside existing items for accessibility and motion preferences.

astro-svelte.mdc significantly expands Image Optimization documentation with new subsections including Astro Image Component, ResponsiveImage Component for srcset/responsive images, Icons with component usage and accessible labeling, Demo Embeds with security notes, and Code Blocks in MDX using Expressive Code. The reorganization consolidates related content with standardized component approaches replacing previous minimal guidance and preloading/font link snippets.

file-structure.mdc undergoes substantial restructuring, replacing the Region Syntax guidance with a File-Level Documentation approach. The documentation now requires top-level JSDoc comments for each file and establishes a structured layout pattern (File-level documentation, Imports, Type Definitions, Constants/Configuration, Helper Functions, Main Exports). Concrete code examples are added demonstrating JSDoc coverage for functions, interfaces, and properties, reframing the content from region-based organization to comprehensive documentation practices.

typescript.mdc updates the TypeScript configuration documentation to note an extension of strict options with two new sub-options (noImplicitOverride and noFallthroughCasesInSwitch). It introduces new Path Aliases documentation and adds sections detailing Logger Pattern and Safe Execution Pattern with usage examples.

All changes are documentation-only with no modifications to public APIs or exported entity declarations.

Signed-off-by: Vaclav Vancura <commit@vancura.dev>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Vaclav Vancura <commit@vancura.dev>
@linear
Copy link
Copy Markdown

linear bot commented Jan 9, 2026

AL-191 Update AI rules

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 9, 2026

Warning

Rate limit exceeded

@vancura has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 4 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between a3a4a71 and e9dbce8.

📒 Files selected for processing (1)
  • ai-rules/astro-svelte.mdc

Walkthrough

The PR updates four AI rule documentation files to enhance development guidance. Changes include adding code highlighting and semantic design tokens to website rules, reorganizing file-structure rules from region-based to documentation-focused approach, expanding TypeScript conventions with path aliases and execution patterns, and adding comprehensive Astro/Svelte component examples.

Changes

Cohort / File(s) Summary
AI Rules Documentation Updates
ai-rules/ambilab-website.mdc, ai-rules/astro-svelte.mdc, ai-rules/file-structure.mdc, ai-rules/typescript.mdc
Comprehensive updates across AI rule documentation: ambilab-website.mdc adds code highlighting (Expressive Code/Shiki), semantic design tokens with CSS custom properties and Tailwind mapping, and expands styling quality checks; astro-svelte.mdc introduces Image Optimization sections with component examples (Astro Image, ResponsiveImage, Icons, Demo Embeds, Code Blocks); file-structure.mdc shifts from region syntax to file-level JSDoc documentation patterns with structured layout guidance; typescript.mdc adds strict TypeScript configuration options (noImplicitOverride, noFallthroughCasesInSwitch), path aliases documentation, and Logger/Safe Execution patterns. All changes are documentation-only with no API modifications.

Possibly related PRs

  • PR #16 — Updates ai-rules/*.mdc files with semantic tokens and code highlighting, directly overlapping with multiple documentation changes in the current PR
  • PR #18 — Modifies ai-rules/ambilab-website.mdc file, sharing the same documentation file target as the current PR
  • PR #35 — Updates icon usage and sourcing documentation in ai-rules/ambilab-website.mdc, related to icon component examples being added
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'docs: update AI rules' is vague and generic, using non-descriptive language that doesn't convey the specific nature of the documentation updates across multiple files. Consider a more specific title that highlights the main changes, such as 'docs: add semantic design tokens, code examples, and TypeScript patterns to AI rules' or similar to better communicate the scope of updates.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch al-191-update-ai-rules

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@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

🤖 Fix all issues with AI agents
In @ai-rules/astro-svelte.mdc:
- Around line 336-349: Update the "Code Blocks in MDX" supported languages list
to use Shiki's correct identifier by replacing the entries "bash" and "shell"
with "shellscript"; locate the list inside the Code Blocks in MDX section (the
block that enumerates supported languages and the example using Expressive Code)
and edit the comma-separated language tokens so the final list reads:
typescript, javascript, jsx, tsx, html, css, scss, json, yaml, markdown,
shellscript, python, rust, go.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b44a28 and a3a4a71.

📒 Files selected for processing (4)
  • ai-rules/ambilab-website.mdc
  • ai-rules/astro-svelte.mdc
  • ai-rules/file-structure.mdc
  • ai-rules/typescript.mdc
🔇 Additional comments (15)
ai-rules/typescript.mdc (2)

87-101: Path Aliases table is clear and comprehensive.

The mapping is consistent with the path alias definitions in ambilab-website.mdc (lines 292-301), providing helpful alignment across documentation. The table format makes it easy to reference.


146-172: Logger and Safe Execution patterns are correctly implemented.

Both utility functions exist with signatures matching the documented examples:

  • createLogger properly exports from src/utils/logger.ts and accepts LoggerOptions parameter
  • safeExecute properly exports from src/utils/safe-execute.ts with overloaded signatures supporting the documented usage pattern

No updates needed.

ai-rules/ambilab-website.mdc (3)

62-62: Tech stack additions (Expressive Code and Linting) are well-aligned with documentation updates.

These additions in the tech stack align well with the Code Blocks guidance in astro-svelte.mdc (lines 336-349) and the extended linting setup. The information is consistent across documentation files.

Also applies to: 66-66


344-344: Hardcoding colors mistake reinforces semantic token guidance effectively.

Adding this item to the common mistakes list strengthens the connection to the Semantic Design Tokens section (lines 245-263), providing good cross-reinforcement of the token-based theming approach.


245-263: Semantic Design Tokens implementation is fully verified and correctly documented.

The semantic tokens are properly implemented in both src/styles/global.css (using the @theme directive) and tailwind.config.ts (with theme.extend.colors mappings). All documented token categories and dark mode support with -dark suffix variants are present and functional.

ai-rules/astro-svelte.mdc (3)

320-334: Demo Embeds documentation includes important security considerations.

The security note about the allowlist (blit-tech-demos.ambilab.com, HTTPS only) is appropriately placed and aligns with the more detailed security guidance in ambilab-website.mdc (lines 199-235). The cross-file consistency is good, though ensure that the DemoEmbed component implementation actually enforces these security constraints.


277-300: Image optimization guidance covers both static and responsive use cases.

The separation between Astro's built-in Image component (for static imports) and the ResponsiveImage component (for responsive images with srcset) is clear and practical. This provides good guidance for different image optimization scenarios.


302-318: Icon component correctly implements accessibility features as documented.

The Icon component at src/components/astro/Icon.astro properly supports both the decorative and ariaLabel parameters as shown. The implementation is even more robust than the documentation indicates—it enforces that non-decorative icons must provide an ariaLabel, preventing accidental accessibility gaps. All 13 icons listed (bluesky, calendar, clock, github, instagram, linkedin, mastodon, pixel-heart, refresh, tag, threads, user, x) are available. The guidance on semantic vs. decorative icon usage is accurate and follows accessibility best practices.

ai-rules/file-structure.mdc (7)

1-5: Frontmatter is clear and appropriate.

The metadata accurately reflects the file's purpose and the scope is appropriate for TypeScript/JavaScript files.


9-23: File-level documentation guidance is clear and well-exemplified.

The example effectively demonstrates the recommended JSDoc pattern with context about why such documentation matters for this particular route configuration file.


25-32: Standard file structure is well-organized and follows established conventions.

The six-step structure provides a clear blueprint for file organization that readers can immediately apply.


34-51: Function documentation example is comprehensive and standards-compliant.

The JSDoc template covers all essential elements (description, parameters, return value, error handling) and the example is realistic and well-formatted.


53-71: Interface documentation example effectively demonstrates dual-level commenting.

The example clearly shows how to document both the interface and individual properties, with appropriate terseness for property descriptions.


73-95: Region syntax section appropriately transitions to optional status.

The deprioritization of regions aligns well with the documentation-focused reorganization while still providing clear guidance for files where regions remain useful.


97-117: Practical guidance on region usage is well-qualified and context-aware.

The concrete threshold (100 lines) and clear decision criteria make this guidance immediately actionable while respecting the optional nature of regions.

Updated the list of supported languages in the AI rules documentation,
replacing 'bash' and 'shell' with 'shellscript' for clarity.

Signed-off-by: Vaclav Vancura <commit@vancura.dev>
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.

1 participant