Post

Porting Code to Ambler TS: The Quickest Way

Porting Code to Ambler TS: The Quickest Way

The quickest way to port code from a Git repository into Ambler TS is to include it as a Git submodule and leverage Ambler’s agentic skills. In this guide, we’ll use the PocketFlow cookbook as an example of how to streamline this process.

Project Setup

First, let’s prepare the workspace by setting up the directory and adding the source repository as a submodule.

  1. Create a project folder
  2. Initialize git
  3. Add PocketFlow (or a Git repository of your choosing) as a submodule
  4. Install the Ambler TS skills
1
2
3
4
5
mkdir port
cd port
git init
git submodule add https://github.com/The-Pocket/PocketFlow.git
npx skills add argenkiwi/ambler-ts

Initialize Ambler

Use a coding agent (like Claude or Gemini) and invoke the ambler-init skill to set up the environment:

1
/ambler-init .

Port Code

Now, invoke the ambler-walk skill and provide the path to the specific logic you want to port. Ambler will handle the heavy lifting:

1
/ambler-walk create chat walk from @PocketFlow/cookbook/pocketflow-chat

The agent will automatically:

  1. Analyze the source logic.
  2. Create the necessary Nodes in nodes/.
  3. Scaffold a Spec in specs/.
  4. Wire everything into a Walk in walks/.

Test Run

Once the agent finishes, you can verify the port immediately:

1
2
deno test nodes/tests/
deno task <walk-name>

By leveraging submodules and agentic skills, you can drastically reduce the manual effort required to migrate complex logic into the Ambler TS ecosystem.

This post is licensed under CC BY 4.0 by the author.