Skip to main content

Overview

The Impeccable build system transforms feature-rich source files into provider-specific formats. It’s built with Bun for fast performance and uses zero external dependencies.

Architecture

The build system is modular and focused:

Build Commands

Build Process

The build follows these steps:

1. Build Static Assets

The website uses:
  • Tailwind CLI for CSS compilation (handles @theme directive)
  • Bun’s built-in bundler for HTML/JS
  • Minification and source maps

2. Read Source Files

Reads all source files from:
  • source/skills/*.md - Skill definitions
  • source/commands/*.md - Command definitions

3. Transform for Each Provider

Each transformer handles provider-specific format requirements.

4. Create Prefixed Versions

Generates prefixed versions (e.g., /i-audit) to avoid conflicts.

5. Assemble Universal Bundles

Combines all provider outputs into a single directory.

6. Create ZIP Bundles

Generates downloadable ZIP files for each provider and universal bundles.

7. Sync to Local Development

Copies Claude Code output to .claude/ for local development.

Core Utilities

parseFrontmatter(content)

Extracts YAML frontmatter and body from a markdown file:

readSourceFiles(rootDir)

Recursively reads all source files:

writeFile(filePath, content)

Writes content to a file, creating directories as needed:

Transformer Pattern

Each provider has a dedicated transformer function:

Provider-Specific Details

Cursor Transformer

Location: scripts/lib/transformers/cursor.js Output: dist/cursor/.cursor/ Transformations:
  • Commands: Strip frontmatter, body only
  • Skills: Full Agent Skills standard with YAML frontmatter

Claude Code Transformer

Location: scripts/lib/transformers/claude-code.js Output: dist/claude-code/.claude/ Transformations:
  • Keeps full YAML frontmatter for both commands and skills
  • No transformations needed

Gemini Transformer

Location: scripts/lib/transformers/gemini.js Output: dist/gemini/ Transformations:
  • Commands: Convert to TOML format
  • Skills: Modular files with @import syntax
  • Transform {{argname}} → {{args}}

Codex Transformer

Location: scripts/lib/transformers/codex.js Output: dist/codex/.codex/ Transformations:
  • Commands: Custom prompt format with argument-hint
  • Skills: Agent Skills standard
  • Transform {{argname}} → $ARGNAME

Output Structure

The build generates:

ZIP Generation

Location: scripts/lib/zip.js Creates ZIP bundles for:
  • Individual providers (e.g., cursor.zip)
  • Universal bundles (all providers)
  • Prefixed versions

Performance

Bun provides significant performance benefits:
  • Faster execution: 2-4x faster than Node.js
  • Native TypeScript: No compilation needed
  • Built-in bundler: Fast HTML/JS/CSS bundling
  • Zero dependencies: No node_modules overhead
Typical build times:
  • Full build: ~2-3 seconds
  • Clean rebuild: ~3-4 seconds

Development Tips

Watch Mode

For active development, use:

Testing Transformers

Test a single transformer:

Debugging

Add console.log statements in transformers:

Extending the Build System

Adding a New Provider

  1. Create transformer: scripts/lib/transformers/newprovider.js
  1. Export from registry: scripts/lib/transformers/index.js
  1. Call from build: scripts/build.js

Adding New Source Types

  1. Define format: Create source/newtype/ directory
  2. Add parser: Update readSourceFiles() in utils.js
  3. Update transformers: Handle new type in each transformer

Troubleshooting

Build Fails with YAML Parsing Errors

  • Check frontmatter indentation (YAML is indent-sensitive)
  • Ensure --- delimiters are on their own lines
  • Verify colons have spaces after them

Output Doesn’t Match Expectations

  • Check transformer for your provider
  • Verify source file frontmatter structure
  • Run bun run rebuild for clean build

ZIP Generation Fails

  • Ensure output directories exist
  • Check file permissions
  • Verify ZIP library is working

Performance Issues

  • Profile with console.time() / console.timeEnd()
  • Check for unnecessary file operations
  • Ensure directories are cleaned properly