Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This document provides instructions for AI agents working on this codebase.
Sign in to like and favorite skills
This document provides instructions for AI agents working on this codebase.
This is a
pnpm monorepo. To get started, run pnpm install in the root directory to install all dependencies for all workspaces.
The project uses
pnpm as a package manager and Turborepo to manage the monorepo scripts. All commands should be run from the project root.
pnpm format and pnpm lint before committing.packages/logic-core or apps/game/src/game/logic. These files should be plain TypeScript and not import any Pixi.js modules.apps/game/src/scenes. These files are responsible for visualizing the state from the logic layer.pnpm test.pnpm test (it is configured to generate coverage).Development:
pnpm dev. This will use Turborepo to start the development servers for both the game client and the server backend concurrently.http://localhost:8080).Production:
pnpm build to create production-ready builds for all applications.pnpm start --filter=@xiuxian/server.assets directory.import myImage from '../assets/images/my-image.png';myImage variable can then be used with a loader like PIXI.Assets.load().The project uses a singleton
SceneManager (src/scenes/SceneManager.ts) to control the game's scenes.
SceneManager.getInstance().switchScene(NewScene)..destroy({ children: true })) to prevent memory leaks. Do not manually add or remove scenes from the stage.A strict separation between logic and view is enforced, particularly for complex scenes.
MainScene): The complex drag/swipe calculations are not performed in MainScene.ts. Instead, they are located in pure functions in src/game/logic/mainScreen.ts.MainScene) captures user input, passes it to the pure logic functions, and then applies the returned values to the Pixi.js objects.logic file and be covered by unit tests.The core
logic-core package defines how cards work.
CardData (packages/logic-core/src/types.ts): This is the raw data definition for a card, loaded from JSON. It includes properties like id, name, type, and the new rarity. It is a discriminated union, making it type-safe.Card (packages/logic-core/src/card.ts): This is a lightweight class that represents a card instance. It does not duplicate data. Instead, it holds a reference to a CardData object and uses getters to expose the data. When you are working with a card in the game, you will be using a Card object.After making changes, please verify them by running the following commands from the project root:
pnpm lintpnpm format:checkpnpm test:ci (Note: use the test:ci script for non-interactive testing)pnpm build