A workspace engine for AI runtimes.
This project explores a Dockerfile-like authoring model for building detachable AI workspaces from a declarative Workspacefile.
The initial goal is not to run Claude or Codex directly. The initial goal is to define:
- a stable
Workspacefilesyntax - a pipeline model for building an agent workspace
- a portable workspace manifest that different runtimes can consume
- a clear separation between base repo content, attached repos, overlays, and runtime-specific outputs
- a safe way to describe private git sources and MCP runtime inputs without embedding secrets
Current agent systems tend to grow through ad hoc setup paths:
- one path for API-triggered work
- one path for bot-triggered work
- one path for long-lived sessions
- one path for project-specific overlays
This repo treats workspace construction as a first-class build problem.
Workspacefile: declarative build script, inspired by DockerfileNamespace overlay: local files layered into the workspace when the namespace matchesBuild pipeline: normalized stages such asFROM,ATTACH,OVERLAY,PROMPT,TOOLS,EXPORTWorkspace manifest: machine-readable output describing the built workspaceRuntime export: adapters for Codex, Claude, or future AI runtimes
VERSION 1
NAMESPACE moldplan.pm
NAME pm-service
CONFIGURE claude-code
FROM repo "." INCLUDE "src/api" "src/shared" AS main
ATTACH repo "../infra-dashboard" AS dashboard
# ATTACH git "git@github.com:org/private-repo.git" REF "main" AUTH "ssh-agent" AS private_tools
COPY main:"src/utils" "utils"
OVERLAY namespace "moldplan.pm"
PROMPT file "prompts/pm-service.md"
MCP FILE "mcp/base.json" MERGE
MCP SERVER "github" COMMAND "node ./mcp/github.js" ENV "GITHUB_TOKEN" RUNTIME "codex" "claude" AUTH "gh"
PLUGIN npm "@anthropic/superpowers"
# PLUGIN git "github:user/claude-plugin" REF "main"
# PLUGIN path "./plugins/my-plugin"
RUN "echo workspace ready"
SETTINGS model "claude-sonnet-4-20250514"
SETTINGS allowedTools "Edit,Write,Bash"
# SETTINGS MCP SKIP
TOOLS mcp "linear_*" "nomad_*" "line_*"
TOOLS cli "git" "rg" "sed"
EXPORT runtime "codex"
EXPORT runtime "claude"
EXPORT runtime "gemini"
EXPORT runtime "cursor"
EXPORT runtime "windsurf"
EXPORT runtime "amp"Phase 1:
- parse
Workspacefile - normalize instructions into a build plan
- output a
workspace-manifest.json - produce runtime export directories for Codex and Claude
Phase 2:
- support namespace overlay resolution from local directories
- support attached repo declarations
- support private git repo declarations via
AUTHstrategy metadata - support MCP file and MCP server declarations in the manifest and runtime exports
- support variable interpolation and environment inputs
Phase 3:
- execute real workspace materialization
- support detachable archive / restore flows
- expose the engine as a library and CLI
cmd/awe/ CLI entrypoint
internal/workspacefile/ parser and AST
internal/planner/ normalized build plan
internal/manifest/ runtime-neutral manifest model
examples/ sample Workspacefiles
docs/ design notes
This is an exploratory scaffold, but it now supports:
- parsing a
Workspacefilewith full DSL includingAGENT,PLUGIN,RUN,SETTINGS,COPY,INCLUDE - building a normalized manifest
- recording private git source metadata (
git + REF + AUTH) - recording MCP file and MCP server declarations
- selective path inclusion via
INCLUDEonFROM/ATTACH - fine-grained file copying via
COPY(alias:path or absolute path) - writing a bundle with:
workspace-manifest.jsonworkspace/materialized content (with INCLUDE filtering and COPY rules applied)exports/codex/AGENTS.mdexports/claude/CLAUDE.mdexports/claude/.claude/settings.json(MCP auto-inject + SETTINGS)exports/claude/plugins.jsonexports/claude/setup.sh(plugin install + RUN steps, executable)exports/gemini/GEMINI.mdexports/cursor/.cursor/rules/workspace.mdc(with YAML frontmatter)exports/windsurf/.windsurf/rules/workspace.mdexports/amp/AGENTS.md- runtime metadata and MCP artifacts per runtime
- all agent config files are skipped if already present (no overwrite)
Private repos are supported at the definition level through git sources:
FROM git "git@github.com:org/private-repo.git" REF "main" AUTH "ssh-agent" AS mainImportant:
Workspacefiledescribes the auth mechanism only- secrets and tokens are never stored in the file
- the actual credential must already exist in the build environment
Examples of AUTH values:
ssh-agentghglabinherit
The current engine will pass through to the local git command. If the environment can already clone the private repo, the engine can use it too.
Two MCP-related instructions are supported:
MCP FILE "mcp/base.json" MERGE
MCP SERVER "github" COMMAND "node ./mcp/github.js" ENV "GITHUB_TOKEN" RUNTIME "codex" "claude" AUTH "gh"MCP FILEincludes local MCP config files into the manifest and runtime export bundleMCP SERVERrecords runtime MCP server definitions in the manifest and per-runtime metadata
The engine currently exports MCP artifacts into each runtime directory under mcp/.
Install the CLI from a tagged release:
go install github.com/wayne930242/agent-workspace-engine/cmd/awe@v0.3.0Run locally from source:
Print the normalized manifest:
go run ./cmd/awe -file examples/WorkspacefileWrite a bundle to disk:
go run ./cmd/awe -file examples/Workspacefile -write -out ./build/demoFail fast when declared auth strategies are unavailable:
go run ./cmd/awe -file examples/Workspacefile -write -out ./build/demo --strict-authBundle output now includes:
workspace-manifest.jsoncontrol-plane-mapping.jsonworkspace/materialized content- runtime exports for each target
mcp/merged.jsonwhenMCP FILE ... MERGEis declared