@kunlv/atdc 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +58 -0
- package/GO.md +245 -0
- package/bin/add-command.py +144 -0
- package/bin/atdc.js +460 -0
- package/bin/cls.js +98 -0
- package/central/link.sh +60 -0
- package/central/ticket_center_server/.handoffs/TASK-238389_QYinVipLimit.md +128 -0
- package/central/ticket_center_server/.test_plans/TASK-227254-SupportMembership-self-test-plan.md +566 -0
- package/central/ticket_center_server/.test_plans/task-238389-qyin-vip-limit-self-test-plan.md +210 -0
- package/commands/claude/atd.md +3 -0
- package/commands/claude/atdc/1-spec.md +5 -0
- package/commands/claude/atdc/1-update.md +5 -0
- package/commands/claude/atdc/2-qa.md +3 -0
- package/commands/claude/atdc/3-impl-skip-spec.md +5 -0
- package/commands/claude/atdc/3-impl.md +3 -0
- package/commands/claude/atdc/4-verify.md +3 -0
- package/commands/claude/atdc/5-done.md +3 -0
- package/commands/claude/atdc/add-command.md +4 -0
- package/commands/claude/atdc/add-to-hc.md +3 -0
- package/commands/claude/atdc/analysis-cls-log.md +4 -0
- package/commands/claude/atdc/article.md +6 -0
- package/commands/claude/atdc/bugfix.md +4 -0
- package/commands/claude/atdc/code-simplifier.md +8 -0
- package/commands/claude/atdc/commit.md +4 -0
- package/commands/claude/atdc/compound.md +5 -0
- package/commands/claude/atdc/context.md +3 -0
- package/commands/claude/atdc/diagnose.md +8 -0
- package/commands/claude/atdc/git-guardrails.md +18 -0
- package/commands/claude/atdc/grill-with-docs.md +8 -0
- package/commands/claude/atdc/handoff.md +8 -0
- package/commands/claude/atdc/health.md +3 -0
- package/commands/claude/atdc/learn.md +4 -0
- package/commands/claude/atdc/review.md +10 -0
- package/commands/claude/atdc/search.md +4 -0
- package/commands/claude/atdc/strategy.md +3 -0
- package/commands/claude/atdc/table2xlsx.md +4 -0
- package/commands/claude/atdc/test-plan.md +5 -0
- package/commands/claude/atdc/travel-planner.md +4 -0
- package/commands/claude/atdc/xlsx2sql-insert.md +4 -0
- package/commands/claude/atdc/xlsx2sql-update.md +4 -0
- package/commands/claude/atdc/zoom-out.md +8 -0
- package/commands/codex/atdc/SKILL.md +8 -0
- package/commands/codex/atdc-1-spec/SKILL.md +8 -0
- package/commands/codex/atdc-1-update/SKILL.md +8 -0
- package/commands/codex/atdc-2-qa/SKILL.md +8 -0
- package/commands/codex/atdc-3-impl/SKILL.md +8 -0
- package/commands/codex/atdc-3-impl-skip-spec/SKILL.md +8 -0
- package/commands/codex/atdc-4-verify/SKILL.md +8 -0
- package/commands/codex/atdc-5-done/SKILL.md +8 -0
- package/commands/codex/atdc-add-command/SKILL.md +7 -0
- package/commands/codex/atdc-add-to-hc/SKILL.md +8 -0
- package/commands/codex/atdc-analysis-cls-log/SKILL.md +5 -0
- package/commands/codex/atdc-article/SKILL.md +8 -0
- package/commands/codex/atdc-bugfix/SKILL.md +5 -0
- package/commands/codex/atdc-code-simplifier/SKILL.md +7 -0
- package/commands/codex/atdc-commit/SKILL.md +7 -0
- package/commands/codex/atdc-compound/SKILL.md +8 -0
- package/commands/codex/atdc-context/SKILL.md +8 -0
- package/commands/codex/atdc-diagnose/SKILL.md +9 -0
- package/commands/codex/atdc-git-guardrails/SKILL.md +19 -0
- package/commands/codex/atdc-grill-with-docs/SKILL.md +9 -0
- package/commands/codex/atdc-handoff/SKILL.md +9 -0
- package/commands/codex/atdc-health/SKILL.md +8 -0
- package/commands/codex/atdc-learn/SKILL.md +7 -0
- package/commands/codex/atdc-review/SKILL.md +49 -0
- package/commands/codex/atdc-search/SKILL.md +5 -0
- package/commands/codex/atdc-strategy/SKILL.md +8 -0
- package/commands/codex/atdc-table2xlsx/SKILL.md +8 -0
- package/commands/codex/atdc-test-plan/SKILL.md +13 -0
- package/commands/codex/atdc-travel-planner/SKILL.md +7 -0
- package/commands/codex/atdc-xlsx2sql-insert/SKILL.md +8 -0
- package/commands/codex/atdc-xlsx2sql-update/SKILL.md +8 -0
- package/commands/codex/atdc-zoom-out/SKILL.md +9 -0
- package/commands/cursor/atdc/SKILL.md +8 -0
- package/commands/cursor/atdc-1-spec/SKILL.md +8 -0
- package/commands/cursor/atdc-1-update/SKILL.md +8 -0
- package/commands/cursor/atdc-2-qa/SKILL.md +8 -0
- package/commands/cursor/atdc-3-impl/SKILL.md +8 -0
- package/commands/cursor/atdc-3-impl-skip-spec/SKILL.md +8 -0
- package/commands/cursor/atdc-4-verify/SKILL.md +8 -0
- package/commands/cursor/atdc-5-done/SKILL.md +8 -0
- package/commands/cursor/atdc-add-command/SKILL.md +7 -0
- package/commands/cursor/atdc-add-to-hc/SKILL.md +8 -0
- package/commands/cursor/atdc-analysis-cls-log/SKILL.md +5 -0
- package/commands/cursor/atdc-article/SKILL.md +8 -0
- package/commands/cursor/atdc-bugfix/SKILL.md +5 -0
- package/commands/cursor/atdc-code-simplifier/SKILL.md +7 -0
- package/commands/cursor/atdc-commit/SKILL.md +7 -0
- package/commands/cursor/atdc-compound/SKILL.md +8 -0
- package/commands/cursor/atdc-context/SKILL.md +8 -0
- package/commands/cursor/atdc-diagnose/SKILL.md +8 -0
- package/commands/cursor/atdc-git-guardrails/SKILL.md +18 -0
- package/commands/cursor/atdc-grill-with-docs/SKILL.md +8 -0
- package/commands/cursor/atdc-handoff/SKILL.md +8 -0
- package/commands/cursor/atdc-health/SKILL.md +8 -0
- package/commands/cursor/atdc-learn/SKILL.md +7 -0
- package/commands/cursor/atdc-review/SKILL.md +49 -0
- package/commands/cursor/atdc-search/SKILL.md +5 -0
- package/commands/cursor/atdc-strategy/SKILL.md +8 -0
- package/commands/cursor/atdc-table2xlsx/SKILL.md +8 -0
- package/commands/cursor/atdc-test-plan/SKILL.md +7 -0
- package/commands/cursor/atdc-travel-planner/SKILL.md +7 -0
- package/commands/cursor/atdc-xlsx2sql-insert/SKILL.md +8 -0
- package/commands/cursor/atdc-xlsx2sql-update/SKILL.md +8 -0
- package/commands/cursor/atdc-zoom-out/SKILL.md +8 -0
- package/commands/opencode/atd.md +6 -0
- package/commands/opencode/atdc/1-spec.md +8 -0
- package/commands/opencode/atdc/1-update.md +8 -0
- package/commands/opencode/atdc/2-qa.md +6 -0
- package/commands/opencode/atdc/3-impl-skip-spec.md +8 -0
- package/commands/opencode/atdc/3-impl.md +6 -0
- package/commands/opencode/atdc/4-verify.md +6 -0
- package/commands/opencode/atdc/5-done.md +6 -0
- package/commands/opencode/atdc/add-command.md +6 -0
- package/commands/opencode/atdc/add-to-hc.md +6 -0
- package/commands/opencode/atdc/analysis-cls-log.md +6 -0
- package/commands/opencode/atdc/article.md +6 -0
- package/commands/opencode/atdc/bugfix.md +6 -0
- package/commands/opencode/atdc/code-simplifier.md +8 -0
- package/commands/opencode/atdc/commit.md +6 -0
- package/commands/opencode/atdc/compound.md +8 -0
- package/commands/opencode/atdc/context.md +6 -0
- package/commands/opencode/atdc/diagnose.md +8 -0
- package/commands/opencode/atdc/git-guardrails.md +18 -0
- package/commands/opencode/atdc/grill-with-docs.md +8 -0
- package/commands/opencode/atdc/handoff.md +8 -0
- package/commands/opencode/atdc/health.md +6 -0
- package/commands/opencode/atdc/learn.md +6 -0
- package/commands/opencode/atdc/review.md +7 -0
- package/commands/opencode/atdc/search.md +6 -0
- package/commands/opencode/atdc/strategy.md +6 -0
- package/commands/opencode/atdc/table2xlsx.md +6 -0
- package/commands/opencode/atdc/test-plan.md +6 -0
- package/commands/opencode/atdc/travel-planner.md +6 -0
- package/commands/opencode/atdc/xlsx2sql-insert.md +6 -0
- package/commands/opencode/atdc/xlsx2sql-update.md +6 -0
- package/commands/opencode/atdc/zoom-out.md +8 -0
- package/config/cls-defaults.json +19 -0
- package/hooks/atd-archive.sh +86 -0
- package/hooks/atd-state.sh +165 -0
- package/hooks/evidence-hook.sh +88 -0
- package/hooks/evidence-log.sh +54 -0
- package/hooks/guardrails.sh +65 -0
- package/hooks/handoff-compress.sh +104 -0
- package/hooks/phase-guard.sh +134 -0
- package/hooks/phase-write-guard.sh +96 -0
- package/hooks/ponytail-fix.sh +179 -0
- package/hooks/ponytail-guard.sh +66 -0
- package/hooks/ponytail-scan.sh +62 -0
- package/install.sh +276 -0
- package/package.json +20 -0
- package/packages/cls/bin/cls.js +146 -0
- package/packages/cls/config/defaults.json +17 -0
- package/packages/cls/mcp/server.js +142 -0
- package/packages/cls/package.json +29 -0
- package/packages/cls/scripts/postinstall.js +19 -0
- package/packages/cls/src/client.js +262 -0
- package/prompts/1-spec.md +271 -0
- package/prompts/1-update.md +198 -0
- package/prompts/2-qa.md +164 -0
- package/prompts/3-impl-bugfix.md +271 -0
- package/prompts/3-impl.md +419 -0
- package/prompts/4-verify.md +160 -0
- package/prompts/5-done.md +227 -0
- package/prompts/6-article.md +571 -0
- package/prompts/X-add-command.md +60 -0
- package/prompts/X-add-to-hc.md +178 -0
- package/prompts/X-analysis-cls-log.md +68 -0
- package/prompts/X-bugfix.md +10 -0
- package/prompts/X-code-simplifier.md +38 -0
- package/prompts/X-commit.md +116 -0
- package/prompts/X-compound.md +188 -0
- package/prompts/X-context-scan.md +101 -0
- package/prompts/X-diagnose.md +116 -0
- package/prompts/X-grill-with-docs.md +120 -0
- package/prompts/X-handoff.md +80 -0
- package/prompts/X-health.md +78 -0
- package/prompts/X-learn.md +151 -0
- package/prompts/X-review.md +417 -0
- package/prompts/X-search.md +74 -0
- package/prompts/X-strategy.md +95 -0
- package/prompts/X-table2xlsx.md +46 -0
- package/prompts/X-test-plan.md +436 -0
- package/prompts/X-travel-planner.md +22 -0
- package/prompts/X-xlsx2sql-insert.md +34 -0
- package/prompts/X-xlsx2sql-update.md +40 -0
- package/prompts/X-zoom-out.md +119 -0
- package/reference/diagnose-loop.md +66 -0
- package/reference/gates.md +90 -0
- package/reference/git-guardrails.md +71 -0
- package/reference/guards.md +275 -0
- package/reference/learn.md +100 -0
- package/reference/memory.md +190 -0
- package/reference/risk.md +74 -0
- package/reference/tdd.md +40 -0
- package/scripts/svg2png.js +46 -0
- package/src/cls/client.js +244 -0
- package/src/constants.js +49 -0
- package/src/evidence/ai-draft-metrics.js +157 -0
- package/src/evidence/canvas.js +184 -0
- package/src/evidence/index.js +98 -0
- package/src/evidence/sink-events.js +165 -0
- package/src/evidence/stage-timing.js +112 -0
- package/src/installers/claude.js +79 -0
- package/src/installers/codex.js +62 -0
- package/src/installers/opencode.js +72 -0
- package/src/manifest/ponytail-patterns.json +185 -0
- package/src/mcp/cls-mcp-server.js +142 -0
- package/src/utils.js +79 -0
- package/src/validators/state-validate.js +123 -0
- package/templates/.phase-state.json +13 -0
- package/templates/adr.md +62 -0
- package/templates/changelog.md +21 -0
- package/templates/concepts.md +35 -0
- package/templates/design.md +47 -0
- package/templates/handoff.md +64 -0
- package/templates/learn-skill.md +43 -0
- package/templates/progress.json +17 -0
- package/templates/proposal.md +29 -0
- package/templates/solution.md +36 -0
- package/templates/strategy.md +39 -0
- package/templates/tasks.md +41 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: atd:review
|
|
3
|
+
description: 代码review(CRG+CodeGraph:blast radius+风险+测试缺口)。触发词:review、代码审查。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用 Read 工具读取 `${ATDC_DIR}/prompts/X-review.md`,然后根据参数开始执行。
|
|
7
|
+
|
|
8
|
+
跳过 GO.md 路由,直接进行代码级 review。无参数时执行全量 review。
|
|
9
|
+
|
|
10
|
+
## 子模式
|
|
11
|
+
|
|
12
|
+
| 参数 | 说明 |
|
|
13
|
+
|------|------|
|
|
14
|
+
| 无参数 | 全量 review(CRG + CodeGraph) |
|
|
15
|
+
| `delta` | 仅变更文件 review |
|
|
16
|
+
| `pr` | PR/分支 review |
|
|
17
|
+
| `gaps` | 仅测试缺口检测 |
|
|
18
|
+
| `flows` | 仅受影响流程追踪 |
|
|
19
|
+
| `arch` | 架构健康检查(耦合/桥接/枢纽) |
|
|
20
|
+
| `crg` | CRG 深度分析(token 高效模式) |
|
|
21
|
+
|
|
22
|
+
## 强制规则
|
|
23
|
+
|
|
24
|
+
### 规则 1:pr 模式必须先合并 origin/master
|
|
25
|
+
|
|
26
|
+
对于 `pr` 模式,执行 Phase 1 前**必须**先将 `origin/master` 最新代码合并到当前分支,避免 diff 包含已合入 master 的内容:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git fetch origin master && git merge origin/master --no-edit
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 规则 2:报告输出路径固定
|
|
33
|
+
|
|
34
|
+
Review 报告**必须**输出到项目根目录的 `docs/report/`,命名格式:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
docs/report/code-review-<分支名或change号>-<YYYY-MM-DD>.md
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
前缀固定为 `code-review-`,日期为当天日期。不再保存到 `openspec/changes/`。
|
|
41
|
+
|
|
42
|
+
### 规则 3:检测到 DB 操作时必须做慢查校验
|
|
43
|
+
|
|
44
|
+
Review 过程中检测到变更代码包含 SQL 查询(Raw SQL / GORM / DB 连接)时:
|
|
45
|
+
1. **暂停** review,向用户列出涉及的 SQL 和表名
|
|
46
|
+
2. 要求用户提供对应表的 `CREATE TABLE` 语句(DDL)
|
|
47
|
+
3. 用户提供 DDL 后,逐条分析每条 SQL 的索引命中情况(命中/部分覆盖/filesort/temp table)
|
|
48
|
+
4. 给出 EXPLAIN 预估和慢查风险等级(🟢低/🟡中/🔴高)
|
|
49
|
+
5. 汇总到 review 报告的 "DB 慢查分析" 章节
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: atd:test-plan
|
|
3
|
+
description: 生成自测计划+集成测试代码。触发词:test-plan、自测计划、生成自测。
|
|
4
|
+
---
|
|
5
|
+
用 Read 工具读取 `${ATDC_DIR}/prompts/X-test-plan.md`,然后直接开始执行。
|
|
6
|
+
|
|
7
|
+
跳过 GO.md 路由,直接进入自测计划阶段:基于当前活跃 change 的 tasks.md,生成自测计划文档和集成测试 Go 文件。
|
|
8
|
+
|
|
9
|
+
**签名铁律(生成集成测试时必须遵守,禁止省略):**
|
|
10
|
+
- 外部接口走 `CheckClientSignature`(kugo v0.1):**POST 必须把原始 JSON body 纳入签名**;GET body 为空串。
|
|
11
|
+
- 公式:`MD5(appkey + sorted(key=value...) + body + appkey)` → lowercase hex;参数名是 `signature`(不是 `sign`)。
|
|
12
|
+
- `doPost` / `doPostSigned` 必须:`b, _ := json.Marshal(payload)` → `signQueryWithBody(params, string(b))` → 同一 `b` 作为请求体。
|
|
13
|
+
- 生成后必须包含 `TestKugoBuildSignature_PostIncludesBody` 单测并通过。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: atd:git-guardrails
|
|
3
|
+
description: Git安全防护(拦截push main/force push/WIP)。触发词:git-guardrails、git防护。
|
|
4
|
+
---
|
|
5
|
+
执行以下步骤:
|
|
6
|
+
|
|
7
|
+
1. 检查 hook 是否已安装:
|
|
8
|
+
```bash
|
|
9
|
+
ls -la .git/hooks/pre-push 2>/dev/null && echo "✅ 已安装" || echo "❌ 未安装"
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. 如果用户说 `install` 或未安装:
|
|
13
|
+
```bash
|
|
14
|
+
ln -sf ~/atdc/hooks/guardrails.sh .git/hooks/pre-push && echo "✅ git-guardrails 已安装"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
3. 输出当前防护状态(参考 reference/git-guardrails.md 说明规则)
|
|
18
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: atd:review
|
|
3
|
+
description: 代码review(CRG+CodeGraph:blast radius+风险+测试缺口)。触发词:review、代码审查。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用 Read 工具读取 `${ATDC_DIR}/prompts/X-review.md`,然后根据参数开始执行。
|
|
7
|
+
|
|
8
|
+
跳过 GO.md 路由,直接进行代码级 review。无参数时执行全量 review。
|
|
9
|
+
|
|
10
|
+
## 子模式
|
|
11
|
+
|
|
12
|
+
| 参数 | 说明 |
|
|
13
|
+
|------|------|
|
|
14
|
+
| 无参数 | 全量 review(CRG + CodeGraph) |
|
|
15
|
+
| `delta` | 仅变更文件 review |
|
|
16
|
+
| `pr` | PR/分支 review |
|
|
17
|
+
| `gaps` | 仅测试缺口检测 |
|
|
18
|
+
| `flows` | 仅受影响流程追踪 |
|
|
19
|
+
| `arch` | 架构健康检查(耦合/桥接/枢纽) |
|
|
20
|
+
| `crg` | CRG 深度分析(token 高效模式) |
|
|
21
|
+
|
|
22
|
+
## 强制规则
|
|
23
|
+
|
|
24
|
+
### 规则 1:pr 模式必须先合并 origin/master
|
|
25
|
+
|
|
26
|
+
对于 `pr` 模式,执行 Phase 1 前**必须**先将 `origin/master` 最新代码合并到当前分支,避免 diff 包含已合入 master 的内容:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git fetch origin master && git merge origin/master --no-edit
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 规则 2:报告输出路径固定
|
|
33
|
+
|
|
34
|
+
Review 报告**必须**输出到项目根目录的 `docs/report/`,命名格式:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
docs/report/code-review-<分支名或change号>-<YYYY-MM-DD>.md
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
前缀固定为 `code-review-`,日期为当天日期。不再保存到 `openspec/changes/`。
|
|
41
|
+
|
|
42
|
+
### 规则 3:检测到 DB 操作时必须做慢查校验
|
|
43
|
+
|
|
44
|
+
Review 过程中检测到变更代码包含 SQL 查询(Raw SQL / GORM / DB 连接)时:
|
|
45
|
+
1. **暂停** review,向用户列出涉及的 SQL 和表名
|
|
46
|
+
2. 要求用户提供对应表的 `CREATE TABLE` 语句(DDL)
|
|
47
|
+
3. 用户提供 DDL 后,逐条分析每条 SQL 的索引命中情况(命中/部分覆盖/filesort/temp table)
|
|
48
|
+
4. 给出 EXPLAIN 预估和慢查风险等级(🟢低/🟡中/🔴高)
|
|
49
|
+
5. 汇总到 review 报告的 "DB 慢查分析" 章节
|