Level 3 patterns - test-smart, deploy, migrate, logs, status (production systems)
/plugin marketplace add bryonjacob/aug/plugin install bryonjacob-aug-just-aug-just@bryonjacob/augThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Production systems. Git-aware testing, deployment integration, migrations, observability.
Git-aware test execution. Conditional expensive tests based on changed files.
# Smart test execution (conditional component tests based on git changes)
test-smart mode="default":
@scripts/test-smart.sh {{mode}}
Implementation (scripts/test-smart.sh):
#!/usr/bin/env bash
set -euo pipefail
MODE="${1:-default}"
# Always run fast unit tests
echo "🧪 Unit tests (always)..."
pnpm vitest run --project unit --reporter=verbose
# Determine if component tests needed
NEED_COMPONENT=false
case "$MODE" in
staged) CHANGED=$(git diff --cached --name-only --diff-filter=ACMR || echo "") ;;
push) CHANGED=$(git diff --name-only origin/main...HEAD || echo "") ;;
*) CHANGED=$(git diff --name-only HEAD || echo "")
CHANGED+=$'\n'$(git diff --cached --name-only --diff-filter=ACMR || echo "") ;;
esac
# Check if component-related files changed
if echo "$CHANGED" | grep -qE "src/(components|design-system|pages)/.*\.tsx?$"; then
NEED_COMPONENT=true
fi
# Run component tests if needed
if [ "$NEED_COMPONENT" = true ]; then
echo "🎨 Component changes detected..."
pnpm vitest run --project component --reporter=verbose
else
echo "⏭️ No component changes"
fi
Usage:
just test-smart # Default (working + staged)
just test-smart staged # Pre-commit hook
just test-smart push # Pre-push hook
Deploy to environment. Cloud provider integration.
# Deploy to environment (default: dev)
deploy environment="dev":
@scripts/deploy/check-auth.sh {{environment}}
@scripts/deploy/full.sh {{environment}}
Auth check (scripts/deploy/check-auth.sh):
#!/usr/bin/env bash
set -euo pipefail
ENV="${1:-dev}"
# Check gcloud auth
if ! gcloud auth list --filter=status:ACTIVE >/dev/null 2>&1; then
echo "❌ Not authenticated"
exit 1
fi
# Check project
EXPECTED="myproject-$ENV"
CURRENT=$(gcloud config get-value project 2>/dev/null)
if [ "$CURRENT" != "$EXPECTED" ]; then
echo "❌ Wrong project"
echo " Expected: $EXPECTED"
echo " Current: $CURRENT"
exit 1
fi
echo "✅ Authenticated: $(gcloud auth list --filter=status:ACTIVE --format='value(account)')"
Partial deploys:
deploy-api environment="dev":
@scripts/deploy/api.sh {{environment}}
deploy-web environment="dev":
@scripts/deploy/web.sh {{environment}}
Database migrations. Apply, rollback, create, history.
# Apply database migrations
migrate:
<apply all pending migrations>
# Rollback last migration
migrate-down:
<rollback one migration>
# Create new migration
migrate-create message:
<generate migration with description>
# View migration history
migrate-history:
<show applied migrations timeline>
Python (Alembic):
migrate:
uv run alembic upgrade head
migrate-down:
uv run alembic downgrade -1
migrate-create message:
uv run alembic revision --autogenerate -m "{{message}}"
migrate-history:
uv run alembic history --verbose
Migration testing:
test-migration:
uv run pytest -v -m "migration" --durations=10
Service logs. Tail cloud logs.
# View service logs
logs service="api" environment="dev":
@scripts/gcp/logs.sh {{service}} {{environment}}
Implementation:
#!/usr/bin/env bash
SERVICE="${1:-api}"
ENV="${2:-dev}"
gcloud logging tail \
"resource.type=cloud_run_revision AND resource.labels.service_name=$ENV-$SERVICE" \
--project="myproject-$ENV" \
--format="table(timestamp, textPayload)"
Deployment health check.
# Check deployment status
status environment="dev":
@scripts/gcp/status.sh {{environment}}
Implementation:
#!/usr/bin/env bash
ENV="${1:-dev}"
echo "Services:"
gcloud run services list \
--project="myproject-$ENV" \
--format="table(SERVICE,URL,LAST_DEPLOYED)"
Problem: Full test suite slow (unit 3s, component 18s). Running all tests every commit slows development.
Solution: Conditionally run expensive tests based on git diff.
Modes:
default: Working directory + stagedstaged: Staged files only (pre-commit)push: Commits since origin/main (pre-push)Benefits:
Deployment as first-class justfile command. No context switching to console/scripts.
Commands:
deploy - Full deploymentdeploy-api, deploy-web - Partial (fast iteration)logs - Debuggingstatus - Health checkSafety:
Migrations alongside tests/builds. First-class development operation.
Workflow:
just migrate-create "add users table"just migratejust test-migrationTesting:
@pytest.mark.migration
def test_upgrade_downgrade_cycle():
downgrade(config, "base")
upgrade(config, "head")
downgrade(config, "-1")
upgrade(config, "head")
Add when:
Skip when:
GCP (Cloud Run): Examples above
AWS (ECS):
deploy environment="dev":
aws ecs update-service --cluster {{environment}} --service api --force-new-deployment
Azure (Container Apps):
deploy environment="dev":
az containerapp update --name api --resource-group {{environment}} --image {{image}}