Skip to content

qiusuo0226/chrono-pm-skill / governance-shared/baselines/3.20.0/ChronoPM-Project

chrono-pm-project

Verified

Markdown 驱动的单项目 AI 项目管理技能。覆盖需求、待办、进度、风险问题、里程碑、成本、日报周报、会议纪要、决策、复盘、初始化向导、计划、完整性巡检、历史计划导入、词库、PM 偏好。录入只发生在本项目 ai 目录。跨项目归集/检索请使用伴生技能 ChronoPM-Portfolio(只读)。触发:项目管理、日报、周报、风险登记册、需求追踪、里程碑、ChronoPM、记录/整理记录/补全/回填/更新/归档/入库/评审/验收、会议纪要、合同登记、初始化项目、倒排、待办、完整性巡检、词库、偏好、画图、责任链图。支持主动变更+人工确认:写入即标记待确认并登记 pm-decisions,确认后生效。需求只绑工作包,计划只绑工作包。

FileKindSize
CHANGELOG.mdmarkdown130.1 KB
SKILL.mdskill md14.1 KB
SKILL_BLUEPRINT.mdmarkdown53.4 KB
SKILL_MODULE_MAP.mdmarkdown6.4 KB
VERSIONother7 B
assets/templates/archive/resource-register-template.mdmarkdown3.9 KB
assets/templates/archive/transfer-log-template.mdmarkdown3.8 KB
assets/templates/change-log-archive-template.mdmarkdown1.2 KB
assets/templates/change-log-index-template.mdmarkdown1.2 KB
assets/templates/change-log-template.mdmarkdown1.8 KB
assets/templates/contract-register-template.mdmarkdown3.1 KB
assets/templates/daily-todo-binding-template.mdmarkdown6.2 KB
assets/templates/decision-log-template.mdmarkdown685 B
assets/templates/domain-glossary-template.mdmarkdown2.2 KB
assets/templates/import-log-template.mdmarkdown1.3 KB
assets/templates/index-formats.mdmarkdown4.9 KB
assets/templates/issue-register-template.mdmarkdown1.5 KB
assets/templates/legacy-sources-template.mdmarkdown1022 B
assets/templates/lessons-learned-template.mdmarkdown1.8 KB
assets/templates/meeting-template.mdmarkdown1.4 KB
assets/templates/ops-log-index-template.mdmarkdown534 B
assets/templates/ops-log-template.mdmarkdown1.5 KB
assets/templates/output-manifest-template.mdmarkdown1.0 KB
assets/templates/outputs-index-template.mdmarkdown1.3 KB
assets/templates/personal-daily-todo-template.mdmarkdown9.7 KB
assets/templates/plan-import-template.mdmarkdown1.7 KB
assets/templates/plan-template.mdmarkdown3.7 KB
assets/templates/pm-decisions-template.mdmarkdown5.3 KB
assets/templates/pm-profile-template.mdmarkdown8.0 KB
assets/templates/project-brief-template.mdmarkdown4.4 KB
assets/templates/project-context-template.mdmarkdown4.1 KB
assets/templates/project-lineage-template.mdmarkdown1.3 KB
assets/templates/project-notes-template.mdmarkdown1.1 KB
assets/templates/project-status-template.mdmarkdown2.3 KB
assets/templates/requirement-index-template.mdmarkdown813 B
assets/templates/requirement-register-template.mdmarkdown4.5 KB
assets/templates/risk-register-template.mdmarkdown1.8 KB
assets/templates/source-type-registry-template.mdmarkdown6.6 KB
assets/templates/weekly-report-template.mdmarkdown2.4 KB
assets/templates/workspace-health-template.mdmarkdown1.9 KB
assets/templates/wp-chart-template.mdmarkdown3.1 KB
assets/templates/wp-index-template.mdmarkdown1.8 KB
assets/templates/wp-template.mdmarkdown10.6 KB
governance/contracts/skill-contract.mdmarkdown7.8 KB
governance/migrations/README.mdmarkdown141 B
governance/migrations/upgrade-to-3.10.0.mdmarkdown10.2 KB
governance/migrations/upgrade-to-3.11.0.mdmarkdown6.1 KB
governance/migrations/upgrade-to-3.12.0.mdmarkdown7.2 KB
governance/migrations/upgrade-to-3.13.0.mdmarkdown6.6 KB
governance/migrations/upgrade-to-3.14.0.mdmarkdown10.0 KB
governance/migrations/upgrade-to-3.15.0.mdmarkdown7.2 KB
governance/migrations/upgrade-to-3.16.0.mdmarkdown6.0 KB
governance/migrations/upgrade-to-3.17.0.mdmarkdown5.7 KB
governance/migrations/upgrade-to-3.18.0.mdmarkdown5.3 KB
governance/migrations/upgrade-to-3.19.0.mdmarkdown5.5 KB
governance/migrations/upgrade-to-3.20.0.mdmarkdown6.0 KB
governance/migrations/upgrade-to-3.6.0.mdmarkdown2.3 KB
governance/migrations/upgrade-to-3.7.0.mdmarkdown3.1 KB
governance/migrations/upgrade-to-3.8.0.mdmarkdown19.4 KB
governance/migrations/upgrade-to-3.9.0.mdmarkdown11.1 KB
references/00-pm-main-rules.mdmarkdown80.5 KB
references/01-daily-report-rules.mdmarkdown35.3 KB
references/02-meeting-rules.mdmarkdown7.5 KB
references/04-risk-issue-rules.mdmarkdown15.3 KB
references/05-query-rules.mdmarkdown47.2 KB
references/06-file-rules.mdmarkdown29.6 KB
references/07-requirement-rules.mdmarkdown31.0 KB
references/08-change-control-rules.mdmarkdown10.2 KB
references/09-portfolio-rules.mdmarkdown391 B
references/10-update-trigger-rules.mdmarkdown23.0 KB
references/11-output-artifact-rules.mdmarkdown17.5 KB
references/12-excel-generation-rules.mdmarkdown15.4 KB
references/13-continuity-rules.mdmarkdown12.2 KB
references/14-self-check-rules.mdmarkdown27.0 KB
references/15-snapshot-rules.mdmarkdown3.9 KB
references/16-skill-governance-rules.mdmarkdown15.3 KB
references/17-domain-glossary-rules.mdmarkdown18.7 KB
references/18-init-wizard-rules.mdmarkdown13.8 KB
references/19-info-completeness-rules.mdmarkdown17.3 KB
references/20-workspace-version-rules.mdmarkdown15.3 KB
references/21-pm-profile-rules.mdmarkdown24.5 KB
references/22-carried-over-rules.mdmarkdown19.8 KB
references/23-procedure-index.mdmarkdown5.6 KB
reply-norm-skill/CAPABILITY.mdmarkdown858 B
reply-norm-skill/references/capability-boundary.mdmarkdown880 B
reply-norm-skill/references/reply-rules.mdmarkdown2.8 KB
scripts/_version.pyscript2.2 KB
scripts/carryover_step0.pyscript12.1 KB
scripts/chronopm_init/__init__.pyscript247 B
scripts/chronopm_init/config.pyscript9.5 KB
scripts/chronopm_init/file_registry.pyscript20.4 KB
scripts/chronopm_init/template_renderer.pyscript2.7 KB
scripts/chronopm_init/validators.pyscript1.2 KB
scripts/chronopm_init/workspace_builder.pyscript5.1 KB
scripts/init_workspace.pyscript2.0 KB
scripts/migrate_workspace.pyscript97.2 KB
scripts/sync_version.pyscript4.6 KB
scripts/verify_contract_ri.pyscript1.9 KB
scripts/verify_projection.pyscript11.1 KB
scripts/verify_requirement_wp.pyscript3.3 KB
scripts/verify_todo_continuity.pyscript3.4 KB
skill-gap-skill/CAPABILITY.mdmarkdown974 B
skill-gap-skill/assets/templates/skill-gap-demand-template.mdmarkdown2.7 KB
skill-gap-skill/references/capability-boundary.mdmarkdown1.1 KB
skill-gap-skill/references/gap-capture-rules.mdmarkdown6.7 KB
skill.jsonconfig39.0 KB
source-split-skill/CAPABILITY.mdmarkdown884 B
source-split-skill/assets/templates/source-atoms-index-template.mdmarkdown412 B
source-split-skill/assets/templates/source-doc-meta-template.mdmarkdown2.6 KB
source-split-skill/assets/templates/source-index-template.mdmarkdown739 B
source-split-skill/assets/templates/source-parse-log-template.mdmarkdown582 B
source-split-skill/references/capability-boundary.mdmarkdown1.3 KB
source-split-skill/references/split-rules.mdmarkdown3.5 KB
tests/regression-suite.mdmarkdown102.0 KB

scripts/carryover_step0.py

View on GitHub
#!/usr/bin/env python3
"""结转 Step 0 机械段:拷贝后裁剪。日常默认写盘。exit 0 完成;1 写失败;2 不可判仍建档。"""
from __future__ import annotations

import argparse
import datetime as dt
import re
import sys
from pathlib import Path

CLOSED = {"已完成", "已取消", "已转出"}
HDR_NAMES = {"姓名", "人员", "Name"}


def _ai(root: Path) -> Path:
    ai = root / "ai"
    return ai if ai.exists() else root


def _cells(line: str) -> list[str]:
    return [c.strip() for c in line.strip().strip("|").split("|")]


def _blank(today: str, name: str) -> str:
    return (
        f"---\ndoc_type: personal-daily-todo\nowner: {name}\ndate: {today}\n---\n\n"
        f"# 待办 - {today} - {name}\n\n## 1. 待办清单\n\n### 1.1 核心执行表(8 列)\n\n"
        "| 待办编号 | 标题 | 状态 | 进度 | WP Ref | 计划 Ref | 开始时间 | 结束时间 |\n"
        "|---|---|---|---|---|---|---|---|\n"
    )


H2 = r"^## "
H23 = r"^#{2,3} "


def _span(text: str, start_re: str, end_re: str = H23) -> tuple[int, int, int] | None:
    m = re.search(start_re, text, flags=re.M)
    if not m:
        return None
    rest = text[m.end() :]
    nxt = re.search(end_re, rest, flags=re.M)
    end = m.end() + (nxt.start() if nxt else len(rest))
    return m.start(), m.end(), end


