Skip to content

[#2580] Optimised .vortex/CLAUDE.md and unified the snapshot update path.#2583

Open
AlexSkrypnyk wants to merge 2 commits into
mainfrom
feature/2580-optimise-claude-md
Open

[#2580] Optimised .vortex/CLAUDE.md and unified the snapshot update path.#2583
AlexSkrypnyk wants to merge 2 commits into
mainfrom
feature/2580-optimise-claude-md

Conversation

@AlexSkrypnyk
Copy link
Copy Markdown
Member

@AlexSkrypnyk AlexSkrypnyk commented Jun 7, 2026

Closes #2580

Summary

The .vortex/CLAUDE.md maintenance guide had grown to 282 lines, carrying content duplicated from the always-loaded root AGENTS.md and the sibling subsystem guides, four near-identical update-snapshots rule blocks, and a deep video-pipeline reference that only matters when editing the video system itself. This pass trims it to 174 lines (~38% smaller), removes the duplication, verifies the remaining instructions against the current ahoy targets and code, and makes ahoy update-snapshots the single documented way to regenerate fixtures.

Changes

.vortex/CLAUDE.md

  • Removed the verbatim "HIGHEST PRIORITY RULE - Bash Commands" block, which is already present in the always-loaded root AGENTS.md, so it no longer lands in context twice.
  • Consolidated the four repeated update-snapshots HARD RULE blocks into a single Snapshots section that preserves every constraint (commit first, foreground only, no wrappers, the ahoy --file pointer).
  • Made ahoy update-snapshots the only documented path: dropped the UPDATE_SNAPSHOTS row from the Environment Variables table and added an explicit instruction never to set UPDATE_SNAPSHOTS by hand.
  • Moved the documentation-video pipeline internals (orchestrator, workspace, VIDEOS config array, --keep iteration) out to .vortex/docs/CLAUDE.md, keeping a concise staleness-trigger summary plus a pointer.
  • Deduplicated the shell-script pattern (this file now holds the single canonical copy) and tightened the AI Assistant Guidelines.

.vortex/docs/CLAUDE.md

  • Added a Documentation videos section holding the pipeline internals relocated from the maintenance guide, where they sit next to the update-videos.php orchestrator they describe.

.vortex/tests/CLAUDE.md

  • Corrected the Commands block, which pointed at .vortex/installer with installer commands instead of .vortex/tests.
  • Replaced the duplicated shell-script pattern with a pointer to the canonical copy in .vortex/CLAUDE.md.

.vortex/installer/tests/Functional/Handlers/AbstractHandlerProcessTestCase.php

  • Repointed the class docblock from "Run with UPDATE_SNAPSHOTS=1" to "Run ahoy update-snapshots from .vortex/", removing the last place that advertised the second snapshot path.

Before / After

BEFORE - .vortex/CLAUDE.md (282 lines)        AFTER - .vortex/CLAUDE.md (174 lines)
├── HIGHEST PRIORITY: Bash Commands  ✗dup     ├── Project Structure
├── Project Structure                         ├── Subsystems
├── Subsystems                                ├── Tooling package (canonical script pattern)
├── Tooling package (script pattern)          ├── Quick Commands
├── Quick Commands                            ├── Snapshots (one rule, ahoy-only)
├── Cross-System Workflow                     ├── Cross-System Workflow
│   ├── 4x HARD RULE (update-snapshots)       ├── Documentation videos (triggers + pointer) ─┐
│   ├── script/file update steps              ├── Environment Variables (no UPDATE_SNAPSHOTS) │
│   ├── Documentation videos (~55 lines)      └── AI Assistant Guidelines                     │
│   └── installer prompt-flow change                                                          │
├── Environment Variables (UPDATE_SNAPSHOTS)  .vortex/docs/CLAUDE.md                          │
└── AI Assistant Guidelines (re-states rule)  └── Documentation videos (pipeline internals) ◀─┘

Summary by CodeRabbit

  • Documentation

    • Updated developer maintenance guides with clarified testing snapshot and video generation procedures.
  • Chores

    • Reorganized internal documentation structure for improved clarity and accessibility.

…ath.

Removed the Bash-commands rule block (kept in AGENTS.md), consolidated the snapshot HARD RULES, and made 'ahoy update-snapshots' the only documented path by dropping the 'UPDATE_SNAPSHOTS' advert from the env table and the installer test docblock. Moved the documentation-video pipeline internals to 'docs/CLAUDE.md', fixed the wrong working directory in 'tests/CLAUDE.md', and deduplicated the shell-script pattern.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 7, 2026

Review Change Stack

Walkthrough

This PR reorganizes and standardizes the maintenance documentation across the vortex repository's CLAUDE.md guides. It removes outdated bash-command rules, restructures guidance for snapshots and videos, standardizes the snapshot regeneration workflow to use ahoy update-snapshots, and adds comprehensive documentation for video generation and testing procedures.

Changes

Documentation and Workflow Standardization

Layer / File(s) Summary
Main CLAUDE.md Reorganization and Rule Updates
.vortex/CLAUDE.md
Removed the HIGHEST PRIORITY bash-command rule, standardized project structure guidance, reorganized subsystem CLAUDE.md pointers and tooling package sections, then added dedicated Publishing and Quick Commands sections, introduced explicit Snapshots hard rules (commit-first, foreground-only, no wrappers), updated Cross-System Workflow steps, shortened Documentation videos, removed UPDATE_SNAPSHOTS=1 from Environment Variables, and refreshed AI Assistant Guidelines with new restrictions and formatting standards.
Snapshot Update Workflow Standardization
.vortex/installer/tests/Functional/Handlers/AbstractHandlerProcessTestCase.php, .vortex/tests/CLAUDE.md
Updated snapshot regeneration instructions to use ahoy update-snapshots from .vortex/ instead of UPDATE_SNAPSHOTS=1, and revised the PHPUnit test command flow to explicitly cd into .vortex/tests before running composer install, linting, and tests. Added test maintenance guidance to run ahoy update-snapshots after modifying PHPUnit tests.
Documentation Video Generation Guide
.vortex/docs/CLAUDE.md
Added a new comprehensive section describing Docusaurus video generation and maintenance, including the command matrix for ahoy update-videos, fixed workspace behavior, per-video configuration source, step-by-step recording pipeline, iteration with --keep, and notes on manual commits and release-time regeneration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • drevops/vortex#1978: Updates .vortex/CLAUDE.md maintenance and AI-guideline instructions with overlapping changes to testing workflow and fixture snapshot guidance.
  • drevops/vortex#2541: Both PRs update .vortex/CLAUDE.md tooling package workflow and change fixture regeneration steps to use ahoy update-snapshots.
  • drevops/vortex#2537: Both PRs modify the snapshot-updating procedure to use ahoy update-snapshots and establish hard rules around its usage without wrapper scripts.

Poem

A rabbit hops through docs so clear,
Where snapshots dance and videos cheer,
The guidance glows with rules so neat—
ahoy update-snapshots, oh what a treat! 🐰✨
No bash commands to confuse the way,
Just clear instructions to save the day.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: optimizing .vortex/CLAUDE.md and unifying the snapshot update path to ahoy update-snapshots.
Linked Issues check ✅ Passed The PR successfully addresses the linked issue #2580 by optimizing .vortex/CLAUDE.md through consolidation, deduplication, and clarification of the snapshot update workflow.
Out of Scope Changes check ✅ Passed All changes are directly related to the PR objective: documentation updates in .vortex files, deduplication of content, consolidation of snapshot rules, and a single docblock update in test code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/2580-optimise-claude-md

Comment @coderabbitai help to get the list of available commands and usage tips.

@AlexSkrypnyk AlexSkrypnyk added this to the 1.40.0 milestone Jun 7, 2026
@AlexSkrypnyk AlexSkrypnyk added the A3 Board worker 3 label Jun 7, 2026
@github-actions

This comment has been minimized.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.vortex/docs/CLAUDE.md:
- Around line 80-81: The code currently calls $recorder->fail("Docker stack
'$compose_project' is not running") and returns 1 when needs_built_project is
true and isDockerStackRunning($compose_project) is false, which contradicts the
docs for --keep; change the behavior so it exits cleanly instead of failing:
replace the fail(...) + return 1 with a non-error path (e.g., call
$recorder->note(...) or $recorder->info(...) to log the message and return 0),
keeping the existing note('Rerun without --keep to bootstrap fresh.') and
ensuring this branch returns success rather than an error code.
- Around line 94-104: Update the example sequence in the CLAUDE.md docs to
remove the incorrect first use of the --keep flag: the initial command should be
"ahoy update-videos lint" to perform the full bootstrap + record lint (since
--keep skips bootstrap and requires an existing workspace), then show "ahoy
update-videos --keep lint" to reuse the kept workspace, and finally "ahoy
update-videos lint" for a fresh bootstrap that cleans up; adjust the three
example lines around the ahoy update-videos invocation accordingly so comments
match behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2043d645-0e39-4567-9039-10d03398e8d3

📥 Commits

Reviewing files that changed from the base of the PR and between 818eab0 and a78ede4.

📒 Files selected for processing (4)
  • .vortex/CLAUDE.md
  • .vortex/docs/CLAUDE.md
  • .vortex/installer/tests/Functional/Handlers/AbstractHandlerProcessTestCase.php
  • .vortex/tests/CLAUDE.md

Comment thread .vortex/docs/CLAUDE.md
Comment on lines +80 to +81
bootstraps from scratch; `--keep` reuses the existing workspace and exits cleanly
if the Docker stack is not running.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Correct the exit behavior for missing Docker stack.

The documentation states that --keep "exits cleanly if the Docker stack is not running," but the orchestrator actually fails with exit code 1 and error message when the stack is missing.

Context snippet 4 shows:

if ($needs_built_project && !$recorder->isDockerStackRunning($compose_project)) {
  $recorder->fail("Docker stack '$compose_project' is not running");
  $recorder->note('Rerun without --keep to bootstrap fresh.');
  return 1;
}
📝 Proposed fix
-bootstraps from scratch; `--keep` reuses the existing workspace and exits cleanly
-if the Docker stack is not running.
+bootstraps from scratch; `--keep` reuses the existing workspace and fails if the
+Docker stack is not running (when recording commands that need Docker).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.vortex/docs/CLAUDE.md around lines 80 - 81, The code currently calls
$recorder->fail("Docker stack '$compose_project' is not running") and returns 1
when needs_built_project is true and isDockerStackRunning($compose_project) is
false, which contradicts the docs for --keep; change the behavior so it exits
cleanly instead of failing: replace the fail(...) + return 1 with a non-error
path (e.g., call $recorder->note(...) or $recorder->info(...) to log the message
and return 0), keeping the existing note('Rerun without --keep to bootstrap
fresh.') and ensuring this branch returns success rather than an error code.

Comment thread .vortex/docs/CLAUDE.md
Comment on lines +94 to +104
**Iterating on one video** - use `--keep` so the install + build happens only
once, then replay the recording against the preserved project:

```bash
cd .vortex
ahoy update-videos --keep lint # full bootstrap + record lint, keep workspace
# tweak the lint command or the recorder
ahoy update-videos --keep lint # reuse the kept workspace, record lint only
ahoy update-videos lint # fresh bootstrap, no --keep, cleans up at end
# (or manually) rm -rf .artifacts/tmp/videos-workspace
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix the iteration workflow example - first command cannot use --keep.

The workflow example shows ahoy update-videos --keep lint as the first command with a comment claiming "full bootstrap + record lint, keep workspace". This is incorrect:

  1. --keep skips the bootstrap and requires an existing workspace (lines 80-81 and the command matrix at line 74).
  2. If no workspace exists, --keep will fail immediately (verified by snippet 4's workspace existence check).
  3. The comment "full bootstrap" contradicts the --keep flag's documented behavior.
🔧 Proposed fix
 **Iterating on one video** - use `--keep` so the install + build happens only
 once, then replay the recording against the preserved project:
 
 ```bash
 cd .vortex
-ahoy update-videos --keep lint     # full bootstrap + record lint, keep workspace
+ahoy update-videos lint            # full bootstrap + record lint, keep workspace
 # tweak the lint command or the recorder
 ahoy update-videos --keep lint     # reuse the kept workspace, record lint only
-ahoy update-videos lint            # fresh bootstrap, no --keep, cleans up at end
 # (or manually) rm -rf .artifacts/tmp/videos-workspace
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.vortex/docs/CLAUDE.md around lines 94 - 104, Update the example sequence in
the CLAUDE.md docs to remove the incorrect first use of the --keep flag: the
initial command should be "ahoy update-videos lint" to perform the full
bootstrap + record lint (since --keep skips bootstrap and requires an existing
workspace), then show "ahoy update-videos --keep lint" to reuse the kept
workspace, and finally "ahoy update-videos lint" for a fresh bootstrap that
cleans up; adjust the three example lines around the ahoy update-videos
invocation accordingly so comments match behavior.


</details>

<!-- fingerprinting:phantom:triton:puma -->

<!-- cr-comment:v1:7793e7f6588848c32895ab95 -->

<!-- This is an auto-generated comment by CodeRabbit -->

@AlexSkrypnyk

This comment has been minimized.

1 similar comment
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk AlexSkrypnyk added the Needs review Pull request needs a review from assigned developers label Jun 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 7, 2026

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.56% (205/208)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk

This comment has been minimized.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk
Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.56% (205/208)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.38%. Comparing base (818eab0) to head (0015919).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2583   +/-   ##
=======================================
  Coverage   88.38%   88.38%           
=======================================
  Files           7        7           
  Lines         353      353           
  Branches        3        3           
=======================================
  Hits          312      312           
  Misses         41       41           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A3 Board worker 3 Needs review Pull request needs a review from assigned developers

Projects

Status: BACKLOG

Development

Successfully merging this pull request may close these issues.

Optimise .vortex/CLAUDE.md

1 participant