mirror of
https://github.com/coder/coder.git
synced 2026-11-11 03:21:02 +08:00
> Mux updated this PR on behalf of Mike. ## Stack Context This stack splits experimental personal skills into smaller reviewable PRs. Personal skills are user-owned `SKILL.md` files stored by Coder and injected into chatd alongside workspace skills. Stack order: 1. #25362 personal skill resolver 2. #25363 storage, permissions, API, and SDK 3. #25365 API test coverage 4. #25366 chattool and chatd integration 5. #25066 settings UI and docs 6. #25386 personal skills slash menu ## What? Adds the shared personal skill parser and resolver package, plus reusable skill-name validation exported from `workspacesdk`. The parser enforces the full personal skill contract: max raw size, kebab-case name, max name length, and non-empty body. ## Why? The rest of the stack needs one source-aware resolver for personal and workspace skills, including collision handling and qualified aliases. Keeping personal skill constraints in the parser prevents callers from accidentally parsing invalid personal skills. ## Validation - `go test ./coderd/x/skills ./codersdk/workspacesdk` - pre-commit hooks on this branch
53 lines
2.5 KiB
Go
53 lines
2.5 KiB
Go
// Package skills defines the shared model for personal and workspace skills
|
|
// used by chatd.
|
|
//
|
|
// Glossary:
|
|
//
|
|
// - Personal skill: A user-owned skill that follows the user across Coder
|
|
// chats and workspaces, stored by Coder rather than discovered from a
|
|
// workspace filesystem.
|
|
// - Workspace skill: A skill discovered from the workspace filesystem,
|
|
// currently under .agents/skills by default.
|
|
// - Skill source: The origin of a skill available to chatd, such as personal
|
|
// storage or workspace filesystem discovery.
|
|
// - Skill alias: A chat or tool lookup name for a skill. Bare aliases use the
|
|
// skill name. Qualified aliases use personal/<name> or workspace/<name>.
|
|
//
|
|
// Decision:
|
|
//
|
|
// Personal skills are stored by Coder. For each chat turn, chatd fetches
|
|
// personal skill metadata fresh, combines it with workspace skill metadata, and
|
|
// injects the available skills into the existing skill prompt.
|
|
// When chatd needs skill content, it resolves personal skills through the
|
|
// read_skill flow instead of syncing files into workspace filesystems.
|
|
//
|
|
// If a personal skill and workspace skill share the same kebab-case name, both
|
|
// are exposed with qualified aliases: personal/<name> for the personal skill
|
|
// and workspace/<name> for the workspace skill. One source must not silently
|
|
// override the other.
|
|
//
|
|
// Site admins can read and modify personal skill content. Personal skills are
|
|
// user-authored instructions, not secret material. Audit records can include
|
|
// raw Markdown content diffs alongside the actor, target user, and relevant
|
|
// metadata.
|
|
//
|
|
// Personal skill edits affect the next chat turn. Old chat turns are not exact
|
|
// snapshots of the personal skill state that existed when they ran.
|
|
//
|
|
// The v1 design does not include CLI support, web UI support, supporting files,
|
|
// organization-scoped personal skills, syncing personal skills into workspace
|
|
// filesystems, or stable public API documentation.
|
|
//
|
|
// Consequences:
|
|
//
|
|
// Chatd can use personal and workspace skills through one prompt and one read
|
|
// path, while storage remains owned by Coder instead of individual workspace
|
|
// filesystems. Fresh metadata keeps skill changes responsive, but chat history
|
|
// is less reproducible because old turns do not capture an exact copy of
|
|
// personal skill content.
|
|
//
|
|
// Explicit qualified aliases make ambiguous names visible to users and tools.
|
|
// Admin access improves operability and abuse handling, but it creates a
|
|
// privacy trade-off that must remain clear in product and support expectations.
|
|
package skills
|