def _replace_body(text: str, start_re: str, new_body: str, end_re: str = H23) -> str:
    sp = _span(text, start_re, end_re)
    if not sp:
        return text
    _s, body0, body1 = sp
    body = new_body if new_body.endswith("\n") else new_body + "\n"
    return text[:body0] + body + text[body1:]


def _body(text: str, start_re: str, end_re: str = H23) -> str:
    sp = _span(text, start_re, end_re)
    return text[sp[1] : sp[2]] if sp else ""


def _open_tds(block: str) -> set[str]:
    keep: set[str] = set()
    for line in block.splitlines():
        if not line.startswith("|") or "---" in line:
            continue
        cells = _cells(line)
        if cells and cells[0].startswith("TD-"):
            st = cells[2] if len(cells) > 2 else ""
            if st not in CLOSED:
                keep.add(cells[0])
    return keep


def _filter_table(block: str, keep: set[str], col: int = 0) -> str:
    out = []
    for line in block.splitlines():
        if line.startswith("|") and "---" not in line:
            cells = _cells(line)
            if len(cells) > col and cells[col].startswith("TD-") and cells[col] not in keep:
                continue
        out.append(line)
    return "\n".join(out)


def _filter_notes(block: str, keep: set[str], src_date: str) -> str:
    out = []
    for line in block.splitlines():
        m = re.match(r"^- (TD-\S+)[::]", line)
        if m:
            if m.group(1) not in keep:
                continue
            if "结转自" not in line:
                line = line.rstrip() + f" | 结转自 {src_date}"
        out.append(line)
    return "\n".join(out)


def _mark_s5(block: str, src_date: str) -> str:
    marker = f"未变(结转自 {src_date})"
    body = block.lstrip("\n")
    if "未变(结转自" in body:
        return "\n" + body
    return f"\n> {marker}\n" + body


def _trim_energy(block: str, today: str) -> str:
    cum = re.search(r"累计总能耗:[^\n]+", block)
    line = cum.group(0) if cum else f"累计总能耗:— [能耗单位](截至 {today})"
    line = re.sub(r"截至 \d{4}-\d{2}-\d{2}", f"截至 {today}", line)
    return (
        f"\n{line}\n\n"
        "| 日期 | 当日能耗 | 来源 | 备注 | 异常 |\n"
        "|---|---|---|---|---|\n"
        f"| {today} | — | — | — | — |\n"
    )


def _has_daily(text: str) -> bool:
    b = _body(text, r"^## 2\. 日报存档.*$", H2)
    stripped = re.sub(r"^>.*$", "", b, flags=re.M).strip()
    return bool(re.search(r"^### \d{4}-\d{2}-\d{2}", b, flags=re.M)) and len(stripped) > 40


def _asks(text: str, name: str, keep: set[str], src_text: str | None) -> str:
    rows = []
    if re.search(r"同时参与", text) or (src_text and re.search(r"同时参与", src_text)):
        rows.append(f"ASK:SHARE {name}")
    if not keep and (src_text is None or not _has_daily(src_text)):
        rows.append(f"ASK:IDLE {name}")
    return "\n".join(rows)


