Skip to content

Adds installable LLM rules.mdc #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 16, 2025
Merged

Adds installable LLM rules.mdc #139

merged 8 commits into from
May 16, 2025

Conversation

marklundin
Copy link
Member

@marklundin marklundin commented May 16, 2025

As of today, the project hasn't been fully indexed by LLM's and vibe coding often produces confused results. Whilst wait for better coverage, this PR adds a set of rules.mdc files that can provide LLM's with better context of the library and how it works.

There are a couple of rules

  • @playcanvas/react rules - Provide top level contextual information for the library and usage.
  • /blocks.mdc - Provides information for installing and getting started with the components
  • /splat-viewer.mdc - Provides specific context for installing and using <SplatViewer/>

The @playcanvas/react rules are available on https://playcanvas-react.vercel.app/rules (when deployed)

Docs

The docs & README have been updated with some information on installing and LLM rules with instructions for both Cursor and Windsurf.

image.

Splat Viewer rules

Rules have been added to the registry so running npx shadcn add splat-viewer automatically installs the rules to the IDE.

There are also a few docs layout improvements.

- Updated README.md to include a new section on AI Assisted Development, providing installation instructions for MDC rules.
- Revised blocks.mdx to clarify the description of 3D building blocks and their usage.
- Improved the SplatViewer documentation with additional details on features and usage examples.
- Added new MDC files for blocks and SplatViewer to standardize component usage rules.
- Enhanced the index.mdx to better explain the purpose of the PlayCanvas React library and its features.

These changes improve the clarity and usability of the documentation, making it easier for developers to get started with PlayCanvas React.
@marklundin marklundin self-assigned this May 16, 2025
@marklundin marklundin added documentation Improvements or additions to documentation enhancement New feature or request Blocks labels May 16, 2025
Copy link

pkg-pr-new bot commented May 16, 2025

Open in StackBlitz

npm i https://pkg.pr.new/playcanvas/react/@playcanvas/react@139

commit: cc73bba

- Replaced direct imports of Splat components with a unified import from the new Splat module.
- Updated the `useMDXComponents` function to include Splat as a component.
- Adjusted documentation in blocks.mdx to reflect the new import structure for Splat components.
@marklundin marklundin requested a review from Copilot May 16, 2025 16:01
Copy link
Contributor

@Copilot Copilot AI left a comment

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 introduces installable MDC rules to improve LLM context for the library and its components. Key changes include the addition of new MDC rule files for @playcanvas/react, splat-viewer, and blocks; updates to documentation to guide IDE rule installation; and minor adjustments to component exports and examples.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/lib/README.md Added Stackblitz template and AI Assisted Development instructions for installing MDC rules.
packages/lib/.playcanvas-react.mdc Introduced MDC rules for @playcanvas/react including usage examples.
packages/docs/registry/splat-viewer/index.tsx Renamed SplatViewer export to Viewer for consistency.
packages/docs/registry/splat-viewer/.splat-viewer.mdc Added MDC rules for splat-viewer along with usage examples.
packages/docs/registry/.blocks.mdc Added MDC rules for 3D blocks with guidance on component usage.
packages/docs/registry-mdx-components.tsx & packages/docs/mdx-components.js Removed/deprecated registry MDX components and updated MDX components accordingly.
packages/docs/content/docs/index.mdx Updated examples and documentation layout with revised installation and component usage instructions.
packages/docs/content/blocks.mdx Updated content and command instructions to reference splat-viewer MDC rules.
packages/docs/app/rules/route.tsx Added a new API route to serve the MDC rules.
README.md Updated top-level documentation with AI Assisted Development instructions.
Comments suppressed due to low confidence (1)

packages/docs/content/docs/index.mdx:89

  • The code snippet uses the Render component without importing it; add an import for Render from '@playcanvas/react/components' to ensure the example is self-contained and functional.
      <Render type='cube' />

@marklundin marklundin merged commit c4bf2b3 into main May 16, 2025
5 checks passed
@marklundin marklundin deleted the docs-update branch May 16, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocks documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant