← 返回 Skills 市场
cargo-ai

Cargo Context

作者 Cargo · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
90
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install cargo-context
功能描述
Inspect and edit the workspace's git-backed context repository (the GTM knowledge base of markdown/MDX files) and its runtime sandbox using the Cargo CLI. Us...
使用说明 (SKILL.md)

Cargo CLI — Context

The context is a git-backed repository of typed markdown/MDX files that captures a workspace's GTM knowledge (company narrative, ICPs, personas, plays, proof, objections, etc.) and is read/written by both humans and agents. The cargo-ai context domain has two subdomains you'll use:

  • runtime — browse, read, write, edit, and execute against the workspace's runtime sandbox (a checked-out copy of the context repo). write/edit are pushed to the default branch; execute runs are not pushed.
  • graph — build/load the knowledge graph derived from every markdown/MDX file in the context repo.

The canonical example of a context repository is getcargohq/cargo-workspaces. Read its README.md to understand the domain layout and file conventions before writing new entries. For uploading runtime-independent files (CSVs, PDFs) used in batch runs, use cargo-workspace-management (cargo-ai workspaceManagement file upload) instead. For RAG file attachments to agents, use cargo-ai (cargo-ai ai file upload).

See references/conventions.md for the full context repo structure and per-domain templates. See references/response-shapes.md for the JSON shapes returned by each cargo-ai context command. See references/troubleshooting.md for common errors and how to fix them. See references/examples/authoring.md for end-to-end add / edit / delete recipes. See references/examples/lifecycle.md for the bootstrap + refresh-from-calls playbook. See references/examples/graph-queries.md for inspecting the knowledge graph.

Prerequisites

See ../cargo/references/prerequisites.md for install, login (--oauth / --token), JSON output conventions, and error shapes. Verify the session with cargo-ai whoami before running any of the commands below — runtime write and runtime edit push commits to the workspace's context repo, so confirming workspace.name first is non-negotiable.

Discover the context first

Before editing anything, see what's in the context repo:

cargo-ai context runtime browse                 # list entries at the runtime sandbox root
cargo-ai context graph get                      # full knowledge graph derived from the repo's md/mdx files

Quick reference

# Runtime sandbox (checked-out copy of the context repo)
cargo-ai context runtime browse [--path \x3Cpath>]
cargo-ai context runtime read --path \x3Cpath> [--start-line \x3Cn>] [--end-line \x3Cn>]
cargo-ai context runtime write --path \x3Cpath> --content \x3Ccontent> [--commit-message \x3Cmessage>]
cargo-ai context runtime edit --path \x3Cpath> --old-string \x3Cold> --new-string \x3Cnew> [--commit-message \x3Cmessage>]
cargo-ai context runtime execute --command \x3Ccommand> [--args \x3Cjson>]

# Knowledge graph
cargo-ai context graph get

Runtime sandbox

The runtime sandbox is a checked-out, executable copy of the context repository. It's the surface you use to read and modify context files, and to run commands against them.

Two important behaviors to remember:

  • write and edit push to the default branch of the context repo. They are not local-only.
  • execute does not push. Changes made to files by a shell command run via execute stay in the sandbox and are discarded — use execute for builds, tests, or inspection, not for committing edits.

Because writes push immediately, confirm the target workspace before the first write/edit:

cargo-ai whoami   # → workspace.uuid, workspace.name

