Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 39 additions & 23 deletions docs/concepts/skills.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# Use Skills

A Skill is a set of instructions for the agent explaining when to use it, what steps to follow, what dependencies are required, and which operations require user confirmation.

A Skill is a document-based working method for an agent. It explains when to use a capability, what steps to follow, what dependencies are required, and which operations need confirmation.

## Official core Skills

AgentDock native installers and Docker images automatically install and activate these official core Skills:
AgentDock native installers and Docker images ship these core Skills with the runtime:

- `agentdock-user-guide`
- `skill-authoring`
- `skill-installation`
- `skill-vetter-runtime`

They use the same version selection and rollback mechanism as other installed Skills.
They are managed like other AgentDock-managed Skills: each name has one current content tree. AgentDock does not keep a selectable Skill-version history or an active-version pointer.

`desktop` and Skills requiring accounts, system permissions, or third-party configuration are not installed automatically.
Skills that require extra accounts, system permissions, or third-party software are installed separately when needed.

## How to use Skills

Expand All @@ -27,53 +26,70 @@ Install and use this Skill: https://example.com/example-skill.zip

The agent typically:

1. Checks whether a matching Skill is already installed.
2. Reads the Skill instructions and safety boundaries.
3. Checks required commands, accounts, or environment variables.
4. Uses actual tools to perform the task.
1. Uses `agentdock_context` or `workspace_context` to discover relevant Skill candidates and their source.
2. Selects one exact candidate and reads the `file` returned by the host with `read_file`.
3. Checks required commands, accounts, environment variables, and safety boundaries.
4. Uses real tools to perform the task; commands bound to a Skill use that candidate's returned `skill_ref` with `exec_command`.
5. Confirms and verifies operations with side effects.

Do not reconstruct a `skill_ref` from a bare Skill name. The host-issued reference keeps managed, shared, and workspace candidates with the same name distinct.

## Workspace-local Skills

A project can expose local Skills at `<workspace>/.agents/skills/<skill-name>/SKILL.md`. `workspace_context` returns only their `name`, `description`, and `file` index; it does not inject the Skill body into context. Read the returned `SKILL.md` with `read_file` only when that Skill is needed.
A project can expose local Skills at `<workspace>/.agents/skills/<skill-name>/SKILL.md`. `workspace_context` indexes them and returns provenance such as `name`, `description`, `source_type`, `source_id`, `skill_ref`, and `file`; it does not inject the Skill body into context.

When names overlap, prefer the workspace Skill for the active project, then AgentDock Skills, then global common Skills under `~/.agents/skills`.
A workspace Skill, an AgentDock-managed Skill, and a shared Skill under `~/.agents/skills` remain separate candidates even when their names match. For project work, a workspace candidate is often the relevant choice, but the agent must use the selected candidate's own `file` and `skill_ref` instead of silently applying a global name-based priority.

## Installing a Skill
## Installing or updating a managed Skill

Confirm the source is trustworthy before installing. Ask the agent to vet the package before installing and activating:
Confirm the source is trustworthy before installing. Ask the agent to review the package first:

```text
Please vet this Skill's source, files, and permission requirements, and install it once confirmed safe.
Please review this Skill's source, files, portability, and permission requirements, then install it if the review is clean.
```

Remote sources must point to a ZIP archive; local sources can be a Skill directory or ZIP file. A Skill can have multiple installed versions, but only one is active at any time. When installing a new version, you can leave it inactive. Use `skill_package activate` to switch active versions, or rollback to a previous version if switching fails. Skill packages must not contain tokens, cookies, browser sessions, or personal environment files.
`skill_manage install` accepts a local Skill directory, a local ZIP archive, or an HTTPS package URL. An optional source SHA-256 can be supplied for integrity checking.

A managed Skill has one current content tree. Installing different content with the same Skill name atomically replaces that current content after validation; reinstalling identical content is a no-op and returns the same `content_digest`. AgentDock does not expose `activate`, `rollback`, or version-selection actions for Skills. To restore known content, review and reinstall the desired source snapshot.

When upgrading from an older AgentDock release that used the historical Skill layout, supported installers and updaters migrate managed Skill content and persistent Skill data automatically. The old layout is kept intact until the outer install/update transaction commits, so users do not need to move Skill directories or run migration commands manually.

