crawl_config.json 4.88 KB
{
  "skill_name": "screenwriter",
  "description": "剧本整理员 - 负责剧本格式规范化、结构化整理与格式校验",
  "version": "1.0.0",
  "created_at": "2026-03-27",

  "input": {
    "supported_formats": [
      "fountain",
      "fdx",
      "txt",
      "json",
      "pdf"
    ],
    "encoding": "UTF-8",
    "max_page_count": 200,
    "min_page_count": 1,
    "required_fields": [
      "title",
      "author",
      "content"
    ],
    "sample_input": {
      "format": "fountain",
      "example": "Title: My Screenplay\n\nFADE IN:\n\nINT. COFFEE SHOP - DAY\n\nAction line here..."
    }
  },

  "validation_rules": {
    "scene_heading": {
      "pattern": "^(INT\\.|EXT\\.|INT\\./EXT\\.).*-\\s*(DAY|NIGHT|MORNING|EVENING|CONTINUOUS|MOMENTS LATER|LATER)$",
      "error_message": "场景标题格式错误,应为: [INT./EXT.] [地点] - [时间]",
      "case_sensitive": true,
      "uppercase_required": true
    },
    "character_name": {
      "pattern": "^[A-Z][A-Z0-9\\s]+$",
      "error_message": "角色名必须全大写",
      "max_length": 40
    },
    "dialogue_indent": {
      "left_margin_inches": 2.5,
      "right_margin_inches": 2.5,
      "error_message": "对话缩进不符合规范"
    },
    "font": {
      "required": "Courier",
      "size": 12,
      "error_message": "必须使用 Courier 12pt 字体"
    },
    "margins": {
      "left": 1.5,
      "right": 1.0,
      "top": 1.0,
      "bottom": 1.0,
      "unit": "inches"
    },
    "time_markers": {
      "valid_values": ["DAY", "NIGHT", "MORNING", "EVENING", "LATER", "CONTINUOUS", "MOMENTS LATER", "DUSK", "DAWN", "AFTERNOON"],
      "error_message": "时间标记不在有效值列表中"
    },
    "page_count": {
      "min": 1,
      "max": 200,
      "recommended_min": 70,
      "recommended_max": 120,
      "warning": "剧本长度偏离标准范围"
    }
  },

  "output": {
    "format": "json",
    "structure": {
      "metadata": {
        "title": "string",
        "author": "string",
        "created_at": "ISO8601",
        "page_count": "number",
        "scene_count": "number"
      },
      "scenes": [
        {
          "id": "string",
          "heading": "string",
          "location_type": "INT|EXT|INT./EXT",
          "location": "string",
          "time_of_day": "string",
          "content": "string",
          "dialogues": [
            {
              "character": "string",
              "parenthetical": "string|null",
              "text": "string"
            }
          ]
        }
      ],
      "statistics": {
        "total_scenes": "number",
        "total_dialogues": "number",
        "total_characters": "number",
        "word_count": "number"
      },
      "validation_results": {
        "passed": "boolean",
        "errors": ["string"],
        "warnings": ["string"]
      }
    },
    "format_options": {
      "indent": 2,
      "ensure_ascii": false
    }
  },

  "crawl_sources": [
    {
      "name": "StudioBinder",
      "url": "https://www.studiobinder.com/blog/how-to-write-a-screenplay/",
      "type": "reference",
      "description": "专业剧本格式指南"
    },
    {
      "name": "Script Reader Pro",
      "url": "https://www.scriptreaderpro.com/",
      "type": "reference",
      "description": "行业标准参考"
    },
    {
      "name": "Final Draft",
      "url": "https://www.finaldraft.com/",
      "type": "tool",
      "description": "专业剧本软件"
    },
    {
      "name": "Scripts.com",
      "url": "https://www.scripts.com/",
      "type": "sample",
      "description": "剧本库参考"
    }
  ],

  "correction_rules": {
    "auto_fix": [
      {
        "rule": "lowercase_scene_heading",
        "description": "将小写场景标题转换为大写",
        "example": "int. coffee shop - day -> INT. COFFEE SHOP - DAY"
      },
      {
        "rule": "normalize_time_markers",
        "description": "规范化时间标记",
        "example": "morning -> MORNING"
      },
      {
        "rule": "fix_character_spacing",
        "description": "调整角色名与对话间距",
        "indent_inches": 3.7
      }
    ],
    "warning_only": [
      {
        "rule": "page_count_warning",
        "description": "页面数量偏离标准时警告"
      },
      {
        "rule": "missing_act_structure",
        "description": "缺少三幕结构标记时警告"
      }
    ]
  },

  "quality_metrics": {
    "completeness": {
      "weight": 0.3,
      "checks": [
        "scene_heading_count",
        "character_count",
        "dialogue_count",
        "metadata_presence"
      ]
    },
    "format_compliance": {
      "weight": 0.4,
      "checks": [
        "font_compliance",
        "margin_compliance",
        "case_sensitivity",
        "indent_accuracy"
      ]
    },
    "structure_quality": {
      "weight": 0.3,
      "checks": [
        "three_act_structure",
        "scene_transitions",
        "dialogue_coherence"
      ]
    }
  }
}