Coding

Agent项目必备文件管理器

Try it

文件太多?AI忘上文?换会话麻烦?AI记错版本? 请给 AI 长期项目建立「项目记忆 + 文件索引 + 工作规则 + 版本记录」的治理系统。让 AI 换会话、换模型、甚至换 Agent 后,仍然能完美交接项目,而无需重新遍历或猜测。 包含:跨 Agent 的公共协议:VERSIONS.md / LESSONS.md / whitelist.json / blacklist.json / index.md ;适配器:SKILL.md / CLAUDE.md / AGENTS.md / .cursor/rules/ 。 适配TRAE,其他代理无法保证。 CLI 已通过 76 用例健壮性测试。

What it does

Set up and maintain a project governance workspace for AI-assisted long-running projects — project protocol (AGENTS.md), directory index (index.md), error log (LESSONS.md), session handoff, changelog, stable version index (VERSIONS.md), whitelist/blacklist parameter registries. 为 AI 长期项目建立「项目记忆 + 文件索引 + 工作规则 + 版本记录」的治理系统,让 AI 在长期项目里「不忘事、不乱改、不重复犯错」,换会话后仍能接着做。Use when the user complains the project is messy, files are scattered or misplaced, the AI repeats mistakes or uses wrong versions, the user expects the AI to find files itself instead of asking for paths, when starting a new AI-assisted project, onboarding an AI agent into an existing project, or when a project lacks structured rules/versioning. 触发场景:项目太乱、文件乱、找不到文件、乱放文件、又用错版本、项目太多怎么管理、上次做到哪、你不是应该记得吗、哪个才是最终版、建立规则、版本索引、黑白名单。

The skill document

Project Governance

中文:给 AI 长期项目建立一套「项目记忆 + 文件索引 + 工作规则 + 版本记录」的管理系统,让 AI 换会话、换模型后仍能正确接着项目做,而不是重新猜项目。

30-second overview

这个 Skill 给项目增加 8 个东西:

  1. 项目规则 —— AI 应该怎么做
  2. 文件地图 —— 文件在哪里
  3. 项目状态 —— 现在做到哪里
  4. 错误记录 —— 以前踩过什么坑
  5. 版本索引 —— 哪个版本才是真的
  6. 黑白名单 —— 什么能用、什么不能用
  7. 会话交接 —— 上一个 AI 做到哪里
  8. 变更记录 —— 为什么这么改

核心目标:让 AI 换会话、换模型、甚至换 Agent 后,仍然能正确接着项目做,而不是重新猜项目。

When to Use

Use this skill when:

  • The user complains the project is messy, files are scattered, or the AI keeps misplacing files ("你怎么又乱放文件").
  • The user expects the AI to find files itself instead of asking for paths ("你自己找").
  • The AI keeps repeating mistakes or using wrong versions.
  • The user says "你不是应该记得吗?" / "上次不是已经验证过了吗?" / "哪个才是最终版?" / "别重新做,之前已经跑通了" — Memory + Governance boundary scenarios where memory alone is not a reliable authority.
  • Starting a new AI-assisted project and you want the agent to follow a stable protocol from day one.
  • Onboarding an AI agent into an existing project that has no rules, error log, or parameter registry.
  • A project has grown messy: files scattered, parameters changed without record, past mistakes repeated.
  • You want to enforce durable rules such as "index-first file lookup", "plan before execute", "file existence ≠ file validity", or "registry-driven parameter selection".

Do NOT use this skill when:

  • The task is a one-off question or small edit that does not need project-wide conventions.
  • The project already has a mature governance system and you only need a small rule tweak — edit the existing files directly instead.

Memory & Governance Boundary

Platform memory (e.g. Trae user profile / project memory) is a context source, not an authoritative fact store. Governance files are the project execution protocol. The two complement each other:

LayerWhat it answers
Platform memory"What happened before / how does this user usually work"
Governance files"How this project must work now, where files are, which version is authoritative"

Authority priority when they conflict:

  1. Current project files / frozen versions
  2. Project governance files (AGENTS.md, index.md, VERSIONS.md, registries)
  3. Project memory
  4. User long-term memory
  5. AI inference

When memory and governance files disagree, governance wins. Durable conventions learned from memory must be settled into the governance files after human confirmation — memory alone never becomes the project's authority.

Instructions

Step 1 — Scaffold

python scripts/governance.py init --project-dir /path/to/project --project-name "My Project"

Creates 11 governance files from templates/ (never overwrites existing files unless --force).

Step 2 — Customize

Edit the generated AGENTS.md: directory permission zones, autonomy levels, artifact placement rules, and project-specific rules under "Project Customization". Keep the universal Core Governance Rules as-is.

