From 451b0829f2f6cf8ef87895e1dd9f365e4a32739d Mon Sep 17 00:00:00 2001 From: murat Date: Thu, 15 Jan 2026 15:11:43 -0600 Subject: [PATCH] docs: conditional pre-commit --- .husky/pre-commit | 13 +++++++++++-- .husky/pre-push | 4 ---- tools/build-docs.js | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) delete mode 100755 .husky/pre-push diff --git a/.husky/pre-commit b/.husky/pre-commit index f0eec1c3..a717056b 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -5,5 +5,14 @@ npx --no-install lint-staged # Validate everything npm test -npm run docs:validate-links -npm run docs:build + +# Validate docs links only when docs change +if command -v rg >/dev/null 2>&1; then + if git diff --cached --name-only | rg -q '^docs/'; then + npm run docs:validate-links + fi +else + if git diff --cached --name-only | grep -Eq '^docs/'; then + npm run docs:validate-links + fi +fi diff --git a/.husky/pre-push b/.husky/pre-push deleted file mode 100755 index 21f374e2..00000000 --- a/.husky/pre-push +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh - -npm run docs:validate-links -npm run docs:build diff --git a/tools/build-docs.js b/tools/build-docs.js index f2ac0064..edd9ad84 100644 --- a/tools/build-docs.js +++ b/tools/build-docs.js @@ -24,8 +24,8 @@ const BUILD_DIR = path.join(PROJECT_ROOT, 'build'); const SITE_URL = process.env.SITE_URL || 'https://bmad-code-org.github.io/BMAD-METHOD'; const REPO_URL = 'https://github.com/bmad-code-org/BMAD-METHOD'; -const LLM_MAX_CHARS = 800_000; -const LLM_WARN_CHARS = 700_000; +const LLM_MAX_CHARS = 700_000; +const LLM_WARN_CHARS = 600_000; const LLM_EXCLUDE_PATTERNS = ['changelog', 'ide-info/', 'v4-to-v6-upgrade', 'downloads/', 'faq'];