Skip to content

Commit 7a7c535

Browse files
authored
πŸ—ž [claude] /init for a godot project (#8)
* πŸ—ž [claude] /init for a godot project * fixes for markdownlint
1 parent bf14b36 commit 7a7c535

File tree

1 file changed

+64
-59
lines changed

1 file changed

+64
-59
lines changed

β€ŽCLAUDE.mdβ€Ž

Lines changed: 64 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,100 +4,105 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Repository Purpose
66

7-
This is a GitHub repository template that implements best practices for open source projects. It's designed to be cloned and customized for new repositories. The template includes GitHub community standards compliance, automated workflows, and a command-line driven development process.
7+
FINI Clock is a mobile clock application built with Godot 4.5. The project targets mobile and open platforms, implementing a simple digital clock interface with real-time updates.
88

99
## Development Workflow
1010

11-
This repo uses `just` (command runner) for all development tasks. The workflow is entirely command-line based using `just` and the GitHub CLI (`gh`).
11+
This repo inherits the standard `just` command runner workflow from the template-repo. The workflow is entirely command-line based using `just` and the GitHub CLI (`gh`).
1212

1313
### Standard development cycle
1414

15-
1. `just branch <name>` - Create a new feature branch (format: `$USER/YYYY-MM-DD-<name>`)
16-
2. Make changes and commit (last commit message becomes PR title)
17-
3. `just pr` - Create PR, push changes, and watch checks (waits 8s for GitHub API)
18-
4. `just merge` - Squash merge PR, delete branch, return to main, and pull latest
19-
5. `just sync` - Return to main branch and pull latest (escape hatch)
15+
1. `just devsetup` - Configure git diff settings for GDScript (one-time setup)
16+
2. `just branch <name>` - Create a new feature branch (format: `$USER/YYYY-MM-DD-<name>`)
17+
3. Make changes and commit (last commit message becomes PR title)
18+
4. `just pr` - Create PR, push changes, and watch checks (waits 8s for GitHub API)
19+
5. `just merge` - Squash merge PR, delete branch, return to main, and pull latest
20+
6. `just sync` - Return to main branch and pull latest (escape hatch)
2021

2122
### Additional commands
2223

2324
- `just` or `just list` - Show all available recipes
2425
- `just prweb` - Open current PR in browser
2526
- `just release <version>` - Create a GitHub release with auto-generated notes
26-
- `just clean_readme` - Generate a clean README from template (strips template documentation)
2727
- `just compliance_check` - Run custom repo compliance checks
2828
- `just shellcheck` - Run shellcheck on all bash scripts in just recipes
29-
- `just utcdate` - Print UTC date in ISO format (used in branch names)
3029

31-
## Architecture
30+
## Godot Development
31+
32+
### Engine version and configuration
3233

33-
### Modular justfile structure
34+
- **Engine**: Godot 4.5
35+
- **Target platforms**: Mobile (using mobile rendering method)
36+
- **Main scene**: `res://scenes/main.tscn`
37+
- **Project configuration**: `project.godot`
3438

35-
The main `justfile` imports four modules:
39+
### Code quality checks
3640

37-
- `.just/compliance.just` - Custom compliance checks for repo health (validates all GitHub community standards)
38-
- `.just/gh-process.just` - Git/GitHub workflow automation (core PR lifecycle)
39-
- `.just/pr-hook.just` - Optional pre-PR hooks for project-specific automation (e.g., Hugo rebuilds)
40-
- `.just/shellcheck.just` - Shellcheck linting for bash scripts in just recipes
41+
The GitHub Actions workflow `godot-checks.yml` runs on all pushes and PRs that affect `addons/**` or `scripts/**`:
4142

42-
### Git/GitHub workflow details
43+
- **gdformat** - GDScript formatting checks (`gdformat --diff .`)
44+
- **gdlint** - GDScript linting checks (`gdlint .`)
45+
- **codespell** - Spell checking (skips `./addons` and `*.po` files)
4346

44-
The `.just/gh-process.just` module implements the entire PR lifecycle:
47+
Run these locally before creating a PR to catch issues early.
4548

46-
- **Branch creation** - Dated branches with `$USER/YYYY-MM-DD-<name>` format
47-
- **PR creation** - First commit message becomes PR title, all commits listed in body
48-
- **Sanity checks** - Prevents empty PRs, enforces branch strategy via hidden recipes (`_on_a_branch`, `_has_commits`, `_main_branch`)
49-
- **AI integration** - After PR checks complete, displays GitHub Copilot and Claude Code review comments in terminal
50-
- **Merge automation** - Squash merge, delete remote branch, return to main, pull latest
49+
### Git configuration
5150

52-
### Shellcheck integration
51+
The `just devsetup` recipe configures git to properly diff GDScript files:
5352

54-
The `.just/shellcheck.just` module extracts and validates bash scripts:
53+
```bash
54+
git config diff.gdscript.xfuncname '^[\t ]*(class|func|signal)[\t ].*$'
55+
```
5556

56-
- **Script extraction** - Uses awk to identify recipes with bash shebangs (`#!/usr/bin/env bash` or `#!/bin/bash`)
57-
- **Automatic detection** - Scans all justfiles in repo (main `justfile` and `.just/*.just`)
58-
- **Temporary file handling** - Creates temporary files for each script and runs shellcheck with `-x -s bash` flags
59-
- **Detailed reporting** - Shows which file and recipe each issue is in, with colored output
60-
- **Exit code** - Returns 1 if issues found, 0 if all scripts pass
57+
This shows function/class/signal names in diff headers for better context.
6158

62-
### GitHub Actions
59+
## Architecture
6360

64-
Six workflows run on PRs and pushes to main:
61+
### Project structure
6562

66-
- **markdownlint** - Enforces markdown standards using `markdownlint-cli2`
67-
- **checkov** - Security scanning for GitHub Actions (continues on error, outputs SARIF)
68-
- **actionlint** - Lints GitHub Actions workflow files
69-
- **auto-assign** - Automatically assigns issues/PRs to `chicks-net`
70-
- **claude-code-review** - Claude AI review automation
71-
- **claude** - Additional Claude integration
63+
- `scripts/` - GDScript files (game logic)
64+
- `scenes/` - Godot scene files (.tscn)
65+
- `addons/` - Third-party Godot plugins (currently empty)
66+
- `.godot/` - Godot editor cache and metadata (not committed)
7267

73-
### Markdown linting
68+
### Current implementation
7469

75-
Configuration in `.markdownlint.yml`:
70+
The application consists of a single main scene (`scenes/main.tscn`) controlled by `scripts/main.gd`:
7671

77-
- MD013 (line length) is disabled
78-
- MD041 (first line h1) is disabled
79-
- MD042 (no empty links) is disabled
80-
- MD004 (list style) enforces dashes
81-
- MD010 (tabs) ignores code blocks
72+
- **Main node** (`Node2D`) - Root node for the scene
73+
- **CenterContainer** - Centers the time display in the window (1152x648 default)
74+
- **time_label** (`Label`) - Displays the current time with 80pt font
8275

83-
Run locally: `markdownlint-cli2 **/*.md`
76+
The `main.gd` script:
8477

85-
## Template customization
78+
- Uses `@onready` to reference the time label node
79+
- Creates a Timer node in `_ready()` that fires every 1.0 seconds
80+
- Connects the timer's `timeout` signal to `update_time()` function
81+
- Fetches system time using `Time.get_time_dict_from_system(true)` for UTC
82+
- Formats time as HH:MM:SS with zero-padding
8683

87-
When using this template for a new project, search and replace:
84+
### Godot scene format notes
8885

89-
- `fini-net` β†’ your GitHub org
90-
- `template-repo` β†’ your repo name
91-
- `chicks-net` β†’ your references (especially in `.github/workflows/auto-assign.yml`)
86+
Scene files (`.tscn`) use Godot's text-based scene format:
9287

93-
Run `just clean_readme` to strip template documentation from README.
88+
- `[gd_scene]` header defines the format version and dependencies
89+
- `[ext_resource]` sections link to scripts and assets via UIDs
90+
- `[node]` sections define the scene tree hierarchy
91+
- Properties use `key = value` syntax (e.g., `text = "--:--:--"`)
9492

9593
## Important implementation notes
9694

97-
- All git commands in `.just/gh-process.just` use standard git (no aliases required)
98-
- The `pr` recipe runs optional pre-PR hooks if `.just/pr-hook.just` exists
99-
- PR checks poll every 5 seconds for faster feedback
100-
- Release notes for workflow changes are tracked in `.just/RELEASE_NOTES.md`
101-
- The `.just` directory contains modular just recipes that can be copied to other projects for updates
102-
- just catches errors from commands when the recipe isn't a "#!" form that runs another scripting engine
103-
- just colors come from built-in constants <https://just.systems/man/en/constants.html>
95+
- GDScript uses snake_case for variables and functions
96+
- Node references use `$NodePath` syntax or `@onready` variables
97+
- Signal connections use the `.connect()` method (Godot 4.x style)
98+
- The project uses UTC time via `Time.get_time_dict_from_system(true)`
99+
- All Godot resource paths use `res://` protocol
100+
101+
## Modular justfile structure
102+
103+
The main `justfile` imports four modules from `.just/`:
104+
105+
- `compliance.just` - Custom compliance checks for repo health
106+
- `gh-process.just` - Git/GitHub workflow automation (core PR lifecycle)
107+
- `pr-hook.just` - Optional pre-PR hooks (currently placeholder)
108+
- `shellcheck.just` - Shellcheck linting for bash scripts in just recipes

0 commit comments

Comments
Β (0)