# /godot-status — Documenter l'état actuel du projet Godot

> **Synonymes** : status, état, où en est, progress, progression, devlog, rapport, report, documentation, scan, overview, résumé, summary

Tu es un documentaliste projet Godot. Scanne le projet et génère un rapport d'état clair, suis la progression, et suggère des améliorations.

## Process

### Step 1: Gather project metadata
```
godot_project_settings(action="list")
```
Extract: project name, main scene, viewport size, renderer.

### Step 2: List all project files
```
godot_execute_script(code="""
var files = []
var dirs_to_scan = ["res://"]
while dirs_to_scan.size() > 0:
	var dir_path = dirs_to_scan.pop_front()
	var dir = DirAccess.open(dir_path)
	if dir == null:
		continue
	dir.list_dir_begin()
	var file_name = dir.get_next()
	while file_name != "":
		var full_path = dir_path + file_name
		if dir.current_is_dir():
			if file_name != "." and file_name != ".." and file_name != ".godot" and file_name != "addons":
				dirs_to_scan.append(full_path + "/")
		else:
			files.append(full_path)
		file_name = dir.get_next()
	dir.list_dir_end()
files.sort()
return "\\n".join(files)
""")
```

### Step 3: Inspect each scene
For each `.tscn` file found:
```
godot_open_scene(path="res://scenes/xxx.tscn")
godot_get_scene_tree
```

### Step 4: Read the existing DEVLOG if present
Check if `res://DEVLOG.md` or `DEVLOG.md` exists in the project root directory. If yes, read it to know what was documented before.

### Step 5: Check for issues
Run a quick scan:
```
godot_execute_script(code="""
var issues = []
var root = EditorInterface.get_edited_scene_root()
if root == null:
	return "No scene open"

func check_node(node, path):
	# Physics body without collision shape
	if node is PhysicsBody2D or node is PhysicsBody3D:
		var has_shape = false
		for child in node.get_children():
			if child is CollisionShape2D or child is CollisionShape3D:
				if child.shape != null:
					has_shape = true
		if not has_shape:
			issues.append("WARN: %s (%s) has no CollisionShape with a shape" % [path, node.get_class()])

	# Node with null script where siblings have scripts
	# (not always a bug, but worth flagging)

	for child in node.get_children():
		check_node(child, path + "/" + child.name)

check_node(root, root.name)
if issues.size() == 0:
	return "No issues found"
return "\\n".join(issues)
""")
```

### Step 6: Generate DEVLOG.md

Write the report using the Write tool (NOT godot_write_script — this is a markdown file, not GDScript).

## DEVLOG.md format

```markdown
# DEVLOG — {Project Name}

> Auto-generated by Golem MCP. Last update: {date}

## Project info

- **Engine:** Godot {version}
- **Renderer:** {renderer}
- **Viewport:** {width}x{height}
- **Main scene:** {main_scene or "not set"}

## Scenes

### {scene_name.tscn}
```
{scene tree output}
```
Scripts: {list of attached scripts}

### {scene_name_2.tscn}
...

## Project files

```
{file tree, grouped by directory}
```

## Issues

{any warnings from the scan, or "None detected."}

## Session log

### {date}
- {Summary of what was done in this session}

---
*Previous sessions below*

### {previous date}
- {Previous session summary}
```

## Rules

- **Append to session log, never overwrite previous entries.** The DEVLOG is a living document.
- Keep session summaries to 3-5 bullet points max. What was created, changed, or fixed.
- If no DEVLOG exists yet, create it fresh.
- If one exists, preserve all previous content and add a new session entry at the top of the session log section.
- The scene tree and file list sections ARE overwritten each time (they reflect current state).
- Don't include files from `addons/` or `.godot/` in the file listing.

---

## Step 7: Generate/update progress.txt

Write a `progress.txt` in the Godot project root (via Write tool) with this format:

```
COMPLETED:
- {feature or task that is done}

IN PROGRESS:
- {current work}

NEXT:
- {planned next steps}

KNOWN BUGS:
- {known issues, or "None"}
```

Rules:
- If `progress.txt` exists, read it first and update sections
- Keep each section to max 10 items — archive old completed items
- Be specific: "Player movement with 8-direction" not "movement"

## Step 8: Self-improving CLAUDE.md

After the scan, propose updates for the project's `CLAUDE.md` (in the Godot project, not the golem-mcp repo):

- **Lessons learned** from this session — errors corrected, patterns discovered, traps encountered
- **Pièges connus** specific to THIS project (not generic Godot ones)
- **Conventions discovered** — naming patterns, folder structure, coding style

Format proposal as a diff:
```
Suggested additions to CLAUDE.md:

## Pièges connus (projet)
- {trap 1}
- {trap 2}

## Patterns
- {pattern discovered}
```

**Ne pas modifier CLAUDE.md sans validation du user.**

## Step 9: Suggestions

Based on the scan, propose actionable suggestions. Check for these conditions:

| Condition détectée | Suggestion |
|-------------------|------------|
| Pas de Theme resource (`res://theme.tres` absent) | "Pas de Theme détecté → `/godot-theme` pour un design system cohérent" |
| UI sans metadata rôles (pas de `set_meta("role", ...)`) | "UI sans rôles → `/godot-composition` pour structurer avec le système de rôles" |
| Boutons sans states hover/focus/pressed | "Boutons sans états interactifs → `/godot-behavior` pour ajouter du feedback" |
| Scène complexe sans plan documenté | "Projet sans GAME_PLAN.md → `/godot-plan` pour structurer avant de continuer" |
| UI avec spacing/couleurs incohérents | "Incohérences visuelles détectées → `/godot-design-audit` pour un audit structuré" |
| Pas de main scene configurée | "Pas de scène principale → `godot_project_settings` pour la configurer" |
| Scripts sans `GolemCapture.log()` | "Logs avec print() → remplacer par `GolemCapture.log()` pour capturer via MCP" |
| Camera2D sans script | "Camera2D détectée sans script → ajouter un script pour screenshake (voir `/godot-behavior` Section 11)" |
| Camera2D avec position modifiée directement | "Camera2D utilise position au lieu de offset → risque de casser le cadrage lors du shake" |
| Pas d'autoload Juice | "Pas d'autoload game feel → créer `Juice.gd` pour centraliser shake/freeze (voir `/godot-behavior`)" |

Present suggestions at the end of the status report, max 5.

## Step 10: Detect Camera2D issues

Ajouter cette vérification dans le scan (Step 5) :

```
godot_execute_script(code="""
var camera_issues = []
var root = EditorInterface.get_edited_scene_root()
if root == null:
	return ""

func check_cameras(node, path):
	if node is Camera2D:
		if node.get_script() == null:
			camera_issues.append("INFO: %s (Camera2D) has no script — consider adding one for screenshake" % path)
	for child in node.get_children():
		check_cameras(child, path + "/" + child.name)

check_cameras(root, root.name)
return "\\n".join(camera_issues)
""")
```
