关于 the-ledger
the-ledger 是 Gangsta Agents 系列的持久记忆技能,在目标项目中记录有效方法、失败经验和项目规则,为后续阶段及任务提供依据。
主要功能
- 01记录经验与失败案例
- 02维护项目章程
- 03按主题标签检索记录
- 04在 Heist 中应用约束
- 05记录条目来源
适用场景
- 01保存绕过复杂约束的解决方法
- 02记录回归问题或错误方案
- 03在提出或实施更改前核对项目规则
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ kucherenko/ gangsta --skill the-ledger安装后在 Claude Code 中输入/the-ledger确认已加载。
详细介绍
账簿:Gangsta Agents Family 的机构记忆
概述
账簿是 Gangsta Agents Family 的持久记忆。它存储成功的推理路径(洞见)、记录在案的失败(失败案例)以及积累的治理规则(项目章程)。每次行动都会从账簿中读取信息并写入内容。
目录结构
账簿位于目标项目中,而不是 gangsta 软件包中:
docs/gangsta/
├── constitution.md # Project Constitution (living document)
├── insights/ # Repository of Insights (Good Catches)
│ └── YYYY-MM-DD-<topic>.md
└── fails/ # Repository of Fails (Concrete Shoes)
└── YYYY-MM-DD-<topic>.md
初始化账簿
如果目标项目中不存在 docs/gangsta/,请创建该目录:
mkdir -p docs/gangsta/insights docs/gangsta/fails
创建初始文件 docs/gangsta/constitution.md:
# Project Constitution
## Commandments (from Insights)
_No commandments yet. They will be added as Heists produce insights._
## Negative Constraints (from Fails)
_No constraints yet. They will be added as Heists document failures._
## Architectural Decisions
_No decisions recorded yet._
编写洞见
标准: 当某个解决方案绕过了复杂的限制、发现了不易察觉的方法,或确立了新的项目戒律时,记录下来。
文件: docs/gangsta/insights/YYYY-MM-DD-<topic-slug>.md
---
date: YYYY-MM-DD
heist: <heist-name>
phase: <phase-where-discovered>
tags: [tag1, tag2, tag3]
---
# <Title: Short description of the insight>
## Discovery
<How the insight was found — which phase, what triggered it>
## Solution
<The successful reasoning pathway or creative solution>
## Project Commandment
<If applicable: a new rule to add to the Constitution>
<If not applicable: omit this section>
写入后,更新 docs/gangsta/constitution.md:
- 将戒律(如有)添加到“戒律”部分
- 添加来源引用:
— Source: insights/YYYY-MM-DD-<topic>.md
编写失败案例
标准: 当某种方法导致回归、安全漏洞、时间浪费或错误实现时,记录下来。
文件: docs/gangsta/fails/YYYY-MM-DD-<topic-slug>.md
---
date: YYYY-MM-DD
heist: <heist-name>
phase: <phase-where-occurred>
tags: [tag1, tag2, tag3]
severity: critical | high | medium | low
---
# <Title: Short description of the failure>
## What Happened
<Description of the failure and its observable impact>
## Cognitive Diagnosis
<Causal mechanism explaining WHY the failure occurred — not just what went wrong, but the reasoning error that led to it>
## Negative Constraint
<The explicit prohibition: "NEVER [prohibited pattern] because [reason]">
写入后,更新 docs/gangsta/constitution.md:
- 将负面约束添加到“负面约束”部分
- 添加来源引用:
— Source: fails/YYYY-MM-DD-<topic>.md
阅读账簿
侦察期间
在 insights/ 和 fails/ 中搜索标签与当前行动主题匹配的条目。在侦察档案中列出相关条目。
审讯期间
魔鬼代言人必须在接受任何提案前检查所有负面约束。如果提案违反了某项负面约束,则自动驳回。
密谈期间
副头目在起草契约时引用戒律。契约必须引用所有相关戒律。
行动期间
工人在实施前检查负面约束。如果某个工作包可能违反约束,工人应向小队负责人升级处理。
洗钱期间
写入行动中新增的洞见和失败案例,并更新章程。
Omerta 合规
- 真实原则:所有账簿条目都引用具体阶段、行动和可观察证据
- 可用性原则:每次更新后都将账簿文件提交到 git
- 规范即法律:章程中的负面约束对今后的所有行动均具有约束力