refactor: generic skills build system with auto-discovery (#8)

* refactor: generic skills build system with auto-discovery

- Rename postgres-best-practices-build → skills-build
- Add auto-discovery: scans skills/ for subdirectories with metadata.json
- Build/validate all skills or specific skill with -- argument
- Update root AGENTS.md and CONTRIBUTING.md with new structure
- No configuration needed to add new skills

Usage:
  npm run build                    # Build all skills
  npm run build -- skill-name      # Build specific skill
  npm run validate                 # Validate all skills

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix ci

* more generic impact levels

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Pedro Rodrigues
2026-01-23 15:56:11 +00:00
committed by GitHub
parent 4b49188895
commit bbde7ff5f8
15 changed files with 955 additions and 907 deletions

View File

@@ -2,10 +2,9 @@
Thank you for contributing to Supabase Agent Skills! Here's how to get started:
[1. Getting Started](#getting-started) [2. Issues](#issues)
[3. Pull Requests](#pull-requests)
[4. Contributing New Rules](#contributing-new-rules)
[5. Extending Existing Skills](#extending-existing-skills)
[1. Getting Started](#getting-started) | [2. Issues](#issues) |
[3. Pull Requests](#pull-requests) | [4. Contributing New Rules](#contributing-new-rules) |
[5. Creating a New Skill](#creating-a-new-skill)
## Getting Started
@@ -49,6 +48,68 @@ npm run build # Generate AGENTS.md from rules
Both commands must complete successfully.
## Contributing New Rules
To add a rule to an existing skill:
1. Navigate to `skills/{skill-name}/rules/`
2. Copy `_template.md` to `{prefix}-{your-rule-name}.md`
3. Fill in the frontmatter (title, impact, tags)
4. Write explanation and examples (Incorrect/Correct)
5. Run validation and build:
```bash
npm run validate
npm run build
```
## Creating a New Skill
To create an entirely new skill:
### 1. Create the directory structure
```bash
mkdir -p skills/my-skill/rules
```
### 2. Create metadata.json
```json
{
"version": "1.0.0",
"organization": "Your Org",
"date": "January 2026",
"abstract": "Brief description of this skill."
}
```
### 3. Create rules/_sections.md
```markdown
## 1. First Category (first)
**Impact:** HIGH
**Description:** What this category covers.
## 2. Second Category (second)
**Impact:** MEDIUM
**Description:** What this category covers.
```
### 4. Create rule files
Name files as `{prefix}-{rule-name}.md` where prefix matches a section.
Example: `first-example-rule.md` for section "First Category"
### 5. Build
```bash
npm run build
```
The build system auto-discovers skills. No configuration needed.
## Questions or Feedback?
- Open an Issue for bugs or suggestions