From devflow
Gate bloqueante auto-ativado antes de qualquer edição. Detecta a estratégia git do projeto e aplica branch protection + isolamento.
npx claudepluginhub nexuz-sys/devflow --plugin devflowThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
⛔ REGRA BLOQUEANTE: Esta verificação DEVE ser executada ANTES de qualquer edição de arquivo.
Este skill é enforced por um hook PreToolUse que bloqueia Edit e Write em branches protegidas.
O hook retorna permissionDecision: "deny" — o LLM não consegue editar sem antes criar uma branch de trabalho.
Fluxo quando bloqueado:
Skill({ skill: "devflow:git-strategy" })Exceções — arquivos permitidos em qualquer branch (hook não bloqueia):
.context/workflow/.checkpoint/* — handoff, checkpoints.context/workflow/* — estado do workflow.context/plans/* — planos PREVC.context/docs/* — docs do projeto (sync).context/agents/* — playbooks de agentes (sync).context/skills/* — skills do projeto (sync)docs/superpowers/* — planos do superpowersdocs/specs/* — design specs$CLAUDE_PLUGIN_ROOT/*)Exceções — branches não protegidas (hook não bloqueia):
feature/*, fix/*, hotfix/*, release/*)Announce at start: "I'm using the devflow:git-strategy skill to verify branch safety."
| Estratégia | Isolamento | Branches protegidas |
|---|---|---|
| branch-flow | git checkout -b <tipo>/<nome> | Configurável (main, develop, ou ambas) |
| worktree | git worktree add | Configurável via .devflow.yaml |
| trunk-based | Nenhum (commits diretos) | Nenhuma |
1. Ler .context/.devflow.yaml → seção git
2. Se não existir → BLOQUEAR:
"DevFlow não está configurado. Execute /devflow config para definir sua estratégia git."
NÃO prosseguir. NÃO fazer detecção por heurísticas.
3. Se existir → usar campos:
- strategy: branch-flow | worktree | trunk-based
- protectedBranches: lista de branches protegidas
- branchProtection: true/false
- prCli: gh | glab | none
Importante: Este skill NÃO faz mais detecção automática por heurísticas.
A detecção foi movida para o skill devflow:config, que é executado uma vez no setup.
git rev-parse --abbrev-ref HEAD
AskUserQuestion:
question: "Você está em branch protegida. Qual tipo de alteração?"
header: "Branch"
multiSelect: false
options:
- label: "Feature (Recomendado)"
description: "Nova funcionalidade. Cria: feature/<nome>"
- label: "Bugfix"
description: "Correção de bug. Cria: fix/<nome>"
- label: "Hotfix"
description: "Correção urgente. Cria: hotfix/<nome>"
- label: "Release"
description: "Nova versão. Cria: release/<versão>"
IF worktree:
a. Se scripts/wt-create.sh existir:
./scripts/wt-create.sh <tipo> <nome>
Senão (fallback manual):
REPO_DIR=$(git rev-parse --show-toplevel)
PARENT_DIR=$(dirname "$REPO_DIR")
REPO_NAME=$(basename "$REPO_DIR")
git worktree add "${PARENT_DIR}/${REPO_NAME}-<tipo>-<nome>" -b <tipo>/<nome>
b. Verificar .gitignore:
git check-ignore -q <diretório-worktree> || echo "<diretório>" >> .gitignore
c. Setup automático:
[ -f package.json ] && npm install
[ -f Cargo.toml ] && cargo build
[ -f requirements.txt ] && pip install -r requirements.txt
[ -f go.mod ] && go mod download
d. Baseline tests — rodar e reportar. Se falhar, perguntar se continua.
e. PARAR e instruir: "Abra nova janela no worktree: code -n <path>"
f. Disciplina: nunca editar arquivos de outra worktree (ler OK, editar NÃO).
ELIF branch-flow:
git checkout -b <tipo>/<nome>
Confirmar branch criada, prosseguir.
ELIF trunk-based:
Prosseguir direto. Alertar sobre feature flags se funcionalidade incompleta.
Se branch atual é feature/*, fix/*, hotfix/*, ou release/* → prosseguir sem gate.
Não aplicar gate quando:
| Estratégia | Ação |
|---|---|
| worktree | git worktree remove <path> + git branch -d <tipo>/<nome> (ou ./scripts/wt-clean.sh) |
| branch-flow | git branch -d <tipo>/<nome> |
| trunk-based | Nenhuma |
Ler prCli de .context/.devflow.yaml:
IF prCli == "gh":
gh pr create --title "..." --body "..."
ELIF prCli == "glab":
glab mr create --title "..." --description "..."
ELIF prCli == "none":
Instruir usuário a criar manualmente
[git-strategy gate] → P → R → E → V → C