Move project into content/; add description param

This commit is contained in:
2026-08-27 02:09:55 +02:00
parent ea7d7d3b6b
commit dd6325f2a1
8 changed files with 187 additions and 107 deletions
+63
View File
@@ -0,0 +1,63 @@
# CLAUDE.md
This is an SCP: Secret Laboratory LabAPI plugin, generated from the
`labapi-plugin` `dotnet new` template. `EntryPoint.cs` is the plugin's entry
point (`Plugin<Config>`); `Config.cs` is its YAML-backed settings class.
## LabAPI contract (verified against northwood-studios/LabAPI source, not guessed)
`Plugin<TConfig>` (`LabApi.Loader.Features.Plugins`) requires implementing:
`Name`, `Description`, `Author`, `RequiredApiVersion` (all abstract get-only) plus
`Enable()`/`Disable()`. Overridable but optional: `Version` (defaults to the
assembly's version), `Priority` (`LoadPriority`, defaults to `Medium`),
`ConfigFileName` (defaults to `"config.yml"`). `Config` is a plain `class` with a
public parameterless constructor and public get/set properties — the base class
(de)serializes it via YamlDotNet automatically; don't hand-roll config I/O.
**Never invent a LabAPI class/namespace/method/property/attribute.** Before using one
you haven't already seen in this project, check the restored package (`LabApi.dll` +
`LabApi.xml` under `%userprofile%\.nuget\packages\northwood.labapi\<version>\lib\net48\`)
or https://github.com/northwood-studios/LabAPI. If you can't verify a member exists,
say so instead of guessing.
## Toolchain choices — don't "fix" these without being asked
- `TargetFramework` is `netstandard2.1` on purpose, even though LabAPI's own docs and
the `Northwood.LabAPI` NuGet package only target `net48`/`net481`. This is a
deliberate compatibility choice (compiled output still loads under the game's
Mono/.NET Framework 4.8 host) that trades away some netstandard2.1 BCL/language
surface .NET Framework can't actually run (e.g. default interface members). Don't
switch it to `net48`, don't add multi-targeting, unless asked.
- `LangVersion` is pinned explicitly in the `.csproj` — don't let it drift to `latest`.
- The `.csproj` suppresses exactly two warnings, both scoped as narrowly as MSBuild
allows, because of the netstandard2.1/net48-only-package combination above:
`NU1701` (via a per-`PackageReference` `<NoWarn>`, not a project-wide one) and
`MSB3270` (via `ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch=None`). Don't
broaden either into a blanket suppression and don't remove them without
understanding why (both are explained here, not in the `.csproj` — this project's
code style forbids comments, including in the `.csproj`, see "Code style" below).
- `Northwood.LabAPI` uses a floating `Version="*"` on purpose, so every
`dotnet restore` pulls whatever is latest on NuGet at that moment. This is
intentionally **not** wired to `EntryPoint.cs`'s `RequiredApiVersion`, which is a
separate, manually-maintained literal for the minimum LabAPI version this code is
known to work with — bump it by hand if you verify compatibility with a newer
release, don't try to auto-sync it with the floating restore.
## Code style
- No `//`, `/* */`, `///`, or XML (`<!-- -->`) comments unless explicitly asked for.
No comments restating self-explanatory code.
- All text embedded in code defaults to **English**: string/log/console messages,
exception messages, `[Description]`/config text, any user-facing string.
- This never applies to identifiers picked deliberately (project name, namespace,
class/method/property/variable names) — keep those as requested.
## How to verify a change
There is no test project scaffolded. Verify with:
```bash
dotnet build
```
Expect `Build succeeded. 0 Warning(s) 0 Error(s)`.
+10
View File
@@ -0,0 +1,10 @@
using System.ComponentModel;
namespace LabApiPluginTemplate
{
public class Config
{
[Description("Whether the plugin is enabled.")]
public bool IsEnabled { get; set; } = true;
}
}
+27
View File
@@ -0,0 +1,27 @@
using System;
using LabApi.Features.Console;
using LabApi.Loader.Features.Plugins;
namespace LabApiPluginTemplate
{
public class EntryPoint : Plugin<Config>
{
public override string Name => "LabApiPluginTemplate";
public override string Description => "TODO: describe what this plugin does.";
public override string Author => "YourName";
public override Version RequiredApiVersion { get; } = new Version("1.1.7");
public override void Enable()
{
Logger.Info($"{Name} has been enabled.");
}
public override void Disable()
{
Logger.Info($"{Name} has been disabled.");
}
}
}
+22
View File
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>14.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<RootNamespace>LabApiPluginTemplate</RootNamespace>
<AssemblyName>LabApiPluginTemplate</AssemblyName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<NoWarn>$(NoWarn);NU1701</NoWarn>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="*">
<NoWarn>NU1701</NoWarn>
</PackageReference>
</ItemGroup>
</Project>