{
  "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": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/rose-container-tools",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=rose-container-tools",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "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."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "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."
        },
        {
          "label": "Upgrade existing",
          "body": "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."
        }
      ]
    },
    "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."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/rose-container-tools",
    "agentPageUrl": "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"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "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."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "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."
      },
      {
        "label": "Upgrade existing",
        "body": "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."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "ROSE Container Tools",
        "body": "Build and run ROSE-based source code analysis tools using ROSE installed in a container."
      },
      {
        "title": "⚠️ ALWAYS Use Makefile",
        "body": "Never use ad-hoc scripts or command-line compilation for ROSE tools.\n\nUse Makefile for all builds\nEnables make -j parallelism\nEnsures consistent flags\nSupports make check for testing"
      },
      {
        "title": "Why Container?",
        "body": "ROSE requires GCC 7-10 and specific Boost versions. Most modern hosts don't have these. The container provides:\n\nPre-installed ROSE at /rose/install\nCorrect compiler toolchain\nAll dependencies configured"
      },
      {
        "title": "1. Start the Container",
        "body": "# If container exists\ndocker start rose-tools-dev\ndocker exec -it rose-tools-dev bash\n\n# Or create new container\ndocker run -it --name rose-tools-dev \\\n  -v /home/liao/rose-install:/rose/install:ro \\\n  -v $(pwd):/work \\\n  -w /work \\\n  rose-dev:latest bash"
      },
      {
        "title": "2. Build with Makefile",
        "body": "Always use Makefile to build ROSE tools. Never use ad-hoc scripts.\n\n# Inside container\nmake        # Build all tools\nmake check  # Build and test"
      },
      {
        "title": "3. Run the Tool",
        "body": "./build/my_tool -c input.c"
      },
      {
        "title": "Makefile (Required)",
        "body": "Create Makefile for your tool:\n\nROSE_INSTALL = /rose/install\n\nCXX      = g++\nCXXFLAGS = -std=c++14 -Wall -g -I$(ROSE_INSTALL)/include/rose\nLDFLAGS  = -L$(ROSE_INSTALL)/lib -Wl,-rpath,$(ROSE_INSTALL)/lib\nLIBS     = -lrose\n\nBUILDDIR = build\nSOURCES  = $(wildcard tools/*.cpp)\nTOOLS    = $(patsubst tools/%.cpp,$(BUILDDIR)/%,$(SOURCES))\n\n.PHONY: all clean check\n\nall: $(TOOLS)\n\n$(BUILDDIR)/%: tools/%.cpp\n\t@mkdir -p $(BUILDDIR)\n\t$(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS) $(LIBS)\n\ncheck: all\n\t@for tool in $(TOOLS); do \\\n\t\techo \"Testing $$tool...\"; \\\n\t\tLD_LIBRARY_PATH=$(ROSE_INSTALL)/lib $$tool -c tests/hello.c; \\\n\tdone\n\nclean:\n\trm -rf $(BUILDDIR)"
      },
      {
        "title": "Example: Identity Translator",
        "body": "Minimal ROSE tool that parses and unparses code:\n\n// tools/identity.cpp\n#include \"rose.h\"\n\nint main(int argc, char* argv[]) {\n    SgProject* project = frontend(argc, argv);\n    if (!project) return 1;\n    \n    AstTests::runAllTests(project);\n    return backend(project);\n}\n\nBuild and run:\n\nmake\n./build/identity -c tests/hello.c\n# Output: rose_hello.c (unparsed)"
      },
      {
        "title": "Example: Call Graph Generator",
        "body": "// tools/callgraph.cpp\n#include \"rose.h\"\n#include <CallGraph.h>\n\nint main(int argc, char* argv[]) {\n    ROSE_INITIALIZE;\n    SgProject* project = new SgProject(argc, argv);\n    \n    CallGraphBuilder builder(project);\n    builder.buildCallGraph();\n    \n    AstDOTGeneration dotgen;\n    dotgen.writeIncidenceGraphToDOTFile(\n        builder.getGraph(), \"callgraph.dot\");\n    \n    return 0;\n}"
      },
      {
        "title": "Example: AST Node Counter",
        "body": "// tools/ast_stats.cpp\n#include \"rose.h\"\n#include <map>\n\nclass NodeCounter : public AstSimpleProcessing {\npublic:\n    std::map<std::string, int> counts;\n    \n    void visit(SgNode* node) override {\n        if (node) counts[node->class_name()]++;\n    }\n};\n\nint main(int argc, char* argv[]) {\n    SgProject* project = frontend(argc, argv);\n    \n    NodeCounter counter;\n    counter.traverseInputFiles(project, preorder);\n    \n    for (auto& [name, count] : counter.counts)\n        std::cout << name << \": \" << count << \"\\n\";\n    \n    return 0;\n}"
      },
      {
        "title": "Common ROSE Headers",
        "body": "HeaderPurposerose.hMain header (includes most things)CallGraph.hCall graph constructionAstDOTGeneration.hDOT output for AST/graphssageInterface.hAST manipulation utilities"
      },
      {
        "title": "Simple Traversal (preorder/postorder)",
        "body": "class MyTraversal : public AstSimpleProcessing {\n    void visit(SgNode* node) override {\n        // Process each node\n    }\n};\n\nMyTraversal t;\nt.traverseInputFiles(project, preorder);"
      },
      {
        "title": "Top-Down with Inherited Attributes",
        "body": "class MyTraversal : public AstTopDownProcessing<int> {\n    int evaluateInheritedAttribute(SgNode* node, int depth) override {\n        return depth + 1;  // Pass to children\n    }\n};"
      },
      {
        "title": "Bottom-Up with Synthesized Attributes",
        "body": "class MyTraversal : public AstBottomUpProcessing<int> {\n    int evaluateSynthesizedAttribute(SgNode* node, \n        SynthesizedAttributesList childAttrs) override {\n        int sum = 0;\n        for (auto& attr : childAttrs) sum += attr;\n        return sum + 1;  // Return to parent\n    }\n};"
      },
      {
        "title": "Testing in Container",
        "body": "# Run from host\ndocker exec -w /work rose-tools-dev make check\n\n# Or interactively\ndocker exec -it rose-tools-dev bash\ncd /work\nmake && make check"
      },
      {
        "title": "\"rose.h not found\"",
        "body": "# Check include path\necho $ROSE/include/rose\nls $ROSE/include/rose/rose.h"
      },
      {
        "title": "\"cannot find -lrose\"",
        "body": "# Check library path\nls $ROSE/lib/librose.so"
      },
      {
        "title": "Runtime: \"librose.so not found\"",
        "body": "# Set library path\nexport LD_LIBRARY_PATH=$ROSE/lib:$LD_LIBRARY_PATH"
      },
      {
        "title": "Segfault on large files",
        "body": "# Increase stack size\nulimit -s unlimited"
      },
      {
        "title": "Container Reference",
        "body": "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)"
      }
    ],
    "body": "ROSE Container Tools\n\nBuild and run ROSE-based source code analysis tools using ROSE installed in a container.\n\n⚠️ ALWAYS Use Makefile\n\nNever use ad-hoc scripts or command-line compilation for ROSE tools.\n\nUse Makefile for all builds\nEnables make -j parallelism\nEnsures consistent flags\nSupports make check for testing\nWhy Container?\n\nROSE requires GCC 7-10 and specific Boost versions. Most modern hosts don't have these. The container provides:\n\nPre-installed ROSE at /rose/install\nCorrect compiler toolchain\nAll dependencies configured\nQuick Start\n1. Start the Container\n# If container exists\ndocker start rose-tools-dev\ndocker exec -it rose-tools-dev bash\n\n# Or create new container\ndocker run -it --name rose-tools-dev \\\n  -v /home/liao/rose-install:/rose/install:ro \\\n  -v $(pwd):/work \\\n  -w /work \\\n  rose-dev:latest bash\n\n2. Build with Makefile\n\nAlways use Makefile to build ROSE tools. Never use ad-hoc scripts.\n\n# Inside container\nmake        # Build all tools\nmake check  # Build and test\n\n3. Run the Tool\n./build/my_tool -c input.c\n\nMakefile (Required)\n\nCreate Makefile for your tool:\n\nROSE_INSTALL = /rose/install\n\nCXX      = g++\nCXXFLAGS = -std=c++14 -Wall -g -I$(ROSE_INSTALL)/include/rose\nLDFLAGS  = -L$(ROSE_INSTALL)/lib -Wl,-rpath,$(ROSE_INSTALL)/lib\nLIBS     = -lrose\n\nBUILDDIR = build\nSOURCES  = $(wildcard tools/*.cpp)\nTOOLS    = $(patsubst tools/%.cpp,$(BUILDDIR)/%,$(SOURCES))\n\n.PHONY: all clean check\n\nall: $(TOOLS)\n\n$(BUILDDIR)/%: tools/%.cpp\n\t@mkdir -p $(BUILDDIR)\n\t$(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS) $(LIBS)\n\ncheck: all\n\t@for tool in $(TOOLS); do \\\n\t\techo \"Testing $$tool...\"; \\\n\t\tLD_LIBRARY_PATH=$(ROSE_INSTALL)/lib $$tool -c tests/hello.c; \\\n\tdone\n\nclean:\n\trm -rf $(BUILDDIR)\n\nExample: Identity Translator\n\nMinimal ROSE tool that parses and unparses code:\n\n// tools/identity.cpp\n#include \"rose.h\"\n\nint main(int argc, char* argv[]) {\n    SgProject* project = frontend(argc, argv);\n    if (!project) return 1;\n    \n    AstTests::runAllTests(project);\n    return backend(project);\n}\n\n\nBuild and run:\n\nmake\n./build/identity -c tests/hello.c\n# Output: rose_hello.c (unparsed)\n\nExample: Call Graph Generator\n// tools/callgraph.cpp\n#include \"rose.h\"\n#include <CallGraph.h>\n\nint main(int argc, char* argv[]) {\n    ROSE_INITIALIZE;\n    SgProject* project = new SgProject(argc, argv);\n    \n    CallGraphBuilder builder(project);\n    builder.buildCallGraph();\n    \n    AstDOTGeneration dotgen;\n    dotgen.writeIncidenceGraphToDOTFile(\n        builder.getGraph(), \"callgraph.dot\");\n    \n    return 0;\n}\n\nExample: AST Node Counter\n// tools/ast_stats.cpp\n#include \"rose.h\"\n#include <map>\n\nclass NodeCounter : public AstSimpleProcessing {\npublic:\n    std::map<std::string, int> counts;\n    \n    void visit(SgNode* node) override {\n        if (node) counts[node->class_name()]++;\n    }\n};\n\nint main(int argc, char* argv[]) {\n    SgProject* project = frontend(argc, argv);\n    \n    NodeCounter counter;\n    counter.traverseInputFiles(project, preorder);\n    \n    for (auto& [name, count] : counter.counts)\n        std::cout << name << \": \" << count << \"\\n\";\n    \n    return 0;\n}\n\nCommon ROSE Headers\nHeader\tPurpose\nrose.h\tMain header (includes most things)\nCallGraph.h\tCall graph construction\nAstDOTGeneration.h\tDOT output for AST/graphs\nsageInterface.h\tAST manipulation utilities\nAST Traversal Patterns\nSimple Traversal (preorder/postorder)\nclass MyTraversal : public AstSimpleProcessing {\n    void visit(SgNode* node) override {\n        // Process each node\n    }\n};\n\nMyTraversal t;\nt.traverseInputFiles(project, preorder);\n\nTop-Down with Inherited Attributes\nclass MyTraversal : public AstTopDownProcessing<int> {\n    int evaluateInheritedAttribute(SgNode* node, int depth) override {\n        return depth + 1;  // Pass to children\n    }\n};\n\nBottom-Up with Synthesized Attributes\nclass MyTraversal : public AstBottomUpProcessing<int> {\n    int evaluateSynthesizedAttribute(SgNode* node, \n        SynthesizedAttributesList childAttrs) override {\n        int sum = 0;\n        for (auto& attr : childAttrs) sum += attr;\n        return sum + 1;  // Return to parent\n    }\n};\n\nTesting in Container\n# Run from host\ndocker exec -w /work rose-tools-dev make check\n\n# Or interactively\ndocker exec -it rose-tools-dev bash\ncd /work\nmake && make check\n\nTroubleshooting\n\"rose.h not found\"\n# Check include path\necho $ROSE/include/rose\nls $ROSE/include/rose/rose.h\n\n\"cannot find -lrose\"\n# Check library path\nls $ROSE/lib/librose.so\n\nRuntime: \"librose.so not found\"\n# Set library path\nexport LD_LIBRARY_PATH=$ROSE/lib:$LD_LIBRARY_PATH\n\nSegfault on large files\n# Increase stack size\nulimit -s unlimited\n\nContainer Reference\nPath\tContents\n/rose/install\tROSE installation (headers, libs, bins)\n/rose/install/include/rose\tHeader files\n/rose/install/lib\tlibrose.so and dependencies\n/rose/install/bin\tROSE tools (identityTranslator, etc.)\n/work\tMounted workspace (your code)"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/chunhualiao/rose-container-tools",
    "publisherUrl": "https://clawhub.ai/chunhualiao/rose-container-tools",
    "owner": "chunhualiao",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "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"
  }
}