Forge AI Workspace Architect
Systematic workspace reorganization for AI agent users. Scans workspace, builds safety-first reorganization plan, executes with zero data loss, and verifies everything works afterward.
Systematic workspace reorganization for AI agent users.
Forge scans your AI agent's workspace, builds a safety-first reorganization plan, executes it with zero data loss, and verifies everything works afterward. Built from a battle-tested methodology used on production AI workspaces.
The Problem
AI agent workspaces accumulate chaos fast. Files pile up at root. Memory files reference moved documents. Cron jobs point to old paths. Config files drift. One bad reorganization can brick your agent's memory, break running processes, or corrupt critical state files.
Manual cleanup is dangerous. Automated cleanup without safeguards is worse.
What Forge Does
1. Scan (forge_scan.py)
- - Maps your entire workspace: files, directories, sizes, types
- Discovers all cross-references (file A mentions file B)
- Finds broken references (file A mentions file B, but B doesn't exist)
- Identifies running processes and their file dependencies
- Detects hardcoded paths in scripts and configs
- Catalogs cron jobs, scheduled tasks, and their path dependencies
- Outputs a complete workspace report
2. Plan (forge_plan.py)
- - Generates a reorganization plan based on your configured directory template
- Creates hardline safety rules before touching anything
- Produces an ordered execution sequence with dependency tracking
- Identifies protected files that must never be modified
- Plans reference patches (what needs updating after moves)
- Generates rollback procedures for every step
- Outputs a human-reviewable plan — nothing executes automatically
3. Audit (forge_audit.py)
- - Pre-move audit: Verifies backup exists, creates file manifest, checks all protected files
- Post-move audit: Compares file counts, verifies no files lost, checks all references resolve, validates protected files unchanged
- Content audit: Scans for misplaced content, secrets in wrong locations, orphaned files
- Reference audit: Verifies every cross-reference in every file still resolves
Quick Start
CODEBLOCK0
Design Philosophy
Safety First, Always
- - Never deletes files. Moves only. If something looks like garbage, it goes to archive.
- Never modifies protected files. You define what's protected; Forge won't touch them.
- Backup before changes. Forge refuses to generate a plan without a verified backup.
- Human reviews the plan. Forge doesn't auto-execute. You read the plan, you decide.
- Rollback for every step. Every move in the plan includes how to undo it.
Zero-Deletion Policy
No file is ever deleted during reorganization. Files are moved, never removed. Even files that appear to be duplicates are preserved until you explicitly confirm deletion.
Atomic Reference Updates
When a file moves, every reference to that file must update in the same logical step. Forge tracks these as paired operations: move file + update references = one unit. If the reference update fails, the move should be rolled back.
Framework, Not Opinions
Forge doesn't dictate your directory structure. You configure the template. Forge handles the mechanics of getting there safely.
Use Cases
- - New AI agent setup: Start with a clean, structured workspace from day one
- Workspace recovery: Untangle months of accumulated file chaos
- Platform migration: Moving from one AI agent platform to another
- Team onboarding: Standardize workspace structure across multiple agents
- Pre-deployment cleanup: Verify workspace integrity before going live
- Post-incident audit: Check what broke and what's still intact after a failure
What's Included
| File | Purpose |
|---|
| INLINECODE3 | Workspace scanner and reference mapper |
| INLINECODE4 |
Reorganization planner with safety rules |
|
forge_audit.py | Pre/post audit verification |
|
config_example.py | Configuration template |
|
LIMITATIONS.md | What Forge doesn't do |
|
LICENSE | MIT License |
Requirements
- - Python 3.8+
- No external dependencies (stdlib only)
- Works on any OS (Linux, macOS, Windows)
- Platform-agnostic (OpenClaw, AutoGPT, CrewAI, or any file-based workspace)
Configuration
See config_example.py for the full configuration reference. Key settings:
- -
WORKSPACE_ROOT — Path to your workspace PROTECTED_FILES — Files that must never be modified or movedPROTECTED_DIRS — Directories that must never be touchedDIRECTORY_TEMPLATE — Your desired directory structureBACKUP_DIR — Where backups are storedARCHIVE_DIR — Where "deleted" files actually goREADME_TEMPLATE — Content template for per-directory _README.md files
quality-verified
License
MIT — See LICENSE file.
⚠️ Security Note — Config File Execution
This skill loads configuration from a user-provided Python file using importlib.exec_module. This executes the config file as Python code.
- - Only run config files you have written or fully reviewed
- A malicious or unreviewed config file can execute arbitrary code on your system
- Config path is validated for existence,
.py extension, and size (1MB cap) before execution - Do not run configs provided by untrusted sources without inspection
INLINECODE21 in your config file runs subprocess calls. Only include trusted, pre-validated commands.
⚠️ Disclaimer
This software is provided "AS IS", without warranty of any kind, express or implied.
USE AT YOUR OWN RISK.
- - The author(s) are NOT liable for any damages, losses, or consequences arising from
the use or misuse of this software — including but not limited to financial loss,
data loss, security breaches, business interruption, or any indirect/consequential damages.
- - This software does NOT constitute financial, legal, trading, or professional advice.
- Users are solely responsible for evaluating whether this software is suitable for
their use case, environment, and risk tolerance.
- - No guarantee is made regarding accuracy, reliability, completeness, or fitness
for any particular purpose.
- - The author(s) are not responsible for how third parties use, modify, or distribute
this software after purchase.
By downloading, installing, or using this software, you acknowledge that you have read
this disclaimer and agree to use the software entirely at your own risk.
DATA DISCLAIMER: This software processes and stores data locally on your system.
The author(s) are not responsible for data loss, corruption, or unauthorized access
resulting from software bugs, system failures, or user error. Always maintain
independent backups of important data. This software does not transmit data externally
unless explicitly configured by the user.
Support & Links
| |
|---|
| 🐛 Bug Reports | TheShadowyRose@proton.me |
| ☕ Ko-fi |
ko-fi.com/theshadowrose |
| 🛒
Gumroad |
shadowyrose.gumroad.com |
| 🐦
Twitter |
@TheShadowyRose |
| 🐙
GitHub |
github.com/TheShadowRose |
| 🧠
PromptBase |
promptbase.com/profile/shadowrose |
Built with OpenClaw — thank you for making this possible.
🛠️
Need something custom? Custom OpenClaw agents & skills starting at $500. If you can describe it, I can build it. →
Hire me on Fiverr
Forge AI 工作区架构师
面向AI智能体用户的系统性工作区重组工具。扫描工作区,构建安全优先的重组方案,零数据丢失执行,并验证所有功能正常运行。
面向AI智能体用户的系统性工作区重组工具。
Forge扫描您的AI智能体工作区,构建安全优先的重组方案,零数据丢失执行,并验证所有功能正常运行。基于经过生产级AI工作区实战检验的方法论构建。
问题
AI智能体工作区会迅速积累混乱。文件堆积在根目录。记忆文件引用了已移动的文档。定时任务指向旧路径。配置文件逐渐偏离。一次糟糕的重组可能导致智能体记忆失效、破坏正在运行的进程,或损坏关键状态文件。
手动清理是危险的。没有安全措施的自动清理更糟。
Forge的功能
1. 扫描 (forge_scan.py)
- - 映射整个工作区:文件、目录、大小、类型
- 发现所有交叉引用(文件A提及文件B)
- 查找损坏的引用(文件A提及文件B,但B不存在)
- 识别正在运行的进程及其文件依赖
- 检测脚本和配置文件中的硬编码路径
- 编录定时任务、计划任务及其路径依赖
- 输出完整的工作区报告
2. 规划 (forge_plan.py)
- - 根据您配置的目录模板生成重组方案
- 在操作任何内容前创建硬性安全规则
- 生成带依赖追踪的有序执行序列
- 识别必须永不修改的保护文件
- 规划引用修补(移动后需要更新的内容)
- 为每一步生成回滚流程
- 输出可供人工审查的方案——不自动执行任何操作
3. 审计 (forge_audit.py)
- - 移动前审计: 验证备份存在,创建文件清单,检查所有保护文件
- 移动后审计: 比较文件数量,验证无文件丢失,检查所有引用可解析,确认保护文件未更改
- 内容审计: 扫描错位内容、错误位置的密钥、孤立文件
- 引用审计: 验证每个文件中每个交叉引用仍可解析
快速开始
bash
1. 配置工作区
cp config
example.py forgeconfig.py
编辑 forge_config.py,设置工作区路径、保护文件、目录模板
2. 扫描工作区
python3 forge
scan.py --config forgeconfig.py
3. 生成重组方案
python3 forge
plan.py --config forgeconfig.py --scan-report scan_report.json
4. 审查方案(执行前务必审查)
cat reorg_plan.json
5. 运行移动前审计
python3 forge
audit.py --config forgeconfig.py --phase pre
6. 执行方案(您手动执行或使用自己的脚本)
Forge生成方案。由您执行。这是有意为之。
7. 运行移动后审计
python3 forge
audit.py --config forgeconfig.py --phase post --manifest pre_manifest.txt
设计理念
安全第一,始终如一
- - 绝不删除文件。 仅移动。如果某文件看起来像垃圾,它会被移入归档。
- 绝不修改保护文件。 您定义保护内容;Forge不会触碰它们。
- 变更前备份。 没有经过验证的备份,Forge拒绝生成方案。
- 人工审查方案。 Forge不会自动执行。您阅读方案,您做决定。
- 每一步都可回滚。 方案中的每个移动都包含如何撤销。
零删除策略
重组过程中绝不删除任何文件。文件被移动,而非移除。即使是看似重复的文件也会保留,直到您明确确认删除。
原子引用更新
当文件移动时,对该文件的所有引用必须在同一逻辑步骤中更新。Forge将这些视为配对操作:移动文件 + 更新引用 = 一个单元。如果引用更新失败,移动应被回滚。
框架,而非意见
Forge不规定您的目录结构。您配置模板。Forge负责安全实现这一过程。
使用场景
- - 新AI智能体设置: 从第一天起拥有整洁、结构化的工作区
- 工作区恢复: 理清数月积累的文件混乱
- 平台迁移: 从一个AI智能体平台迁移到另一个
- 团队入职: 在多个智能体间标准化工作区结构
- 部署前清理: 上线前验证工作区完整性
- 事后审计: 检查故障后哪些内容损坏、哪些仍然完好
包含内容
| 文件 | 用途 |
|---|
| forgescan.py | 工作区扫描器和引用映射器 |
| forgeplan.py |
带安全规则的重组规划器 |
| forge_audit.py | 移动前/移动后审计验证 |
| config_example.py | 配置模板 |
| LIMITATIONS.md | Forge不做什么 |
| LICENSE | MIT许可证 |
要求
- - Python 3.8+
- 无外部依赖(仅标准库)
- 适用于任何操作系统(Linux、macOS、Windows)
- 平台无关(OpenClaw、AutoGPT、CrewAI或任何基于文件的工作区)
配置
参见 config_example.py 获取完整配置参考。关键设置:
- - WORKSPACEROOT — 工作区路径
- PROTECTEDFILES — 必须永不修改或移动的文件
- PROTECTEDDIRS — 必须永不触碰的目录
- DIRECTORYTEMPLATE — 您期望的目录结构
- BACKUPDIR — 备份存储位置
- ARCHIVEDIR — 已删除文件实际存放位置
- READMETEMPLATE — 每个目录 README.md 文件的内容模板
质量验证
许可证
MIT — 参见 LICENSE 文件。
⚠️ 安全说明 — 配置文件执行
此技能使用 importlib.exec_module 加载用户提供的Python配置文件。这会作为Python代码执行配置文件。
- - 仅运行您编写或完全审查过的配置文件
- 恶意或未经审查的配置文件可在您的系统上执行任意代码
- 执行前会验证配置路径是否存在、是否为 .py 扩展名以及大小(上限1MB)
- 不要运行来自不可信来源的配置而不加检查
配置文件中的 PROCESSCHECKCOMMANDS 会运行子进程调用。仅包含可信、经过预验证的命令。
⚠️ 免责声明
本软件按原样提供,不附带任何明示或暗示的担保。
使用风险自负。
- - 作者不对因使用或滥用本软件而产生的任何损害、损失或后果负责——包括但不限于财务损失、数据丢失、安全漏洞、业务中断或任何间接/后果性损害。
- 本软件不构成财务、法律、交易或专业建议。
- 用户全权负责评估本软件是否适合其使用场景、环境和风险承受能力。
- 不保证准确性、可靠性、完整性或适用于任何特定目的。
- 作者不对第三方在购买后如何使用、修改或分发本软件负责。
下载、安装或使用本软件即表示您已阅读此免责声明,并同意完全自担风险使用本软件。
数据免责声明: 本软件在您的系统上本地处理和存储数据。作者不对因软件错误、系统故障或用户错误导致的数据丢失、损坏或未经授权访问负责。请始终维护重要数据的独立备份。除非用户明确配置,本软件不会向外部传输数据。
支持与链接
| |
|---|
| 🐛 报告错误 | TheShadowyRose@proton.me |
| ☕ Ko-fi |
ko-fi.com/theshadowrose |
| 🛒
Gumroad |
shadowyrose.gumroad.com |
| 🐦
Twitter |
@TheShadowyRose |
| 🐙
GitHub |
github.com/TheShadowRose |
| 🧠
PromptBase |
promptbase.com/profile/shadowrose |
基于 OpenClaw 构建 — 感谢您让这一切成为可能。
🛠️
需要定制内容? 定制OpenClaw智能体和技能,起价$500。只要您能描述,我就能构建。→
在Fiverr上雇佣我