Skip to content

Commit 2679029

Browse files
MaxKlessclaude
andauthored
fix(core): share .agents skills dir across codex, cursor, gemini (#34882)
## Summary - The upstream config repo (nx-ai-agents-config) now generates skills into a shared `.agents/skills/` directory instead of separate per-agent skills directories for codex, cursor, and gemini. - Updated the `agentDirs` mapping so `.agents` is copied when any of codex, cursor, or gemini are enabled, not just codex. - Widened the `agent` field type from `Agent` to `Agent | Agent[]` to support mapping a single directory to multiple agents. ## Key decisions - Used `Agent | Agent[]` union type rather than always-array to minimize changes to existing single-agent entries. The loop normalizes with `Array.isArray` before checking. --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 5c0e05c commit 2679029

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

packages/nx/src/ai/set-up-ai-agents/set-up-ai-agents.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,24 @@ export async function setupAiAgentsGeneratorImpl(
276276
if (aiConfigRepoPath) {
277277
const repoPath = aiConfigRepoPath;
278278

279+
// Shared skills directory used by codex, cursor, and gemini
280+
if (hasAgent('codex') || hasAgent('cursor') || hasAgent('gemini')) {
281+
const sharedSkillsSrc = join(repoPath, 'generated/.agents');
282+
if (existsSync(sharedSkillsSrc)) {
283+
generateFiles(
284+
tree,
285+
sharedSkillsSrc,
286+
join(options.directory, '.agents'),
287+
{}
288+
);
289+
}
290+
}
291+
292+
// Agent-specific directories (commands, agents, config)
279293
const agentDirs: { agent: Agent; src: string; dest: string }[] = [
280294
{ agent: 'opencode', src: 'generated/.opencode', dest: '.opencode' },
281295
{ agent: 'copilot', src: 'generated/.github', dest: '.github' },
282296
{ agent: 'cursor', src: 'generated/.cursor', dest: '.cursor' },
283-
{ agent: 'codex', src: 'generated/.agents', dest: '.agents' },
284297
{
285298
agent: 'codex',
286299
src: 'generated/.codex/agents',

0 commit comments

Comments
 (0)