ln-724-artifact-cleaner by levnikolaevich/claude-code-skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-724-artifact-cleaner路径说明: 文件路径(
shared/、references/、../ln-*)是相对于技能仓库根目录的。如果在当前工作目录下未找到,请定位到此 SKILL.md 文件所在的目录,然后向上返回一级以找到仓库根目录。如果缺少shared/目录,请通过 WebFetch 从https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}获取文件。
类型: L3 工作者 类别: 7XX 项目引导 父级: ln-720-structure-migrator
移除从在线平台导出的项目中特定于平台的产物,为生产部署做好准备。
| 方面 | 详情 |
|---|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 项目目录,平台(自动检测或手动指定) |
| 输出 | 无平台依赖的干净项目 |
| 支持的平台 | Replit, StackBlitz, CodeSandbox, Glitch |
| 持续时间 | 约 2-5 分钟 |
| 调用方式 | 从 ln-720 调用(TRANSFORM 模式,有条件地)或可由用户调用 |
调用条件:
| 平台 | 配置文件 | 目录 | NPM 包 | 构建配置 | 注释 |
|---|---|---|---|---|---|
| Replit | .replit, replit.nix | .local/, .cache/, .upm/ | @replit/* | REPL_ID 检查 | // @replit |
| StackBlitz | .stackblitzrc | .turbo/ | -- | 端口覆盖 | -- |
| CodeSandbox | sandbox.config.json | .codesandbox/ | -- | CSB 环境检查 | -- |
| Glitch | glitch.json, .glitch-assets | .glitch/, .data/ | -- | Glitch 环境变量 | -- |
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
| 平台 | 主要标识 | 置信度 |
|---|---|---|
| Replit | .replit 文件 | 100% |
| StackBlitz | .stackblitzrc | 100% |
| CodeSandbox | sandbox.config.json | 100% |
| Glitch | glitch.json | 100% |
输出:
Detected Platforms:
- replit (confidence: 100%)
针对每个检测到的平台,使用特定于平台的检测规则扫描产物。
Replit 检测规则:
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$" line
StackBlitz/CodeSandbox/Glitch: 必读: 加载 platform_artifacts.md 以获取检测规则。
Scan 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
- .replit
按平台显示详细的更改预览。
Will 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 modified
Proceed 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
修改 package.json: 从 devDependencies 中移除以 @replit/ 开头的键。
修改 vite.config.ts:
@replit/* 导入REPL_ID 条件块移除 // @replit 注释: 在 **/*.tsx、**/*.ts、**/*.jsx、**/*.js 中 Grep // @replit.*$。
修改 .gitignore: 移除 .replit 行。
rm -f .stackblitzrc
rm -rf .turbo/ # Only if not used in production
rm -f sandbox.config.json
rm -rf .codesandbox/
从 package.json 中移除 "sandbox" 字段(如果存在)。
rm -f glitch.json .glitch-assets
rm -rf .glitch/
# .data/ - ASK USER before deleting (may contain important data)
从服务器代码中移除 Glitch 环境变量检查(PROJECT_DOMAIN、ASSETS_URL)。
Cleanup 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"
| 情况 | 处理方式 |
|---|---|
| 未找到平台产物 | 报告"项目是干净的"并退出 |
| 检测到多个平台 | 按顺序清理每个平台,生成单独的报告 |
| 项目使用 Webpack(非 Vite) | 搜索 webpack.config.* 替代 |
| 没有 package.json | 跳过 NPM 清理阶段 |
.data/ 目录(Glitch) | 删除前询问用户(可能包含数据) |
| 错误 | 操作 |
|---|---|
| 权限被拒绝 | 记录错误,建议 chmod 或管理员权限 |
| 文件正在使用 | 延迟后重试,然后警告用户 |
| JSON 解析错误 | 记录错误,建议手动修复 |
| 构建配置语法错误 | 记录错误,建议手动修复 |
在 TRANSFORM 模式下有条件地调用:
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-cleaner
npm run build版本: 2.0.0 最后更新: 2026-02-07
每周安装次数
134
仓库
GitHub 星标
245
首次出现
2026年2月7日
安全审计
安装于
github-copilot123
claude-code123
cursor123
opencode123
gemini-cli122
codex122
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. Ifshared/is missing, fetch files via WebFetch fromhttps://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
Type: L3 Worker Category: 7XX Project Bootstrap Parent: ln-720-structure-migrator
Removes platform-specific artifacts from projects exported from online platforms, preparing them for production deployment.
| 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 |
Invocation conditions:
| Platform | Config Files | Directories | NPM Packages | Build Config | Comments |
|---|---|---|---|---|---|
| Replit | .replit, replit.nix | .local/, .cache/, .upm/ | @replit/* | REPL_ID checks |
Reference: platform_artifacts.md
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 | .replit file | 100% |
| StackBlitz | .stackblitzrc | 100% |
| CodeSandbox | sandbox.config.json | 100% |
| Glitch | glitch.json | 100% |
Output:
Detected Platforms:
- replit (confidence: 100%)
Per detected platform, scan for artifacts using platform-specific detection rules.
Replit Detection Rules:
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$" line
StackBlitz/CodeSandbox/Glitch: MANDATORY READ: Load platform_artifacts.md for detection rules.
Scan 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
- .replit
Show detailed preview of changes per platform.
Will 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 modified
Proceed with platform cleanup (Replit)? [Y/n]
Options:
Based on detected platforms, dispatch to platform-specific cleanup. Execute sequentially if multiple platforms detected.
Delete files/directories:
rm -f .replit replit.nix .replit.nix
rm -f vite-plugin-meta-images.ts
rm -rf .local/ .cache/ .upm/ .breakpoints
Modify package.json: Remove keys starting with @replit/ from devDependencies.
Modify vite.config.ts:
@replit/* importsREPL_ID conditional blocksRemove// @replit comments: Grep // @replit.*$ in **/*.tsx, **/*.ts, **/*.jsx, **/*.js.
Modify .gitignore: Remove .replit line.
rm -f .stackblitzrc
rm -rf .turbo/ # Only if not used in production
rm -f sandbox.config.json
rm -rf .codesandbox/
Remove "sandbox" field from package.json (if exists).
rm -f glitch.json .glitch-assets
rm -rf .glitch/
# .data/ - ASK USER before deleting (may contain important data)
Remove Glitch env var checks (PROJECT_DOMAIN, ASSETS_URL) from server code.
Cleanup 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 webpack.config.* instead |
| No package.json | Skip NPM cleanup phase |
.data/ directory (Glitch) | Ask user before deleting (may contain data) |
| Error | Action |
|---|---|
| Permission denied | Log error, suggest chmod or admin rights |
| 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 |
Called conditionally in TRANSFORM mode:
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-cleaner
npm run build after cleanupVersion: 2.0.0 Last Updated: 2026-02-07
Weekly Installs
134
Repository
GitHub Stars
245
First Seen
Feb 7, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
github-copilot123
claude-code123
cursor123
opencode123
gemini-cli122
codex122
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
36,300 周安装
// @replit |
| StackBlitz | .stackblitzrc | .turbo/ | -- | Port overrides | -- |
| CodeSandbox | sandbox.config.json | .codesandbox/ | -- | CSB env checks | -- |
| Glitch | glitch.json, .glitch-assets | .glitch/, .data/ | -- | Glitch env vars | -- |