Skip to content

Commit cc9fca5

Browse files
author
Joseph Edmonds
committed
feat(SkillsDeployPlugin): opt-out env var PHP_QA_CI_DISABLE_CONFIG_PUSH
Skills/agents/hooks are still deployed by default on every composer install/update -- consistent .claude/ config across projects is intentional. But on dev/staging/CI hosts that aren't Claude Code environments, the deployment leaves the working tree dirty and breaks deploy idempotency. Add PHP_QA_CI_DISABLE_CONFIG_PUSH (truthy values per FILTER_VALIDATE_BOOLEAN) as an opt-out. When set, the plugin logs that it was disabled and exits without touching .claude/. When unset (the default), the plugin logs the opt-out instructions on every run so deploy operators can discover the flag and add it to their deploy environment. Also: pre-existing markdown normalisations applied to README.md by mdformat (numbered list escapes under Phase 2/3/4 headings, blank lines before bullet lists). These are unrelated to the feature but would re-apply on the next edit anyway, so committed once together.
1 parent 7d88728 commit cc9fca5

2 files changed

Lines changed: 40 additions & 10 deletions

File tree

README.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,24 @@ Your project's `composer.json` must allow the required plugins:
4747
PHP-QA-CI orchestrates multiple PHP quality tools across four phases:
4848

4949
**Phase 1 -- Code Modification:**
50+
5051
1. Rector (safe functions, PHPUnit, PHP 8.4 upgrades)
5152
2. PHP CS Fixer
5253

5354
**Phase 2 -- Linting and Validation:**
54-
3. PSR-4 Validation
55-
4. Composer Checks
56-
5. Strict Types Enforcement
57-
6. PHP Lint
58-
7. Composer Require Checker
59-
8. Markdown Links Checker
55+
3\. PSR-4 Validation
56+
4\. Composer Checks
57+
5\. Strict Types Enforcement
58+
6\. PHP Lint
59+
7\. Composer Require Checker
60+
8\. Markdown Links Checker
6061

6162
**Phase 3 -- Static Analysis:**
62-
9. PHPStan (level max)
63+
9\. PHPStan (level max)
6364

6465
**Phase 4 -- Testing:**
65-
10. PHPUnit
66-
11. Infection (mutation testing, optional, requires Xdebug)
66+
10\. PHPUnit
67+
11\. Infection (mutation testing, optional, requires Xdebug)
6768

6869
**Post-Success:** PHPLoc (stats only, cannot fail)
6970

@@ -141,6 +142,7 @@ vendor/lts/php-qa-ci/scripts/install-github-actions.bash
141142
```
142143

143144
This will:
145+
144146
- Create `.github/workflows/qa.yml` with an optimized QA pipeline
145147
- Auto-detect your PHP version from `composer.json`
146148
- Configure smart caching for faster builds
@@ -183,6 +185,7 @@ vendor/lts/php-qa-ci/scripts/deploy-skills.bash vendor/lts/php-qa-ci .
183185
```
184186

185187
This will:
188+
186189
- Copy hooks to `.claude/hooks/`
187190
- Register them in `.claude/settings.json`
188191
- Detect and configure hooks-daemon if present (see hooks-daemon documentation for installation)
@@ -199,6 +202,25 @@ This will:
199202

200203
See `.claude/hooks/README.md` for detailed hook documentation after deployment.
201204

205+
### Disabling Auto-Deployment (Dev / Staging / CI Hosts)
206+
207+
Skills, agents and hooks are deployed automatically on every `composer install`
208+
and `composer update` via the `SkillsDeployPlugin`. This is intentional --
209+
keeping `.claude/` config consistent across projects is a core goal.
210+
211+
On hosts where this is unwanted (dev / staging deploys, build images, CI runners
212+
that aren't Claude Code environments) the deployment can leave the working tree
213+
dirty. Opt out by exporting:
214+
215+
```bash
216+
export PHP_QA_CI_DISABLE_CONFIG_PUSH=true
217+
```
218+
219+
When set (any truthy value -- `true`, `1`, `yes`, `on`), the plugin logs that it
220+
was disabled and exits without touching `.claude/`. When unset (the default), the
221+
plugin logs the opt-out instructions every time it runs so deploy operators can
222+
discover the flag.
223+
202224
### Composer Plugins
203225

204226
PHP-QA-CI registers three Composer plugins:

src/ComposerPlugin/SkillsDeployPlugin.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ public static function getSubscribedEvents(): array
5353
*/
5454
public function deploySkills(Event $event): void
5555
{
56-
$io = $event->getIO();
56+
$io = $event->getIO();
57+
58+
if (filter_var(getenv('PHP_QA_CI_DISABLE_CONFIG_PUSH'), FILTER_VALIDATE_BOOLEAN)) {
59+
$io->write('<info>php-qa-ci: Claude config push DISABLED via PHP_QA_CI_DISABLE_CONFIG_PUSH=true — skipping</info>');
60+
61+
return;
62+
}
63+
5764
$composer = $event->getComposer();
5865
$config = $composer->getConfig();
5966

@@ -83,6 +90,7 @@ public function deploySkills(Event $event): void
8390
}
8491

8592
$io->write('<info>Deploying Claude Code Skills, Agents and Hooks...</info>');
93+
$io->write('<comment> (to disable on dev/staging/CI hosts: export PHP_QA_CI_DISABLE_CONFIG_PUSH=true)</comment>');
8694

8795
$command = \sprintf(
8896
'bash %s %s %s 2>&1',

0 commit comments

Comments
 (0)