AgentSkillsCN

deploy

本技能可自动将 Quartz 静态站点部署至 GitHub Pages,并集成 Eagle 图像预处理功能。当用户提出部署、发布需求,或明确调用“/deploy”命令时,这一技能便能派上用场。其工作流程首先对 Eagle 图像进行转换处理并完成暂存,随后同步至 Quartz,构建站点、提交更改,并推送到已配置的分支。

SKILL.md
--- frontmatter
name: deploy
description: This skill automates Quartz static site deployment to GitHub Pages with integrated Eagle image pre-processing. This skill should be used when the user requests deployment, publishing, or explicitly invokes "/deploy". The workflow prepares staging with transformed Eagle images, syncs to Quartz, builds the site, commits changes, and pushes to the configured branch.

Deploy

Overview

Automate Quartz static site deployment with integrated Eagle image pre-processing.

This skill uses bundled scripts to:

  1. Prepare deployment staging with transformed Eagle images
  2. Sync prepared content to Quartz
  3. Build and deploy to GitHub Pages

Important: Original notes in 40. Digital Garden/ preserve Eagle file:/// paths. Only staging copies are transformed for deployment.

Prerequisites

Before using this skill, configure your environment:

  1. Create .env file in vault root:

    bash
    cp .claude/skills/deploy/.env.example .env
    
  2. Edit .env and set required variables:

    • EAGLE_LIBRARY_PATH: Path to your Eagle library (e.g., /Users/username/Documents/Ataraxia.library)
    • QUARTZ_REPO_PATH: Path to your Quartz repository
    • DEPLOY_SITE_URL: Your site URL (e.g., https://yourdomain.com)
  3. Verify the script can find your configuration:

    bash
    .claude/skills/deploy/scripts/deploy.sh
    

If missing variables, the script will show clear error messages.

See Configuration for all available options.

Workflow

Run Deployment Script

Execute the bundled deployment script:

bash
.claude/skills/deploy/scripts/deploy.sh

The script automates: 0. Prepare Staging: Creates .deploy-staging/ with Eagle images transformed to /_attachments/ references

  1. Content Sync: Syncs transformed content from staging to Quartz content/
  2. Build: Runs npx quartz build to generate static site
  3. Commit Analysis: Analyzes changes with git diff --stat
  4. Auto-commit: Generates appropriate commit message and pushes to v4 branch

The script will output:

  • Progress indicators for each step
  • Eagle image processing results
  • Final commit message
  • Deployment confirmation

Source Preservation:

  • Original notes in 40. Digital Garden/ keep Eagle file:/// paths
  • Staging directory .deploy-staging/ is automatically cleaned up after deployment
  • Eagle app continues to work with original notes

On Success: Report to user:

  • Commit hash and message
  • "배포 완료!" confirmation
  • Site URL: ${DEPLOY_SITE_URL}

On Failure (if rollback needed):

bash
cd "${QUARTZ_REPO_PATH}" && git revert HEAD --no-edit && git push "${DEPLOY_GIT_REMOTE}" "${DEPLOY_GIT_BRANCH}"

Configuration

All configuration is managed through environment variables in .env at vault root.

Required Variables

VariableDescriptionExample
EAGLE_LIBRARY_PATHPath to Eagle library/Users/username/Documents/Ataraxia.library
QUARTZ_REPO_PATHPath to Quartz repository/Users/username/Documents/Obsidian/Quartz
DEPLOY_SITE_URLDeployed site URLhttps://yourdomain.com

Optional Variables

VariableDescriptionDefault
DEPLOY_GIT_BRANCHTarget deployment branchv4
DEPLOY_GIT_REMOTEGit remote nameorigin

Setup

  1. Copy the example configuration:

    bash
    cp .claude/skills/deploy/.env.example .env
    
  2. Edit .env in vault root and configure:

    • EAGLE_LIBRARY_PATH: Absolute path to your Eagle library (e.g., /Users/username/Documents/Ataraxia.library)
    • QUARTZ_REPO_PATH: Absolute path to your Quartz repository
    • DEPLOY_SITE_URL: Your deployed site URL
  3. Optional: Customise git branch/remote if your setup differs

  4. Verify configuration:

    bash
    source .env && echo "Quartz: $QUARTZ_REPO_PATH" && echo "Site: $DEPLOY_SITE_URL"
    

Bundled Resources

Scripts

scripts/deploy.sh

  • Main deployment orchestration script
  • Calls prepare-staging.sh to create staging area
  • Coordinates sync, build, and git operations
  • Generates appropriate commit messages based on changes
  • Provides clear progress indicators and next steps

scripts/prepare-staging.sh

  • Creates deployment staging area at 40. Digital Garden/.deploy-staging/
  • Copies content from Digital Garden to staging
  • Orchestrates Eagle image processing via process-eagle-images.mjs
  • Validates Eagle library path from environment

scripts/process-eagle-images.mjs

  • Scans staging for Eagle file:/// image references
  • Copies images from Eagle library to staging _attachments/
  • Transforms markdown to use relative /_attachments/ paths
  • Generates descriptive filenames from alt text or Eagle ID

Trigger Conditions

This skill activates when the user:

  • Says "배포", "배포해줘", "deploy", "publish"
  • Invokes "/deploy"
  • Requests to "push to production" or "update the site"