From 5c532e708c9e01d74bd9c2e21247bafa72168f98 Mon Sep 17 00:00:00 2001 From: Mathias Bergqvist Date: Thu, 30 Apr 2026 22:48:28 +0200 Subject: [PATCH] chore: drop HANDROLLED sentinel machinery from context-sync.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing in the workspace uses the HANDROLLED escape hatch anymore — the infra repo (its only consumer) was migrated to the standard pattern. Removing the dead code: HANDROLLED_MARKER constant, skip_if_handrolled function, and call sites in each generator. Sync output for any non- HANDROLLED file (i.e., every file we have) is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/context-sync.sh | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/scripts/context-sync.sh b/scripts/context-sync.sh index faf132f..a3f9468 100755 --- a/scripts/context-sync.sh +++ b/scripts/context-sync.sh @@ -14,21 +14,6 @@ set -euo pipefail PROJECT_FILE=".context/PROJECT.md" SKILLS_DIR=".skills" -HANDROLLED_MARKER="HANDROLLED: do not regenerate" - -# Skip regenerating any target file that opts out via the HANDROLLED sentinel. -# Add `` near the top of a file to keep -# it hand-maintained even when context:sync runs. Useful for projects whose -# CLAUDE.md (or other adapter) is the single source of truth — e.g. ops repos -# where incident-derived safety rules must not be diluted by templated content. -skip_if_handrolled() { - local file="$1" - if [ -f "$file" ] && head -n 20 "$file" | grep -q "$HANDROLLED_MARKER"; then - echo " → $file (handrolled, skipped)" - return 0 - fi - return 1 -} # Walk up to find root .context/AGENT.md find_root_context() { @@ -71,7 +56,6 @@ root_block() { # Claude Code walks up the tree — it finds ~/dev/CLAUDE.md automatically. # Project-level CLAUDE.md only needs project-specific context. generate_claude() { - skip_if_handrolled CLAUDE.md && return cat "$PROJECT_FILE" > CLAUDE.md echo " → CLAUDE.md (project-only; Claude Code inherits root)" } @@ -80,14 +64,12 @@ generate_claude() { # These tools read AGENTS.md from cwd but don't walk up. # Concatenate root + project. generate_agents() { - skip_if_handrolled AGENTS.md && return { root_block; cat "$PROJECT_FILE"; } > AGENTS.md echo " → AGENTS.md (root + project; Crush, Pi, Antigravity)" } # ── Cursor ─────────────────────────────────────────────────── generate_cursor() { - skip_if_handrolled .cursorrules && return { echo "# Cursor rules — auto-generated" echo "# Do not edit. Run: task context:sync" @@ -100,7 +82,6 @@ generate_cursor() { # ── Aider ──────────────────────────────────────────────────── generate_aider() { - skip_if_handrolled .aider.conventions.md && return { root_block; cat "$PROJECT_FILE"; } > .aider.conventions.md if [ ! -f .aider.conf.yml ]; then cat > .aider.conf.yml << 'YAML' @@ -113,7 +94,6 @@ YAML # ── Generic system prompt (Open WebUI, Mods, etc.) ────────── generate_system_prompt() { - skip_if_handrolled .context/system-prompt.txt && return { echo "You are a coding assistant working on a specific project." echo "Follow all conventions from both the root agent context and project context."