Skip to content

Conversation

@Rodriguespn
Copy link
Collaborator

Summary

This PR refactors the build system from a single-skill setup (postgres-best-practices-build) to a generic, extensible build system (skills-build) that automatically discovers and processes any skill in the skills/ directory.

Key changes:

  • Renamed packages/postgres-best-practices-buildpackages/skills-build
  • Added auto-discovery: scans skills/ for subdirectories containing metadata.json
  • Build/validate all skills at once or target a specific skill with -- {skill-name}
  • Updated documentation (AGENTS.md, CONTRIBUTING.md) with new structure
  • Zero configuration needed to add new skills

Motivation

Previously, the build system was tightly coupled to the postgres-best-practices skill. Adding a new skill would require modifying build configuration and hardcoded paths. This refactor enables:

  1. Scalability - Add unlimited skills without touching the build system
  2. Simplicity - Just create a directory with the right structure
  3. Consistency - All skills follow the same build/validation process

New Repository Structure

agent-skills/
├── skills/
│   └── {skill-name}/
│       ├── metadata.json         # Required: skill metadata
│       ├── AGENTS.md             # Generated: compiled rules output
│       └── rules/
│           ├── _sections.md      # Required: section definitions
│           ├── _template.md      # Optional: rule template
│           └── {prefix}-{name}.md  # Rule files
│
└── packages/
    └── skills-build/             # Generic build system (renamed)

How to Add a New Skill

Adding a new skill is now configuration-free. Follow these steps:

1. Create the directory structure

mkdir -p skills/my-new-skill/rules

2. Create metadata.json

{
  "version": "1.0.0",
  "organization": "Your Org",
  "date": "January 2026",
  "abstract": "Brief description of what this skill teaches AI agents."
}

3. Create rules/_sections.md

Define categories for your rules with impact levels:

## 1. First Category (first)
**Impact:** HIGH
**Description:** What this category covers.

## 2. Second Category (second)
**Impact:** MEDIUM
**Description:** What this category covers.

The prefix in parentheses (e.g., first, second) maps to rule file prefixes.

4. Add rule files

Create rules in rules/ named {prefix}-{rule-name}.md:

---
title: Action-Oriented Title
impact: HIGH
impactDescription: Quantified benefit (e.g., "5-20x improvement")
tags: keyword1, keyword2
---

## Title

1-2 sentence explanation of the rule.

**Incorrect:**
\`\`\`sql
-- bad example
\`\`\`

**Correct:**
\`\`\`sql
-- good example
\`\`\`

5. Build

npm run build                    # Build all skills
npm run build -- my-new-skill    # Build only your skill

- 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>
@Rodriguespn Rodriguespn self-assigned this Jan 23, 2026
@Rodriguespn Rodriguespn added the enhancement New feature or request label Jan 23, 2026
@Rodriguespn Rodriguespn merged commit bbde7ff into main Jan 23, 2026
2 checks passed
@Rodriguespn Rodriguespn deleted the feature/generic-build branch January 23, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants