pxt-arcade
Copilot instructions548 starsChanged 12 months agoMITView on GitHub
For external contributors: If you encounter simulator-specific issues, please file them in this repository and maintainers will coordinate with the appropriate internal teams.
- Installs packages
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
58 rules. About 0 are common, 41 are distinctive, and 17 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈41
Distinctive · estimate
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Follow TypeScript strict mode conventions
- Distinctive: line 10
Use semantic versioning for all packages
- Distinctive: line 12
Write clear, self-documenting code with JSDoc comments
- Distinctive: line 13
Follow the existing code style and patterns in each component
- Distinctive: line 16
Always include proper type annotations
- Very specific: line 17
Use export statements for public APIs
- Very specific: line 18
Prefer const over let where possible
- Distinctive: line 19
Use arrow functions for callbacks and short functions
- Distinctive: line 177
When assigned an issue, first determine which repository the changes should go to:
- Distinctive: line 199
When editing files, be aware of which repository they belong to:
- Very specific: line 226
Place TypeScript APIs in appropriate libs/ directory
- Very specific: line 227
Use //% block="..." annotations for Blockly integration
- Very specific: line 228
Add //% help="..." for documentation links
- Very specific: line 230
Update pxt.json to include new files
- Very specific: line 233
Variable Format: Use $ format instead of deprecated % format for variables
- Distinctive: line 249
Avoid circular dependencies between repositories
- Distinctive: line 252
Keep APIs simple and discoverable
- Distinctive: line 253
Use consistent naming patterns
- Distinctive: line 255
Consider both block and text programming users
- Distinctive: line 256
Follow TypeScript best practices
- Very specific: line 259
API Documentation: Use JSDoc comments and //% help annotations
- Very specific: line 260
Tutorial Content: Place in docs/ with proper markdown formatting
- Very specific: line 262
Screenshots: Use for UI changes and place in docs/static/
- Distinctive: line 263
Breaking Changes: Document breaking changes clearly in commit messages
- Distinctive: line 264
README Updates: Update relevant README files when adding features
- Distinctive: line 277
Add TypeScript implementation with proper annotations
- Distinctive: line 278
Test in local development server
- Distinctive: line 279
Add documentation and examples
- Distinctive: line 280
Update relevant configuration files
- Distinctive: line 286
Test across browsers and devices
- Distinctive: line 287
Verify no regressions in existing functionality
- Distinctive: line 291
Test in multiple browsers
- Distinctive: line 292
Consider mobile and accessibility
- Distinctive: line 293
Check theme compatibility (light/dark modes)
- Very specific: line 300
Run setup.cmd /link to re-establish repository links
- Distinctive: line 301
Check that all repositories are on compatible versions
- Distinctive: line 302
Ensure npm dependencies are installed in all repos
- Distinctive: line 305
Check browser console for errors
- Very specific: line 306
Verify npm run serve is running from pxt-arcade
- Very specific: line 307
Ensure gulp watch is running from pxt-core for live changes
- Very specific: line 315
Missing APIs: Check if API should be in pxt-common-packages vs pxt-arcade
- Very specific: line 316
Block not appearing: Verify pxt.json includes the TypeScript file
- Very specific: line 317
IntelliSense problems: Check JSDoc comments and //% help annotations
- Distinctive: line 318
Cross-target compatibility: Test changes don't break other MakeCode targets
- Very specific: line 322
Package loading: Check pxt.json files for correct file references
- Distinctive: line 323
TypeScript errors: Ensure all dependencies are properly linked via npm link
- Distinctive: line 333
TypeScript compilation errors: Check for missing type definitions or circular dependencies
- Distinctive: line 335
Performance issues: Check for memory leaks in game loops or inefficient rendering
- Distinctive: line 351
Always test across repositories when making changes to pxt-core or pxt-common-packages
- Distinctive: line 352
Consider backwards compatibility when modifying existing APIs
- Distinctive: line 353
Document breaking changes clearly in PR descriptions
- Distinctive: line 354
Use semantic versioning principles for API changes
- Distinctive: line 372
Follow Microsoft security policies
- Distinctive: line 380
Unit Tests: Write unit tests for new functionality
- Distinctive: line 382
Simulator Testing: Test simulator features across different browsers
- Distinctive: line 384
Cross-Target Testing: Ensure changes don't break other MakeCode targets
- Distinctive: line 385
Cross-Repository Testing: Test compatibility when making changes to pxt-core or pxt-common-packages
- Distinctive: line 386
Documentation Testing: Test examples with real scenarios
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MakeCode Arcade Multi-Repository Workspace Instructions for GitHub Copilot
Workspace Overview
This is a multi-repository development workspace for the Microsoft MakeCode Arcade ecosystem. The workspace contains four linked repositories that work together to provide a complete block-based and TypeScript programming environment for creating retro-style arcade games.
General Development Guidelines
Code Quality Standards
- Follow TypeScript strict mode conventions
- Use semantic versioning for all packages
- Maintain backward compatibility when possible
- Write clear, self-documenting code with JSDoc comments
- Follow the existing code style and patterns in each component
Code Generation Standards
- Always include proper type annotations
- Use
exportstatements for public APIs - Prefer
constoverletwhere possible - Use arrow functions for callbacks and short functions
- Include error handling for async operations
Workspace Structure & Repository Responsibilities
Workspace Layout
workspace-root/
├── pxt/ # Core MakeCode framework (pxt-core)
├── pxt-common-packages/ # Shared cross-target APIs and game engine
└── pxt-arcade/ # Arcade target configuration and extensionsRepository-Specific Responsibilities
pxt/ (pxt-core)
Repository: https://github.com/microsoft/pxt
Local Path: ../pxt relative to pxt-arcade
Package Name: pxt-core
Changes should go here for:
- Core editor functionality (Monaco editor integration, block editor)
- Build system and compilation pipeline (
gulpfile.js,Makefile) - Package management and extension loading
- Core APIs and runtime
- Static TypeScript definitions in
libs/(e.g.,libs/base/,libs/core/) - Web app infrastructure (
webapp/,pxteditor/) - Language services and IntelliSense (
pxtcompiler/) - Import/export functionality
- Cloud services integration (
pxtservices/)
pxt-common-packages/
Repository: https://github.com/microsoft/pxt-common-packages
Local Path: ../pxt-common-packages relative to pxt-arcade
Package Name: pxt-common-packages
Changes should go here for:
- Cross-target game engine APIs (sprites, physics, input)
- Hardware abstraction layers
- Common blocks and TypeScript APIs in
libs/ - Shared simulator functionality in
sim/ - Device-specific implementations (
libs/core---*/)
pxt-arcade-sim (internal dependency)
Note: This is an internal Microsoft repository not accessible to external contributors. Changes that might require coordination:
- Complex simulator functionality changes
- Game rendering and display issues
- Input handling problems in simulator
- Audio/sound systems in simulator
For external contributors: If you encounter simulator-specific issues, please file them in this repository and maintainers will coordinate with the appropriate internal teams.
pxt-arcade/ (This Repository)
Repository: https://github.com/microsoft/pxt-arcade
Local Path: . (workspace root)
Package Name: pxt-arcade
Changes should go here for:
- Target configuration (
pxtarget.json,targetconfig.json) - Arcade-specific library extensions in
libs/ - Arcade-specific documentation (
docs/,docfiles/) - Editor customizations (
editor/) - Arcade themes and styling (
theme/) - Build and deployment scripts (
scripts/)
Code Change Guidelines
Changes that belong in THIS repository (pxt-arcade):
- Arcade-specific features
- Arcade-specific blocks or APIs in
libs/. These tend to be specifically extensions, or overrides from the common game library features found in pxt-common-packages - Target configuration changes in
pxtarget.jsonortargetconfig.jsonpxtarget.jsonis the main target configuration file that defines the capabilities and features of the Arcade target. This is part of a released version of the application.targetconfig.jsonis served live and may include changes that occur between releases
- Arcade hardware support
- Documentation specific to Arcade in
docs/anddocfiles/
- Arcade-specific blocks or APIs in
- Arcade target configuration
- Build configurations specific to arcade
- Theme and styling changes in
theme/ - Arcade-specific editor extensions in
editor/
Changes that should go to pxt-core:
- Core functionality
- Block editor improvements
- Monaco/TypeScript editor changes
- Build system modifications
- Package management features
- Cloud/sharing functionality
- Language service improvements
- Static TypeScript definitions
- Core language APIs in
libs/base/,libs/core/ - Fundamental data types and primitives
- Basic runtime functionality
- Cross-target foundational APIs
- Core language APIs in
Changes that should go to pxt-common-packages:
- Cross-target APIs
- Sprite system improvements
- Physics engine changes
- Game loop modifications
- Input handling that affects multiple targets
- Hardware abstraction layers
Development Workflow & Dependencies
Repository Dependencies
The repositories have the following dependency chain:
pxt-arcade depends on:
├── pxt-core (linked via npm link)
├── pxt-common-packages (linked via npm link)
└── pxt-arcade-sim (internal dependency)
pxt-common-packages depends on:
└── pxt-core (linked via npm link)Setting up the development environment:
First-time setup (Windows):
# From pxt-arcade directory
setup.cmd /firsttimeManual setup steps:
# 1. Build pxt-core
cd ../pxt
npm install
npm run build
# 2. Setup pxt-common-packages
cd ../pxt-common-packages
npm install
npm link ../pxt
# 3. Setup pxt-arcade and link everything
cd ../pxt-arcade
npm install
npm link ../pxt
npm link ../pxt-common-packagesDaily development workflow:
# Start the development server with file watching
cd ../pxt && gulp watch & # Watches pxt-core changes
cd ../pxt-arcade && npm run serve # Starts the arcade development serverKey development commands:
npm run serve: Start the arcade development serversetup.cmd /pull: Pull latest changes from all repositoriessetup.cmd /link: Re-link all repositories
Important Workspace Context
Issue Triage and Repository Assignment
When assigned an issue, first determine which repository the changes should go to:
- UI/Editor issues: Usually pxt-core (
pxt/) - Game engine/API issues: Usually pxt-common-packages
- Arcade-specific features: Usually pxt-arcade
- Simulator display/input issues: May require coordination with internal teams
Project Structure and Key Files
Understanding where different types of functionality lives:
Configuration Files:
pxtarget.json(pxt-arcade): Main target configuration - released versiontargetconfig.json(pxt-arcade): Live configuration served between releasespackage.jsonfiles: Dependencies and build scripts in each repopxt.jsonfiles: Library/package definitions throughoutlibs/directories
Core Development Patterns:
- Library Structure: Each
libs/directory contains apxt.jsonfile defining the library - Block Definitions: TypeScript files with
//% blockannotations for Blockly integration - API Documentation: Comments with
//% helpannotations for IntelliSense - Cross-repo APIs: Changes affecting multiple targets should go in pxt-common-packages
Multi-Repository File Locations:
When editing files, be aware of which repository they belong to:
Core Framework Files (pxt/):
gulpfile.js,Makefile- Build systemwebapp/,pxteditor/- Web app infrastructurepxtcompiler/- Language serviceslibs/base/,libs/core/- Static TypeScript definitions
Cross-Target Game Engine (pxt-common-packages/):
libs/- Cross-target APIs (sprites, physics, controller)sim/- Shared simulator functionality
Arcade Target (pxt-arcade/):
pxtarget.json,targetconfig.json- Target configurationlibs/- Arcade-specific extensionsdocs/,docfiles/- Arcade documentationeditor/- Editor customizationstheme/- Arcade-specific styling
Key Workspace Files:
arcade.code-workspace: VSCode workspace configurationsetup.cmd: Windows development environment setup script
Coding Patterns and Best Practices
Block and API Development:
- Adding new APIs:
- Place TypeScript APIs in appropriate
libs/directory - Use
//% block="..."annotations for Blockly integration - Add
//% help="..."for documentation links - Include JSDoc comments for IntelliSense
- Update
pxt.jsonto include new files
- Place TypeScript APIs in appropriate
- Block Annotation Best Practices:
- Variable Format: Use
$format instead of deprecated%format for variables- ✅ Preferred:
//% block="my $sprite" - ❌ Deprecated:
//% block="my %sprite=variables_get"
- ✅ Preferred:
- Shadow Values: Configure shadow values separately for better localization
- ✅ Preferred:
//% block="my $sprite" //% sprite.shadow="variables_get" - ❌ Avoid:
//% block="my $sprite=variables_get"
- ✅ Preferred:
- Localization: Separating shadow configuration from block text makes translation easier
- Variable Format: Use
- Cross-Repository Dependencies:
- Core APIs go in pxt-core
libs/ - Cross-target game APIs go in pxt-common-packages
libs/ - Target-specific extensions go in pxt-arcade
libs/ - Avoid circular dependencies between repositories
- Core APIs go in pxt-core
- API Design Principles:
- Keep APIs simple and discoverable
- Use consistent naming patterns
- Provide good default values
- Consider both block and text programming users
- Follow TypeScript best practices
Documentation Standards:
- API Documentation: Use JSDoc comments and
//% helpannotations - Tutorial Content: Place in
docs/with proper markdown formatting - Code Examples: Include practical, tested examples
- Screenshots: Use for UI changes and place in
docs/static/ - Breaking Changes: Document breaking changes clearly in commit messages
- README Updates: Update relevant README files when adding features
- Inline Documentation: Include inline documentation for complex algorithms
- API Examples: Provide examples for new API functions
Build and Deployment Considerations:
- Target Configuration: Changes to
pxtarget.jsonrequire full rebuild - Live Configuration:
targetconfig.jsonchanges are served immediately - Breaking Changes: Coordinate across repositories for API changes
- Backwards Compatibility: Maintain compatibility with existing projects
Common Development Workflows:
- Adding new blocks/APIs:
- Determine correct repository (see guidelines above)
- Add TypeScript implementation with proper annotations
- Test in local development server
- Add documentation and examples
- Update relevant configuration files
- Fixing bugs:
- Reproduce the issue locally
- Identify root cause and affected repositories
- Implement fix with minimal impact
- Test across browsers and devices
- Verify no regressions in existing functionality
- UI/Editor changes:
- Most likely in pxt-core repository
- Test in multiple browsers
- Consider mobile and accessibility
- Check theme compatibility (light/dark modes)
- Verify localization compatibility
Common Issues and Troubleshooting
Development Environment Issues:
- Build failures: Usually caused by missing dependencies or incorrect linking
- Run
setup.cmd /linkto re-establish repository links - Check that all repositories are on compatible versions
- Ensure npm dependencies are installed in all repos
- Run
- Editor not loading:
- Check browser console for errors
- Verify
npm run serveis running from pxt-arcade - Ensure
gulp watchis running from pxt-core for live changes
- Simulator issues:
- Most simulator problems require internal team coordination
- File issues in pxt-arcade repository with detailed reproduction steps
- Include browser version and console errors
API and Library Issues:
- Missing APIs: Check if API should be in pxt-common-packages vs pxt-arcade
- Block not appearing: Verify
pxt.jsonincludes the TypeScript file - IntelliSense problems: Check JSDoc comments and
//% helpannotations - Cross-target compatibility: Test changes don't break other MakeCode targets
Build and Configuration Issues:
- Target configuration: Changes to
pxtarget.jsonrequire restart of development server - Package loading: Check
pxt.jsonfiles for correct file references - TypeScript errors: Ensure all dependencies are properly linked via npm link
Browser Compatibility:
- Chrome: Primary development browser, most features work
- Firefox: Good compatibility, test major features
- Safari: iOS compatibility important for mobile users
- Edge: Windows compatibility, especially for offline scenarios
Common Error Patterns:
- Module not found: Usually indicates missing npm link or incorrect file paths
- TypeScript compilation errors: Check for missing type definitions or circular dependencies
- Runtime errors in simulator: Often related to API usage or missing implementations
- Performance issues: Check for memory leaks in game loops or inefficient rendering
Current Branch and Repository Context
Branch Management:
- Current branch:
dev/jwunderl/port-offline-page-update(pxt repository) - Main branches:
masterfor releases, various dev branches for features - Cross-repo coordination: Changes affecting multiple repos may require synchronized PRs
Repository Status:
- pxt: Core framework - changes here affect all MakeCode targets
- pxt-common-packages: Cross-target APIs - changes affect Arcade and other targets
- pxt-arcade: Arcade-specific target - most localized changes
- pxt-arcade-sim: Internal simulator - coordinate with maintainers
Development Workflow Notes:
- Always test across repositories when making changes to pxt-core or pxt-common-packages
- Consider backwards compatibility when modifying existing APIs
- Document breaking changes clearly in PR descriptions
- Use semantic versioning principles for API changes
Technical Considerations
Performance Guidelines:
- Game performance in simulator and on devices
- Editor responsiveness with large projects
- Memory usage in arcade games
- Build time optimization
- Bundle size considerations
Compatibility Requirements:
- Cross-browser support (Chrome, Firefox, Safari, Edge)
- Mobile device compatibility
- Hardware device compatibility
- Backward compatibility with existing projects
Security Guidelines:
- Follow Microsoft security policies
- Validate user-generated content
- Secure handling of shared projects
- Privacy considerations for educational use
Testing Requirements
Testing Standards:
- Unit Tests: Write unit tests for new functionality
- UI Testing: Include accessibility tests for UI components
- Simulator Testing: Test simulator features across different browsers
- Compilation Testing: Validate TypeScript compilation without errors
- Cross-Target Testing: Ensure changes don't break other MakeCode targets
- Cross-Repository Testing: Test compatibility when making changes to pxt-core or pxt-common-packages
- Documentation Testing: Test examples with real scenarios
- Hardware Testing: Validate on actual hardware devices when applicable
Code Review Guidelines
What to look for in PRs:
- Correctness: Does the code solve the intended problem?
- Performance: Are there any performance implications?
- Compatibility: Does it work across all supported platforms?
- Documentation: Is the feature properly documented?
- Testing: Has the change been adequately tested?
- Code style: Does it follow existing patterns and conventions?
Common Issues to Watch For:
- Breaking changes to existing APIs
- Performance regressions in games or editor
- Missing or incorrect documentation
- Inadequate error handling
- Security vulnerabilities
- Accessibility issues
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

