Skip to content

ccoalm/ccl-skills / skills/skill-extraction-workflow

skill-extraction-workflow

Flagged

复盘 / 沉淀 / 总结经验 / 补进技能 / 技能缺陷 / 流程优化 / would other teammates hit this / will we forget next time / teamwide recurrence / extract skill / post-mortem / 深度 review·审计技能仓库 / 对标外部技能包找 gap(benchmark superpowers·gstack 等) / 核查全局安装点(~/.config/opencode 等)旧快照是否遮蔽本仓技能 / 本仓(ccl-skills 等共享技能仓)OpenCode 项目配置·命令治理 → turn reusable lessons into durable CCL skills.

FileKindSize
SKILL.mdskill md111.0 KB
agents/openai.yamlconfig257 B
references/analysis-parse-fix-test-challenge-replay.mdmarkdown1.5 KB
references/attention-budget-ratchet.mdmarkdown13.7 KB
references/attribution-verification.mdmarkdown4.4 KB
references/bootstrap-slim-c3-obligation-table.mdmarkdown8.0 KB
references/correction-routing-map.mdmarkdown3.7 KB
references/coverage-exhaustion-traps.mdmarkdown19.6 KB
references/description-authoring.mdmarkdown21.1 KB
references/dual-track-review-gate.mdmarkdown110.6 KB
references/eval-routing.mdmarkdown22.2 KB
references/evidence-card-template.mdmarkdown3.2 KB
references/example-domain-preselect.mdmarkdown4.6 KB
references/external-practice-controls.mdmarkdown45.5 KB
references/extraction-lifecycle-handoff.mdmarkdown6.9 KB
references/extraction-quickstart.mdmarkdown20.2 KB
references/firing-point-placement.mdmarkdown21.3 KB
references/harness-patterns-and-eval.mdmarkdown42.6 KB
references/incident-postmortem-extraction.mdmarkdown28.8 KB
references/l0-l1-l2-routing.mdmarkdown10.3 KB
references/online-skill-review.mdmarkdown6.7 KB
references/parallel-stack-references-pattern.mdmarkdown35.9 KB
references/r0-leakage-audit.mdmarkdown19.9 KB
references/recurring-anti-patterns-checklist.mdmarkdown34.4 KB
references/resume-paused-delivery.mdmarkdown3.0 KB
references/review-feedback-mining.mdmarkdown5.7 KB
references/review-finding-standards.mdmarkdown7.3 KB
references/review-rubric.mdmarkdown3.1 KB
references/rule-consolidation.mdmarkdown38.2 KB
references/skill-listing-budget.mdmarkdown1.7 KB
references/source-register.mdmarkdown1.0 MB
references/source-to-skill-extraction.mdmarkdown109.3 KB
references/two-source-extraction-pattern.mdmarkdown19.4 KB
references/uiux-judgment-extraction.mdmarkdown19.1 KB
references/uiux-routing-map.mdmarkdown5.8 KB
references/validation-and-landing.mdmarkdown46.9 KB
scripts/AGENTS.mdmarkdown635 B
scripts/check-ccl-skills.shexecutablescript100.7 KB
scripts/check-contract-anchors.shexecutablescript5.6 KB
scripts/check-evidence-card-leak.shexecutablescript26.1 KB
scripts/check-mr-target-freshness.shexecutablescript9.4 KB
scripts/check-size-budget.shexecutablescript36.0 KB
scripts/check-sync-pointers.shexecutablescript22.6 KB
scripts/check_review_evidence_present.pyexecutablescript4.6 KB
scripts/contract-anchors.tsvother3.8 KB
scripts/entrypoint_form_census.pyexecutablescript7.1 KB
scripts/eval-golden-trace.rbexecutablescript10.0 KB
scripts/eval-health.rbexecutablescript14.6 KB
scripts/eval-routing-bank.rbexecutablescript30.4 KB
scripts/eval-routing.rbexecutablescript9.2 KB
scripts/extraction_review_gate.shexecutablescript1.8 KB
scripts/gate_receipt.pyexecutablescript24.7 KB
scripts/generic-r0-leak-scan.shexecutablescript12.4 KB
scripts/governing-chain-diff.pyexecutablescript12.8 KB
scripts/impact-chain-gate.rbexecutablescript124.4 KB
scripts/obligation-ledger.pyscript107.0 KB
scripts/reference-access-census.shexecutablescript8.3 KB
scripts/register-firing-path-resolution.rbexecutablescript48.4 KB
scripts/shared_git_surface_gate.pyexecutablescript38.0 KB
scripts/skill-behavior-eval.pyexecutablescript39.3 KB
scripts/skill-paired-eval.pyexecutablescript76.9 KB
scripts/source-register-lifecycle.rbscript1.5 KB
scripts/source-register-pending-status.rbscript2.0 KB
scripts/test_ai_coding_implementation_gates.shexecutablescript85.2 KB
scripts/test_antipattern_grep_panel.shexecutablescript3.2 KB
scripts/test_body_compliance_grading.shexecutablescript21.0 KB
scripts/test_check_ccl_impact_chain_refscripts.shexecutablescript145.1 KB
scripts/test_check_ccl_r0_status.shexecutablescript4.2 KB
scripts/test_check_ccl_register_pending_exclusion.shexecutablescript7.4 KB
scripts/test_check_ccl_regressions.shexecutablescript14.3 KB
scripts/test_check_ccl_route_drift.shexecutablescript22.6 KB
scripts/test_check_ccl_size_budget.shexecutablescript59.5 KB
scripts/test_check_ccl_skill_catalog.shexecutablescript23.3 KB
scripts/test_check_ccl_source_register_lifecycle.shexecutablescript6.1 KB
scripts/test_check_contract_anchors.shexecutablescript7.4 KB
scripts/test_check_mr_target_freshness.shexecutablescript12.8 KB
scripts/test_check_review_evidence_present.shexecutablescript4.3 KB
scripts/test_check_sync_pointers.shexecutablescript32.5 KB
scripts/test_ci_checkout_ref_binding.shexecutablescript8.2 KB
scripts/test_controlled_escalation_pins.shexecutablescript7.7 KB
scripts/test_entrypoint_domain_scan_terms.shexecutablescript8.8 KB
scripts/test_entrypoint_form_census.shexecutablescript6.3 KB
scripts/test_eval_routing_bank_grader_diagnostics.shexecutablescript20.6 KB
scripts/test_eval_routing_bank_resolution.shexecutablescript15.3 KB
scripts/test_eval_routing_bank_surface_binding.shexecutablescript6.9 KB
scripts/test_eval_routing_prose_target.shexecutablescript3.7 KB
scripts/test_eval_runtime.pyexecutablescript43.3 KB
scripts/test_extraction_review_gate.shexecutablescript15.2 KB
scripts/test_frozen_case_sanctity.shexecutablescript6.9 KB
scripts/test_frozen_case_sanctity_selfproof.shexecutablescript4.6 KB
scripts/test_gate_receipt.shexecutablescript17.7 KB
scripts/test_generic_r0_leak_scan.shexecutablescript6.4 KB
scripts/test_git_identity_predicate_gate.shscript13.8 KB
scripts/test_governing_chain_diff.shexecutablescript15.1 KB
scripts/test_impact_chain_gate_dateless_host.shexecutablescript6.8 KB
scripts/test_impact_chain_gate_verdict_differential.shexecutablescript20.8 KB
scripts/test_impact_chain_round_attribution.shexecutablescript32.5 KB
scripts/test_impact_chain_self_adjudication.shexecutablescript31.4 KB
scripts/test_impact_chain_source_refuted.shexecutablescript14.7 KB
scripts/test_liveness_predicate_gate.shexecutablescript14.5 KB
scripts/test_locale_independent_gates.shexecutablescript13.0 KB
scripts/test_obligation_ledger.shexecutablescript94.9 KB
scripts/test_obligation_ledger_repo_audit.shexecutablescript2.7 KB
scripts/test_pinned_phrase_mutation_walk.shexecutablescript6.5 KB
scripts/test_reference_access_census.shexecutablescript17.3 KB
scripts/test_register_firing_path_resolution.shexecutablescript41.0 KB
scripts/test_register_firing_path_wiring.shexecutablescript29.9 KB
scripts/test_regression_runner_lanes.shexecutablescript4.5 KB
scripts/test_regression_runner_registration.shexecutablescript1.5 KB
scripts/test_routing_bank_integrity.shexecutablescript15.5 KB
scripts/test_routing_pointer_integrity.shexecutablescript18.9 KB
scripts/test_shared_git_surface_gate.shexecutablescript76.8 KB
scripts/test_skill_paired_eval.pyscript60.0 KB
scripts/test_teardown_guard_pins.shexecutablescript17.0 KB
scripts/test_uiux_delivery_contract.shexecutablescript118.6 KB
scripts/test_uiux_loading_budget.shexecutablescript15.4 KB
scripts/test_validate_skill_credential_cwd.shexecutablescript2.6 KB
scripts/test_validate_skill_cross_refs.shexecutablescript4.8 KB
scripts/test_validate_skill_root_depth.shexecutablescript2.5 KB
scripts/validate-skill.shexecutablescript10.5 KB

