amplifier-workspace / templates
AGENTS.md1 starsChanged 25 days agoMITView on GitHub
A temporary working repository for cross-repo development. Created fresh for a task; destroyed when complete. Invariant: Every repo in this workspace lives as a subdirectory of cwd with its own .git — either a submodule (remote exists) or a local-only git repo (pre-publish). The workspace root is never the root of any project's source tree. Forbidden — no matter how convenient it seems: Why: The workspace is destroyed at session end. Self-containment is what makes destruction safe. Edits outside cwd,…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Invariant: Every repo in this workspace lives as a subdirectory of cwd with its own .git — either a submodule (remote exists) or a …
- Distinctive: line 35
Rule of thumb: If it doesn't need to persist past workspace destruction, the root is fine.
- Very specific: line 47
Don't reconstruct that guidance from memory.
- Distinctive: line 63
Don't store anything that needs long-term persistance in the root directory.
- Distinctive: line 71
If the intended lifetime is unclear, clarify it before treating a resource as disposable.
- Very specific: line 73
Add each cleanup liability at the workspace root (create the file if absent).
- Very specific: line 87
Create SCRATCH.md at the workspace root as your working memory:
- Distinctive: line 91
Keep bounded: retain needed history in investigation records or a task-history file before pruning.
- Distinctive: line 93
Keep AGENTS.md for current conventions, not task chronology.
- Distinctive: line 112
When a project subdir is ready to ship:
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Development Workspace
A temporary working repository for cross-repo development. Created fresh for a task; destroyed when complete.
THE RULES
Invariant: Every repo in this workspace lives as a subdirectory of cwd with its own .git — either a submodule (remote exists) or a local-only git repo (pre-publish). The workspace root is never the root of any project's source tree.
| User says… | You do (exactly this) |
| "pull down X", "get X", "clone X", "add X" | git submodule add <url> in cwd |
| "start a new project X", "let's build X" (no repo yet) | mkdir X && cd X && git init — all new code goes inside this subdir |
| "publish X" / "push X to github" (local-only project) | From inside the subdir: gh repo create --source=. --push |
Forbidden — no matter how convenient it seems:
- ❌
git clone <url>orgh repo clone <url>for adding a repo to this workspace — usegit submodule addinstead - ❌ Using an existing checkout elsewhere on the filesystem (e.g.
~/repos/X/,../X/). The "helpful reuse" anti-pattern: edits land in the wrong checkout and versions drift. - ❌ Scanning parent directories or
~/looking for existing clones to reuse - ❌ Creating new-project source (code/configs meant to become a published repo) at the workspace root. The "workspace-as-project-root" anti-pattern: when you later "publish this," the workspace scraps, submodule refs, and
SCRATCH.mdend up in your project's initial commit. Persistent new-project code goes in a subdir (see table above). Ephemeral files at the root are fine — see next section. - ❌ Committing new-project code to the workspace git — it's throwaway. New-project code belongs in the subdir's own git.
Why: The workspace is destroyed at session end. Self-containment is what makes destruction safe. Edits outside cwd, or persistent project code mingled with workspace scraps, cause lost work or polluted initial commits.
What the Workspace Root IS For
The root is the right place for anything ephemeral that doesn't need to survive session end:
- Throwaway scripts and experiments
- Temporary files for the user to inspect, hand off, or reuse in-session
- Cross-repo scratch work — exploration, comparisons, notes that don't belong to any single repo
- Planning docs, design drafts, announcement copy that serve their purpose this session and aren't meant for a repo
- Output of analysis or investigation runs
Rule of thumb: If it doesn't need to persist past workspace destruction, the root is fine. If it does, it goes in a subdir (submodule or local git) — no exceptions.
Feel free to use the root liberally for this category of work. The constraint is persistence, not file creation.
Each Subdir Is a Repo With Its Own Rules
The rules above govern the root. Each subdir is a separate repo with its own conventions, and inside that subdir those conventions override your workspace defaults — you are a guest there.
When you start work in a subdir — and again when the work shifts phase (design → code → debug → verify → PR) — discover and honor that repo's convention files: AGENTS.md, .github/PULL_REQUEST_TEMPLATE.md, CONTRIBUTING.md, and contextual files like PRINCIPLES.md / SMOKE_TESTS.md / KNOWN_ISSUES.md. Read them before you change the furniture; re-read them as the work changes shape; populate the PR template from real evidence, not paraphrase.
Before completion, propose reusable lessons for the guidance that owns them, honoring awareness boundaries and applicable approval requirements. Preserve each lesson's object, scope, and phase; do not turn a past failure into a broader standing restriction. Keep incident narratives in task history, not standing instructions.
Don't reconstruct that guidance from memory. Load the per-repo-conventions skill, or read foundation:docs/PER_REPO_CONVENTIONS.md, for the full discovery pattern, re-read cadence, verification gradient, and lesson-capture routing.
Verification and Missing Tools
- Match the requested evidence. Static inspection and unit tests support verification; they do not replace a requested live-model or deployed-workload test. Run the actual workflow and inspect its result. A prompted acknowledgment alone does not prove tool dispatch: check the genuine tool call and result when claiming tool use.
- Isolate execution when the host path is unsafe. Do not run the host
amplifierwith a scratchAMPLIFIER_HOME: first-run module installation can change its shared tool environment. Use a DTU for runtime verification instead. Prefer the Docker Compose Smart Tool,digital-twin-universe, for new compatible environments; keep existing resources on their original backend. Its profiles and state are not interchangeable with Incusamplifier-digital-twin. - Discover before installing. Check the selected executable's version, read its installed
--help, and usedigital-twin-universe checkfor Docker readiness. This is deterministic;installis model-backed Docker setup, not a readiness probe. For a missing tool, use the owning project's installation instructions: DTU Smart Tool and optional legacy Amplifier Tester. - Complete ordinary authorized setup. A missing executable or agent is a setup task, not a reason to downgrade the test or hand routine steps back to the user. Install only the needed capability within the task's authority. Package installation, Docker readiness, workload credentials, and session-loaded agents are separate checks; the Smart CLI works without installing every bundle. Stop at actual permission, credential, license, or safety refusals; do not bypass them or silently upgrade shared tools.
- Verify and clean up. Inspect inner command exit status and semantic output, not just the outer wrapper's exit code. If a result is uncertain, inspect it before retrying. Forward only needed credentials by reference, never in logs or evidence. Retain required evidence, account for temporary resources below, and confirm owned cleanup.
Session Lifecycle
- Workspace spun up fresh (already done)
- Work happens in subdirs for anything that persists; root is free for ephemeral cross-repo work
- Workspace destroyed when done. The root directory does not persist.
Don't store anything that needs long-term persistance in the root directory.
Tracking External Resources
WORKSPACE-MANIFEST.json is a cleanup ledger, not an inventory of everything created during a task. Record only temporary resources whose cleanup belongs to this workspace and that deleting its directory will not remove. The test is intended lifetime, not resource type or location.
- Track: temporary DTUs/containers, extra test tmux sessions, scratch Gitea instances/repos, temporary cloud test resources, and task-only files or caches outside the workspace. Record them when created so they are not abandoned running or consuming disk.
- Do not add durable deliverables intended to survive the workspace, such as a shared Foundry account, a deployed application, or long-lived project infrastructure. Do not add pre-existing shared services merely because this task uses them. Keep their operational details in the owning project's durable records, not this disposable ledger.
- If the intended lifetime is unclear, clarify it before treating a resource as disposable. Creating something from an ephemeral workspace does not make it temporary.
Add each cleanup liability at the workspace root (create the file if absent); an empty resources list is correct when nothing needs cleanup:
{"version": 1, "resources": [{"kind": "dtu", "id": "dtu-a1b2c3d4", "note": "integration test env", "created_at": "2026-01-01T00:00:00Z", "teardown": "amplifier-digital-twin destroy dtu-a1b2c3d4", "status": "active"}]}When this workspace actually tears a tracked resource down, set its status to "reaped" and add a reaped_at timestamp. If it is independently confirmed absent without this workspace tearing it down, use "observed_absent" and observed_absent_at. Preserve genuine cleanup entries and their history. Before declaring work done, reconcile these entries: any still "active" is unfinished cleanup, and destruction requires explicit acknowledgment before leaving it behind. The workspace tool never executes teardown hints itself.
Correcting a scope mistake: if a durable resource was added by mistake, verify it is intended to survive, preserve any needed details in the owning project's durable records, and remove only that mistaken entry. Do not mark a live resource "reaped" or "observed_absent", invent a retention status, or delete the manifest to bypass other cleanup obligations.
Working Memory
@SCRATCH.md
Create SCRATCH.md at the workspace root as your working memory:
- Accepted objective, current decisions, unresolved blockers, and next actions
- Drives what to do next — not a log of what was done
- Loaded every turn via the @-mention above
- Keep bounded: retain needed history in investigation records or a task-history file before pruning; reference it by plain path only when needed for remaining work
Keep AGENTS.md for current conventions, not task chronology. Do not @-mention history files: superseded instructions remain evidence, not current authority. Archiving an incident does not retire a valid rule or remove a current blocker.
In handoffs, preserve the scope and source of current requirements; distinguish revisable engineering assumptions from approved constraints. Resolve conflicting requirements before execution, without weakening mandatory safety or privacy controls.
Layout
The workspace root holds AGENTS.md, SCRATCH.md, tool config directories, subdirectories (one per repo), and any ephemeral scratch files. Each subdirectory is its own git repo.
./
├── AGENTS.md # this file
├── SCRATCH.md # working memory
├── <submodule-repo>/ # existing repo added via `git submodule add`
├── <local-project>/ # new work, `git init` inside, publish later
└── <ephemeral stuff> # scripts, notes, temp files — fine at rootPublishing a Local-Only Project
When a project subdir is ready to ship:
- From inside the subdir:
gh repo create --source=. --public --push(or--private) - The subdir is now a remote-backed repo — work continues normally
- In later sessions, the repo can be re-added as a proper submodule:
git submodule add <url>
Warning: A local-only subdir is lost when the workspace is destroyed. Publish (or back up) before destroying.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

