mirror of
https://github.com/supabase/agent-skills.git
synced 2026-03-27 10:09:26 +08:00
Revert "fix: remove CLAUDE.md symlink generation from build"
This reverts commit c07c234601.
This commit is contained in:
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: "20"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
@@ -30,7 +30,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: "20"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: packages/skills-build
|
working-directory: packages/skills-build
|
||||||
@@ -53,18 +53,18 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sanity-test:
|
test:
|
||||||
name: Sanity Test (skills add)
|
name: Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: "20"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: Run sanity tests
|
- name: Run sanity tests
|
||||||
run: npm run test
|
run: npm run test:sanity
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ skills/
|
|||||||
{skill-name}/
|
{skill-name}/
|
||||||
SKILL.md # Required: skill manifest (Agent Skills spec)
|
SKILL.md # Required: skill manifest (Agent Skills spec)
|
||||||
AGENTS.md # Generated: navigation guide for agents
|
AGENTS.md # Generated: navigation guide for agents
|
||||||
|
CLAUDE.md # Generated: symlink to AGENTS.md
|
||||||
references/
|
references/
|
||||||
_sections.md # Required: section definitions
|
_sections.md # Required: section definitions
|
||||||
{prefix}-{name}.md # Reference files
|
{prefix}-{name}.md # Reference files
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
existsSync,
|
existsSync,
|
||||||
|
lstatSync,
|
||||||
readdirSync,
|
readdirSync,
|
||||||
readFileSync,
|
readFileSync,
|
||||||
statSync,
|
statSync,
|
||||||
|
symlinkSync,
|
||||||
|
unlinkSync,
|
||||||
writeFileSync,
|
writeFileSync,
|
||||||
} from "node:fs";
|
} from "node:fs";
|
||||||
import { basename, join } from "node:path";
|
import { basename, join } from "node:path";
|
||||||
@@ -225,6 +228,25 @@ function skillNameToTitle(skillName: string): string {
|
|||||||
.join(" ");
|
.join(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create CLAUDE.md symlink pointing to AGENTS.md
|
||||||
|
*/
|
||||||
|
function createClaudeSymlink(paths: SkillPaths): void {
|
||||||
|
const symlinkPath = paths.claudeSymlink;
|
||||||
|
|
||||||
|
// Remove existing symlink or file if it exists
|
||||||
|
if (existsSync(symlinkPath)) {
|
||||||
|
const stat = lstatSync(symlinkPath);
|
||||||
|
if (stat.isSymbolicLink() || stat.isFile()) {
|
||||||
|
unlinkSync(symlinkPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create symlink (relative path so it works across environments)
|
||||||
|
symlinkSync("AGENTS.md", symlinkPath);
|
||||||
|
console.log(` Created symlink: CLAUDE.md -> AGENTS.md`);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build AGENTS.md for a specific skill
|
* Build AGENTS.md for a specific skill
|
||||||
*
|
*
|
||||||
@@ -253,6 +275,7 @@ function buildSkill(paths: SkillPaths): void {
|
|||||||
|
|
||||||
// Header
|
// Header
|
||||||
output.push(`# ${paths.name}\n`);
|
output.push(`# ${paths.name}\n`);
|
||||||
|
output.push(`> **Note:** \`CLAUDE.md\` is a symlink to this file.\n`);
|
||||||
|
|
||||||
// Brief description
|
// Brief description
|
||||||
output.push(`## Overview\n`);
|
output.push(`## Overview\n`);
|
||||||
@@ -264,6 +287,7 @@ function buildSkill(paths: SkillPaths): void {
|
|||||||
output.push(`${paths.name}/`);
|
output.push(`${paths.name}/`);
|
||||||
output.push(` SKILL.md # Main skill file - read this first`);
|
output.push(` SKILL.md # Main skill file - read this first`);
|
||||||
output.push(` AGENTS.md # This navigation guide`);
|
output.push(` AGENTS.md # This navigation guide`);
|
||||||
|
output.push(` CLAUDE.md # Symlink to AGENTS.md`);
|
||||||
if (existsSync(paths.referencesDir)) {
|
if (existsSync(paths.referencesDir)) {
|
||||||
output.push(` references/ # Detailed reference files`);
|
output.push(` references/ # Detailed reference files`);
|
||||||
}
|
}
|
||||||
@@ -329,6 +353,9 @@ function buildSkill(paths: SkillPaths): void {
|
|||||||
writeFileSync(paths.agentsOutput, output.join("\n"));
|
writeFileSync(paths.agentsOutput, output.join("\n"));
|
||||||
console.log(` Generated: ${paths.agentsOutput}`);
|
console.log(` Generated: ${paths.agentsOutput}`);
|
||||||
console.log(` Total references: ${referenceFiles.length}`);
|
console.log(` Total references: ${referenceFiles.length}`);
|
||||||
|
|
||||||
|
// Create CLAUDE.md symlink
|
||||||
|
createClaudeSymlink(paths);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run build when executed directly
|
// Run build when executed directly
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export interface SkillPaths {
|
|||||||
skillDir: string;
|
skillDir: string;
|
||||||
referencesDir: string;
|
referencesDir: string;
|
||||||
agentsOutput: string;
|
agentsOutput: string;
|
||||||
|
claudeSymlink: string;
|
||||||
skillFile: string;
|
skillFile: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ export function getSkillPaths(skillName: string): SkillPaths {
|
|||||||
skillDir,
|
skillDir,
|
||||||
referencesDir: join(skillDir, "references"),
|
referencesDir: join(skillDir, "references"),
|
||||||
agentsOutput: join(skillDir, "AGENTS.md"),
|
agentsOutput: join(skillDir, "AGENTS.md"),
|
||||||
|
claudeSymlink: join(skillDir, "CLAUDE.md"),
|
||||||
skillFile: join(skillDir, "SKILL.md"),
|
skillFile: join(skillDir, "SKILL.md"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# supabase-postgres-best-practices
|
# supabase-postgres-best-practices
|
||||||
|
|
||||||
|
> **Note:** `CLAUDE.md` is a symlink to this file.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.
|
Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.
|
||||||
@@ -10,6 +12,7 @@ Postgres performance optimization and best practices from Supabase. Use this ski
|
|||||||
supabase-postgres-best-practices/
|
supabase-postgres-best-practices/
|
||||||
SKILL.md # Main skill file - read this first
|
SKILL.md # Main skill file - read this first
|
||||||
AGENTS.md # This navigation guide
|
AGENTS.md # This navigation guide
|
||||||
|
CLAUDE.md # Symlink to AGENTS.md
|
||||||
references/ # Detailed reference files
|
references/ # Detailed reference files
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
1
skills/supabase-postgres-best-practices/CLAUDE.md
Symbolic link
1
skills/supabase-postgres-best-practices/CLAUDE.md
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
AGENTS.md
|
||||||
Reference in New Issue
Block a user