Skip to content

Shadow bundle context should guide iterative development workflow #205

@obra

Description

@obra

Problem

When using shadow environments for iterative development, I ran into a workflow gap that caused confusion and wasted time.

What happened

  1. Created a shadow environment with local sources for amplifier-app-cli and amplifier-module-hooks-streaming-ui
  2. Tested changes - they worked
  3. Made additional commits locally to fix issues found during testing
  4. Assumed the shadow would have the new commits
  5. Tested again - changes weren't there
  6. Spent time debugging why the "fix" wasn't working, when the real issue was the shadow had a point-in-time snapshot

Root cause

The shadow instructions (amplifier-bundle-shadow/context/shadow-instructions.md) mention that snapshots are point-in-time, but don't provide clear workflow guidance for the common iterative development pattern:

write code → create shadow → test → find issue → fix locally → test again → ???

The missing step is: use add-source to sync new commits into the running shadow.

Proposed change

Add a section to context/shadow-instructions.md in the shadow bundle:

## Iterating on Local Changes

Shadow environments snapshot your local repos **at creation time**. When you make new commits locally after creating a shadow, those changes are NOT automatically available.

**To sync new local commits into a running shadow:**

1. Use `add-source` to push the new commit:
   ```bash
   shadow add-source <shadow-id> /path/to/local/repo:org/repo-name
  1. Clear any module/package caches inside the shadow that may have the old version

  2. Re-test

Alternative: Destroy and recreate the shadow to get a fresh snapshot with all current commits.

Common mistake: Assuming new local commits are automatically available in existing shadows. They are not - shadows are isolated snapshots.


This would help AI agents (and humans) understand the correct workflow for iterative development with shadow environments.

---

*Note: Filed here because `microsoft/amplifier-bundle-shadow` has issues disabled.*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions