Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
2ac1248
feat: add project skill queries and authorization
jaaydenh Oct 15, 2026
836c956
refactor(coderd/database): share chat project config authorization he…
jaaydenh Oct 15, 2026
7bc17ba
test(coderd/database): assert project skill reads stay scoped to thei…
jaaydenh Oct 15, 2026
1c9e8f1
feat: add project skill API routes
jaaydenh Oct 15, 2026
d623418
chore(coderd): clarify chat project skill limit comment
jaaydenh Oct 15, 2026
dda45bc
feat(coderd/x): load project skills in chats
jaaydenh Oct 15, 2026
27c808d
feat(site): list project skills in the chat slash menu
jaaydenh Oct 15, 2026
009432c
refactor(site/src/pages/AgentsPage): share stored skill source loadin…
jaaydenh Oct 15, 2026
a3a2f5d
refactor(site/src/pages/AgentsPage/components/ChatMessageInput): simp…
jaaydenh Oct 15, 2026
23a5168
refactor(site/src/pages/AgentsPage): name stored skill source flags a…
jaaydenh Oct 15, 2026
5533023
refactor(site/src/pages/AgentsPage/components): clarify skill source …
jaaydenh Oct 15, 2026
681b374
test: cover project skill loader and gating gaps
jaaydenh Oct 15, 2026
2a72a92
test(site/src/pages/AgentsPage/components): assert the project skills…
jaaydenh Oct 15, 2026
26deda5
fix(site/src/pages/AgentsPage): use the root chat's project for subag…
jaaydenh Oct 15, 2026
549a030
fix(site/src/pages/AgentsPage): keep inherited project skills pending…
jaaydenh Oct 15, 2026
7b6c3e3
test(site/src/pages/AgentsPage/components): restore Range geometry st…
jaaydenh Oct 15, 2026
a14b495
refactor(site/src/pages/AgentsPage): extract SkillEditorForm and shar…
jaaydenh Oct 15, 2026
3a6e22b
feat(site): add the project skills dialog
jaaydenh Oct 15, 2026
e1a4429
fix(site/src/pages/AgentsPage/components): keep the edited skill name…
jaaydenh Oct 15, 2026
dd7a120
Merge branch 'chat-project-skills/skill-editor-form' into chat-projec…
jaaydenh Oct 15, 2026
43b64fc
fix(site/src/pages/AgentsPage/components/ProjectPage): keep skill edi…
jaaydenh Oct 15, 2026
fc6f82d
test(site/src/pages/AgentsPage/components/ProjectPage): move download…
jaaydenh Oct 15, 2026
85fcc37
refactor(site/src/pages/AgentsPage/components): drop a JSDoc that res…
jaaydenh Oct 15, 2026
ff7f8d8
fix(site/src/pages/AgentsPage/components/ProjectPage): drop stale ski…
jaaydenh Oct 15, 2026
91be0f4
Merge branch 'chat-project-skills/skill-editor-form' into chat-projec…
jaaydenh Oct 15, 2026
553df7e
refactor(site/src/pages/AgentsPage/components): drop comments that re…
jaaydenh Oct 15, 2026
78f6a19
Merge branch 'chat-project-skills/skill-editor-form' into chat-projec…
jaaydenh Oct 15, 2026
316ad1e
fix(site/src/pages/AgentsPage/components/ProjectPage): cancel stale s…
jaaydenh Oct 15, 2026
6c07758
fix(site/src/pages/AgentsPage/components/ProjectPage): keep New disab…
jaaydenh Oct 15, 2026
8defe30
docs(site/src/api/queries): correct the project skill 409 comment
jaaydenh Oct 15, 2026
805a802
docs(site/src/pages/AgentsPage): document exported skill helpers
jaaydenh Oct 15, 2026
74b1f39
refactor(site/src/pages/AgentsPage): tighten the project skills dialog
jaaydenh Oct 16, 2026
540ea7b
refactor(site/src/pages/AgentsPage/components/ProjectPage): scope the…
jaaydenh Oct 16, 2026
14066aa
docs(site/src/pages/AgentsPage): document project skill cache and dia…
jaaydenh Oct 16, 2026
4adbfba
test(site/src/pages/AgentsPage/components/ProjectPage): drop a render…
jaaydenh Oct 16, 2026
e6af784
Merge remote-tracking branch 'origin/main' into HEAD
jaaydenh Oct 16, 2026
ebb0776
fix(coderd/database/migrations): renumber chat project skill audit mi…
jaaydenh Oct 16, 2026
2ea1fca
Merge branch 'chat-project-skills/queries' into chat-project-skills/api
jaaydenh Oct 16, 2026
f317b07
Merge branch 'chat-project-skills/api' into chat-project-skills/chatd
jaaydenh Oct 16, 2026
958d217
Merge branch 'chat-project-skills/chatd' into chat-project-skills/sub…
jaaydenh Oct 16, 2026
483db17
Merge branch 'chat-project-skills/subagent-project' into chat-project…
jaaydenh Oct 16, 2026
29b7356
Merge branch 'chat-project-skills/skill-editor-form' into chat-projec…
jaaydenh Oct 16, 2026
f010477
chore(coderd): remove non-essential project skill comments
jaaydenh Oct 18, 2026
cbb4bf7
Merge remote-tracking branch 'origin/main' into rs-queries
jaaydenh Oct 18, 2026
1799827
fix(coderd/database/migrations): renumber chat project skill audit mi…
jaaydenh Oct 18, 2026
d1c3934
Merge branch 'rs-queries' into rs-api
jaaydenh Oct 18, 2026
a63de89
Merge branch 'rs-api' into rs-chatd
jaaydenh Oct 18, 2026
8e1aa52
feat: add project skill API routes
jaaydenh Oct 15, 2026
34c10cd
chore(coderd): clarify chat project skill limit comment
jaaydenh Oct 15, 2026
c20a345
Merge branch 'chat-project-skills/api' into chat-project-skills/chatd
jaaydenh Oct 18, 2026
ec1b625
Merge remote-tracking branch 'origin/main' into chat-project-skills/c…
jaaydenh Oct 18, 2026
c39c1e0
Merge branch 'chat-project-skills/chatd' into chat-project-skills/sub…
jaaydenh Oct 18, 2026
e848b00
Merge branch 'chat-project-skills/subagent-project' into chat-project…
jaaydenh Oct 18, 2026
9d3f01c
Merge branch 'chat-project-skills/skill-editor-form' into chat-projec…
jaaydenh Oct 18, 2026
52ba82d
Merge remote-tracking branch 'origin/main' into skills-chatd-fix
jaaydenh Oct 20, 2026
1c06855
chore: update architecture.md
jaaydenh Oct 20, 2026
0c938f1
fix: gate project skills on project usability and fail open in the co…
jaaydenh Oct 20, 2026
379ae2e
fix(site/src/pages/AgentsPage): keep loaded project skills after a fa…
jaaydenh Oct 20, 2026
ee7773e
Merge remote-tracking branch 'origin/chat-project-skills/chatd' into …
jaaydenh Oct 20, 2026
8288725
docs(site/src/pages/AgentsPage/components/ChatMessageInput): clarify …
jaaydenh Oct 20, 2026
894beaf
fix(site/src): count only lost project access as no project skills
jaaydenh Oct 20, 2026
019f52f
fix(site/src): let lost project access override cached project skills
jaaydenh Oct 20, 2026
2964653
test(site/src/pages/AgentsPage/components/ChatMessageInput): cover lo…
jaaydenh Oct 20, 2026
b0a3bbc
revert(site/src/pages/AgentsPage): drop the root-chat project fallbac…
jaaydenh Oct 20, 2026
b1e7cf2
Merge remote-tracking branch 'origin/chat-project-skills/chatd' into …
jaaydenh Oct 20, 2026
9bb55f3
Merge remote-tracking branch 'origin/chat-project-skills/skill-editor…
jaaydenh Oct 20, 2026
89a2e9a
fix(site/src): hide project skills the caller's chats cannot use
jaaydenh Oct 20, 2026
9231e4e
fix(site/src/api/queries): treat a cached project list as unknown unt…
jaaydenh Oct 20, 2026
17ba94d
Merge remote-tracking branch 'origin/main' into wyav/sk-chatd
jaaydenh Oct 20, 2026
b79ed20
Merge branch 'wyav/sk-chatd' into wyav/sk-skill-editor-form
jaaydenh Oct 20, 2026
0384e1b
Merge branch 'wyav/sk-skill-editor-form' into wyav/sk-project-skills-…
jaaydenh Oct 20, 2026
90de6c8
refactor(coderd/x/chatd): remove the unused resolveProjectInstructions
jaaydenh Oct 21, 2026
e9117ba
chore: update architecture.md
jaaydenh Oct 21, 2026
f83fb91
Merge branch 'chat-project-skills/chatd' of https://github.com/coder/…
jaaydenh Oct 21, 2026
e9a4adf
fix(site/src/pages/AgentsPage/components/ChatMessageInput): drop the …
jaaydenh Oct 21, 2026
fe2c0b3
Merge commit 'e9a4adf7c68e6bf80c9633591e8a99345b3f1dbf' into resync-s…
jaaydenh Oct 21, 2026
9d80261
Merge commit '3216580614^' into resync-skill-editor-form
jaaydenh Oct 21, 2026
793e989
Merge commit '3216580614' into resync-skill-editor-form
jaaydenh Oct 21, 2026
e5f1e0a
Merge commit '793e989a07d92b87e39aa15f5f0f9c853a9d317c' into pr-30855…
jaaydenh Oct 21, 2026
78f232d
Merge commit 'c1d4907f6c^' into project-skills-dialog
jaaydenh Oct 21, 2026
d581a38
Merge commit 'c1d4907f6c' into project-skills-dialog
jaaydenh Oct 21, 2026
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
56 changes: 55 additions & 1 deletion site/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ const organizationSkillPath = (organizationId: string, name: string) =>
`${organizationSkillsPath(organizationId)}/${encodeURIComponent(name)}`;
const organizationSkillACLPath = (organizationId: string, name: string) =>
`${organizationSkillPath(organizationId, name)}/acl`;
const chatProjectSkillsPath = (organizationId: string, projectId: string) =>
`/api/experimental/organizations/${organizationId}/chats/projects/${projectId}/skills`;
const chatProjectSkillPath = (
organizationId: string,
projectId: string,
name: string,
) =>
`${chatProjectSkillsPath(organizationId, projectId)}/${encodeURIComponent(name)}`;
const userAIProviderKeysPath = (user = "me") =>
`/api/v2/users/${encodeURIComponent(user)}/ai-provider-keys`;
const mcpServerConfigsPath = (organization: string) =>
Expand Down Expand Up @@ -3339,11 +3347,57 @@ class ExperimentalApiMethods {
projectId: string,
): Promise<TypesGen.SkillMetadata[]> => {
const response = await this.axios.get<TypesGen.SkillMetadata[]>(
`/api/experimental/organizations/${organizationId}/chats/projects/${projectId}/skills`,
chatProjectSkillsPath(organizationId, projectId),
);
return response.data;
};

getChatProjectSkill = async (
organizationId: string,
projectId: string,
name: string,
): Promise<TypesGen.Skill> => {
const response = await this.axios.get<TypesGen.Skill>(
chatProjectSkillPath(organizationId, projectId, name),
);
return response.data;
};

createChatProjectSkill = async (
organizationId: string,
projectId: string,
req: TypesGen.CreateSkillRequest,
): Promise<TypesGen.Skill> => {
const response = await this.axios.post<TypesGen.Skill>(
chatProjectSkillsPath(organizationId, projectId),
req,
);
return response.data;
};

updateChatProjectSkill = async (
organizationId: string,
projectId: string,
name: string,
req: TypesGen.UpdateSkillRequest,
): Promise<TypesGen.Skill> => {
const response = await this.axios.patch<TypesGen.Skill>(
chatProjectSkillPath(organizationId, projectId, name),
req,
);
return response.data;
};

deleteChatProjectSkill = async (
organizationId: string,
projectId: string,
name: string,
): Promise<void> => {
await this.axios.delete(
chatProjectSkillPath(organizationId, projectId, name),
);
};

getChatProjectInstructions = async (
organizationId: string,
projectId: string,
Expand Down
92 changes: 91 additions & 1 deletion site/src/api/queries/chatProjectSkills.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isAxiosError } from "axios";
import type { UseQueryResult } from "react-query";
import type { QueryClient, UseQueryResult } from "react-query";
import { API } from "#/api/api";
import type * as TypesGen from "#/api/typesGenerated";

Expand All @@ -10,6 +10,9 @@ import type * as TypesGen from "#/api/typesGenerated";
export const chatProjectSkillsKey = (projectId: string) =>
["chat-project-skills", projectId] as const;

const chatProjectSkillKey = (projectId: string, name: string) =>
[...chatProjectSkillsKey(projectId), name] as const;

/** Lists the skills of a chat project, including disabled ones. */
export const chatProjectSkills = (
organizationId: string,
Expand All @@ -24,6 +27,93 @@ export const chatProjectSkills = (
failureCount < 3 && !isChatProjectAccessError(error),
});

/** Reads one project skill with its SKILL.md content. */
export const chatProjectSkill = (
organizationId: string,
projectId: string,
name: string,
) => ({
queryKey: chatProjectSkillKey(projectId, name),
queryFn: (): Promise<TypesGen.Skill> =>
API.experimental.getChatProjectSkill(organizationId, projectId, name),
});

const invalidateChatProjectSkills = (
queryClient: QueryClient,
projectId: string,
) =>
queryClient.invalidateQueries({
queryKey: chatProjectSkillsKey(projectId),
exact: true,
});

/** Creates a project skill; every outcome, conflicts included, refreshes the list. */
export const createChatProjectSkill = (
queryClient: QueryClient,
organizationId: string,
projectId: string,
) => ({
mutationFn: (req: TypesGen.CreateSkillRequest) =>
API.experimental.createChatProjectSkill(organizationId, projectId, req),
// A 409 can mean a changed name set or skill count, so refresh the list.
onSettled: () => invalidateChatProjectSkills(queryClient, projectId),
});

type UpdateChatProjectSkillArgs = {
name: string;
req: TypesGen.UpdateSkillRequest;
};

/** Replaces a project skill's content or turns it on or off. */
export const updateChatProjectSkill = (
queryClient: QueryClient,
organizationId: string,
projectId: string,
) => ({
mutationFn: ({ name, req }: UpdateChatProjectSkillArgs) =>
API.experimental.updateChatProjectSkill(
organizationId,
projectId,
name,
req,
),
// Cancelling an older GET first keeps it from overwriting the PATCH response.
onSuccess: async (
skill: TypesGen.Skill,
{ name }: UpdateChatProjectSkillArgs,
) => {
const queryKey = chatProjectSkillKey(projectId, name);
await queryClient.cancelQueries({ queryKey, exact: true });
queryClient.setQueryData(queryKey, skill);
Comment thread
jaaydenh marked this conversation as resolved.
Resolved
},
onSettled: () => invalidateChatProjectSkills(queryClient, projectId),
Comment thread
jaaydenh marked this conversation as resolved.
Resolved
});

/** Deletes a project skill. Success or a 404 evicts its details; the list always refreshes. */
export const deleteChatProjectSkill = (
queryClient: QueryClient,
organizationId: string,
projectId: string,
) => ({
mutationFn: (name: string) =>
API.experimental.deleteChatProjectSkill(organizationId, projectId, name),
onSuccess: (_data: unknown, name: string) => {
Comment thread
jaaydenh marked this conversation as resolved.
Resolved
queryClient.removeQueries({
queryKey: chatProjectSkillKey(projectId, name),
exact: true,
});
},
onSettled: (_data: unknown, error: unknown, name: string) => {
if (isAxiosError(error) && error.response?.status === 404) {
queryClient.removeQueries({
queryKey: chatProjectSkillKey(projectId, name),
exact: true,
});
}
return invalidateChatProjectSkills(queryClient, projectId);
},
});

/**
* Reports whether a project skills request failed with 403 or 404, meaning
* the caller lost access to the project. Other failures may be transient.
Expand Down
Loading
Loading