Skip to content

Commit 71cb9a1

Browse files
author
DavidQ
committed
Adds template-based game creation scripting with tool scaffolding and enforces updated script location and commit format.
BUILD_PR_LEVEL_09_19_TEMPLATE_GAME_CREATION_SCRIPTING
1 parent 5e4be9c commit 71cb9a1

17 files changed

Lines changed: 368 additions & 139 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 12 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,13 @@
1-
# MODEL
2-
GPT-5.4
31

4-
# REASONING
5-
high
6-
7-
# COMMAND
8-
Create BUILD_PR_LEVEL_09_18_CODEX_PLAN_SWITCH_AND_API_KEY_SCRIPTING as a docs-first, surgical PR for `HTML-JavaScript-Gaming`.
9-
10-
## Mission
11-
Add a small PowerShell-based repo automation slice that:
12-
- switches between Pay-as-you-go and Codex plan modes
13-
- inputs/updates API key configuration
14-
- validates the configured API key state safely
15-
16-
## Required scope
17-
- add PowerShell scripts for plan switching
18-
- add PowerShell scripts for API key input/update
19-
- add PowerShell scripts for API key validation
20-
- keep the scripts local-repo/operator focused
21-
- document usage and guardrails
22-
- add focused validation or smoke checks where practical
23-
24-
## Preferred implementation style
25-
- PowerShell first
26-
- obvious operator-facing script names
27-
- outputs/helper artifacts routed to the project folder when applicable
28-
- keep scripts lightweight, deterministic, and easy to inspect
29-
30-
## Hard rules
31-
- do not change engine code
32-
- do not add gameplay/runtime features
33-
- do not redesign tools
34-
- do not expand into broad deployment automation in this PR
35-
- do not implement the website prep/update/delete scripts in this PR
36-
- do not implement the game-template asset conversion scripts in this PR
37-
- keep this PR surgical and purpose-specific
38-
39-
## Roadmap instruction
40-
Update roadmap status where this PR clearly advances tracked work.
41-
42-
Also add these new roadmap items as explicitly requested:
43-
1. Existing games asset folders should be updated so existing images / vectors / related runtime assets can be transformed into tool-editable `data/` objects, with corresponding project JSON updates.
44-
2. Add the ability for a PowerShell script to create a new game from template, including a project scaffold for the tools.
45-
3. Add scripts to prep / update / delete the repo so it can be placed on a website.
46-
4. Add scripts to switch between Pay-as-you-go and Codex plan modes, and scripts to input API key material and validate it.
47-
48-
These roadmap additions are allowed text additions for this PR.
49-
50-
## Deliverables
51-
Return a single repo-structured ZIP at:
52-
`<project folder>/tmp/BUILD_PR_LEVEL_09_18_CODEX_PLAN_SWITCH_AND_API_KEY_SCRIPTING.zip`
53-
54-
Include:
55-
- docs/pr/BUILD_PR_LEVEL_09_18_CODEX_PLAN_SWITCH_AND_API_KEY_SCRIPTING.md
56-
- docs/dev/codex_commands.md
57-
- docs/dev/commit_comment.txt
58-
- docs/dev/next_command.txt
59-
- docs/dev/reports/change_summary.txt
60-
- docs/dev/reports/validation_checklist.txt
61-
62-
## Validation
63-
Run focused checks only:
64-
- PowerShell parse/readiness checks on touched scripts
65-
- focused smoke checks for plan switching logic
66-
- focused smoke checks for API key input/update path
67-
- focused smoke checks for API key validation path
68-
69-
## Success definition
70-
- repo has clear scripts for plan switching
71-
- repo has clear scripts for API key input/update
72-
- repo has clear scripts for API key validation
73-
- roadmap includes the requested new items
74-
- final output is one ZIP in `<project folder>/tmp/`
2+
MODEL: GPT-5.4
3+
REASONING: high
4+
5+
COMMAND:
6+
- use scripts/PS/codex/ as the base path for all codex scripts
7+
- implement template game creation script
8+
- include tool project scaffolding
9+
- enforce asset/data folder structure
10+
- reverse commit comment format:
11+
description first
12+
PR name last
13+
- update roadmap status only (no text changes except previously approved additions)

docs/dev/CODEX_PLAN_AND_API_KEY_SCRIPTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Codex Plan And API Key Scripting
22

3-
This repo includes a focused operator scripting surface in `scripts/PS` for:
3+
This repo includes a focused operator scripting surface in `scripts/PS/codex` for:
44
- switching active Codex billing/plan workflow mode
55
- setting/updating local API key configuration
66
- validating API key readiness safely
77

88
## Scripts
9-
- `scripts/PS/Switch-CodexPlanMode.ps1`
10-
- `scripts/PS/Set-CodexApiKey.ps1`
11-
- `scripts/PS/Validate-CodexApiKey.ps1`
12-
- `scripts/PS/Get-CodexOperatorState.ps1`
9+
- `scripts/PS/codex/Switch-CodexPlanMode.ps1`
10+
- `scripts/PS/codex/Set-CodexApiKey.ps1`
11+
- `scripts/PS/codex/Validate-CodexApiKey.ps1`
12+
- `scripts/PS/codex/Get-CodexOperatorState.ps1`
1313

1414
## State File
1515
- Default state file: `.codex/local/codex-operator-state.json`
@@ -20,37 +20,37 @@ This repo includes a focused operator scripting surface in `scripts/PS` for:
2020
Switch to Pay-as-you-go mode:
2121

2222
```powershell
23-
.\scripts\PS\Switch-CodexPlanMode.ps1 -Mode payg
23+
.\scripts\PS\codex\Switch-CodexPlanMode.ps1 -Mode payg
2424
```
2525

2626
Switch to Codex mode:
2727

2828
```powershell
29-
.\scripts\PS\Switch-CodexPlanMode.ps1 -Mode codex
29+
.\scripts\PS\codex\Switch-CodexPlanMode.ps1 -Mode codex
3030
```
3131

3232
Set or update API key for current process only (safe for smoke checks):
3333

3434
```powershell
35-
.\scripts\PS\Set-CodexApiKey.ps1 -ApiKey "sk-your-key" -Scope Process
35+
.\scripts\PS\codex\Set-CodexApiKey.ps1 -ApiKey "sk-your-key" -Scope Process
3636
```
3737

3838
Set or update API key for current user profile:
3939

4040
```powershell
41-
.\scripts\PS\Set-CodexApiKey.ps1 -Scope User
41+
.\scripts\PS\codex\Set-CodexApiKey.ps1 -Scope User
4242
```
4343

4444
Validate configured key state:
4545

4646
```powershell
47-
.\scripts\PS\Validate-CodexApiKey.ps1 -EnvVarName OPENAI_API_KEY -RequireStateRecord
47+
.\scripts\PS\codex\Validate-CodexApiKey.ps1 -EnvVarName OPENAI_API_KEY -RequireStateRecord
4848
```
4949

5050
Inspect current mode + metadata:
5151

5252
```powershell
53-
.\scripts\PS\Get-CodexOperatorState.ps1
53+
.\scripts\PS\codex\Get-CodexOperatorState.ps1
5454
```
5555

5656
## Guardrails
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Codex Template Game Creation Scripting
2+
3+
Use `scripts/PS/codex/New-CodexTemplateGame.ps1` to create a new game scaffold from `games/_template` with the standardized asset/data and tool-project contract.
4+
5+
## Script
6+
- `scripts/PS/codex/New-CodexTemplateGame.ps1`
7+
8+
## Example
9+
```powershell
10+
.\scripts\PS\codex\New-CodexTemplateGame.ps1 -GameId "my-new-game" -DisplayName "My New Game"
11+
```
12+
13+
## Generated Structure
14+
- `games/<game>/` copied from `games/_template/`
15+
- `games/<game>/assets/<domain>/` and `games/<game>/assets/<domain>/data/` for:
16+
- `sprites`
17+
- `tilemaps`
18+
- `parallax`
19+
- `vectors`
20+
- `games/<game>/assets/<game>.assets.json` (manifest scaffold)
21+
- `games/<game>/config/<game>.project.json` (tool project scaffold)
22+
23+
## Guardrails
24+
- Script normalizes `-GameId` to slug format for deterministic paths.
25+
- Script fails if the target game folder already exists.
26+
- Script writes empty scaffold metadata only; no engine or gameplay files are altered.

docs/dev/COMMIT_COMMENT.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
BUILD_PR_LEVEL_09_18_CODEX_PLAN_SWITCH_AND_API_KEY_SCRIPTING
21

