This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Docusaurus-based documentation site for psake, a PowerShell build automation tool. The site uses a hybrid PowerShell/Node.js build system, combining static documentation with auto-generated command references from the psake PowerShell module.
The build system uses PowerShell + psake for orchestration, with Docusaurus/Node.js for the site generation:
build.ps1- Main entry point that handles bootstrapping and invokes psake taskspsakeFile.ps1- Task definitions for all build automationrequirements.psd1- PowerShell module dependencies (managed via PSDepend)
# First-time setup (install all dependencies)
.\build.ps1 -Bootstrap
# Start development server
.\build.ps1 -Task Server
# Full production build
.\build.ps1 -Task Build
# Run tests (validates sidebar links)
.\build.ps1 -Task Test
# List all available tasks
.\build.ps1 -HelpToken efficiency: Always prefer
.\build.ps1 -Quiet -Task <task>when running builds from Claude Code. The-Quietflag suppresses verbose console output and returns a structuredPsakeBuildResultobject, which dramatically reduces token usage while still capturing success/failure.
Important: The Server task runs bun run serve which serves the production build. For local development with hot-reload, use:
.\build.ps1 -Task Init # Install dependencies first
bun start # Then start dev server directly- Init - Runs
bun install - Build - Full site build (depends on Init, GenerateCommandReference, FrontMatterCMSSync)
- Server - Serves production build
- Test - Runs Pester tests
- GenerateCommandReference - Auto-generates MDX files for psake commands
- FrontMatterCMSSync - Converts YAML datafiles to JSON for Frontmatter CMS
Command documentation is auto-generated from the psake PowerShell module:
- Generator:
New-PsakeDocusaurusHelpinscripts/New-PsakeDocusaurusHelp.ps1, powered byMicrosoft.PowerShell.PlatyPS - Source: psake module help (from the main psake repository)
- Output:
docs/commands/*.mdxfiles - Sidebar: Auto-imported via
docs/commands/docusaurus.sidebar.js - Configuration: See
$docusaurusOptionsinpsakeFile.ps1
Never manually edit files in docs/commands/ - they will be overwritten. Edit the source help in the psake repository instead.
Blog posts use YAML datafiles as the source of truth for authors and tags:
- Authors:
blog/authors.yml(handle as key) - Tags:
blog/tags.yml(with label, permalink, description) - Sync: Run
.\build.ps1 -Task FrontMatterCMSSyncafter editing YAML files to regenerate JSON
File naming: YYYY-MM-DD-descriptive-slug.md
Required frontmatter:
---
title: "Clear, descriptive title"
description: "SEO-friendly description (150-160 chars)"
date: 2025-08-03T23:38:05.100Z # ISO format
authors:
- heyitsgilbert # Handle from blog/authors.yml
tags:
- psake # Handles from blog/tags.yml
- announcement
---Content structure:
- Engaging intro paragraph
<!-- truncate -->after first paragraph (for blog list previews)- Semantic headings (## for main sections)
Available tag handles: powershell, build-automation, psake, ci-cd, testing, deployment, scripting, tutorial, getting-started, advanced, best-practices, tips, troubleshooting, release, announcement, msbuild, dotnet, visual-studio
- Tutorials:
docs/tutorial-basics/anddocs/tutorial-advanced/ - Categories: Use
_category_.jsonfiles for folder metadata - Sidebar: Manually maintained in
sidebars.ts(validated by Pester tests)
The site uses Frontmatter CMS for content management:
- Config:
frontmatter.json- defines content types, fields, and datafile mappings - Author/tag dropdowns: Use
handleas labelField from datafiles - After YAML changes: Run
FrontMatterCMSSynctask to update CMS choices
- Pester tests:
tests/Docs.Tests.ps1- validates all docs are linked in sidebar - Build validation: Docusaurus build fails on broken links (
onBrokenLinks: 'throw'in config) - Blog validation: Warns on inline tags/authors, untruncated posts
Run tests before committing:
.\build.ps1 -Task Test- Platform: Netlify (auto-deploy from
mainbranch) - Build output:
/builddirectory (static site) - Preview URL: Local server runs on http://localhost:3000
- All docs must be linked in
sidebars.ts- Pester tests enforce this - YAML files are source of truth - JSON files are generated, don't edit them
- Command docs are auto-generated - Edit source help in psake repo, not MDX files
- Blog posts require frontmatter validation - Missing required fields will cause warnings
- Node.js: >=18.0 (specified in package.json engines)
- PowerShell: 7+ (required by psakeFile.ps1)
- Package manager: Yarn (locked version via packageManager field)
- PowerShell modules: Auto-installed via PSDepend during bootstrap
- Use
YYYY-MM-DD-slug.mdnaming - Add required frontmatter (title, description, date, authors, tags)
- Verify author handle exists in
blog/authors.yml - Verify tag handles exist in
blog/tags.yml - Include intro +
<!-- truncate -->+ main content - Run
.\build.ps1 -Task Testto validate - Preview with
bun start
- Add to
blog/authors.ymlorblog/tags.yml - Run
.\build.ps1 -Task FrontMatterCMSSync
- Add markdown file to appropriate
docs/subdirectory - Update
sidebars.tsto include the new page - Run
.\build.ps1 -Task Testto ensure it's properly linked