From aaa4f7de56e432d633197513d35c81e3259e29e0 Mon Sep 17 00:00:00 2001 From: president Date: Sat, 20 Dec 2025 20:37:27 +0900 Subject: [PATCH] =?UTF-8?q?=E7=92=B0=E5=A2=83=E8=A8=AD=E5=AE=9A=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97?= =?UTF-8?q?=E3=80=81make-json.sh=E3=81=AB=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=83=8F=E3=83=B3=E3=83=89=E3=83=AA=E3=83=B3=E3=82=B0=E3=81=A8?= =?UTF-8?q?JSON=E3=82=B9=E3=82=AD=E3=83=BC=E3=83=9E=E3=81=AE=E3=83=90?= =?UTF-8?q?=E3=83=AA=E3=83=87=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=80=82=E6=96=B0=E3=81=97=E3=81=84=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88promote-manifest.sh?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E6=88=90=E3=81=97=E3=80=81=E3=83=9E=E3=83=8B?= =?UTF-8?q?=E3=83=95=E3=82=A7=E3=82=B9=E3=83=88=E7=94=9F=E6=88=90=E3=81=AE?= =?UTF-8?q?=E3=83=97=E3=83=AD=E3=82=BB=E3=82=B9=E3=82=92=E5=BC=B7=E5=8C=96?= =?UTF-8?q?=E3=80=82README.md=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=97=E3=80=81?= =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=B3=E3=83=97=E3=83=88=E7=94=9F=E6=88=90?= =?UTF-8?q?=E3=81=AE=E6=A7=8B=E9=80=A0=E3=82=92=E6=98=8E=E7=A2=BA=E5=8C=96?= =?UTF-8?q?=E3=80=82=E3=82=B7=E3=83=BC=E3=83=B3=E3=81=A8=E3=82=B9=E3=82=BF?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=81=AE=E7=99=BB=E9=8C=B2=E3=83=AB=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=82=92=E6=95=B4=E7=90=86=E3=81=97=E3=80=81=E3=82=B9?= =?UTF-8?q?=E3=82=AD=E3=83=BC=E3=83=9E=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 1 + .vscode/settings.json | 3 + README.md | 103 ++++++++++++++++++- make-json.sh | 41 ++++---- manifest.json | 1 + note | 44 ++++++++ promote-manifest.sh | 50 +++++++++ prompts/scenes.md | 198 ++++++++++++++++++++---------------- prompts/styles.md | 134 +++++++++++++++++++++--- prompts/task_template.md | 79 ++++++++++++++- prompts/world-set.md | 207 ++++++++++++++++++++++---------------- schema/prompt.schema.json | 41 ++++++++ 12 files changed, 685 insertions(+), 217 deletions(-) create mode 100644 .env create mode 100644 .vscode/settings.json mode change 100644 => 100755 make-json.sh create mode 100644 note create mode 100644 promote-manifest.sh create mode 100644 schema/prompt.schema.json 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" <