sweep-flag-namespace
정보
이 스킬은 바이너리의 네임스페이스를 철저히 탐색하여 모든 기능 플래그를 목록화하고, 사용 유형별로 분류하며, 기록된 세트 대비 완전성을 추적합니다. 캠페인 종료 조건 검증과 같이 샘플링이 아닌 완전한 열거가 필요한 시나리오를 위해 설계되었습니다. DEFAULT-TRUE 그룹을 포함한 검증 가능한 완전한 플래그 목록이 필요할 때, `probe-feature-flag-state`의 상류에서 사용하십시오.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/sweep-flag-namespaceClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Sweep Flag Namespace
盡取二進制名空間中之每一旗候,分 gate 調用與 telemetry,與運行之已錄集校之,至未錄之餘歸零。probe-feature-flag-state 一旗一辨;此技則生其所據之錄,並驗其周備。
用時
- 旗探campaign行至中途,需可驗之停止條件,而非揣度旗已「足」否
- 二進制旗名空間甚大(候字數百),抽樣易漏要 gate
- 須將 DEFAULT-TRUE 與 DEFAULT-FALSE 分報——前者乃任名空間中信號最強之子集
- 多波文檔同行於一二進制,欲書之每波之周備度
- 疑前番campaign過早而止,欲以新掃確或駁之
入
- 必要:可讀之二進制或 bundle 文件
- 必要:名空間前綴(合成例:
acme_*),辨識所究系統之旗 - 必要:運行之文檔集——campaign 已書之旗錄
- 可選:gate-reader 函數名(合成:
gate(...)、flag(...)、isEnabled(...)),預備則速第二步 - 可選:telemetry/emit 函數名,同理而反向
- 可選:此二進制前版之掃出,以行差別析
法
Step 1: Harvest All Strings Matching the Namespace Prefix
取二進制中合於前綴之每一字面,不論調用點之角色。此步求覆,非求類。
BUNDLE=/path/to/cli/bundle.js
PREFIX=acme_ # synthetic placeholder
# Pull every quoted string starting with the prefix
grep -oE "\"${PREFIX}[a-zA-Z0-9_]+\"" "$BUNDLE" | sort -u > /tmp/sweep-candidates.txt
wc -l /tmp/sweep-candidates.txt # unique candidate count
# Per-string occurrence count (gives a first hint at gate-call density)
grep -oE "\"${PREFIX}[a-zA-Z0-9_]+\"" "$BUNDLE" | sort | uniq -c | sort -rn > /tmp/sweep-occurrences.txt
head /tmp/sweep-occurrences.txt
得:去重之候列,及按頻排之出現檔。次數甚高(≥10)者疑 gate 密;單次者多為 telemetry 事件名或靜態標籤。
敗則:若獨字數為零,前綴有誤(誤字、名空間界不合、調用約定異於所料)。若逾五千,前綴過寬——宜先收緊,否則簿冊不可治。
Step 2: Disambiguate Gate Calls from Telemetry from Static Labels
同字異役。於調用點辨其役,乃簿冊可施行之由。沿用 probe-feature-flag-state 第二步之辨法。
每候之每次出現,類之:
- gate-call——字為 gate-reader 函數之首參(
gate("$FLAG", default)、flag("$FLAG", ...)、isEnabled("$FLAG")等) - telemetry-call——字為 emit/log/track 函數之首參
- env-var-check——字現於
process.env.X查或同類 - static-label——字現於登錄表、map 或注釋中,無行為之繫
# Count gate-call occurrences for the candidate set, using a synthetic
# reader-name pattern. Adapt the regex to the actual reader names found.
GATE_PATTERN='(gate|flag|isEnabled)\(\s*"acme_'
grep -coE "$GATE_PATTERN" "$BUNDLE"
# Per-flag gate-call count
while read -r flag; do
flag_no_quotes="${flag//\"/}"
count=$(grep -coE "(gate|flag|isEnabled)\(\s*\"${flag_no_quotes}\"" "$BUNDLE")
echo -e "${flag_no_quotes}\t${count}"
done < /tmp/sweep-candidates.txt > /tmp/sweep-gate-counts.tsv
得:每獨字一錄,形如 {flag, total_occurrences, gate_call_count, telemetry_count, static_label_count, env_var_count}。gate-call 計乃可施行之欄;餘為噪濾。
敗則:若每候之 gate-call 皆零,gate-reader 之式有誤。或二進制用此正則所漏之 reader 函數,或此名空間純為 telemetry(非旗名空間)。先以 decode-minified-js-gates 試數候,得實際 reader 名再重行此步。
Step 3: Build the Extraction Inventory
合每字之錄為一簿冊。CSV 或 JSONL——擇一而恆守,以利波次之差別。
# JSONL inventory
{
while IFS=$'\t' read -r flag gate_count; do
[ "$gate_count" -gt 0 ] || continue # skip strings with no gate-call evidence
total=$(grep -c "\"${flag}\"" "$BUNDLE")
telem=$((total - gate_count)) # rough; refine if other call types matter
printf '{"flag":"%s","total":%d,"gate_calls":%d,"telemetry":%d,"documented":false}\n' \
"$flag" "$total" "$gate_count" "$telem"
done < /tmp/sweep-gate-counts.tsv
} > /tmp/sweep-inventory.jsonl
wc -l /tmp/sweep-inventory.jsonl # gate-bearing flag count
二導出之計要焉:
total_unique:前綴所合之每字(gate 濾前)gate_calls:至少一次 gate-call 之子集——此為 campaign 之工作集
得:每獨之 gate-bearing 旗一錄之檔。gate 計常為 total_unique 之一分(多為 5–20%),二數宜顯異。
敗則:若簿冊空,或 gate_calls ≈ total_unique,第二步之 gate-vs-telemetry 辨產無意義之分。重審 reader-name 正則。
Step 4: Cross-Reference Against the Documented Set
周備之度賴於文檔集——campaign 於研究檔中已書之旗。校之而報其餘。
DOCUMENTED=/path/to/research/documented-flags.txt # one flag name per line
# Extract gate-bearing flag names from the inventory
jq -r '.flag' /tmp/sweep-inventory.jsonl | sort -u > /tmp/sweep-extracted.txt
# Compute the documented and remaining sets
sort -u "$DOCUMENTED" > /tmp/sweep-documented.txt
comm -23 /tmp/sweep-extracted.txt /tmp/sweep-documented.txt > /tmp/sweep-remaining.txt
echo "Extracted (gate-bearing): $(wc -l < /tmp/sweep-extracted.txt)"
echo "Documented: $(wc -l < /tmp/sweep-documented.txt)"
echo "Remaining (undocumented): $(wc -l < /tmp/sweep-remaining.txt)"
周備之度乃 remaining——歸零則文檔集已盡覆名空間中所有 gate-bearing 旗。
得:三計。campaign 初,remaining 宜為 extracted 之大分。每波削之至零。觀其軌跡以察停滯(一波反覆查已錄之旗)。
敗則:若 documented 逾 extracted,則文檔集含陳舊之條(此版已去之旗)。改用 comm -13 以顯廢名;下波檔中標為 REMOVED 而存之。
Step 5: Report the DEFAULT-TRUE Population
於 gate-bearing 旗集中,分二進制默認為 true 與默認為 false(或非 boolean)者。DEFAULT-TRUE 旗於所有用者皆開而無服務器側之蓋,乃最高信號之子集。
# Heuristic: gate-call shape `gate("flag_name", true)` indicates DEFAULT-TRUE
DEFAULT_TRUE_PATTERN='(gate|flag|isEnabled)\(\s*"acme_[a-zA-Z0-9_]+",\s*!?true\b'
grep -oE "$DEFAULT_TRUE_PATTERN" "$BUNDLE" | grep -oE '"acme_[a-zA-Z0-9_]+"' | sort -u > /tmp/sweep-default-true.txt
DEFAULT_FALSE_PATTERN='(gate|flag|isEnabled)\(\s*"acme_[a-zA-Z0-9_]+",\s*false\b'
grep -oE "$DEFAULT_FALSE_PATTERN" "$BUNDLE" | grep -oE '"acme_[a-zA-Z0-9_]+"' | sort -u > /tmp/sweep-default-false.txt
echo "DEFAULT-TRUE: $(wc -l < /tmp/sweep-default-true.txt)"
echo "DEFAULT-FALSE: $(wc -l < /tmp/sweep-default-false.txt)"
旗之默認非 boolean 者(config 對象、TTL reader、async reader),以 decode-minified-js-gates 類其 reader 之變——其默認形異,宜別桶報之。
得:常分 10–20% DEFAULT-TRUE,80–90% DEFAULT-FALSE。極端者(≥90% TRUE 或 ≥90% FALSE)異常而宜察——或示某發布期之約(試驗皆默認開、分批推時皆默認關)。
敗則:若 DEFAULT-TRUE 與 DEFAULT-FALSE 之合不覆 gate-bearing 簿冊,餘者用非 boolean reader。以 decode-minified-js-gates 對其缺處類之。
Step 6: Confirm Completion
第四步 remaining = 0 時,行終掃:尋名空間相合之字之 gate-call 出現,而不在文檔集中者。此可獲第一步漏採之旗(如字串拼接藏其字面,逃簡易 grep)。
# Search for gate-call shapes containing the namespace prefix, not constrained
# to literal-string occurrences. Loosens Step 1's grep to catch dynamic forms.
DYNAMIC_PATTERN='(gate|flag|isEnabled)\(\s*[^"]*"acme_'
grep -nE "$DYNAMIC_PATTERN" "$BUNDLE" | head -50
# Alternative: ripgrep with multiline for split-string concatenation
rg -U "(gate|flag|isEnabled)\(\s*\"acme_(\\\\\"|[a-zA-Z0-9_])+\"" "$BUNDLE"
以 gate-call 之得校 /tmp/sweep-documented.txt。若有合於文檔集外之旗,回第一步以精提取(如治動態構造)。空則 campaign 周備矣。
得:終掃返空(campaign 周備)或返微餘(常 <5 旗,多為動態構造或別 reader)。
敗則:若第四步稱 remaining = 0 而終掃返大餘,則第一步系統性失採。察所漏之式(動態字、異引號、別 reader 函數),以更緊之正則自第一步重行之。
驗
- 第一步獨字數非零,且於預期之數量級內
- 第二步生有意義之 gate-vs-telemetry 分(gate-call 數為一分,非全有或全無)
- 第三步簿冊每 gate-bearing 旗一錄,CSV 或 JSONL
- 第四步報
total_unique、gate_calls、documented、remaining——其度於 campaign 終時歸零 - 第五步 DEFAULT-TRUE 與 DEFAULT-FALSE 別報之
- 第六步終掃返空乃稱 campaign 周備
- 一切例皆用合成之 placeholder(
acme_*、gate(...)等),無實旗名或 reader 名漏入檔 - sweep 之出可與前版之 sweep 相差(同形同欄)
陷
- 止於樣,非掃:campaign 至「已錄足旗」而止,未算
remaining,乃抽樣非掃。此技之要在可驗之終止條件 - 混 gate-bearing 與全提取:名空間中多字非 gate。以
total_unique為 campaign 分母,膨其工而抑其表觀完成率。當以gate_calls為分母 - 跨版恃單一正則:gate-reader 函數名於主版間或變。掃新二進制始時宜重驗第二步之式
- 跳第六步:未行終動態掃即稱
remaining = 0達周備,可漏字串拼接之旗。終掃廉而捕窘 - 漏實名:易誤將實旗名自簿冊貼入此技之例。
acme_*placeholder 之律有由——法與所獲宜分 - 以陳舊文檔集行校:若文檔集建於舊二進制,已去之旗顯為「已錄」而非提取,真未錄者顯為餘。先以當前二進制刷新文檔集再校
參
probe-feature-flag-state——一旗一類(此技簿冊之下游)decode-minified-js-gates——掃中需 reader-變類時用之monitor-binary-version-baselines——版間之長時跟蹤;每基線可重掃redact-for-public-disclosure——如何發掃法而不漏簿冊本身conduct-empirical-wire-capture——以實驗驗 sweep 所揭之旗
GitHub 저장소
연관 스킬
llamaguard
기타LlamaGuard는 폭력 및 혐오 발언 등 6가지 안전 범주에서 LLM 입력과 출력을 조정하기 위한 Meta의 70-80억 파라미터 모델입니다. 94-95% 정확도를 제공하며 vLLM, Hugging Face 또는 Amazon SageMaker를 사용해 배포할 수 있습니다. 이 기술을 사용하여 AI 애플리케이션에 콘텐츠 필터링 및 안전 가드레일을 손쉽게 통합하세요.
cost-optimization
기타이 Claude Skill은 리소스 적정화, 태깅 전략, 지출 분석을 통해 개발자들이 클라우드 비용을 최적화할 수 있도록 지원합니다. AWS, Azure, GCP에서 클라우드 비용을 절감하고 비용 거버넌스를 구현하기 위한 프레임워크를 제공합니다. 인프라 비용을 분석하거나, 리소스를 적정화하거나, 예산 제약을 충족해야 할 때 사용하세요.
quantizing-models-bitsandbytes
기타이 스킬은 bitsandbytes를 사용하여 LLM을 8비트 또는 4비트 정밀도로 양자화하며, 최소한의 정확도 손실로 50-75%의 메모리 감소를 달성합니다. 제한된 GPU 메모리에서 더 큰 모델을 실행하거나 추론을 가속화하는 데 이상적이며, INT8, NF4, FP4와 같은 형식을 지원합니다. 이 스킬은 HuggingFace Transformers와 통합되어 QLoRA 학습 및 8비트 옵티마이저를 가능하게 합니다.
dispatching-parallel-agents
기타이 Claude Skill은 3개 이상의 독립적인 문제를 동시에 조사하고 해결하기 위해 다중 에이전트를 배치합니다. 공유 상태나 의존성 없이 해결 가능한 무관련 장애 시나리오에 맞게 설계되었습니다. 핵심 기능은 병렬 문제 해결로, 각 독립 문제 영역마다 하나의 에이전트를 할당하여 효율성을 극대화합니다.
