Skip to content

Commit 77e9c8b

Browse files
committed
refactor: reorganize root directory structure
- Move spec.md → docs/, install-hook.sh → scripts/ - Merge single-file dirs: resources/ → templates/, benchmark-results/ → data/, manifests/ → schemas/, project-templates/ → templates/language/ - Group scripts: gc/, metrics/, verify/ subdirectories - Update all path references across package.json, docs, hooks, commands
1 parent fd4b089 commit 77e9c8b

30 files changed

Lines changed: 44 additions & 50 deletions

.claude/commands/vibeguard/check.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ argument-hint: "[project_dir]"
6969

7070
3. **运行合规检查**
7171
```bash
72-
bash ${VIBEGUARD_DIR}/scripts/compliance_check.sh <project_dir>
72+
bash ${VIBEGUARD_DIR}/scripts/verify/compliance_check.sh <project_dir>
7373
```
7474

7575
4. **汇总报告**
@@ -126,6 +126,6 @@ argument-hint: "[project_dir]"
126126
127127
**Reference**
128128
- VibeGuard 守卫脚本:`vibeguard/guards/`
129-
- VibeGuard 合规检查:`vibeguard/scripts/compliance_check.sh`
129+
- VibeGuard 合规检查:`vibeguard/scripts/verify/compliance_check.sh`
130130
- 配合 `/vibeguard:preflight` 使用效果最佳
131131
<!-- VIBEGUARD:CHECK:END -->

.claude/commands/vibeguard/gc.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ tags: [vibeguard, gc, cleanup, maintenance]
2424
**Steps**
2525

2626
1. **日志归档**
27-
- 运行 `bash ${VIBEGUARD_DIR}/scripts/gc-logs.sh`
27+
- 运行 `bash ${VIBEGUARD_DIR}/scripts/gc/gc-logs.sh`
2828
- events.jsonl 超过 10MB 时按月归档(gzip)
2929
- 保留最近 3 个月,更老的自动删除
3030
- 输出归档统计
3131

3232
2. **Worktree 清理**
33-
- 运行 `bash ${VIBEGUARD_DIR}/scripts/gc-worktrees.sh`
33+
- 运行 `bash ${VIBEGUARD_DIR}/scripts/gc/gc-worktrees.sh`
3434
- 删除超过 7 天未活跃且无未合并变更的 worktree
3535
- 有未合并变更的只警告,列出需要手动处理的
3636

@@ -59,7 +59,7 @@ tags: [vibeguard, gc, cleanup, maintenance]
5959
- 修复后运行 `/vibeguard:check` 验证
6060

6161
**Reference**
62-
- 日志归档: `scripts/gc-logs.sh`
63-
- Worktree 清理: `scripts/gc-worktrees.sh`
62+
- 日志归档: `scripts/gc/gc-logs.sh`
63+
- Worktree 清理: `scripts/gc/gc-worktrees.sh`
6464
- 代码垃圾检测: `guards/universal/check_code_slop.sh`
6565
<!-- VIBEGUARD:GC:END -->

.claude/commands/vibeguard/learn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,6 @@ argument-hint: "<错误描述 | 'extract' 提取经验 | 空=自动判断>"
352352
- Hook 脚本模板:`vibeguard/hooks/`
353353
- 规则文件:`vibeguard/rules/`
354354
- 规则索引:`vibeguard/claude-md/vibeguard-rules.md`
355-
- Skill 模板:`vibeguard/resources/skill-template.md`
355+
- Skill 模板:`vibeguard/templates/skill-template.md`
356356
- 学术参考:Voyager (skill libraries), CASCADE (meta-skills), Reflexion (self-reflection)
357357
<!-- VIBEGUARD:LEARN:END -->

.claude/commands/vibeguard/preflight.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,5 @@ tags: [vibeguard, preflight, constraints, prevention]
169169
**Reference**
170170
- VibeGuard 守卫脚本:`vibeguard/guards/`
171171
- VibeGuard 规则:`vibeguard/rules/`
172-
- VibeGuard 七层防幻觉框架:`vibeguard/spec.md`
172+
- VibeGuard 七层防幻觉框架:`vibeguard/docs/spec.md`
173173
<!-- VIBEGUARD:PREFLIGHT:END -->

