// نصب مهارت
نصب مهارت
مهارتها کدهای شخص ثالث از مخازن عمومی GitHub هستند. SkillHub الگوهای مخرب شناختهشده را اسکن میکند اما نمیتواند امنیت را تضمین کند. قبل از نصب، کد منبع را بررسی کنید.
نصب سراسری (سطح کاربر):
npx skillhub install Blackhorse311/BotMind/bepinexنصب در پروژه فعلی:
npx skillhub install Blackhorse311/BotMind/bepinex --projectبرای Hermes یا runtimeهای دیگر استفاده کنید. مهارت در مسیر <directory>/<skill-name>/ نوشته میشود.
npx skillhub install Blackhorse311/BotMind/bepinex --target-dir /path/to/skillsمسیر پیشنهادی: ~/.claude/skills/bepinex/
محتوای SKILL.md
---
name: bepinex
description: |
Develops BepInEx plugins with hooks, patches, and mod initialization for Unity games.
Use when: Creating BepInEx plugins, setting up plugin entry points, configuring mod settings, or integrating with Harmony patches.
allowed-tools: Read, Edit, Write, Glob, Grep, Bash
---
# BepInEx Skill
BepInEx is the plugin framework for Unity game modding. This project uses BepInEx 5.x with .NET Standard 2.1 for SPT (Single Player Tarkov) modding. Plugins are loaded via `[BepInPlugin]` attributes and use `ConfigFile` for settings. All patches use **Harmony** (see the **harmony** skill).
## Quick Start
### Plugin Entry Point
```csharp
[BepInPlugin("com.blackhorse311.botmind", "BotMind", "1.0.0")]
[BepInDependency("xyz.drakia.bigbrain", BepInDependency.DependencyFlags.HardDependency)]
[BepInDependency("me.sol.sain", BepInDependency.DependencyFlags.SoftDependency)]
public class BotMindPlugin : BaseUnityPlugin
{
public static ManualLogSource Log { get; private set; }
private void Awake()
{
Log = Logger;
Log.LogInfo("BotMind is loading...");
// Initialize configuration
BotMindConfig.Initialize(Config);
// Apply Harmony patches
new Harmony("com.blackhorse311.botmind").PatchAll();
Log.LogInfo("BotMind loaded successfully!");
}
}
```
### Configuration Binding
```csharp
public static class BotMindConfig
{
public static ConfigEntry<bool> EnableLooting { get; private set; }
public static ConfigEntry<float> SearchRadius { get; private set; }
public static void Initialize(ConfigFile config)
{
EnableLooting = config.Bind(
"General", // Section
"Enable Looting", // Key
true, // Default
"Enable bot looting behavior" // Description
);
SearchRadius = config.Bind(
"Looting",
"Search Radius",
50f,
new ConfigDescription(
"Loot search distance in meters",
new AcceptableValueRange<float>(10f, 200f)
)
);
}
}
```
## Key Concepts
| Concept | Usage | Example |
|---------|-------|---------|
| Plugin GUID | Unique identifier | `"com.author.modname"` |
| Hard dependency | Required mod | `DependencyFlags.HardDependency` |
| Soft dependency | Optional mod | `DependencyFlags.SoftDependency` |
| ConfigEntry | Runtime setting | `config.Bind("Section", "Key", default)` |
| ManualLogSource | Logging | `Logger.LogInfo("message")` |
## Common Patterns
### Soft Dependency Check
**When:** Integrating with optional mods like SAIN
```csharp
private static bool _sainChecked;
private static bool _sainAvailable;
public static bool IsSAINAvailable()
{
if (!_sainChecked)
{
_sainAvailable = Chainloader.PluginInfos.ContainsKey("me.sol.sain");
_sainChecked = true;
}
return _sainAvailable;
}
```
### Lifecycle Hooks
**When:** Responding to game events
```csharp
private void Awake() // Plugin load - register patches, config
private void Start() // After all plugins loaded
private void OnEnable() // Plugin enabled
private void OnDisable() // Plugin disabled
private void OnDestroy() // Cleanup resources
```
## See Also
- [patterns](references/patterns.md) - Plugin structure, config, logging
- [workflows](references/workflows.md) - Build, deploy, debug
## Related Skills
- **harmony** - Patching game methods
- **csharp** - Language patterns
- **unity** - MonoBehaviour lifecycle
- **dotnet** - Build and project configurationمجوز
مجوز اعلامشده: MIT
MIT License
Copyright (c) 2026 Blackhorse311
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 Blackhorse311/BotMind/bepinexنصب در پروژه فعلی:
npx skillhub install Blackhorse311/BotMind/bepinex --projectبرای Hermes یا runtimeهای دیگر استفاده کنید. مهارت در مسیر <directory>/<skill-name>/ نوشته میشود.
npx skillhub install Blackhorse311/BotMind/bepinex --target-dir /path/to/skillsمسیر پیشنهادی: ~/.claude/skills/bepinex/