Skill packages must not contain tokens, cookies, browser sessions, `.env` files, caches, or device-private data.

## Configure accounts or API keys

When a Skill requires credentials, ask the agent to store them in that Skill's isolated environment, for example:
When a managed Skill requires credentials, ask the agent to save them in that Skill's isolated environment, for example:

```text
Set EXAMPLE_API_KEY for example-skill without echoing the actual value in the reply.
```

Isolated environments are injected only when running that Skill; they are not written into the Skill package or the permanent system environment.
`skill_manage env_list` reports variable names and configuration state without returning secret values. The isolated environment is injected only when a command runs with that managed candidate's `skill_ref`; it is not written into the Skill package or the permanent system environment.

## Persistent Skill data

When a managed Skill command needs mutable persistent state, AgentDock creates a private data directory and exposes it to that process as the reserved `SKILL_DATA_DIR` environment variable.

The Skill should treat `SKILL_DATA_DIR` as an optional AgentDock integration, not as a portable requirement. Shared and workspace candidates do not inherit a managed Skill's environment or data directory. Normal managed-Skill updates and `skill_manage remove` preserve isolated environment and persistent data; `skill_manage remove` with `purge=true` removes those preserved resources as well.

Supported AgentDock installers and self-updaters migrate older managed-Skill layouts automatically during a normal upgrade, so no manual directory migration is required.

## Usage precautions

- Confirm before deleting, sending, uploading, paying, or authorizing.
- Skill instructions cannot exceed the permissions of the running user, Docker volumes, or the OS.
- Skill instructions cannot exceed the permissions of the AgentDock process, container volumes, or the operating system.
- Third-party Skills may call external services; verify source and capabilities before installation.
- On failure, check missing dependencies or configuration first; do not paste secrets into public logs.
- Do not paste secrets into public logs or package them with the Skill.
- Treat `content_digest` as content identity and audit evidence, not as a product version number.

## Viewing installed Skills

Ask directly:

```text
What Skills are installed? What does each do?
What Skills are available here, and where does each candidate come from?
```

The agent checks installed Skill names and descriptions, then reads full documentation as needed.
The agent can use `agentdock_context` for managed/shared candidates and `workspace_context` for the active project, then read full Skill documentation only when needed.