Step 3 — Maintain (every session)

  1. Session start: read index.mdsession_handoff.mdLESSONS.md; before generating parameters, read blacklist.json / whitelist.json.
  2. During work: find files via the index (never blind search); inherit whitelist entries with score > 0.85; never use permanent_ban: true; record new mistakes in LESSONS.md.
  3. Session end: update session_handoff.md, index.md (file changes), CHANGELOG.md (decisions).

Step 4 — Validate, index, check

python scripts/governance.py validate --project-dir /path/to/project   # registries conform to schema
python scripts/governance.py index --project-dir /path/to/project      # rebuild index.md map (links + notes)
python scripts/governance.py check --project-dir /path/to/project      # health gate: files + registries + fresh index

Input / Output

  • Input: a project directory (with or without existing governance files), a project name, and the user's governance pain points (messy files, wrong versions, repeated mistakes, "你自己找").
  • Output: a governance workspace (AGENTS.md, index.md, VERSIONS.md, LESSONS.md, session_handoff.md, CHANGELOG.md, whitelist.json / blacklist.json) plus a validated, up-to-date index.

On Failure

  • init fails (invalid path, permission): report the exact failing command and reason; do not partially scaffold or guess.
  • validate reports schema errors: fix the registry entries; never bypass validation.
  • check fails (missing files / stale index): run index, then re-run check; if still failing, report to the human.
  • Never fabricate a "passed" result — report what was verified and what was not.

What It Produces

FilePurpose
AGENTS.mdProject protocol: core governance rules, authority levels, first-run protocol, permission zones, trust boundary
index.md + index_notes.jsonAuthoritative directory map with clickable links and short notes
VERSIONS.mdStable version index with human judgments
LESSONS.mdAI error & correction log
session_handoff.mdEnd-of-session handoff
CHANGELOG.mdDecision & version history
whitelist.json / blacklist.jsonVerified / failed parameter registries
ARCHITECTURE.md / PROJECT.mdArchitecture & project card

Details

  • README.md — full package overview: Core / CLI / Skill-adapter structure, subcommands, limitations, Trae cold-start acceptance test
  • templates/ — governance file templates
  • scripts/governance.py — init / validate / index / check CLI

Limitations

This package is currently designed and tested primarily for Trae Skills. Other agents may use the generated governance files, but automatic Skill discovery/loading is not guaranteed outside Trae. The governance files and CLI are kept agent-neutral for future adapters.

Related skills

为项目仓库生成 AGENTS.md — AI 面向的项目 README。告诉 AI Coding Agent:项目是什么、怎么构建和测试、代码规范、编程原则等。 触发场景:用户需要创建 AGENTS.md、生成项目 AI 指南、为仓库写 AI 上下文文件、或提到「给 AI 看的 README」、agentsmd-...

1 installs

A cross-agent project memory skill for Codex and Claude Code, enabling consistent context, documentation, and development history across sessions.

多部门AI Agent组织架构搭建:层级设计、三通道通讯协议、日报汇报链、自主学习系统、全员审计巡查。解决Agent多了互相踩脚的问题——不是教你建团队,是教你一个AI团队怎么不被自己搞死。触发词:「agent团队」「多Agent组织」「Agent分工」「Agent管理」「Agent架构」「Agent协作」「AI组织」

智能体协会(agent-guild)— cross-agent shared memory. 本机多个 AI agent 共享 同一份身份、规则、记忆与交接消息 — 纯本地 Markdown/JSON,无服务器。 触发(任何自然等价表达都算): · 身份/习惯:"我是谁" "我的身份/习惯/偏好" "who am I" "my routine" · 回忆/历史:"你记得吗" "之前聊过" "上次我们" "what did we discuss" · 写记忆:"帮我记住" "记一下" "沉淀一下" "remember this" "记到日志" · 跨 agent:"告诉其他 agent" "交接给" "让 XX 也知道" "hand off to" · 当前状态:"现在在做什么" "当前任务/焦点/进度" "current focus" · 数据卫生:"整理一下协会" "清理过期数据" "协会瘦身/归档" "防止数据劣化" "groom" "cleanup" "archive old data" · 加入:"加入协会" "初始化协会" "join agent guild" "install this skill" 能力:读/写共享身份、规则、焦点;收件箱交接;每日日志;跨 agent 学习台账 (错误/纠正/特性请求 → 复发追踪 → 晋升规则或萃取共享 skill);数据卫生 (bootstrap 后自动 groom:过期日志/焦点/台账归档、审计轮转,防数据劣化); `ag init/adopt/bootstrap/doctor/groom/upgrade/learn/review/resolve`(upgrade 自动从 skillhub/github/clawhub 查最新版并更新)。 未加入?先跑 docs/ONBOARDING.md。

1 installs

Read and write shared state for ANY AI agent with a dual-layer model: durable cross-agent knowledge (`.agents/memory` + optional private local layer) and rea...

1 installs