Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/workflows/lint-agents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ name: Lint Agent Files
on:
pull_request:
paths:
- 'design/**'
- 'engineering/**'
- 'game-development/**'
- 'marketing/**'
- 'paid-media/**'
- 'sales/**'
- 'product/**'
- 'project-management/**'
- 'testing/**'
- 'support/**'
- 'spatial-computing/**'
- 'specialized/**'
- "academic/**"
- "design/**"
- "engineering/**"
- "game-development/**"
- "marketing/**"
- "paid-media/**"
- "sales/**"
- "product/**"
- "project-management/**"
- "testing/**"
- "support/**"
- "spatial-computing/**"
- "specialized/**"

jobs:
lint:
Expand All @@ -29,7 +30,7 @@ jobs:
id: changed
run: |
FILES=$(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD -- \
'design/**/*.md' 'engineering/**/*.md' 'game-development/**/*.md' 'marketing/**/*.md' 'paid-media/**/*.md' 'sales/**/*.md' 'product/**/*.md' \
'academic/**/*.md' 'design/**/*.md' 'engineering/**/*.md' 'game-development/**/*.md' 'marketing/**/*.md' 'paid-media/**/*.md' 'sales/**/*.md' 'product/**/*.md' \
'project-management/**/*.md' 'testing/**/*.md' 'support/**/*.md' \
'spatial-computing/**/*.md' 'specialized/**/*.md')
{
Expand Down
15 changes: 13 additions & 2 deletions scripts/lint-agents.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@

set -euo pipefail

# Keep in sync with AGENT_DIRS in scripts/convert.sh
AGENT_DIRS=(
academic
design
engineering
game-development
marketing
paid-media
sales
product
project-management
testing
Expand All @@ -33,6 +36,12 @@ warnings=0
lint_file() {
local file="$1"

if [[ ! -f "$file" ]]; then
echo "ERROR $file: not a file or does not exist"
errors=$((errors + 1))
return
fi

# 1. Check frontmatter delimiters
local first_line
first_line=$(head -1 "$file")
Expand Down Expand Up @@ -71,8 +80,10 @@ lint_file() {
fi
done

# 4. Check file has meaningful content
if [[ $(echo "$body" | wc -w) -lt 50 ]]; then
# 4. Check file has meaningful content (awk strips wc's leading whitespace on macOS/BSD)
local word_count
word_count=$(echo "$body" | wc -w | awk '{print $1}')
if [[ "${word_count:-0}" -lt 50 ]]; then
echo "WARN $file: body seems very short (< 50 words)"
warnings=$((warnings + 1))
fi
Expand Down