def _apply_trim(text: str, today: str, src_date: str) -> tuple[str, set[str]]:
    text = re.sub(r"^(date:\s*)\d{4}-\d{2}-\d{2}", rf"\g<1>{today}", text, count=1, flags=re.M)
    text = re.sub(r"(# 待办 - )\d{4}-\d{2}-\d{2}", rf"\g<1>{today}", text, count=1)
    keep = _open_tds(_body(text, r"^### 1\.1.+$"))
    text = _replace_body(text, r"^### 1\.1.+$", "\n" + _filter_table(_body(text, r"^### 1\.1.+$"), keep) + "\n")
    text = _replace_body(text, r"^### 1\.2.+$", "\n" + _filter_table(_body(text, r"^### 1\.2.+$"), keep) + "\n")
    text = _replace_body(text, r"^### 1\.3.+$", "\n" + _filter_table(_body(text, r"^### 1\.3.+$"), keep) + "\n")
    text = _replace_body(text, r"^### 1\.4.+$", "\n" + _filter_notes(_body(text, r"^### 1\.4.+$"), keep, src_date) + "\n")
    text = _replace_body(text, r"^### 1\.5.+$", "\n" + _filter_table(_body(text, r"^### 1\.5.+$"), keep, 0) + "\n")
    text = _replace_body(text, r"^## 0\.6.+$", _trim_energy(_body(text, r"^## 0\.6.+$", H2), today), H2)
    text = _replace_body(
        text, r"^## 5\..*$", _mark_s5(_body(text, r"^## 5\..*$", H2), src_date), H2
    )
    text = _replace_body(text, r"^## 2\. 日报存档.*$", "\n", H2)
    text = _replace_body(text, r"^## 3\. 工作日志.*$", "\n", H2)
    text = _replace_body(text, r"^## 6\. 变更日志.*$", "\n| 时间 | 变更内容 | 原因 |\n|---|---|---|\n", H2)
    text = _replace_body(text, r"^## Revision Log.*$", "\n| Time | Change | Reason | Operator |\n|---|---|---|---|\n", H2)
    return text, keep


def _row_map(block: str, col: int = 0) -> dict[str, str]:
    rows = {}
    for line in block.splitlines():
        if line.startswith("|") and "---" not in line:
            cells = _cells(line)
            if len(cells) > col and cells[col].startswith("TD-"):
                rows[cells[col]] = line
    return rows


def parse_index(index_md: Path) -> tuple[list[str], dict]:
    """§1 花名册:返回应建档姓名(非已出组)与标记字典。"""
    text = index_md.read_text(encoding="utf-8") if index_md.exists() else ""
    names: list[str] = []
    in_s1 = False
    for line in text.splitlines():
        if line.startswith("## 1") or ("花名册" in line and line.startswith("##")):
            in_s1 = True
            continue
        if in_s1 and line.startswith("## "):
            break
        if in_s1 and line.startswith("|") and "---" not in line:
            cells = _cells(line)
            if cells and cells[0] not in HDR_NAMES:
                st = cells[3] if len(cells) > 3 else (cells[1] if len(cells) > 1 else "")
                if "已出组" not in st:
                    names.append(cells[0])
    flags = {"done": bool(re.search(r"carryover_done_for_today.*true", text, re.I))}
    return names, flags


def find_source_file(todos: Path, name: str, today: str) -> Path | None:
    """该人 date≤today 的最新个人 md。"""
    dates = []
    if not todos.exists():
        return None
    for d in todos.iterdir():
        if d.is_dir() and re.match(r"\d{4}-\d{2}-\d{2}$", d.name) and d.name <= today:
            f = d / f"{name}.md"
            if f.exists():
                dates.append(d.name)
    if not dates:
        return None
    dates.sort()
    return todos / dates[-1] / f"{name}.md"


