fn scaffold(featureName) {
// Create new spec with auto-incrementing ID
Bash(
)
Create README.md from template.md
Report created spec status
}
fn readStatus(specId) {
// Read existing spec metadata
Bash(
)
Parse TOML output into SpecStatus
// Suggest continuation point
match (documents) {
plan exists => "PLAN found. Proceed to implementation?"
sdd exists, no plan => "SDD found. Continue to PLAN?"
prd exists, no sdd => "PRD found. Continue to SDD?"
no documents => "Start from PRD?"
}
}
fn transitionPhase(specId, phase) {
Update README.md document status and current phase.
Log phase transition in decisions table.
// Handoff to document-specific skills:
match (phase) {
PRD => specify-requirements skill
SDD => specify-solution skill
PLAN => specify-plan skill
}
// On completion, return here for next phase transition.
}
fn logDecision(specId, decision, rationale) {
Append row to README.md Decisions Log table.
Update Last Updated field.
}
specifyMeta($ARGUMENTS) {
match ($ARGUMENTS) {
featureName (new) => scaffold(featureName)
specId (existing) => readStatus(specId) |> transitionPhase |> logDecision
}
}
fn scaffold(featureName) {
// 使用自动递增ID创建新规范
Bash(
)
从template.md生成README.md
报告已创建的规范状态
}
fn readStatus(specId) {
// 读取现有规范的元数据
Bash(
)
将TOML输出解析为SpecStatus格式
// 建议后续操作节点
match (documents) {
plan已存在 => "已找到PLAN。是否进入实现阶段?"
已存在SDD但无plan => "已找到SDD。是否继续到PLAN阶段?"
已存在PRD但无sdd => "已找到PRD。是否继续到SDD阶段?"
无任何文档 => "是否从PRD阶段开始?"
}
}
fn transitionPhase(specId, phase) {
更新README.md中的文档状态和当前阶段。
在决策表中记录阶段转换信息。
// 移交至文档专属技能:
match (phase) {
PRD => specify-requirements skill
SDD => specify-solution skill
PLAN => specify-plan skill
}
// 完成后返回此处进行下一阶段转换。
}
fn logDecision(specId, decision, rationale) {
向README.md的决策日志表中追加行记录。
更新“最后更新”字段。
}
specifyMeta($ARGUMENTS) {
match ($ARGUMENTS) {
featureName (新功能) => scaffold(featureName)
specId (已有规范) => readStatus(specId) |> transitionPhase |> logDecision
}
}