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
This commit is contained in:
59
tools/immutability/README.md
Normal file
59
tools/immutability/README.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# DSS Immutability System (Simplified)
|
||||
|
||||
## Overview
|
||||
|
||||
Protects core architecture files from accidental modification through a simple git pre-commit hook.
|
||||
|
||||
## Protected Files
|
||||
|
||||
- `.knowledge/dss-principles.json` - Core design system principles
|
||||
- `.knowledge/dss-architecture.json` - System architecture definition
|
||||
- `.clauderc` - AI agent configuration
|
||||
|
||||
## How It Works
|
||||
|
||||
1. **Git Hook**: Pre-commit hook checks if any protected files are being modified
|
||||
2. **AI Instructions**: Claude is instructed in `.clauderc` to never modify these files
|
||||
3. **Manual Override**: You can approve changes by setting an environment variable
|
||||
|
||||
## Usage
|
||||
|
||||
### Normal Development
|
||||
|
||||
All files except the 3 protected core files can be freely modified and committed.
|
||||
|
||||
### Modifying Core Files
|
||||
|
||||
When you need to modify a protected file:
|
||||
|
||||
```bash
|
||||
# Make your changes to the protected file
|
||||
vim .knowledge/dss-principles.json
|
||||
|
||||
# Commit with explicit approval
|
||||
ALLOW_CORE_CHANGES=true git commit -m "Update: core architecture change"
|
||||
```
|
||||
|
||||
That's it! No complex workflows, no change requests, just one environment variable.
|
||||
|
||||
## For AI Agents
|
||||
|
||||
If Claude needs to modify a protected file, it will:
|
||||
1. Ask you for explicit approval
|
||||
2. You respond confirming the change
|
||||
3. Claude makes the change
|
||||
4. You commit with `ALLOW_CORE_CHANGES=true`
|
||||
|
||||
## Installation
|
||||
|
||||
The git hook is automatically installed at `.git/hooks/pre-commit`.
|
||||
|
||||
To reinstall:
|
||||
```bash
|
||||
cp tools/immutability/pre_commit_hook.sh .git/hooks/pre-commit
|
||||
chmod +x .git/hooks/pre-commit
|
||||
```
|
||||
|
||||
## Philosophy
|
||||
|
||||
**Simple is better than complex.** We protect the 3 files that define DSS identity, and trust human judgment for everything else.
|
||||
46
tools/immutability/pre_commit_hook.sh
Executable file
46
tools/immutability/pre_commit_hook.sh
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
# DSS Immutability Guard - Simplified Version
|
||||
# Protects core principle files from accidental modification
|
||||
|
||||
echo "🛡️ DSS Immutability Check..."
|
||||
|
||||
# List of protected files (core principles only)
|
||||
PROTECTED_FILES=(
|
||||
".knowledge/dss-principles.json"
|
||||
".knowledge/dss-architecture.json"
|
||||
".clauderc"
|
||||
)
|
||||
|
||||
# Check if any protected files are being modified
|
||||
MODIFIED_PROTECTED=()
|
||||
for file in "${PROTECTED_FILES[@]}"; do
|
||||
if git diff --cached --name-only | grep -q "^${file}$"; then
|
||||
MODIFIED_PROTECTED+=("$file")
|
||||
fi
|
||||
done
|
||||
|
||||
# If protected files are modified, require confirmation
|
||||
if [ ${#MODIFIED_PROTECTED[@]} -gt 0 ]; then
|
||||
echo ""
|
||||
echo "⚠️ WARNING: You are modifying protected core files:"
|
||||
for file in "${MODIFIED_PROTECTED[@]}"; do
|
||||
echo " - $file"
|
||||
done
|
||||
echo ""
|
||||
echo "These files define DSS core architecture and should rarely change."
|
||||
echo ""
|
||||
echo "To proceed with this commit, set: ALLOW_CORE_CHANGES=true"
|
||||
echo "Example: ALLOW_CORE_CHANGES=true git commit -m 'your message'"
|
||||
echo ""
|
||||
|
||||
# Check if user has explicitly allowed the change
|
||||
if [ "$ALLOW_CORE_CHANGES" != "true" ]; then
|
||||
echo "❌ Commit blocked. Set ALLOW_CORE_CHANGES=true to proceed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ ALLOW_CORE_CHANGES=true detected. Proceeding with commit."
|
||||
fi
|
||||
|
||||
echo "✅ Immutability check passed."
|
||||
exit 0
|
||||
Reference in New Issue
Block a user