Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
58e8949
feat(main-street): implement sell cards from street grid (CG-0MQOA5U4…
Jul 20, 2026
4fc8755
docs(AGENTS.md): add UI best practices section for creating modal dia…
Jul 20, 2026
7f0633b
fix(feudalism): show tiebreaker text only on tied influence scores (C…
Jul 21, 2026
b9fa91a
fix(feudalism): standardize game-over overlay to depth 2000 (CG-0MQNO…
Jul 21, 2026
703e006
feat: add reduced motion AI delay for Golf, Feudalism, Lost Cities, S…
Jul 21, 2026
d24bc3f
feat: replace StatsButton Σ text with bar chart SVG icon (CG-0MQSF2FU…
Jul 21, 2026
753b0d9
fix: gracefully handle missing ToneForge synth module with clear warn…
Jul 21, 2026
1136448
CG-0MQRB9RMF003PRNO: Add reputationPerTurn and reputationBonus fields…
Jul 21, 2026
5550d7d
CG-0MQS25QSO0031OHU: Fix stale comment — HUD strip is 50% width, not 2/3
Jul 21, 2026
74734d5
CG-0MQS25QSO0031OHU: Narrow Main Street HUD header to avoid overlappi…
Jul 21, 2026
9d2f3bc
CG-0MQQT9X45002WM4H: Synergy only works for different businesses
Jul 21, 2026
a398377
SA-0MQW86QL30064M83: Align investment cards with development row grid
Jul 21, 2026
f471f01
CG-0MQQHESNA006MOCK: Remove remaining The Mind files and references
Jul 21, 2026
9ebe706
CG-0MQR7QSRH007YXZC: Add Menu button to end-of-game overlays for Sush…
Jul 21, 2026
d28aee5
Merge branch 'wl-CG-0MQR7QSRH007YXZC-no-menu-button-in-end-of-game-di…
Jul 21, 2026
95e1f62
CG-0MRV84ZT60069PW6: Per-card incremental income/reputation tracking
Jul 21, 2026
6cd634a
CG-0MRV9QH8V002JD7S: Implementation complete
Jul 22, 2026
70a18d5
CG-0MRV9RTIJ005ONVA: Fix multiple sound triggers in 9-Card Golf
Jul 22, 2026
fd5204f
docs: document Clinic synergy reclassification from Service to Health…
Jul 22, 2026
44ffdba
docs(AGENTS.md): consolidate and deduplicate Worklog rules (CG-0MRW7J…
Jul 22, 2026
577e39f
fix(main-street): Address audit gap - proper HUD text alignment and r…
Jul 22, 2026
ee7326e
Fix audit gap: exclude sold card income from HUD tooltips
Jul 22, 2026
9e1eadd
Use per-card cached currentIncome for HUD tooltips instead of compute…
Jul 22, 2026
1b27553
Remove legacy-fallback from applyIncome and HUD tooltips
Jul 22, 2026
cfbe4f6
CG-0MRVCWNEQ009H52Z: Convert Main Street synergy from absolute values…
Jul 22, 2026
9252863
Bump version to v0.1.7
Jul 23, 2026
f561cb1
Update CHANGELOG.md for v0.1.7
Jul 23, 2026
be46739
Merge origin/dev into main (automated)
Jul 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ Worklog Specific Ignores

### End of Worklog Specific Ignores
.pi/
.implement_state.json
2 changes: 1 addition & 1 deletion .pi-compact.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A Phaser 4 RC + TypeScript card game engine with modular core (`src/core-engine/
- **Gym RngScene** (CG-0MPLT8ADR0099WF3): Reimplemented to display full 52-card deck grid, card scaling fixes, deterministic seed + auto-shuffle
- **Documentation cleanup** (CG-0MP12U37I009PWPQ): Consolidated game docs in DEVELOPER.md
- **HUD tooltips** (CG-0MPKE6W1C0047A44): Migrated Sushi Go & Lost Cities to shared TooltipManager
- **Code-smell refactoring** (CG-0MM1OPFLF07WCFYP): Split long functions across SushiGo, TheMind, Splendor scenes
- **Code-smell refactoring** (CG-0MM1OPFLF07WCFYP): Split long functions across SushiGo, Splendor scenes

## Next Recommended Work
- **CG-0MP2988UN009P9LM** — Extract shared HUD layer into core engine and adopt across games (status: `blocked`, priority: high)
Expand Down
240 changes: 65 additions & 175 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,203 +133,93 @@ Any change that alters developer workflows **must** include a corresponding docu
2. If the doc update cannot be included in the same commit, create a **child work item** in Worklog for the doc update. The parent work item **cannot be closed** until the doc-update child is also closed.
3. Reviewers should verify that docs are updated before approving any PR that touches infrastructure or workflow files.

<!-- Start base Worklog AGENTS.md file -->

## work-item Tracking with Worklog (wl)

IMPORTANT: This project uses Worklog (wl) for ALL work-item tracking. Do NOT use markdown TODOs, task lists, or other tracking methods.

## CRITICAL RULES

- Use Worklog (wl), described below, for ALL task tracking, do NOT use markdown TODOs, task lists, or other tracking methods
- When mentioning a work item always use its title followed by its ID in parentheses, e.g. "Fix login bug (WL-1234)"
- Always keep work items up to date with accurate status, priority, stage, and assignee
- Whenever you are provided with, or discover, a new work item create it in wl immediately
- Whenever you are provided with or discover important context (specifications, designs, user-stories) ensure the information is added to the description of the relevant work item(s) OR create a new work item if none exist
- Whenever you create a planning document (PRD, spec, design doc) add references to the document in the description of any work item that is directly related to the document
- Work items cannot be closed until all child items are closed, all blocking dependencies resolved and a Producer has reviewed and approved the work
- Never commit changes without associating them with a work item
- Never commit changes without ensuring all tests and quality checks pass
- Whenever a commit is made add a comment to impacted the work item(s) describing the changes, the files affected, and including the commit hash.
- If push fails, resolve and retry until it succeeds
- When using backticks in arguments to shell commands, escape them properly to avoid errors

### Important Rules

- Use wl as a primary source of truth, only the source code is more authoritative
- Always use `--json` flag for programmatic use
- When new work items are discovered or prompted while working on an existing item create a new work item with `wl create`
- If the item must be completed before the current work item can be completed add it as a child of the current item (`wl create --parent <current-work-item-id>`)
- If the item is related to the current work item but not blocking its completion add a reference to the current item in the description (`discovered-from:<current-work-item-id>`)
- Check `wl next` before asking "what should I work on?" and always offer the response as a next steps suggestion, with an explanation
- Run `wl --help` and `wl <cmd> --help` to learn about the capabilities of WorkLog (wl) and discover available flags
- Use work items to track all significant work, including bugs, features, tasks, epics, chores
- Use clear, concise titles and detailed descriptions for all work items
- Use parent/child relationships to track dependencies and subtasks
- Use priorities to indicate the importance of work items
- Use stages to track workflow progress
- Do NOT clutter repo root with planning documents

### work-item Types

Track work-item types with `--issue-type`:

- bug - Something broken
- feature - New functionality
- task - Work item (tests, docs, refactoring)
- epic - Large feature with subtasks
- chore - Maintenance (dependencies, tooling)

### Work Item Descriptions
## UI Best Practices: Creating Modal Dialogs

- Use clear, concise titles summarizing the work item.
- Do not escape special characters
- The description must provide sufficient context for understanding and implementing the work item.
- At a minimum include:
- A summary of the problem or feature.
- Example User Stories if applicable.
- Expected behaviour and outcomes.
- Steps to reproduce (for bugs).
- Suggested implementation approach if relevant.
- Links to related work items or documentation.
- Measurable and testable acceptance criteria.
When adding a new modal dialog overlay (e.g. a sell confirmation dialog, settings panel, or any popup), follow the established pattern used by `showSellConfirmation` in `MainStreetOverlayContent.ts`. The key rules are:

### Priorities
### 1. Use the overlay infrastructure from `@ui/`

Worklog uses named priorities:

- critical - Security, data loss, broken builds
- high - Major features, important bugs
- medium - Default, nice-to-have
- low - Polish, optimization
```ts
import { createOverlayBackground, createOverlayButton, dismissOverlay } from '../../../src/ui';
```

### Dependencies
### 2. Create the background + box with `createOverlayBackground`

Use parent/child relationships to track blocking dependencies.
```ts
const boxConfig = { width: 360, height: 260, color: 0x000000, alpha: 1.0, depth: 200 };
const overlay = createOverlayBackground(
s,
{ depth: 199, alpha: 0.6 }, // backdrop: darker, slightly lower depth
boxConfig, // visible centered box
);
s.overlayObjects.push(...overlay.objects);
```

- Child items must be completed before the parent can be closed.
- If a work item blocks another, make it a child of the blocked item.
- If a work item blocks multiple items, create the parent/child relationships with the highest priority item as the parent unless one of the items is in-progress, in which case that item should be the parent.
- If in doubt raise for product manager review.
### 3. Parent ALL text and button objects into `hudContainer` (CRITICAL)

Other types of dependencies can be tracked in descriptions, for example `discovered-from:<work-item-id>`, `related-to:<work-item-id>`, `blocked-by:<work-item-id>`.
This is the single most common mistake. Every text label, button, or interactive element you add to the overlay **must** be parented into `s.hudContainer`, otherwise it renders **behind** the overlay box and becomes invisible:

Worklog does not enforce these relationships but they can be used for planning and tracking.
```ts
const titleText = s.add.text(x, y, 'My Title', { ... })
.setOrigin(0.5).setDepth(201);
if (s.hudContainer) s.hudContainer.add(titleText); // ← REQUIRED
s.overlayObjects.push(titleText);

### Workflow management
const btn = createOverlayButton(s, x, y, '[ OK ]', 201);
if (s.hudContainer) s.hudContainer.add(btn); // ← REQUIRED
s.overlayObjects.push(btn);
```

- Use the `--stage` flag to track workflow stages according to your particular process,
- e.g. `idea`, `prd_complete`, `milestones_defined`, `plan_complete`, `in_progress``done`.
- Use the `--assignee` flag to assign work items to agents.
- Use the `--tags` flag to add arbitrary tags for filtering and organization. Though avoid over-tagging.
- Use comments to document progress, decisions, and context.
- Use `risk` and `effort` fields to track complexity and potential issues.
- If available use the `effort_and_risk` agent skill to estimate these values.
### 4. Depth ordering

1. Check ready work: `wl next`
2. Claim your task: `wl update <id> --status in-progress`
3. Work on it: implement, test, document
4. Discover new work? Create a linked issue:
Use consistent depth values to ensure correct z-ordering:

- `wl create "Found bug" --priority high --tags "discovered-from:<parent-id>"`
| Layer | Depth |
|-------|-------|
| Backdrop (semi-transparent overlay) | 199 |
| Visible overlay box | 200 |
| Text labels, buttons, interactive elements | 201 |

5. Complete: `wl close <id> --reason "PR #123 merged"`
6. Sync: run `wl sync` before ending the session
### 5. Cleanup on dismiss

### Work-Item Management
When the user confirms or cancels, call `dismissOverlay` and reset the objects array:

```bash
# Create work items
wl create --help # Show help for creating work items
wl create --title "Bug title" --description "<details>" --priority high --issue-type bug --json
wl create --title "Feature title" --description "<details>" --priority medium --issue-type feature --json
wl create --title "Epic title" --description "<details>" --priority high --issue-type epic --json
wl create --title "Subtask" --parent <parent-id> --priority medium --json
wl create --title "Found bug" --priority high --tags "discovered-from:WL-123" --json

# Update work items
wl update --help # Show help for updating work items
wl update <work-item-id> --status in-progress --json
wl update <work-item-id> --priority high --json

# Comments
wl comment --help # Show help for comment commands
wl comment list <work-item-id> --json
wl comment show <work-item-id>-C1 --json
wl comment update <work-item-id>-C1 --comment "Revised" --json
wl comment delete <work-item-id>-C1 --json

# Close or delete
# wl close: provide -r reason for closing; can close multiple ids
wl close <work-item-id> --reason "PR #123 merged" --json
wl close <work-item-id-1> <work-item-id-2> --json

# *Destructive command ask for confirmation before running* Dekete a work item permanently
wl delete <work-item-id> --json
```ts
dismissOverlay(s.overlayObjects);
s.overlayObjects = [];
s.refreshAll(); // re-render the game state if it changed
```

### Project Status
### 6. Reference the sell dialog for a complete example

```bash
# Show the next ready work items (JSON output)
# Display a recommendation for the next item to work on in JSON
wl next --json
# Display a recommendation for the next item assigned to `agent-name` to work on
wl next --assignee "agent-name" --json
# Display a recommendation for the next item to work on that matches a keyword (in title/description/comments)
wl next --search "keyword" --json

# Show all items with status `in-progress` in JSON
wl in-progress --json
# Show in-progress items assigned to `agent-name`
wl in-progress --assignee "agent-name" --json

# Show recently created or updated work items
wl recent --json
# Show the 10 most recently created or updated items
wl recent --number 10 --json
# Include child/subtask items when showing recent items
wl recent --children --json

# List all work items except those in a completed state
wl list --json
# Limit list output
wl list -n 5 --json
# List items filtered by status (open, in-progress, closed, etc.)
wl list --status open --json
# List items filtered by priority (critical, high, medium, low)
wl list --priority high --json
# List items filtered by comma-separated tags
wl list --tags "frontend,bug" --json
# List items filtered by assignee (short or full name)
wl list --assignee alice --json
# List items filtered by stage (e.g. triage, review, done)
wl list --stage review --json

# Show details for a specific work item
wl show <work-item-id> --comments --json
# Show details including child/subtask items
wl show <work-item-id> --children --json
```
The best reference implementation is `showSellConfirmation` in `example-games/main-street/scenes/MainStreetOverlayContent.ts`. It demonstrates:
- Using `createOverlayBackground` for the backdrop + box
- Parenting all text and buttons into `hudContainer`
- Using `createOverlayButton` for styled interactive buttons
- Handling both confirm (sell) and cancel actions
- Proper cleanup and state refresh

#### Team
<!-- Start base Worklog AGENTS.md file -->

```bash
# Sync local worklog data with the remote (shares changes)
wl sync
# Import issues from GitHub into the worklog (GitHub -> worklog)
wl github import
# Push worklog changes to GitHub issues (worklog -> GitHub)
wl github push
```
## Worklog Rules

#### Plugins
This project follows the standard Worklog (wl) workflow for work-item tracking. The full ruleset is defined in the global AGENTS.md at `~/.pi/agent/AGENTS.md` under these sections:

Depending on your setup, you may have additional wl plugins installed. Check available plugins with `wl --help` (See plugins section) to view more information about the features provided by each plugin run `wl <plugin-command> --help`
- **Work-item Tracking with Worklog (wl)** — Core principles for using wl
- **CRITICAL RULES** — Mandatory rules for commits, tests, and work-item hygiene
- **Important Rules** — Recommended practices for effective wl usage
- **Stage vs Status distinction** — Understanding the two lifecycle axes
- **work-item Types, Descriptions, Priorities, Dependencies** — Template definitions
- **Workflow management** — Stage progression and team coordination
- **Work-Item Management** — CLI reference for `wl create`, `wl update`, `wl close`, etc.
- **Project Status** — CLI reference for `wl list`, `wl show`, `wl next`, etc.
- **Coding Disciplines** — Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution

#### Help
### TCE Project Conventions

Run `wl --help` to see general help text and available commands.
Run `wl <command> --help` to see help text and all available flags for any command.
- Work-item prefix: **CG** (Tableau-Card-Engine)
- Priority levels: critical → high → medium → low
- Stage progression: idea → intake_complete → plan_complete → in_progress → in_review → done
- See project `docs/DEVELOPER.md` for additional TCE-specific development workflows.

<!-- End base Worklog AGENTS.md file -->
<!-- End base Worklog AGENTS.md file -->
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## v0.1.7 (2026-07-23)
### Features
- Narrow Main Street HUD header to avoid overlapping undo button (CG-0MQS25QSO0031OHU)
- 9 Card Golf Stock/Deck is face up (CG-0MRV9QH8V002JD7S)
- Multiple sound triggers? (CG-0MRV9RTIJ005ONVA)
- Convert Main Street synergy bonuses from absolute values to percentage multipliers (CG-0MRVCWNEQ009H52Z)
- Feudalism game-over overlay uses non-standard type and button layout (CG-0MQNOTVIH0052HW0)
- Sell cards in Main Street (CG-0MQOA5U4H000J37N)
- Need delay if reduced motion is on (CG-0MQPSVDTD002JCX5)
- The stats button has no icon (CG-0MQSF2FU40072RL9)
### Bug Fixes
- Feudalism win screen shows tiebreaker text unconditionally (CG-0MQN31CD400709UC)
- Synergy only works for different businesses (CG-0MQQT9X45002WM4H)
- No Menu button in end of game dialog (CG-0MQR7QSRH007YXZC)
- Investment cards misaligned (SA-0MQW86QL30064M83)
### Other
- Per-card incremental income/reputation tracking (replace monolithic per-turn recalculation) (CG-0MRV84ZT60069PW6)
- Consolidate and deduplicate AGENTS.md (CG-0MRW7JGSS0080N9P)
- Update documentation for Clinic rework (Health synergy, reputation per turn) (CG-0MQRB9RMF003PRNO)
- Refacactor AGENTS.md (CG-0MRP1AY0L008J5VL)
- Missing build/tf-synths/main-street-runtime-synth.mjs — run npm run tf:generate (CG-0MQR54BSD007FQTA)
- Identify and delete all The Mind files (CG-0MQQHESNA006MOCK)

## v0.1.6 (2026-07-20)
### Features
- Create a playable instance of Blackjack (CG-0MQK6UBQK003MA0T)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ tableau-card-engine/
│ ├── sushi-go/ Sushi Go! (card drafting, human vs. AI)
│ ├── feudalism/ Feudalism (engine-building, human vs. AI)
│ ├── lost-cities/ Lost Cities (2-player expedition lanes, human vs. AI)
│ ├── the-mind/ The Mind (cooperative real-time, human vs. AI)
│ └── main-street/ Main Street (single-player tableau builder)
├── public/assets/ Static assets (cards, fonts, images)
│ └── cards/ 52 standard card SVGs + card back + game-specific cards (140x190px)
Expand Down
Loading
Loading