一键导入
recommend-front-matter
Scan existing AI-SDD documents and recommend YAML front matter additions
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scan existing AI-SDD documents and recommend YAML front matter additions
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze and extract requirements from use case diagram. Use when extracting UR/FR/NFR from use cases or when called by generate-prd.
Check consistency between implementation code and design documents (design), detecting discrepancies
Generate quality assurance checklists from specifications and plans with structured IDs and categories
Analyze specifications and generate clarification questions to eliminate ambiguity before implementation
Define and manage non-negotiable project principles (Constitution) and verify synchronization with other documents
Automatically executed during document updates or before implementation to check consistency between PRD ↔ *_spec.md ↔ *_design.md. Detects missing requirement ID (UR/FR/NFR) references, data model mismatches, API definition discrepancies, terminology inconsistencies, and ensures traceability between documents.
| name | recommend-front-matter |
| description | Scan existing AI-SDD documents and recommend YAML front matter additions |
| argument-hint | [--apply] |
| license | MIT |
| user-invocable | true |
| agent | haiku |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion |
Scans existing AI-SDD documents (PRD, spec, design, task) and recommends adding YAML front matter for structured metadata.
Purpose: Help users add front matter to existing documents created before front matter support was added.
Note: Front matter is optional and backward compatible. This skill provides recommendations but does not require adoption.
Read the following prerequisite references before execution:
references/prerequisites_plugin_update.md - Check for plugin updatesreferences/prerequisites_principles.md - Read AI-SDD principles documentreferences/prerequisites_directory_paths.md - Resolve directory paths using SDD_* environment variablesreferences/front_matter_prd.md - PRD front matter schemareferences/front_matter_spec_design.md - Spec/Design front matter schemareferences/front_matter_task.md - Task front matter schemareferences/front_matter_impl.md - Implementation Log front matter schemaOutput templates are located under templates/${SDD_LANG:-en}/ within this skill directory.
The SDD_LANG environment variable determines the language (default: en).
$ARGUMENTS
--apply: Automatically apply recommended front matter to documents (after user confirmation)
/recommend-front-matter — Generate recommendation report only/recommend-front-matter --apply — Apply front matter after confirmationOptimized Execution Flow:
Execute python3 "${CLAUDE_PLUGIN_ROOT}/skills/recommend-front-matter/scripts/scan-documents.py" to scan AI-SDD documents.
This script:
.sdd-config.json to resolve directory paths${SDD_REQUIREMENT_DIR}, ${SDD_SPECIFICATION_DIR}, and ${SDD_TASK_DIR} directories---)# heading${SDD_ROOT}/.cache/recommend-front-matter/scan_result.json)$CLAUDE_ENV_FILE:
RECOMMEND_FM_CACHE_DIR - Cache directoryRECOMMEND_FM_SCAN_RESULT - JSON scan result file pathSDD_LANG - Language configurationScan Result JSON Schema: See references/scan_result_schema.md for the full schema and an example.
For each document without front matter in the scan result:
Use the Read tool to read the first 100 lines of each document. This provides context for:
| Field | Inference Logic |
|---|---|
id | Generate from file path and type: "{type}-{feature-name}" (hierarchical: "{type}-{parent}-{feature-name}") |
title | Extract from first # heading (fallback: basename) |
type | Use type field from scan result (prd, spec, design, task, implementation-log) |
status | Default to "draft" for new front matter |
created | Use current date YYYY-MM-DD |
updated | Same as created for initial front matter |
depends-on | Infer from file naming patterns (spec → prd, design → spec, task → design). Empty list if no match found. |
tags | Extract from headings and content keywords (max 5 tags). Use lowercase, hyphenated format (e.g., "user-auth"). |
category | Infer from directory hierarchy or parent feature name. Empty if no clear category. |
Dependency Inference Logic:
Follow the dependency direction rules from the type-specific front matter references:
${SDD_REQUIREMENT_PATH} directory:
{basename}.md{parent-name}.md${SDD_SPECIFICATION_PATH} directory:
{basename}_spec.md{parent-name}_spec.md or {parent-name}/index_spec.md${SDD_SPECIFICATION_PATH} directory:
{basename}_design.md{parent-name}_design.md or {parent-name}/index_design.mdID Generation for Hierarchical Structure:
For hierarchical directory structures (e.g., specification/auth/user-login_design.md):
"auth""user-login""design-auth-user-login"For flat structures (e.g., specification/user-login_design.md):
"design-user-login"Based on the type field, add the type-specific fields listed in templates/${SDD_LANG}/type_specific_fields.md (PRD / Spec / Design / Task / Implementation Log).
Use the report template at templates/${SDD_LANG}/recommendation_report.md.
For each document without front matter:
Report Sections:
--apply)--apply option)Only execute if --apply argument is present.
Use AskUserQuestion to confirm before modifying files:
Question: "以下の {count} 個のファイルに Front Matter を追加します。よろしいですか?" (en: "Add Front Matter to {count} files?")
Display:
Options:
If user cancels → Output recommendation report only and exit.
For each document without front matter (after user confirms):
---
id: "{inferred_id}"
title: "{extracted_title}"
type: "{type}"
status: "draft"
created: "{created_date}"
updated: "{updated_date}"
depends-on: [{dependency_ids}]
tags: [{inferred_tags}]
category: "{inferred_category}"
{type_specific_fields}
---
--- and first headingError Handling:
Use the result template at templates/${SDD_LANG}/application_result.md.
--apply OptionGenerate recommendation report using templates/${SDD_LANG}/recommendation_report.md:
--apply OptionAfter user confirmation and file updates:
Strongly recommend users to:
depends-on, tags, category) after applyingThe following fields are inferred using pattern matching and may require manual adjustment:
depends-on: May miss dependencies if naming conventions differtags: Basic keyword extraction, may not capture domain-specific conceptscategory: Inferred from directory structure, may need refinementpriority/risk: Always default to "medium", should be reviewed/check-spec --full for validation)