spec 1.0 · 規範

Leji エージェントプロファイルのフロントマター

AI エージェントの支援による翻訳です。内容に相違がある場合は、英語版ページが優先されます。文章に問題を見つけた際は、Issueまたはプルリクエストをお願いします。

エージェントプロファイル文書の YAML フロントマターを検証します。markdown の本文は自由な形式のままです。

正規の $idhttps://leji.org/schemas/v1.0/agent-profile.schema.json
生ファイル:agent-profile.schema.json

フィールド

#idstring必須

このプロファイルの安定した識別子です。たとえば "core" や "reviewer"。

パターン ^[a-z0-9]+(-[a-z0-9]+)*$

#namestring必須

人が読めるロールの名前です。

#rolestring必須

このプロファイルが担うロール識別子です。マニフェストの agents マップで結び付けられます。

#purposestring

このロールが何のためにあるのかを、一行で述べます。

#versionstring

このプロファイルのバージョンです。任意です。

#inheritsstring

このプロファイルが姿勢の配列と本文を受け継ぐ、ただひとつの core プロファイルの id です。解決は仕様に従います。解決は 1 段階だけで、対象は存在し、一意であり、role として core を宣言していなければなりません。inherits を宣言したプロファイルは、基となるプロファイルが与えている箇所については requiredRead と mustAskWhen を省略できます。

パターン ^[a-z0-9]+(-[a-z0-9]+)*$

#requiredRead文字列の配列

このロールが、あらゆる作業の前に読み込むパスです。

#defaultContext"domain" · "system" · "practice" · "governance" · "decisions" の配列

このロールが既定で読み込むカテゴリです。

#mustAskWhen文字列の配列

ロールが手を止めて人に尋ねなければならない条件です。

#mustRefuseWhen文字列の配列

ロールが尋ねるのではなく、はっきり断らなければならない条件です。

#escalationstring

誰に、あるいはどこにエスカレーションするかです。

#owners文字列の配列

このプロファイルの所有者です。任意です。

#freshnessobject

このプロファイルのレビューの期限です。

reviewAfterstring

この日付を過ぎたら、プロファイルが古くなっていないか見直すべき、という ISO 8601 の日付です。

#hoststring

このエージェントを動かすエージェントホストです。たとえば "claude-code"、"codex"、"cursor"。ホストに依存しないプロファイルでは省略します。

#invocationobject

このエージェントに、外部の CLI としてどう関与するかです。ホスト自身の常駐エージェントでは省略します。

commandstring必須

シェルからこのエージェントに関与するためのコマンドテンプレートです。<prompt> プレースホルダーを必ず含み、それは引用符で囲まない独立したシェルの語として置かれなければなりません。pattern が確かめるのは置換の箇所が存在することだけで、どこに置くかは仕様の規則です。

constraints文字列の配列

機械が知っておく価値のある、運用上の制約です。たとえばプロンプトの長さの制限やタイムアウト。

スキーマと実例

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://leji.org/schemas/v1.0/agent-profile.schema.json",
  "title": "Leji agent profile frontmatter",
  "description": "Validates the YAML frontmatter of an agent profile document. The markdown body stays free-form.",
  "type": "object",
  "required": [
    "id",
    "name",
    "role"
  ],
  "if": {
    "not": {
      "required": [
        "inherits"
      ]
    }
  },
  "then": {
    "required": [
      "requiredRead",
      "mustAskWhen"
    ]
  },
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "Stable identifier for this profile, e.g. \"core\" or \"reviewer\".",
      "type": "string",
      "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
    },
    "name": {
      "description": "Human-readable name of the role.",
      "type": "string",
      "minLength": 1
    },
    "role": {
      "description": "The role identifier this profile fills, bound in the manifest's agents map.",
      "type": "string",
      "minLength": 1
    },
    "purpose": {
      "description": "One line on what this role is for.",
      "type": "string"
    },
    "version": {
      "description": "Optional version of this profile.",
      "type": "string"
    },
    "inherits": {
      "type": "string",
      "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
      "description": "id of the single core profile whose posture arrays and body this profile extends, resolved per the specification. Resolution is single-level: the target must exist, be unique, and declare role core. A profile that declares inherits may omit requiredRead and mustAskWhen where the base supplies them."
    },
    "requiredRead": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "pattern": "^(?!/)(?!\\./)(?!.*(^|/)\\.\\.(/|$))(?!.*\\\\).+$"
      },
      "description": "Paths this role loads before any task."
    },
    "defaultContext": {
      "type": "array",
      "items": {
        "enum": [
          "domain",
          "system",
          "practice",
          "governance",
          "decisions"
        ]
      },
      "description": "Categories this role loads by default."
    },
    "mustAskWhen": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      },
      "description": "Conditions under which the role must stop and ask a human."
    },
    "mustRefuseWhen": {
      "description": "Conditions under which the role must refuse outright rather than ask.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "escalation": {
      "type": "string",
      "description": "Who or what to escalate to."
    },
    "owners": {
      "description": "Optional owners of this profile.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "freshness": {
      "description": "Review horizon for this profile.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "reviewAfter": {
          "description": "ISO 8601 date after which the profile should be reviewed for staleness.",
          "type": "string",
          "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$"
        }
      }
    },
    "host": {
      "type": "string",
      "description": "The agent host that runs this agent, e.g. \"claude-code\", \"codex\", \"cursor\". Omit for host-agnostic profiles."
    },
    "invocation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "command"
      ],
      "properties": {
        "command": {
          "type": "string",
          "pattern": "<prompt>",
          "description": "Command template to engage this agent from a shell. Must carry the <prompt> placeholder, standing as its own unquoted shell word; the pattern verifies the substitution site exists, placement is the spec's rule."
        },
        "constraints": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Operational constraints worth machine-knowing, e.g. prompt length limits, timeouts."
        }
      },
      "description": "How to engage this agent as an external CLI. Omit for the host's own resident agent."
    }
  }
}

適合するエージェントプロファイルです。このスキーマが検証するのは YAML フロントマターで、その下の markdown 本文は自由な形式の文章です。

---
id: thought-partner
name: Thought Partner (Codex)
role: thought-partner
purpose: 文章、設計上の判断、そして判断を要する問いについての、独立したセカンドオピニオン。
host: codex
invocation:
  command: codex exec --skip-git-repo-check <prompt>
  constraints:
    - プロンプトは簡潔に保つ。非常に長いプロンプトは CLI を止めてしまう
    - 対話的ではない。プロンプトをひとつ渡すと返答がひとつ返るだけで、セッションの状態は持たない
inherits: core
requiredRead:
  - docs/boot-profile.md
mustAskWhen:
  - その判断が、記録済みの決定を変えてしまうとき
  - その問いが、コンテキストレイヤーにまだない機微な資料に関わるとき
---

# Thought Partner (Codex)

`leji.json``thought-partner` ロールを通じて関与し、手順の中で名前を直接
指すことはありません。指示は、それ自体で完結するプロンプトで渡します。対象と
なる文章や決定、それを縛る制約、そして正確な問いです。このリポジトリにも、その
履歴にもアクセスできません。判断してほしいことは、すべてプロンプトに入れます。

その判断は、ひとつの見方として扱ってください。このパートナーと常駐エージェント
の見解が分かれたときは、双方の見立てを添えて人に委ねます。

← スキーマ一覧