Skip to content

Commit 5da6d06

Browse files
turegjorupclaude
andcommitted
6869: Fix hook file paths for Docker and update README
Convert absolute host paths to relative paths in all PostToolUse hooks using ${CLAUDE_FILE_PATH#$CLAUDE_PROJECT_DIR/} so tools inside Docker containers can resolve the files. Document agents, skills, hooks, and MCP servers in README. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 506969b commit 5da6d06

2 files changed

Lines changed: 56 additions & 16 deletions

File tree

.claude/settings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,17 @@
108108
"hooks": [
109109
{
110110
"type": "command",
111-
"command": "case \"$CLAUDE_FILE_PATH\" in *.php) docker compose exec -T phpfpm vendor/bin/php-cs-fixer fix --quiet \"$CLAUDE_FILE_PATH\" 2>/dev/null || true ;; esac",
111+
"command": "case \"$CLAUDE_FILE_PATH\" in *.php) REL_PATH=\"${CLAUDE_FILE_PATH#$CLAUDE_PROJECT_DIR/}\"; docker compose exec -T phpfpm vendor/bin/php-cs-fixer fix --quiet \"$REL_PATH\" 2>/dev/null || true ;; esac",
112112
"timeout": 30
113113
},
114114
{
115115
"type": "command",
116-
"command": "case \"$CLAUDE_FILE_PATH\" in *.php) docker compose exec -T phpfpm vendor/bin/phpstan analyse --no-progress --error-format=raw \"$CLAUDE_FILE_PATH\" 2>/dev/null || true ;; esac",
116+
"command": "case \"$CLAUDE_FILE_PATH\" in *.php) REL_PATH=\"${CLAUDE_FILE_PATH#$CLAUDE_PROJECT_DIR/}\"; docker compose exec -T phpfpm vendor/bin/phpstan analyse --no-progress --error-format=raw \"$REL_PATH\" 2>/dev/null || true ;; esac",
117117
"timeout": 30
118118
},
119119
{
120120
"type": "command",
121-
"command": "case \"$CLAUDE_FILE_PATH\" in *.twig) docker compose exec -T phpfpm vendor/bin/twig-cs-fixer lint --fix \"$CLAUDE_FILE_PATH\" 2>/dev/null || true ;; esac",
121+
"command": "case \"$CLAUDE_FILE_PATH\" in *.twig) REL_PATH=\"${CLAUDE_FILE_PATH#$CLAUDE_PROJECT_DIR/}\"; docker compose exec -T phpfpm vendor/bin/twig-cs-fixer lint --fix \"$REL_PATH\" 2>/dev/null || true ;; esac",
122122
"timeout": 15
123123
},
124124
{
@@ -128,7 +128,7 @@
128128
},
129129
{
130130
"type": "command",
131-
"command": "case \"$CLAUDE_FILE_PATH\" in *.js|*.css|*.scss|*.yaml|*.yml|*.md) docker compose run --rm -T node npx prettier --write \"$CLAUDE_FILE_PATH\" 2>/dev/null || true ;; esac",
131+
"command": "case \"$CLAUDE_FILE_PATH\" in *.js|*.css|*.scss|*.yaml|*.yml|*.md) REL_PATH=\"${CLAUDE_FILE_PATH#$CLAUDE_PROJECT_DIR/}\"; docker compose run --rm -T node npx prettier --write \"$REL_PATH\" 2>/dev/null || true ;; esac",
132132
"timeout": 15
133133
}
134134
]

README.md

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ information about sites and installations running on the server. These are sent
1616

1717
This allows us to monitor
1818

19-
* What is installed and running
20-
* Which sites/domains we are hosting
21-
* What docker images we are running
22-
* What packages and modules we are running
23-
* If there are known CVE's for the packages/modules
24-
* What git repositories we are hosting
19+
- What is installed and running
20+
- Which sites/domains we are hosting
21+
- What docker images we are running
22+
- What packages and modules we are running
23+
- If there are known CVE's for the packages/modules
24+
- What git repositories we are hosting
2525

2626
Additionally we can register and document
2727

28-
* All OpenID Connect setups
29-
* All Services Certificates
28+
- All OpenID Connect setups
29+
- All Services Certificates
3030

3131
Servers, OpenID Connect setups, Services Certificates must be created and maintained manually.
3232
All other information is kept up to date by analysing the DetectionResults.
@@ -74,9 +74,9 @@ AZURE_AZ_OIDC_REDIRECT_URI=https://itksites.local.itkdev.dk/openid-connect/gener
7474

7575
There are not implemented on
7676

77-
* sites
78-
* installations
79-
* domains
77+
- sites
78+
- installations
79+
- domains
8080

8181
This is due to automated processes and scripts that listen from sites and data
8282
is therefore not relevant to have. The architecture makes it possible to delete
@@ -150,7 +150,7 @@ and is not portable across tools.
150150
The following plugins are enabled in `.claude/settings.json`:
151151

152152
| Plugin | Purpose | Source |
153-
|---------------------|-----------------------------------------------------------------------------|------------------------------------------------------------------------------|
153+
| ------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
154154
| `php-lsp` | PHP language server for type-aware code intelligence | [claude-plugins-official](https://github.com/anthropics/claude-code-plugins) |
155155
| `context7` | Up-to-date documentation lookup for Symfony, Doctrine, API Platform, etc. | [claude-plugins-official](https://github.com/anthropics/claude-code-plugins) |
156156
| `code-review` | Pull request code review | [claude-plugins-official](https://github.com/anthropics/claude-code-plugins) |
@@ -162,3 +162,43 @@ The following plugins are enabled in `.claude/settings.json`:
162162
> **Note:** The `php-lsp` plugin requires [Intelephense](https://intelephense.com/)
163163
> installed globally: `npm install -g intelephense`. All other plugins work
164164
> without additional dependencies.
165+
166+
#### Claude Code agents
167+
168+
Custom agents in `.claude/agents/` automate multi-step workflows:
169+
170+
| Agent | Purpose |
171+
| ------------------ | ----------------------------------------------------------------- |
172+
| `pr-readiness` | Runs all CI-equivalent checks locally before creating a PR |
173+
| `create-migration` | Generates and validates a Doctrine migration after entity changes |
174+
175+
#### Claude Code skills
176+
177+
Custom skills in `.claude/skills/` provide repeatable task shortcuts:
178+
179+
| Skill | Invocation | Purpose |
180+
| ----------------- | ------------------ | ----------------------------------------------------- |
181+
| `update-api-spec` | `/update-api-spec` | Regenerate and stage OpenAPI spec files after changes |
182+
183+
#### Claude Code hooks
184+
185+
Hooks in `.claude/settings.json` run automatically on tool events:
186+
187+
| Hook | Trigger | Purpose |
188+
| -------------- | -------------- | ------------------------------------------------------ |
189+
| Docker start | `SessionStart` | Starts Docker services on session start |
190+
| PHP-CS-Fixer | `PostToolUse` | Auto-formats PHP files on edit |
191+
| PHPStan | `PostToolUse` | Runs static analysis on edited PHP files |
192+
| Twig-CS-Fixer | `PostToolUse` | Auto-formats Twig templates on edit |
193+
| Composer norm | `PostToolUse` | Normalizes `composer.json` on edit |
194+
| Prettier | `PostToolUse` | Auto-formats JS, CSS, YAML, and Markdown files on edit |
195+
| Lock guard | `PreToolUse` | Blocks edits to lock files and `.env.local` |
196+
| Container lint | `Stop` | Validates Symfony DI container before stopping |
197+
198+
#### MCP servers
199+
200+
A shared `.mcp.json` provides team-wide MCP server configuration:
201+
202+
| Server | Purpose |
203+
| ---------- | ------------------------------------------------------------------------- |
204+
| `context7` | Live documentation lookup for Symfony, Doctrine, API Platform, and others |

0 commit comments

Comments
 (0)