Skip to content

Commit b26c9e2

Browse files
bpmcthugodutka
andauthored
feat: update tasks docs (#18659)
Preview: https://coder.com/docs/@tasks-docs/ai-coder --------- Co-authored-by: Hugo Dutka <[email protected]>
1 parent 6580971 commit b26c9e2

25 files changed

+229
-497
lines changed

docs/ai-coder/agents.md

Lines changed: 0 additions & 95 deletions
This file was deleted.

docs/ai-coder/best-practices.md

Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,53 @@
1-
# Model Context Protocols (MCP) and adding AI tools
1+
# Best Practices
22

3-
> [!NOTE]
4-
>
5-
> This functionality is in beta and is evolving rapidly.
6-
>
7-
> When using any AI tool for development, exercise a level of caution appropriate to your use case and environment.
8-
> Always review AI-generated content before using it in critical systems.
9-
>
10-
> Join our [Discord channel](https://discord.gg/coder) or
11-
> [contact us](https://coder.com/contact) to get help or share feedback.
3+
This document includes a mix of cultural and technical best practices and guidelines for introducing AI agents into your organization.
124

13-
## Overview
5+
## Identify Use Cases
146

15-
Coder templates should be pre-equipped with the tools and dependencies needed
16-
for development. With AI Agents, this is no exception.
7+
To successfully implement AI coding agents, identify 3-5 practical use cases where AI tools can deliver real value. Additionally, find a target group of developers and projects that are the best candidates for each specific use case.
178

18-
## Prerequisites
9+
Below are common scenarios where AI coding agents provide the most impact, along with the right tools for each use case:
1910

20-
- A Coder deployment with v2.21 or later
21-
- A [template configured for AI agents](./create-template.md)
11+
| Scenario | Description | Examples | Tools |
12+
|------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
13+
| **Automating actions in the IDE** | Supplement tedious development with agents | Small refactors, generating unit tests, writing inline documentation, code search and navigation | [IDE Agents](./ide-agents.md) in Workspaces |
14+
| **Developer-led investigation and setup** | Developers delegate research and initial implementation to AI, then take over in their preferred IDE to complete the work | Bug triage and analysis, exploring technical approaches, understanding legacy code, creating starter implementations | [Tasks](./tasks.md), to a full IDE with [Workspaces](../user-guides/workspace-access/index.md) |
15+
| **Prototyping & Business Applications** | User-friendly interface for engineers and non-technical users to build and prototype within new or existing codebases | Creating dashboards, building simple web apps, data analysis workflows, proof-of-concept development | [Tasks](./tasks.md) |
16+
| **Full background jobs & long-running agents** | Agents that run independently without user interaction for extended periods of time | Automated code reviews, scheduled data processing, continuous integration tasks, monitoring and alerting | [Tasks](./tasks.md) API *(in development)* |
17+
| **External agents and chat clients** | External AI agents and chat clients that need access to Coder workspaces for development environments and code sandboxing | ChatGPT, Claude Desktop, custom enterprise agents running tests, performing development tasks, code analysis | [MCP Server](./mcp-server.md) |
2218

23-
## Best Practices
19+
## Provide Agents with Proper Context
2420

25-
- Use the most capable ML models you have access to in order to evaluate Agent
26-
performance.
27-
- Set a system prompt with the `AI_SYSTEM_PROMPT` environment in your template
28-
- Within your repositories, write a `.cursorrules`, `CLAUDE.md` or similar file
29-
to guide the agent's behavior.
30-
- To read issue descriptions or pull request comments, install the proper CLI
31-
(e.g. `gh`) in your image/template.
32-
- Ensure your [template](./create-template.md) is truly pre-configured for
33-
development without manual intervention (e.g. repos are cloned, dependencies
34-
are built, secrets are added/mocked, etc.).
21+
While LLMs are trained on general knowledge, it's important to provide additional context to help agents understand your codebase and organization.
3522

36-
> Note: [External authentication](../admin/external-auth/index.md) can be helpful
37-
> to authenticate with third-party services such as GitHub or JFrog.
23+
### Memory
3824

39-
- Give your agent the proper tools via MCP to interact with your codebase and
40-
related services.
41-
- Read our recommendations on [securing agents](./securing.md) to avoid
42-
surprises.
25+
Coding Agents like Claude Code often refer to a [memory file](https://docs.anthropic.com/en/docs/claude-code/memory) in order to gain context about your repository or organization.
4326

44-
## Adding Tools via MCP
27+
Look up the docs for the specific agent you're using to learn more about how to provide context to your agents.
4528

46-
Model Context Protocol (MCP) is an emerging standard for adding tools to your
47-
agents.
29+
### Tools (Model Context Protocol)
4830

49-
Follow the documentation for your [agent](./agents.md) to learn how to configure
50-
MCP servers. See
51-
[modelcontextprotocol/servers](https://github.com/modelcontextprotocol/servers)
52-
to browse open source MCP servers.
31+
Agents can also use tools, often via [Model Context Protocol](https://modelcontextprotocol.io/introduction) to look up information or perform actions. A common example would be fetching style guidelines from an internal wiki, or looking up the documentation for a service within your catalog.
5332

54-
### Our Favorite MCP Servers
33+
Look up the docs for the specific agent you're using to learn more about how to provide tools to your agents.
5534

56-
In internal testing, we have seen significant improvements in agent performance
57-
when these tools are added via MCP.
35+
#### Our Favorite MCP Servers
36+
37+
In internal testing, we have seen significant improvements in agent performance when these tools are added via MCP.
5838

5939
- [Playwright](https://github.com/microsoft/playwright-mcp): Instruct your agent
6040
to open a browser, and check its work by viewing output and taking
6141
screenshots.
6242
- [desktop-commander](https://github.com/wonderwhy-er/DesktopCommanderMCP):
63-
Instruct your agent to run long-running tasks (e.g. `npm run dev`) in the
64-
background instead of blocking the main thread.
43+
Instruct your agent to run long-running tasks (e.g. `npm run dev`) in the background instead of blocking the main thread.
44+
45+
## Security & Permissions
46+
47+
LLMs and agents can be dangerous if not run with proper boundaries. Be sure not to give agents full permissions on behalf of a user, and instead use separate identities with limited scope whenever interacting autonomously.
48+
49+
[Learn more about securing agents with Coder Tasks](./security.md)
6550

66-
## Next Steps
51+
## Keep it Simple
6752

68-
- [Supervise Agents in the UI](./coder-dashboard.md)
69-
- [Supervise Agents in the IDE](./ide-integration.md)
70-
- [Supervise Agents Programmatically](./headless.md)
71-
- [Securing Agents](./securing.md)
53+
Today's LLMs and AI agents are not going to refactor entire codebases with production-grade code on their own! Using coding agents can be extremely fun and productive, but it is important to keep the scope of your use cases small and simple, and grow them over time.

docs/ai-coder/coder-dashboard.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/ai-coder/create-template.md

Lines changed: 0 additions & 66 deletions
This file was deleted.

docs/ai-coder/custom-agents.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
# Custom Agents
22

3-
> [!NOTE]
4-
>
5-
> This functionality is in beta and is evolving rapidly.
6-
>
7-
> When using any AI tool for development, exercise a level of caution appropriate to your use case and environment.
8-
> Always review AI-generated content before using it in critical systems.
9-
>
10-
> Join our [Discord channel](https://discord.gg/coder) or
11-
> [contact us](https://coder.com/contact) to get help or share feedback.
12-
13-
Custom agents beyond the ones listed in the [Coder registry](https://registry.coder.com/modules?tag=agent) can be used with Coder.
3+
Custom agents beyond the ones listed in the [Coder registry](https://registry.coder.com/modules?tag=agent) can be used with Coder Tasks.
144

155
## Prerequisites
166

177
- A Coder deployment with v2.21 or later
18-
- A [Coder workspace / template](./create-template.md)
8+
- A [Coder workspace / template](../admin/templates/creating-templates.md)
199
- A custom agent that supports Model Context Protocol (MCP)
2010

2111
## Getting Started
@@ -31,19 +21,18 @@ From there, the agent can run the MCP server with the `coder exp mcp server` com
3121
Inside a Coder workspace, run the following commands:
3222

3323
```sh
34-
coder login # be sure to be authenticated with the Coder CLI
35-
export CODER_MCP_APP_STATUS_SLUG=my-agent # needs to be the same as the slug in the coder_app resource
24+
coder login
25+
export CODER_MCP_APP_STATUS_SLUG=my-agent
3626

3727
# Use your own agent's logic and syntax here:
3828
any-custom-agent configure-mcp --name "coder" --command "coder exp mcp server"
3929
```
4030

4131
This will start the MCP server and report activity back to the Coder control plane on behalf of the coder_app resource.
4232

43-
> See the [Goose module](https://github.com/coder/registry/blob/main/registry/coder/modules/goose/main.tf) source code for a real world example.
33+
> [!NOTE]
34+
> See [this version of the Goose module](https://github.com/coder/registry/blob/release/coder/goose/v1.3.0/registry/coder/modules/goose/main.tf) source code for a real world example.
4435
4536
## Contributing
4637

47-
We welcome contributions for various agents via the [Coder registry](https://registry.coder.com/modules?tag=agent)!
48-
49-
See our [contributing guide](https://github.com/coder/registry/blob/main/CONTRIBUTING.md) for more information.
38+
We welcome contributions for various agents via the [Coder registry](https://registry.coder.com/modules?tag=agent)! See our [contributing guide](https://github.com/coder/registry/blob/main/CONTRIBUTING.md) for more information.

0 commit comments

Comments
 (0)