scripts/test_locale_independent_gates.sh

View on GitHub
#!/usr/bin/env bash
# Regression: the repository gates must not depend on the caller's locale.
# Under a POSIX/unset locale Ruby defaults to US-ASCII, so a gate that reads the
# UTF-8 skill text (or runs a `ruby -e` program with UTF-8 literals) crashed with
# "invalid byte sequence in US-ASCII" before checking anything, while CI (which
# runs C.UTF-8) stayed green. Each ruby-invoking script pins `RUBYOPT=-Ku`.
#   (1) every tracked live shell script (skills/, hooks/, scripts/) and every
#       Makefile target that invokes ruby carries the pin, and no other literal RUBYOPT mention drops it; the
#       classifier is held by pinned bypass and near-miss rows; frozen evidence
#       under specs/ and eval/ is exempt;
#   (2) validate-skill.sh passes on a UTF-8 fixture under LC_ALL=C;
#   (3) the same run with the pin deleted goes red for the encoding reason, which
#       shows the pin is what makes leg (2) pass; on a host whose C locale already
#       reads UTF-8 the pin is not load-bearing and leg (3) reports unevaluated.
set -euo pipefail
# Ruby takes its encoding from the locale; under a POSIX/unset locale it reads the UTF-8 skill text as US-ASCII and crashes. Pin UTF-8, as CI runs.
case " ${RUBYOPT:-} " in *" -Ku "*) ;; *) export RUBYOPT="-Ku${RUBYOPT:+ $RUBYOPT}" ;; esac

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd -P)"
PIN='case " ${RUBYOPT:-} " in *" -Ku "*) ;; *) export RUBYOPT="-Ku${RUBYOPT:+ $RUBYOPT}" ;; esac'
fail() { printf 'FAIL: %b\n' "$*" >&2; exit 1; }

# Closed contract over the idiom this repo owns: a RUBYOPT mention keeps the pin
# only as the pin line itself, the keep idiom RUBYOPT="${RUBYOPT:+$RUBYOPT }..."
# whose suffix holds only `-r<lib>` requires or variables, or an empty RUBYOPT=
# before `bash "$script"` (that script pins itself). Any other literal mention -
# replacing, clearing, unset, env -u, any other Ruby option - drops the pin.
# Ruby's option names are not this repo's to enumerate, so the suffix is
# allowlisted, never denylisted. Returns 0 when allowed.
KEEP_TOKEN='(-r[^[:space:]"\\]+|[$][{]?[A-Za-z_0-9]+[}]?)'
pin_kept() {
  local line="$1" rest
  [ "$line" = "$PIN" ] && return 0
  # An attribute builtin on the variable can unexport or rescope it even when
  # the value is the keep idiom.
  if printf '%s\n' "$line" | grep -qE '(^|[[:space:];&|({])(declare|typeset|local|readonly|export[[:space:]]+-n)([[:space:]]|$)[^;|&]*RUBYOPT'; then
    return 1
  fi
  rest="$(printf '%s\n' "$line" | sed -E \
    -e "s/^([^\"'\\\\]*)[[:space:]]#.*\$/\\1/" \
    -e "s/RUBYOPT=\"[\$][{]RUBYOPT:[+][\$]RUBYOPT [}](${KEEP_TOKEN}([[:space:]]+${KEEP_TOKEN})*)?\"//g" \
    -e 's/(^|[[:space:]])RUBYOPT=[[:space:]]+bash[[:space:]]+"[$][A-Za-z_{][^"]*"/\1/g')"
  case "$rest" in *RUBYOPT*) return 1 ;; esac
  return 0
}

