微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🔍

三方数据一致性智能审计

flatnotes-tasksmd-github-audit · vv1.0.0
专业技能 安全 A 级 作者 branexp 公开目录收录
1.8k 下载 370 安装 8k 收藏 57.5k 浏览

简介

基于 GitHub 作为事实来源,自动审计 Flatnotes 知识库与 Tasks.md 看板的一致性,检测过时笔记、缺失链接和项目漂移,生成可执行的修复计划。

原始描述

Thoroughly audit Tasks.md Flatnotes for drift and accuracy; use GitHub (gh CLI) as source of truth to detect stale notes/cards and missing links. Produces a report and an optional fix plan.

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/flatnotes-tasksmd-github-audit/
其它 Agent解压到它自己的 skills 目录,目录名用 flatnotes-tasksmd-github-audit

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

中文使用说明 来自收录源

核心用法

flatnotes-tasksmd-github-audit 是一个专为 Brandon 设计的本地审计工具,用于系统性检查个人任务管理系统(Tasks.md + Flatnotes)与 GitHub 仓库实际状态的同步程度。运行方式简单直接:

node skills/flatnotes-tasksmd-github-audit/scripts/audit.mjs --since-days 30 --write

工具会扫描三大数据源并生成交叉验证报告:

  1. Tasks.md 看板检查:验证泳道结构完整性、WIP 限制(Doing ≤ 3)、卡片格式规范(Outcome/Steps)、标签体系(proj/prio/eff/type)以及 Flatnotes: 指针完整性
  2. Flatnotes 项目笔记审计:确保每个活跃项目具备标准笔记结构(00 Overview、10 Research、20 Plan、90 Log),Hub 笔记包含状态摘要、链接区(repo + Tasks 过滤器)和决策区(ADR 链接)
  3. GitHub 真相对齐:通过 gh CLI 获取 Open PR 和近期 Merged PR,交叉验证 PR 是否映射到 Tasks 卡片或项目日志

输出为 Markdown 可读报告 + JSON 结构化数据,便于后续自动化处理。

显著优点

  • 零依赖安全设计:仅使用 Node.js 内置模块(fs, path, child_process, util),无第三方 npm 包,彻底消除供应链攻击面
  • 优雅降级机制:当 gh 未认证时,GitHub 检查自动标记为 SKIPPED_GITHUB,脚本不崩溃,本地审计仍可独立运行
  • 规则驱动的质量门:内置 lane 规则(如 prio-p2 必须位于 Backlog)、格式规范(Blocked 需含 Unblock:)等可量化检查项
  • 双向链接验证:同时验证 Tasks 卡片 → Flatnotes 指针,以及 Flatnotes Hub → ADR 笔记的反向链接完整性
  • 报告/修复分离:默认仅生成报告,所有破坏性操作需显式授权,符合安全最小权限原则

潜在缺点与局限性

  • GitHub 依赖限制:需本地安装并认证官方 gh CLI,且仅支持通过 gh 访问的仓库;私有仓库需额外配置权限
  • 启发式匹配局限:PR 与 Tasks 卡片的关联依赖 URL 匹配、编号匹配或标题子串启发式,可能存在误报或漏报
  • Markdown 解析脆弱性:依赖正则表达式解析 Tasks.md 表格和标签,对非标准格式容错性有限
  • 单用户场景设计:路径硬编码为 /home/ds/.config/appdata/,虽可通过环境变量覆盖,但迁移成本存在
  • 无增量审计机制:每次全量扫描,大型历史仓库性能可能下降

适合人群

  • 使用 Tasks.md + Flatnotes 组合进行项目管理的开发者
  • 追求 GitHub PR 与本地任务双向可追溯性的技术团队负责人
  • 需要定期"看板大扫除"但手动检查耗时的个人贡献者
  • 偏好本地优先、数据自主的隐私敏感型用户

常规风险

  • 文件系统读取范围:需授权访问本地笔记目录,虽为只读但仍需确认路径配置正确
  • gh CLI 认证状态:若使用未认证的 gh 实例,GitHub 校验将被跳过,可能导致"假阴性"(实际已漂移但未检出)
  • 报告解读门槛:输出包含大量细粒度检查项,需理解 Tasks.md 泳道语义和 Flatnotes 项目结构才能有效采取行动

技能正文


