Skip to content

chore: add .gitignore to flowspec-netlog (#1059) #1345

chore: add .gitignore to flowspec-netlog (#1059)

chore: add .gitignore to flowspec-netlog (#1059) #1345

name: Dev Setup Validation
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
dev-setup-validation:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies
run: uv sync
- name: Validate symlink structure
run: |
echo "=== Validating dev-setup symlink structure ==="
echo ""
# R1: Verify all .md files in .claude/commands/ are symlinks
echo "Checking R1: All .md files must be symlinks..."
NON_SYMLINKS=$(find .claude/commands -name "*.md" -type f 2>/dev/null || true)
if [ -n "$NON_SYMLINKS" ]; then
echo "❌ FAILED: Found non-symlink .md files:"
echo "$NON_SYMLINKS" | sed 's/^/ - /'
echo ""
echo "Fix: Run 'uv run flowspec dev-setup --force'"
exit 1
fi
echo "✓ Passed: All .md files are symlinks"
echo ""
# R2: Verify all symlinks resolve to existing files
echo "Checking R2: All symlinks must resolve..."
BROKEN_SYMLINKS=$(find .claude/commands -name "*.md" -type l ! -exec test -e {} \; -print 2>/dev/null || true)
if [ -n "$BROKEN_SYMLINKS" ]; then
echo "❌ FAILED: Found broken symlinks:"
echo "$BROKEN_SYMLINKS" | sed 's/^/ - /'
echo ""
echo "Fix: Run 'uv run flowspec dev-setup --force'"
exit 1
fi
echo "✓ Passed: All symlinks resolve"
echo ""
# R3: Verify all symlinks point to templates/commands/
echo "Checking R3: All symlinks must point to templates/commands/..."
MISPOINTED=0
for SYMLINK in $(find .claude/commands -name "*.md" -type l 2>/dev/null); do
TARGET=$(readlink -f "$SYMLINK")
if [[ ! "$TARGET" =~ ^$(pwd)/templates/commands/ ]]; then
echo "❌ Symlink points outside templates/commands/: $SYMLINK -> $TARGET"
MISPOINTED=1
fi
done
if [ $MISPOINTED -eq 1 ]; then
echo ""
echo "Fix: Run 'uv run flowspec dev-setup --force'"
exit 1
fi
echo "✓ Passed: All symlinks point to templates/commands/"
echo ""
# R7: Verify subdirectory structure (flow/, spec/)
echo "Checking R7: Subdirectory structure..."
if [ ! -d ".claude/commands/flow" ]; then
echo "❌ FAILED: Missing .claude/commands/flow directory"
echo "Fix: Run 'uv run flowspec dev-setup --force'"
exit 1
fi
if [ ! -d ".claude/commands/spec" ]; then
echo "❌ FAILED: Missing .claude/commands/spec directory"
echo "Fix: Run 'uv run flowspec dev-setup --force'"
exit 1
fi
# Check for unexpected subdirectories
UNEXPECTED_DIRS=$(find .claude/commands -mindepth 1 -maxdepth 1 -type d ! -name flow ! -name spec 2>/dev/null || true)
if [ -n "$UNEXPECTED_DIRS" ]; then
echo "❌ FAILED: Found unexpected subdirectories:"
echo "$UNEXPECTED_DIRS" | sed 's/^/ - /'
echo ""
echo "Expected structure: flow/, spec/ only"
echo "Fix: Run 'uv run flowspec dev-setup --force'"
exit 1
fi
# Check for .md files at root level
ROOT_MD=$(find .claude/commands -maxdepth 1 -name "*.md" 2>/dev/null || true)
if [ -n "$ROOT_MD" ]; then
echo "❌ FAILED: Found .md files at root level (should be in subdirectories):"
echo "$ROOT_MD" | sed 's/^/ - /'
echo ""
echo "All .md files must be in flow/ or spec/ subdirectories"
echo "Fix: Run 'uv run flowspec dev-setup --force'"
exit 1
fi
echo "✓ Passed: Directory structure is correct"
echo ""
- name: Run dev-setup command
run: |
echo "=== Testing dev-setup command ==="
echo ""
echo "Running: uv run flowspec dev-setup --force"
uv run flowspec dev-setup --force
echo ""
echo "✓ dev-setup command executed successfully"
echo ""
# Verify expected output structure
echo "Verifying output structure..."
if [ ! -d ".claude/commands/flow" ] || [ ! -d ".claude/commands/spec" ]; then
echo "❌ FAILED: dev-setup did not create expected directory structure"
exit 1
fi
# Verify symlinks were created
FLOW_COUNT=$(find .claude/commands/flow -name "*.md" -type l 2>/dev/null | wc -l)
SPECKIT_COUNT=$(find .claude/commands/spec -name "*.md" -type l 2>/dev/null | wc -l)
echo " - Created $FLOW_COUNT flow command symlinks"
echo " - Created $SPECKIT_COUNT spec command symlinks"
if [ $FLOW_COUNT -eq 0 ] || [ $SPECKIT_COUNT -eq 0 ]; then
echo "❌ FAILED: dev-setup did not create expected symlinks"
exit 1
fi
echo "✓ Output structure verified"
- name: Run dev-setup validation tests
run: |
echo "=== Running dev-setup validation test suite ==="
uv run pytest tests/test_dev_setup_*.py -v