Oskar Austegard

AGENTS.md: AI Agent Instructions

This document provides guidance for AI agents interacting with this repository. The information is based on an analysis of the existing codebase, structure, and workflows.

Skills Management

To install or update Claude skills from the claude-skills repository:

Option 1: Run locally

bash .claude/install-skills.sh

Option 2: Trigger GitHub Actions

To add/remove skills: Edit the SKILLS array in .claude/install-skills.sh

Code Maps - Navigation & Maintenance

This repository uses code maps (_MAP.md files) to provide navigable overviews of the codebase structure without requiring you to read every file.

Using Code Maps

  1. Start with the root map: Read _MAP.md first to understand the overall structure
  2. Navigate hierarchically: Click through subdirectory links (e.g., [bsky/](./bsky/_MAP.md)) to explore specific areas
  3. Understand dependencies: Maps show exports/imports to reveal module relationships
  4. Only read source files when needed: Use maps to identify relevant files before reading them

Example workflow:

1. Read _MAP.md (see 10 subdirectories)
2. Read bsky/_MAP.md (see bsky-core.js exports 16 functions)
3. Read bsky-quote.js (see it imports from bsky-core.js)
4. Now read the actual source files only if needed

Maintaining Code Maps

IMPORTANT: When you modify code that affects exports or imports, you MUST regenerate the maps.

GitHub Action: Update Code Maps

When to regenerate:

How to regenerate:

# Regenerate all maps (dependencies auto-install on first run)
python .claude/skills/mapping-codebases/scripts/codemap.py .

# Include updated maps in your commit
git add '*/_MAP.md'

Update Code Maps workflow (GitHub Actions)

You can run the Update Code Maps workflow from GitHub Actions. It lives in .github/workflows/update-code-maps.yml and currently runs via workflow_dispatch (manual).

Best practice: Regenerate maps just before committing code changes that affect module interfaces. You can also use the Update Code Maps workflow after changes that alter imports/exports, in addition to the local codemap.py command.

Dev Environment Tips

This is a Jekyll-based static site published to GitHub Pages.

Commands

Testing Instructions

Branch Preview Builds

The repository includes a Branch Preview workflow (.github/workflows/branch-preview.yml) that automatically deploys preview sites for non-main branches using Surge.sh.

How It Works

  1. Automatic triggers: Deploys on pushes to any branch except main, and on pull requests
  2. Unique URLs: Each branch gets a preview at https://<branch-name>-austegard-preview.surge.sh
  3. PR comments: For pull requests, a comment is posted with the preview URL

One-Time Setup

To enable branch previews, add the SURGE_TOKEN secret to the repository:

  1. Get a Surge token (run locally):
    npx surge login    # Create account or login
    npx surge token    # Copy the token displayed
    
  2. Add repository secret: Go to Settings → Secrets and variables → Actions → New repository secret
    • Name: SURGE_TOKEN
    • Value: paste the token from step 1

Manual Trigger

You can also manually trigger the workflow from the Actions tab → “Branch Preview” → Run workflow.

Preview URL Format

Branch names are sanitized for URLs (lowercased, special chars replaced with dashes, truncated to 30 chars):

Verifying Preview Deployments

When checking if a preview deployment succeeded, the workflow typically takes 45-90 seconds to complete. If checking the preview URL returns a 404, wait and retry - you may need to poll multiple times until the workflow finishes.

Code Style

Project Structure

The repository is organized into thematic subdirectories containing standalone web tools and pages.

Development Workflow

  1. Understand first: Read relevant _MAP.md files before making changes to understand code structure
  2. Make changes: Implement requested features or fixes
  3. Update maps: Regenerate if you changed exports/imports in JavaScript files
  4. Test: Run tests if applicable (npm test)
  5. Commit: Include updated _MAP.md files in commits when relevant

Do / Don’t

PR Instructions

Additional Context