# Send Build ROSE tools using a container 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": "rose-container-tools",
    "name": "Build ROSE tools using a container",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/chunhualiao/rose-container-tools",
    "canonicalUrl": "https://clawhub.ai/chunhualiao/rose-container-tools",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/rose-container-tools",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=rose-container-tools",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/rose-container-tools"
    },
    "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/rose-container-tools",
    "downloadUrl": "https://openagent3.xyz/downloads/rose-container-tools",
    "agentUrl": "https://openagent3.xyz/skills/rose-container-tools/agent",
    "manifestUrl": "https://openagent3.xyz/skills/rose-container-tools/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/rose-container-tools/agent.md"
  }
}
```
## Documentation

### ROSE Container Tools

Build and run ROSE-based source code analysis tools using ROSE installed in a container.

### ⚠️ ALWAYS Use Makefile

Never use ad-hoc scripts or command-line compilation for ROSE tools.

Use Makefile for all builds
Enables make -j parallelism
Ensures consistent flags
Supports make check for testing

### Why Container?

ROSE requires GCC 7-10 and specific Boost versions. Most modern hosts don't have these. The container provides:

Pre-installed ROSE at /rose/install
Correct compiler toolchain
All dependencies configured

### 1. Start the Container

# If container exists
docker start rose-tools-dev
docker exec -it rose-tools-dev bash

# Or create new container
docker run -it --name rose-tools-dev \\
  -v /home/liao/rose-install:/rose/install:ro \\
  -v $(pwd):/work \\
  -w /work \\
  rose-dev:latest bash

### 2. Build with Makefile

Always use Makefile to build ROSE tools. Never use ad-hoc scripts.

# Inside container
make        # Build all tools
make check  # Build and test

### 3. Run the Tool

./build/my_tool -c input.c

### Makefile (Required)

Create Makefile for your tool:

ROSE_INSTALL = /rose/install

CXX      = g++
CXXFLAGS = -std=c++14 -Wall -g -I$(ROSE_INSTALL)/include/rose
LDFLAGS  = -L$(ROSE_INSTALL)/lib -Wl,-rpath,$(ROSE_INSTALL)/lib
LIBS     = -lrose

BUILDDIR = build
SOURCES  = $(wildcard tools/*.cpp)
TOOLS    = $(patsubst tools/%.cpp,$(BUILDDIR)/%,$(SOURCES))

.PHONY: all clean check

all: $(TOOLS)

$(BUILDDIR)/%: tools/%.cpp
	@mkdir -p $(BUILDDIR)
	$(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS) $(LIBS)

check: all
	@for tool in $(TOOLS); do \\
		echo "Testing $$tool..."; \\
		LD_LIBRARY_PATH=$(ROSE_INSTALL)/lib $$tool -c tests/hello.c; \\
	done

clean:
	rm -rf $(BUILDDIR)

### Example: Identity Translator

Minimal ROSE tool that parses and unparses code:

// tools/identity.cpp
#include "rose.h"

int main(int argc, char* argv[]) {
    SgProject* project = frontend(argc, argv);
    if (!project) return 1;
    
    AstTests::runAllTests(project);
    return backend(project);
}

Build and run:

make
./build/identity -c tests/hello.c
# Output: rose_hello.c (unparsed)

### Example: Call Graph Generator

// tools/callgraph.cpp
#include "rose.h"
#include <CallGraph.h>

int main(int argc, char* argv[]) {
    ROSE_INITIALIZE;
    SgProject* project = new SgProject(argc, argv);
    
    CallGraphBuilder builder(project);
    builder.buildCallGraph();
    
    AstDOTGeneration dotgen;
    dotgen.writeIncidenceGraphToDOTFile(
        builder.getGraph(), "callgraph.dot");
    
    return 0;
}

### Example: AST Node Counter

// tools/ast_stats.cpp
#include "rose.h"
#include <map>

class NodeCounter : public AstSimpleProcessing {
public:
    std::map<std::string, int> counts;
    
    void visit(SgNode* node) override {
        if (node) counts[node->class_name()]++;
    }
};

int main(int argc, char* argv[]) {
    SgProject* project = frontend(argc, argv);
    
    NodeCounter counter;
    counter.traverseInputFiles(project, preorder);
    
    for (auto& [name, count] : counter.counts)
        std::cout << name << ": " << count << "\\n";
    
    return 0;
}

### Common ROSE Headers

HeaderPurposerose.hMain header (includes most things)CallGraph.hCall graph constructionAstDOTGeneration.hDOT output for AST/graphssageInterface.hAST manipulation utilities

### Simple Traversal (preorder/postorder)

class MyTraversal : public AstSimpleProcessing {
    void visit(SgNode* node) override {
        // Process each node
    }
};

MyTraversal t;
t.traverseInputFiles(project, preorder);

### Top-Down with Inherited Attributes

class MyTraversal : public AstTopDownProcessing<int> {
    int evaluateInheritedAttribute(SgNode* node, int depth) override {
        return depth + 1;  // Pass to children
    }
};

### Bottom-Up with Synthesized Attributes

class MyTraversal : public AstBottomUpProcessing<int> {
    int evaluateSynthesizedAttribute(SgNode* node, 
        SynthesizedAttributesList childAttrs) override {
        int sum = 0;
        for (auto& attr : childAttrs) sum += attr;
        return sum + 1;  // Return to parent
    }
};

### Testing in Container

# Run from host
docker exec -w /work rose-tools-dev make check

# Or interactively
docker exec -it rose-tools-dev bash
cd /work
make && make check

### "rose.h not found"

# Check include path
echo $ROSE/include/rose
ls $ROSE/include/rose/rose.h

### "cannot find -lrose"

# Check library path
ls $ROSE/lib/librose.so

### Runtime: "librose.so not found"

# Set library path
export LD_LIBRARY_PATH=$ROSE/lib:$LD_LIBRARY_PATH

### Segfault on large files

# Increase stack size
ulimit -s unlimited

### Container Reference

PathContents/rose/installROSE installation (headers, libs, bins)/rose/install/include/roseHeader files/rose/install/liblibrose.so and dependencies/rose/install/binROSE tools (identityTranslator, etc.)/workMounted workspace (your code)
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: chunhualiao
- Version: 1.0.0
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/rose-container-tools)
- [Send to Agent page](https://openagent3.xyz/skills/rose-container-tools/agent)
- [JSON manifest](https://openagent3.xyz/skills/rose-container-tools/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/rose-container-tools/agent.md)
- [Download page](https://openagent3.xyz/downloads/rose-container-tools)