Bump to CounterStrikeSharp 1.0.371 and .NET 10, replace per-tick light spawns with a parented light_barn, add plugin config, real unit tests, and refresh CI plus docs. Co-authored-by: Cursor <cursoragent@cursor.com>
2.5 KiB
Flashlight Modernization Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Modernize the flashlight plugin to .NET 10 / CSS 1.0.371 with a parented light_barn implementation, config, real unit tests, fixed CI, and updated README.
Architecture: Pure helpers in FlashlightLogic + config clamps in FlashlightConfig; plugin owns lifecycle and wires Use/command/events; one CBarnLight per active player, parented once, toggled via create/destroy.
Tech Stack: .NET 10, CounterStrikeSharp.API 1.0.371, xUnit, GitHub Actions
Global Constraints
- Target framework:
net10.0 - Package:
CounterStrikeSharp.API1.0.371 [MinimumApiVersion(371)]- Module version:
0.1.0 - No per-tick entity create/spawn/teleport in steady state
- Spec:
docs/superpowers/specs/2026-07-21-flashlight-modernization-design.md
Task 1: Project targets + pure logic + tests
Files:
-
Modify:
Flashlight/Flashlight.csproj -
Modify:
Flashlight.Tests/Flashlight.Tests.csproj -
Create:
Flashlight/FlashlightConfig.cs -
Create:
Flashlight/FlashlightLogic.cs -
Create:
Flashlight/PlayerFlashlightState.cs -
Modify:
Flashlight.Tests/FlashlightLogicTests.cs -
Retarget both projects to
net10.0; bump CSS to1.0.371; bump test packages as needed -
Implement
FlashlightConfigwith defaults from the spec and aClamp()method -
Implement pure
FlashlightLogichelpers: try-toggle with cooldown, eye Z offset, origin from base+forward -
Replace smoke tests with tests against those helpers
-
Run
dotnet testand confirm pass
Task 2: Plugin rewrite (parented light_barn)
Files:
-
Modify:
Flashlight/Flashlight.cs -
Delete or gut:
Flashlight/LogHelper.cs(preferLogger) -
Implement
BasePlugin, IPluginConfig<FlashlightConfig> -
OnTick: Use-key edge + cooldown only when
AllowUseKey -
Create/parent/enable
light_barnonce on toggle on; remove on toggle off -
Cleanup on death/spawn/team/disconnect/unload
-
Keep
css_fl_toggle -
Run
dotnet buildand confirm success
Task 3: CI + README
Files:
-
Modify:
.github/workflows/build.yml -
Modify:
README.md -
CI: .NET 10, restore, test, release build
-
README: versions, parented light, config table, build/test, changelog 0.1.0
-
Run
dotnet testonce more