DEV Community

Leandro
Leandro

Posted on

Porting existing code to Ambler TS

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. We'll use the PocketFlow cookbook as an example.

Project Setup

  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
mkdir port
cd port
git init
git submodule add https://github.com/The-Pocket/PocketFlow.git
npx skills add argenkiwi/ambler-ts
Enter fullscreen mode Exit fullscreen mode

Initialize Ambler

Use a coding agent (like Claude or Pi) and invoke the ambler-walk skill:

/ambler-init .
Enter fullscreen mode Exit fullscreen mode

Port Code

Invoke the ambler-walk skill and provide the path to what you want to port:

/ambler-walk create chat walk from @PocketFlow/cookbook/pocketflow-chat
Enter fullscreen mode Exit fullscreen mode

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, verify the port:

deno test nodes/tests/
deno task <walk-name>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)