# Every RUBYOPT line of one file that drops the pin, as "N:line". Whole-line
# comments are skipped; nothing else is pre-filtered, so a line that merely
# contains the pin text is still classified.
pin_drops() {
  local hit
  while IFS= read -r hit; do
    pin_kept "${hit#*:}" || printf '%s\n' "$hit"
  done < <(grep -nE 'RUBYOPT' "$1" | grep -vE '^[0-9]+:[[:space:]]*#' || true)
}

# (1a) The classifier itself: every bypass row must be flagged and every
# near-miss row must stay allowed, so a broken classifier cannot pass on a
# corpus that happens to hold only allowed shapes.
while IFS= read -r row; do
  [ -n "$row" ] || continue
  if pin_kept "$row"; then fail "classifier allowed a pin-dropping line: $row"; fi
done <<'ROWS'
RUBYOPT="-r$SHIM" ruby x.rb
RUBYOPT= ruby -e "p 1"
unset RUBYOPT
env -u RUBYOPT ruby -e 1
RUBYOPT="$RUBYOPT_EXTRA -rfoo" ruby -e 1
export RUBYOPT=
RUBYOPT=
RUBYOPT= LC_ALL=C ruby -e 1
LC_ALL=C RUBYOPT= LANG=C ruby -e 1
RUBYOPT= exec ruby -e 1
RUBYOPT= "${RUBY:-ruby}" -e 1
RUBYOPT= bash -c "ruby -e 1"
unset -v RUBYOPT
unset LANG RUBYOPT
env --unset=RUBYOPT ruby -e 1
env -uRUBYOPT ruby -e 1
RUBYOPT=-W0 ruby -e 1 "$RUBYOPT"
RUBYOPT="${RUBYOPT#-Ku}" ruby -e 1
RUBYOPT="" bash x.sh
export RUBYOPT=-W0
echo "a #b"; RUBYOPT=-Kn ruby -e 1
printf ' #' ; unset RUBYOPT
case " ${RUBYOPT:-} " in *" -Ku "*) ;; *) export RUBYOPT="-Ku${RUBYOPT:+ $RUBYOPT}" ;; esac; unset RUBYOPT
RUBYOPT="${RUBYOPT:+$RUBYOPT }-Kn" ruby x.rb
RUBYOPT="${RUBYOPT:+$RUBYOPT }-E ASCII" ruby x.rb
RUBYOPT="${RUBYOPT:+$RUBYOPT }--internal-encoding=US-ASCII" ruby x.rb
RUBYOPT="${RUBYOPT:+$RUBYOPT }--disable=rubyopt" ruby x.rb
RUBYOPT="${RUBYOPT:+$RUBYOPT }-r\" -Kn" ruby x.rb
export -n RUBYOPT="${RUBYOPT:+$RUBYOPT }-rdate"
declare +x RUBYOPT="${RUBYOPT:+$RUBYOPT }"
local RUBYOPT="${RUBYOPT:+$RUBYOPT }-rdate"
readonly RUBYOPT="${RUBYOPT:+$RUBYOPT }-rdate"
typeset -x RUBYOPT="${RUBYOPT:+$RUBYOPT }-rdate"
RUBYOPT="${RUBYOPT:+$RUBYOPT_EXTRA }" ruby x.rb
RUBYOPT="${RUBYOPT:+$RUBYOPT}-Kn" ruby x.rb
x=$#; unset RUBYOPT
echo a\ #b; unset RUBYOPT
local RUBYOPT
declare -x RUBYOPT=
ROWS
while IFS= read -r row; do
  [ -n "$row" ] || continue
  pin_kept "$row" || fail "classifier flagged an allowed line: $row"
done <<'ROWS'
out="$(RUBYOPT="${RUBYOPT:+$RUBYOPT }-rdate" ruby x.rb)"
env -u X LC_ALL=C RUBYOPT= bash "$SIZE_SCRIPT" "$REPO"
f() { # takes a RUBYOPT value
RUBYOPT= bash "$x"; ruby -e 1
RUBYOPT="${RUBYOPT:+$RUBYOPT }-r$SHIM -rdate" ruby x.rb
RUBYOPT="${RUBYOPT:+$RUBYOPT }$2" ruby "$1"
run_gate() { # <gate-path> <RUBYOPT value or empty>
locale=C RUBYOPT= bash "$x"
dir=/usr/local RUBYOPT="${RUBYOPT:+$RUBYOPT }-rdate" ruby x.rb
declared=1 RUBYOPT= bash "$s"
ROWS

# (1b) Static coverage over tracked live shell scripts.
tracked="$(git -C "$ROOT" ls-files -- 'skills/*.sh' 'hooks/*.sh' 'scripts/*.sh')" \
  || fail "cannot list tracked scripts (not a git checkout?); leg 1 needs git ls-files"
[ -n "$tracked" ] || fail "git ls-files listed no tracked scripts under $ROOT; leg 1 would pass vacuously"
missing=""
dropped=""
while IFS= read -r rel; do
  # A bare `ruby` word: catches `ruby -e`, `ruby<<`, `ruby;`, `${RUBY:-ruby}`;
  # leaves `rubygems` / `ruby-build` alone. Over-matching only over-requires the pin.
  grep -qE '(^|[^a-z_])ruby([^a-z0-9_.-]|$)' "$ROOT/$rel" || continue
  grep -qxF "$PIN" "$ROOT/$rel" || missing="$missing\n  $rel"
  # This file names RUBYOPT in its own patterns and rows, so only its pin is checked.
  [ "$rel" = "skills/skill-extraction-workflow/scripts/test_locale_independent_gates.sh" ] && continue
  while IFS= read -r hit; do
    [ -n "$hit" ] && dropped="$dropped\n  $rel: $hit"
  done < <(pin_drops "$ROOT/$rel")
done <<<"$tracked"
# Makefile targets that run ruby in a recipe must be on the target-specific
# RUBYOPT pin line. A rule line names every target before its first colon
# (`a b: deps`); `X := y` assignments and the pin line itself are not rules.
mk_pinned_of() { sed -nE 's/^([^#:]*):[[:space:]]*override RUBYOPT :=.*-Ku.*$/\1/p' "$1"; }
mk_ruby_of() {
  awk '
    /^\t/ { if ($0 ~ /(^|[^a-z_])ruby([^a-z0-9_.-]|$)/) for (i in cur) print cur[i]; next }
    /^[^#[:space:]]/ {
      c = index($0, ":"); if (c == 0) next
      head = substr($0, 1, c - 1)
      if (substr($0, c + 1, 1) == "=" || head ~ /=/) next
      if ($0 ~ /RUBYOPT :=/) next
      split("", cur); n = split(head, names, /[[:space:]]+/)
      for (i = 1; i <= n; i++) if (names[i] != "") cur[i] = names[i]
    }' "$1" | sort -u
}
mk_missing_of() { # <Makefile>: ruby-running targets absent from the pin line
  local pinned t
  grep -qxF 'export RUBYOPT' "$1" || { echo "(RUBYOPT is not exported)"; return; }
  pinned="$(mk_pinned_of "$1")"
  [ -n "$pinned" ] || { echo "(no target-specific RUBYOPT -Ku pin line)"; return; }
  for t in $(mk_ruby_of "$1"); do
    case " $pinned " in *" $t "*) ;; *) echo "$t" ;; esac
  done
}
[ -n "$(mk_ruby_of "$ROOT/Makefile")" ] || fail "found no Makefile recipe that runs ruby; the Makefile check would pass vacuously"
for t in $(mk_missing_of "$ROOT/Makefile"); do missing="$missing\n  Makefile target $t"; done
# The tracker itself, on a fixture: a multi-target ruby rule after a pinned one
# must be reported under its own names, and an assignment line must not reset it.
mk_fx="$(mktemp "${TMPDIR:-/tmp}/locale-mk.XXXXXX")"
printf 'X := 1\nexport RUBYOPT\np1 p2: override RUBYOPT := -Ku\np1:\n\truby a.rb\nnew-a new-b: dep\n\t@ruby b.rb\nY := 2\n\techo no\n' >"$mk_fx"
mk_fx_out="$(mk_missing_of "$mk_fx" | tr '\n' ' ')"
rm -f "$mk_fx"
[ "$mk_fx_out" = "new-a new-b " ] || fail "Makefile tracker must report exactly new-a new-b on its fixture, got: $mk_fx_out"
[ -z "$missing" ] || fail "ruby-invoking scripts without the RUBYOPT UTF-8 pin:$missing"
[ -z "$dropped" ] || fail "RUBYOPT mentions that drop the UTF-8 pin (use the keep idiom):$dropped"