Read the workspace name back to the user. If the session is for a specific client, make sure workspace.name matches before authoring anything — there is no dry-run mode. If workspace.name is generic or ambiguous (e.g. "Main", "Test", a person's name, an internal codename), don't guess — ask the user for the company name and canonical domain (example.com) and confirm both before the first write. If you logged in without pinning a workspace, re-run cargo-ai login --oauth --workspace-uuid \x3Cuuid> (or --token \x3Cworkspace-scoped-token> for non-interactive use).

Edits derived from sales-call analysis should be applied one at a time with human review, not batched. Looping an agent over many calls tends to overweight the loudest signal and miss nuance — see references/examples/lifecycle.md for the call-refresh playbook.

Browse and read

# List entries at the root of the runtime sandbox
cargo-ai context runtime browse

# List entries under a subpath (e.g. a domain folder like persona/ or play/)
cargo-ai context runtime browse --path persona

# Read a full file
cargo-ai context runtime read --path persona/vp-sales-mid-market.md

# Read only a line range (1-indexed, inclusive on both ends)
cargo-ai context runtime read --path play/inbound-trial-to-paid.md --start-line 1 --end-line 40

Write a new file

write creates (or overwrites) a file and pushes a commit to the default branch.

cargo-ai context runtime write \
  --path persona/vp-sales-mid-market.md \
  --content "$(cat \x3C\x3C'EOF'
---
title: VP of Sales, mid-market
description: Owns pipeline, quota, and rep productivity at a 200–2,000-person company.
---

## Role
- Title: VP of Sales
- Seniority: Executive
- Function: Revenue
- Reports to: CRO or CEO

## KPIs
- New ARR, win rate, pipeline coverage, rep ramp time

## Pains
- Pipeline gaps, slow ramp, low rep activity, forecasting drift

## Motivations
- Hit the number, build a repeatable motion, get visibility

## Day-to-day
Forecast calls, deal reviews, pipeline reviews, 1:1s with frontline managers.

## Preferred channels
- medium/linkedin-outbound
- medium/exec-warm-intro

## Common objections
- objection/we-already-have-an-ai-sdr

## How we land
Lead with pipeline-coverage math, not features.
EOF
)" \
  --commit-message "Add VP of Sales mid-market persona"

Edit an existing file

edit replaces a single exact substring. --old-string must occur exactly once in the file; pass an empty --new-string to delete the match.

# Replace one specific sentence
cargo-ai context runtime edit \
  --path global/positioning.md \
  --old-string "We help RevOps automate workflows." \
  --new-string "We help RevOps run AI-native GTM motions." \
  --commit-message "Refresh positioning one-liner"

# Delete a line (pass empty --new-string)
cargo-ai context runtime edit \
  --path persona/vp-sales-mid-market.md \
  --old-string "\
- Outdated stat: 4.2x pipeline\
" \
  --new-string ""

For larger restructures, prefer write (full-file overwrite) over many sequential edit calls.

Execute a command in the sandbox

execute runs a shell command in the sandbox. Useful for inspecting structure or running checks; changes are not pushed.

# Find every file that cross-references a specific slug
cargo-ai context runtime execute \
  --command grep \
  --args '["-r","-l","persona/vp-sales-mid-market","."]'

# Count entries per domain
cargo-ai context runtime execute --command ls --args '["-1","persona"]'

# Run a one-shot script (no quotes/escaping needed inside --command beyond JSON for args)
cargo-ai context runtime execute --command pwd

--args is a JSON array of string arguments. Omit it for a no-arg command.

Context repository structure and conventions

The Cargo context repo is a typed knowledge base. The canonical example — and the source of the conventions below — is getcargohq/cargo-workspaces; read its README.md and _template.md files in each domain before writing new entries. For the full domain reference, see references/conventions.md.

Domains

Domain Purpose
global/ Company-level context: mission, voice, positioning, narrative, pricing
icp/ Ideal Customer Profile segments
persona/ Buyer personas (roles inside an ICP)
jtbd/ Jobs-to-be-done framings
alternative/ Competitors, substitutes, status quo
client/ Customer profiles, case studies, reference accounts
insight/ Market insights and observations
medium/ Channel playbooks (email, LinkedIn, cold call, etc.)
objection/ Objections + responses + proof
play/ GTM plays (signal → audience → channel → sequence → outcome)
proof/ Atomic proof points (metrics, quotes, case data)
signal/ Buying signals and intent triggers

File conventions

  • Filename: kebab-case.md (e.g. vp-sales-mid-market.md).
  • Frontmatter: YAML with title and description, both required on every file.
  • Cross-references: use the domain/slug form, no .md extension (e.g. persona/vp-sales-mid-market).
  • Templates: each domain ships an _template.md. Read it (cargo-ai context runtime read --path persona/_template.md) before authoring a new entry.

Workflow: add a new entry

  1. Confirm the target domain and copy its template:
    cargo-ai context runtime read --path persona/_template.md
    
  2. write a new file at \x3Cdomain>/\x3Cslug>.md with title + description and the body sections filled in.
  3. Add cross-refs (domain/slug) where useful — keep them bidirectional when it makes sense.
  4. Rebuild the knowledge graph to verify the new entry and its links:
    cargo-ai context graph get
    

For full per-domain templates and worked examples, see references/conventions.md and references/examples/authoring.md.

Workflow: bootstrap and refresh

To stand up a new workspace's context repo from scratch, or to refresh an existing one on a cadence, follow the two-phase lifecycle in references/examples/lifecycle.md:

  1. Bootstrap (one-time): seed global/, persona/, client/, proof/, objection/, signal/ from public sources, then open a fresh agent session against the seeded repo. For the prescriptive, automatable version (domain in → files out, idempotent, with credit budget), use references/examples/bootstrap-from-domain.md.
  2. Refresh (every 2–4 weeks): pull the last ~3 months of sales-call transcripts → analyze one at a time, human-in-the-loop → apply a repetition threshold before promoting any claim to context → validate by generating sequence permutations → diff the graph before/after and retire stale entries.

The repetition threshold (how many calls a claim must appear in before it lands in context) is documented in references/conventions.md.

Knowledge graph

context graph get builds (or loads from cache) the knowledge graph over every markdown/MDX file in the context repo. Use it to:

  • Audit cross-references between domains (e.g. find personas that link to plays with no proof attached).
  • Discover what already exists before writing a new entry (avoid duplicates).
  • Power downstream agents that need the typed structure of the workspace's context.
cargo-ai context graph get

The response includes the parsed frontmatter and outbound domain/slug references for each node — pipe it through jq to slice it. See references/examples/graph-queries.md for ready-to-run queries.

Help

Every command supports --help:

cargo-ai context --help
cargo-ai context runtime browse --help
cargo-ai context runtime read --help
cargo-ai context runtime write --help
cargo-ai context runtime edit --help
cargo-ai context runtime execute --help
cargo-ai context graph get --help
安全使用建议
Install only if you intend to let Cargo operate on your workspace context repository. Confirm the workspace before any write/edit, avoid committing raw call transcripts or sensitive customer data, review repo changes carefully, and use sandbox execution only for simple inspection unless you explicitly approve more.
能力标签
requires-oauth-tokenrequires-sensitive-credentials
能力评估
Purpose & Capability
The stated purpose, examples, and metadata consistently describe browsing, reading, writing, editing, executing inspection commands, and querying a git-backed Cargo context repository.
Instruction Scope
The skill repeatedly tells agents to confirm the target workspace, read before editing, avoid batching call-derived edits, and use human review; some reference pages are less explicit but do not add hidden behavior.
Install Mechanism
Installation uses the disclosed npm package @cargo-ai/cli@latest and requires Cargo OAuth or an API token; this is purpose-aligned but users should understand they are trusting an external CLI and account credential.
Credentials
The runtime execute command is broad, but it is disclosed as sandboxed, non-persistent, and mainly shown for inspection commands such as grep, ls, pwd, and find.
Persistence & Privilege
Write and edit operations push commits to the default branch, and rename/delete workflows can affect persistent repository state; this is central to the skill and is disclosed, though privacy and backup cautions could be stronger.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cargo-context
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cargo-context 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Updated dependency installation to use "@cargo-ai/cli@latest" in SKILL.md. - Simplified and centralized prerequisites section by linking to a shared prerequisites document. - Removed redundant step-by-step install and login instructions from SKILL.md. - No changes to commands, usage, or functionality.
v1.0.0
Initial release of cargo-context. - Introduces a Cargo CLI skill for inspecting and editing a workspace's git-backed context repository and runtime sandbox. - Supports browsing, reading, writing, and editing markdown/MDX files, as well as running commands in the context sandbox. - Provides access to the context-derived knowledge graph for workspace insights. - Requires @cargo-ai/cli and Cargo account to use. - Includes clear usage references, prerequisites, and safety recommendations for editing and executing commands.
元数据
Slug cargo-context
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Cargo Context 是什么?

Inspect and edit the workspace's git-backed context repository (the GTM knowledge base of markdown/MDX files) and its runtime sandbox using the Cargo CLI. Us... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 90 次。

如何安装 Cargo Context?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cargo-context」即可一键安装,无需额外配置。

Cargo Context 是免费的吗?

是的,Cargo Context 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Cargo Context 支持哪些平台?

Cargo Context 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Cargo Context?

由 Cargo(@cargo-ai)开发并维护,当前版本 v1.0.1。

💬 留言讨论