refactor
Refactor a Retrograde procedural generation pass using established patterns and checklist
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Refactor a Retrograde procedural generation pass using established patterns and checklist
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Investigate a Starfield form or record type to understand its structure
Stages all current changes and commits them to git with a useful message derived from the diff. Run with /commit.
Reviews recent git work across 3–7 days and proposes exactly 5 targeted improvements to code elegance, coherence, and style alignment. Run with /elegance at the start or end of a session to keep the codebase healthy.
Picks a random file from Retrograde.Library and runs a focused elegance review against it and its related files, proposing exactly 5 targeted improvements. Run with /spotlight for a quick quality check on undervisited code.
End-of-session workflow improvement. Reviews what was learnt and makes small, targeted updates to scripts, formlib, designlib, CLAUDE.md, and memory. Run with /kaizen at the end of a working session.
Discover what decoration items Starfield places around a given PackIn or Static in existing worldspaces, then generate C# array entries ready to paste into a BuildingDecoratorPass. Use when the user asks to find decorations for a science counter, workbench, or any other Starfield furniture PackIn.
| name | refactor |
| description | Refactor a Retrograde procedural generation pass using established patterns and checklist |
When the user asks you to refactor a file (typically a procedural generation pass), follow this guide systematically. Apply patterns incrementally and verify the build after each step.
const for true constants, readonly for instance valuesMaxCandidatePrefabsPerConnector over maxTriesEvaluatePrefabRotations not ProcessRotationsPlacementContext describes its purposeConnectorUtils.cs - Connector manipulation, rotation, compatibilityConnectorSelectionUtil.cs - Connector selection strategiesMathUtil.cs - Math operationsScoringUtil.cs - Plan scoringBridgeUtil.cs - Bridge logicRoomUtils.cs - Room prefab selectionPlacementUtil.cs - Placement operationsRetrogradeUtils.cs - General utilitiesBundle 5+ related parameters into a context class:
private class PlacementContext
{
public List<PlacedRoom> PlannedRooms { get; set; }
public P3Float ClusterCenter { get; set; }
// ... related state
}
// 14 params -> 2 params
private static Result? TryPlace(OpenConnector target, PlacementContext context)
// Stage 1: Multi-plan generation
// Stage 2: Iterative room placement loop
// Stage 2a: Select next connector
// Stage 2b: Find best room
// Stage 2c: Apply placement
// Stage 3: Evaluate plan
// Stage 4: Apply best plan
Return structured results instead of out parameters:
private class BossPlacementResult
{
public RoomPrefab Prefab { get; set; }
public int Rotation { get; set; }
public P3Float Position { get; set; }
}
BossPlacementResult result object to replace out parametersTryPlaceBossRoomAtConnector methodconst with PascalCase naming, grouped by categoryBridgePlacementContext to bundle 11 parameters (planned rooms, connectors, placements, used prefab IDs, room utils, district info, yMin) into a single context passed through the placement pipelineBridgePlacementResult replacing 3 out parameters with a structured return typeTryPlaceBridgeBetween (4-level nesting) into EvaluatePrefabRotation and BuildBridgePlacementResult; extracted IsValidBridgePair and AcceptBridgePlacement from PlanBridgesPlanBridges 11 params → 1 (context); TryPlaceBridgeBetween 13 params (10 in + 3 out) → 3 params returning a result objectpositionTolerance and startPosTolerance to class-level const fields; removed tolerance parameters from all helper methodsSealUnconnectedPlacedMarkers (~90 lines, 3 stages) into CollectPlacedConnectors, FindMatchedConnectors, and AreConnectorsMated; extracted TrySealConnector to encapsulate the strict→relaxed blocker placement patternif (!placed) block with placeholder commentSealUnconnectedPlacedMarkers reads as three high-level stages; helper signatures simplified by removing repeated tolerance parameters