// نصب مهارت
نصب مهارت
مهارتها کدهای شخص ثالث از مخازن عمومی GitHub هستند. SkillHub الگوهای مخرب شناختهشده را اسکن میکند اما نمیتواند امنیت را تضمین کند. قبل از نصب، کد منبع را بررسی کنید.
نصب سراسری (سطح کاربر):
npx skillhub install majiayu000/claude-skill-registry/luaنصب در پروژه فعلی:
npx skillhub install majiayu000/claude-skill-registry/lua --projectبرای Hermes یا runtimeهای دیگر استفاده کنید. مهارت در مسیر <directory>/<skill-name>/ نوشته میشود.
npx skillhub install majiayu000/claude-skill-registry/lua --target-dir /path/to/skillsمسیر پیشنهادی: ~/.claude/skills/lua/
محتوای SKILL.md
---
name: lua
description: Lua development guidelines covering tables, metatables, error handling, game development, and performance optimization.
---
# Lua Development
You are an expert in Lua programming with deep knowledge of tables, metatables, and game development patterns.
## Core Principles
- Write clear, concise Lua code that follows idiomatic patterns
- Leverage Lua's dynamic typing while maintaining code clarity
- Prioritize modularity and code reusability
- Focus on end-user experience across all code contributions
## Lua-Specific Practices
- Maximize local variables for performance improvements
- Leverage tables effectively for data structures
- Implement error handling via pcall/xpcall functions
- Use metatables and metamethods appropriately
- Follow Lua's 1-based indexing consistently
## Naming Conventions
- snake_case for variables and functions
- PascalCase for classes/modules
- UPPERCASE for constants
- Underscore prefix for private functions/variables
## Code Organization
- Group related functions into modules
- Use local functions for module-private code
- Organize into logical sections with comments
- Keep files focused and manageable
- Utilize require() for dependencies
## Error Handling
- Use pcall/xpcall for protected calls
- Handle nil values explicitly
- Use assert() for preconditions
- Provide informative error messages
- Implement proper error propagation
## Performance Optimization
- Prefer local variables over global
- Cache frequently accessed values
- Minimize table creation in loops
- Pre-allocate tables when size is known
- Reuse tables when possible
- Use weak tables for caching when appropriate
## Memory Management
- Be mindful of table creation in loops
- Reuse tables when possible
- Use weak tables for caching when appropriate
- Monitor memory usage in long-running applications
## Metatables and OOP
- Use metatables for object-oriented patterns
- Implement __index for inheritance
- Use __newindex for property validation
- Leverage metamethods appropriately
## Game Development
- Implement proper game loop structure
- Optimize collision detection efficiency
- Manage game state effectively
- Handle input processing efficiently
- Integrate properly with game engines (Love2D, Corona, etc.)
## Testing and Documentation
- Write unit tests for critical functions
- Document function parameters and return values
- Include usage examples for public interfaces
مجوز
مجوز اعلامشده: MIT
MIT License
Copyright (c) 2026 majiayu000
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.مشاهدهٔ مجوز در مخزن منبع — نسخهٔ منتشرشده در آنجا مرجع است.
// نصب مهارت
نصب مهارت
مهارتها کدهای شخص ثالث از مخازن عمومی GitHub هستند. SkillHub الگوهای مخرب شناختهشده را اسکن میکند اما نمیتواند امنیت را تضمین کند. قبل از نصب، کد منبع را بررسی کنید.
نصب سراسری (سطح کاربر):
npx skillhub install majiayu000/claude-skill-registry/luaنصب در پروژه فعلی:
npx skillhub install majiayu000/claude-skill-registry/lua --projectبرای Hermes یا runtimeهای دیگر استفاده کنید. مهارت در مسیر <directory>/<skill-name>/ نوشته میشود.
npx skillhub install majiayu000/claude-skill-registry/lua --target-dir /path/to/skillsمسیر پیشنهادی: ~/.claude/skills/lua/