Loading...
Loading...
Universal platform artifact cleaner: Replit, StackBlitz, CodeSandbox, Glitch
npx skill4agent add levnikolaevich/claude-code-skills ln-724-artifact-cleaner| Aspect | Details |
|---|---|
| Input | Project directory, platform (auto-detect or manual) |
| Output | Clean project without platform dependencies |
| Platforms | Replit, StackBlitz, CodeSandbox, Glitch |
| Duration | ~2-5 minutes |
| Invocation | Called from ln-720 (TRANSFORM mode, conditional) or user-invocable |
| Platform | Config Files | Directories | NPM Packages | Build Config | Comments |
|---|---|---|---|---|---|
| Replit | | | | | |
| StackBlitz | | | -- | Port overrides | -- |
| CodeSandbox | | | -- | CSB env checks | -- |
| Glitch | | | -- | Glitch env vars | -- |
Phase 1: Detect & Scan
|
+---> 1.0 Detect platforms (auto-detect by config files)
+---> 1.1 Scan platform-specific artifacts
|
v
Phase 2: Preview
|
v
Phase 3: Confirm
|
v
Phase 4: Execute (per detected platform)
|
+---> 4.1 Delete files/directories
+---> 4.2 Modify package.json
+---> 4.3 Modify build config (vite/webpack)
+---> 4.4 Remove platform comments
+---> 4.5 Modify .gitignore
|
v
Phase 5: Verify & Report| Platform | Primary Indicator | Confidence |
|---|---|---|
| Replit | | 100% |
| StackBlitz | | 100% |
| CodeSandbox | | 100% |
| Glitch | | 100% |
Detected Platforms:
- replit (confidence: 100%)Files:
- Glob: .replit, replit.nix, .replit.nix
- Glob: vite-plugin-meta-images.ts (if uses REPLIT_* env vars)
Directories:
- Glob: .local/, .cache/, .upm/, .breakpoints
Package.json:
- Grep: "@replit/" in devDependencies
Vite Config:
- Grep: "@replit/" imports
- Grep: "REPL_ID" or "REPLIT_" environment checks
Code:
- Grep: "// @replit" comments in *.tsx, *.ts, *.jsx, *.js
.gitignore:
- Grep: "^\.replit$" lineScan Results:
Platform: Replit
Files Found: 2
- .replit (729 bytes)
- vite-plugin-meta-images.ts (2333 bytes)
Directories Found: 1
- .local/ (6 files, 589KB)
Package Dependencies: 3
- @replit/vite-plugin-cartographer
- @replit/vite-plugin-dev-banner
- @replit/vite-plugin-runtime-error-modal
Build Config Modifications: 4
- Import: runtimeErrorOverlay
- Import: metaImagesPlugin
- Plugin: runtimeErrorOverlay()
- Block: REPL_ID conditional (lines 14-24)
Code Comments: 10
- button.tsx: 5 comments
- badge.tsx: 5 comments
Gitignore Entries: 1
- .replitWill DELETE files:
- .replit (729 bytes)
- vite-plugin-meta-images.ts (2333 bytes)
Will DELETE directories:
- .local/ (6 files, 589KB)
Will MODIFY files:
- package.json: Remove 3 @replit/* devDependencies
- vite.config.ts: Remove 4 imports/plugins/blocks
- 2 UI files: Remove 10 @replit comments
- .gitignore: Remove ".replit" line
Summary: 2 files deleted, 1 directory deleted, 5 files modifiedProceed with platform cleanup (Replit)? [Y/n]rm -f .replit replit.nix .replit.nix
rm -f vite-plugin-meta-images.ts
rm -rf .local/ .cache/ .upm/ .breakpoints@replit/@replit/*REPL_ID// @replit// @replit.*$**/*.tsx**/*.ts**/*.jsx**/*.js.replitrm -f .stackblitzrc
rm -rf .turbo/ # Only if not used in productionrm -f sandbox.config.json
rm -rf .codesandbox/"sandbox"rm -f glitch.json .glitch-assets
rm -rf .glitch/
# .data/ - ASK USER before deleting (may contain important data)PROJECT_DOMAINASSETS_URLCleanup Complete!
Platforms Cleaned: Replit
Deleted:
- .replit
- vite-plugin-meta-images.ts
- .local/ (6 files)
Modified:
- package.json (removed 3 dependencies)
- vite.config.ts (removed 4 imports/plugins)
- button.tsx (removed 5 comments)
- badge.tsx (removed 5 comments)
- .gitignore (removed 1 line)
Next Steps:
1. Run `npm install` to update package-lock.json
2. Run `npm run build` to verify build works
3. Commit: git add . && git commit -m "chore: remove platform artifacts"| Case | Handling |
|---|---|
| No platform artifacts found | Report "Project is clean" and exit |
| Multiple platforms detected | Clean each sequentially, separate reports |
| Project uses Webpack (not Vite) | Search |
| No package.json | Skip NPM cleanup phase |
| Ask user before deleting (may contain data) |
| Error | Action |
|---|---|
| Permission denied | Log error, suggest |
| File in use | Retry after delay, then warn user |
| JSON parse error | Log error, suggest manual fix |
| Build config syntax error | Log error, suggest manual fix |
ln-720-structure-migrator:
Phase 1: Detect project type + platform
Phase 2: Clean artifacts (ln-724-artifact-cleaner) # CONDITIONAL
Condition: Platform detected (Replit/StackBlitz/CodeSandbox/Glitch)
Skipped if: CREATE mode OR no platform markers
Phase 3: Restructure frontend (ln-721)
Phase 4: Generate backend (ln-722)
Phase 5: Generate seed data (ln-723)User: Clean my project from platform artifacts
Claude: Invokes ln-724-artifact-cleanernpm run build