TMP="$(mktemp -d "${TMPDIR:-/tmp}/locale-gates.XXXXXX")"
trap 'rm -rf "$TMP"' EXIT

# Exercise the actual Makefile declarations using inert recipes. In particular,
# command-line RUBYOPT must not override the UTF-8 pin. Replacing just the recipes
# keeps live evals offline and preserves Make's assignment/export semantics.
make_targets="$(mk_ruby_of "$ROOT/Makefile" | tr '\n' ' ')"
printf '%s:\n' "$make_targets" >"$TMP/probe.mk"
printf '\t@ruby -e '\''abort "make recipe lost UTF-8" unless Encoding.default_external == Encoding::UTF_8; abort "make recipe lost caller option" if ENV["CCL_MAKE_CALLER_OPTION"] == "yes" && !ENV.fetch("RUBYOPT").split.include?("-W0")'\''\n' >>"$TMP/probe.mk"
run_make_pin() {
  local makefile="$1"
  shift
  env -u LANGUAGE -u RUBYOPT LC_ALL=C LANG=C make --no-print-directory \
    -f "$makefile" -f "$TMP/probe.mk" "$@" $make_targets
}
if ! make_out="$(run_make_pin "$ROOT/Makefile" RUBYOPT=-W0 CCL_MAKE_CALLER_OPTION=yes 2>&1)"; then
  fail "Makefile Ruby targets failed under LC_ALL=C with CLI RUBYOPT:\n$make_out"
fi
if ! make_out="$(run_make_pin "$ROOT/Makefile" 2>&1)"; then
  fail "Makefile Ruby targets failed with RUBYOPT absent:\n$make_out"
