Skip to content

MinLeeV5/devkeel / .harness/skills/brainstorming

brainstorming

Verified

探索、比较、挑战或补全开发方案;按 Lite/Full 深度组织相关问题、形成可读结论,并在用户同意持久化后维护 OpenSpec Living brainstorm。

FileKindSize
SKILL.mdskill md7.6 KB
agents/openai.yamlconfig220 B
references/living-brainstorm.mdmarkdown4.5 KB
references/openspec-context.mdmarkdown2.4 KB
scripts/openspec-status-snapshot.shexecutablescript1.1 KB
scripts/planning-state.mjsexecutablescript3.3 KB

scripts/planning-state.mjs

View on GitHub
#!/usr/bin/env node

import fs from 'node:fs'
import path from 'node:path'

const input = process.argv[2]

if (!input) {
  process.stderr.write('Usage: planning-state.mjs <brainstorm.md>\n')
  process.exit(2)
}

const filePath = path.resolve(input)
if (!fs.existsSync(filePath)) {
  process.stdout.write(`${JSON.stringify({
    state: 'MISSING',
    valid: false,
    applyReady: false,
    file: filePath,
    reasons: ['brainstorm.md 不存在'],
  })}\n`)
  process.exit(0)
}

const source = fs.readFileSync(filePath, 'utf8')
const statusLines = source.match(/^> \*\*状态:\*\* `(?:DRAFT|CONFIRMED)`[^\n]*$/gmu) ?? []

if (statusLines.length === 0) {
  process.stdout.write(`${JSON.stringify({
    state: 'LEGACY',
    valid: false,
    applyReady: false,
    file: filePath,
    reasons: ['缺少 Living Artifact 状态行,需要迁移并由用户确认'],
  })}\n`)
  process.exit(0)
}

const reasons = []
if (statusLines.length !== 1) reasons.push(`状态行数量必须为 1,实际为 ${statusLines.length}`)

const statusLine = statusLines[0] ?? ''
const draftMatch = statusLine.match(/^> \*\*状态:\*\* `DRAFT` · \*\*阶段:\*\* (探索中|收敛中|可确认)$/u)
const legacyDraftMatch = statusLine.match(/^> \*\*状态:\*\* `DRAFT` · \*\*实施准备度:\*\* \d+%$/u)
const confirmedMatch = statusLine.match(
  /^> \*\*状态:\*\* `CONFIRMED` · \*\*确认项:\*\* (\d+) D \/ (\d+) A \/ (\d+) O$/u,
)

if (!draftMatch && !legacyDraftMatch && !confirmedMatch) reasons.push('状态行格式无效')

const historyStart = source.search(/^## 决策变更记录\s*$/mu)
const activeSource = historyStart >= 0 ? source.slice(0, historyStart) : source
const decisionMatches = [...activeSource.matchAll(/^#### (D|A|O)-(\d+)\b.*$/gmu)]
const ids = decisionMatches.map(match => `${match[1]}-${match[2]}`)
const duplicates = [...new Set(ids.filter((id, index) => ids.indexOf(id) !== index))]
if (duplicates.length > 0) reasons.push(`存在重复确认项:${duplicates.join(', ')}`)

const counts = { D: 0, A: 0, O: 0 }
for (const id of new Set(ids)) counts[id[0]] += 1

const downstreamMatches = [...source.matchAll(/^- \*\*下游状态:\*\* `(NONE|CURRENT|STALE)`\s*$/gmu)]
if (downstreamMatches.length !== 1) {
  reasons.push(`下游状态行数量必须为 1,实际为 ${downstreamMatches.length}`)
}
const downstream = downstreamMatches[0]?.[1] ?? 'UNKNOWN'

let state = 'INVALID'
const stage = draftMatch?.[1] ?? null

if (draftMatch || legacyDraftMatch) {
  state = 'DRAFT'
  if (stage === '可确认' && counts.O > 0) reasons.push('可确认阶段不能包含开放项 O-*')
}

if (confirmedMatch) {
  state = 'CONFIRMED'
  const declared = {
    D: Number(confirmedMatch[1]),
    A: Number(confirmedMatch[2]),
    O: Number(confirmedMatch[3]),
  }
  for (const kind of ['D', 'A', 'O']) {
    if (declared[kind] !== counts[kind]) {
      reasons.push(`${kind} 计数不一致:状态行为 ${declared[kind]},正文为 ${counts[kind]}`)
    }
  }
  if (counts.O > 0) reasons.push('CONFIRMED 不能包含开放项 O-*')
}

const valid = reasons.length === 0
const applyReady = valid && state === 'CONFIRMED' && downstream === 'CURRENT'

process.stdout.write(`${JSON.stringify({
  state,
  valid,
  applyReady,
  stage,
  needsStageMigration: Boolean(legacyDraftMatch),
  counts,
  downstream,
  duplicates,
  file: filePath,
  reasons,
})}\n`)
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall