×
Community Blog Accelerating Real-World Cloud Migration Projects with Qwen Code Agent Skills

Accelerating Real-World Cloud Migration Projects with Qwen Code Agent Skills

Most cloud migration projects don't fail at code rewriting—they stall before a single line of code is touched.

How an open-source skill set turns "we don't know what we have" into a system diagram, a migration plan, and a validated Function Compute package.

Most articles about cloud migration start at the interesting part: rewriting API calls, tuning inference, redesigning a data pipeline. In real projects, that part is rarely where the schedule dies.

The schedule dies earlier.

The stall that happens before any code is touched

Here is a pattern that anyone who has worked on enterprise migration will recognize.

A company builds an application. Over the years, the engineers who built it move on, or the team shrinks to one part-time maintainer. The system keeps running, so nobody touches it. It quietly becomes legacy — not because the technology is old, but because the knowledge about it is gone.

Then something forces a move. Infrastructure cost has to come down. The business wants to enter the China market and needs a presence in-region. A contract renewal, a compliance requirement, a data residency rule. Migration becomes mandatory.

So the company calls a system integrator, or a cloud vendor's solution architect, and asks for a proposal. And the conversation goes like this:

SA: What does the current system look like?
Customer: ...we're not entirely sure. There's a web app, a database, and some AI part.
SA: Which services does it call? What are the dependencies? Where is data stored?
Customer: We'd have to check.

Nobody can answer, so nobody can scope. And because the customer cannot describe the system concretely, they also cannot define what would be shared under an NDA — which means they cannot even ask the vendor to investigate it for them. The engagement cannot start, because the input the engagement needs is the output the engagement was supposed to produce.

The project stalls. Sometimes for a quarter. Sometimes for a year.

The bottleneck is not the rewrite. The bottleneck is the assessment phase, and specifically the very first step: producing a shareable, accurate picture of what you actually have.

CloudPort Agent is an open-source (Apache-2.0) set of native Qwen Code Agent Skills built around that observation. It does perform the migration — but it starts by drawing the map.

Step 0: get a system overview in about the time it takes to make coffee

The system-diagram-generator skill takes a repository and produces a single self-contained HTML architecture report. It is deliberately standalone: it is not part of the migration execution path, and you can use it on any repository you want to understand, whether or not you ever migrate it.

The full procedure is four steps.

1. Install Qwen Code.

bash -c "$(curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh)" -s --source bailian

On macOS with Homebrew, this route also works and is what was used for the runs described here:

brew install node@22
brew link --overwrite node@22
brew install qwen-code

Either way, authenticate against Alibaba Cloud Model Studio with /auth once Qwen Code starts.

2. Put the CloudPort skills where Qwen Code will find them.

git clone https://github.com/webbigdata-jp/cloudport-agent.git
mkdir -p ~/.qwen/skills
cp -R cloudport-agent/skills/. ~/.qwen/skills/

(Or copy them into a single project as .qwen/skills/ if you prefer to scope them per repository.)

3. Clone the repository you want to understand.

git clone https://github.com/your-org/the-system-nobody-remembers.git
cd the-system-nobody-remembers

4. Ask.

qwen
> Please draw a system overview diagram of this repository.

The agent reads the repository — source files, dependency manifests, configuration, infrastructure definitions, deployment scripts — and writes an HTML report you can open in a browser and email to anyone.

A generated sample is included in the repository(examples/system-diagram-generator-output
/):

<code>system-diagram-generator output example</code>

That artifact is the thing that unblocks the conversation. Hand it to an SI partner or a cloud architect and they can finally do their job: estimate scope, size the effort, identify the risky parts, and propose an architecture. What used to be a months-long game of archaeology becomes an attachment.

The report is written to be confidentiality-safe. The skill instructs the agent to describe structure, components, and dependencies, and to leave out credentials, secrets, and business-specific proper nouns. precisely because the artifact's purpose is to be shared outside the company before an NDA is in place.

Two honest caveats belong here.

The output is a draft, not an audit. This is LLM-generated, so someone on the customer side must read the report once before it leaves the building — both to correct anything inaccurate and to confirm nothing sensitive slipped through. That review takes an afternoon. The alternative takes a quarter.

Reviewing a repository means sending parts of it to an inference endpoint. That is worth stating plainly rather than glossing over, because it is exactly the objection a security team will raise. Three things are worth knowing:

  1. Alibaba Cloud states that Model Studio does not use customer data for model training, and that data in transit is encrypted with AES-256. Model Studio is available in several regions — including Singapore, Japan (Tokyo), Germany (Frankfurt), US (Virginia), and China (Beijing) — so you can choose where inference happens; endpoints and API keys are region-specific. Check the current Model Studio service terms and your region's cross-border data transfer implications before pointing an agent at a sensitive repository.
  2. Qwen Code's own documentation notes that the tool does not use your prompts, code, or responses for training, and that anything beyond that is governed by whichever provider you authenticate against. Usage statistics collection can be turned off in its settings.
  3. If a policy still says "this code does not leave our network," you are not stuck. A large part of the Qwen family is released as open weights, including under Apache-2.0, so the same workflow can run against a self-hosted or on-premises model endpoint. Qwen Code talks to an OpenAI-compatible endpoint, so pointing it somewhere else is configuration, not a rewrite. Combined with RAM-based access control and per-workspace scoping on the managed side, this gives you a spectrum of options rather than a single take-it-or-leave-it posture.

That flexibility matters more than it might seem. The organizations most likely to have lost track of their own architecture are frequently the same ones with the strictest rules about what may be transmitted. A discovery tool that only works in one trust configuration would be useless to exactly the people who need it most.

From the map to the move

Migration overview

Once the picture exists, the rest of CloudPort Agent takes over. Point Qwen Code at a repository containing an existing AI application and the workflow runs:

  1. Scan — locate model API call sites across Python, JavaScript/TypeScript, REST calls, configuration, infrastructure files, and deployment scripts, while leaving unrelated integrations alone.
  2. Plan — produce a reviewable migration plan: API mappings, dependency changes, embedding-space safeguards, validation criteria, deployment impact.
  3. Apply — make minimal code and configuration changes, including multimodal payload shapes and structured-output handling.
  4. Test and repair — run schema checks, offline unit tests, syntax checks, package validation, and project smoke checks that need no production credentials; diagnose and fix failures automatically.
  5. Build and validate the artifact — assemble a self-contained Function Compute package and emit the exact commands a human should run.

The skills that make this up:

Skills architecture

Skill Role
system-diagram-generator Standalone discovery / handover report
project-profile-generator Scans an unfamiliar repository and writes a thin project profile
gemini-to-qwen-api-mapping Maps existing SDK, REST, and provider-config usage to Model Studio–compatible patterns, including multimodal and structured output
dependency-migration Updates dependency files, lockfiles, imports, and environment variables without disturbing unrelated packages
migration-validation Equivalence checks, schema checks, vector-index compatibility, smoke-run sign-off
deploy-alibaba-fc-advisor Builds and validates the Function Compute artifact, then produces a human-executed deployment checklist

Why the agent stops at the cloud boundary

Inside the checked-out repository, CloudPort Agent is autonomous: it investigates, edits, migrates dependencies, runs tests, repairs failures, and validates the deployment package. Qwen Code's approval system remains the local safety layer, blocking or escalating commands it classifies as destructive.

Outside the repository, the boundary is deliberate. Creating cloud resources, supplying production credentials, rebuilding a billable vector index, and deploying to production all change either spend or availability. CloudPort prepares the artifact and the exact commands; a human runs them.

This is not a limitation so much as a reflection of how migration projects actually work. Advisors advise; the customer's own team or their SI partner executes. A tool that fits that split — thorough preparation, human-owned execution — is a tool that can be adopted without a governance argument.

Proof that the migration is complete, not approximate

"It migrated" is easy to claim and hard to believe. The repository therefore ships a complete, runnable example rather than a description of one:

examples/gemini-streamlit-cloudrun-to-qwen-fc/

It is a Streamlit application, originally written against another provider's SDK and serverless container platform, migrated to Alibaba Cloud Model Studio and Function Compute. The point of choosing this particular application is coverage: it exercises text generation, image understanding, and video understanding — the three modalities that migration efforts most often quietly drop, because the text path is easy and the multimodal paths are where request shapes diverge.

File What it demonstrates
cloudport_compat.py The compatibility layer: request/response mapping onto the Model Studio API, including multimodal payloads
app.py The migrated application itself
tests/test_cloudport_compat.py Offline request-mapping and safety tests — no API key needed
smoke_test.py Live checks against the real API for text, image, and video
deploy.sh Builds a self-contained Function Compute ZIP
README.md Build and verification instructions

The two-tier verification is the part worth stealing even if you never use CloudPort. Offline tests assert that requests are shaped correctly and run in CI for free; the live smoke test asserts that each modality actually returns a sane answer from the deployed configuration. "Deployment succeeded" and "the application works" are different claims, and only the second one matters.

A note on deploy.sh: the Function Compute 3.0 Custom Runtime does not guarantee a package manager or arbitrary language runtimes on PATH, so anything that installs dependencies at cold start is a trap. The artifact must be self-contained, with dependencies vendored at build time. CloudPort's deployment skill encodes that rule so the next project does not rediscover it at 2 a.m.

You can try the migrated result here: https://qwenstremlint.tubesaku.com/

A shape this fits well: split-region deployments

One target architecture that keeps coming up, especially for companies whose trigger for migrating is China market entry, looks like this:

  1. The web and inference tier runs in-region on Alibaba Cloud — Function Compute for the application, Model Studio for Qwen inference — so users get low latency and the deployment sits where the market is.
  2. The corpus, search index, or system of record stays in the company's home region, for data residency or simply because that is where it already lives.
  3. The two are joined through an MCP server, so the application reaches its data through a defined tool interface rather than a bespoke, hand-rolled integration.

CloudPort's reference migration uses exactly this pattern: the application on Function Compute calls Model Studio for inference and reaches MongoDB Atlas Vector Search through the official MongoDB MCP server. Two details from that experience are now baked into the skills. First, MCP servers launched through a package runner at cold start will not survive on the Custom Runtime — invoke the runtime binary directly with dependencies bundled at build time. Second, embedding vectors from different models are not interchangeable, so switching embedding models means re-embedding the corpus and regenerating the index; the validation skill checks dimensions before recommending anything that would trigger a billable rebuild.

Runtime layout after migration

If your target looks like this, it is not a special case requiring a bespoke design. It is the path the skills were written against.

Sidebar: publishing the site, and one Cloudflare trap

There is a piece of operational knowledge here that is easy to discover too late, so it is worth stating explicitly.

If your reason for migrating is China market entry, note that publishing a public website from a mainland China region is subject to a regulatory filing and review process. It is a normal, well-documented procedure, but it is not instant, and it is not something you can leave until the week before launch. Plan for it at the start of the project, in parallel with the technical work, rather than discovering it after the application is already built and tested.

For the demo in this article, the deployment therefore runs in the Japan (Tokyo) region, with the custom domain fronted by Cloudflare. That combination is convenient — Cloudflare terminates TLS for you, so you get HTTPS on your own hostname without managing certificates.

But there is a specific ordering trap:

Cloudflare CNAME record with Proxied enabled

That orange cloud is the Proxied toggle. If you turn it on before Function Compute has finished verifying your custom domain, domain verification will not complete. Function Compute needs to see the DNS record resolving to its own endpoint; with Proxied enabled, the record resolves to Cloudflare instead, and the check never passes.

The order that works:

  1. Create the CNAME record pointing at your Function Compute endpoint with Proxied off (DNS only, grey cloud).
  2. Complete the custom domain configuration and verification on the Function Compute side.
  3. Only then switch the record to Proxied to pick up Cloudflare's TLS and edge features.

If you have already hit this, the fix is the same sequence: toggle Proxied off, let verification pass, toggle it back on.

What it costs to try

Nothing but the tokens, and about ten minutes.

# 1. Install Qwen Code and authenticate against Model Studio
bash -c "$(curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh)" -s --source bailian

# 2. Install the skills
git clone https://github.com/webbigdata-jp/cloudport-agent.git
mkdir -p ~/.qwen/skills && cp -R cloudport-agent/skills/. ~/.qwen/skills/

# 3. Open any repository and ask
cd /path/to/your-repo && qwen

Inside Qwen Code, /skills lists what is available, and /approval-mode auto is the recommended setting for long autonomous sessions: routine reads, in-workspace edits, builds, and tests proceed, while risky commands still stop for a decision. Do not use YOLO mode on an unfamiliar production repository.

The full demo prompt for an end-to-end migration is in docs/demo-prompt.md.

Closing

The industry's mental model of migration is that the hard part is the rewrite. In practice, the projects that stall do not stall on the rewrite. They stall because a company cannot describe its own system well enough to ask for help with it — and every downstream step, including the NDA, the estimate, and the statement of work, depends on that description existing.

So the first skill CloudPort Agent offers is not a migration skill. It is a map.

Once the map exists, the rest is engineering, and engineering is the part we already know how to automate: scan, plan, patch, test, repair, package — with the human keeping the credentials, the budget, and the deploy button.

CloudPort Agent is open source under Apache-2.0 at github.com/webbigdata-jp/cloudport-agent. Issues, forks, and profiles for new source stacks are welcome.


Disclosures and notes on the demo sites

CloudPort Agent was built as an entry to the Global AI Hackathon Series with Qwen Cloud.

Three live sites are referenced in this article and in the repository:

Site What it is
https://soccer.tubesaku.com/ The original application, before migration
https://qwen-soccer.tubesaku.com/ The migrated version running on Alibaba Cloud (partial dataset only)
https://qwenstremlint.tubesaku.com/ The migrated multimodal sample application on Function Compute

All three are operated on a limited-time basis, for the duration of the hackathon and the World Cup period. They are demonstrations rather than permanent services, so expect them to be taken down; the repository, the example code, and the generated architecture report remain available regardless.

The YouTube data shown on soccer.tubesaku.com and qwen-soccer.tubesaku.com comes from YouTube analytics site tubesaku.com.

Disclaimer: The views expressed herein are for reference only and do not necessarily represent the official views of Alibaba Cloud.

0 1 0
Share on

dahara1

1 posts | 0 followers

You may also like

Comments

dahara1

1 posts | 0 followers

Related Products