Skip to content

feat(runtime): wire plan-to-git Claude hooks and PR sync#398

Merged
skulidropek merged 2 commits into
mainfrom
issue-397-plan-to-git-hooks-sync
Jun 11, 2026
Merged

feat(runtime): wire plan-to-git Claude hooks and PR sync#398
skulidropek merged 2 commits into
mainfrom
issue-397-plan-to-git-hooks-sync

Conversation

@skulidropek

@skulidropek skulidropek commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Pins generated project containers to a plan-to-git build with Claude Code capture, temp-backed state, and sync --pr.
  • Installs a shared /opt/docker-git/hooks/plan-to-git-sync helper that syncs all queued agent plans to an explicit PR when available, with branch discovery fallback.
  • Adds Claude Code Stop and UserPromptSubmit hooks via an idempotent JSON merge into CLAUDE_CONFIG_DIR/settings.json.
  • Backfills both Codex and Claude histories before post-push plan sync.

Closes #397

Verification

  • bun run --filter @effect-template/lib test -- core/templates.test.ts
  • bun --cwd packages/app vitest run tests/docker-git/core-templates.test.ts
  • bun run --filter @effect-template/lib test -- core/git-post-push-wrapper.test.ts
  • bun run --filter @effect-template/lib typecheck
  • bun run --filter @prover-coder-ai/docker-git typecheck
  • generated hook scripts extracted from renderEntrypointGitHooks() pass bash -n
  • bun run check
  • bun run test

Mathematical Guarantees

  • Invariant: PLAN_TO_GIT_STATE_DIR defaults to /tmp/plan-to-git, so hook state stays outside the git checkout unless explicitly overridden.
  • Invariant: Claude settings merge preserves existing settings and appends the managed hook only when missing.
  • Invariant: one sync helper processes queued state across agent sources; Codex, Claude Code, Grok/future supported agents share the same plan-to-git sync path.
  • Postcondition: if a PR number is known through env or REPO_REF=refs/pull/<n>/head, runtime calls plan-to-git sync --pr <n>; otherwise it falls back to current branch discovery.

@skulidropek

skulidropek commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: 8a14af1
Status: success
Files: 12 (7.06 MB)
Links: README | Manifest

git status

On branch issue-397-plan-to-git-hooks-sync
Your branch is up to date with 'origin/issue-397-plan-to-git-hooks-sync'.

nothing to commit, working tree clean

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@skulidropek, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 26 minutes and 55 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e273d49b-f54f-4ea9-a28a-fd23a259d0b3

📥 Commits

Reviewing files that changed from the base of the PR and between 8889c5c and 9879e5a.

📒 Files selected for processing (10)
  • .changeset/plan-to-git-claude-hooks.md
  • packages/app/src/lib/core/templates-entrypoint/git-hooks.ts
  • packages/app/src/lib/core/templates-entrypoint/plan-to-git.ts
  • packages/app/src/lib/core/templates/dockerfile-prelude.ts
  • packages/app/tests/docker-git/core-templates.test.ts
  • packages/lib/src/core/templates-entrypoint/git-hooks.ts
  • packages/lib/src/core/templates-entrypoint/plan-to-git.ts
  • packages/lib/src/core/templates/dockerfile-prelude.ts
  • packages/lib/tests/core/git-post-push-wrapper.test.ts
  • packages/lib/tests/core/templates.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-397-plan-to-git-hooks-sync

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@skulidropek skulidropek changed the title feat(runtime): wire plan-to-git claude hooks and pr sync feat(runtime): wire plan-to-git Claude hooks and PR sync Jun 11, 2026
@skulidropek

skulidropek commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: 9879e5a
Status: success
Files: 13 (7.99 MB)
Links: README | Manifest

git status

On branch issue-397-plan-to-git-hooks-sync
Your branch is up to date with 'origin/issue-397-plan-to-git-hooks-sync'.

nothing to commit, working tree clean

@skulidropek skulidropek merged commit 3d19177 into main Jun 11, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Подключить plan-to-git: Claude Code hooks и автосинк всех агентов в GitHub PR

1 participant