# Send sonic-build to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "sonic-build",
    "name": "sonic-build",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/rustiqly/sonic-build",
    "canonicalUrl": "https://clawhub.ai/rustiqly/sonic-build",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/sonic-build",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=sonic-build",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "references/prerequisites.md",
      "references/troubleshooting.md",
      "references/vs-platform.md",
      "scripts/prerequisites.sh"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "sonic-build",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-12T16:47:01.026Z",
      "expiresAt": "2026-05-19T16:47:01.026Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=sonic-build",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=sonic-build",
        "contentDisposition": "attachment; filename=\"sonic-build-1.1.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "sonic-build"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/sonic-build"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/sonic-build",
    "downloadUrl": "https://openagent3.xyz/downloads/sonic-build",
    "agentUrl": "https://openagent3.xyz/skills/sonic-build/agent",
    "manifestUrl": "https://openagent3.xyz/skills/sonic-build/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/sonic-build/agent.md"
  }
}
```
## Documentation

### Quick Start

cd sonic-buildimage
make init
make configure PLATFORM=vs   # or broadcom, mellanox, etc.
make SONIC_BUILD_JOBS=4 target/sonic-vs.img.gz

For dev builds (skip tests): add BUILD_SKIP_TEST=y.

### Build Architecture

Two-phase build via GNU Make → slave.mk → sonic-slave Docker container:

Bookworm phase — compile all packages (debs, python wheels, Docker images) into target/debs/bookworm/
Trixie phase — assemble final image from phase 1 packages into target/debs/trixie/

Makefile invokes Makefile.work with different BLDENV per phase. The configure target creates per-distro directories.

### Configuration

All knobs in rules/config. Override in rules/config.user (gitignored, persists across rebases).

### Key Knobs

KnobDefaultRecommendedEffectSONIC_CONFIG_BUILD_JOBS14Parallel top-level package buildsSONIC_CONFIG_MAKE_JOBS$(nproc)defaultCompiler threads per packageBUILD_SKIP_TESTny (dev)Skip unit testsSONIC_BUILD_MEMORYunset24gDocker --memory — contains OOM in containerSONIC_DPKG_CACHE_METHODnonerwcacheCache .deb packages for incremental buildsDEFAULT_BUILD_LOG_TIMESTAMPnonesimpleTimestamps in build logsSONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILDunsetyHost Docker daemon instead of DinD

### Recommended rules/config.user

SONIC_CONFIG_BUILD_JOBS = 4
BUILD_SKIP_TEST = y
SONIC_BUILD_MEMORY = 24g
DEFAULT_BUILD_LOG_TIMESTAMP = simple

### Parallelism

Rule of thumb: JOBS × 6GB ≤ available RAM.

JOBS=1: ~3h VS build, ~10GB RAM
JOBS=4: significant speedup, ~20GB RAM
JOBS=8: OOM risk on <48GB RAM

Why JOBS=1 is slow: 64/194 packages depend on libswsscommon (critical path bottleneck). JOBS=1 leaves most cores idle.

### Memory Protection

Without limits, parallel builds can trigger the kernel OOM killer on any host process.

# Container-scoped OOM (host stays healthy):
SONIC_BUILD_MEMORY = 24g
# Or via CLI:
make SONIC_BUILDER_EXTRA_CMDLINE="--memory=24g" ...

### DPKG cache (package-level)

SONIC_DPKG_CACHE_METHOD = rwcache
SONIC_DPKG_CACHE_SOURCE = /var/cache/sonic/artifacts

### Version cache (downloads)

SONIC_VERSION_CACHE_METHOD = cache

### Rebuilding a Single Package

make target/debs/bookworm/sonic-utilities_1.2-1_all.deb
make target/docker-syncd-vs.gz
ls target/debs/bookworm/ | grep <name>

### Clean Builds

When to clean: after branch switch, rebase, or unexplained failures.

rm -rf target/*   # always full clean, not selective
make configure PLATFORM=vs
make SONIC_BUILD_JOBS=4 target/sonic-vs.img.gz

Stale artifacts (.bin, squashfs) confuse make into skipping phases.

### Submodules

make init                                          # after clone or pull
git submodule update --init --force src/<module>    # fix corrupted submodule

SSH clone is more reliable than HTTPS (HTTPS can give HTTP 500).

### Common Pitfalls

For detailed troubleshooting, see references/troubleshooting.md.

### Prerequisites

See references/prerequisites.md for host setup (Docker, Python, jinjanator).

### VS Platform Notes

See references/vs-platform.md for VS-specific details (TAP devices, port mapping, sai.profile, oper speed).

### PR Submission

Single commit per PR (squash before push)
git commit -s for DCO sign-off
Rebase to latest master before force-push
Add tests — run BUILD_SKIP_TEST=n at least once
Monitor CI after push
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: rustiqly
- Version: 1.1.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-12T16:47:01.026Z
- Expires at: 2026-05-19T16:47:01.026Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/sonic-build)
- [Send to Agent page](https://openagent3.xyz/skills/sonic-build/agent)
- [JSON manifest](https://openagent3.xyz/skills/sonic-build/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/sonic-build/agent.md)
- [Download page](https://openagent3.xyz/downloads/sonic-build)