Files
dss/.dss/doc-sync/hooks/post-commit
Digital Production Factory 276ed71f31 Initial commit: Clean DSS implementation
Migrated from design-system-swarm with fresh git history.
Old project history preserved in /home/overbits/apps/design-system-swarm

Core components:
- MCP Server (Python FastAPI with mcp 1.23.1)
- Claude Plugin (agents, commands, skills, strategies, hooks, core)
- DSS Backend (dss-mvp1 - token translation, Figma sync)
- Admin UI (Node.js/React)
- Server (Node.js/Express)
- Storybook integration (dss-mvp1/.storybook)

Self-contained configuration:
- All paths relative or use DSS_BASE_PATH=/home/overbits/dss
- PYTHONPATH configured for dss-mvp1 and dss-claude-plugin
- .env file with all configuration
- Claude plugin uses ${CLAUDE_PLUGIN_ROOT} for portability

Migration completed: $(date)
🤖 Clean migration with full functionality preserved
2025-12-09 18:45:48 -03:00

61 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
#
# Post-commit hook for documentation synchronization
#
# Automatically regenerates documentation after commits
PROJECT_ROOT="$(git rev-parse --show-toplevel)"
DOC_SYNC_DIR="$PROJECT_ROOT/.dss/doc-sync"
RUNNER="$DOC_SYNC_DIR/doc_sync_runner.py"
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo ""
echo "📚 Post-commit: Regenerating documentation..."
# Check if runner exists
if [ ! -f "$RUNNER" ]; then
echo -e "${YELLOW}⚠️ Doc sync runner not found, skipping${NC}"
exit 0
fi
# Get list of changed files in this commit
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r HEAD)
# Check if any code files were changed
CODE_CHANGED=$(echo "$CHANGED_FILES" | grep -E "\.(py|js|ts|jsx|tsx)$")
if [ -z "$CODE_CHANGED" ]; then
echo -e "${YELLOW}No code changes detected, skipping doc regeneration${NC}"
exit 0
fi
# Run documentation generators
cd "$PROJECT_ROOT"
python3 "$RUNNER" run --trigger post-commit 2>&1
if [ $? -eq 0 ]; then
echo -e "${GREEN}✓ Documentation updated successfully${NC}"
# Check if .knowledge/ was updated
KNOWLEDGE_UPDATED=$(git status --porcelain | grep "^.M .knowledge/")
if [ -n "$KNOWLEDGE_UPDATED" ]; then
echo ""
echo -e "${YELLOW}📝 Knowledge base was updated:${NC}"
echo "$KNOWLEDGE_UPDATED" | sed 's/^/ /'
echo ""
echo -e "${YELLOW}Stage and commit these changes:${NC}"
echo " git add .knowledge/"
echo " git commit -m \"docs: update knowledge base (auto-generated)\""
fi
else
echo -e "${YELLOW}⚠️ Documentation generation had warnings/errors${NC}"
echo -e "${YELLOW}Check the output above for details${NC}"
fi
exit 0