Creating and maintaining Skills is a developer workflow; see [Developer Guide](../contributing/development.md#skill-development).
Creating and maintaining Skills is a developer workflow; see [Contributor guide](../contributing/development.md#skill-development).
68 changes: 48 additions & 20 deletions docs/contributing/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ make check

It runs formatting, tests, vet, and builds. During local development, package-level tests may run first, but the complete check is still required before submission.

Changes involving concurrency, platform differences, installers, Docker, or browsers also require the relevant focused tests and real-environment verification.
Changes involving concurrency, platform differences, installers, Docker, browsers, ACP, or desktop lifecycle also require relevant focused tests and real-environment verification.

## Documentation checks

Expand All @@ -30,30 +30,44 @@ pnpm install --frozen-lockfile
pnpm check
```

`pnpm check` runs the TypeScript check, verifies English and Simplified Chinese structure, builds both Docusaurus locales for production, and checks internal links. After changing navigation, layout, or wide tables, inspect desktop and mobile pages in a real browser.
`pnpm check` runs TypeScript checks, locale tests, English/Simplified Chinese structural consistency checks, production builds for both locales, and the default production build. After changing navigation, layout, or wide tables, inspect desktop and mobile pages in a real browser.

## Public-contract discipline

Public documentation describes behavior that an ordinary user or third-party integrator can reproduce. It is not a maintainer notebook.

- Use current `main` source, public release assets, tool schemas, and supported UI/CLI entry points as the source of truth.
- Derive tool names and actions from the actual MCP contracts. Use the client's `tools/list` for availability rather than documenting internal helper functions as public tools.
- Derive runtime configuration from the current Core configuration parser and public server flags. Installer-only transaction variables, test switches, signing variables, and maintainer deployment overrides are not user configuration.
- Use generic placeholders such as `example.com`, `<token>`, and `<workspace>`. Never publish a maintainer username, device name, private hostname, local project path, personal proxy, private endpoint, or real credential.
- Document supported defaults and user-controlled overrides, not the topology of a maintainer machine. Platform examples should work for a normal installation of that platform.
- Keep compatibility code and migration behavior out of the primary path. Mention a legacy input only when current users may still encounter it, and label the current replacement clearly.
- Keep English and Simplified Chinese pages semantically synchronized in the same change.

When a source comment or historical document conflicts with executable behavior, verify the actual contract and tests before updating user documentation. Do not preserve stale wording merely for consistency with an older release.

## Change principles

- Inspect the existing directory structure, interfaces, error handling, and test style first.
- Keep the primary flow readable; do not create abstraction only for formal layering.
- Update tests when changing tool descriptions, schemas, paths, authentication, commands, browsers, or desktop capabilities.
- When changing an installer, verify help text, defaults, generated files, and representative installation paths.
- Do not publish real tokens, private endpoints, personal directories, or maintainer credentials.
- Keep migration history, temporary compatibility behavior, and maintainer-machine deployment details out of user documentation.
- Update tests when changing tool descriptions, schemas, paths, authentication, commands, browsers, ACP, or desktop capabilities.
- When changing an installer, verify help text, defaults, generated files, supported release assets, upgrades, uninstall behavior, and representative installation paths.
- Preserve user data unless the public action explicitly requests destructive cleanup; document purge behavior separately from ordinary update/remove behavior.
- Do not expose real tokens, private endpoints, personal directories, or maintainer credentials in tests, examples, screenshots, logs, or docs.

## Tool result conventions

Use MCP protocol-level `isError` for tool-call errors. Successful tool results do not use ambiguous generic fields such as `ok` or `tool_ok`:

- Commands use `command_ok`, `exit_code`, and `command_error`.
- Browser operations use `browser_ok` and `browser_error`.
- Other tools use explicit domain fields such as `valid`, `changed`, and `configured`.
- Other tools use explicit domain fields such as `changed`, `configured`, `written`, or similarly scoped results.

When adding or changing an output schema, verify that `structuredContent` does not leak generic state fields from internal HTTP, WSL child-process, or runner protocols.
When adding or changing an output schema, verify that `structuredContent` does not leak generic state fields from internal HTTP, WSL child-process, installer, or runner protocols.

## Skill development

First-party Skills use a “portable core plus optional AgentDock integration” model. The minimum layout is:
First-party Skills use a portable document core with optional AgentDock integration. The minimum layout is:

```text
example-skill/
Expand All @@ -62,20 +76,34 @@ example-skill/

Add `references/`, `scripts/`, entry points, and tests only when needed. Requirements:

- Use relative paths inside the package.
- Scripts read only from the current process environment.
- Do not hard-code user-specific absolute paths, installed versions, or private AgentDock state files.
- Do not package environment files, caches, login state, or device-private data.
- Increment the semantic version after changing instructions, references, or scripts.
- Use `skill-authoring` to review content and portability, then use `skill_package validate` to validate package structure.
- `SKILL.md` has a valid `name`, a useful `description`, and non-empty instructions.
- Use relative paths inside the package; do not depend on a maintainer checkout path or private AgentDock state path.
- Scripts read configuration from the current process environment and keep mutable state outside the package.
- Do not package `.env` files, tokens, caches, login state, databases, downloaded results, symlinks, or device-private data.
- `metadata.version`, if present, is author metadata only. AgentDock does not use a Skill version field for install selection, activation, or rollback.
- Treat `content_digest` as current-content identity. Reinstalling identical managed content is a no-op; changed content replaces the current managed tree transactionally.
- If persistent mutable data is required, portable code should treat `SKILL_DATA_DIR` as an optional AgentDock adapter. Do not hard-code `~/.agentdock/data/...`.
- Use `skill-authoring` to review structure, portability, and safety. Runtime installation uses `skill_manage`; there is no `skill_package validate` compatibility action to document.
- When executing Skill-bound commands in integrations, use the exact host-issued `skill_ref` from discovery rather than reconstructing one from a bare name.

See [Use Skills](../concepts/skills.md) for the user workflow.

## Cross-repository changes

A user-visible change may require more than one repository:

- Tool behavior, installers, Core configuration, and bundled Skills: update `uvwt/agentdock` and matching docs.
- Shared AgentDock/NexusDock interfaces: update `uvwt/agentdock-protocol` first when the protocol contract changes, then update both implementations and docs.
- NexusDock-only deployment or fleet UI behavior: update `uvwt/nexusdock` and the relevant public documentation.
- Community or independently distributed Skills: update the Skill source/catalog rather than copying maintainer-specific installation state into AgentDock docs.

See [Use Skills](../concepts/skills.md) for usage details.
Keep each repository change independently reviewable and link related PRs when a public contract spans repositories.

## Commits and releases

- `main` is the stable branch.
- Commit messages use `type(scope): 中文说明`.
- Commit messages use the repository's current convention; AgentDock commonly uses `type(scope): 中文说明`.
- Before committing, confirm the working tree contains only changes for the current task.
- Check GitHub Actions after pushing.
- Visit the deployed page after documentation is published.
- Follow the current source-repository maintenance rules for releases, signing, production deployment, and maintainer-machine operations; do not duplicate those procedures in user documentation.
- Run the full repository checks before submission and check GitHub Actions after pushing.
- Visit the deployed documentation after publication when the change affects navigation, rendering, downloads, or copyable commands.
- Release signing, production deployment, and maintainer-machine operations belong in maintainer runbooks or automation, not ordinary user pages.
2 changes: 1 addition & 1 deletion docs/getting-started/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Quitting the menu bar application does not stop the AgentDock background service
4. Verify that AgentDock detects a supported browser.
5. Click **Apply and Restart**.

AgentDock uses isolated sessions and profiles for browser automation, never taking over your primary browser profile.
AgentDock uses isolated sessions and profiles by default. Attaching to an existing Chromium-family browser over CDP is an explicit advanced choice; see the browser guide before using that mode.

For sessions and security boundaries, see [Browser automation](../guides/browser-control.md).

Expand Down
28 changes: 20 additions & 8 deletions docs/getting-started/vps.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ curl -fL "$BASE_URL/$ASSET.sha256" -o "$TMP_DIR/$ASSET.sha256"
)

sudo install -m 0755 "$TMP_DIR/bin/agentdock" /opt/agentdock/bin/agentdock
sudo rm -rf /opt/agentdock/share/agentdock/core-skills
sudo install -d -m 0755 /opt/agentdock/share/agentdock/core-skills
sudo cp -R "$TMP_DIR/share/agentdock/core-skills/." /opt/agentdock/share/agentdock/core-skills/
sudo chown -R root:root /opt/agentdock/share/agentdock/core-skills
sudo -u agentdock -H /opt/agentdock/bin/agentdock skill bootstrap \
--bundle /opt/agentdock/share/agentdock/core-skills
rm -rf "$TMP_DIR"
```

Expand Down Expand Up @@ -68,13 +74,6 @@ sudo chown root:agentdock /etc/agentdock/agentdock.env
sudo chmod 0640 /etc/agentdock/agentdock.env
```

Add these variables when NexusDock Recall or workflow templates are required:

```bash
AGENTDOCK_NEXUS_ENDPOINT=https://nexus.example.com
AGENTDOCK_NEXUS_TOKEN=<replace-with-a-secret>
```

## systemd unit

Create `/etc/systemd/system/agentdock.service`:
Expand Down Expand Up @@ -109,6 +108,19 @@ sudo systemctl daemon-reload
sudo systemctl enable --now agentdock
```

## Pair NexusDock (optional)

If this device should use NexusDock Recall/Workflow or join a NexusDock fleet, generate a one-time pairing code under **NexusDock → Settings → System & Nodes**. Pair as the same service user that runs AgentDock, then restart the service:

```bash
sudo -u agentdock -H /opt/agentdock/bin/agentdock nexus pair \
--endpoint https://nexus.example.com \
--code <pairing-code>
sudo systemctl restart agentdock
```

Do not put legacy Nexus endpoint/token credentials in `agentdock.env`; current AgentDock loads NexusDock identity from the paired device state.

## HTTPS reverse proxy

Caddy example:
Expand Down Expand Up @@ -142,7 +154,7 @@ AGENTDOCK_OAUTH_TOKEN_SECRET=<random-signing-key-at-least-32-bytes>

## Update

Download and verify the target release again, replace `/opt/agentdock/bin/agentdock`, then restart:
Download and verify the target release again, replace the binary **and** refresh/bootstrap that release's `share/agentdock/core-skills` bundle as shown above, then restart:

```bash
sudo systemctl restart agentdock
Expand Down
Loading
Loading