Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
feat: Codex 向けに Skill ごとの agents/openai.yaml を生成 (0-8)#74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
takemi-ohama
merged 6 commits into
release/skill-inventory
from
feature/inventory-codex-conformanceAug 8, 2026
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cfcf840
chore: feature/inventory-codex-conformance の Draft PR 作成
takemi-ohama 23d072f
Merge release/skill-inventory
takemi-ohama f775568
Feat: Codex 配布物へ暗黙起動を抑止する openai.yaml を生成 (0-8)
takemi-ohama a7d4dd1
Docs: Codex の暗黙起動抑止による利用者への影響と起動方法を追記
takemi-ohama b3e083d
Merge: base ブランチ release/skill-inventory を取り込み
takemi-ohama 7acc4bc
Docs: Codex の明示起動 ($skill) の挙動を実機検証結果に基づき修正
takemi-ohama File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| policy: | ||
| allow_implicit_invocation: false | ||
| interface: | ||
| default_prompt: "<base-branch> (例: qa/staging, release/v2)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| policy: | ||
| allow_implicit_invocation: false | ||
| interface: | ||
| default_prompt: "<env-branch> (例: qa/staging, release/v2)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| policy: | ||
| allow_implicit_invocation: false | ||
| interface: | ||
| default_prompt: "[PR番号]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| policy: | ||
| allow_implicit_invocation: false | ||
| interface: | ||
| default_prompt: "[PR番号]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| policy: | ||
| allow_implicit_invocation: false | ||
| interface: | ||
| default_prompt: "[--draft] [base-branch] or [commit-message]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| policy: | ||
| allow_implicit_invocation: false | ||
| interface: | ||
| default_prompt: "[PR番号 | --branch] [AIエージェント(codex|gemini)] [--focus AREA]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -99,6 +99,67 @@ rewrite_codex_skill_paths() { | ||
| done | ||
| } | ||
| # Codex は Skill ごとの `<Skill 名>/agents/openai.yaml` で暗黙起動を制御する。 | ||
| # SKILL.md の frontmatter を読み、`disable-model-invocation: true` を持つ Skill だけへ生成する。 | ||
| write_codex_skill_policies() { | ||
| local skills_dir="$1" | ||
| python3 - "$skills_dir" <<'PY' | ||
| import sys | ||
| from pathlib import Path | ||
| skills_dir = Path(sys.argv[1]) | ||
| def parse_frontmatter(text: str) -> dict[str, str]: | ||
| lines = text.splitlines() | ||
| if not lines or lines[0].strip() != "---": | ||
| return {} | ||
| fields: dict[str, str] = {} | ||
| for line in lines[1:]: | ||
| if line.strip() == "---": | ||
| break | ||
| # ネストした値(allowed-tools のリストなど)はここでは扱わない | ||
| if not line or line[0].isspace() or ":" not in line: | ||
| continue | ||
| key, _, value = line.partition(":") | ||
| value = value.strip() | ||
| if len(value) >= 2 and value[0] == value[-1] and value[0] in "\"'": | ||
| value = value[1:-1] | ||
| fields[key.strip()] = value | ||
| return fields | ||
| def yaml_double_quoted(value: str) -> str: | ||
| return '"' + value.replace("\\", "\\\\").replace('"', '\\"') + '"' | ||
| for skill_dir in sorted(p for p in skills_dir.iterdir() if p.is_dir()): | ||
| skill_md = skill_dir / "SKILL.md" | ||
| if not skill_md.is_file(): | ||
| continue | ||
| agents_dir = skill_dir / "agents" | ||
| policy_path = agents_dir / "openai.yaml" | ||
| # 前回の生成物を必ず捨ててから作り直す(対象から外れた Skill に残さない) | ||
| policy_path.unlink(missing_ok=True) | ||
| fields = parse_frontmatter(skill_md.read_text(encoding="utf-8")) | ||
| if fields.get("disable-model-invocation") != "true": | ||
| if agents_dir.is_dir() and not any(agents_dir.iterdir()): | ||
| agents_dir.rmdir() | ||
| continue | ||
| lines = ["policy:", " allow_implicit_invocation: false"] | ||
takemi-ohama marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| argument_hint = fields.get("argument-hint") | ||
| if argument_hint: | ||
| lines += ["interface:", f" default_prompt: {yaml_double_quoted(argument_hint)}"] | ||
| agents_dir.mkdir(parents=True, exist_ok=True) | ||
| policy_path.write_text("\n".join(lines) + "\n", encoding="utf-8") | ||
| PY | ||
| } | ||
| rewrite_kiro_skill_paths() { | ||
| local skills_dir="$1" | ||
| local file | ||
| @@ -175,6 +236,7 @@ sync_skills() { | ||
| if [ "$variant" = codex-runtime ]; then | ||
| rewrite_codex_skill_paths "$tmp_dir" skills | ||
| write_codex_skill_policies "$tmp_dir" | ||
| elif [ "$variant" = kiro-runtime ]; then | ||
| rewrite_kiro_skill_paths "$tmp_dir" | ||
| fi | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.