repo-audit-tool 1.2.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 +67 -0
- package/AUDIT.md +802 -0
- package/BEST-PRACTICES.md +268 -0
- package/CLAUDE.md +1 -0
- package/CONTRIBUTING.md +42 -0
- package/DEVELOPMENT.md +112 -0
- package/HANDOFF.md +124 -0
- package/LICENSE +21 -0
- package/PUBLISHING.md +66 -0
- package/README.en.md +71 -0
- package/README.md +71 -0
- package/REPO-AUDIT.md +107 -0
- package/REPO-CLASSIFICATION.md +137 -0
- package/SECURITY.md +19 -0
- package/docs/repo-audit/AGENT-GUIDE.md +474 -0
- package/docs/repo-audit/HUMAN-GUIDE.md +749 -0
- package/package.json +36 -0
- package/repo-audit.mjs +1507 -0
- package/rules/categories/archive.yaml +48 -0
- package/rules/categories/content.yaml +34 -0
- package/rules/categories/dsh-plugin.yaml +79 -0
- package/rules/categories/go-service.yaml +67 -0
- package/rules/categories/product-oss.yaml +75 -0
- package/rules/categories/python-app.yaml +60 -0
- package/rules/categories/sandbox.yaml +33 -0
- package/rules/domains/docs.yaml +105 -0
- package/rules/domains/git.yaml +52 -0
- package/rules/domains/quality.yaml +69 -0
- package/rules/domains/security.yaml +79 -0
- package/shim/repo-audit.cmd +7 -0
- package/shim/repo-audit.ps1 +4 -0
- package/shim/repo-audit.sh +5 -0
- package/templates/AGENT-GUIDE.md +331 -0
- package/templates/README.md +192 -0
- package/templates/UPDATE-MODEL.md +141 -0
- package/templates/UPDATE-PLAN.md +79 -0
- package/templates/categories/content/AGENTS-append.md +6 -0
- package/templates/categories/content/CATEGORY.md +26 -0
- package/templates/categories/content/README.en.md +12 -0
- package/templates/categories/content/README.md +14 -0
- package/templates/categories/content/gitignore-append.md +6 -0
- package/templates/categories/dsh-plugin/AGENTS-append.md +21 -0
- package/templates/categories/dsh-plugin/CATEGORY.md +9 -0
- package/templates/categories/dsh-plugin/CONTRIBUTING-append.md +22 -0
- package/templates/categories/dsh-plugin/DEVELOPMENT-append.md +71 -0
- package/templates/categories/dsh-plugin/PUBLISHING-append.md +53 -0
- package/templates/categories/dsh-plugin/README-append.md +28 -0
- package/templates/categories/dsh-plugin/README.en.md +44 -0
- package/templates/categories/dsh-plugin/gitignore-append.md +15 -0
- package/templates/categories/go-service/.githooks/pre-commit +13 -0
- package/templates/categories/go-service/.github/workflows/ci.yml +31 -0
- package/templates/categories/go-service/.github/workflows/release.yml +58 -0
- package/templates/categories/go-service/.goreleaser.yaml +86 -0
- package/templates/categories/go-service/AGENTS-append.md +7 -0
- package/templates/categories/go-service/CATEGORY.md +33 -0
- package/templates/categories/go-service/CONTRIBUTING-append.md +13 -0
- package/templates/categories/go-service/DEVELOPMENT-append.md +21 -0
- package/templates/categories/go-service/Makefile +21 -0
- package/templates/categories/go-service/PUBLISHING-append.md +48 -0
- package/templates/categories/go-service/PUBLISHING.md +59 -0
- package/templates/categories/go-service/README-append.md +26 -0
- package/templates/categories/go-service/README.en.md +43 -0
- package/templates/categories/go-service/gitignore-append.md +13 -0
- package/templates/categories/product-oss/.github/CODEOWNERS +6 -0
- package/templates/categories/product-oss/.github/ISSUE_TEMPLATE/bug_report.yml +52 -0
- package/templates/categories/product-oss/.github/ISSUE_TEMPLATE/config.yml +8 -0
- package/templates/categories/product-oss/.github/dependabot.yml +28 -0
- package/templates/categories/product-oss/.github/workflows/dependency-review.yml +18 -0
- package/templates/categories/product-oss/.github/workflows/release-please.yml +39 -0
- package/templates/categories/product-oss/.release-please-manifest.json +3 -0
- package/templates/categories/product-oss/CATEGORY.md +27 -0
- package/templates/categories/product-oss/CHANGELOG.md +14 -0
- package/templates/categories/product-oss/PULL_REQUEST_TEMPLATE.md +15 -0
- package/templates/categories/product-oss/SUPPORT.md +71 -0
- package/templates/categories/product-oss/release-please-config.json +10 -0
- package/templates/categories/python-app/.githooks/pre-commit +13 -0
- package/templates/categories/python-app/.github/workflows/ci.yml +33 -0
- package/templates/categories/python-app/.github/workflows/publish.yml +112 -0
- package/templates/categories/python-app/AGENTS-append.md +18 -0
- package/templates/categories/python-app/CATEGORY.md +34 -0
- package/templates/categories/python-app/CONTRIBUTING-append.md +13 -0
- package/templates/categories/python-app/DEVELOPMENT-append.md +21 -0
- package/templates/categories/python-app/PUBLISHING-append.md +52 -0
- package/templates/categories/python-app/PUBLISHING.md +61 -0
- package/templates/categories/python-app/README-append.md +27 -0
- package/templates/categories/python-app/README.en.md +44 -0
- package/templates/categories/python-app/gitignore-append.md +19 -0
- package/templates/categories/python-app/pyproject.toml +41 -0
- package/templates/categories/python-app/scripts/verify.py +39 -0
- package/templates/categories/sandbox/AGENTS-append.md +7 -0
- package/templates/categories/sandbox/CATEGORY.md +31 -0
- package/templates/categories/sandbox/README.en.md +24 -0
- package/templates/categories/sandbox/README.md +23 -0
- package/templates/check-single-source.mjs +107 -0
- package/templates/common/AGENTS-core.md +28 -0
- package/templates/common/CONTRIBUTING-core.md +21 -0
- package/templates/common/DEVELOPMENT-core.md +45 -0
- package/templates/common/PUBLISHING-core.md +31 -0
- package/templates/common/README-core.md +60 -0
- package/templates/common/SECURITY-core.md +19 -0
- package/templates/common/copilot-instructions.md +5 -0
- package/templates/common/gitignore-core.md +11 -0
- package/templates/repo-root/.githooks/pre-commit +20 -0
- package/templates/repo-root/.github/workflows/ci.yml +45 -0
- package/templates/repo-root/.github/workflows/publish.yml +77 -0
- package/templates/repo-root/CLAUDE.md +3 -0
- package/templates/repo-root/LICENSE +21 -0
- package/templates/repo-root/package.json +71 -0
- package/templates/repo-root/scripts/build.mjs +24 -0
- package/templates/repo-root/scripts/check-deploy.mjs +176 -0
- package/templates/repo-root/scripts/verify.mjs +52 -0
- package/templates/repo-root/src/config.ts +25 -0
- package/templates/repo-root/src/index.ts +40 -0
- package/templates/repo-root/tsconfig.build.json +22 -0
- package/templates/repo-root/tsconfig.json +23 -0
- package/templates/scaffold.mjs +793 -0
- package/templates/skill/SKILL.md +47 -0
package/README.en.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# repo-audit
|
|
2
|
+
|
|
3
|
+
> **Repository Standardization Audit Tool + Engineering Scaffold Generator**
|
|
4
|
+
|
|
5
|
+
Audits repositories against industrial best practices (zero npm dependencies, single-file pure Node.js ESM) and generates compliant engineering scaffolds from templates.
|
|
6
|
+
|
|
7
|
+
## ✨ Features
|
|
8
|
+
|
|
9
|
+
- **Zero dependencies**: Single `repo-audit.mjs` file, pure Node.js ESM, no `npm install` required
|
|
10
|
+
- **Cross-platform**: Built-in launchers for Windows (`.cmd` / `.ps1`) and Linux/macOS (`.sh`)
|
|
11
|
+
- **Auto-classification**: Scores file structure to detect 18 repository types (dsh-plugin / python-app / go-service / content / sandbox / archive, etc.)
|
|
12
|
+
- **Extensible rules**: YAML rules in `rules/`, covering 5 dimensions (docs / git / quality / security) + category-specific rules
|
|
13
|
+
- **Monorepo awareness**: Auto-detects workspace layouts (`apps/*` / `packages/*`, etc.)
|
|
14
|
+
- **Repo-level waivers**: `.auditrc.yaml` declares known-accepted findings to prevent alert fatigue
|
|
15
|
+
- **Optional LLM enhancement**: Supports 15+ providers (OpenAI / Anthropic / DeepSeek / Qwen / GLM / OpenRouter, etc.)
|
|
16
|
+
- **Read-only safety**: Does not modify any files in the audited repository
|
|
17
|
+
|
|
18
|
+
## 📦 Quick Start
|
|
19
|
+
|
|
20
|
+
### Audit a repository
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Direct run (Linux/macOS)
|
|
24
|
+
./shim/repo-audit.sh --repo /path/to/repo
|
|
25
|
+
|
|
26
|
+
# Or with node
|
|
27
|
+
node repo-audit.mjs --repo /path/to/repo --format json
|
|
28
|
+
|
|
29
|
+
# Windows
|
|
30
|
+
shim\repo-audit.cmd --repo C:\path\to\repo
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Generate a scaffold
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
node templates/scaffold.mjs --type dsh-plugin --name my-plugin --org my-org --desc "Plugin description"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🏗️ Directory Structure
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
repo-audit/
|
|
43
|
+
├── repo-audit.mjs # Core audit engine (single file, zero deps)
|
|
44
|
+
├── rules/ # Audit rules (YAML)
|
|
45
|
+
│ ├── domains/ # Cross-dimension rules (docs/git/quality/security)
|
|
46
|
+
│ └── categories/ # Category-specific rules (dsh-plugin/python-app/...)
|
|
47
|
+
├── shim/ # Cross-platform launchers
|
|
48
|
+
├── templates/ # Engineering scaffold templates + generator
|
|
49
|
+
├── docs/repo-audit/ # User manuals (AGENT-GUIDE + HUMAN-GUIDE)
|
|
50
|
+
├── AUDIT.md # Audit methodology
|
|
51
|
+
├── BEST-PRACTICES.md # Best practices reference
|
|
52
|
+
├── REPO-CLASSIFICATION.md # Classification detection guide
|
|
53
|
+
└── REPO-AUDIT.md # Tool overview
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## 📚 Documentation
|
|
57
|
+
|
|
58
|
+
- [Human Guide](docs/repo-audit/HUMAN-GUIDE.md) — Full usage documentation
|
|
59
|
+
- [Agent Guide](docs/repo-audit/AGENT-GUIDE.md) — Machine-readable operation protocol
|
|
60
|
+
- [Audit Methodology](AUDIT.md)
|
|
61
|
+
- [Best Practices](BEST-PRACTICES.md)
|
|
62
|
+
|
|
63
|
+
## 🛠️ Development
|
|
64
|
+
|
|
65
|
+
- Audit rules: Edit `rules/domains/*.yaml` (cross-dimension) or `rules/categories/*.yaml` (category-specific)
|
|
66
|
+
- New categories: Add `<type>.yaml` to `rules/categories/`, or extend via `REPO_AUDIT_TYPES` env var
|
|
67
|
+
- Custom rules: `--rules my-rules.yaml` parameter
|
|
68
|
+
|
|
69
|
+
## 📄 License
|
|
70
|
+
|
|
71
|
+
MIT © 2026 NinjaSln-labs
|
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# repo-audit
|
|
2
|
+
|
|
3
|
+
> **仓库标准化审计工具 + 工程脚手架生成器**
|
|
4
|
+
|
|
5
|
+
对仓库进行工业级最佳实践审计(无需 npm 依赖的纯 Node.js ESM 单文件),并支持从模板生成符合规范的工程脚手架。
|
|
6
|
+
|
|
7
|
+
## ✨ 特性
|
|
8
|
+
|
|
9
|
+
- **零依赖**:单个 `repo-audit.mjs` 文件,纯 Node.js ESM,无需 `npm install`
|
|
10
|
+
- **跨平台**:内置 Windows(`.cmd` / `.ps1`)、Linux/macOS(`.sh`)启动器
|
|
11
|
+
- **自动分类**:基于文件结构评分检测 18 种仓库类型(dsh-plugin / python-app / go-service / content / sandbox / archive 等)
|
|
12
|
+
- **可扩展规则**:`rules/` 目录下 YAML 规则,支持 5 大维度(docs / git / quality / security)+ 分类专属规则
|
|
13
|
+
- **Monorepo 感知**:自动探测 workspace 布局(`apps/*` / `packages/*` 等)
|
|
14
|
+
- **仓库级豁免**:`.auditrc.yaml` 声明已知接受的发现,避免「狼来了」效应
|
|
15
|
+
- **可选 LLM 增强**:支持 15+ 提供商(OpenAI / Anthropic / DeepSeek / Qwen / GLM / OpenRouter 等)
|
|
16
|
+
- **只读安全**:不修改被审计仓库任何文件
|
|
17
|
+
|
|
18
|
+
## 📦 快速开始
|
|
19
|
+
|
|
20
|
+
### 审计仓库
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 直接运行(Linux/macOS)
|
|
24
|
+
./shim/repo-audit.sh --repo /path/to/repo
|
|
25
|
+
|
|
26
|
+
# 或用 node
|
|
27
|
+
node repo-audit.mjs --repo /path/to/repo --format json
|
|
28
|
+
|
|
29
|
+
# Windows
|
|
30
|
+
shim\repo-audit.cmd --repo C:\path\to\repo
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 生成脚手架
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
node templates/scaffold.mjs --type dsh-plugin --name my-plugin --org my-org --desc "插件描述"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🏗️ 目录结构
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
repo-audit/
|
|
43
|
+
├── repo-audit.mjs # 核心审计引擎(单文件,零依赖)
|
|
44
|
+
├── rules/ # 审计规则(YAML)
|
|
45
|
+
│ ├── domains/ # 跨维度规则(docs/git/quality/security)
|
|
46
|
+
│ └── categories/ # 分类专属规则(dsh-plugin/python-app/...)
|
|
47
|
+
├── shim/ # 跨平台启动器
|
|
48
|
+
├── templates/ # 工程脚手架模板 + 生成器
|
|
49
|
+
├── docs/repo-audit/ # 使用手册(AGENT-GUIDE + HUMAN-GUIDE)
|
|
50
|
+
├── AUDIT.md # 审计方法论
|
|
51
|
+
├── BEST-PRACTICES.md # 最佳实践标准
|
|
52
|
+
├── REPO-CLASSIFICATION.md # 分类检测说明
|
|
53
|
+
└── REPO-AUDIT.md # 工具概述
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## 📚 文档
|
|
57
|
+
|
|
58
|
+
- [人类手册](docs/repo-audit/HUMAN-GUIDE.md) — 完整使用说明
|
|
59
|
+
- [Agent 手册](docs/repo-audit/AGENT-GUIDE.md) — 机器可读的操作协议
|
|
60
|
+
- [审计方法论](AUDIT.md)
|
|
61
|
+
- [最佳实践标准](BEST-PRACTICES.md)
|
|
62
|
+
|
|
63
|
+
## 🛠️ 开发
|
|
64
|
+
|
|
65
|
+
- 审计规则:编辑 `rules/domains/*.yaml`(跨维度)或 `rules/categories/*.yaml`(分类专属)
|
|
66
|
+
- 新增分类:在 `rules/categories/` 添加 `<type>.yaml`,或用 `REPO_AUDIT_TYPES` 环境变量扩展
|
|
67
|
+
- 自定义规则:`--rules my-rules.yaml` 参数加载
|
|
68
|
+
|
|
69
|
+
## 📄 许可证
|
|
70
|
+
|
|
71
|
+
MIT © 2026 NinjaSln-labs
|
package/REPO-AUDIT.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# repo-audit — 仓库标准化审计工具
|
|
2
|
+
|
|
3
|
+
专门审计 scaffold 生成的仓库是否符合工业最佳实践标准。审计基准 = `templates/` 目录下的模板文件。
|
|
4
|
+
|
|
5
|
+
## 快速开始
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 审计当前仓库(自动检测分类)
|
|
9
|
+
node repo-audit.mjs
|
|
10
|
+
|
|
11
|
+
# 审计指定仓库
|
|
12
|
+
node repo-audit.mjs --repo /path/to/repo
|
|
13
|
+
|
|
14
|
+
# 指定分类(跳过自动检测,加速)
|
|
15
|
+
node repo-audit.mjs --repo /path/to/repo --type python-app
|
|
16
|
+
|
|
17
|
+
# 启用 LLM 增强(对 fail 的发现做根因分析和修复建议)
|
|
18
|
+
export LLM_PROVIDER=deepseek
|
|
19
|
+
export LLM_API_KEY=sk-xxx
|
|
20
|
+
node repo-audit.mjs --repo /path/to/repo --llm-model deepseek-chat
|
|
21
|
+
|
|
22
|
+
# 严格模式(Critical/Major 发现即 exit 1,适合 CI)
|
|
23
|
+
node repo-audit.mjs --strict
|
|
24
|
+
|
|
25
|
+
# 只输出 JSON(CI 解析用)
|
|
26
|
+
node repo-audit.mjs --format json
|
|
27
|
+
|
|
28
|
+
# 只审计特定维度
|
|
29
|
+
node repo-audit.mjs --dim security --dim docs
|
|
30
|
+
|
|
31
|
+
# 叠加自定义规则
|
|
32
|
+
node repo-audit.mjs --rules my-custom-rules.yaml
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 跨平台安装
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# 方式一:直接运行
|
|
39
|
+
node repo-audit.mjs --repo /path/to/repo
|
|
40
|
+
|
|
41
|
+
# 方式二:加入 PATH(shim 目录)
|
|
42
|
+
export PATH="$PATH:/path/to/shim"
|
|
43
|
+
repo-audit --repo /path/to/repo # Windows 用 repo-audit.cmd,Linux/macOS 用 repo-audit.sh
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 命令行参数
|
|
47
|
+
|
|
48
|
+
| 参数 | 说明 | 默认值 |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `--repo <path>` | 目标仓库路径 | 当前目录 |
|
|
51
|
+
| `--type <type>` | 强制指定分类(跳过自动检测) | 自动推断 |
|
|
52
|
+
| `--format <fmt>` | 输出格式:md / json / both | both |
|
|
53
|
+
| `--output <path>` | 输出目录 | `<repo>/audit-report/` |
|
|
54
|
+
| `--llm-provider <p>` | LLM 供应商:openai / anthropic / deepseek / none | none |
|
|
55
|
+
| `--llm-model <m>` | 模型名称 | auto |
|
|
56
|
+
| `--strict` | 严格模式:Critical/Major 发现即 exit 1 | 关 |
|
|
57
|
+
| `--rules <file>` | 自定义规则文件(可多次) | 无 |
|
|
58
|
+
| `--dim <domain>` | 只审计指定维度(可多次) | 全部 |
|
|
59
|
+
| `--help, -h` | 显示帮助 | — |
|
|
60
|
+
|
|
61
|
+
## 环境变量
|
|
62
|
+
|
|
63
|
+
| 变量 | 说明 | 默认值 |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| `LLM_PROVIDER` | LLM 供应商 | `none` |
|
|
66
|
+
| `LLM_API_KEY` | API Key | 无(必须手动指定)|
|
|
67
|
+
| `LLM_MODEL` | 模型名称 | `auto` |
|
|
68
|
+
| `LLM_BASE_URL` | 自定义 API 端点 | 供应商默认 |
|
|
69
|
+
| `REPO_AUDIT_TYPES` | 自定义分类列表(JSON 数组) | 内置默认 |
|
|
70
|
+
|
|
71
|
+
支持的 LLM 供应商:`openai`、`anthropic`、`deepseek`、`none`
|
|
72
|
+
|
|
73
|
+
## 输出说明
|
|
74
|
+
|
|
75
|
+
审计报告写入 `<repo>/audit-report/` 目录:
|
|
76
|
+
- `report.md` — 人类可读的详细报告(评分 + 分级发现 + LLM 分析)
|
|
77
|
+
- `report.json` — 机器可读的结构化数据(CI 消费用)
|
|
78
|
+
- stdout — 简洁摘要(评分 + 发现统计)
|
|
79
|
+
|
|
80
|
+
## 审计维度(可扩展)
|
|
81
|
+
|
|
82
|
+
| 维度 | 初始规则数 | 说明 |
|
|
83
|
+
|---|---|---|
|
|
84
|
+
| `git` | 4 | Conventional Commits、.gitignore、提交数、lock 状态 |
|
|
85
|
+
| `docs` | 8 | README/LICENSE/AGENTS/CONTRIBUTING 等(引用 templates/common/ 单源) |
|
|
86
|
+
| `security` | 4 | 硬编码密钥、CI SHA 固定、本机路径、id-token 权限 |
|
|
87
|
+
| `quality` | 5 | 验证链、CI workflow、pre-commit、锁文件、CLAUDE.md |
|
|
88
|
+
| `dsh` / `python` / `go` / `sandbox` / `content` / `oss` | 各 3-7 | 分类专属规则(从 CATEGORY.md 推导) |
|
|
89
|
+
|
|
90
|
+
**新增维度**:在 `rules/domains/` 下加新 YAML 文件,无需改引擎代码。
|
|
91
|
+
**新增分类**:在 `rules/categories/` 下加新 YAML + `detectType` 加分支。
|
|
92
|
+
|
|
93
|
+
## 与 scaffold 的关系
|
|
94
|
+
|
|
95
|
+
- `scaffold.mjs --generate` 后 → 立即跑 `repo-audit` 验证出库质量
|
|
96
|
+
- `scaffold.mjs --update` 后 → 再跑 `repo-audit` 确认模板升级未破坏既有内容
|
|
97
|
+
- audit 报告可作为 PR 描述附件,说明仓库当前健康度
|
|
98
|
+
- 规则随模板升级自动更新(`template_ref` 指向 templates/,不改代码)
|
|
99
|
+
|
|
100
|
+
## 退出码
|
|
101
|
+
|
|
102
|
+
| 码 | 含义 |
|
|
103
|
+
|---|---|
|
|
104
|
+
| 0 | 审计通过(无 Critical/Major 或 --strict 未启用) |
|
|
105
|
+
| 1 | 有 Critical/Major 发现且 --strict 启用 |
|
|
106
|
+
| 2 | 参数错误 / 运行时错误 |
|
|
107
|
+
| 3 | 目标不是 git 仓库 |
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# 个人仓库分类总表(2026-09 扫描)
|
|
2
|
+
|
|
3
|
+
> 扫描范围:`~/ninjasin-labs/`(maxdepth 3 找 `.git`)。每仓标注:分类 / 证据 / 模板映射。
|
|
4
|
+
> 分类按"模板差异"划分而非纯技术栈——差异维度:语言运行时、制品形态(npm 发布/服务部署/无制品)、协作模式(单人直提 main / 多人 PR 流)。
|
|
5
|
+
|
|
6
|
+
## 分类定义与模板映射
|
|
7
|
+
|
|
8
|
+
| 分类 | 定义 | 模板 |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| **A · dsh 插件单库** | TypeScript + npm 发布 + 宿主 dsh peer;部署纪律(profile file: 安装) | `templates/repo-root/`(基类,`--type dsh-plugin` 默认) |
|
|
11
|
+
| **B · 产品/多人协作 OSS** | 有 PR 流(merge commit 实证)/ CHANGELOG / ROADMAP / 双语 README;语言不限 | 对应语言基类(A/C/D)+ `templates/categories/product-oss/` overlay |
|
|
12
|
+
| **C · Python 应用/研究** | pyproject.toml + src/ + tests/;pytest/ruff;无 npm | `templates/categories/python-app/`(delta) |
|
|
13
|
+
| **D · Go 服务** | go.mod + cmd/ + Makefile | `templates/categories/go-service/`(delta) |
|
|
14
|
+
| **E · 本地实验/dogfood 沙盒** | 同构 agents/docs/src/tests 结构、master 分支、无 origin、生命周期短 | `templates/categories/sandbox/`(delta,最小集) |
|
|
15
|
+
| **F · 内容/写作** | 文档/文章本体即制品,无构建链 | `templates/categories/content/`(delta,最小集) |
|
|
16
|
+
| **G · 存档只读** | 封版仓,禁改禁发布 | **无模板**(遵守仓内封版纪律) |
|
|
17
|
+
|
|
18
|
+
## 逐仓清单(23 个 git 仓库)
|
|
19
|
+
|
|
20
|
+
### A · dsh 插件单库 ×6 → repo-root 基类
|
|
21
|
+
|
|
22
|
+
| 仓库 | 证据 |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `dsh-ecosystem/dsh-context-compass` | npm 0.11.6、cordis.patch.yml、PUBLISHING/DEVELOPMENT 全套 |
|
|
25
|
+
| `dsh-ecosystem/dsh-subagent-router` | npm 0.4.0、OIDC trusted publishing 首跑 |
|
|
26
|
+
| `dsh-ecosystem/dsh-imgdraw` | 规范化对齐 compass(AGENTS/CONTRIBUTING/SECURITY 全套) |
|
|
27
|
+
| `dsh-ecosystem/dsh-knowledge-sqlite` | npm keywords/files 白名单、双语 README |
|
|
28
|
+
| `dsh-ecosystem/dsh-session-slm-router` | S3 阶段文档、规范全套 |
|
|
29
|
+
| `dsh-ecosystem/dsh-subagent-cursor` | 规范全套、CHANGELOG |
|
|
30
|
+
|
|
31
|
+
### B · 产品/多人协作 OSS ×4 → 语言基类 + product-oss overlay
|
|
32
|
+
|
|
33
|
+
| 仓库 | 语言基类 | 证据(PR 流/规范面) |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| `qingfu-envoy` | python-app | Merge PR #23、CONTRIBUTING/SECURITY/ROADMAP、package-lock(前端) |
|
|
36
|
+
| `neonforge` | python-app(apps/ 多包,待定) | 双轴评审报告入库、lefthook、双语 |
|
|
37
|
+
| `fuyao-nomad` | python-app(harness/) | CHANGELOG/CONTRIBUTING/ROADMAP、release guards |
|
|
38
|
+
| `Voyage` | python-app(impl/sim) | CHANGELOG/双语/PRODUCT-DOC-AUDIT、红蓝对抗报告 |
|
|
39
|
+
|
|
40
|
+
### C · Python 应用/研究 ×4 → python-app delta
|
|
41
|
+
|
|
42
|
+
| 仓库 | 证据 |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `chumen` | pyproject.toml + src/tests/tools、内测统计脚本 |
|
|
45
|
+
| `shisui` | pyproject.toml + examples/runs/profiles |
|
|
46
|
+
| `shuijing-v2` | pyproject + setup.cfg + Dockerfile(可部署) |
|
|
47
|
+
| `vertical-small-model` | adapters/lib/tests/reports(研究型,master、无 origin) |
|
|
48
|
+
|
|
49
|
+
### D · Go 服务 ×1 → go-service delta
|
|
50
|
+
|
|
51
|
+
| 仓库 | 证据 |
|
|
52
|
+
|---|---|
|
|
53
|
+
| `jinteng` | go.mod/go.sum、cmd/、Makefile、deploy/docs/examples |
|
|
54
|
+
|
|
55
|
+
### E · 本地实验/dogfood 沙盒 ×11 → sandbox delta
|
|
56
|
+
|
|
57
|
+
| 仓库 | 证据 |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `fuyao-adopt-qingfu-envoy` / `-shisui` / `-voyage` | 同构 agents/docs/package.json/src/tests、master、无 origin |
|
|
60
|
+
| `fuyao-dogfood-action-list` / `-audit-trail` / `-boundary-s7` / `-changelog-slice` / `-dual-harness` / `-grant-gate` / `-reading-card` / `-todo-strip` | 同上 8 个 dogfood 粒度仓库 |
|
|
61
|
+
| `weather-outfit-assistant` | 单页 JS 小工具(app.js/server.mjs)、dogfood 收尾 |
|
|
62
|
+
|
|
63
|
+
### F · 内容/写作 ×2 → content delta
|
|
64
|
+
|
|
65
|
+
| 仓库 | 证据 |
|
|
66
|
+
|---|---|
|
|
67
|
+
| `rsi-unit-of-evolution` | essay.md/en + review 三轮 + revision-notes |
|
|
68
|
+
| `part-time-job` | 简历/素材/行动计划(含 PDF 生成脚本) |
|
|
69
|
+
|
|
70
|
+
### G · 存档只读 ×1
|
|
71
|
+
|
|
72
|
+
| 仓库 | 说明 |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `dsh-ecosystem/dsh-plugins` | 2026-09 封版(AGENTS.md 硬性规则:禁改插件源码、发布流程已删)——**不套模板** |
|
|
75
|
+
|
|
76
|
+
### 非 git 目录(不计入,仅登记)
|
|
77
|
+
|
|
78
|
+
`agent-tools`、`scripts`、`questions`、`plans`、`cloud-services`、`dsh-ecosystem/research/`(本地研究区)、`generated-images`、`visual`
|
|
79
|
+
|
|
80
|
+
## 使用方式
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
# A 类(默认)
|
|
84
|
+
node templates/scaffold.mjs --name <name> --org NinjaSln-labs --desc "..."
|
|
85
|
+
# C/D/E/F 类
|
|
86
|
+
node templates/scaffold.mjs --type python-app --name chumen2 --org NinjaSln-labs --desc "..."
|
|
87
|
+
node templates/scaffold.mjs --type sandbox --name dogfood-xxx --desc "..."
|
|
88
|
+
# B 类:先用语言基类脚手架,再叠加 product-oss overlay(见 categories/product-oss/CATEGORY.md)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 分类模板体系(templates/categories/)
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
templates/
|
|
95
|
+
├── repo-root/ # 基类工程件(A 类 dsh 插件);AGENTS/CONTRIBUTING/.gitignore 已迁 common
|
|
96
|
+
├── common/ # **单源**:AGENTS-core(含 AI 协作守则 7 条)/ CONTRIBUTING-core / gitignore-core / copilot-instructions
|
|
97
|
+
├── categories/ # 各分类 delta(工程件 + *-append.md 差异段 + CATEGORY.md)
|
|
98
|
+
│ ├── dsh-plugin/ python-app/ go-service/ sandbox/ content/ product-oss/
|
|
99
|
+
├── scaffold.mjs # --type 路由 + --overlay;三件套单源拼装(core+append)
|
|
100
|
+
├── check-single-source.mjs # 多源漂移检查:core 指纹扫描/append 命名/基类残留(发现多源 exit 1)
|
|
101
|
+
└── skill/ README.md
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
设计原则:**通用文档层一份**(LICENSE/README/DEVELOPMENT/PUBLISHING/SECURITY 骨架);
|
|
105
|
+
**AGENTS/CONTRIBUTING/.gitignore 单源拼装**(common core + 分类 append,产物内勿手改拼装段);
|
|
106
|
+
语言差异只在工程件 delta(构建/CI/钩子/忽略表);`--type` 路由由 `scaffold.mjs` 执行,
|
|
107
|
+
delta 规则的文档源在各分类 `CATEGORY.md`(改规则先改文档)。
|
|
108
|
+
|
|
109
|
+
**Agent 参与优化(所有工程分类)**:AGENTS.md 内置「AI 协作守则」7 条(不猜契约 / 完成的定义 =
|
|
110
|
+
验证链全绿 / 机密红线 / 不静默绕过门禁 / 改动最小化 / 文档同步 / 冲突处理);AI 入口三桥接——
|
|
111
|
+
CLAUDE.md(`@AGENTS.md` 导入)+ `.github/copilot-instructions.md`(工程分类自动配)+ AGENTS.md 本体;
|
|
112
|
+
pre-commit 验证链前门即 agent 防呆。
|
|
113
|
+
|
|
114
|
+
**单源收敛与漂移把守(2026-09 二轮审计)**:AGENTS/CONTRIBUTING/.gitignore 原为 5/4/4 份重复源,
|
|
115
|
+
已收敛为 common 单源 + 分类 append;`check-single-source.mjs` 常态把守(core 指纹扫描——若有人把
|
|
116
|
+
共性段拷回分类文件即 exit 1;实测原样通过)。
|
|
117
|
+
|
|
118
|
+
**实测记录(2026-09)**:五分类 + B 类混合 scaffold 全跑通;累计抓修 9 个实施 bug(ask fallback
|
|
119
|
+
语义、legal/target 重复声明、delta 落空、最小集漏删、go 空目录清理、SUPPORT/CATEGORY 入产物、
|
|
120
|
+
PR 模板位置、overlay 源路径 ENOENT、content 残留 .gitignore 引用)。
|
|
121
|
+
|
|
122
|
+
## 边界说明(2026-09 更新:原"未出模板"项已按工业实践调研补全)
|
|
123
|
+
|
|
124
|
+
- ~~C 类 publish(PyPI)~~ ✅ 已补:`categories/python-app/.github/workflows/publish.yml`(PyPI Trusted
|
|
125
|
+
Publishing:tag 守卫 + build/publish 分离 + 两环境 pypi/testpypi + PEP 740 attestations 默认开)
|
|
126
|
+
与 PyPI 版 PUBLISHING.md(pending publisher / bump-my-version / 14 天冻结新规)——依据 docs.pypi.org +
|
|
127
|
+
pypa/gh-action-pypi-publish v1.14.2(2026-09 核实)
|
|
128
|
+
- ~~D 类 publish(GitHub Release)~~ ✅ 已补:`categories/go-service/.goreleaser.yaml`(v2 最小配置,
|
|
129
|
+
默认 ldflags 版本注入 + conventional changelog 分组)+ `release.yml`(goreleaser-action@v7)+
|
|
130
|
+
Go 版 PUBLISHING/CONTRIBUTING——依据 goreleaser.com v2.18(2026-09 核实);SBOM/cosign/GHCR 按小库
|
|
131
|
+
务实取舍默认注释、成对启用
|
|
132
|
+
- ~~B 类 overlay 未验证~~ ⬆️ 已升级为完整 overlay:release-please v5 三件套(版本晋升自动化)+
|
|
133
|
+
YAML issue forms + CODEOWNERS + dependabot + dependency-review + SUPPORT.md 含 21 条"单人→多人
|
|
134
|
+
升级检查清单"(rulesets 为推荐路径)——依据 docs.github.com 与 googleapis/release-please(2026-09 核实)
|
|
135
|
+
- **仍然成立的不确定项**:三条链均为"按官方文档当前版整理",未经过一次真实发布回归——各分类首个
|
|
136
|
+
新库落地时按 PUBLISHING.md 实测并把偏差回写模板;E/F 最小集从现有 13 库实况反推,转正走全量迁移
|
|
137
|
+
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# 安全策略
|
|
2
|
+
|
|
3
|
+
## 支持面
|
|
4
|
+
|
|
5
|
+
本仓库是<宿主能力面 / 服务用途>。安全边界值得关注的面:
|
|
6
|
+
|
|
7
|
+
- <列出暴露面:网络入口(RPC/HTTP 端点及访问限制)、读写的敏感数据、对外请求>
|
|
8
|
+
- <配置值来源与敏感度说明>
|
|
9
|
+
- <发布产物携带的最小依赖>
|
|
10
|
+
|
|
11
|
+
## 报告漏洞
|
|
12
|
+
|
|
13
|
+
若你发现漏洞或安全缺陷,**不要**公开 issue——到 GitHub 仓库 Security 标签页用私密漏洞报告
|
|
14
|
+
(Private vulnerability reporting,首选)。
|
|
15
|
+
|
|
16
|
+
## 响应
|
|
17
|
+
|
|
18
|
+
- 确认收到后 72 小时内回复。
|
|
19
|
+
- 严重漏洞优先修复并发布补丁版本。
|