def copy_and_trim(src: Path | None, dest: Path, today: str, name: str) -> str:
    """源文件裁剪写入 dest。已有 dest 不覆盖 §2,只补缺失未办结。返回 ASK 片段。"""
    dest.parent.mkdir(parents=True, exist_ok=True)
    if dest.exists():
        dest_text = dest.read_text(encoding="utf-8")
        have = _open_tds(_body(dest_text, r"^### 1\.1.+$")) | set(_row_map(_body(dest_text, r"^### 1\.1.+$")))
        if src is None or not src.exists():
            return _asks(dest_text, name, have, None)
        src_text = src.read_text(encoding="utf-8")
        src_open = _open_tds(_body(src_text, r"^### 1\.1.+$"))
        missing = [td for td in src_open if td not in have]
        if missing:
            add11 = "\n".join(x for t in missing if (x := _row_map(_body(src_text, r"^### 1\.1.+$")).get(t)))
            dest_text = _replace_body(
                dest_text, r"^### 1\.1.+$", _body(dest_text, r"^### 1\.1.+$").rstrip() + "\n" + add11 + "\n"
            )
            add15_map = _row_map(_body(src_text, r"^### 1\.5.+$"))
            add15 = "\n".join(add15_map[t] for t in missing if t in add15_map)
            if add15:
                dest_text = _replace_body(
                    dest_text, r"^### 1\.5.+$", _body(dest_text, r"^### 1\.5.+$").rstrip() + "\n" + add15 + "\n"
                )
            dest.write_text(dest_text, encoding="utf-8")
            have |= set(missing)
        return _asks(dest_text, name, have | src_open, src_text)
    if src is None or not src.exists():
        dest.write_text(_blank(today, name), encoding="utf-8")
        return _asks("", name, set(), None)
    src_text = src.read_text(encoding="utf-8")
    m = re.search(r"^date:\s*(\d{4}-\d{2}-\d{2})", src_text, flags=re.M)
    src_date = m.group(1) if m else today
    text, keep = _apply_trim(src_text, today, src_date)
    dest.write_text(text, encoding="utf-8")
    return _asks(text, name, keep, src_text)


def update_markers(index_md: Path, today: str, names: list[str], ok: list[str], failed: list[str]) -> None:
    text = index_md.read_text(encoding="utf-8") if index_md.exists() else (
        f"---\ndoc_type: daily-todo-binding\ndate: {today}\n---\n\n# 当日待办绑定 - {today}\n"
    )
    if "carryover_done_for_today" in text:
        text = re.sub(r"(carryover_done_for_today[:\s*]*)[^\n]+", r"\1true", text, count=1)
    else:
        text += "\n\n> **carryover_done_for_today**: true\n"
    index_md.parent.mkdir(parents=True, exist_ok=True)
    index_md.write_text(text, encoding="utf-8")


def emit_report(today: str, ok: list[str], failed: list[str], asks: list[str]) -> None:
    print(f"CARRYOVER {today} ok={len(ok)} fail={len(failed)}")
    for n in ok:
        print(f"OK {n}")
    for n in failed:
        print(f"FAIL {n}")
    for a in asks:
        print(a)


def main() -> int:
    p = argparse.ArgumentParser()
    p.add_argument("--root", required=True)
    p.add_argument("--date", default=None)
    p.add_argument("--dry-run", action="store_true")
    args = p.parse_args()
    today = args.date or dt.date.today().isoformat()
    if args.date and args.date > dt.date.today().isoformat():
        print("REFUSE future date (N-37)")
        return 1
    ai = _ai(Path(args.root))
    todos = ai / "todos"
    if not todos.exists():
        print("无 todos/")
        return 2
    dates = sorted(
        d.name
        for d in todos.iterdir()
        if d.is_dir() and re.match(r"\d{4}-\d{2}-\d{2}$", d.name) and d.name <= today
    )
    legal = todos / dates[-1] / "_index.md" if dates else None
    if legal is None or not legal.exists():
        print("无合法 _index")
        return 2
    names, flags = parse_index(legal)
    today_dir = todos / today
    today_idx = today_dir / "_index.md"
    if flags.get("done") and today_idx.exists() and all((today_dir / f"{n}.md").exists() for n in names):
        print("SKIP already done")
        return 0
    if args.dry_run:
        print(f"DRY names={len(names)}")
        return 0
    if legal != today_idx:
        today_dir.mkdir(parents=True, exist_ok=True)
        if not today_idx.exists():
            today_idx.write_text(legal.read_text(encoding="utf-8"), encoding="utf-8")
    ok, failed, asks = [], [], []
    for name in names:
        dest = today_dir / f"{name}.md"
        try:
            src = find_source_file(todos, name, today)
            if src == dest:
                src = None
            a = copy_and_trim(src, dest, today, name)
            if a:
                asks.extend(x for x in a.splitlines() if x)
            ok.append(name)
        except OSError as e:
            failed.append(name)
            print(f"E5 {name} {e}")
    update_markers(today_idx, today, names, ok, failed)
    emit_report(today, ok, failed, asks)
    return 1 if failed else 0


if __name__ == "__main__":
    sys.exit(main())
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