{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://jellylabs.ai/schemas/gnosis.schema.json",
  "title": "Gnosis Memory File",
  "description": "Schema for gnosis memory files (.claude/gnosis/*.json) - project knowledge persistence",
  "type": "object",
  "required": ["project", "updated"],
  "properties": {
    "project": {
      "type": "string",
      "description": "Project identifier"
    },
    "updated": {
      "type": "string",
      "format": "date-time",
      "description": "Last update timestamp (ISO 8601)"
    },
    "architecture": {
      "type": "object",
      "description": "Architectural knowledge about the project",
      "properties": {
        "summary": {
          "type": "string",
          "description": "Brief architecture summary"
        },
        "stack": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Technology stack components"
        },
        "structure": {
          "type": "object",
          "additionalProperties": { "type": "string" },
          "description": "Directory structure descriptions"
        }
      }
    },
    "patterns": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Known patterns in the codebase"
    },
    "conventions": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Coding conventions and style preferences"
    },
    "decisions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["date", "decision"],
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "description": "Decision date"
          },
          "decision": {
            "type": "string",
            "description": "What was decided"
          },
          "rationale": {
            "type": "string",
            "description": "Why this decision was made"
          },
          "context": {
            "type": "string",
            "description": "Situation that prompted the decision"
          }
        }
      },
      "description": "Recorded architectural decisions"
    },
    "learnings": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Session learnings and discoveries"
    },
    "gotchas": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Known issues, quirks, or pitfalls"
    },
    "commands": {
      "type": "object",
      "additionalProperties": { "type": "string" },
      "description": "Common commands for this project (build, test, deploy, etc.)"
    }
  }
}
