← 返回
开发者工具 中文

Amp Code

Delegate coding tasks to Sourcegraph Amp, an autonomous coding agent. Use when: multi-file changes, new features, bug fixes, test writing, or any coding task...
将编码任务委托给 Sourcegraph Amp,一个自主编码代理。使用场景:多文件改动、新功能、缺陷修复、编写测试,或任何编码任务。
minerva-care
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 615
下载
💾 4
安装
1
版本
#latest

概述

amp-code — Delegate Coding Tasks to Sourcegraph Amp

Use this skill to hand off coding work to Amp, an autonomous coding agent.

Amp can read, write, refactor, and test code across an entire codebase without supervision.


When to delegate to Amp

Delegate when the task involves:

  • Multi-file changes — refactoring, moving modules, updating APIs
  • New features — implementing something that requires creating/editing several files
  • Bug fixes — especially when the root cause requires investigation and code changes
  • Test writing — generating test suites, adding coverage
  • Anything > ~5 min of coding — if you'd need multiple edit calls, let Amp do it

Do NOT delegate:

  • Simple single-line edits (just use edit)
  • Purely diagnostic/read-only questions (just use exec/read)
  • Tasks where you need fine-grained control over each file change

Modes

ModeDescriptionUse when
---------------------------------------------------------------------------------------------------
rushFast, lightweight modelSmall/clear tasks, quick fixes
smartBalanced model (default)Most tasks
deepPowerful model, slower, higher costComplex architecture, hard bugs

How to run a task

Simple one-shot (recommended)

cd /path/to/project && \
  amp \
    --dangerously-allow-all \
    --no-notifications \
    --no-ide \
    -m smart \
    -x "Your task description here"

The -x flag (execute mode) makes amp non-interactive: it runs the task and exits,

printing only the agent's final message to stdout.

Using the wrapper script

bash {baseDir}/scripts/amp-task.sh \
  --task "Add pagination to the /invoices endpoint" \
  --dir /path/to/your/project \
  --mode smart

The script handles: cd to project dir, thread creation (for auditability), execute mode,

and clean output. It prints the thread ID and final agent response.


Key flags

FlagEffect
--------------------------------------------------------------------------------
--dangerously-allow-allNo confirmation prompts — agent acts autonomously
--no-notificationsSuppress sound/system notifications
--no-ideDon't connect to IDE (safe for headless runs)
-x "message"Execute mode: non-interactive, prints final output
-m rush/smart/deepSelect agent mode (model + system prompt)
-l "label"Tag the thread with a label (repeatable)

Working directory matters

Amp reads the codebase from the current directory. Always cd to the project root first,

or pass --dir to the wrapper script. Without the right cwd, Amp won't see the right files.


Checking results

After a run, the wrapper script outputs:

  1. The thread ID — use this to inspect or continue the conversation
  2. The final agent message — summary of what was done

To see the full thread as markdown (all messages, tool calls, etc.):

amp threads markdown <thread-id>

To continue a thread (e.g., to follow up or fix something):

cd /path/to/project && \
  echo "Now also add tests for the pagination logic" | \
  amp threads continue <thread-id> \
    --dangerously-allow-all --no-notifications --no-ide -x

To list recent threads:

amp threads list

Example invocations

One-shot fix

cd /path/to/your/project && \
  amp --dangerously-allow-all --no-notifications --no-ide -x \
  "Fix the TypeError in src/api/invoices.js line 42 — amount is sometimes null"

Feature implementation (via wrapper)

bash {baseDir}/scripts/amp-task.sh \
  --task "Implement CSV export for the invoices list page — add a button in the UI and a /api/invoices/export endpoint" \
  --dir /path/to/your/project \
  --mode smart

Deep refactor

bash {baseDir}/scripts/amp-task.sh \
  --task "Migrate all database calls from raw SQL to Knex query builder. Maintain existing behaviour, add comments." \
  --dir /path/to/your/project \
  --mode deep

Quick test generation

bash {baseDir}/scripts/amp-task.sh \
  --task "Write Jest unit tests for all functions in src/utils/formatting.js" \
  --dir /path/to/your/project \
  --mode rush

Notes

  • Amp commits are tagged with Amp-Thread: trailer in git. Use this to find amp-authored commits.
  • The --dangerously-allow-all flag bypasses all tool permission checks. Only use on trusted projects.
  • Amp may make mistakes. Review the diff after large changes: git diff HEAD~1
  • For very long tasks, amp may time out. Break into smaller sub-tasks if needed.
  • Thread IDs are UUIDs. Save them if you want to audit or continue work later.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 17:09 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,164
productivity

Readarr

minerva-care
通过 Readarr(电子书/有声书管理器)的 REST API 进行交互。用于搜索图书、监控作者新书发布、查询缺失内容等。
★ 0 📥 624
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,150