name: flatnotes-tasksmd-github-audit description: "Thoroughly audit Tasks.md + Flatnotes for drift and accuracy; use GitHub (gh CLI) as source of truth to detect stale notes/cards and missing links. Produces a report and an optional fix plan."

Flatnotes + Tasks.md + GitHub Audit

Use this skill when Brandon asks to audit the Flatnotes/Tasks.md system for accuracy and ensure it’s up to date, using GitHub as the source of truth.

Quick start

Run the bundled auditor (report-only):

node skills/flatnotes-tasksmd-github-audit/scripts/audit.mjs --since-days 30 --write

Outputs:

  • Markdown report: tmp/flatnotes-tasksmd-audit.md
  • JSON report: tmp/flatnotes-tasksmd-audit.json

If gh is not authenticated, the audit still runs but GitHub checks will be marked as SKIPPED_GITHUB.


Data sources (defaults)

  • Tasks.md root: /home/ds/.config/appdata/tasksmd/tasks
  • Flatnotes root: /home/ds/.config/appdata/flatnotes/data
  • Flatnotes “system notes” mirror in workspace: notes/resources/flatnotes-system/

Override via env vars:

  • TASKS_ROOT
  • FLATNOTES_ROOT

Audit goals (what “accurate” means)

A) Board hygiene (Tasks.md)

  • Global lanes exist: 00 Inbox, 05 Backlog, 10 Next, 20 Doing, 30 Blocked, 40 Waiting, 90 Done.
  • Lane rule preference: prio-p2 lives in 05 Backlog by default (no prio-p2 in 10 Next).
  • Doing WIP ≤ 3 (preference).
  • Cards should be consistently formatted (Outcome/Steps) and tagged (proj/prio/eff/type).
  • Blocked cards include Unblock:.
  • Project cards include a Flatnotes pointer (Flatnotes: ...).

B) Project completeness (Flatnotes)

For each active project in SYS Workspace - Project Registry:

  • Required project notes exist:
    • PJT <slug> - 00 Overview
    • PJT <slug> - 10 Research
    • PJT <slug> - 20 Plan
    • PJT <slug> - 90 Log
  • Hub note has:
    • Current status (1–3 bullets)
    • Links section with repo + Tasks filter
    • Decisions section linking relevant ADR(s)

C) GitHub truth reconciliation (GitHub = source of truth)

For each project repo in the registry:

  • Open PRs should have a corresponding Tasks card (Doing/Next/Blocked/Waiting) OR an explicit reason why not.
  • Recently merged PRs should be reflected somewhere:
    • preferably a short note in the project log (PJT <slug> - 90 Log) + hub status update, or
    • a Done card with PR link.
    • (Audit treats either as reconciled; it may warn if a merged PR is only on a Done card but missing from the log.)
  • Done cards should ideally include a PR link when work was shipped via PR.

Workflow (recommended)

  1. Parse registry

    • Read SYS Workspace - Project Registry from Flatnotes.
    • Extract: slug, status, Tasks tag, GitHub repo URL.
  2. Scan Tasks.md

    • Index cards by lane and by proj-* tag.
    • Flag lane rule violations (prio-p2 in Next, etc.).
    • Flag cards missing Flatnotes pointer.
  3. Scan Flatnotes

    • Check required project notes exist.
    • Check hub Decisions section links ADR notes.
  4. GitHub cross-check

    • Use gh:
      • gh pr list --state open --json ...
      • gh pr list --state merged --search "merged:>=<date>" --json ... (or equivalent)
    • Try to match PRs ↔ Tasks cards using:
      • PR URL in card content
      • PR number
      • Title substring heuristic
  5. Report

    • Output: summary + per-project drift list + fix plan.

Applying fixes (guardrails)

Default is report-only.

If Brandon explicitly asks to apply fixes:

  • Safe auto-fixes allowed:
    • create missing Flatnotes notes (10 Research, etc.) using existing templates
    • add missing ADR links to hub Decisions section
    • move prio-p2 from Next → Backlog
    • add missing Flatnotes pointers to Tasks cards
  • Anything that renames files or deletes content: ask first.

Bundled code

  • scripts/audit.mjs — generates the report (Markdown + JSON). If needed, patch it rather than rewriting.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

productivityproject-program-managementautomationdocsgitbackenddevops

同类 Skill