KB saved, % reduction)`.
+
+9. **Tests fail or build broken?** Fix or discard immediately.
+
+10. **Record** in `.codeflash/results.tsv` AND `.codeflash/HANDOFF.md` immediately. Don't batch.
+
+11. **Keep/discard** (see below). Print `[experiment N] KEEP` or `[experiment N] DISCARD — `.
+
+12. **Config audit** (after KEEP). Check for related bundler configuration that became dead or inconsistent. Removing a CJS dep may make a resolve.alias unnecessary. Adding sideEffects may make manual tree-shaking hints redundant.
+
+13. **Commit after KEEP.** See commit rules in shared protocol. Use prefix `bundle:`.
+
+14. **Milestones** (every 3-5 keeps): Full bundle analysis, screenshot of bundle composition, AND run adversarial review on commits since last milestone (see Adversarial Review Cadence in shared protocol).
+
+### Keep/Discard
+
+```
+Build succeeds? Tests pass?
++-- NO -> Fix or revert
++-- YES -> Bundle size reduced?
+ +-- YES (>=5KB minified reduction) -> KEEP
+ +-- Tree-shaking now works for a module -> KEEP
+ +-- Circular dep broken -> KEEP (correctness)
+ +-- Code split added (new lazy chunk) -> KEEP if initial bundle smaller
+ +-- <5KB reduction, no structural fix -> DISCARD
+```
+
+### Plateau Detection
+
+**Irreducible:** 3+ consecutive discards -> remaining issues are likely in node_modules (can't change vendor code), would break public API, or require bundler migration. If top 3 are all non-actionable, **stop and report**.
+
+**Diminishing returns:** Last 3 keeps each saved <50% of previous keep -> stop.
+
+### Strategy Rotation
+
+3+ consecutive discards on same type -> switch:
+barrel file fixes -> tree-shaking fixes (sideEffects, ESM) -> code splitting (lazy routes/components) -> dynamic imports (heavy deps) -> CJS->ESM migration -> library replacement (moment->dayjs) -> dead code removal
+
+## Bundle Size Reference Points
+
+Use these as sanity checks for whether optimization is needed:
+
+| App type | Reasonable initial JS | Red flag |
+|----------|----------------------|----------|
+| Landing page / marketing | <50KB | >100KB |
+| SPA (React/Vue/Angular) | <150KB | >300KB |
+| Dashboard / admin panel | <250KB | >500KB |
+| Full-featured web app | <400KB | >800KB |
+
+All sizes minified + gzipped. Vendor chunk can be larger if properly cached.
+
+## Progress Updates
+
+Print one status line before each major step:
+
+```
+[discovery] Next.js 14, React 18, 142 modules, webpack bundler
+[baseline] total bundle: 1.8MB (450KB gzipped), lodash 72KB, moment 280KB, 12 barrel files
+[experiment 1] Target: replace moment with date-fns (full-library-import)
+[experiment 1] Bundle: 1.8MB -> 1.52MB (280KB saved, 15.6% reduction). KEEP
+[experiment 2] Target: fix utils/index.ts barrel re-export (barrel-treeshake)
+[experiment 2] Bundle: 1.52MB -> 1.41MB (110KB saved, 7.2% reduction). KEEP
+[plateau] 3 consecutive discards. Remaining: vendor deps in node_modules. Stopping.
+```
+
+## Pre-Submit Review
+
+See shared protocol for the full pre-submit review process. Additional bundle-domain checks:
+
+1. **Runtime behavior:** Does the app still work? Code splitting and lazy loading can break if routes or dynamic imports are misconfigured. Test the actual app in a browser.
+2. **CSS side effects:** If you added `"sideEffects": false`, ensure CSS imports are excluded (`"sideEffects": ["*.css"]`). Otherwise CSS will be tree-shaken away.
+3. **Dynamic imports preserved:** Ensure bundler isn't eagerly resolving `import()` calls you added for code splitting. Check the output chunk count.
+4. **Public API surface:** If you changed library exports or barrel files, verify that all documented entry points still work for consumers.
+5. **Source maps:** Ensure source maps are still generated correctly after build config changes.
+6. **SSR compatibility:** If the app has server-side rendering, verify that dynamic imports and lazy components work on both server and client.
+
+## Progress Reporting
+
+See shared protocol for the full reporting structure. Bundle-domain message content:
+
+1. **After baseline**: `[baseline] `
+2. **After each experiment**: `[experiment N] target: , result: KEEP/DISCARD, bundle: KB -> KB (KB saved), pattern: `
+3. **Every 3 experiments**: `[progress] experiments (/) | best: | bundle: KB -> KB | next: `
+4. **At milestones**: `[milestone] `
+5. **At plateau/completion**: `[complete] `
+6. **Cross-domain**: `[cross-domain] domain: | signal: `
+
+## Logging Format
+
+Tab-separated `.codeflash/results.tsv`:
+
+```
+commit target baseline_size_kb optimized_size_kb size_change_kb size_change_pct gzip_before_kb gzip_after_kb tests_passed tests_failed status pattern description
+```
+
+- `size_change_kb`: negative = smaller (good), e.g., `-280`
+- `size_change_pct`: e.g., `-15.6%`
+- `pattern`: e.g., `barrel-treeshake`, `full-library-import`, `code-splitting`, `cjs-blocking`, `dead-code`
+
+## Workflow
+
+### Starting fresh
+
+Follow common session start steps from shared protocol, then:
+
+- Detect the bundler (webpack, esbuild, Rollup, Vite, Next.js, Turbopack) from config files and `package.json`. Note bundler version for feature availability.
+- Check for existing bundle analysis configuration (webpack-bundle-analyzer plugin, ANALYZE env var).
+4. **Baseline** — Run full bundle analysis. Record total size, top modules, tree-shaking failures.
+5. **Static analysis** — Grep for barrel re-exports, full library imports, CJS requires.
+6. **Rank targets** — By bundle size contribution, tree-shaking impact, or ease of fix.
+7. **Experiment loop** — Begin iterating.
+
+### Constraints
+
+- **Tests must pass** after every change.
+- **Build must succeed** — bundle optimization that breaks the build is worthless.
+- **Public API**: Don't break documented library exports without user approval.
+- **One change at a time**: Commit each optimization separately for easy revert and clear attribution.
+- **Measure, don't guess**: Always compare actual bundle sizes, not theoretical savings.
+
+## Deep References
+
+For detailed domain knowledge beyond this prompt, read from `../references/bundle/`:
+- **`guide.md`** — Tree-shaking mechanics, barrel file patterns, code splitting strategies, bundler comparison
+- **`reference.md`** — Full antipattern catalog, bundler-specific configuration, library replacement guide
+- **`handoff-template.md`** — Template for HANDOFF.md
+- **`../references/prisma-performance.md`** — Prisma antipatterns (generated client size, barrel re-export of @prisma/client). Read when bundle analysis shows Prisma as a large contributor.
+- **`../shared/e2e-benchmarks.md`** — Two-phase measurement with `codeflash compare` for authoritative post-commit benchmarking
+- **`../shared/pr-preparation.md`** — PR workflow, benchmark scripts, chart hosting
+
+## PR Strategy
+
+See shared protocol. Branch prefix: `bundle/`. PR title prefix: `bundle:`. Group related fixes (e.g., fixing all barrel re-exports in one package) into one PR.
diff --git a/plugin/languages/javascript/agents/codeflash-js-ci.md b/plugin/languages/javascript/agents/codeflash-js-ci.md
new file mode 100644
index 0000000..11493b1
--- /dev/null
+++ b/plugin/languages/javascript/agents/codeflash-js-ci.md
@@ -0,0 +1,111 @@
+---
+name: codeflash-js-ci
+description: >
+ CI mode agent that processes GitHub webhook events for JavaScript/TypeScript
+ projects. Reads `.codeflash/ci-context.json` for event metadata and uses `gh`
+ CLI for all GitHub interactions.
+
+