okhp3-replit-multi-artifact

Diagnose and prevent silent failures in Replit pnpm multi-artifact monorepos.

1|Updated Jun 13, 2026
One-click install
npx skills add https://github.com/OKHP3/refoldec --skill okhp3-replit-multi-artifact-okhp3
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: okhp3-replit-multi-artifact
Source: https://github.com/OKHP3/refoldec/tree/main/.agents/skills/okhp3-replit-multi-artifact
Command: npx skills add https://github.com/OKHP3/refoldec --skill okhp3-replit-multi-artifact-okhp3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding a second artifact to a Replit pnpm monorepo triggers non-obvious failures—blank previews, port conflicts, broken API routes, and duplicate dependency instances—that cost multiple debugging turns because none of the rules are documented in the artifact creation walkthrough. ## Core Features & Use Cases - BASE_URL prefix discipline: Enforces prepending import.meta.env.BASE_URL to every route and API call so requests stay inside the artifact's path-based mount. - PORT and workflow rules: Requires reading the PORT env var, setting allowedHosts: true in Vite, and using managed workflow names (artifacts/<slug>: <service-name>) instead of configureWorkflow replacements. - pnpm catalog and workspace wiring: Prevents catalog drift from off-catalog pins and wires cross-artifact shared libraries via workspace:* dependencies. - Use Case: When a preview pane goes blank after adding a second artifact, work through the seven-step debug checklist covering workflow state, openPorts, allowedHosts, PORT reading, BASE_URL usage, restarts, and catalog drift. ## Quick Start Ask the agent to diagnose why your Replit artifact preview is blank or why API calls 404 after adding a second artifact to the monorepo.

Frequently Asked Questions about okhp3-replit-multi-artifact

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why do my Replit artifact API calls return 404 when the endpoint exists?▼

Root-relative URLs like /api/users escape the artifact's path-based mount prefix on Replit. Prepend import.meta.env.BASE_URL to every fetch call, using fetch(`${BASE}api/users`) since BASE_URL already includes a trailing slash.

How do I fix a blank preview pane in a Replit multi-artifact monorepo?▼

Work through the debug checklist in order: confirm the workflow is running, check openPorts via getWorkflowStatus, set allowedHosts: true in Vite config, verify the server reads the PORT env var, ensure BASE_URL prefixes all routes, restart the workflow, and check for pnpm catalog drift.

Should I use configureWorkflow to restart a Replit artifact service?▼

No. Managed workflows named artifacts/<slug>: <service-name> inject PORT, BASE_PATH, and proxy routing configuration. Use the WorkflowsRestart tool or restartWorkflow with the exact managed name; a configureWorkflow replacement omits this configuration and creates a conflicting preview path.

How do I share code between artifacts in a pnpm workspace?▼

Create the library as a package named @workspace/<name>, add it to the consuming artifact's package.json as "workspace:*", run pnpm install from the workspace root, and import by package name. Relative paths break TypeScript project references and Vite module resolution.

Why does my Vite plugin typecheck fail in a pnpm workspace?▼

Off-catalog version pins create duplicate store instances, so TypeScript sees two incompatible copies of the same package. Replace exact pins with "catalog:" references for packages listed in pnpm-workspace.yaml, then run pnpm install from the root.

When is this multi-artifact guidance not applicable?▼

It does not cover artifact bootstrapping, workflow restart mechanics, package installation, or secrets management—those belong to the artifacts, workflows, package-management, and environment-secrets skills respectively. Single standalone apps outside a Replit monorepo are also out of scope.