Skip to content

feat: add npm-package-bundler-guard persona - #15

Merged
khaliqgant merged 7 commits into
mainfrom
feat/npm-package-bundler-guard-persona
Apr 29, 2026
Merged

khaliqgant merged 7 commits into
mainfrom
feat/npm-package-bundler-guard-persona

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Apr 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a new persona that catches npm package misconfigurations that break bundlers (Turbopack, webpack, esbuild).

Born from repeated deploy failures where:

  • exports pointed to raw .ts source files — Turbopack can't handle .ts from node_modules
  • files only included src, not dist — published packages had no compiled output
  • Barrel re-exports pulled in heavy transitive deps (e.g. @relayfile/adapter-core → SchemaAdapter) that couldn't resolve outside the monorepo
  • CI only ran tsc --noEmit, missing bundler resolution failures that only surface during next build

The persona audits package.json configs and flags:

  • Blocker: exports → .ts, missing dist in files, file: deps, barrel chains with unresolvable deps
  • Suggestion: missing ./path-mapper subpath exports for zero-dep modules, missing bundler build CI step

Test plan

  • Persona JSON is valid and follows the existing schema
  • Workload router picks it up for npm-package-compat intent

🤖 Generated with Claude Code


Open with Devin

Encodes hard-won lessons from repeated Turbopack deploy failures caused
by misconfigured npm package exports (raw .ts in exports, missing dist
in files, barrel re-export chains pulling unresolvable transitive deps).

Catches: exports → .ts source, missing dist in files, file: deps,
barrel chains with heavy deps, missing subpath exports for zero-dep
utility modules, and missing bundler build steps in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ddc6d700c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1,25 @@
{
"id": "npm-package-bundler-guard",
"intent": "npm-package-compat",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Register new persona intent in router wiring

Adding this intent in JSON alone does not make the persona usable: there are no other references to npm-package-compat/npm-package-bundler-guard in the repo, packages/workload-router/scripts/generate-personas.mjs only emits personas present in exportNameMap (this id is missing there, so generation skips it), and packages/workload-router/src/index.ts does not include this intent in PERSONA_INTENTS or personaCatalog. In practice, resolvePersona can never select this persona, so this commit is a functional no-op.

Useful? React with 👍 / 👎.

devin-ai-integration[bot]

This comment was marked as resolved.

Encodes hard-won lessons from repeated Turbopack deploy failures caused
by misconfigured npm package exports (raw .ts in exports, missing dist
in files, barrel re-export chains pulling unresolvable transitive deps).

Registers the persona across all four integration points:
- personas/npm-package-bundler-guard.json (definition)
- generate-personas.mjs exportNameMap
- PERSONA_INTENTS + personaCatalog in index.ts
- default routing profile (best-value tier)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new npm-package-bundler-guard persona and wires it into the workload router under the npm-package-compat intent to flag npm package configurations that commonly break bundlers.

Changes:

  • Adds personas/npm-package-bundler-guard.json defining the new persona and tiered runtime config.
  • Wires the new persona into the workload-router intent catalog, default routing profile, and persona generation script.
  • Updates routing profile tests/fixtures to include the new intent.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
personas/npm-package-bundler-guard.json Introduces the new persona definition and prompts for bundler/package.json compatibility auditing.
packages/workload-router/src/index.ts Registers the new npm-package-compat intent and maps it to the generated persona spec.
packages/workload-router/src/index.test.ts Updates the custom routing profile fixture to include the new intent.
packages/workload-router/src/generated/personas.ts Adds the generated npmPackageBundlerGuard export used by the router.
packages/workload-router/scripts/generate-personas.mjs Wires the new persona filename/id to an export name so it is included in generation output.
packages/workload-router/routing-profiles/default.json Adds a default tier/rationale for the new npm-package-compat intent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to 125
},
'npm-package-compat': {
tier: 'best-value',
rationale: 'mechanical package.json audits'
}

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

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

A new intent/persona is introduced (npm-package-compat → npm-package-bundler-guard), but the tests never assert that resolvePersona('npm-package-compat') (or personaCatalog['npm-package-compat']) resolves to the expected persona/runtime from the default routing profile. Add a focused assertion to ensure this wiring doesn’t regress (e.g., personaId, tier, harness).

Copilot uses AI. Check for mistakes.
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits April 29, 2026 23:25
…, fix CI

- Add all missing intents to routing-profiles/schema.json (sage-slack-egress-migration, sage-proactive-rewire, cloud-slack-proxy-guard, sage-cloud-e2e-conduction, capability-discovery, npm-package-compat, posthog, persona-authoring, agent-relay-workflow, slop-audit, api-contract-review, local-stack-orchestration, e2e-validation, write-integration-tests)
- Add missing 'agent-relay-workflow' to custom routing profile in test fixture (fixes TS2741 CI failure)
- Add focused test asserting resolvePersona('npm-package-compat') resolves to npm-package-bundler-guard

Co-Authored-By: Khaliq Gant <khaliqgant@gmail.com>
- Remove duplicate agent-relay-workflow.json entry in README
- Add missing persona files to README (api-contract-reviewer, docker-stack-wrangler, e2e-validator, integration-test-author, npm-package-bundler-guard)
- Replace tautological skills.length >= 0 assertion with specific check (3 skills, first is skill.sh/writing-agent-relay-workflows)

Co-Authored-By: Khaliq Gant <khaliqgant@gmail.com>
@khaliqgant
khaliqgant merged commit a900c82 into main Apr 29, 2026
1 of 2 checks passed
@khaliqgant
khaliqgant deleted the feat/npm-package-bundler-guard-persona branch April 29, 2026 23:39
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.

2 participants