From 5abdc63767eb79a1a69d1a46e8b70357a5cf78bf Mon Sep 17 00:00:00 2001 From: Pedro Rodrigues Date: Fri, 23 Jan 2026 01:49:34 +0000 Subject: [PATCH] refactor: initial build system refactor for unified skills - Renamed postgres-best-practices-build to skills-build - Moved postgres files to src/postgres/ subdirectory - Updated BUILD_DIR paths in postgres/config.ts - Updated type imports to reference ../types.js - Created IMPLEMENTATION_GUIDE.md with detailed step-by-step tasks This is the foundation for a unified build system that will support both postgres-best-practices (rule-based) and supabase (reference-based) skills. Next steps documented in IMPLEMENTATION_GUIDE.md (Tasks 1-6). --- .../package-lock.json | 0 .../package.json | 0 .../src => skills-build/src/postgres}/build.ts | 2 +- .../src => skills-build/src/postgres}/config.ts | 4 ++-- .../src => skills-build/src/postgres}/parser.ts | 2 +- .../src => skills-build/src/postgres}/validate.ts | 2 +- .../src/types.ts | 0 .../tsconfig.json | 0 8 files changed, 5 insertions(+), 5 deletions(-) rename packages/{postgres-best-practices-build => skills-build}/package-lock.json (100%) rename packages/{postgres-best-practices-build => skills-build}/package.json (100%) rename packages/{postgres-best-practices-build/src => skills-build/src/postgres}/build.ts (99%) rename packages/{postgres-best-practices-build/src => skills-build/src/postgres}/config.ts (89%) rename packages/{postgres-best-practices-build/src => skills-build/src/postgres}/parser.ts (99%) rename packages/{postgres-best-practices-build/src => skills-build/src/postgres}/validate.ts (99%) rename packages/{postgres-best-practices-build => skills-build}/src/types.ts (100%) rename packages/{postgres-best-practices-build => skills-build}/tsconfig.json (100%) diff --git a/packages/postgres-best-practices-build/package-lock.json b/packages/skills-build/package-lock.json similarity index 100% rename from packages/postgres-best-practices-build/package-lock.json rename to packages/skills-build/package-lock.json diff --git a/packages/postgres-best-practices-build/package.json b/packages/skills-build/package.json similarity index 100% rename from packages/postgres-best-practices-build/package.json rename to packages/skills-build/package.json diff --git a/packages/postgres-best-practices-build/src/build.ts b/packages/skills-build/src/postgres/build.ts similarity index 99% rename from packages/postgres-best-practices-build/src/build.ts rename to packages/skills-build/src/postgres/build.ts index f858c87..56503b7 100644 --- a/packages/postgres-best-practices-build/src/build.ts +++ b/packages/skills-build/src/postgres/build.ts @@ -2,7 +2,7 @@ import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs"; import { basename, join } from "node:path"; import { AGENTS_OUTPUT, METADATA_FILE, RULES_DIR } from "./config.js"; import { parseRuleFile } from "./parser.js"; -import type { Metadata, Rule, Section } from "./types.js"; +import type { Metadata, Rule, Section } from "../types.js"; import { validateRuleFile } from "./validate.js"; /** diff --git a/packages/postgres-best-practices-build/src/config.ts b/packages/skills-build/src/postgres/config.ts similarity index 89% rename from packages/postgres-best-practices-build/src/config.ts rename to packages/skills-build/src/postgres/config.ts index 33bc32c..4b911d7 100644 --- a/packages/postgres-best-practices-build/src/config.ts +++ b/packages/skills-build/src/postgres/config.ts @@ -4,8 +4,8 @@ import { fileURLToPath } from "node:url"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); -// Build package directory -export const BUILD_DIR = join(__dirname, ".."); +// Build package directory (now we're in src/postgres/, so go up two levels) +export const BUILD_DIR = join(__dirname, "../.."); // Skill directory (relative to build package) export const SKILL_DIR = join( diff --git a/packages/postgres-best-practices-build/src/parser.ts b/packages/skills-build/src/postgres/parser.ts similarity index 99% rename from packages/postgres-best-practices-build/src/parser.ts rename to packages/skills-build/src/postgres/parser.ts index 6efee67..58c1332 100644 --- a/packages/postgres-best-practices-build/src/parser.ts +++ b/packages/skills-build/src/postgres/parser.ts @@ -1,7 +1,7 @@ import { readFileSync } from "node:fs"; import { basename } from "node:path"; import { IMPACT_LEVELS } from "./config.js"; -import type { CodeExample, ImpactLevel, ParseResult, Rule } from "./types.js"; +import type { CodeExample, ImpactLevel, ParseResult, Rule } from "../types.js"; /** * Parse YAML-style frontmatter from markdown content diff --git a/packages/postgres-best-practices-build/src/validate.ts b/packages/skills-build/src/postgres/validate.ts similarity index 99% rename from packages/postgres-best-practices-build/src/validate.ts rename to packages/skills-build/src/postgres/validate.ts index fa43909..f15b77d 100644 --- a/packages/postgres-best-practices-build/src/validate.ts +++ b/packages/skills-build/src/postgres/validate.ts @@ -3,7 +3,7 @@ import { basename, join } from "node:path"; import { generateSectionMap, parseSections } from "./build.js"; import { IMPACT_LEVELS, RULES_DIR } from "./config.js"; import { parseRuleFile } from "./parser.js"; -import type { ValidationResult } from "./types.js"; +import type { ValidationResult } from "../types.js"; /** * Check if an example label indicates a "bad" pattern diff --git a/packages/postgres-best-practices-build/src/types.ts b/packages/skills-build/src/types.ts similarity index 100% rename from packages/postgres-best-practices-build/src/types.ts rename to packages/skills-build/src/types.ts diff --git a/packages/postgres-best-practices-build/tsconfig.json b/packages/skills-build/tsconfig.json similarity index 100% rename from packages/postgres-best-practices-build/tsconfig.json rename to packages/skills-build/tsconfig.json