diff --git a/.env b/.env new file mode 100644 index 0000000..74e7cc2 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +TOKEN="578edf8a8328fb37d6c32f56eb1450622db3492a" \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c269e49 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "chatgpt.openOnStartup": false +} \ No newline at end of file diff --git a/README.md b/README.md index 7efc62f..e3a2066 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,102 @@ -# 状況とか条件を書く +# AI-ART Repository Policy (Mandatory) -task_templateを参照すして作業を進めて下さい +This document defines **mandatory constraints and policies**. +All executions, generations, and outputs **MUST strictly comply** +with this document. + +Failure to comply invalidates the output. + +--- + +## 1. Role Definition + +You are an **AI execution engine** operating on this repository. + +- This repository is treated as an **execution context** +- Human-like interpretation, improvisation, or assumption is prohibited +- Follow instructions **exactly as written** + +--- + +## 2. Execution Order (Strict) + +You MUST process files in the following order: + +1. README.md + → Defines **global policies and constraints** +2. prompts/task_template.md + → Defines **executable instructions** +3. images_dir (if referenced) + → Reference-only assets + +No reordering is allowed. + +--- + +## 3. Authority Hierarchy + +If instructions conflict, obey the following priority: + +1. README.md (highest authority) +2. task_template.md +3. Inline assumptions (lowest, discouraged) + +README.md always overrides other instructions. + +--- + +## 4. Output Scope + +You may ONLY output what is explicitly requested +by `task_template.md`. + +- No explanations +- No commentary +- No meta discussion +- No additional suggestions + +--- + +## 5. Prohibited Content + +The following are strictly forbidden: + +- NSFW or sexualized content +- Excessive violence or gore +- Direct imitation of copyrighted characters +- Trademarked designs copied verbatim +- Political or religious messaging (unless explicitly requested) + +--- + +## 6. Style & Interpretation Rules + +- Interpret instructions **literally** +- Do NOT extrapolate missing details +- If information is missing: + - Use the **minimum neutral interpretation** + - Do NOT invent lore, backstory, or settings + +--- + +## 7. Image Reference Rules + +If `images_dir` is referenced: + +- Treat all files as **optional reference material** +- Ignore system files (e.g. `.DS_Store`) +- Do NOT infer content from filenames alone +- Use images ONLY if explicitly instructed + +--- + +## 8. Determinism Requirement + +Outputs must be: + +- Reproducible +- Deterministic +- Stable across executions given the same inputs + +Creative variance is allowed **only when explicitly permitted** +in `task_template diff --git a/make-json.sh b/make-json.sh old mode 100644 new mode 100755 index d3d65e3..2c37aed --- a/make-json.sh +++ b/make-json.sh @@ -1,24 +1,29 @@ + #!/usr/bin/env bash +set -euo pipefail -TOKEN="578edf8a8328fb37d6c32f56eb1450622db3492a" -BASE="https://git.sunamura-llc.com" -OWNER="openRepo" -REPO="AI-ART" -BRANCH="main" +ROOT_DIR="$(cd "$(dirname "$0")" && pwd)" +SCHEMA="$ROOT_DIR/schema/prompt.schema.json" +OUT_DIR="$ROOT_DIR/output" +OUT_JSON="$OUT_DIR/prompt.json" -OUT="manifest.json" +mkdir -p "$OUT_DIR" -images_json=$(curl -s \ - -H "Authorization: token ${TOKEN}" \ - "${BASE}/api/v1/repos/${OWNER}/${REPO}/contents/images") +echo "[INFO] Generating JSON via AI (paste result)..." +echo "Paste JSON below. End with Ctrl+D:" +JSON_CONTENT=$(cat) -echo "{ - \"repo\": \"${OWNER}/${REPO}\", - \"branch\": \"${BRANCH}\", - \"readme\": \"${BASE}/${OWNER}/${REPO}/raw/branch/${BRANCH}/README.md\", - \"task_template\": \"${BASE}/${OWNER}/${REPO}/raw/branch/${BRANCH}/prompts/task_template.md\", - \"rules\": \"${BASE}/${OWNER}/${REPO}/raw/branch/${BRANCH}/.cursorrules\", - \"images\": $(echo "$images_json" | jq '[.[] | {name: .name, url: .download_url}]') -}" > "${OUT}" +echo "$JSON_CONTENT" > "$OUT_JSON" -echo "✔ manifest.json generated" +echo "[INFO] Validating JSON schema..." + +if ! command -v ajv >/dev/null 2>&1; then + echo "[ERROR] ajv not found. Install with:" + echo " npm install -g ajv-cli" + exit 1 +fi + +ajv validate -s "$SCHEMA" -d "$OUT_JSON" --strict=true + +echo "[OK] JSON is valid and schema-compliant." +echo "[DONE] Output saved to: $OUT_JSON" diff --git a/manifest.json b/manifest.json index 9afdf5e..33cbf7d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,3 +1,4 @@ + { "repo": "openRepo/AI-ART", "branch": "main", diff --git a/note b/note new file mode 100644 index 0000000..6556519 --- /dev/null +++ b/note @@ -0,0 +1,44 @@ +法:constraints +省令:styles / scenes +執行:task +実行入口:manifest.json +という 完全制御体系が完成。 + +task_type 別・設計意図(人間向けメモ) + +これは README か docs/ に書く用。 +今後の自分・他人のため。 + +character_full_body + +キャラ台帳 + +三面図 + +設定資料 + +scene_composition + +背景 + +世界観カット + +ビジュアルテスト + +em_design + +道具 + +装備(※ weapon でない) + +プロダクト的デザイン + +prop_design + +小物 + +UI 部品 + +世界観を壊さない補助物 + +④ make-json.sh は変更不要 \ No newline at end of file diff --git a/promote-manifest.sh b/promote-manifest.sh new file mode 100644 index 0000000..c559981 --- /dev/null +++ b/promote-manifest.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROMPT_JSON="$ROOT_DIR/output/prompt.json" +MANIFEST_JSON="$ROOT_DIR/manifest.json" + +if [ ! -f "$PROMPT_JSON" ]; then + echo "[ERROR] prompt.json not found." + exit 1 +fi + +if ! command -v jq >/dev/null 2>&1; then + echo "[ERROR] jq not found. Install jq first." + exit 1 +fi + +WORLD_ID=$(jq -r '.meta.world_id' "$PROMPT_JSON") +WORLD_VERSION=$(jq -r '.meta.world_version' "$PROMPT_JSON") +STYLE_ID=$(jq -r '.meta.style_id' "$PROMPT_JSON") +SCENE_ID=$(jq -r '.meta.scene_id' "$PROMPT_JSON") +TASK_TYPE=$(jq -r '.meta.task_type' "$PROMPT_JSON") + +if [[ "$WORLD_ID" == "null" || "$STYLE_ID" == "null" || "$TASK_TYPE" == "null" ]]; then + echo "[ERROR] Invalid meta fields in prompt.json" + exit 1 +fi + +cat > "$MANIFEST_JSON" <