Skip to content

External Library Flow

TL;DR

Use External Library Flow when AI agents need to work with a private or external codebase that is not inside the current workspace. The workflow asks for one thing up front: the project path. After that, the coding agent detects metadata, packages the codebase into compressed Repomix XML, writes a short onboarding document, updates architecture guidance so later agents know where to look, and verifies that the reference material can be found again. You should review detected metadata before packaging continues and review the published onboarding artifacts plus architecture update before treating onboarding as complete.

When To Use This Workflow

When Not To Use This Workflow

Before You Start

How To Start

Teach AI about our internal authentication library at ../auth-sdk.
Onboard the shared billing client from /opt/repos/billing-client so later coding tasks can use it.
Document the external utilities package for AI use in this workspace. The project path is ../shared-utils.

How Rosetta Shapes This Workflow

Workflow At A Glance

Phase What you provide What agents do What you get Review gate
1. Discovery External project path Validate access, detect project name, version, and tech stack Detected metadata Confirm or correct detected metadata
2. Analysis Confirmed project path and metadata Package the codebase as compressed XML, read README, find entry points, draft the learning flow Repomix package output plus onboarding draft content No explicit gate in source
3. Publishing Confirmed metadata and generated artifacts Publish {project-name}.xml and {project-name}-onboarding.md, confirm both IDs, clean temp files, update architecture guidance Durable refsrc artifacts and architecture rule Review published artifacts and architecture update
4. Verification Published artifacts Search by project name, verify tags, display learning flow, confirm onboarding succeeded Proof that later agents can find and use the reference set Review verification evidence

Workflow Overview

flowchart TD
  A["Start: user requests external onboarding"] --> B["Phase 1: ask for project path"]
  B --> C["Validate path and auto-detect<br/>name, version, tech stack"]
  C --> D{"Metadata correct?"}
  D -- "No" --> C
  D -- "Yes" --> E["Phase 2: package codebase<br/>with compressed Repomix XML"]
  E --> F["Read README and entry points"]
  F --> G["Draft short learning flow"]
  G --> H["Phase 3: publish refsrc/<project>.xml"]
  H --> I["Publish refsrc/<project>-onboarding.md"]
  I --> J["Update ARCHITECTURE.md rule"]
  J --> K["Confirm document IDs and cleanup"]
  K --> L["Phase 4: search by project name"]
  L --> M["Verify tags and display learning flow"]
  M --> N["Confirm AI can use onboarded reference"]

  style A fill:#dbeafe,stroke:#1d4ed8,color:#0f172a
  style B fill:#fef3c7,stroke:#d97706,color:#78350f
  style C fill:#dcfce7,stroke:#16a34a,color:#14532d
  style D fill:#fef3c7,stroke:#d97706,color:#78350f
  style E fill:#dbeafe,stroke:#1d4ed8,color:#0f172a
  style F fill:#dcfce7,stroke:#16a34a,color:#14532d
  style G fill:#dcfce7,stroke:#16a34a,color:#14532d
  style H fill:#dbeafe,stroke:#1d4ed8,color:#0f172a
  style I fill:#dbeafe,stroke:#1d4ed8,color:#0f172a
  style J fill:#fef3c7,stroke:#d97706,color:#78350f
  style K fill:#dcfce7,stroke:#16a34a,color:#14532d
  style L fill:#dbeafe,stroke:#1d4ed8,color:#0f172a
  style M fill:#dcfce7,stroke:#16a34a,color:#14532d
  style N fill:#dcfce7,stroke:#16a34a,color:#14532d

Interaction Flow

sequenceDiagram
  participant U as User
  participant R as Rosetta instructions
  participant A as Coding agent
  participant T as Tools
  participant F as refsrc artifacts

  U->>A: Request onboarding for external project
  R->>A: Enforce sequential workflow and todo tracking
  A->>U: Ask for project path
  U-->>A: Provide path
  A->>T: Inspect project files and detect metadata
  A->>U: Present detected name, version, tech stack
  U-->>A: Confirm or correct metadata
  A->>T: Run Repomix packaging with compress=true, style=xml
  A->>T: Read README and entry points
  A->>F: Create {project-name}.xml
  A->>F: Create {project-name}-onboarding.md
  A->>F: Update ARCHITECTURE.md with refsrc usage rule
  A->>U: Show published artifacts and IDs
  A->>T: Search by project name and verify tags
  A->>U: Display learning flow and confirm onboarding

Phases

Phase 1. Discovery

Goal

Find the external project and reduce user questions to a single required input: the project path.

What you provide

What the agent does

What you get

What to watch for

Phase 2. Analysis

Goal

Turn the external codebase into a compact AI-readable reference and extract the minimum onboarding guidance needed for later work.

What you provide

What the agent does

What you get

What to watch for

Phase 3. Publishing

Goal

Publish durable workspace artifacts that later agents can search and use.

What you provide

What the agent does

What you get

What to watch for

Phase 4. Verification

Goal

Prove that the newly published reference set is searchable and usable by later AI tasks.

What you provide

What the agent does

What you get

What to watch for

How To Review Results

Review the workflow at two levels: metadata correctness early, then artifact usefulness at the end.

For phase 1, verify:

For phase 3 and 4, verify:

If any of those checks fail, later workflows will either miss the dependency entirely or use it badly.

Workflow-Specific Customization

Artifacts You Will Get

Common Mistakes

Source Files