README_CN.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -437,23 +437,23 @@ vibeguard/
437437
│ └── claude-rules/ # 原生规则(部署到 ~/.claude/rules/vibeguard/)
438438
│ ├── common/ # coding-style(U-01~U-26) + data-consistency + security + workflow(W-01~W-05)
439439
│ ├── rust/ golang/ typescript/ python/ # 语言质量规则(带 paths 作用域)
440-
├── resources/skill-template.md # Skill 提取模板
440+
├── templates/skill-template.md # Skill 提取模板
441441
├── skills/ # 可复用工作流
442442
├── scripts/ # 工具脚本
443443
│ ├── setup/ # 安装/卸载/检查脚本
444444
│ ├── stats.sh # 统计分析
445445
│ ├── quality-grader.sh # 质量等级评分(A/B/C/D)
446-
│ ├── doc-freshness-check.sh # 文档新鲜度检测
446+
│ ├── verify/doc-freshness-check.sh # 文档新鲜度检测
447447
│ ├── log-capability-change.sh # 能力进化日志
448448
│ ├── constraint-recommender.py # preflight 约束自动推荐
449-
│ ├── gc-logs.sh # 日志归档
450-
│ ├── gc-worktrees.sh # Worktree 清理
451-
│ ├── gc-scheduled.sh # 定期 GC(launchd 调度,每周日 3:00)
449+
│ ├── gc/gc-logs.sh # 日志归档
450+
│ ├── gc/gc-worktrees.sh # Worktree 清理
451+
│ ├── gc/gc-scheduled.sh # 定期 GC(launchd 调度,每周日 3:00)
452452
│ ├── project-init.sh # 项目级脚手架(语言检测 + 守卫激活 + pre-commit/pre-push 安装)
453-
│ ├── metrics-exporter.sh # Prometheus 指标导出
453+
│ ├── metrics/metrics-exporter.sh # Prometheus 指标导出
454454
│ └── ci/ # CI 验证脚本
455455
├── context-profiles/ # 上下文模式(dev/review/research)
456-
└── spec.md # 完整规范
456+
└── docs/spec.md # 完整规范
457457
```
458458

459459
## CLAUDE.md 模板

docs/benchmark-design.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,13 @@ bash scripts/benchmark.sh --mode=full
342342
### 6.4 历史存档
343343
344344
```
345-
benchmark-results/
345+
data/
346346
2026-03-23.json
347347
2026-03-16.json
348348
...
349349
```
350350

351-
每次运行追加结果到 `benchmark-results/``scripts/benchmark.sh` 自动对比上次结果输出 delta。
351+
每次运行追加结果到 `data/``scripts/benchmark.sh` 自动对比上次结果输出 delta。
352352

353353
---
354354

docs/how/learning-skill-generation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ Hook 升级(强制警告,打断 Agent 循环)
388388
| `hooks/post-build-check.sh` | 构建检查 + 连续失败升级(U-25 机械化) |
389389
| `scripts/gc-scheduled.sh` | GC 定期学习(跨会话模式识别) |
390390
| `.claude/commands/vibeguard/learn.md` | /vibeguard:learn 命令(双模式路由) |
391-
| `resources/skill-template.md` | SKILL.md 写作模板 |
391+
| `templates/skill-template.md` | SKILL.md 写作模板 |
392392
| `skills/*/SKILL.md` | 已提取的 Skill 文件 |
393393

394394
## 与 OpenAI Harness 的对标

spec.md renamed to docs/spec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ task_contract:
285285

286286
```
287287
vibeguard/
288-
├── spec.md # 本文件(~500行)- 完整规范
288+
├── docs/spec.md # 本文件(~500行)- 完整规范
289289
├── README.md # 快速开始(~50行)
290290
├── setup.sh # 一键部署(~30行)
291291
@@ -336,7 +336,7 @@ vibeguard/
336336
│ └── typescript/
337337
│ └── eslint-guards.ts # TS 守卫模板
338338
339-
├── project-templates/
339+
├── templates/language/
340340
│ ├── python-CLAUDE.md # Python 项目 CLAUDE.md 模板
341341
│ ├── typescript-CLAUDE.md # TS 项目 CLAUDE.md 模板
342342
│ └── rust-CLAUDE.md # Rust 项目 CLAUDE.md 模板

hooks/git/pre-push

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# Blocks force pushes at the git level — this is the correct separation of
55
# concerns vs. regex-matching git commands in the bash guard.
66
#
7-
# Install via install-hook.sh:
8-
# bash install-hook.sh <project_dir>
7+
# Install via scripts/install-hook.sh:
8+
# bash scripts/install-hook.sh <project_dir>
99
#
1010
# The hook receives push refs on stdin:
1111
# <local-ref> <local-sha> <remote-ref> <remote-sha>

0 commit comments

Comments
 (0)