fi
# Applied mutations prove both declarations matter at runtime, as well as in
# the static tracker. CLI variables are auto-exported by Make, so the export
# mutation must run without the CLI override to avoid masking a missing export.
sed 's/: override RUBYOPT :=/: RUBYOPT :=/' "$ROOT/Makefile" >"$TMP/no-override.mk"
sed '/^export RUBYOPT$/d' "$ROOT/Makefile" >"$TMP/no-export.mk"
for mutant in no-override no-export; do
  cmp -s "$ROOT/Makefile" "$TMP/$mutant.mk" && fail "$mutant mutation was not applied"
  [ -n "$(mk_missing_of "$TMP/$mutant.mk")" ] || fail "Makefile tracker accepted $mutant mutation"
  make_args=()
  [ "$mutant" != no-override ] || make_args=(RUBYOPT=-W0)
  # Bash 3.2 treats an empty array as unset under nounset.
  if make_out="$(run_make_pin "$TMP/$mutant.mk" ${make_args[@]+"${make_args[@]}"} 2>&1)"; then
    fail "Makefile $mutant mutation still passed the UTF-8 assertion"
  fi
  case "$make_out" in *'make recipe lost UTF-8'*) : ;; *) fail "$mutant failed for an unrelated reason:\n$make_out" ;; esac
done

# (1c) The scan as a whole, on a fixture file: only a line that drops the pin is
# reported, including one that also contains the pin text.
{
  printf '%s\n' "$PIN"
  printf '%s; unset RUBYOPT\n' "$PIN"
  printf '# unset RUBYOPT in a comment\n'
  printf 'out="$(RUBYOPT="${RUBYOPT:+$RUBYOPT }-rdate" ruby x.rb)"\n'
} >"$TMP/scan-fixture.sh"
scan_out="$(pin_drops "$TMP/scan-fixture.sh")"
[ "${scan_out%%:*}" = "2" ] && [ "$(printf '%s\n' "$scan_out" | grep -c .)" = "1" ] \
  || fail "pin_drops must report only line 2 of the scan fixture, got:\n$scan_out"
mkdir -p "$TMP/skill/references"
cat >"$TMP/skill/SKILL.md" <<'EOF'
---
name: locale-fixture
description: 合成夹具 — synthetic fixture for locale independence.
---

# 夹具

见 `references/detail.md`。
EOF
printf '# 细节\n\n中文正文。\n' >"$TMP/skill/references/detail.md"

run_c_locale() { env -u LANGUAGE LC_ALL=C LANG=C RUBYOPT= bash "$1" "$TMP/skill"; }

# (2) The shipped gate passes under the C locale.
if ! out="$(run_c_locale "$SCRIPT_DIR/validate-skill.sh" 2>&1)"; then
  fail "validate-skill.sh failed under LC_ALL=C:\n$out"
fi
case "$out" in *markdown_references_ok*) : ;; *) fail "validate-skill.sh did not reach the reference check under LC_ALL=C:\n$out" ;; esac

# (3) Applied mutation: the same script without the pin reds for the encoding reason.
cp -R "$SCRIPT_DIR" "$TMP/scripts"
grep -vxF "$PIN" "$SCRIPT_DIR/validate-skill.sh" >"$TMP/scripts/validate-skill.sh"
if mout="$(run_c_locale "$TMP/scripts/validate-skill.sh" 2>&1)"; then
  # Unevaluated only when the host itself explains the pass: Ruby already reads
  # UTF-8 under the C locale, so the pin is not load-bearing here. Any other
  # reason the unpinned run passed means leg 2 may be vacuous.
  if ! env -u LANGUAGE LC_ALL=C LANG=C ruby -e 'exit(Encoding.find("locale") == Encoding::UTF_8 ? 0 : 1)'; then
    fail "pin removed, yet validate-skill.sh still passed under LC_ALL=C on a host whose Ruby reads US-ASCII there, so leg 2 proves nothing:\n$mout"
  fi
  echo "test_locale_independent_gates_leg3_unevaluated: this host's Ruby reads UTF-8 under LC_ALL=C, so removing the pin cannot be shown to matter here" >&2
  echo "test_locale_independent_gates: ok (legs 1-2; leg 3 unevaluated on this host)"
  exit 0
fi
case "$mout" in
  *"invalid byte sequence"*|*"invalid multibyte char"*) : ;;
  *) fail "pin removed: run failed, but not for the encoding reason:\n$mout" ;;
esac

echo "test_locale_independent_gates: ok"
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall