LeoYeAI/agent-master-skills / skills/backstage
backstage
VerifiedAnti-drift protocol script. Ensures parity between docs and system. Triggers: 'bom dia PROJECT' / 'good morning PROJECT' (load project context with health checks)
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 21.6 KB |
| _meta.json | config | 813 B |
| backstage.sh | script | 1.6 KB |
| checks.sh | script | 7.1 KB |
| contract.html | other | 7.3 KB |
| parse-roadmap.sh | script | 727 B |
| update-backstage.sh | script | 3.8 KB |
checks.sh
View on GitHub#!/bin/bash
# checks.sh - Unified policies/ + checks/ enforcement
# Executes checks FIRST, then reads policies
set -e
PROJECT_ROOT="${1:-.}"
MODE="${2:-start}" # start or end
cd "$PROJECT_ROOT"
echo "π Running backstage enforcement (mode: $MODE)..."
echo ""
# ============================================================================
# STEP 1: Execute ALL checks (deterministic - bash domain)
# ============================================================================
echo "π Executing checks/ (deterministic)..."
echo ""
GLOBAL_CHECKS_DIR="$HOME/Documents/backstage/backstage/checks/global"
LOCAL_CHECKS_DIR="backstage/checks/local"
CHECKS_PASS=true
CHECKS_RUN=0
ROADMAP_STATUS="" # Capture roadmap-tasks output
# Collect local check basenames (for override detection)
LOCAL_CHECKS=""
if [ -d "$LOCAL_CHECKS_DIR" ]; then
for check in "$LOCAL_CHECKS_DIR"/*.sh; do
if [ -f "$check" ]; then
basename_check=$(basename "$check")
LOCAL_CHECKS="$LOCAL_CHECKS $basename_check "
fi
done
fi
# Run global checks (skip if local has same name)
if [ -d "$GLOBAL_CHECKS_DIR" ]; then
echo " π Global checks:"
for check in "$GLOBAL_CHECKS_DIR"/*.sh; do
if [ -f "$check" ]; then
basename_check=$(basename "$check")
# Skip if local overrides (check if basename is in LOCAL_CHECKS string)
if echo "$LOCAL_CHECKS" | grep -q " $basename_check "; then
echo " βοΈ $basename_check (local override)"
continue
fi
# Run check
CHECK_OUTPUT=$(bash "$check" 2>&1)
if [ $? -eq 0 ]; then
echo " β
$basename_check"
# Capture roadmap-tasks output if all tasks done
if [ "$basename_check" = "roadmap-tasks.sh" ] && echo "$CHECK_OUTPUT" | grep -q "π¦ Ready for merge-to-main"; then
ROADMAP_STATUS="$CHECK_OUTPUT"
fi
else
echo " β $basename_check (failed)"
CHECKS_PASS=false
fi
CHECKS_RUN=$((CHECKS_RUN + 1))
fi
done
else
echo " β οΈ No global checks found ($GLOBAL_CHECKS_DIR)"
fi
echo ""
# Run local checks (always run, overrides global if same name)
if [ -d "$LOCAL_CHECKS_DIR" ]; then
echo " π Local checks:"
for check in "$LOCAL_CHECKS_DIR"/*.sh; do
if [ -f "$check" ]; then
basename_check=$(basename "$check")
# Run check
if bash "$check" >/dev/null 2>&1; then
echo " β
$basename_check"
else
echo " β $basename_check (failed)"
CHECKS_PASS=false
fi
CHECKS_RUN=$((CHECKS_RUN + 1))
fi
done
else
echo " βΉοΈ No local checks found ($LOCAL_CHECKS_DIR)"
fi
echo ""
echo " π Checks executed: $CHECKS_RUN"
# ============================================================================
# STEP 2: Read interpretive checks (.md files in checks/)
# ============================================================================
echo ""
echo "π Reading interpretive checks/ (.md files - AI enforces)..."
echo ""
INTERPRETIVE_READ=0
# Collect local interpretive basenames (for override detection)
LOCAL_INTERPRETIVE=""
if [ -d "$LOCAL_CHECKS_DIR" ]; then
for check in "$LOCAL_CHECKS_DIR"/*.md; do
if [ -f "$check" ]; then
basename_check=$(basename "$check")
LOCAL_INTERPRETIVE="$LOCAL_INTERPRETIVE $basename_check "
fi
done
fi
# Read global interpretive checks (skip if local has same name)
if [ -d "$GLOBAL_CHECKS_DIR" ]; then
echo " π Global interpretive:"
for check in "$GLOBAL_CHECKS_DIR"/*.md; do
if [ -f "$check" ]; then
basename_check=$(basename "$check")
# Skip README.md
if [ "$basename_check" = "README.md" ]; then
continue
fi
# Skip if local overrides
if echo "$LOCAL_INTERPRETIVE" | grep -q " $basename_check "; then
echo " βοΈ $basename_check (local override)"
continue
fi
echo " β
$basename_check (read)"
INTERPRETIVE_READ=$((INTERPRETIVE_READ + 1))
fi
done
fi
echo ""
# Read local interpretive checks (always read, overrides global if same name)
if [ -d "$LOCAL_CHECKS_DIR" ]; then
echo " π Local interpretive:"
HAS_LOCAL_INTERPRETIVE=false
for check in "$LOCAL_CHECKS_DIR"/*.md; do
if [ -f "$check" ] && [ "$(basename "$check")" != "README.md" ]; then
basename_check=$(basename "$check")
echo " β
$basename_check (read)"
INTERPRETIVE_READ=$((INTERPRETIVE_READ + 1))
HAS_LOCAL_INTERPRETIVE=true
fi
done
if [ "$HAS_LOCAL_INTERPRETIVE" = false ]; then
echo " βΉοΈ No local interpretive checks found"
fi
else
echo " βΉοΈ No local interpretive checks found"
fi
echo ""
echo " π Interpretive checks read: $INTERPRETIVE_READ"
# ============================================================================
# STEP 3: Integrated report
# ============================================================================
echo ""
echo "π Integrated Enforcement Report:"
echo ""
# Show current branch + epic info
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown")
if [[ "$CURRENT_BRANCH" == "main" ]]; then
echo "πΏ Branch: main (read-only)"
elif [[ "$CURRENT_BRANCH" =~ ^v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
VERSION="${BASH_REMATCH[1]}"
# Extract epic title from ROADMAP
if [[ -f backstage/ROADMAP.md ]]; then
EPIC_TITLE=$(awk "/^## v$VERSION\$/,/^###/" backstage/ROADMAP.md | grep "^###" | head -1 | sed 's/^### //')
if [[ -n "$EPIC_TITLE" ]]; then
echo "πΏ Epic: v$VERSION - $EPIC_TITLE"
else
echo "πΏ Branch: $CURRENT_BRANCH"
fi
else
echo "πΏ Branch: $CURRENT_BRANCH"
fi
else
echo "πΏ Branch: $CURRENT_BRANCH"
fi
echo ""
echo "π Checks (deterministic):"
if [ "$CHECKS_PASS" = true ]; then
echo " β
All checks passed ($CHECKS_RUN executed)"
else
echo " β Some checks failed (see above)"
fi
echo ""
echo "π Interpretive checks:"
echo " β
All interpretive checks read ($INTERPRETIVE_READ total)"
echo " π€ AI will enforce contextual rules"
# Show roadmap status if epic complete
if [ -n "$ROADMAP_STATUS" ]; then
echo ""
echo "$ROADMAP_STATUS"
fi
echo ""
# ============================================================================
# STEP 4: Exit code (mode-aware)
# ============================================================================
if [ "$CHECKS_PASS" = true ]; then
echo "β
Enforcement complete (all deterministic checks passed)"
exit 0
else
if [ "$MODE" = "start" ]; then
echo "π Enforcement failed (blocking commit - fix issues above)"
exit 1
else
echo "β οΈ Enforcement soft fail (add issues to ROADMAP)"
exit 0
fi
fi
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product β it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product β not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial β a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK β model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER β read BEFORE opening the target file; don't skip because it "looks like a one-liner" β whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) β never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named β don't Read the file). | Stars: 198k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |