Guide

Run an agent that scaffolds a new project

Let an agent running on your connect0 core write boilerplate into a fresh `/workspace/` with `upload.write`. A worked example of an agent as code generator on the core.

5/18/2026 · connect0 · 3 min

An agent running on the core lays down a whole project's boilerplate into a clean workspace, one audited file at a time.

You're starting a new project. You want the agent to lay down the boilerplate — package.json, tsconfig, basic source files — into a clean /workspace/. upload.write is the right tool.

Why upload.write here

The agent already knows what the files should contain (you'll describe the project in prose; it'll generate). The user doesn't have a file to PUT. So:

  • upload.create_link — wrong tool; nothing to upload.
  • sh "cat > foo" — works for one or two files, gets ugly fast for ten.
  • upload.write — one call per file, clean audit trail, no shell escaping nightmares.

The flow

"Scaffold a TypeScript CLI project at /workspace/cli — package.json with a start script, tsconfig with strict mode, src/index.ts with a basic argparse loop."

Agent (sequentially):

upload.write {
  "target_path": "cli/package.json",
  "content_text": "{\n  \"name\": \"cli\",\n  \"version\": \"0.1.0\",\n  \"type\": \"module\",\n  \"scripts\": { \"start\": \"tsx src/index.ts\" }\n}"
}

upload.write {
  "target_path": "cli/tsconfig.json",
  "content_text": "{\n  \"compilerOptions\": { \"target\": \"ES2022\", \"strict\": true, ... }\n}"
}

upload.write {
  "target_path": "cli/src/index.ts",
  "content_text": "// agent-generated CLI scaffold\n..."
}

Each call lands an audit row with source = 'mcp-write'. The dashboard shows them grouped by issuance time.

Then verify

> Show me what you wrote.
sh "find /workspace/cli -type f"
sh "cat /workspace/cli/package.json"

Why not zip the whole tree?

The agent could base64-encode a tarball into upload.write and unpack via sh. Don't — it's harder to read in the audit, and the per-file path-canonicalisation rules (no .., no hidden segments, sane characters) give you a small but real safety net per write.

When to graduate to a different tool

  • The boilerplate is your real template, not something the agent should "generate." Upload it as a tarball (upload-tarball guide) and sh "tar -x". Faster than ten upload.write calls.
  • You're scaffolding the same shape repeatedly. Move the template into a remote git repo and have the agent sh "git clone" from it (with egress=open).

Limits

  • 1 MiB per call (size cap on upload.write). For files larger than that, switch to upload.create_link and feed the bytes via a temp file the agent generates locally first.
  • One file per call — no batching. Each is independently audited.

Next steps

Where this fits

This is the Run your agents pillar of connect0 — the core that connects everything your company runs on. The agent runs on the core, generating each scaffold file straight into your project's isolated workspace — one audited upload.write at a time. Start building → · All guides →