Skills Agentes

Gate Worktree Git Safety

Nota interna del proyecto no-mistakes. Se usa al cambiar la contención recursiva del gate, la colocación del worktree de run, las llamadas a git en el gate bare, el targeting de PR de GitHub o los hooks post-receive.

Estrellas
8.2k

en todo el repo

Actividad
60

0–100, la ruta de este skill

Actualizado
hace 3 días

último commit aquí

Commits
1

últimos 90 días

Contexto
1.4k tok

34 tok en reposo

Paquete
1 archivo

5 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add kunchenguid/no-mistakes --skill gate-worktree-git-safety --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • `internal/gatecontext` es el clasificador único de la contención recursiva del gate: combina identidad del directorio del gate con ancestría del peer IPC autenticado por el OS; `NO_MISTAKES_GATE` es solo diagnóstico.
  • La colocación del worktree de run (`worktree_roots`) la decide la configuración una sola vez al crear el run y se persiste en `runs.worktree_dir`; todo consumidor posterior la lee con `worktrees.RecordedDir`, nunca la re-deriva.
  • En repos de gate bare, los harnesses inyectan `safe.bareRepository=explicit`; toda llamada a git va por `git.Run`, que antepone `--git-dir=<dir>`, nunca por descubrimiento vía `cmd.Dir` o `-C`.
  • Los comandos `gh` que apuntan a un PR deben nombrarlo explícitamente por número o URL vía `prSelector`, porque el daemon corre `gh` desde el gate bare cuyo HEAD es la rama default.
  • El valor `--gate` del hook post-receive nunca viene de un `$(pwd)` desnudo; el script resuelve un directorio de gate absoluto y `normalizeNotifyGatePath` es una segunda capa.

Úsalo cuando

  • Se cambia la contención recursiva del gate, la colocación del worktree de run, las llamadas a git en el gate bare, el targeting de PR de GitHub o los hooks post-receive.

No lo uses cuando

    Qué lo activa

    Di cualquiera de estas frases y el agente debería cargar este skill.

    • Voy a tocar la contención de ejecución recursiva del gate
    • Cambia dónde se colocan los worktrees de run
    • Revisa el targeting de PR con gh desde el gate bare

    SKILL.md

    En inglés

    Recursive Gate-Execution Containment

    • internal/gatecontext is the single classifier for recursive pipeline control. It combines canonical registered gate common-directory identity with OS-authenticated IPC peer ancestry; NO_MISTAKES_GATE is diagnostic only. CLI preflight, daemon mutation ingress, gate init/eject, branch-sync mutation, and the managed pre-receive hook must all keep using that owner so marker removal, cwd changes, and direct pushes cannot bypass refusal. Read-only AXI status/logs, help, and doctor remain available. Regressions: internal/gatecontext, TestGateStepCannotStartRecursivePipeline.
    • Every pipeline agent prompt receives the phase boundary from internal/gateguidance, and the generated user-level skill reuses the same owner. Step agents return only their assigned phase; the outer executor alone controls other validation, push, PR, and CI phases. Edit internal/skill/skill.go, then run make skill; never edit the generated skill directly.

    Filesystem and Paths

    • Use filepath.Join; respect NM_HOME for app state; directories are 0o755 and files 0o644 by convention.
    • On macOS, path comparisons may need symlink resolution (/var vs /private/var); use worktrees.Canonical/worktrees.Contains wherever run worktree paths are compared, so one spelling matches everywhere.
    • Run worktree placement (worktree_roots) is owned by internal/worktrees. Configuration decides it exactly once, at run creation (Layout.Dir in RunManager.startRunWithIntentSource), and the result is persisted in runs.worktree_dir; every later consumer - resume, step diff, startup cleanup, procreap, eject, gatecontext attribution - must read it back through worktrees.RecordedDir and never re-derive it from config, so a mid-flight edit can neither strand a parked run nor point a removal at a directory the run never used. An empty column means the default <NM_HOME>/worktrees/<repoID>/<runID>.
    • worktrees.CheckPlacement is the single policy for an unusable root (inside NM_HOME, inside any registered checkout); config.ValidateWorktreeRoots owns what the config can judge alone. The daemon refuses to start on an unusable placement, so init --worktree-root must refuse exactly the same set or it prints a paste that takes the operator's CLI down, and EVERY init refuses to register a checkout that contains a configured root - the same state reached from the other direction. User-facing semantics live in docs/src/content/docs/reference/global-config.md. Regressions: internal/worktrees, internal/config/config_worktree_roots_test.go, internal/daemon/worktree_roots_test.go, internal/gate/eject_sweep_test.go, internal/cli/init_test.go.

    Git on Bare Gate Repos (safe.bareRepository)

    • Agent harnesses and hardened CI inject safe.bareRepository=explicit, which forbids cwd-based discovery of bare repositories. Route every gate git call through git.Run, which detects a bare git dir and prepends --git-dir=<dir>; never shell out to git in a bare gate repo relying on cmd.Dir or -C discovery (issue #362).
    • Startup gate migration is DB-authoritative with a strict validated <id>.git legacy fallback; it must reject non-gates before hook or Git mutation and use git.RunBare so a malformed directory cannot discover an ancestor worktree. Completed migrations carry the content-versioned gate-config stamp and normal restarts must stay filesystem-only for current gates. Regressions: TestMigrateGateConfigsRejectsInvalidDirectoriesAndSkipsCurrentGates, TestColdDetachedStartupProductionGateCardinality.
    • Regressions: TestRunOnBareRepoUnderSafeBareRepositoryExplicit, TestWorktreeAddRemoveOnBareRepoUnderSafeBareRepositoryExplicit, TestInitUnderSafeBareRepositoryExplicit.

    gh PR-Targeting From the Bare Gate Repo (internal/scm/github)

    • The daemon runs gh from the detached bare gate repo whose HEAD is the default branch, so every PR-targeting command must name the exact PR explicitly: an empty positional makes gh pr <verb> infer the cwd branch (main) and return no pull requests found for branch main even when the feature PR's checks are green. GetChecks, GetPRState, GetMergeableState, and UpdatePR route through the shared prSelector (number, else URL, else fail closed) - never append a bare pr.Number/pr.URL that can be empty. This is the gh analogue of the git bare-gate-repo trap above.
    • Regressions: TestGetChecksTargetsKnownPRByURLWhenNumberMissing, TestPRTargetingReadsFailClosedWithoutIdentity, TestPRStateAndMergeableTargetKnownPRByURL, TestUpdatePRTargetsKnownPRByURLWhenNumberMissing, TestUpdatePRFailsClosedWithoutIdentity.

    Post-Receive Hook Gate Path Resolution (internal/git/hook.go)

    • The hook's --gate value must never come from a bare $(pwd): Git can invoke post-receive from a cwd that collapses to . (issue #269), which the daemon rejects and the pipeline silently never starts. The hook script resolves an absolute gate dir (git first, hook location fallback), and normalizeNotifyGatePath in internal/cli/daemon_cmd.go is an independent second layer that absolutizes whatever an already-installed older hook sends.
    • Regressions: TestPostReceiveHook_ResolvesAbsoluteGateDir, TestPostReceiveHook_FallsBackToHookLocationForGateDir, TestNormalizeNotifyGatePathResolvesLegacyDotGate.

    Reproducido de kunchenguid/no-mistakes bajo licencia MIT. Leer esta página en markdown.

    Archivos

    1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

    Detalles

    Licencia
    MIT
    Recursos incluidos
    Solo SKILL.md
    Código fuente
    Ver SKILL.md

    Más de kunchenguid/no-mistakes

    Este repo incluye 16 skills. Si instalas uno, normalmente ya tienes los demás.

    Valida tus cambios de código por el pipeline de no-mistakes (review de código automatizado, tests, lint, docs, push, PR y CI) antes de que lleguen al destino de push configurado. Se activa con `/no-mistakes`.

    Costo de contexto al activarse
    5.9k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 3 días
    devops infraestructura

    Nota interna del proyecto no-mistakes. Se usa al cambiar la readiness de CI, la recogida de checks del forge, los reruns, los timeouts de CI o la monitorización del ciclo de vida del PR.

    Costo de contexto al activarse
    2.6k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    anteayer
    devops infraestructura

    Nota interna del proyecto no-mistakes. Se usa al cambiar las sesiones de review, las decisiones sobre findings, los timeouts de agente, el comportamiento del Test local o la conformidad con la intención.

    Costo de contexto al activarse
    4.1k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 3 días
    herramientas desarrollo

    Nota interna de seguridad del proyecto no-mistakes. Se usa al cambiar el render del cuerpo del PR, la redacción de rutas de home, la publicación de rutas de artefacto o los marcadores de attestation de pipeline.

    Costo de contexto al activarse
    1.1k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    anteayer
    seguridad

    Nota interna del proyecto no-mistakes. Se usa al añadir o cambiar tests, el harness e2e, el aislamiento de procesos de test o el sharding de tests en CI.

    Costo de contexto al activarse
    1.1k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    anteayer
    testing qa

    Nota interna del proyecto no-mistakes. Se usa al cambiar la configuración de modelo o esfuerzo de un agente, los mapeos de adaptador o los perfiles de candidato de eval, todo bajo el dueño único `internal/agentcfg`.

    Costo de contexto al activarse
    519 tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 3 días
    herramientas desarrollo

    Skills relacionados

    Úsalo cuando la implementación esté completa, todos los tests pasen, y necesites decidir cómo integrar el trabajo.

    Costo de contexto al activarse
    1.9k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 19 días
    herramientas desarrollo

    Úsalo al empezar trabajo de feature que necesita aislamiento del workspace actual, o antes de ejecutar planes de implementación: asegura un workspace aislado vía herramientas nativas o fallback a git worktree.

    Costo de contexto al activarse
    1.7k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    el mes pasado
    herramientas desarrollo

    Úsala al crear nuevas skills, editar skills existentes o verificar que funcionan antes de desplegarlas.

    Costo de contexto al activarse
    6.6k tok
    Tamaño del paquete
    7 archivos
    Última actualización
    hace 19 días
    herramientas desarrollo