3-
Adds a focused PowerShell operator automation slice with repo-local plan mode switching, API key input/update, and API key validation scripts (`scripts/PS/*Codex*.ps1`). Includes usage/guardrails documentation and roadmap updates with the four requested scripting/asset-conversion items.
2+
Adds `scripts/PS/codex/New-CodexTemplateGame.ps1` to create new games from `games/_template`, scaffold tool project metadata, and enforce runtime/domain + tool-data folder structure under `games/<game>/assets/<domain>/data/`. Keeps codex scripts under `scripts/PS/codex/` and applies roadmap status-only updates.
3+
4+
BUILD_PR_LEVEL_09_19_TEMPLATE_GAME_CREATION_SCRIPTING

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD_PR_LEVEL_09_19_TEMPLATE_GAME_CREATION_SCRIPTING
1+
BUILD_PR_LEVEL_09_20_WEBSITE_REPO_PREP_SCRIPTING
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
Summary
2-
- Added focused operator scripts under `scripts/PS`:
3-
- `Switch-CodexPlanMode.ps1`
4-
- `Set-CodexApiKey.ps1`
5-
- `Validate-CodexApiKey.ps1`
6-
- `Get-CodexOperatorState.ps1`
7-
- shared helper: `CodexOperatorState.ps1`
8-
- Added usage + guardrails documentation at `docs/dev/CODEX_PLAN_AND_API_KEY_SCRIPTING.md`.
9-
- Implemented repo-local metadata state at `.codex/local/codex-operator-state.json` (generated at runtime), with no raw key persisted to disk by scripts.
10-
- Updated roadmap with the four requested new items and marked the plan/API-key scripting item as completed by this PR.
11-
12-
Behavior implemented
13-
- Plan mode switching between `payg` and `codex` with explicit persisted state metadata.
14-
- API key input/update for `Process` and `User` scopes via environment variable configuration.
15-
- Safe API key validation (presence + format + metadata fingerprint consistency check) without printing raw secret values.
2+
- Added `scripts/PS/codex/New-CodexTemplateGame.ps1` as a focused template game creation script.
3+
- Script copies `games/_template` into `games/<game>` and enforces active asset domains with runtime/data split:
4+
- `assets/sprites/data`
5+
- `assets/tilemaps/data`
6+
- `assets/parallax/data`
7+
- `assets/vectors/data`
8+
- Script scaffolds:
9+
- `games/<game>/assets/<game>.assets.json`
10+
- `games/<game>/config/<game>.project.json`
11+
- Updated codex scripting doc paths to use `scripts/PS/codex/` as the base location.
12+
- Updated roadmap with status-only bracket change for template game creation scripting.
13+
- Commit comment format remains description first and PR name last.
Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,10 @@
1-
Validation Checklist - BUILD_PR_LEVEL_09_18_CODEX_PLAN_SWITCH_AND_API_KEY_SCRIPTING
2-
3-
Scope
4-
[x] PR remains in the repo scripting lane only
5-
[x] No engine changes introduced
6-
[x] No gameplay/runtime feature changes introduced
7-
[x] No tool UI redesign introduced
8-
[x] No broad deployment automation introduced in this PR
9-
[x] No asset conversion automation introduced in this PR
10-
11-
Scripts
12-
[x] PowerShell plan-switch script(s) added
13-
[x] Active mode is clear and inspectable
14-
[x] API key input/update script(s) added
15-
[x] API key validation script(s) added
16-
[x] Script usage is documented clearly
17-
[x] Script outputs/errors are actionable
18-
19-
Validation
20-
[x] Touched PowerShell files parse/read cleanly
21-
[x] Focused plan-switch smoke checks pass
22-
[x] Focused API key input/update smoke checks pass
23-
[x] Focused API key validation smoke checks pass
24-
25-
Roadmap
26-
[x] Existing roadmap status updated where applicable
27-
[x] Requested new roadmap items added
28-
[x] Added roadmap items are limited to the explicitly requested scripting/asset items
29-
30-
Packaging
31-
[x] docs/pr document included
32-
[x] docs/dev/codex_commands.md included
33-
[x] docs/dev/commit_comment.txt included
34-
[x] docs/dev/next_command.txt included
35-
[x] docs/dev/reports/change_summary.txt included
36-
[x] docs/dev/reports/validation_checklist.txt included
37-
[x] Single ZIP produced at `<project folder>/tmp/BUILD_PR_LEVEL_09_18_CODEX_PLAN_SWITCH_AND_API_KEY_SCRIPTING.zip`
1+
Validation Checklist - BUILD_PR_LEVEL_09_19_TEMPLATE_GAME_CREATION_SCRIPTING
2+
3+
[x] `scripts/PS/codex/` used as base path for codex scripts in touched docs/scripts
4+
[x] template game creation script added
5+
[x] tool project scaffolding generated by script
6+
[x] asset/data folder structure enforced by script
7+
[x] commit comment format is description first, PR name last
8+
[x] roadmap updated with status-only bracket change
9+
[x] PowerShell parse check passes on touched codex scripts
10+
[x] focused template-creation smoke check passes

docs/dev/roadmaps/MASTER_ROADMAP_HIGH_LEVEL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@
599599

600600
### Repo Operator + Asset Conversion Scripting Lanes
601601
- [ ] Existing games asset folders updated so existing images / vectors / related runtime assets can be transformed into tool-editable `data/` objects, with corresponding project JSON updates
602-
- [ ] Add the ability for a PowerShell script to create a new game from template, including a project scaffold for the tools
602+
- [x] Add the ability for a PowerShell script to create a new game from template, including a project scaffold for the tools
603603
- [ ] Add scripts to prep / update / delete the repo so it can be placed on a website
604604
- [x] Add scripts to switch between Pay-as-you-go and Codex plan modes, and scripts to input API key material and validate it
605605

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
# BUILD_PR — LEVEL 09_19 — TEMPLATE GAME CREATION SCRIPTING
3+
4+
## Objective
5+
Introduce PowerShell scripting to create a new game from a standardized template, including tool project scaffolding.
6+
7+
## Key Updates
8+
- Codex scripts are now located at: scripts/PS/codex/
9+
- Commit comment format reversed (details first, PR name last)
10+
11+
## Scope
12+
- script to create new game from template
13+
- include assets, folders, and tool project structure
14+
- align with asset/data split conventions
15+
16+
## Out of Scope
17+
- no engine changes
18+
- no gameplay features
19+
20+
## Roadmap Instruction
21+
- Update roadmap status only where applicable
22+
- Continue including previously added roadmap items

0 commit comments

Comments
 (0)