{
  "schemaVersion": "1.0",
  "id": "ai-coding-memory",
  "name": "AI Coding Memory",
  "version": "1.5.0",
  "author": "Personize",
  "description": "Shared, durable memory for software teams that work with AI coding assistants (Claude Code, Codex, Cursor, ...). Tasks, features, decisions, proposals/hypotheses/questions, errors, PR/deploy events, AI sessions and addressed teammate messages with read state — keyed deterministically so every person and tool lands on the same record — plus a relation graph and the guidelines assistants follow to recall, record and hand off work.",
  "requires": [],
  "resources": {
    "entityTypes": [
      {
        "slug": "person",
        "upsertAllowed": true,
        "name": "Person",
        "pluralLabel": "People",
        "description": "A human on the team — a Personize user or not. Keyed by work email.",
        "icon": "User",
        "color": "#3B82F6",
        "primaryKeyField": "email"
      },
      {
        "slug": "project",
        "upsertAllowed": true,
        "name": "Project",
        "pluralLabel": "Projects",
        "description": "A repository or product. The scope of every other record.",
        "icon": "FolderGit2",
        "color": "#6366F1",
        "primaryKeyField": "project_key"
      },
      {
        "slug": "feature",
        "upsertAllowed": true,
        "name": "Feature",
        "pluralLabel": "Features",
        "description": "A user-visible capability or initiative that groups tasks, decisions and errors.",
        "icon": "Sparkles",
        "color": "#10B981",
        "primaryKeyField": "feature_key"
      },
      {
        "slug": "task",
        "upsertAllowed": true,
        "name": "Task",
        "pluralLabel": "Tasks",
        "description": "A unit of proposed or accepted work with an owner, status and priority.",
        "icon": "CheckSquare",
        "color": "#22C55E",
        "primaryKeyField": "task_key"
      },
      {
        "slug": "decision",
        "upsertAllowed": true,
        "name": "Decision",
        "pluralLabel": "Decisions",
        "description": "A technical or product decision with its rationale; changed only by superseding.",
        "icon": "Scale",
        "color": "#F59E0B",
        "primaryKeyField": "decision_key"
      },
      {
        "slug": "inquiry",
        "upsertAllowed": true,
        "name": "Inquiry",
        "pluralLabel": "Inquiries",
        "description": "A proposal, hypothesis or open question (see kind) that needs an outcome.",
        "icon": "HelpCircle",
        "color": "#A855F7",
        "primaryKeyField": "inquiry_key"
      },
      {
        "slug": "error",
        "upsertAllowed": true,
        "name": "Error",
        "pluralLabel": "Errors",
        "description": "A distinct failure, keyed by a normalized-signature fingerprint so repeats land on one record.",
        "icon": "AlertTriangle",
        "color": "#EF4444",
        "primaryKeyField": "error_key"
      },
      {
        "slug": "event",
        "upsertAllowed": true,
        "name": "Event",
        "pluralLabel": "Events",
        "description": "Something with an external id that happened: PR, commit, deploy, release, CI run.",
        "icon": "Rocket",
        "color": "#8B5CF6",
        "primaryKeyField": "event_key"
      },
      {
        "slug": "ai_session",
        "upsertAllowed": true,
        "name": "AI Session",
        "pluralLabel": "AI Sessions",
        "description": "One AI coding-assistant session (Claude Code, Codex, Cursor, ...) driven by one person.",
        "icon": "Bot",
        "color": "#0EA5E9",
        "primaryKeyField": "session_key"
      },
      {
        "slug": "message",
        "upsertAllowed": true,
        "name": "Message",
        "pluralLabel": "Messages",
        "description": "A note from one teammate (or their AI assistant) to one recipient, with read state. One record per recipient.",
        "icon": "Mail",
        "color": "#EC4899",
        "primaryKeyField": "message_key"
      },
      {
        "slug": "customer_account",
        "upsertAllowed": true,
        "name": "Customer Account",
        "pluralLabel": "Customer Accounts",
        "description": "A refreshable cache of a customer account used by routines: tier, cadence and a health reference. Values are caches, not the source of truth; refresh them from the source. Left empty until customer-level intelligence is enabled for your organization.",
        "icon": "Building2",
        "color": "#14B8A6",
        "primaryKeyField": "account_key"
      },
      {
        "slug": "metric_snapshot",
        "upsertAllowed": true,
        "name": "Metric Snapshot",
        "pluralLabel": "Metric Snapshots",
        "description": "One captured metric value for one routine and period, with its source.",
        "icon": "Gauge",
        "color": "#F97316",
        "primaryKeyField": "snapshot_key"
      }
    ],
    "collections": [
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "person-profile",
        "name": "Person Profile",
        "entityType": "person",
        "definition": "A team member. Records exist for everyone who owns, decides, reviews or authors work — Personize users or not. Keyed by work email.",
        "properties": [
          {
            "systemName": "email",
            "propertyName": "Email",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "Work email, lowercased. The record key (standard email identifier). Git author emails map here."
          },
          {
            "systemName": "display_name",
            "propertyName": "Display Name",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Full name as the team uses it."
          },
          {
            "systemName": "handles",
            "propertyName": "Handles",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Other handles, comma-separated: 'github:<login>, slack:<id>'."
          },
          {
            "systemName": "role",
            "propertyName": "Role",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Role or function (e.g. backend engineer, engineering manager)."
          },
          {
            "systemName": "team",
            "propertyName": "Team",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Team name."
          },
          {
            "systemName": "status",
            "propertyName": "Status",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "active = currently on the team; inactive = left or paused.",
            "options": [
              "active",
              "inactive"
            ]
          },
          {
            "systemName": "is_personize_user",
            "propertyName": "Is Personize User",
            "type": "boolean",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "true if this person has their own Personize login."
          },
          {
            "systemName": "timezone",
            "propertyName": "Timezone",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "IANA timezone, e.g. America/Toronto."
          },
          {
            "systemName": "expertise",
            "propertyName": "Expertise",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Areas and project keys this person knows deeply; used to route questions."
          }
        ]
      },
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "project-profile",
        "name": "Project Profile",
        "entityType": "project",
        "definition": "A repository or product and its current focus.",
        "properties": [
          {
            "systemName": "project_key",
            "propertyName": "Project Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "The record key: '<owner>/<repo>' from `git remote get-url origin`, lowercased; a kebab slug for projects without a repo."
          },
          {
            "systemName": "title",
            "propertyName": "Title",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Project name."
          },
          {
            "systemName": "repo_url",
            "propertyName": "Repo URL",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Repository URL."
          },
          {
            "systemName": "default_branch",
            "propertyName": "Default Branch",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "e.g. main, master."
          },
          {
            "systemName": "status",
            "propertyName": "Status",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "Project lifecycle.",
            "options": [
              "active",
              "paused",
              "archived"
            ]
          },
          {
            "systemName": "owner_email",
            "propertyName": "Owner Email",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "ownership"
            ],
            "description": "Accountable person (a Person email)."
          },
          {
            "systemName": "description",
            "propertyName": "Description",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "What the project is and is not."
          },
          {
            "systemName": "current_focus",
            "propertyName": "Current Focus",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "2-5 lines on what the team is focused on now. Replaced by whoever changes the focus."
          },
          {
            "systemName": "environments",
            "propertyName": "Environments",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Deploy environments, comma-separated (e.g. 'dev, staging, production')."
          },
          {
            "systemName": "created_by_email",
            "propertyName": "Created By (Email)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Human who registered the project."
          },
          {
            "systemName": "created_at_ms",
            "propertyName": "Created At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Epoch milliseconds."
          },
          {
            "systemName": "updated_by",
            "propertyName": "Updated By",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "'<email> via <tool> <session_key>' of the last structured write."
          }
        ]
      },
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "feature-profile",
        "name": "Feature Profile",
        "entityType": "feature",
        "definition": "The living state of a feature: status, owner, goal and the start-here summary. Its tasks, decisions and errors point to it via feature_key / applies_to_keys.",
        "properties": [
          {
            "systemName": "feature_key",
            "propertyName": "Feature Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "Formula: '<project_key>/f/<kebab-slug>', slug matching the branch feat/<slug>. The record's stable identity (customKeyValue for customKeyName='feature_key'). Lowercase. Never changes, even if the title does. Build it exactly as the Identifier Standard guideline says."
          },
          {
            "systemName": "project_key",
            "propertyName": "Project Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity",
              "scope"
            ],
            "description": "Key of the owning project: '<owner>/<repo>' from `git remote get-url origin`, lowercased (e.g. 'acme/app'). Every filter is scoped by this."
          },
          {
            "systemName": "title",
            "propertyName": "Title",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Short human-readable name. May change; never used for identity."
          },
          {
            "systemName": "created_by_email",
            "propertyName": "Created By (Email)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Email of the HUMAN who created or asked for this record (not the assistant)."
          },
          {
            "systemName": "created_at_ms",
            "propertyName": "Created At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Creation time as epoch milliseconds (numbers are range-filterable; ISO strings are not)."
          },
          {
            "systemName": "updated_by",
            "propertyName": "Updated By",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Last structured write, as '<email> via <tool> <session_key>' (e.g. 'dev@example.com via claude-code claude-code:510c7129-...')."
          },
          {
            "systemName": "last_session_key",
            "propertyName": "Last Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "session_key of the AI session that last changed this record."
          },
          {
            "systemName": "refs",
            "propertyName": "Refs",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Comma-separated external references: PR / commit / tracker ids / URLs (e.g. 'pr/821, commit/3b981225ab12'). Replace the whole value; never append."
          },
          {
            "systemName": "status",
            "propertyName": "Status",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "idea -> proposed -> approved -> in_progress <-> blocked -> in_review -> shipped | abandoned. approved requires explicit human acceptance; shipped requires a ships edge from a deploy/release event.",
            "options": [
              "idea",
              "proposed",
              "approved",
              "in_progress",
              "blocked",
              "in_review",
              "shipped",
              "abandoned"
            ]
          },
          {
            "systemName": "owner_email",
            "propertyName": "Owner Email",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "ownership"
            ],
            "description": "Accountable person (Person email)."
          },
          {
            "systemName": "priority",
            "propertyName": "Priority",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "p0 now, p1 this week, p2 this cycle, p3 later.",
            "options": [
              "p0",
              "p1",
              "p2",
              "p3"
            ]
          },
          {
            "systemName": "goal",
            "propertyName": "Goal",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "What success looks like and why it matters."
          },
          {
            "systemName": "acceptance",
            "propertyName": "Acceptance",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Observable criteria for shipped."
          },
          {
            "systemName": "current_state",
            "propertyName": "Current State",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "The 'start here' paragraph for anyone picking this up: done, next, risks. Replaced, not appended."
          },
          {
            "systemName": "branch",
            "propertyName": "Branch",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Main working branch."
          },
          {
            "systemName": "depends_on_keys",
            "propertyName": "Depends On Keys",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Comma-separated feature keys this feature depends on."
          },
          {
            "systemName": "related_keys",
            "propertyName": "Related Keys",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Comma-separated task / feature keys whose scope overlaps this feature but neither contains the other (mirrors related_to). Replace the whole value; never append."
          },
          {
            "systemName": "status_changed_at_ms",
            "propertyName": "Status Changed At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "When status last changed."
          }
        ]
      },
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "task-profile",
        "name": "Task Profile",
        "entityType": "task",
        "definition": "One unit of work. Complete task lists come from filtering this collection by project_key + status.",
        "properties": [
          {
            "systemName": "task_key",
            "propertyName": "Task Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "Formula: tracker id when one exists ('<project_key>/gh#<n>' or '<project_key>/jira:<key-n>'), else '<project_key>/t/<yymmdd>-<4 random [a-z2-7]>'. The record's stable identity (customKeyValue for customKeyName='task_key'). Lowercase. Never changes, even if the title does. Build it exactly as the Identifier Standard guideline says."
          },
          {
            "systemName": "project_key",
            "propertyName": "Project Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity",
              "scope"
            ],
            "description": "Key of the owning project: '<owner>/<repo>' from `git remote get-url origin`, lowercased (e.g. 'acme/app'). Every filter is scoped by this."
          },
          {
            "systemName": "title",
            "propertyName": "Title",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Short human-readable name. May change; never used for identity."
          },
          {
            "systemName": "created_by_email",
            "propertyName": "Created By (Email)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Email of the HUMAN who created or asked for this record (not the assistant)."
          },
          {
            "systemName": "created_at_ms",
            "propertyName": "Created At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Creation time as epoch milliseconds (numbers are range-filterable; ISO strings are not)."
          },
          {
            "systemName": "updated_by",
            "propertyName": "Updated By",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Last structured write, as '<email> via <tool> <session_key>' (e.g. 'dev@example.com via claude-code claude-code:510c7129-...')."
          },
          {
            "systemName": "last_session_key",
            "propertyName": "Last Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "session_key of the AI session that last changed this record."
          },
          {
            "systemName": "refs",
            "propertyName": "Refs",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Comma-separated external references: PR / commit / tracker ids / URLs (e.g. 'pr/821, commit/3b981225ab12'). Replace the whole value; never append."
          },
          {
            "systemName": "status",
            "propertyName": "Status",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "proposed (human said note it, not accepted) -> backlog (accepted) -> in_progress (claimed; owner required) <-> blocked (reason required) -> in_review (PR open) -> done (resolution + verification required) | cancelled (reason). Reopen: done -> backlog/in_progress with a reason note.",
            "options": [
              "proposed",
              "backlog",
              "in_progress",
              "blocked",
              "in_review",
              "done",
              "cancelled"
            ]
          },
          {
            "systemName": "owner_email",
            "propertyName": "Owner Email",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "ownership"
            ],
            "description": "Person email of the owner, or 'unassigned'. Set together with in_progress to claim."
          },
          {
            "systemName": "priority",
            "propertyName": "Priority",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "p0 now, p1 this week, p2 this cycle, p3 later.",
            "options": [
              "p0",
              "p1",
              "p2",
              "p3"
            ]
          },
          {
            "systemName": "feature_key",
            "propertyName": "Feature Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "scope"
            ],
            "description": "Parent feature key, if any."
          },
          {
            "systemName": "parent_task_key",
            "propertyName": "Parent Task Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "scope"
            ],
            "description": "Parent task key for subtasks."
          },
          {
            "systemName": "acceptance",
            "propertyName": "Acceptance",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Definition of done."
          },
          {
            "systemName": "summary",
            "propertyName": "Summary",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "2-4 sentences: what the work changes and where (modules, endpoints, files). Compared by the overlap check before any new task is created, so write it on creation."
          },
          {
            "systemName": "next_step",
            "propertyName": "Next Step",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "The single next concrete action."
          },
          {
            "systemName": "blocked_reason",
            "propertyName": "Blocked Reason",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Required when status=blocked: what is needed and from whom."
          },
          {
            "systemName": "blocked_by_keys",
            "propertyName": "Blocked By Keys",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Comma-separated task / inquiry / error keys blocking this task."
          },
          {
            "systemName": "related_keys",
            "propertyName": "Related Keys",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Comma-separated task / feature keys whose scope overlaps this task but neither contains the other (mirrors related_to). Replace the whole value; never append."
          },
          {
            "systemName": "resolution",
            "propertyName": "Resolution",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Required for done/cancelled: outcome plus evidence (PR/commit ref)."
          },
          {
            "systemName": "verification",
            "propertyName": "Verification",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Required for done: the command/test run and its result."
          },
          {
            "systemName": "tracker_ref",
            "propertyName": "Tracker Ref",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "External tracker id, e.g. 'gh#123' or 'jira:PROJ-45'."
          },
          {
            "systemName": "status_changed_at_ms",
            "propertyName": "Status Changed At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "When status last changed."
          },
          {
            "systemName": "work_kind",
            "propertyName": "Work Kind",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "What kind of work this task is: 'code' (a normal engineering task) or 'routine' (a recurring job run by the routines engine).",
            "options": [
              "code",
              "routine"
            ]
          },
          {
            "systemName": "recurrence",
            "propertyName": "Recurrence",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "Single cadence field for a routine, for example a cron string or `every:<n><unit>` such as `every:1d`. Set only on routines."
          },
          {
            "systemName": "next_run_at_ms",
            "propertyName": "Next Run At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "When the routine is next due, as epoch milliseconds."
          },
          {
            "systemName": "last_run_at_ms",
            "propertyName": "Last Run At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "When the routine last ran, as epoch milliseconds."
          },
          {
            "systemName": "autonomy",
            "propertyName": "Autonomy",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "How far a routine run may act on its own: read_only (observe and report), draft (prepare output for a human to send), act_limited (act within its caps).",
            "options": [
              "read_only",
              "draft",
              "act_limited"
            ]
          },
          {
            "systemName": "department",
            "propertyName": "Department",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "Which department owns the routine.",
            "options": [
              "ops",
              "product_success",
              "ai_dev",
              "gtm"
            ]
          },
          {
            "systemName": "run_cap_usd",
            "propertyName": "Run Cap (USD)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Maximum spend in US dollars for a single run of the routine."
          },
          {
            "systemName": "month_cap_usd",
            "propertyName": "Month Cap (USD)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Maximum spend in US dollars for the routine per calendar month."
          },
          {
            "systemName": "paused",
            "propertyName": "Paused",
            "type": "boolean",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "True while the routine is paused and must not be picked up."
          },
          {
            "systemName": "lease_until_ms",
            "propertyName": "Lease Until (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Epoch milliseconds until which the current lease holder owns this run. Expired leases may be taken over."
          },
          {
            "systemName": "lease_owner",
            "propertyName": "Lease Owner",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Opaque dispatcher id holding the lease; no personal data."
          },
          {
            "systemName": "playbook_ref",
            "propertyName": "Playbook Ref",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Guideline slug of the routine's playbook."
          }
        ]
      },
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "decision-record",
        "name": "Decision Record",
        "entityType": "decision",
        "definition": "A decision and its rationale. Accepted decisions are never edited in substance; a change of mind is a new decision that supersedes the old one.",
        "properties": [
          {
            "systemName": "decision_key",
            "propertyName": "Decision Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "Formula: '<project_key>/d/<kebab slug of the question>'. The record's stable identity (customKeyValue for customKeyName='decision_key'). Lowercase. Never changes, even if the title does. Build it exactly as the Identifier Standard guideline says."
          },
          {
            "systemName": "project_key",
            "propertyName": "Project Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity",
              "scope"
            ],
            "description": "Key of the owning project: '<owner>/<repo>' from `git remote get-url origin`, lowercased (e.g. 'acme/app'). Every filter is scoped by this."
          },
          {
            "systemName": "title",
            "propertyName": "Title",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Short human-readable name. May change; never used for identity."
          },
          {
            "systemName": "created_by_email",
            "propertyName": "Created By (Email)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Email of the HUMAN who created or asked for this record (not the assistant)."
          },
          {
            "systemName": "created_at_ms",
            "propertyName": "Created At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Creation time as epoch milliseconds (numbers are range-filterable; ISO strings are not)."
          },
          {
            "systemName": "updated_by",
            "propertyName": "Updated By",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Last structured write, as '<email> via <tool> <session_key>' (e.g. 'dev@example.com via claude-code claude-code:510c7129-...')."
          },
          {
            "systemName": "last_session_key",
            "propertyName": "Last Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "session_key of the AI session that last changed this record."
          },
          {
            "systemName": "refs",
            "propertyName": "Refs",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Comma-separated external references: PR / commit / tracker ids / URLs (e.g. 'pr/821, commit/3b981225ab12'). Replace the whole value; never append."
          },
          {
            "systemName": "status",
            "propertyName": "Status",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "proposed -> accepted | rejected; accepted -> superseded (only via a new decision with supersedes_key).",
            "options": [
              "proposed",
              "accepted",
              "superseded",
              "rejected"
            ]
          },
          {
            "systemName": "question",
            "propertyName": "Question",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "The decision framed as the question it answers."
          },
          {
            "systemName": "decision",
            "propertyName": "Decision",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "The choice, stated plainly."
          },
          {
            "systemName": "rationale",
            "propertyName": "Rationale",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Why: reasoning, constraints, evidence. The most valuable field."
          },
          {
            "systemName": "alternatives",
            "propertyName": "Alternatives",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Options considered and why each was rejected."
          },
          {
            "systemName": "applies_to_keys",
            "propertyName": "Applies To Keys",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "scope"
            ],
            "description": "Comma-separated feature / task / project keys this decision governs."
          },
          {
            "systemName": "decided_by_emails",
            "propertyName": "Decided By Emails",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "ownership"
            ],
            "description": "Comma-separated Person emails who made or approved it. Required when accepted."
          },
          {
            "systemName": "decided_at_ms",
            "propertyName": "Decided At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "When accepted."
          },
          {
            "systemName": "supersedes_key",
            "propertyName": "Supersedes Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Decision key this one replaces."
          },
          {
            "systemName": "superseded_by_key",
            "propertyName": "Superseded By Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Decision key that replaced this one."
          },
          {
            "systemName": "resolves_inquiry_key",
            "propertyName": "Resolves Inquiry Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Inquiry key (proposal/question) this decision closes."
          }
        ]
      },
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "inquiry-record",
        "name": "Inquiry Record",
        "entityType": "inquiry",
        "definition": "A proposal, hypothesis or open question with an outcome. Status values allowed depend on kind (see Work Lifecycle Standard).",
        "properties": [
          {
            "systemName": "inquiry_key",
            "propertyName": "Inquiry Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "Formula: '<project_key>/<p|h|q>/<yymmdd>-<4 random [a-z2-7]>' (p=proposal, h=hypothesis, q=question). The record's stable identity (customKeyValue for customKeyName='inquiry_key'). Lowercase. Never changes, even if the title does. Build it exactly as the Identifier Standard guideline says."
          },
          {
            "systemName": "project_key",
            "propertyName": "Project Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity",
              "scope"
            ],
            "description": "Key of the owning project: '<owner>/<repo>' from `git remote get-url origin`, lowercased (e.g. 'acme/app'). Every filter is scoped by this."
          },
          {
            "systemName": "title",
            "propertyName": "Title",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Short human-readable name. May change; never used for identity."
          },
          {
            "systemName": "created_by_email",
            "propertyName": "Created By (Email)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Email of the HUMAN who created or asked for this record (not the assistant)."
          },
          {
            "systemName": "created_at_ms",
            "propertyName": "Created At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Creation time as epoch milliseconds (numbers are range-filterable; ISO strings are not)."
          },
          {
            "systemName": "updated_by",
            "propertyName": "Updated By",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Last structured write, as '<email> via <tool> <session_key>' (e.g. 'dev@example.com via claude-code claude-code:510c7129-...')."
          },
          {
            "systemName": "last_session_key",
            "propertyName": "Last Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "session_key of the AI session that last changed this record."
          },
          {
            "systemName": "refs",
            "propertyName": "Refs",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Comma-separated external references: PR / commit / tracker ids / URLs (e.g. 'pr/821, commit/3b981225ab12'). Replace the whole value; never append."
          },
          {
            "systemName": "kind",
            "propertyName": "Kind",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "proposal = suggested change needing a decision; hypothesis = testable explanation; question = needs an answer.",
            "options": [
              "proposal",
              "hypothesis",
              "question"
            ]
          },
          {
            "systemName": "status",
            "propertyName": "Status",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "proposal: open -> accepted | rejected | withdrawn. hypothesis: open -> testing -> confirmed | refuted | inconclusive. question: open -> answered | dropped.",
            "options": [
              "open",
              "testing",
              "accepted",
              "rejected",
              "withdrawn",
              "confirmed",
              "refuted",
              "inconclusive",
              "answered",
              "dropped"
            ]
          },
          {
            "systemName": "concerns_key",
            "propertyName": "Concerns Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "scope"
            ],
            "description": "Key of the task / feature / error / decision / event this inquiry is about."
          },
          {
            "systemName": "statement",
            "propertyName": "Statement",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "The proposal, hypothesis or question itself."
          },
          {
            "systemName": "raised_by_email",
            "propertyName": "Raised By Email",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "ownership"
            ],
            "description": "Person email who raised it."
          },
          {
            "systemName": "directed_to_email",
            "propertyName": "Directed To Email",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "ownership"
            ],
            "description": "Person email who should answer or decide (comma-separated if several)."
          },
          {
            "systemName": "outcome",
            "propertyName": "Outcome",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Required when closed: the answer, evidence, or reason."
          },
          {
            "systemName": "outcome_key",
            "propertyName": "Outcome Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Decision / task / event key that resolved it."
          },
          {
            "systemName": "status_changed_at_ms",
            "propertyName": "Status Changed At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "When status last changed."
          }
        ]
      },
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "error-record",
        "name": "Error Record",
        "entityType": "error",
        "definition": "A distinct failure signature: attempts live as memories, the verified fix and root cause as properties. Recurrence reopens the same record.",
        "properties": [
          {
            "systemName": "error_key",
            "propertyName": "Error Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "Formula: '<project_key>/e/<first 12 hex of sha1(normalized signature)>' — see the Identifier Standard fingerprint algorithm. The record's stable identity (customKeyValue for customKeyName='error_key'). Lowercase. Never changes, even if the title does. Build it exactly as the Identifier Standard guideline says."
          },
          {
            "systemName": "project_key",
            "propertyName": "Project Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity",
              "scope"
            ],
            "description": "Key of the owning project: '<owner>/<repo>' from `git remote get-url origin`, lowercased (e.g. 'acme/app'). Every filter is scoped by this."
          },
          {
            "systemName": "title",
            "propertyName": "Title",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Short human-readable name. May change; never used for identity."
          },
          {
            "systemName": "created_by_email",
            "propertyName": "Created By (Email)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Email of the HUMAN who created or asked for this record (not the assistant)."
          },
          {
            "systemName": "created_at_ms",
            "propertyName": "Created At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Creation time as epoch milliseconds (numbers are range-filterable; ISO strings are not)."
          },
          {
            "systemName": "updated_by",
            "propertyName": "Updated By",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Last structured write, as '<email> via <tool> <session_key>' (e.g. 'dev@example.com via claude-code claude-code:510c7129-...')."
          },
          {
            "systemName": "last_session_key",
            "propertyName": "Last Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "session_key of the AI session that last changed this record."
          },
          {
            "systemName": "refs",
            "propertyName": "Refs",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Comma-separated external references: PR / commit / tracker ids / URLs (e.g. 'pr/821, commit/3b981225ab12'). Replace the whole value; never append."
          },
          {
            "systemName": "signature",
            "propertyName": "Signature",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "The normalized signature that was fingerprinted: error class + message with volatile parts replaced, plus ' @ <file>:<function>' of the top in-repo frame. Searchable with CONTAINS."
          },
          {
            "systemName": "status",
            "propertyName": "Status",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "open -> investigating -> fix_attempted (applied, not proven) -> resolved (verification required) | wont_fix. Recurrence: resolved -> open with a regression note.",
            "options": [
              "open",
              "investigating",
              "fix_attempted",
              "resolved",
              "wont_fix"
            ]
          },
          {
            "systemName": "severity",
            "propertyName": "Severity",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Impact.",
            "options": [
              "low",
              "medium",
              "high",
              "critical"
            ]
          },
          {
            "systemName": "component",
            "propertyName": "Component",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Area, module or file where it occurs."
          },
          {
            "systemName": "environment",
            "propertyName": "Environment",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Where it was seen.",
            "options": [
              "local",
              "ci",
              "dev",
              "staging",
              "production"
            ]
          },
          {
            "systemName": "owner_email",
            "propertyName": "Owner Email",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "ownership"
            ],
            "description": "Person email investigating it."
          },
          {
            "systemName": "root_cause",
            "propertyName": "Root Cause",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "The underlying mechanism, not the symptom."
          },
          {
            "systemName": "root_cause_confidence",
            "propertyName": "Root Cause Confidence",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "unknown / hypothesis (unproven) / confirmed (reproduced or proven).",
            "options": [
              "unknown",
              "hypothesis",
              "confirmed"
            ]
          },
          {
            "systemName": "fix_summary",
            "propertyName": "Fix Summary",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "What was changed to fix it."
          },
          {
            "systemName": "verification",
            "propertyName": "Verification",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Required for resolved: the reproduction or test that now passes, with its result."
          },
          {
            "systemName": "introduced_by_key",
            "propertyName": "Introduced By Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Event key (pr/commit/deploy) that introduced it, if known."
          },
          {
            "systemName": "fixed_by_keys",
            "propertyName": "Fixed By Keys",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Comma-separated event keys that fixed it."
          },
          {
            "systemName": "first_seen_ms",
            "propertyName": "First Seen (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "First occurrence."
          },
          {
            "systemName": "last_seen_ms",
            "propertyName": "Last Seen (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Latest occurrence."
          }
        ]
      },
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "event-record",
        "name": "Event Record",
        "entityType": "event",
        "definition": "An externally identifiable happening (PR, commit, deploy, release, CI run) linking work to delivery.",
        "properties": [
          {
            "systemName": "event_key",
            "propertyName": "Event Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "Formula by kind: '<project_key>/pr/<n>', '<project_key>/commit/<sha12>', '<project_key>/deploy/<env>/<ci-run-id or yymmddThhmm>', '<project_key>/release/<tag>', '<project_key>/ci/<run-id>'. The record's stable identity (customKeyValue for customKeyName='event_key'). Lowercase. Never changes, even if the title does. Build it exactly as the Identifier Standard guideline says."
          },
          {
            "systemName": "project_key",
            "propertyName": "Project Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity",
              "scope"
            ],
            "description": "Key of the owning project: '<owner>/<repo>' from `git remote get-url origin`, lowercased (e.g. 'acme/app'). Every filter is scoped by this."
          },
          {
            "systemName": "title",
            "propertyName": "Title",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Short human-readable name. May change; never used for identity."
          },
          {
            "systemName": "created_by_email",
            "propertyName": "Created By (Email)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Email of the HUMAN who created or asked for this record (not the assistant)."
          },
          {
            "systemName": "created_at_ms",
            "propertyName": "Created At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Creation time as epoch milliseconds (numbers are range-filterable; ISO strings are not)."
          },
          {
            "systemName": "updated_by",
            "propertyName": "Updated By",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Last structured write, as '<email> via <tool> <session_key>' (e.g. 'dev@example.com via claude-code claude-code:510c7129-...')."
          },
          {
            "systemName": "last_session_key",
            "propertyName": "Last Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "session_key of the AI session that last changed this record."
          },
          {
            "systemName": "refs",
            "propertyName": "Refs",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Comma-separated external references: PR / commit / tracker ids / URLs (e.g. 'pr/821, commit/3b981225ab12'). Replace the whole value; never append."
          },
          {
            "systemName": "kind",
            "propertyName": "Kind",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "Type of event.",
            "options": [
              "pr",
              "commit",
              "deploy",
              "release",
              "ci_run",
              "routine_run"
            ]
          },
          {
            "systemName": "status",
            "propertyName": "Status",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "pr: open|merged|closed. deploy: started|succeeded|failed|rolled_back. release: published|withdrawn. ci_run: passed|failed. commit: recorded. routine_run: ok|no_findings|proposed|failed|capped|skipped_paused|skipped_lease.",
            "options": [
              "open",
              "merged",
              "closed",
              "started",
              "succeeded",
              "failed",
              "rolled_back",
              "published",
              "withdrawn",
              "passed",
              "recorded",
              "ok",
              "no_findings",
              "proposed",
              "capped",
              "skipped_paused",
              "skipped_lease"
            ]
          },
          {
            "systemName": "url",
            "propertyName": "URL",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Link to the PR / run / release."
          },
          {
            "systemName": "actor_email",
            "propertyName": "Actor Email",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "ownership"
            ],
            "description": "Person email who authored / triggered it."
          },
          {
            "systemName": "occurred_at_ms",
            "propertyName": "Occurred At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "When it happened (merge time, deploy completion, ...)."
          },
          {
            "systemName": "environment",
            "propertyName": "Environment",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Deploy target (deploy/release only).",
            "options": [
              "dev",
              "staging",
              "production",
              "test",
              "other"
            ]
          },
          {
            "systemName": "commit_sha",
            "propertyName": "Commit SHA",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Commit or merge SHA."
          },
          {
            "systemName": "branch",
            "propertyName": "Branch",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Source branch."
          },
          {
            "systemName": "related_keys",
            "propertyName": "Related Keys",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "scope"
            ],
            "description": "Comma-separated task / feature / error keys this event touches."
          },
          {
            "systemName": "summary",
            "propertyName": "Summary",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "What it contained or changed."
          }
        ]
      },
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "ai-session-record",
        "name": "AI Session Record",
        "entityType": "ai_session",
        "definition": "One assistant session: who, which tool, what it worked on, and the handoff (summary, next steps, open questions).",
        "properties": [
          {
            "systemName": "session_key",
            "propertyName": "Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "Formula: '<tool>:<native session id>'; if the assistant cannot read its id, '<tool>:<yymmdd-hhmm>-<email local part>-<4 random [a-z2-7]>'. The record's stable identity (customKeyValue for customKeyName='session_key'). Lowercase. Never changes, even if the title does. Build it exactly as the Identifier Standard guideline says."
          },
          {
            "systemName": "project_key",
            "propertyName": "Project Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity",
              "scope"
            ],
            "description": "Key of the owning project: '<owner>/<repo>' from `git remote get-url origin`, lowercased (e.g. 'acme/app'). Every filter is scoped by this."
          },
          {
            "systemName": "title",
            "propertyName": "Title",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Short human-readable name. May change; never used for identity."
          },
          {
            "systemName": "created_by_email",
            "propertyName": "Created By (Email)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Email of the HUMAN who created or asked for this record (not the assistant)."
          },
          {
            "systemName": "created_at_ms",
            "propertyName": "Created At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Creation time as epoch milliseconds (numbers are range-filterable; ISO strings are not)."
          },
          {
            "systemName": "updated_by",
            "propertyName": "Updated By",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Last structured write, as '<email> via <tool> <session_key>' (e.g. 'dev@example.com via claude-code claude-code:510c7129-...')."
          },
          {
            "systemName": "last_session_key",
            "propertyName": "Last Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "session_key of the AI session that last changed this record."
          },
          {
            "systemName": "refs",
            "propertyName": "Refs",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Comma-separated external references: PR / commit / tracker ids / URLs (e.g. 'pr/821, commit/3b981225ab12'). Replace the whole value; never append."
          },
          {
            "systemName": "tool",
            "propertyName": "Tool",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Assistant used.",
            "options": [
              "claude-code",
              "codex",
              "cursor",
              "copilot",
              "other"
            ]
          },
          {
            "systemName": "model",
            "propertyName": "Model",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Model id, if known."
          },
          {
            "systemName": "person_email",
            "propertyName": "Person Email",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "ownership"
            ],
            "description": "The human driving the session."
          },
          {
            "systemName": "status",
            "propertyName": "Status",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "active (running) -> ended (wrap-up saved) | interrupted (set by a later session when last_checkpoint_ms is 8h+ old).",
            "options": [
              "active",
              "ended",
              "interrupted"
            ]
          },
          {
            "systemName": "started_at_ms",
            "propertyName": "Started At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Session start."
          },
          {
            "systemName": "ended_at_ms",
            "propertyName": "Ended At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Session end (wrap-up)."
          },
          {
            "systemName": "last_checkpoint_ms",
            "propertyName": "Last Checkpoint (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Last checkpoint write."
          },
          {
            "systemName": "goal",
            "propertyName": "Goal",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "What the session set out to do."
          },
          {
            "systemName": "summary",
            "propertyName": "Summary",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "What was done so far. Replaced at each checkpoint."
          },
          {
            "systemName": "next_steps",
            "propertyName": "Next Steps",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Concrete next actions for whoever continues."
          },
          {
            "systemName": "open_questions",
            "propertyName": "Open Questions",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Inquiry keys and short text of unresolved questions."
          },
          {
            "systemName": "branch",
            "propertyName": "Branch",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Working branch."
          },
          {
            "systemName": "worked_on_keys",
            "propertyName": "Worked On Keys",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Comma-separated keys touched this session. Replaced whole at each checkpoint."
          },
          {
            "systemName": "continues_session_key",
            "propertyName": "Continues Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "session_key this session picked up from."
          }
        ]
      },
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "message-record",
        "name": "Message Record",
        "entityType": "message",
        "definition": "A message from one teammate to one recipient with read state (unread, read, archived). One record per recipient; recipients mark their own messages read.",
        "properties": [
          {
            "systemName": "message_key",
            "propertyName": "Message Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "Formula: '<project_key>/m/<yymmdd>-<4 random [a-z2-7]>' (m=message). project_key is the project the message is about (never 'acme/team'-style team scopes). The record's stable identity (customKeyValue for customKeyName='message_key'). Lowercase. Never changes. One record per recipient: a message to several people is several records sharing a thread_key. Build it exactly as the Identifier Standard guideline says."
          },
          {
            "systemName": "project_key",
            "propertyName": "Project Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity",
              "scope"
            ],
            "description": "Key of the owning project: '<owner>/<repo>' from `git remote get-url origin`, lowercased (e.g. 'acme/app'). Every filter is scoped by this."
          },
          {
            "systemName": "title",
            "propertyName": "Title",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "The subject line. Short, human-readable. May change; never used for identity."
          },
          {
            "systemName": "created_by_email",
            "propertyName": "Created By (Email)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Email of the HUMAN who created or asked for this record (not the assistant)."
          },
          {
            "systemName": "created_at_ms",
            "propertyName": "Created At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Creation time as epoch milliseconds (numbers are range-filterable; ISO strings are not)."
          },
          {
            "systemName": "updated_by",
            "propertyName": "Updated By",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Last structured write, as '<email> via <tool> <session_key>' (e.g. 'dev@example.com via claude-code claude-code:510c7129-...')."
          },
          {
            "systemName": "last_session_key",
            "propertyName": "Last Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "session_key of the AI session that last changed this record."
          },
          {
            "systemName": "refs",
            "propertyName": "Refs",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Comma-separated external references: PR / commit / tracker ids / URLs (e.g. 'pr/821, commit/3b981225ab12'). Replace the whole value; never append."
          },
          {
            "systemName": "sender_email",
            "propertyName": "Sender Email",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "ownership"
            ],
            "description": "Email of the HUMAN sending the message (not the assistant), lowercased."
          },
          {
            "systemName": "recipient_email",
            "propertyName": "Recipient Email",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "ownership"
            ],
            "description": "Email of the ONE recipient, lowercased. Exactly one address, never a list, so 'my unread' is an exact EQ filter with no substring false positives."
          },
          {
            "systemName": "body",
            "propertyName": "Body",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "The message, 2-20 lines of markdown. No secrets, credentials or PII."
          },
          {
            "systemName": "status",
            "propertyName": "Status",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "unread -> read -> archived, or unread -> archived. Created as unread. Only the RECIPIENT changes status (explicit exception to Write Safety 'Other people's work').",
            "options": [
              "unread",
              "read",
              "archived"
            ]
          },
          {
            "systemName": "read_at_ms",
            "propertyName": "Read At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "When the recipient first marked the message read (epoch ms). Unset while unread."
          },
          {
            "systemName": "status_changed_at_ms",
            "propertyName": "Status Changed At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "When status last changed."
          },
          {
            "systemName": "priority",
            "propertyName": "Priority",
            "type": "options",
            "update": true,
            "isExtractable": false,
            "tags": [
              "lifecycle"
            ],
            "description": "normal by default; urgent when the recipient should see it before starting other work.",
            "options": [
              "normal",
              "urgent"
            ]
          },
          {
            "systemName": "thread_key",
            "propertyName": "Thread Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "scope"
            ],
            "description": "message_key of the first message in the thread (its own key for a thread starter). Shared by the per-recipient copies of one message and by replies."
          },
          {
            "systemName": "reply_to_key",
            "propertyName": "Reply To Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "scope"
            ],
            "description": "message_key of the message this one replies to. Empty for a thread starter."
          },
          {
            "systemName": "about_keys",
            "propertyName": "About Keys",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "scope"
            ],
            "description": "Comma-separated keys of the task / feature / error / decision / inquiry / event this message is about (mirrors the 'regarding' edges)."
          }
        ]
      },
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "customer-account",
        "name": "Customer Account",
        "entityType": "customer_account",
        "definition": "Refreshable cache of customer account facts for routines. Not the source of truth. Left empty until customer-level intelligence is enabled for your organization.",
        "properties": [
          {
            "systemName": "project_key",
            "propertyName": "Project Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity",
              "scope"
            ],
            "description": "Key of the owning project: '<owner>/<repo>' from `git remote get-url origin`, lowercased (e.g. 'acme/app'). Every filter is scoped by this."
          },
          {
            "systemName": "title",
            "propertyName": "Title",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Short human-readable name. May change; never used for identity."
          },
          {
            "systemName": "created_by_email",
            "propertyName": "Created By (Email)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Email of the HUMAN who created or asked for this record (not the assistant)."
          },
          {
            "systemName": "created_at_ms",
            "propertyName": "Created At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Creation time as epoch milliseconds (numbers are range-filterable; ISO strings are not)."
          },
          {
            "systemName": "updated_by",
            "propertyName": "Updated By",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Last structured write, as '<email> via <tool> <session_key>' (e.g. 'dev@example.com via claude-code claude-code:510c7129-...')."
          },
          {
            "systemName": "last_session_key",
            "propertyName": "Last Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "session_key of the AI session that last changed this record."
          },
          {
            "systemName": "refs",
            "propertyName": "Refs",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Comma-separated external references: PR / commit / tracker ids / URLs (e.g. 'pr/821, commit/3b981225ab12'). Replace the whole value; never append."
          },
          {
            "systemName": "account_key",
            "propertyName": "Account Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "The account's stable identity (customKeyValue for customKeyName='account_key'). Lowercase. Never changes."
          },
          {
            "systemName": "company_name",
            "propertyName": "Company Name",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Company name as last refreshed from the source."
          },
          {
            "systemName": "tier_cache",
            "propertyName": "Tier (cache)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Cached customer tier. Refreshable; the source of truth lives elsewhere."
          },
          {
            "systemName": "cadence_cache",
            "propertyName": "Cadence (cache)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Cached contact cadence for this account. Refreshable; not the source of truth."
          },
          {
            "systemName": "health_cache_ref",
            "propertyName": "Health Cache Ref",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Pointer to the latest Metric Snapshot (its snapshot_key) for this account."
          },
          {
            "systemName": "cache_refreshed_at_ms",
            "propertyName": "Cache Refreshed At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "When these cached values were last refreshed, as epoch milliseconds."
          }
        ]
      },
      {
        "upsertAllowed": true,
        "lockedProperties": false,
        "slug": "metric-snapshot",
        "name": "Metric Snapshot",
        "entityType": "metric_snapshot",
        "definition": "One captured value of a metric for a routine and period. No thresholds are stored here.",
        "properties": [
          {
            "systemName": "project_key",
            "propertyName": "Project Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity",
              "scope"
            ],
            "description": "Key of the owning project: '<owner>/<repo>' from `git remote get-url origin`, lowercased (e.g. 'acme/app'). Every filter is scoped by this."
          },
          {
            "systemName": "title",
            "propertyName": "Title",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Short human-readable name. May change; never used for identity."
          },
          {
            "systemName": "created_by_email",
            "propertyName": "Created By (Email)",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Email of the HUMAN who created or asked for this record (not the assistant)."
          },
          {
            "systemName": "created_at_ms",
            "propertyName": "Created At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "Creation time as epoch milliseconds (numbers are range-filterable; ISO strings are not)."
          },
          {
            "systemName": "updated_by",
            "propertyName": "Updated By",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "Last structured write, as '<email> via <tool> <session_key>' (e.g. 'dev@example.com via claude-code claude-code:510c7129-...')."
          },
          {
            "systemName": "last_session_key",
            "propertyName": "Last Session Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "attribution"
            ],
            "description": "session_key of the AI session that last changed this record."
          },
          {
            "systemName": "refs",
            "propertyName": "Refs",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "Comma-separated external references: PR / commit / tracker ids / URLs (e.g. 'pr/821, commit/3b981225ab12'). Replace the whole value; never append."
          },
          {
            "systemName": "snapshot_key",
            "propertyName": "Snapshot Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "identity"
            ],
            "description": "<routine key>:<metric>:<period>"
          },
          {
            "systemName": "routine_key",
            "propertyName": "Routine Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "scope"
            ],
            "description": "task_key of the routine that captured this snapshot."
          },
          {
            "systemName": "metric",
            "propertyName": "Metric",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Name of the metric captured."
          },
          {
            "systemName": "period",
            "propertyName": "Period",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Period the value covers (e.g. '2026-10' or '2026-W43')."
          },
          {
            "systemName": "value_number",
            "propertyName": "Value (number)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "The captured metric value."
          },
          {
            "systemName": "value_unit",
            "propertyName": "Value Unit",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [],
            "description": "Unit of value_number (e.g. 'usd', 'count', 'percent')."
          },
          {
            "systemName": "source_ref",
            "propertyName": "Source Ref",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "refs"
            ],
            "description": "The file:line or API name the value was read from."
          },
          {
            "systemName": "captured_at_ms",
            "propertyName": "Captured At (ms)",
            "type": "number",
            "update": true,
            "isExtractable": false,
            "tags": [
              "time"
            ],
            "description": "When the value was captured, as epoch milliseconds."
          },
          {
            "systemName": "account_key",
            "propertyName": "Account Key",
            "type": "text",
            "update": true,
            "isExtractable": false,
            "tags": [
              "scope"
            ],
            "description": "account_key of the customer account this snapshot is about, when it is account-level. Empty otherwise."
          }
        ]
      }
    ],
    "documentTypes": [],
    "documentTags": [
      {
        "slug": "ai-coding-memory",
        "upsertAllowed": false,
        "canonicalTag": "ai-coding-memory",
        "label": "AI Coding Memory",
        "description": "All docs of the AI Coding Memory kit. Fetch with context_retrieve(tags:[\"ai-coding-memory\"]) at session start.",
        "sortOrder": 10
      },
      {
        "slug": "protocol",
        "upsertAllowed": false,
        "canonicalTag": "protocol",
        "label": "Protocol",
        "description": "How assistants read and write team memory.",
        "sortOrder": 20
      },
      {
        "slug": "identifiers",
        "upsertAllowed": false,
        "canonicalTag": "identifiers",
        "label": "Identifiers",
        "description": "Record key formulas and fingerprints.",
        "sortOrder": 30
      },
      {
        "slug": "lifecycle",
        "upsertAllowed": false,
        "canonicalTag": "lifecycle",
        "label": "Lifecycle",
        "description": "Statuses, transitions and evidence rules.",
        "sortOrder": 40
      },
      {
        "slug": "graph",
        "upsertAllowed": false,
        "canonicalTag": "graph",
        "label": "Graph",
        "description": "Relation types and linking rules.",
        "sortOrder": 50
      },
      {
        "slug": "retrieval",
        "upsertAllowed": false,
        "canonicalTag": "retrieval",
        "label": "Retrieval",
        "description": "Query recipes for team-memory questions.",
        "sortOrder": 60
      }
    ],
    "guidelines": [
      {
        "slug": "ai-coding-memory-protocol",
        "upsertAllowed": true,
        "name": "AI Coding Memory Protocol",
        "description": "The session loop for AI coding assistants: start, recall, when to write (including messages to teammates), checkpoints, handoff, exclusions, failure honesty.",
        "tags": [
          "ai-coding-memory",
          "protocol"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "20adb70a0f34e2059ec83d3049d05bfdfe253fc8504f3fe9ec194bff39ebb573",
          "260b3768d38393ee1f9ceff4bf280a1fa48b6122067f063316cd62fff5e37759",
          "3759d46f62cbca0ed4c6158e4046de9e1eecde88b6fe585ac43865033a5b4033",
          "3b4ed5fdbd1cf34aa3f8e82308f9e5d3f352629c400d32b078c9c25422ccd207",
          "54e046c38a631b03dc177a106704efe40374c763ccbdfc6cde6ae686423fb7b9",
          "63ad79d245a15db77c9a77f8622120f1eaccd4495f1ae8c70e979f9462071520",
          "7b33a7e8e470b3446bcb06b85afe69e5d248c1456d0fb99a48da977be5aae105",
          "a649276cd345a776a24a5588a859282bd6f8a4dca85f06ccd803a00b3af74f01",
          "a6bf71208b1c2748bf49459690012c894fcbf29d4f6bc9ac437ed085f1803097"
        ],
        "content": "# AI Coding Memory Protocol\n\nThis org is the shared memory of a software team whose members work with AI coding assistants (Claude Code, Codex, Cursor, ...). Every member and every tool reads and writes the same records. **Nothing is captured automatically except the session record** (see below): you only remember what you explicitly save, and you only know what you explicitly retrieve.\n\nThe companion guidelines (**Identifier Standard**, **Work Lifecycle Standard**, **Graph Linking Standard**, **Write Safety and Concurrency**, **Retrieval Playbook**) are reference material. Fetch one (`memory_retrieve(mode:\"scout\", message:\"<guideline name>\", sources:{documents:true})`) the first time in a session you write a type or answer a question it covers, not at session start.\n\nTool note (once, for every `memory_save` call in these guidelines): on the `core` tool list `memory_save` addresses a record with `record:{id | email | websiteUrl | customKey:{name,value}, entityType}` and a document with `docType`; on the `legacy` list the same fields are `record_id`, `customKeyName` + `customKeyValue`, `type`. The examples use the `core` form.\n\n## Who you are, and your session key\n\n- **Me** = the human's work email (from their instructions). **Tool** = `claude-code` | `codex` | `cursor` | `copilot` | `other`.\n- **Project key** = `git remote get-url origin` → `<owner>/<repo>`, lowercased.\n- **Session key** = `<tool>:<native session id>`, or if you cannot read your session id, `<tool>:<yymmdd-hhmm>-<email local part>-<4 random [a-z2-7]>`. Generate it once and reuse it for the whole session.\n- **author** on every structured write = `<email> via <tool> <session_key>`.\n\n## Setup: each teammate, once\n\nThe kit only works if every person's assistant is set up the same way. Each teammate needs:\n\n1. **Their own Personize API key for this org** (never share keys; never paste one into memory, a doc, or a chat that gets saved).\n2. **The MCP server** pointed at this org with the agent profile: `https://agent.personize.ai/mcp/stream?organizationId=<org id>&profile=agent`. Without `organizationId` the server rejects calls; other profiles lack tools the kit needs.\n3. **A Person record** for them (`type:\"person\"`, key = work email, `display_name`), created before their first session so edges to them are not stubs.\n4. **Assistant instructions** (Claude Code: a block in `~/.claude/CLAUDE.md`) that say: use only this MCP server for team memory; me = <work email>, tool = <tool>; follow these guidelines; keep session start cheap (see *Session start: keep it cheap* below: no reads, no briefing); the work-state rules below; the write rules in *Write Safety and Concurrency*; before creating any task, run the overlap check in the *Work Lifecycle Standard*.\n5. **The session hook** (Claude Code): run `personize kits setup ai-coding-memory`. The CLI ships the hook and writes `~/.claude/hooks/team-memory/` (`config.json`, mode 600), and registers the hooks in `~/.claude/settings.json`. It does NOT edit CLAUDE.md: the *AI Coding Memory Setup Guide* gives the block, and the assistant adds it after asking the human. Flags: `--refresh`, `--dry-run`, `--email`, `--project <owner/repo>` with `--project-record <REC#…>` (give them together), and `--yes`. The API key comes from env `PERSONIZE_TEAM_MEMORY_API_KEY` or a hidden prompt, never on the command line, never in chat. See the *AI Coding Memory Setup Guide* for details and manual install. The `checkMessages` toggle in `config.json` (default `true`) makes the hook show the unread message count at session start. Failures are logged to `log.txt` in that folder. Other tools: create the session record yourself (see below).\n\nCheck it works: start a session in a listed repo, then filter `ai_session` by `session_key` = `claude-code:<session id>`. The record should exist with status `active` and `in_project` + `driven_by` edges.\n\n## The session record: a hook owns it where one is installed\n\nEvery session that is not archived must exist as an `ai_session` record. Where the team's session hook is installed (Claude Code: `~/.claude/hooks/team-memory/`), it does this with no model tokens: it creates the record at session start (status `active`, `in_project` + `driven_by` edges), refreshes `last_checkpoint_ms` + `branch` while the session runs, and sets `interrupted` when the session closes without a wrap-up. The hook tells you your session key at start. **Do not create a second session record.**\n\nWithout a hook, create the record yourself on the first real task (status `active`, `started_at_ms`, `last_checkpoint_ms`, `person_email`, `tool`, `branch`; edges `in_project` + `driven_by`).\n\nEither way, **you** write the content the hook cannot know: `title`, `goal`, `summary`, `next_steps`, `open_questions`, `worked_on_keys` (+ `worked_on` edges), at milestones and at wrap-up.\n\n## Session start: keep it cheap\n\n- No mandatory reads. Do not load all guidelines, and do not brief unprompted.\n- Exception: the session hook shows the unread message count. When it is > 0, offer to show the messages; you MUST NOT read them unprompted. Unattended runners do not check or answer messages.\n- When the human asks what is open / where we stopped, or before you touch an existing task, feature or error: run the matching **Retrieval Playbook** recipe with slim queries (`filters:{…, returnRecords:false}`, the fields you need).\n- Mark stale sessions only when you are already listing sessions: `active` with `last_checkpoint_ms` more than 8h old → `interrupted`.\n\n## Work state: you MUST record it\n\n| Situation | Record |\n|---|---|\n| Work the human wants done but **not now** (\"later\", \"add it to the list\", \"let's park this\") | Task `backlog` (or the type's equivalent below). The human deferring it counts as accepting it |\n| Work being done **now** | Task `in_progress`, `owner_email` = me (claim + re-read) |\n| Work started but stopped, waiting on something | `blocked` + `blocked_reason` |\n| Work finished | `done` with `resolution` + `verification` |\n| Something you suggested that the human has not taken up | **Nothing.** A suggestion is not a record until the human accepts it or asks you to note it (`proposed`) |\n\nThe same split applies to every type: feature `approved` (later) / `in_progress` (now); error `open` (later) / `investigating` (now); inquiry `open` (waiting) / `testing` (being checked); decision `proposed` (to decide) / `accepted` (decided). At wrap-up, every piece of work touched this session must be in one of these states: nothing in flight is left only in the conversation.\n\n## When to write: ONLY these triggers\n\n| Trigger | Write |\n|---|---|\n| The human **accepts** work, defers it, or asks you to note a proposal/question | Create or update Task / Feature / Decision / Inquiry (table above) |\n| **Before** creating a task | The overlap check (*Work Lifecycle Standard*): search open and recent work, link or reuse what overlaps, and message the owner before changing a task someone else owns |\n| Status, owner or blocker changes; a claim | Update the record + a `kind:status-change` memory with the reason |\n| An error is investigated | Error record (fingerprint key) + a `kind:attempt` memory per attempt |\n| A hypothesis is formed or tested | Inquiry (`kind:hypothesis`) + outcome/evidence |\n| A PR is opened or merged, a deploy or release happens | Event record + `implements` / `fixes` / `ships` / `includes` edges |\n| Verification passes (tests, repro, smoke check) | `verification` on the task/error + `kind:evidence` memory |\n| Milestone (a fix lands, a decision is made, direction changes) | Session `summary`, `next_steps`, `open_questions`, `worked_on_keys` + `worked_on` edges |\n| The human asks you to tell or message a teammate | A Message record, ONE PER RECIPIENT (no broadcast messages), plus `sent_by`, `sent_to` and `in_project` edges; add `regarding` when it is about a record |\n| Wrap-up (\"done for today\", \"wrap up\", end of the task) | Final session content + status `ended` + `ended_at_ms`; every touched task in a state from the table above |\n\nNo timed checkpoints: the hook keeps the session alive; write content only when something changed.\n\n## Documents on records\n\nLonger material that belongs to one record (a handoff, a design note, a test report, a runbook for a task) is a **document linked to the record**, not a property and not a memory.\n\n- **Attach:** `memory_save(shape:\"document\", docType:\"<doc type>\", record:{id:\"<REC#…>\"}, name:\"<kebab-name>\", content:\"<markdown with ## sections>\", options:{enrich:false, mode:\"sync\"})`. `enrich:false` stores it verbatim at 0 credits. There is **one document per record + type**: saving again with the same record and type adds to that document. Use `reference` for notes and reports, `brief` for a summary, `playbook` for steps.\n- **Update one part:** same call plus `targetIds:[\"<docId>\"]`, `updateMode:\"section\"` (or `appendToSection` / `append` / `replace`) and `sectionHeader:\"## <Section>\"`. Never `replace` a document you did not write without the human's say-so.\n- **Files:** the old attachment-upload tool is retired and has no successor in this kit. Keep file content out of memory: put a short summary in the document and a ref (path, URL, commit) to the file.\n- **List a record's documents:** scout the record with `sources:{documents:true}` and no `message`. They come back in `documents.must` with `relationship:\"about\"`. With a `message`, the record's own documents come first in `must`, followed by org-wide documents that match the topic.\n- Mention the document in the record's memory or `refs` only when it changes what someone should do next; do not copy its content into memories.\n- **A document saved for a just-created record links.** You do not have to set the record's fields before attaching a document; a record whose database row is still pending is repaired by a background sweep. Read `graph.docLinks` in the document save response as a check: `docLinks.added` of 1 means the link was made.\n\n## Keep writes and reads small\n\n- One `memory_save` to create a record, one `memory_save(shape:\"property\", operations:[…])` to set its fields. Never rewrite fields that did not change.\n- Read with `memory_retrieve(mode:\"filter\", filters:{…, returnRecords:false})`: it returns the main fields only. Full records (`filters:{…, returnRecords:true}`) only when you need a field that is missing.\n- Scout one record with `memories.limit ≤ 10` unless you need its history.\n\n## What never goes in memory\n\n- Secrets, tokens, keys, passwords, connection strings, customer PII, customer data samples.\n- Raw transcripts, full diffs or full logs: save a short summary and a ref (commit, PR, file path) instead.\n- Anything git already records precisely (use a ref).\n- Restatements: before writing, compare with the record's current state; if nothing changed, do not write.\n\n## Memory format\n\nEvery freeform memory (`memory_save` content) starts with one header line:\n\n```\n[by:<email> via:<tool> session:<session_key> kind:<fact|progress|attempt|status-change|evidence|context> refs:<pr/…, commit/…, keys>]\n<2-8 lines of content>\n```\n\nKeep facts, proposals, hypotheses and open questions separate: facts are `kind:fact`/`evidence`; proposals, hypotheses and questions are **Inquiry records**, not facts.\n\n## Failure honesty: you MUST\n\n- Only say something was saved after the tool returned success. Retry a failed write once.\n- If it still fails, tell the human **\"NOT saved to team memory: <what> (<error>)\"**, keep it on a pending list, and retry at the next milestone.\n- If a read fails, say **\"I could not check team memory\"**, never answer as if you had checked.\n- After any status or owner change, read the record back to confirm.\n\n## Ignore\n\n`personize_md` may mention \"handoffs teammates left for you\". That feature no longer exists; handoffs are AI Session records, and messages are explicit notes to a named person.\n"
      },
      {
        "slug": "identifier-standard",
        "upsertAllowed": true,
        "name": "Identifier Standard",
        "description": "Exact key formulas per entity type (including messages) and the error fingerprint algorithm, so every assistant reaches the same record.",
        "tags": [
          "ai-coding-memory",
          "identifiers"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "30053edf6751d6fd425238944fff9cd6bc32edd9bf23e09170cee32df47a1263",
          "a6d0bade2c8f6234d318caebf046039a37030ca3d52637f4e3f5dc6c8eeae763"
        ],
        "content": "# Identifier Standard\n\nPersonize does not generate or validate keys. A record's identity is `type` + `customKeyName` + `customKeyValue`, hashed by the platform. **The same type, key name and value always reach the same record** (case-insensitive). So every person and every tool MUST build keys exactly as below, or duplicates appear.\n\n## Rules: you MUST\n\n- Identify records ONLY by `type` + `customKeyName` + `customKeyValue` (Person: `type:\"person\"` + `email`). **Never** use `name` as an identity parameter: it is a weak alias that can fuse unrelated records.\n- Write keys lowercase. A key never changes; if something is renamed, change `title`, not the key.\n- Always pass `type` (it is part of the identity). A task key under `type:\"feature\"` is a different record.\n- Store the key in its key property too (`task_key`, `feature_key`, ...) so filters show it.\n- Prefer keys you can **rebuild from facts** (git remote, PR number, email, error text). Generate random keys only when nothing natural exists.\n\n## Key formulas\n\n| Type (`type`) | customKeyName | Formula | Example |\n|---|---|---|---|\n| Person (`person`) | none, use `email` | work email, lowercased | `dev@example.com` |\n| Project (`project`) | `project_key` | `<owner>/<repo>` from `git remote get-url origin` (strip host, `.git`), lowercased; a kebab slug if no repo | `acme/app` |\n| Feature (`feature`) | `feature_key` | `<project_key>/f/<kebab-slug>`; slug matches branch `feat/<slug>` when there is one | `acme/app/f/invoice-export` |\n| Task (`task`) | `task_key` | tracker id if it exists: `<project_key>/gh#<n>` or `<project_key>/jira:<key-n>`; else `<project_key>/t/<yymmdd>-<rand4>` | `acme/app/t/260923-k4q9` |\n| Decision (`decision`) | `decision_key` | `<project_key>/d/<kebab slug of the question>` | `acme/app/d/csv-export-storage` |\n| Inquiry (`inquiry`) | `inquiry_key` | `<project_key>/<p\\|h\\|q>/<yymmdd>-<rand4>` (p proposal, h hypothesis, q question) | `acme/app/h/260923-x8r2` |\n| Error (`error`) | `error_key` | `<project_key>/e/<fp12>` (fingerprint below) | `acme/app/e/3f9a1c07b2d4` |\n| Event (`event`) | `event_key` | `<project_key>/pr/<n>` · `<project_key>/commit/<sha12>` · `<project_key>/deploy/<env>/<ci-run-id or yymmddThhmm>` · `<project_key>/release/<tag>` · `<project_key>/ci/<run-id>` | `acme/app/pr/821` |\n| AI Session (`ai_session`) | `session_key` | `<tool>:<native session id>`; else `<tool>:<yymmdd-hhmm>-<email local part>-<rand4>` | `claude-code:510c7129-da95-4db0-8db1-a7136eb345c9` |\n| Message (`message`) | `message_key` | `<project_key>/m/<yymmdd>-<rand4>` | `acme/app/m/261002-k4q9` |\n\n`<rand4>` = 4 random characters from `abcdefghijklmnopqrstuvwxyz234567`. `<yymmdd>` in UTC.\n\n## Before creating a record with a random key: you MUST check for an existing one\n\nTasks, inquiries (and decisions whose slug you are unsure of) are found by filter, not by key. Before creating one, filter by `project_key` (+ `feature_key` / `concerns_key`) and non-terminal status, and compare titles. If one looks equivalent, ask the human instead of creating a duplicate. If a duplicate is created anyway, close it as `cancelled` / `dropped` with a `duplicate_of` edge to the survivor.\n\n**Messages are exempt from this check.** A message is one record per recipient and is always a new record, so you MUST NOT look for an existing one or compare titles; you MUST create a fresh `message_key` for every recipient.\n\n## Error fingerprint: you MUST compute it exactly like this\n\n1. Start from `<ErrorClass>: <message>` (first line only).\n2. Replace, in order: UUIDs → `<uuid>`; ISO/epoch timestamps → `<ts>`; hex runs of 8+ chars → `<hex>`; quoted strings longer than 40 chars → `<str>`; remaining numbers → `<n>`; absolute paths → path relative to the repo root.\n3. Append ` @ <file>:<function>` of the topmost stack frame inside the repo (relative path, no line/column). Omit if there is no in-repo frame.\n4. Collapse whitespace to single spaces, trim, lowercase. This string is the `signature` property.\n5. `fp12` = first 12 hex chars of `sha1(signature)`.\n\nReference (JavaScript):\n\n```js\nimport { createHash } from 'crypto';\nexport function errorSignature(firstLine, frame /* 'src/export/csv.ts:streamPage' | '' */) {\n  let s = firstLine\n    .replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, '<uuid>')\n    .replace(/\\d{4}-\\d{2}-\\d{2}T[\\d:.]+Z?|\\b\\d{13}\\b/g, '<ts>')\n    .replace(/\\b[0-9a-f]{8,}\\b/gi, '<hex>')\n    .replace(/([\"'`])[^\"'`]{41,}\\1/g, '<str>')\n    .replace(/\\d+/g, '<n>');\n  if (frame) s += ` @ ${frame}`;\n  return s.replace(/\\s+/g, ' ').trim().toLowerCase();\n}\nexport const fp12 = (sig) => createHash('sha1').update(sig).digest('hex').slice(0, 12);\n```\n\nReference (Python):\n\n```python\nimport hashlib, re\ndef error_signature(first_line, frame=''):\n    s = re.sub(r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', '<uuid>', first_line, flags=re.I)\n    s = re.sub(r'\\d{4}-\\d{2}-\\d{2}T[\\d:.]+Z?|\\b\\d{13}\\b', '<ts>', s)\n    s = re.sub(r'\\b[0-9a-f]{8,}\\b', '<hex>', s, flags=re.I)\n    s = re.sub(r'([\"\\'`])[^\"\\'`]{41,}\\1', '<str>', s)\n    s = re.sub(r'\\d+', '<n>', s)\n    if frame: s += f' @ {frame}'\n    return re.sub(r'\\s+', ' ', s).strip().lower()\nfp12 = lambda sig: hashlib.sha1(sig.encode()).hexdigest()[:12]\n```\n\nAbsolute-path relativization happens before calling these (pass repo-relative paths).\n\n## Secondary keys\n\nA Person may carry extra keys (e.g. `github_login`) added with `memory_save(shape:\"identifiers\", record:{…}, add:[{name:\"github_login\", value:\"<login>\"}])`. Always prefer email for lookups and links.\n"
      },
      {
        "slug": "work-lifecycle-standard",
        "upsertAllowed": true,
        "name": "Work Lifecycle Standard",
        "description": "Allowed statuses, transitions and required evidence for tasks, features, decisions, inquiries, errors, events, sessions and messages.",
        "tags": [
          "ai-coding-memory",
          "lifecycle"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "319d9a5a59c08e08f3c1eb3fa5be211669bee0b45db7d41e24fb77934c0576f7",
          "7534173fa12ab733318cb5349842bde64a5357e2466da3413012db5d3f5276be",
          "a5b12d74cab2b50c559feeb67c38a13f1aeb0e8fd7f5f6235b1fa20ad67bcfc0",
          "e6a4b83ff6950c0cbc025a0b3a17200f4ac0263c4e3634560ad48db8993a52fd"
        ],
        "content": "# Work Lifecycle Standard\n\nAllowed statuses, transitions and the evidence each transition requires, for tasks, features, decisions, inquiries, errors, events, AI sessions and messages. Rule of thumb for every type: work deferred for later sits in the \"accepted, not started\" status (`backlog`, `approved`, `open`), work being done now sits in the active status (`in_progress`, `investigating`, `testing`) with an owner (see the protocol's *Work state* table). The platform does not enforce these values on direct writes: **you** do. Use only the listed values, lowercase. Set `status_changed_at_ms` on every status change and add a `kind:status-change` memory with the reason.\n\n## Task\n\n```\n(suggestion in conversation: NOT a record)\nproposed ──human accepts──▶ backlog ──claim──▶ in_progress ⇄ blocked\nin_progress ──PR opened──▶ in_review ──merged + verified──▶ done\nany ──▶ cancelled            done ──reopen──▶ backlog | in_progress\n```\n\n| Status | Required |\n|---|---|\n| `proposed` | The human asked to note it but did not commit to it |\n| `backlog` | The human **explicitly accepted** the work (\"yes, add it\", \"let's do it\") |\n| `in_progress` | `owner_email` set (the claim, see Write Safety and Concurrency) |\n| `blocked` | `blocked_reason`, and `blocked_by_keys` + `blocked_by` edge when the blocker is a record |\n| `in_review` | PR Event exists; `implements` edge from it |\n| `done` | `resolution` (outcome + PR/commit ref) **and** `verification` (what was run and the result) |\n| `cancelled` | `resolution` with the reason (or `duplicate_of` edge) |\n| reopen | A `kind:status-change` memory saying why |\n\n### Before creating a task: overlap check (you MUST)\n\nRun this before every new task, sub-tasks you split out included. Two tasks that overlap with no link between them is how two people end up doing the same work without knowing it.\n\n1. **Search.** Run the Retrieval Playbook recipe *Is this work already tracked?*: tasks in every repo the new task touches with status `backlog`, `in_progress`, `blocked` or `in_review`, `done` / `cancelled` tasks changed in the last 30 days, and open features and errors in the project.\n2. **Compare** each candidate's `title`, `summary`, `acceptance` and `refs` with the new task. Shared files or modules in `refs` are the strongest signal: a title often names only part of the work.\n3. **Decide** an outcome for each candidate from the table below. More than one row can apply (a parent and a blocker, for example).\n4. **Tell the human** what you found before you create anything: one line per candidate with its key, status, owner and outcome. Continue on its own for rows marked *auto*. Wait for the human on rows marked *ask*.\n\n| Found | Outcome | Decided by |\n|---|---|---|\n| Unrelated | Nothing | auto |\n| A **broader** task that includes the new work | Create the new task as its sub-task: `parent_task_key` + `subtask_of` edge. If that parent already has a sub-task with the same scope, it is a duplicate (row below) | auto |\n| A **narrower** task that fits inside the new work | Create the new task and make it the candidate's parent (`parent_task_key` + `subtask_of` edge on the candidate). If the candidate already has a parent, ask. If someone else owns the candidate, use the owner message rule below | auto / message |\n| A **duplicate** (same scope) | Do not create. Unowned (`owner_email` empty or `unassigned`): claim or update that task instead. Owned: tell the human who owns it | ask |\n| A **partial overlap** (shared scope, neither contains the other) | Create the new task. Add a `related_to` edge on both tasks (one each way) and put the other key in the new task's `related_keys`. Write the shared part in its `next_step` | auto |\n| An **order dependency** (one must land first: same files, or a schema the other needs) | `blocked_by` edge + `blocked_by_keys` on the task that waits | auto |\n| Same scope already **`in_review` or `done`** | Do not create a duplicate. Extra work on top of it is a new task with a `follows_up` edge to the earlier one | ask |\n| Same scope **`cancelled`** recently | Show the human its `resolution` (why it was cancelled) before creating | ask |\n| A **conflict** (goals or approaches contradict) | Stop. Show both to the human and create nothing until they decide | ask |\n| Covered by an open **feature** or **error** | `part_of` the feature (`feature_key`). For an error, put its key in `refs`; the PR gets the `fixes` edge later | auto |\n\nEdges and memory notes may be added to anyone's task. Changing the properties of a task someone else owns (its parent, `related_keys`, scope, status) goes through the owner message rule.\n\n### Changing a task someone else owns: owner message rule (you MUST)\n\n1. Do **not** change that task. Send its owner a **Message** (see *Message* below): `sender_email` = me, `recipient_email` = the owner, `title` = the change you want, `body` = the new task's key, the overlap and the proposed change, `about_keys` = both task keys, with `regarding` edges to both tasks.\n2. On the new task, say in `next_step` and in a `kind:context` memory that the change waits on message `<message_key>`.\n3. Change nothing on the owner's task until the owner **replies** (a message whose `reply_to_key` is yours) or sets your message to `archived`. Then re-read their task and act on the reply. Archived without a reply means the owner handled it themselves: re-read and do not redo what they changed.\n\nIf the org has no `message` type yet, add a `kind:context` memory on the owner's task addressed to them, ask the human to tell the owner, and change nothing.\n\n## Feature\n\n`idea → proposed → approved → in_progress ⇄ blocked → in_review → shipped | abandoned`\n\n- `approved` requires explicit human acceptance. `shipped` requires a deploy/release Event with a `ships` edge.\n- `current_state` is the start-here paragraph: rewrite it when the picture changes; don't append.\n- Reopen `shipped → in_progress` with a reason memory.\n\n## Decision\n\n`proposed → accepted | rejected`; `accepted → superseded` (only via a new decision).\n\n- `accepted` requires `decision`, `rationale`, `decided_by_emails`, `decided_at_ms`.\n- **Never edit an accepted decision's substance.** To change course: create a new decision with `supersedes_key` + `supersedes` edge; set the old one to `superseded` with `superseded_by_key`.\n- A decision that answers a question or accepts a proposal sets `resolves_inquiry_key` + a `resolves` edge.\n\n## Inquiry (proposal, hypothesis, question)\n\n| kind | Transitions | Closing requires |\n|---|---|---|\n| `proposal` | `open → accepted \\| rejected \\| withdrawn` | accepted: `outcome_key` of the task/feature/decision it became |\n| `hypothesis` | `open → testing → confirmed \\| refuted \\| inconclusive` | `outcome` with the evidence, plus a `kind:evidence` memory |\n| `question` | `open → answered \\| dropped` | `outcome` = the answer; if the answer is a decision, create the Decision too |\n\nHypotheses about an error's cause are Inquiries with `concerns` → the error. A confirmed hypothesis updates the error's `root_cause` and sets `root_cause_confidence:\"confirmed\"`.\n\n## Error\n\n`open → investigating → fix_attempted → resolved | wont_fix`\n\n- `fix_attempted` = a change was applied but **not proven**. Never jump from a plausible fix straight to `resolved`.\n- `resolved` requires `verification` (the reproduction or test that failed before and passes now, with its result) and `root_cause_confidence` = `confirmed`, or a stated reason in `verification` why it cannot be confirmed.\n- Each attempt is a `kind:attempt` memory: *what was tried → what happened*.\n- Update `last_seen_ms` when it recurs. A recurrence after `resolved` → back to `open` with a regression note (same record, the fingerprint is the same).\n\n## Event\n\nMirror of an external fact. Record it when you create or observe it.\n\n| kind | Statuses |\n|---|---|\n| `pr` | `open`, `merged`, `closed` |\n| `commit` | `recorded` |\n| `deploy` | `started`, `succeeded`, `failed`, `rolled_back` |\n| `release` | `published`, `withdrawn` |\n| `ci_run` | `passed`, `failed` |\n\n## AI Session\n\n`active → ended`, or `active → interrupted`; `interrupted → active` when the same session is resumed.\n\n- A session is `ended` only by its own wrap-up (the assistant writes it). The session hook never sets `ended` and never overwrites it.\n- `interrupted` = closed without a wrap-up: set by the session hook when the session closes, or by any later session in the project when an `active` session's `last_checkpoint_ms` is more than 8h old (a crash, or no hook). Its last `summary` / `next_steps` is the handoff; reconcile it against `git log` on its `branch`.\n- `last_checkpoint_ms` is the last sign of activity: the hook refreshes it about every 15 minutes while the session runs.\n- A session that picks up another's work sets `continues_session_key` + a `continues` edge.\n\n## Message\n\n`unread → read → archived`. A new message is always created `unread`.\n\n- You MUST set `read_at_ms` when the status becomes `read`, and `status_changed_at_ms` on every status change.\n- Only the recipient (`recipient_email`) changes the status. The sender and everyone else MUST NOT.\n- You MUST NOT mark a message `read` unless the human has agreed to read it.\n- `priority` is `normal` (default) or `urgent`.\n- Nobody edits `body` after sending; send a reply (new message with `reply_to_key` + a `replies_to` edge) instead.\n"
      },
      {
        "slug": "graph-linking-standard",
        "upsertAllowed": true,
        "name": "Graph Linking Standard",
        "description": "Relation catalog (including message edges), edge direction rule, how to write edges, and which edges are required.",
        "tags": [
          "ai-coding-memory",
          "graph"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "0f16cc32c1b6819672fd776ba48238d0ed449163d917d733d342212ba57a81f9",
          "52aa5d1da3518b8588e1e061b5e583f91a7268d1b5e8b71c1123ebd4bad6a781",
          "8e2bc5e4ef1a0aba87b77bdd159875a2465b7027a6039c7229cd2f6a261b005a",
          "95d3235a31dc7c867764cc4ed49b163aefa56699f689b4532caf8a41bf526c97",
          "d9cf384d13b41c5fbc52e85ce471ca5b23a4cf8c59663dad92ea34a51146a8d9"
        ],
        "content": "# Graph Linking Standard\n\nThe graph connects people, work and delivery so any record can be understood in one lookup. Only the relation types below may be used: an unregistered type is silently stored as a generic edge, which pollutes the graph.\n\n## Direction rule: you MUST\n\nGraph reads return **outgoing edges only**. Every edge points **from the specific record to the context it needs**: child → parent, work → person, event → what it touched, session → what it worked on. Scouting any record then shows its context.\n\n`related_to` is the one relation written on **both** records (one edge each way), because overlapping work has no parent side and either task must show the other.\n\nReverse questions (\"all tasks of feature X\", \"everything Y owns\") are answered with **property filters**, not the graph. That is why each core edge is mirrored by a key property (`feature_key`, `owner_email`, `project_key`, ...). Always write both: the property is the exhaustive source of truth; the edge is for navigation.\n\n## How to write an edge: you MUST\n\nEdges are written with `memory_save` **on the source record**, and `content` is mandatory (edges sent without content are dropped):\n\n```\nmemory_save(\n  record:{ customKey:{ name:\"task_key\", value:\"<key>\" }, entityType:\"task\" },\n  content:\"[by:… via:… session:… kind:context refs:…] Linked to feature f/invoice-export, owner dev@…\",\n  relations:[\n    { relationType:\"part_of\",  toEntityType:\"feature\", toRecordId:\"<feature recordId>\" },\n    { relationType:\"owned_by\", toEntityType:\"person\",  toIdentity:{ kind:\"email\", value:\"dev@example.com\" } }\n  ],\n  options:{ mode:\"sync\" })\n```\n\n- **Person targets:** `toIdentity:{kind:\"email\"}` with `toEntityType:\"person\"`.\n- **Every other target:** `toRecordId`. Get it from the target's save response, or with a filter on its key property: `memory_retrieve(mode:\"filter\", filters:{crmFilter:{type}, groups:[{conditions:[{property:\"<type>_key\", operator:\"EQ\", value:\"<key>\"}]}], returnRecords:false})` → `recordIds[0]`. Do **not** use a keyed scout (`record:{customKey:…}`) to find it: it currently returns \"unresolved\" for these types. Keep a key → recordId map for the session.\n- **Check the edge landed:** after linking, scout the source by `record:{id:<recordId>, type}` with `sources:{graph:true}`. An empty graph means the edge was dropped (the save still reports success). Say **\"NOT saved to team memory: edge <relation>\"**, do not retry in a loop.\n- Do **not** set `smartGraph` or `collectionGraph`. Never infer edges from conversation text.\n- Link only records whose keys you resolved **in this session** and that the human confirmed are involved. When a conversation mentions several tasks, projects or people, do not link the ones that were only mentioned.\n- Single-valued relations (marked 1) end the previous edge automatically when re-declared. That is how reassignment keeps history. Just declare the new edge.\n- To remove a wrong edge: `memory_delete` on the relation edge by its edge id (edge ids come from a graph scout), and note it in a memory.\n\n## Relation catalog\n\nC = core (required whenever the fact is known) · O = optional. Card 1 = single-valued. \"none\" = no mirrored property.\n\n| Relation | From → To | Card | Tier | Mirrors property |\n|---|---|---|---|---|\n| `in_project` | feature, task, decision, inquiry, error, event, ai_session, message → project | 1 | C | `project_key` |\n| `part_of` | task → feature · event(commit) → event(pr) | 1 | C | `feature_key` |\n| `subtask_of` | task → task | 1 | O | `parent_task_key` |\n| `owned_by` | task, feature, error, inquiry, project → person | 1 | C | `owner_email` |\n| `created_by_person` | task, feature, decision, inquiry, error → person | 1 | O | `created_by_email` |\n| `decided_by` | decision → person | N | C | `decided_by_emails` |\n| `directed_to` | inquiry → person | N | O | `directed_to_email` |\n| `performed_by` | event → person | 1 | C | `actor_email` |\n| `reviewed_by` | event(pr) → person | N | O | none |\n| `driven_by` | ai_session → person | 1 | C | `person_email` |\n| `has_manager` | person → person | 1 | O | none |\n| `contributes_to` | person → project | N | O | none |\n| `blocked_by` | task, feature → task, feature, inquiry, error | N | C | `blocked_by_keys` |\n| `depends_on` | feature → feature | N | O | `depends_on_keys` |\n| `duplicate_of` | task→task, error→error, inquiry→inquiry | 1 | C | none |\n| `follows_up` | task → task, error, decision | N | O | none |\n| `related_to` | task, feature → task, feature | N | O | `related_keys` |\n| `implements` | event(pr, commit) → task, feature | N | C | `related_keys` |\n| `fixes` | event(pr, commit) → error | N | C | error `fixed_by_keys` |\n| `includes` | event(deploy, release) → event(pr, commit) | N | C | none |\n| `ships` | event(deploy, release) → task, feature | N | C | `related_keys` |\n| `rolls_back` | event(deploy) → event(deploy) | 1 | O | none |\n| `seen_in` | error → task, feature, event(deploy, ci_run), ai_session | N | C | none |\n| `introduced_by` | error → event | 1 | O | `introduced_by_key` |\n| `tracked_by` | error → task | N | O | none |\n| `supersedes` | decision → decision | N | C | `supersedes_key` |\n| `applies_to` | decision → feature, task, project | N | C | `applies_to_keys` |\n| `resolves` | decision, task, event → inquiry | N | O | `resolves_inquiry_key` / `outcome_key` |\n| `concerns` | inquiry → task, feature, error, decision, event | 1 | C | `concerns_key` |\n| `worked_on` | ai_session → task, feature, error, decision, inquiry, event, message | N | C | `worked_on_keys` |\n| `continues` | ai_session → ai_session | 1 | C | `continues_session_key` |\n| `sent_by` | message → person | 1 | C | `sender_email` |\n| `sent_to` | message → person | 1 | C | `recipient_email` |\n| `replies_to` | message → message | 1 | O | `reply_to_key` |\n| `regarding` | message → task, feature, error, decision, inquiry, event | N | O | `about_keys` |\n\n## Reading the graph\n\nScout with `sources:{graph:true}`, `intent.perSource.graph:{resolveIdentity:true, relationTypes:[…], limit ≤ 50}`. Use `hops:2` only when needed (e.g. deploy → PR → task). Persons created implicitly by an edge are stubs and hidden unless `includeStubs:true`; the team should create Person records up front.\n"
      },
      {
        "slug": "write-safety-and-concurrency",
        "upsertAllowed": true,
        "name": "Write Safety and Concurrency",
        "description": "Create-then-update, no upsert, read-before-write, claim-then-verify, message creation fields and recipient-only status changes, and honest failure reporting.",
        "tags": [
          "ai-coding-memory",
          "protocol"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "884722db845583056eeb851102a61249ae038612e5fa038e9e0574c258f645a7",
          "b16e94acd16997928217a46a99c03fda8b7f12487364a0b5ae25affa5b10eec3",
          "bca3c2b7d9d81f4cf01074cdb50e1a90c194817a48eab87ef2c8e712b9465849",
          "e3421ea68cdd75f7fcad0ceeb6a76f02757e874b671dc9de8847ddc9b4dab47a"
        ],
        "content": "# Write Safety and Concurrency\n\nSeveral people and assistants write the same records at the same time, and the platform has **no locking**: a `set` is last-writer-wins, and array pushes can lose updates. These rules keep shared state correct.\n\n## How to create and update records: you MUST\n\n1. **Never pass `properties` to `memory_save` for these entity types, and do not use the old `memory_upsert` or `memory_update_properties` tools (retired).** With a custom key they resolve to a different record than every other tool, creating a split duplicate. Write fields with `memory_save(shape:\"property\", …)` (step 3).\n2. **Create** with content (the `core`/`legacy` field note is in the protocol):\n   `memory_save(record:{customKey:{name:\"<type>_key\", value:\"<key>\"}, entityType:\"<type>\"}, content:\"<header> <what this is>\", options:{mode:\"sync\"}, relations:[…])`.\n3. **Set structured fields** on the same key:\n   `memory_save(shape:\"property\", record:{customKey:{name:\"<type>_key\", value:\"<key>\"}, entityType:\"<type>\"}, operations:[{op:\"set\", property:\"status\", value:\"backlog\"}, …])`. Put `<email> via <tool> <session_key>` in `updated_by` (the operations carry no author field).\n   Always include `<type>_key`, `project_key`, `title`, `created_by_email`, `created_at_ms` on creation (tasks also `summary`), and `updated_by` + `last_session_key` on every write.\n   For a **message**, creation requires `message_key`, `project_key`, `title`, `created_by_email`, `created_at_ms`, `sender_email`, `recipient_email`, `body`, `status:\"unread\"`, `status_changed_at_ms`, `updated_by`, `last_session_key`. Optional: `thread_key`, `reply_to_key`, `about_keys`, `priority`.\n4. **Read back** after creating or after any status/owner change (`memory_retrieve(mode:\"fetch\", fetch:{propertyNames:[{recordId, names:[…]}]})`). If a value is not what you wrote, report it.\n5. Do not use `expectedVersion`: it is not reliable on this platform.\n6. Do not use the `push` operation on array properties. Log history as freeform memories; `*_keys` and `refs` fields are replaced whole.\n7. Never hard-delete records. Close them with a status (`cancelled`, `dropped`, `withdrawn`, `archived`).\n\n## Read before write: you MUST\n\nImmediately before changing `status`, `owner_email`, `blocked_*` or a decision's `status`:\n\n- Re-read the record. If the value differs from what this session last saw, **do not overwrite**. Tell the human what changed and who changed it (`memory_retrieve(mode:\"fetch\", fetch:{propertyHistory:[{recordId, propertyName}]})` shows the writer), and ask how to proceed.\n\n## Claim, then verify: you MUST\n\nTo start work on a task: set `owner_email` = me and `status` = `in_progress`, then **re-read**. If `owner_email` is not me, someone else claimed it at the same moment, so you lost the race; tell the human.\n\n## Other people's work: you MUST NOT\n\nChange `status` or `owner_email` on a record owned by another person unless the human explicitly asks. Adding a memory note or an edge (e.g. `seen_in`, `related_to`) is always allowed. Any other change to a task someone else owns (its parent, scope, links kept in properties) goes through the owner message rule in the *Work Lifecycle Standard*.\n\nException: the recipient MAY set `status`, `read_at_ms` and `status_changed_at_ms` on a message addressed to them; `status_changed_at_ms` MUST be set on every status change. Nobody edits `body` after sending; send a reply with a `replies_to` edge instead.\n\n## Stale information\n\nIf your session has been running for a while, re-read any record before relying on it for a decision or a write. Never answer \"what's left\" from what you loaded at session start; re-run the query.\n\n## Failures: you MUST\n\n- Treat a write as done only on a success response. Retry once.\n- On repeated failure, say **\"NOT saved to team memory: <what> (<error>)\"**, keep it on the session's pending list, and retry at the next checkpoint.\n- If reads fail, say **\"I could not check team memory\"**.\n- Never claim a record was created, updated, checked or linked without a successful response.\n"
      },
      {
        "slug": "retrieval-playbook",
        "upsertAllowed": true,
        "name": "Retrieval Playbook",
        "description": "Query recipes for remaining tasks, decisions, teammate changes, repeated errors, handoffs, deploys and unread messages.",
        "tags": [
          "ai-coding-memory",
          "retrieval"
        ],
        "agentDocType": "playbook",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "058b827f9075d3e32766d9b2339a3e4e7be541472dfc822cf30ea0cab3fcc16f",
          "214484134e7744e94e2e54d7868d9b4b2f6d77ccb0e2eb9415663dd449f8e01f",
          "2650d689b6c4fbf9ffe2743d581e5cb3861357ab7bbfb622ef9d7c0b199093ad",
          "69d20ae6ab4ef69f8d50b0f15b7210e88f9d1358903fc4e200e69119187d0cc2",
          "d55be68b6ec377e916f9b31f56e904d8c6e15a2e67676e8ca37320852fa5f10a",
          "deb7e035e57de95203978500e7ceca096627bc5217f863cb6e056980c0fa1fa9",
          "e01b27768d0b693f850e382fcc2ddf562c1968567de7c33ff462642ba8bb2bea"
        ],
        "content": "# Retrieval Playbook\n\nRecipes for the team's standard questions. Run them when the human asks, or before you act on existing work, not unprompted at session start. **State questions (what's left, who owns what, what's blocked) are answered from structured filters, never from a handful of search matches.**\n\n## Complete lists: you MUST\n\nUse `memory_retrieve(mode:\"filter\")` (a deterministic property filter, not a semantic search):\n\n```\nmemory_retrieve(mode:\"filter\", filters:{\n  crmFilter:{ type:\"task\" },\n  groups:[{ conditions:[\n    { property:\"project_key\", operator:\"EQ\", value:\"<project_key>\" },\n    { property:\"status\", operator:\"IN\", value:[\"backlog\",\"in_progress\",\"blocked\",\"in_review\"] }\n  ]}],\n  pageSize:200, page:1, returnRecords:false })\n```\n\n`returnRecords:false` returns each record's main fields (title, status, key, refs, priority, …) at a fraction of the size of full records, which is enough for every list below. Fetch full records only for a field that is missing. `returnRecords` goes INSIDE `filters`; at top level it is ignored and the result is full records (often megabytes).\n\n- Loop `page` until `pagination.totalPages`. Deduplicate by recordId and compare the count with `pagination.totalMatched`; if they differ (records changed while paging), run the query once more.\n- Report `proposed` items separately from accepted work.\n- Time ranges use the `*_ms` number properties with `GT` / `LT` (ISO strings do not range-filter).\n\n## Recipes\n\n| Question | Calls |\n|---|---|\n| **What tasks remain, who owns them, what is blocked?** | The filter above. Group by status and `owner_email`; for `blocked` show `blocked_reason` / `blocked_by_keys`. List `proposed` separately. |\n| **What did we decide about feature X, and why?** | Filter `type:\"decision\"`, `applies_to_keys CONTAINS <feature_key>` (all statuses). Present `accepted` first, then the supersede chain (`supersedes_key`). Scout the accepted decision for rationale memories. Flag two accepted decisions answering the same question. |\n| **What did teammate Y do since my last session?** | 1) My last session: filter `ai_session`, `person_email EQ me`, take the max `ended_at_ms` (or `last_checkpoint_ms`) = T. 2) Y's sessions: filter `ai_session`, `person_email EQ Y`, `started_at_ms GT T` → their `summary`, `next_steps`, and `worked_on` (scout with graph). 3) `memory_retrieve(mode:\"filter\")` per type with `updated_at_ms GT T` (a `*_ms` property), scoped to the project, for records changed outside sessions. 4) For changed status/owner fields, `fetch.propertyHistory` shows who changed what. |\n| **Have we seen this error before?** | Compute the fingerprint → filter errors `error_key EQ <key>` (see *Scouting one record*). If not found: filter errors `signature CONTAINS <most distinctive token>` in the project. Still nothing: `memory_retrieve(mode:\"scout\", message:<error text>)` restricted to type `error`, keep only records confirmed to be type `error`, and present them as *possible* matches. (`similar` is REST/SDK only, not on Personize Private, so do not use it here.) On a hit: show status, root cause (with confidence), attempts (memories), fix and verification. |\n| **Where did we stop, what next?** | Latest 1-2 `ai_session` records in the project (filter `project_key`, sorted by recency; any person): `summary`, `next_steps`, `open_questions`; then my `in_progress` / `blocked` tasks and inquiries `directed_to_email` me with status `open`/`testing`; and my unread messages (see *Do I have unread messages?*). |\n| **Do I have unread messages?** | `memory_retrieve(mode:\"filter\")` with `crmFilter:{type:\"message\"}`, conditions `recipient_email EQ me` and `status EQ unread`, count only (`countOnly:true`). Tell the human the number. Messages are only read when the human agrees; do not open or mark them read unprompted. |\n| **Show my inbox** | Same filter with `filters:{…, returnRecords:true}`, sorted descending by `created_at_ms`; add `status IN [unread, read]` to exclude archived messages. Results come back newest first (sorted by `created_at_ms` desc); group unread messages first when presenting them. Show sender, `title`, `priority`, `created_at_ms`. Read a `body` and set `status:\"read\"` + `read_at_ms` only when the human agrees. |\n| **What is Y working on?** | Tasks `owner_email EQ Y` with status `in_progress`/`blocked`/`in_review`, plus Y's `active` sessions. |\n| **What shipped in deploy D / what broke after it?** | Scout event D with graph `relationTypes:[\"ships\",\"includes\"]` (`hops:2` to reach tasks via PRs). Errors with `introduced_by_key EQ D`, or `first_seen_ms GT <D.occurred_at_ms>` in that environment. |\n| **What questions are waiting for me?** | Filter `type:\"inquiry\"`, `directed_to_email CONTAINS me`, status `IN [open, testing]`. |\n\n## Is this work already tracked? (before creating a task)\n\nThe search step of the overlap check (Work Lifecycle Standard). Fetch the open work in full and compare it yourself. Do not rely on `CONTAINS` matches on `title`: an overlapping task is often named after a different part of the work.\n\n1. Open tasks in every repo the new task touches (its `repo_keys`; the project alone when there is one):\n   ```\n   memory_retrieve(mode:\"filter\", filters:{\n     crmFilter:{ type:\"task\" },\n     groups:[{ conditions:[\n       { property:\"project_key\", operator:\"IN\", value:[\"<project_key>\", \"<other repo key>\"] },\n       { property:\"status\", operator:\"IN\", value:[\"backlog\",\"in_progress\",\"blocked\",\"in_review\"] }\n     ]}],\n     pageSize:200, page:1, returnRecords:false })\n   ```\n2. Recently closed: the same filter with `status IN [\"done\",\"cancelled\"]` and `status_changed_at_ms GT <now minus 30 days, in ms>`.\n3. Open features (`status IN [\"approved\",\"in_progress\",\"blocked\"]`) and errors (`status IN [\"open\",\"investigating\",\"fix_attempted\"]`) in the project.\n4. `filters:{…, returnRecords:false}` gives each task's `title`, `status`, key and `refs`. For every candidate whose title or `refs` come close, fetch the rest in one call: `memory_retrieve(mode:\"fetch\", fetch:{propertyNames:[{recordId, names:[\"summary\",\"acceptance\",\"owner_email\",\"parent_task_key\",\"related_keys\",\"next_step\"]}, …]})`.\n\nPage through every result as in *Complete lists*. If a call fails, say the check is incomplete and which part was not searched.\n\n## Scouting one record\n\n1. Resolve the key to a recordId: `memory_retrieve(mode:\"filter\", filters:{crmFilter:{type:\"<type>\"}, groups:[{conditions:[{property:\"<type>_key\", operator:\"EQ\", value:\"<key>\"}]}], returnRecords:false})` → `recordIds[0]`. (A keyed scout, `record:{customKey:…}`, currently returns \"unresolved\" for these types, so do not use it.)\n2. `memory_retrieve(mode:\"scout\", record:{id:\"<recordId>\", type:\"<type>\"}, intent:{perSource:{memories:{limit:10}, graph:{resolveIdentity:true, limit:50}}})`. Raise `memories.limit` (≤ 25) only when you need the history.\n3. Its documents: the same scout with `sources:{documents:true}` and no `message` lists every document linked to the record (see *Documents on records* in the protocol).\n\n## How to answer: you MUST\n\n- Current structured state first, then relevant history (memories, decisions).\n- Cite record keys with status, owner and freshness, e.g. `t/260923-k4q9 (in_progress, dev@…, updated 2h ago by lead@…)`.\n- Label proposals and hypotheses as such; never present them as facts.\n- Flag stale records (e.g. `in_progress` with no update for 7+ days) and conflicts.\n- If any call failed, say which part could not be checked.\n- Keep it proportionate: ~3-6 calls per question, pageSize ≤ 200, memories ≤ 25 per record.\n"
      },
      {
        "slug": "setup-guide",
        "upsertAllowed": true,
        "name": "AI Coding Memory Setup Guide",
        "description": "How to install, refresh, check and undo the session hook and assistant instructions; manual install and other tools.",
        "tags": [
          "ai-coding-memory",
          "protocol"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "7c04863189a7f06c3dc223d01be84366fe5d95b3133b5e9fa3fd351a3de92e11",
          "8b95c147aa02778f22e06bf140485dbae560cd16ff2a930176f6c59635fe89d4",
          "d757662c7c15f54204fcef7785a68d621b6cf5af3cdd6f332bf0805d97becbef"
        ],
        "content": "# AI Coding Memory Setup Guide\n\nHow one teammate sets up the session hook and the assistant instructions for Claude Code. Other tools are covered at the end. Read this when the human asks you to install, refresh, check or undo the setup, not at session start.\n\n## New install\n\nRun:\n\n```\npersonize kits setup ai-coding-memory [--email <work email>] [--project <owner/repo> --project-record <REC#…>] [--yes] [--dry-run]\n```\n\nFlags: `--refresh`, `--dry-run`, `--email`, `--project <owner/repo>` with `--project-record <REC#…>` (they must be given together), and `--yes`.\n\n- **Validation first.** `--project` and `--project-record` must be given together, and `--project` must look like `<owner>/<repo>` (it is lowercased).\n- **API key.** It comes from the env var `PERSONIZE_TEAM_MEMORY_API_KEY` or a hidden prompt. Never pass it on the command line.\n- It writes `session-hook.mjs` in `~/.claude/hooks/team-memory/` (a changed existing one is backed up to `session-hook.mjs.bak-<ts>`).\n- It writes `config.json` there as `{apiKey, email, apiBase, checkMessages:true, projects:{}}` plus the given project (`\"<owner>/<repo>\": {\"projectRecordId\":\"<REC#…>\"}`), file mode 600.\n- It adds the hooks to `~/.claude/settings.json`, backing the file up first (`settings.json.bak-<ts>`).\n- It shows a plan and asks for confirmation unless `--yes` is given.\n- `--dry-run` shows the plan and writes nothing.\n- Without `--yes`, a missing email is prompted. With `--yes`, `--email` is required.\n- The CLI does NOT edit CLAUDE.md. Add the block below yourself, after asking the human.\n\n## Refresh\n\n`personize kits setup ai-coding-memory --refresh` requires an existing `config.json`. It replaces `session-hook.mjs` (backing up the old one) and adds `checkMessages:true` if missing. It keeps the config values (key, email, projects) and does not touch `settings.json`.\n\n## Manual install\n\n1. Put the hook files in `~/.claude/hooks/team-memory/` and create `config.json` there with file mode 600.\n2. Register the hooks in `~/.claude/settings.json`. Each entry is `{hooks:[{type:\"command\", command:\"node \\\"<dir>/session-hook.mjs\\\" <mode>\", timeout:N, async?:true}]}`, where `<dir>` is the absolute hook folder:\n   - `SessionStart` `announce`, timeout 5, sync.\n   - `SessionStart` `record`, timeout 60, async.\n   - `Stop` `record`, timeout 60, async.\n   - `SessionEnd` `record`, timeout 15.\n\n## The CLAUDE.md block\n\nAdd this to `~/.claude/CLAUDE.md`, filling the placeholders:\n\n```\n## Team memory (Personize · ai-coding-memory kit)\nUse ONLY the <mcp server name> MCP tools for team memory (org <org id>, profile agent).\nMe: <work email>. Tool: claude-code. Project key = `git remote get-url origin` -> <owner>/<repo>, lowercased.\nFollow the org's AI Coding Memory guidelines: fetch them with memory_retrieve(mode:\"scout\", message:\"<guideline name>\", sources:{documents:true}) the first time\nyou need their rules in a session, not at session start.\nSession record: a hook creates my AI Session (session_key = claude-code:<session id>), keeps it alive and marks it\ninterrupted on close. Never create another one. Fill in title, goal, summary, next_steps, open_questions, worked_on_keys\nat milestones and on \"wrap up\" (then status ended + ended_at_ms).\nSession start: NO automatic reads or briefing. The hook shows the unread message count: offer to show them, never read\nthem unprompted. Only when I ask what's open / where we stopped, or before acting on an existing task/feature/error: run\nthe Retrieval Playbook recipe with `returnRecords:false` INSIDE `filters`, e.g.\nmemory_retrieve(mode:\"filter\", filters:{..., returnRecords:false}). Save large results to a file and parse them; never paste them.\nBefore creating a task, run the overlap check from the Work Lifecycle Standard.\nWrites: identity = record.customKey {name,value} + entityType (never `name`). NEVER memory_save(properties=…).\nCreate with memory_save(content, options:{mode:\"sync\"}), then memory_save(shape:\"property\", operations:[{op:\"set\", property, value}], ...) with updated_by = \"<email> via claude-code <session_key>\".\nBefore changing status/owner: re-read; if it changed since I last saw it, stop and ask.\nNever create tasks from your own suggestions unless I accept them.\nNever store secrets, credentials, customer PII, raw transcripts or full diffs.\nIf any Personize call fails, say \"NOT saved\" / \"could not check team memory\", never claim success.\n```\n\n## Checks\n\n- Start a session in a repo listed under `projects`. The start message shows the session key.\n- Filter `ai_session` by `session_key` = `claude-code:<session id>`: the record should exist with status `active`.\n- Problems are logged in `~/.claude/hooks/team-memory/log.txt`.\n\n## Undo\n\n- Remove the hook folder and the hook entries from `settings.json`, or restore the `.bak-*` files next to the originals.\n- Remove the CLAUDE.md block.\n\n## Other tools (Codex / Cursor)\n\nThere is no hook. The assistant creates the `ai_session` record itself, as the Protocol describes. Put the instruction block above in that tool's instructions file.\n\n## Rules\n\n- Ask the human before editing CLAUDE.md or settings.json.\n- Never ask for, or echo, the API key in chat.\n"
      },
      {
        "slug": "routine-playbook-customization",
        "upsertAllowed": true,
        "name": "Routine Playbook Customization",
        "description": "How an assistant turns a kit playbook template into the team's own routine playbook, keeps it current after kit upgrades, and adds new ones.",
        "tags": [
          "ai-coding-memory",
          "routine"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "content": "# Routine Playbook Customization\n\nThe guidelines named `Playbook: ...` that came with this kit are **templates**. Each one describes a recurring routine (cost watch, error summary, ticket triage, weekly digest and so on): its purpose, the data it reads, its output, its safety rules, and the judgment questions your team must answer. The templates name example sources for several stacks; none of them knows your systems. This guide is how an assistant turns a template into your team's own playbook, keeps it current when the kit is upgraded, and adds playbooks the kit does not ship.\n\n## Rule 1: never edit a template\n\nCopy it, then edit the copy. A kit upgrade updates every template you have not edited. A template you edited is kept as it is and stops receiving updates, so your rules and the kit's improvements end up mixed in one document that nobody can compare. The copy is yours; the template stays the kit's.\n\n## Adopting a template\n\n1. Read the template (`memory_retrieve(mode:\"scout\", message:\"Playbook: <name>\", sources:{documents:true})`).\n2. Save a new guideline named `Routine: <name>` (for example `Routine: Cloud cost watch`), tagged `ai-coding-memory` and `routine`. Start its content with these three lines:\n   ```\n   Based on: playbook-<template slug>, kit <kit version you copied from>\n   Status: active\n   Version: 1\n   ```\n3. Keep the five headings in the same order: Purpose, Visible data (field: meaning), Output format, Hard safety rules, Judgment questions.\n4. **Visible data:** replace the example sources with your real ones: the system, the read-only credential's name (never its value), and the test query. Delete the examples that do not apply.\n5. **Cost per run:** estimate it for your sources (paid calls per run x unit price, plus one model pass) and set the routine task's `run_cap_usd` and `month_cap_usd` above it.\n6. **Judgment questions:** ask the owner each question. Record the answer under the question as a rule (`Decided: ...`), either one of the options or the owner's own words. Do not answer them yourself. If the template has a \"Starting proposal\" section, offer it as a default the owner can accept or change, then remove the section.\n7. **Hard safety rules:** keep every rule. You may tighten one; loosening one (for example allowing writes) needs the owner's explicit approval, recorded in the copy.\n8. Point the routine's task at your copy: set `playbook_ref` on the task to your copy's slug, as the save returned it.\n\n## After a kit upgrade\n\nThe upgrade report lists the templates it updated. For each routine whose `Based on:` names one of them:\n\n1. Compare the updated template with the version your copy was based on.\n2. Summarize what changed for the owner in plain language: new safety rules, new questions, new example sources.\n3. Propose the changes to the copy. Apply only what the owner accepts, then update the `Based on:` line to the new kit version and raise `Version:` by one.\n\nNew safety rules in a template are worth bringing across even when nothing else is.\n\n## Adding a playbook the kit does not ship\n\nWrite it the same way: the five headings, a `Status:` and `Version:` line, read-only by default, and judgment questions the owner answers. Name it `Routine: <name>` without a `Based on:` line. Never start a slug with `playbook-`; that prefix belongs to kit templates, and the next upgrade could overwrite it.\n\n## Never in a playbook\n\nSecrets, API keys, tokens or connection strings; personal data about customers or staff; raw log lines. Name a credential by where it is stored, not by its value.\n"
      },
      {
        "slug": "playbook-aws-cost-watch",
        "upsertAllowed": true,
        "name": "Playbook: Cloud cost watch",
        "description": "Draft template for the cloud cost watch routine, to copy and adapt: purpose, visible data, output format, safety rules, judgment questions and a starting proposal.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "ab865206fd6dcc6f41086c13f2750fb7316f4b5e71f50bcdde3cefcaa185f236",
          "e76932faaacb6b781d29d26452341c2cd5f62f9220de8b9b9ef905fbd9d83f59"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Cloud cost watch\n\n## Purpose\nWatch daily cloud spend by service and by account or project, and report what changed. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. Code collects data and enforces caps; this playbook owns every judgment.\n\n## Visible data (field: meaning)\n- Daily cost per service and per account or project, from your cloud's billing API: on AWS, Cost Explorer `GetCostAndUsage` grouped by `SERVICE` and `LINKED_ACCOUNT`; on Google Cloud, the billing export in BigQuery; on Azure, the Cost Management query API.\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: daily.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: follow the billing API's page token (`NextPageToken` on AWS) to the end.\n- Identifiers: account or project ids only.\n\n## Output format\nA short report: what changed versus the previous run, evidence (service, account or project id, amounts), and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Page the billing API to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: none expected (account or project ids only). Never print secrets.\n\n## Judgment questions\n1. What counts as a notable change in spend?\n   - Option A: compare to the previous day.\n   - Option B: compare to a longer trailing average.\n2. Which services or accounts should be reported individually?\n   - Option A: all of them.\n   - Option B: only the largest ones.\n3. How should a suspected anomaly be escalated?\n   - Option A: a proposed task only.\n   - Option B: a proposed task plus a direct message.\n\n## Starting proposal (for the owner to accept or edit)\n- Run daily at the default cadence.\n- Report day-over-day change per service, listing account or project ids.\n- Raise a proposed task for anything that looks unusual, and let the owner decide. All thresholds are left for the owner to set.\n"
      },
      {
        "slug": "playbook-errors-and-alarms",
        "upsertAllowed": true,
        "name": "Playbook: Errors and alarms",
        "description": "Draft template for the errors and alarms routine, to copy and adapt: purpose, visible data, output format, safety rules, judgment questions and a starting proposal.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "153e83a9662d3d4311e60aec7f7a8b58f9866301f4e13a8dd8633f2a077a3af0",
          "db22ed4f5a1188c7afb4fd2f7148b6cea86c85404e0317aae26179739a427ca8"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Errors and alarms\n\n## Purpose\nSummarize recurring errors and active alarms on a regular cadence. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. Code collects data and enforces caps; this playbook owns every judgment.\n\n## Visible data (field: meaning)\n- Log lines matched by a query, from your log platform: CloudWatch Logs Insights (`StartQuery` / `GetQueryResults`), Google Cloud Logging, Azure Monitor, Datadog, Sentry or similar. Log queries are often billed per GB scanned.\n- Alarms or monitors and their state: CloudWatch alarms (`DescribeAlarms`), Datadog monitors, Grafana alerts or similar.\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: every 6 hours.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: follow the alarm list's page token to the end; query results are capped by the query limit.\n\n## Output format\nA short report: error signatures with counts, alarms in alarm state, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Page the alarm list to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: log lines may hold PII. Aggregate by signature and pass only signatures and counts to the model. Never pass raw log lines.\n\n## Judgment questions\n1. How should errors be grouped into one signature?\n   - Option A: by message text pattern.\n   - Option B: by source and error code.\n2. Which errors deserve a proposed task?\n   - Option A: new signatures only.\n   - Option B: new signatures and growing ones.\n3. How should alarms that stay in alarm across runs be reported?\n   - Option A: every run.\n   - Option B: once, then on change.\n\n## Starting proposal (for the owner to accept or edit)\n- Run every 6 hours at the default cadence.\n- Group errors by signature and report counts only.\n- List alarms currently in alarm state, and propose a task for new signatures. All thresholds are left for the owner to set.\n"
      },
      {
        "slug": "playbook-ticket-triage",
        "upsertAllowed": true,
        "name": "Playbook: Ticket triage",
        "description": "Draft template for the ticket triage routine, to copy and adapt: purpose, visible data, output format, safety rules and judgment questions.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "3dd7e7df7d06b36155c102caddcd6ec2397b4896b5acbd63e4a99b5db7ab76a9"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Ticket triage\n\n## Purpose\nRead new support tickets and help sort them. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. It carries questions only; the owner supplies every rule.\n\n## Visible data (field: meaning)\n- Your support or ticket system's list API (Zendesk, Intercom, Jira, Linear, GitHub Issues, or an internal tool): ticket id, company name and ticket fields.\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: every 6 hours (4 per day).\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: list paging until exhausted.\n- Identifiers: ticket ids and company name only.\n\n## Output format\nA short report: tickets reviewed by ticket id, the proposed sort for each, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Loop the list paging to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: use ticket ids and company name only. Do not copy ticket bodies or personal details into the output.\n\n## Judgment questions\n1. How should tickets be categorized?\n   - Option A: by topic.\n   - Option B: by who must act.\n2. How should urgency be decided?\n   - Option A: from the ticket text.\n   - Option B: from the ticket text plus the account context.\n3. What should the run do with a ticket it cannot sort?\n   - Option A: list it for a human.\n   - Option B: skip it.\n"
      },
      {
        "slug": "playbook-customer-health",
        "upsertAllowed": true,
        "name": "Playbook: Customer health",
        "description": "Draft template for the customer health routine, to copy and adapt: purpose, visible data, output format, safety rules and judgment questions.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "30274bfb419f50862bb2e3f52e31ceb903f04e1d1c071eb9fecec11b15bc7f6d"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Customer health\n\n## Purpose\nReview account health from cached customer data and usage. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. It carries questions only; the owner supplies every rule.\n\n## Visible data (field: meaning)\n- This kit's Customer Account caches and Metric Snapshots: stored account facts and periodic metric values.\n- Usage per customer account, from your product's own database or analytics tool.\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: daily.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: follow each source's continuation token or cursor to the end.\n- Identifiers: ids and company names.\n\n## Output format\nA short report: accounts reviewed by id, the evidence seen, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Page every source to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: use ids and company names only. Read customer records only as far as your own data policy allows, and write none.\n\n## Judgment questions\n1. What does a healthy account look like?\n   - Option A: steady usage.\n   - Option B: growing usage.\n2. Which signals should be read together?\n   - Option A: usage only.\n   - Option B: usage plus account facts.\n3. Who should see a concern first?\n   - Option A: the account owner.\n   - Option B: a shared review list.\n"
      },
      {
        "slug": "playbook-security-posture",
        "upsertAllowed": true,
        "name": "Playbook: Security posture",
        "description": "Draft template for the security posture routine, to copy and adapt: purpose, visible data, output format, safety rules, judgment questions and a starting proposal.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "22e40f117d208ba1b3318716979bbab9c0506729d120dddce670d6e5c00a7c45",
          "ea586fccd8edd87b8580eda371c6f77c38084faa2948316c920b2bb2c44a2ccd"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Security posture\n\n## Purpose\nReview the account's security posture weekly and report what looks off. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. Code collects data and enforces caps; this playbook owns every judgment.\n\n## Visible data (field: meaning)\n- Your cloud's security and identity read APIs: on AWS, IAM, Security Hub or Config describe calls; on Google Cloud, Security Command Center and IAM; on Azure, Defender for Cloud and Entra ID. They give account settings, roles and findings.\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: weekly.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: follow each API's page token (`Marker` / `NextToken` on AWS) to the end.\n- Identifiers: account and role names only, no secrets.\n\n## Output format\nA short report: findings with account or role name, what changed since the previous run, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Page every API to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII and secrets: account and role names only. Never read, print or store keys, tokens or secret values.\n\n## Judgment questions\n1. Which findings matter most to this org?\n   - Option A: access and permissions.\n   - Option B: configuration drift.\n2. How should an unchanged finding be reported?\n   - Option A: every run.\n   - Option B: only when it changes.\n3. Who is told about a serious finding?\n   - Option A: the owner through a proposed task.\n   - Option B: the owner and a second reviewer.\n\n## Starting proposal (for the owner to accept or edit)\n- Run weekly at the default cadence.\n- Report findings by account or role name and what changed since last run.\n- Propose a task for each new finding. Severity labels and thresholds are left for the owner to set.\n"
      },
      {
        "slug": "playbook-code-drift",
        "upsertAllowed": true,
        "name": "Playbook: Code drift",
        "description": "Draft template for the code drift routine, to copy and adapt: purpose, visible data, output format, safety rules, judgment questions and a starting proposal.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "0705e792bfa9a76185d98a3507fc303d8c512ad2a2d565c7e3b4afff56c405a8",
          "36a0c198934522dc2d444d1d90dc238638412dfe9ce1bc277f87cd82988bd9bb"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Code drift\n\n## Purpose\nCheck weekly whether deployed copies of code and generated references have drifted from the repository. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. Code collects data and enforces caps; this playbook owns every judgment.\n\n## Visible data (field: meaning)\n- Your own drift checks: scripts or CI jobs that compare deployed copies of code, configuration or generated files (API references, SDK docs, infrastructure state) with the repository, for example `terraform plan`, a deployed-function hash check, or a docs generator run with a `--check` flag.\n- Fill in before the first run: the list of checks, each with the command that runs it read-only. Name them in your own copy, never in the template.\n- Default cadence: weekly.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: not applicable (local).\n- Identifiers: none.\n\n## Output format\nA short report: which checks ran, which pairs or files differ, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems or the repository.\n- No paged data here. If any source does page, loop to the end; if the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: none expected. Never print secrets.\n\n## Judgment questions\n1. How should a difference be classified?\n   - Option A: any difference is drift.\n   - Option B: only differences that change behavior.\n2. What should be proposed when drift is found?\n   - Option A: a sync task.\n   - Option B: a review task first.\n3. How should a missing script be handled?\n   - Option A: report it and skip.\n   - Option B: report it and propose a task.\n\n## Starting proposal (for the owner to accept or edit)\n- Run weekly at the default cadence.\n- Run only the checks that exist and list the differences they report.\n- Propose a task per drifted pair. Thresholds are left for the owner to set.\n"
      },
      {
        "slug": "playbook-data-durability",
        "upsertAllowed": true,
        "name": "Playbook: Data durability",
        "description": "Draft template for the data durability routine, to copy and adapt: purpose, visible data, output format, safety rules, judgment questions and a starting proposal.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "31a749a6b7233fba7c77ed7044720b806aa980e772fa1fd6e160b474fa0e278b",
          "ecd28ef03d9780317d496bd288dfb65e7d0af006b91eced281a03d34de555969"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Data durability\n\n## Purpose\nCheck weekly that databases have backups and recovery settings in place. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. Code collects data and enforces caps; this playbook owns every judgment.\n\n## Visible data (field: meaning)\n- Backup and point-in-time recovery settings for each database: on AWS, `DescribeContinuousBackups` (DynamoDB) and `DescribeDBInstances` (RDS); on Google Cloud, the Cloud SQL backup configuration; on Azure, the SQL backup policies; or your managed database provider's API.\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: weekly.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: follow each API's page token to the end.\n- Identifiers: none (resource names only).\n\n## Output format\nA short report: resources checked, their backup state, what changed since the previous run, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Page every API to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: none expected. Never read table contents; read settings only.\n\n## Judgment questions\n1. Which resources must have backups?\n   - Option A: all of them.\n   - Option B: only those holding primary data.\n2. What counts as an acceptable recovery setup?\n   - Option A: any enabled backup.\n   - Option B: point-in-time recovery specifically.\n3. How should a gap be reported?\n   - Option A: a proposed task per resource.\n   - Option B: one grouped task.\n\n## Starting proposal (for the owner to accept or edit)\n- Run weekly at the default cadence.\n- List each resource with its backup state and what changed since last run.\n- Propose a task for each resource lacking backups. Thresholds are left for the owner to set.\n"
      },
      {
        "slug": "playbook-deploy-and-ci-health",
        "upsertAllowed": true,
        "name": "Playbook: Deploy and CI health",
        "description": "Draft template for the deploy and CI health routine, to copy and adapt: purpose, visible data, output format, safety rules, judgment questions and a starting proposal.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "4aeecda1b05b9b73a6813e62989ec6f350abadcc40f7abbd2827a91e47247f16",
          "8916c932f0bb55c858a22af87e676cc03a95f2514134759c60b85da467f1c92a"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Deploy and CI health\n\n## Purpose\nReview recent CI runs and pull requests daily and report problems. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. Code collects data and enforces caps; this playbook owns every judgment.\n\n## Visible data (field: meaning)\n- Recent CI runs and their results: `gh run list` on GitHub Actions, or the GitLab, CircleCI or Buildkite API (read-only).\n- Open and recent pull or merge requests: `gh pr list`, or your Git host's API (read-only).\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: daily.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: `--limit` plus cursor until exhausted within the cap.\n- Identifiers: author handles as ids only.\n\n## Output format\nA short report: failing or stuck runs, pull requests waiting, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything; never re-run, merge or close anything.\n- Page with `--limit` plus cursor to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: refer to authors as ids only, not names.\n\n## Judgment questions\n1. What counts as an unhealthy run?\n   - Option A: any failure.\n   - Option B: repeated failure of the same job.\n2. Which pull requests should be reported?\n   - Option A: all that are waiting.\n   - Option B: only those blocking other work.\n3. How should a flaky job be handled?\n   - Option A: report it each time.\n   - Option B: report it once, then on change.\n\n## Starting proposal (for the owner to accept or edit)\n- Run daily at the default cadence.\n- Report failed runs and waiting pull requests, with author ids only.\n- Propose a task for repeated failures. Thresholds are left for the owner to set.\n"
      },
      {
        "slug": "playbook-onboarding-funnel",
        "upsertAllowed": true,
        "name": "Playbook: Onboarding funnel",
        "description": "Draft template for the onboarding funnel routine, to copy and adapt: purpose, visible data, output format, safety rules and judgment questions.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "d5e4d3c67fe3bf3138f79e55b51f78f4292cc7ea83d051c1f553f00687d4690c"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Onboarding funnel\n\n## Purpose\nReview how new customer accounts move through onboarding each week. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. It carries questions only; the owner supplies every rule.\n\n## Visible data (field: meaning)\n- Sign-up records, plan state and counts of onboarding events per new customer account, from your product database or analytics tool.\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: weekly.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: follow the source's continuation token or cursor to the end.\n- Identifiers: account ids only.\n\n## Output format\nA short report: accounts reviewed by account id, the evidence seen, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Page every source to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: account ids only.\n\n## Judgment questions\n1. What are the steps of onboarding for your product?\n   - Option A: a short list of key events.\n   - Option B: a full event sequence.\n2. How should a stalled account be identified?\n   - Option A: no progress since the last run.\n   - Option B: no progress for a period the owner sets.\n3. What should follow a stalled account?\n   - Option A: a proposed task for a person.\n   - Option B: a listing only.\n"
      },
      {
        "slug": "playbook-credit-runway-and-limits",
        "upsertAllowed": true,
        "name": "Playbook: Credit runway and limits",
        "description": "Draft template for the credit runway and limits routine, to copy and adapt: purpose, visible data, output format, safety rules and judgment questions.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "b60a9e706aa809601e6d6320fdaa5168c46ad68b7a73025eab8cbafce186be2f"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Credit runway and limits\n\n## Purpose\nReview each customer account's balance against its plan limit each day. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. It carries questions only; the owner supplies every rule.\n\n## Visible data (field: meaning)\n- Each customer account's balance (credits, quota or prepaid usage) and plan limit, from your billing system (Stripe, your own billing tables, or similar).\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: daily.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: follow the source's continuation token or cursor to the end.\n- Identifiers: account ids only.\n\n## Output format\nA short report: accounts reviewed by account id, the balance and limit evidence, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems; never change a balance or a plan.\n- Page every source to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: account ids only.\n\n## Judgment questions\n1. How should runway be estimated?\n   - Option A: from recent usage.\n   - Option B: from usage plus known plan changes.\n2. Which accounts should be listed?\n   - Option A: every account.\n   - Option B: only accounts the owner would want to act on.\n3. What should follow a low-runway account?\n   - Option A: a proposed task for a person.\n   - Option B: a listing only.\n"
      },
      {
        "slug": "playbook-api-quality-per-customer",
        "upsertAllowed": true,
        "name": "Playbook: API quality per customer",
        "description": "Draft template for the aPI quality per customer routine, to copy and adapt: purpose, visible data, output format, safety rules and judgment questions.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "d9b9b575c8bff56066c8f542e0796ac9f304191c50139eced45f73d795bb8c47"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: API quality per customer\n\n## Purpose\nReview API behavior for each customer account every week. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. It carries questions only; the owner supplies every rule.\n\n## Visible data (field: meaning)\n- API request and error counts per customer account, grouped by account id, from your API logs or gateway metrics (CloudWatch Logs Insights, Datadog, your API gateway's metrics, or similar). Log queries are often billed per GB scanned.\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: weekly.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: follow the source's page token to the end.\n- Identifiers: account ids and counts only.\n\n## Output format\nA short report: accounts reviewed by account id, the counts seen, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Page every source to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: account ids and counts only. Never pass raw log lines to the model.\n\n## Judgment questions\n1. What does good API quality mean here?\n   - Option A: few errors.\n   - Option B: few errors and steady response times.\n2. How should accounts be compared?\n   - Option A: against their own past.\n   - Option B: against all accounts.\n3. What should follow a poor result?\n   - Option A: a proposed task for a person.\n   - Option B: a listing only.\n"
      },
      {
        "slug": "playbook-feature-adoption",
        "upsertAllowed": true,
        "name": "Playbook: Feature adoption",
        "description": "Draft template for the feature adoption routine, to copy and adapt: purpose, visible data, output format, safety rules and judgment questions.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "0d42df5bce872d81ffa4884b0a8033a598b2066991a9fc0e87c4c21d539ce77e"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Feature adoption\n\n## Purpose\nReview which features each customer account uses, every week. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. It carries questions only; the owner supplies every rule.\n\n## Visible data (field: meaning)\n- One row per feature use per customer account, from your product analytics (PostHog, Amplitude, Mixpanel, Segment or similar) or a usage table in your own database.\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: weekly.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: follow the source's continuation token or cursor to the end.\n- Identifiers: account ids only.\n\n## Output format\nA short report: features and accounts by account id, the counts seen, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Page every source to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: account ids only.\n\n## Judgment questions\n1. What counts as adopting a feature?\n   - Option A: a single use.\n   - Option B: repeated use.\n2. Which features should be tracked?\n   - Option A: all of them.\n   - Option B: a short list the owner names.\n3. How should the result be shown?\n   - Option A: per account.\n   - Option B: per feature.\n"
      },
      {
        "slug": "playbook-llm-spend-by-provider",
        "upsertAllowed": true,
        "name": "Playbook: LLM spend by provider",
        "description": "Draft template for the lLM spend by provider routine, to copy and adapt: purpose, visible data, output format, safety rules, judgment questions and a starting proposal.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "5d2d7b315e49dd55106d1ca9c738bd5fbdf64b022293c54c84810c327aca75b9",
          "e62fc907a5e95068c121f9585f930bf8ffc1b12bd91177a552f8a32272c0a11d"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: LLM spend by provider\n\n## Purpose\nReport daily spend on language-model providers. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. Code collects data and enforces caps; this playbook owns every judgment.\n\n## Visible data (field: meaning)\n- Spend per provider per day: each model provider's usage or billing API (for example OpenAI, Anthropic, Google, OpenRouter), and your cloud bill for hosted models (AWS Bedrock through Cost Explorer `GetCostAndUsage`, Google Vertex AI, Azure OpenAI).\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: daily.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: follow each API's page token to the end.\n- Identifiers: none.\n\n## Output format\nA short report: spend per provider, what changed since the previous run, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Page every source to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: none expected. Never print provider keys.\n\n## Judgment questions\n1. How should spend be compared?\n   - Option A: day over day.\n   - Option B: against a longer average.\n2. Which providers are reported separately?\n   - Option A: all of them.\n   - Option B: only the largest.\n3. What should follow a jump in spend?\n   - Option A: a proposed task.\n   - Option B: a proposed task plus a direct message.\n\n## Starting proposal (for the owner to accept or edit)\n- Run daily at the default cadence.\n- Report spend per provider and the change since last run.\n- Propose a task for any jump. Thresholds are left for the owner to set.\n"
      },
      {
        "slug": "playbook-board-hygiene",
        "upsertAllowed": true,
        "name": "Playbook: Board hygiene",
        "description": "Draft template for the board hygiene routine, to copy and adapt: purpose, visible data, output format, safety rules, judgment questions and a starting proposal.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "0dd086de18fdb61f663fb95be8d899fe6b55acc72e8c059a42d6e84cc60b1556",
          "64d67df4425f4657f2e8a53a6de73966d934400618b86f052cb6c6524a539e13"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Board hygiene\n\n## Purpose\nReview the team task board daily and report items that need attention. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. Code collects data and enforces caps; this playbook owns every judgment.\n\n## Visible data (field: meaning)\n- This kit's task board: tasks and their fields, read with the board query in the Retrieval Playbook (filtered by `project_key`).\n- Default cadence: daily.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: board query paged until exhausted.\n- Identifiers: task keys only.\n\n## Output format\nA short report: tasks needing attention by task key, why, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything on the board.\n- Page the board query to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: task keys only.\n\n## Judgment questions\n1. What makes a task stale?\n   - Option A: no update for a while.\n   - Option B: no update and no owner.\n2. Which tasks should be reported?\n   - Option A: all that need attention.\n   - Option B: only blocked ones.\n3. How should a stale task be raised?\n   - Option A: a proposed task.\n   - Option B: a listing only.\n\n## Starting proposal (for the owner to accept or edit)\n- Run daily at the default cadence.\n- List tasks needing attention by task key, with the reason.\n- Propose a cleanup task. Thresholds are left for the owner to set.\n"
      },
      {
        "slug": "playbook-customer-memory-quality",
        "upsertAllowed": true,
        "name": "Playbook: Customer data quality",
        "description": "Draft template for the customer data quality routine, to copy and adapt: purpose, visible data, output format, safety rules and judgment questions.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "6e3bedbdfcf720cd0dcb62d51771e528116426a864e2f6dda3b8ae565a8915c8"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Customer data quality\n\n## Purpose\nReview the quality of the data you hold about each customer account, every week. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. It carries questions only; the owner supplies every rule.\n\n## Visible data (field: meaning)\n- Data-quality measures per customer account that your systems already produce (for example completeness of key fields, record freshness, duplicate rate), from your database or data warehouse.\n- Fill in before the first run: the exact source, a read-only credential for it, and one test query that returns a single page. Name them in your own copy, never in the template.\n- Default cadence: weekly.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: follow the source's continuation token or cursor to the end.\n- Identifiers: ids only.\n\n## Output format\nA short report: accounts reviewed by id, the metrics seen, and proposed tasks (proposals only). It never includes record content. The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Loop paged data to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: ids only. No record content in the output.\n\n## Judgment questions\n1. What does good data quality mean here?\n   - Option A: complete records.\n   - Option B: accurate and recent records.\n2. How should accounts be compared?\n   - Option A: against their own past.\n   - Option B: against all accounts.\n3. What should follow a poor result?\n   - Option A: a proposed task for a person.\n   - Option B: a listing only.\n"
      },
      {
        "slug": "playbook-weekly-ceo-digest",
        "upsertAllowed": true,
        "name": "Playbook: Weekly leadership digest",
        "description": "Draft template for the weekly leadership digest routine, to copy and adapt: purpose, visible data, output format, safety rules and judgment questions.",
        "tags": [
          "ai-coding-memory",
          "playbook"
        ],
        "agentDocType": "guideline",
        "ownership": "customer-owned-with-platform-fallback",
        "previousContentHashes": [
          "420868a85be5c2c251414795df312165c88469c24150a5fac203dec0aa616e90"
        ],
        "content": "Status: draft\nVersion: 0\n\n# Playbook: Weekly leadership digest\n\n## Purpose\nCombine the other routines' results into one weekly digest. This is a template: copy it and edit the copy, as the Routine Playbook Customization guide describes. It carries questions only; the owner supplies every rule.\n\n## Visible data (field: meaning)\n- The other routines' run records and Metric Snapshots: results and stored metric values from earlier runs.\n- Default cadence: weekly.\n- Cost per run: estimate it for your own sources before the first run (paid calls per run x their unit price, plus one model pass), and set `run_cap_usd` above that.\n- Paging: run records paged until exhausted.\n- Identifiers: inherits from the source routines; ids and company names only.\n\n## Output format\nA short digest: items drawn from the run records, each with its source routine, and proposed tasks (proposals only). The run record stores the playbook version used.\n\n## Hard safety rules\n- Read-only: never write, change or delete anything in the source systems.\n- Page the run records to the end. If the per-run cap stops the loop, end the run `capped`.\n- Stay under `run_cap_usd` and `month_cap_usd`; whatever runs the routine checks the remaining cap before every paid call.\n- PII: inherit the source routines' limits; ids and company names only.\n\n## Judgment questions\n1. What belongs in the digest?\n   - Option A: every routine's headline.\n   - Option B: only items that changed.\n2. How should items be ordered?\n   - Option A: by routine.\n   - Option B: by importance as the owner defines it.\n3. How long should the digest be?\n   - Option A: one short page.\n   - Option B: a short page plus a linked detail list.\n"
      }
    ],
    "relations": [
      {
        "slug": "in-project",
        "upsertAllowed": true,
        "typeName": "in_project",
        "displayLabel": "In Project",
        "description": "The record belongs to this project.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "feature",
          "task",
          "decision",
          "inquiry",
          "error",
          "event",
          "ai_session",
          "message"
        ],
        "allowedToTypes": [
          "project"
        ],
        "examples": [
          "task acme/app/t/260923-k4q9 in_project acme/app"
        ]
      },
      {
        "slug": "part-of",
        "upsertAllowed": true,
        "typeName": "part_of",
        "displayLabel": "Part Of",
        "description": "Task -> its feature; commit event -> its PR event.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "task",
          "event"
        ],
        "allowedToTypes": [
          "feature",
          "event"
        ],
        "examples": [
          "task t/260923-k4q9 part_of feature f/invoice-export",
          "event commit/3b981225ab12 part_of event pr/57"
        ]
      },
      {
        "slug": "subtask-of",
        "upsertAllowed": true,
        "typeName": "subtask_of",
        "displayLabel": "Subtask Of",
        "description": "Task -> parent task.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "task"
        ],
        "allowedToTypes": [
          "task"
        ],
        "examples": [
          "task t/260924-a2b3 subtask_of task t/260923-k4q9"
        ]
      },
      {
        "slug": "owned-by",
        "upsertAllowed": true,
        "typeName": "owned_by",
        "displayLabel": "Owned By",
        "description": "Current owner. Single-valued: reassignment ends the previous edge (history kept).",
        "category": "role",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "task",
          "feature",
          "error",
          "inquiry",
          "project"
        ],
        "allowedToTypes": [
          "person"
        ],
        "examples": [
          "task t/260923-k4q9 owned_by dev@example.com"
        ]
      },
      {
        "slug": "created-by-person",
        "upsertAllowed": true,
        "typeName": "created_by_person",
        "displayLabel": "Created By",
        "description": "Human who raised or created the record.",
        "category": "role",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "task",
          "feature",
          "decision",
          "inquiry",
          "error"
        ],
        "allowedToTypes": [
          "person"
        ],
        "examples": [
          "inquiry q/260923-x8r2 created_by_person lead@example.com"
        ]
      },
      {
        "slug": "decided-by",
        "upsertAllowed": true,
        "typeName": "decided_by",
        "displayLabel": "Decided By",
        "description": "Person(s) who made or approved the decision.",
        "category": "role",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "decision"
        ],
        "allowedToTypes": [
          "person"
        ],
        "examples": [
          "decision d/csv-export-storage decided_by lead@example.com"
        ]
      },
      {
        "slug": "directed-to",
        "upsertAllowed": true,
        "typeName": "directed_to",
        "displayLabel": "Directed To",
        "description": "Person(s) who should answer or decide.",
        "category": "role",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "inquiry"
        ],
        "allowedToTypes": [
          "person"
        ],
        "examples": [
          "question q/260923-x8r2 directed_to lead@example.com"
        ]
      },
      {
        "slug": "performed-by",
        "upsertAllowed": true,
        "typeName": "performed_by",
        "displayLabel": "Performed By",
        "description": "PR/commit author or deploy/release triggerer.",
        "category": "role",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "event"
        ],
        "allowedToTypes": [
          "person"
        ],
        "examples": [
          "event pr/57 performed_by dev@example.com"
        ]
      },
      {
        "slug": "reviewed-by",
        "upsertAllowed": true,
        "typeName": "reviewed_by",
        "displayLabel": "Reviewed By",
        "description": "PR reviewer(s).",
        "category": "role",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "event"
        ],
        "allowedToTypes": [
          "person"
        ],
        "examples": [
          "event pr/57 reviewed_by lead@example.com"
        ]
      },
      {
        "slug": "driven-by",
        "upsertAllowed": true,
        "typeName": "driven_by",
        "displayLabel": "Driven By",
        "description": "The human driving the AI session.",
        "category": "role",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "ai_session"
        ],
        "allowedToTypes": [
          "person"
        ],
        "examples": [
          "session claude-code:510c7129 driven_by dev@example.com"
        ]
      },
      {
        "slug": "has-manager",
        "upsertAllowed": true,
        "typeName": "has_manager",
        "displayLabel": "Has Manager",
        "description": "Reporting line (person -> manager).",
        "category": "role",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "person"
        ],
        "allowedToTypes": [
          "person"
        ],
        "examples": [
          "dev@example.com has_manager lead@example.com"
        ]
      },
      {
        "slug": "contributes-to",
        "upsertAllowed": true,
        "typeName": "contributes_to",
        "displayLabel": "Contributes To",
        "description": "Person works on this project.",
        "category": "role",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "person"
        ],
        "allowedToTypes": [
          "project"
        ],
        "examples": [
          "dev@example.com contributes_to acme/app"
        ]
      },
      {
        "slug": "blocked-by",
        "upsertAllowed": true,
        "typeName": "blocked_by",
        "displayLabel": "Blocked By",
        "description": "Cannot proceed until the target is resolved.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "task",
          "feature"
        ],
        "allowedToTypes": [
          "task",
          "feature",
          "inquiry",
          "error"
        ],
        "examples": [
          "task t/260923-p2m7 blocked_by task t/260923-k4q9"
        ]
      },
      {
        "slug": "depends-on",
        "upsertAllowed": true,
        "typeName": "depends_on",
        "displayLabel": "Depends On",
        "description": "Feature needs another feature first.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "feature"
        ],
        "allowedToTypes": [
          "feature"
        ],
        "examples": [
          "feature f/invoice-pdf depends_on feature f/invoice-export"
        ]
      },
      {
        "slug": "duplicate-of",
        "upsertAllowed": true,
        "typeName": "duplicate_of",
        "displayLabel": "Duplicate Of",
        "description": "Same-type duplicate merged into the target (same type only).",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "task",
          "error",
          "inquiry"
        ],
        "allowedToTypes": [
          "task",
          "error",
          "inquiry"
        ],
        "examples": [
          "task t/260924-zz11 duplicate_of task t/260923-k4q9"
        ]
      },
      {
        "slug": "follows-up",
        "upsertAllowed": true,
        "typeName": "follows_up",
        "displayLabel": "Follows Up",
        "description": "Follow-up work that came out of the target.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "task"
        ],
        "allowedToTypes": [
          "task",
          "error",
          "decision"
        ],
        "examples": [
          "task t/260924-z6w1 follows_up decision d/csv-export-storage"
        ]
      },
      {
        "slug": "related-to",
        "upsertAllowed": true,
        "typeName": "related_to",
        "displayLabel": "Related To",
        "description": "Overlapping work: the two records touch the same scope but neither contains the other. Write it on both records (one edge each way) so either side shows the other.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "task",
          "feature"
        ],
        "allowedToTypes": [
          "task",
          "feature"
        ],
        "examples": [
          "task acme/app/t/261002-oouv related_to task acme/app/t/261001-rxwj"
        ]
      },
      {
        "slug": "implements",
        "upsertAllowed": true,
        "typeName": "implements",
        "displayLabel": "Implements",
        "description": "PR/commit implements the work.",
        "category": "activity",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "event"
        ],
        "allowedToTypes": [
          "task",
          "feature"
        ],
        "examples": [
          "event pr/57 implements task t/260923-k4q9"
        ]
      },
      {
        "slug": "fixes",
        "upsertAllowed": true,
        "typeName": "fixes",
        "displayLabel": "Fixes",
        "description": "PR/commit fixes the error.",
        "category": "activity",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "event"
        ],
        "allowedToTypes": [
          "error"
        ],
        "examples": [
          "event pr/57 fixes error e/3f9a1c07b2d4"
        ]
      },
      {
        "slug": "includes",
        "upsertAllowed": true,
        "typeName": "includes",
        "displayLabel": "Includes",
        "description": "Deploy/release includes a PR or commit.",
        "category": "activity",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "event"
        ],
        "allowedToTypes": [
          "event"
        ],
        "examples": [
          "event deploy/production/8812 includes event pr/57"
        ]
      },
      {
        "slug": "ships",
        "upsertAllowed": true,
        "typeName": "ships",
        "displayLabel": "Ships",
        "description": "Deploy/release delivers the task or feature.",
        "category": "activity",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "event"
        ],
        "allowedToTypes": [
          "task",
          "feature"
        ],
        "examples": [
          "event deploy/production/8812 ships task t/260923-k4q9"
        ]
      },
      {
        "slug": "rolls-back",
        "upsertAllowed": true,
        "typeName": "rolls_back",
        "displayLabel": "Rolls Back",
        "description": "Deploy that reverted an earlier deploy.",
        "category": "activity",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "event"
        ],
        "allowedToTypes": [
          "event"
        ],
        "examples": [
          "event deploy/production/8813 rolls_back event deploy/production/8812"
        ]
      },
      {
        "slug": "seen-in",
        "upsertAllowed": true,
        "typeName": "seen_in",
        "displayLabel": "Seen In",
        "description": "Where the error occurred.",
        "category": "activity",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "error"
        ],
        "allowedToTypes": [
          "task",
          "feature",
          "event",
          "ai_session"
        ],
        "examples": [
          "error e/3f9a1c07b2d4 seen_in task t/260923-p2m7"
        ]
      },
      {
        "slug": "introduced-by",
        "upsertAllowed": true,
        "typeName": "introduced_by",
        "displayLabel": "Introduced By",
        "description": "Change or deploy that introduced the error.",
        "category": "activity",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "error"
        ],
        "allowedToTypes": [
          "event"
        ],
        "examples": [
          "error e/3f9a1c07b2d4 introduced_by event pr/51"
        ]
      },
      {
        "slug": "tracked-by",
        "upsertAllowed": true,
        "typeName": "tracked_by",
        "displayLabel": "Tracked By",
        "description": "Task opened to fix the error.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "error"
        ],
        "allowedToTypes": [
          "task"
        ],
        "examples": [
          "error e/3f9a1c07b2d4 tracked_by task t/260924-fx01"
        ]
      },
      {
        "slug": "supersedes",
        "upsertAllowed": true,
        "typeName": "supersedes",
        "displayLabel": "Supersedes",
        "description": "New decision replaces an old one.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "decision"
        ],
        "allowedToTypes": [
          "decision"
        ],
        "examples": [
          "decision d/csv-export-storage supersedes decision d/csv-export-streaming"
        ]
      },
      {
        "slug": "applies-to",
        "upsertAllowed": true,
        "typeName": "applies_to",
        "displayLabel": "Applies To",
        "description": "Scope the decision governs.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "decision"
        ],
        "allowedToTypes": [
          "feature",
          "task",
          "project"
        ],
        "examples": [
          "decision d/csv-export-storage applies_to feature f/invoice-export"
        ]
      },
      {
        "slug": "resolves",
        "upsertAllowed": true,
        "typeName": "resolves",
        "displayLabel": "Resolves",
        "description": "Closes a proposal/question or tests a hypothesis.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "decision",
          "task",
          "event"
        ],
        "allowedToTypes": [
          "inquiry"
        ],
        "examples": [
          "decision d/csv-export-storage resolves inquiry q/260923-x8r2"
        ]
      },
      {
        "slug": "concerns",
        "upsertAllowed": true,
        "typeName": "concerns",
        "displayLabel": "Concerns",
        "description": "What the proposal/hypothesis/question is about.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "inquiry"
        ],
        "allowedToTypes": [
          "task",
          "feature",
          "error",
          "decision",
          "event"
        ],
        "examples": [
          "hypothesis h/260923-x8r2 concerns error e/3f9a1c07b2d4"
        ]
      },
      {
        "slug": "worked-on",
        "upsertAllowed": true,
        "typeName": "worked_on",
        "displayLabel": "Worked On",
        "description": "What the session touched.",
        "category": "activity",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "ai_session"
        ],
        "allowedToTypes": [
          "task",
          "feature",
          "error",
          "decision",
          "inquiry",
          "event",
          "message"
        ],
        "examples": [
          "session codex:7f2e worked_on task t/260923-p2m7"
        ]
      },
      {
        "slug": "continues",
        "upsertAllowed": true,
        "typeName": "continues",
        "displayLabel": "Continues",
        "description": "Session picked up from a previous session (handoff chain).",
        "category": "activity",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "ai_session"
        ],
        "allowedToTypes": [
          "ai_session"
        ],
        "examples": [
          "session claude-code:9a1b continues session codex:7f2e"
        ]
      },
      {
        "slug": "sent-by",
        "upsertAllowed": true,
        "typeName": "sent_by",
        "displayLabel": "Sent By",
        "description": "Person who sent the message.",
        "category": "role",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "message"
        ],
        "allowedToTypes": [
          "person"
        ],
        "examples": [
          "message acme/app/m/261002-k4q9 sent_by dev@example.com"
        ]
      },
      {
        "slug": "sent-to",
        "upsertAllowed": true,
        "typeName": "sent_to",
        "displayLabel": "Sent To",
        "description": "The one person the message is addressed to.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "message"
        ],
        "allowedToTypes": [
          "person"
        ],
        "examples": [
          "message acme/app/m/261002-k4q9 sent_to lead@example.com"
        ]
      },
      {
        "slug": "replies-to",
        "upsertAllowed": true,
        "typeName": "replies_to",
        "displayLabel": "Replies To",
        "description": "Message -> the message it answers.",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": true,
        "allowedFromTypes": [
          "message"
        ],
        "allowedToTypes": [
          "message"
        ],
        "examples": [
          "message acme/app/m/261003-b7c2 replies_to message acme/app/m/261002-k4q9"
        ]
      },
      {
        "slug": "regarding",
        "upsertAllowed": true,
        "typeName": "regarding",
        "displayLabel": "Regarding",
        "description": "What the message is about (the name about is a platform built-in and is not used).",
        "category": "generic",
        "isSymmetric": false,
        "isSingleValued": false,
        "allowedFromTypes": [
          "message"
        ],
        "allowedToTypes": [
          "task",
          "feature",
          "error",
          "decision",
          "inquiry",
          "event"
        ],
        "examples": [
          "message acme/app/m/261002-k4q9 regarding task acme/app/t/260923-k4q9"
        ]
      }
    ],
    "graphRules": []
  }
}
