commit 9
This commit is contained in:
10
script/fix_and_explain_strudel.sh
Normal file → Executable file
10
script/fix_and_explain_strudel.sh
Normal file → Executable file
@@ -4,6 +4,8 @@
|
||||
BASE_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
||||
OUTPUT_DIR="$BASE_DIR/explained"
|
||||
SKILL_FILE="$BASE_DIR/.gemini/skills/strudel_fix_and_explain.md"
|
||||
GEMINI_REF="$BASE_DIR/.gemini/gemini.md"
|
||||
STRUDEL_REF="$BASE_DIR/.gemini/reference.md"
|
||||
|
||||
# 出力先フォルダの作成
|
||||
if [ ! -f "$SKILL_FILE" ]; then
|
||||
@@ -29,13 +31,17 @@ for file in "${files[@]}"; do
|
||||
filename=$(basename "$file")
|
||||
# 特定のファイルやディレクトリを除外
|
||||
[[ "$filename" =~ ^(Strudel Making Sound|Strudel Study)\.md$ ]] && continue
|
||||
[[ "$file" =~ /(refactoring|script|explained|organized_strudel)/ ]] && continue
|
||||
[[ "$file" =~ /(refactoring|script|explained)/ ]] && continue
|
||||
|
||||
echo "Analyzing and fixing $filename..."
|
||||
|
||||
# 一時ファイルに出力
|
||||
tmp_file="$OUTPUT_DIR/tmp_$filename"
|
||||
(cat "$SKILL_FILE"; echo ""; cat "$file") | gemini > "$tmp_file"
|
||||
|
||||
( [ -f "$GEMINI_REF" ] && cat "$GEMINI_REF"; \
|
||||
[ -f "$STRUDEL_REF" ] && cat "$STRUDEL_REF"; \
|
||||
echo ""; cat "$SKILL_FILE"; \
|
||||
echo ""; cat "$file" ) | gemini > "$tmp_file"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
# FILENAME: タグを検索
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# スクリプトの場所 (scripts/) からプロジェクトルートを動的に取得
|
||||
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
||||
BASE_DIR="$ROOT_DIR/organized_strudel"
|
||||
SOURCE_DIR="$ROOT_DIR/strudel"
|
||||
|
||||
mkdir -p "$BASE_DIR"
|
||||
|
||||
echo "Starting Strudel code categorization..."
|
||||
|
||||
for file in "$SOURCE_DIR"/*.md; do
|
||||
# ドキュメントファイル自体は除外
|
||||
[[ "$file" == *"Strudel Making Sound.md"* ]] && continue
|
||||
[[ "$file" == *"Strudel Study.md"* ]] && continue
|
||||
[[ "$file" == *"/script/"* ]] && continue
|
||||
[ -e "$file" ] || continue
|
||||
|
||||
filename=$(basename "$file")
|
||||
echo "Analyzing $filename..."
|
||||
|
||||
# gemini を使用してカテゴリを判定
|
||||
category=$( (echo "Analyze this Strudel code.
|
||||
Based on functions like s(), note(), fm(), degrade(), or effects like lpf(),
|
||||
classify this into exactly one of these categories:
|
||||
'Sampling', 'Synthesis', 'Generative', 'Ambient_FX'.
|
||||
Return only the category name as a single word."; echo ""; cat "$file") | gemini)
|
||||
|
||||
# カテゴリが取得できなかった場合のデフォルト
|
||||
if [ -z "$category" ]; then
|
||||
category="Unclassified"
|
||||
fi
|
||||
|
||||
target_path="$BASE_DIR/$category"
|
||||
mkdir -p "$target_path"
|
||||
|
||||
cp "$file" "$target_path/"
|
||||
echo "-> Moved to $category/"
|
||||
done
|
||||
12
script/refactor_strudel.sh
Normal file → Executable file
12
script/refactor_strudel.sh
Normal file → Executable file
@@ -4,6 +4,8 @@
|
||||
BASE_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
||||
REFACTOR_DIR="$BASE_DIR/refactoring"
|
||||
SKILL_FILE="$BASE_DIR/.gemini/skills/strudel_refactor.md"
|
||||
GEMINI_REF="$BASE_DIR/.gemini/gemini.md"
|
||||
STRUDEL_REF="$BASE_DIR/.gemini/reference.md"
|
||||
|
||||
# 出力先フォルダの作成
|
||||
if [ ! -f "$SKILL_FILE" ]; then
|
||||
@@ -29,13 +31,17 @@ for file in "${files[@]}"; do
|
||||
filename=$(basename "$file")
|
||||
# 特定のファイルやディレクトリを除外
|
||||
[[ "$filename" =~ ^(Strudel Making Sound|Strudel Study)\.md$ ]] && continue
|
||||
[[ "$file" =~ /(refactoring|script|explained|organized_strudel)/ ]] && continue
|
||||
[[ "$file" =~ /(refactoring|script|explained)/ ]] && continue
|
||||
|
||||
echo "Processing $filename..."
|
||||
|
||||
# スキルファイルをシステムプロンプトとして使用
|
||||
# 知識ベースとスキルファイルを組み合わせて実行
|
||||
tmp_file="$REFACTOR_DIR/tmp_$filename"
|
||||
(cat "$SKILL_FILE"; echo ""; cat "$file") | gemini > "$tmp_file"
|
||||
|
||||
( [ -f "$GEMINI_REF" ] && cat "$GEMINI_REF"; \
|
||||
[ -f "$STRUDEL_REF" ] && cat "$STRUDEL_REF"; \
|
||||
echo ""; cat "$SKILL_FILE"; \
|
||||
echo ""; cat "$file" ) | gemini > "$tmp_file"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
# 最初の数行から FILENAME: タグを検索(より柔軟な抽出)
|
||||
|
||||
Reference in New Issue
Block a user