Integrate IaC Code via Agent Skill

Updated at:

IaC Code provides an official Agent Skill that can be installed into external agents. Depending on whether you want to run IaC Code locally on your machine or directly call Alibaba Cloud’s cloud-hosted ROS Agent, you can choose either iac-code or alibabacloud-ros-agent. This document explains the differences between the two Skills, how to install them, and the first-call flow.

Choose Skill

Skill

Execution mode

Scenarios

iac-code

Download and start the verified IaC Code Runtime locally on your machine.

You want to reuse the local IaC Code model, Alibaba Cloud identity, and working directory, and directly process project files.

alibabacloud-ros-agent

Call Alibaba Cloud’s cloud-hosted ROS Agent via the ROS StartChat API.

You want the cloud-hosted ROS Agent to handle cloud resource planning, IaC, and resource stack tasks, without running the IaC Code Runtime on your local machine.

Both Skills support standard chat as well as pipelines that include solution selection, cost estimation, and deployment confirmation. The iac-code execution environment is local, while the alibabacloud-ros-agent agent execution environment is in the cloud. If you need to use both approaches, you can install both and explicitly specify the Skill in your prompt.

Agent Skill integration and the IaC Code Skill extension serve different use cases:

  • Integrate IaC Code by using Agent Skill: installs the official iac-code skill into another agent so that the host agent can use the cloud resource management capabilities of IaC Code.

  • Extend IaC Code with Skills: adds domain expertise, template specifications, and organizational workflows to IaC Code itself. For more information, see Extend IaC Code with Skills.

To deploy a remote agent service directly, or let the platform manage tasks and context directly, use Integrate IaC Code by using A2A instead.

Prerequisites

  • The host agent supports local skills defined by SKILL.md.

  • CPython 3.8 through 3.14 installed. On macOS or Linux, use python3. On Windows, prefer py -3.

  • Access to the official download address of IaC Code.

  • The project directories that the Skill can access have been determined, and you understand the file or cloud resource operations that will be performed.

If you install using npx skills, you need Node.js 18 or later.

Download and use iac-code Skill

Download and install

  1. Download the latest stable version:

    Download iac-code-skill.zip

    This fixed address always points to the version published to the stable channel. You do not need to update the download link after each release.

  2. Extract the ZIP directly into the Agent Skill root directory of the host agent. The exact location depends on the documentation of the host agent. The final directory structure must be as follows:

    <Agent Skill root directory>/
    └── iac-code/
        ├── SKILL.md
        ├── agents/
        │   └── openai.yaml
        └── scripts/
            └── iac_code.py

    The ZIP already includes a top-level iac-code/ directory, so do not add another nested directory with the same name.

  3. Restart the host agent or create a new session so that it rediscovers Agent Skill.

  4. Go to the extracted iac-code directory and verify that the Runtime can be installed. On macOS or Linux, run:

    python3 scripts/iac_code.py ensure-runtime

    On Windows PowerShell, run:

    py -3 scripts\iac_code.py ensure-runtime

Expected result: On the first run, download and verify the IaC Code Runtime for the current platform, and reuse the cache for subsequent calls.

Configure Runtime Environment

The iac-code Skill uses the same configuration directory as the REPL, web, and desktop versions, which defaults to ~/.iac-code/. If you have already configured the model service and Alibaba Cloud identity, you can reuse them directly; if you want to use a different configuration directory, set IAC_CODE_CONFIG_DIR.

Model configuration is required for the local Runtime to run. When a task needs to query or manage cloud resources, you also need to configure an Alibaba Cloud identity with the minimum necessary permissions. In automated environments, model and Alibaba Cloud credentials can be injected through a secret management solution. Do not write real secrets into SKILL.md, prompts, or project files.

Make your first call

Open a project or workspace in the host agent and enter:

$iac-code Check the ROS templates in the current project and list security risks and suggestions. Do not modify files or deploy resources.

If the host does not support explicit Skill syntax, you can simply ask it to use the iac-code Skill to complete the same task.

Expected result: The host delegates the task to the local IaC Code Runtime and displays the execution process and review results. The first call may need to download the Runtime, so it can take longer than subsequent calls.

Download and use alibabacloud-ros-agent Skill

Download and install

You can search for alibabacloud-ros-agent in the Alibaba Cloud Agent Skills portal, or install it from the official repository:

npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-ros-agent

You can also download the ZIP directly and extract its top-level alibabacloud-ros-agent/ directory into the host agent’s user-level or project-level Skill directory. After installation, restart the host agent or start a new session.

The Skill’s default transport requires the Python dependencies included with the package. If the first check reports that the dependencies are not installed yet, run the following in the Skill directory:

python3 -m pip install -r scripts/requirements.txt
python3 scripts/ros_agent.py check

On Windows PowerShell, run the following command:

py -3 -m pip install -r scripts\requirements.txt
py -3 scripts\ros_agent.py check

Expected result: the check outputs the current transport, ROS service endpoint, and non-sensitive identity readiness information. Do not read or output credential values to verify the configuration.

Configure identity

alibabacloud-ros-agent uses the Alibaba Cloud default credential chain available to the host process, or a specified Alibaba Cloud CLI Profile. It does not require downloading a local IaC Code Runtime, and it does not require configuring a local model service.

The identity used to call the cloud ROS Agent must have ros:StartChat permission. ros:StopChat permission is only needed when explicitly canceling a running remote task. It is recommended to use temporary identities such as STS, RAM Role, or ECS RAM Role, and grant only the permissions actually required for the task.

Make your first call

Enter the following in the host agent:

$alibabacloud-ros-agent query ROS stacks in the cn-hangzhou region, summarize abnormal statuses, and do not perform any write operations.

If the host does not support explicit Skill syntax, you can ask it to “use Alibaba Cloud ROS Agent” to complete the task.

Expected result: the Skill establishes a cloud-side session via the ROS StartChat API, and the host continuously displays progress and the final result. When additional parameters, solution choices, or operation approvals are needed, continue responding in the same host session.

Handle questions, choices, and permission requests

IaC Code may pause a task in the following situations:

  • Additional information is required, such as the region, resource specifications, or the template path.

  • A choice is required among multiple architecture or resource candidates.

  • Approval is required for file modifications, command execution, cloud API calls, or deployment operations.

Respond or make a selection directly in the current host agent session. Before you approve an operation, check the target files, region, resources, estimated costs, and scope of impact. If you reject an operation, IaC Code does not bypass that decision through the host agent.

Update and uninstall

  • To update, re-download iac-code-skill.zip from the fixed address, and then fully replace iac-code/ in the Agent Skill root directory of the host agent.

  • When updating alibabacloud-ros-agent, rerun npx skills add, or re-download from the Skills portal and fully replace the corresponding directory.

  • When uninstalling, delete the corresponding Skill directory under the host Skill root directory, then restart the host or start a new session.

Do not replace only a single bridge script, and do not manually modify the Runtime address, verification information, or the service configuration bundled with the Skill.

Security notes

  • Download Agent Skill only from the official fixed address. Do not install ZIP files from unknown or modified sources.

  • Do not paste sensitive information such as API keys or AccessKey Secret into Skills, project files, prompts, logs, or chat content.

  • The local iac-code Runtime listens only on the local loopback address and generates independent credentials for each launch. It does not run as a public network service.

  • Service invocations by alibabacloud-ros-agent are subject to Alibaba Cloud identity and RAM permissions; do not use a main account AccessKey to bypass authorization issues.

  • Before deploying or changing cloud resources, always check the target resource, region, cost, and scope of impact.

FAQ

Which Skill to choose

If you want to process project files locally, reuse your local IaC Code configuration, or control the Runtime version, choose iac-code. If you want to use Alibaba Cloud’s cloud-hosted ROS Agent directly and control access via Alibaba Cloud identity, choose alibabacloud-ros-agent.

The host agent does not discover the agent skill

Verify that the final path is <Agent Skill root directory>/iac-code/SKILL.md, not the nested iac-code/iac-code/SKILL.md. After installation or an update, restart the host agent or create a new session. Also check the documentation of the host product.

The runtime cannot be downloaded on the first run

Verify that the current platform and architecture are supported. Check network connectivity to the official OSS address, and check the proxy, certificates, and disk space. Do not bypass download errors by modifying the script or disabling verification.

alibabacloud-ros-agent returns identity or permission errors

Run the bundled check first to confirm the default credential chain or the specified Profile is ready. If you get an authorization error, grant the execution identity ros:StartChat. If you need to cancel a remote task, additionally grant ros:StopChat. Do not print AccessKeys in the command line or in chat.

The task pauses during execution

Check whether the current session has pending questions, candidates, or permission requests. After you complete the interaction, the host agent continues with the same IaC Code task. You do not need to resubmit the full request.

References