RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/xuliang2024/cutcli-cookbook

Cursor rule

.cursor/rules/open-source-boundary.mdc

开源 / 闭源边界 — 禁止从闭源仓 jy_cli 复制源码到本仓的安全铁律

Cursor rules

Quality

69/100

Scores the file, not the repository.

Length

413 words

13 headings · 1 code blocks

Repository

66

— · pushed 70 days ago

Last changed

3 days ago

First indexed 3 days ago.
xuliang2024/cutcli-cookbook/.cursor/rules/open-source-boundary.mdcRawGitHub
1---
2description: "开源 / 闭源边界 — 禁止从闭源仓 jy_cli 复制源码到本仓的安全铁律"
3globs: "**/*"
4alwaysApply: true
5---
6 
7# 开源 / 闭源边界(安全关键)
8 
9> ⚠ 这是本仓**最重要**的安全约束。违反任何一条都可能泄露 cutcli 闭源核心代码。
10 
11## 仓库定位
12 
13| 仓 | 路径 | 状态 |
14|---|---|---|
15| `cutcli-cookbook`(本仓) | `/Users/m007/codes/cutcli-cookbook/` | **公开** GitHub: <https://github.com/xuliang2024/cutcli-cookbook> |
16| `jy_cli` | `/Users/m007/codes/jy_cli/` | **闭源** 私有,不得泄露 |
17 
18## 四条铁律
19 
20### 1. 公开仓**永远不出现**这些路径的内容
21 
22| 闭源路径 | 包含的敏感内容 |
23|---|---|
24| `jy_cli/src/` | TypeScript 源码、API 实现、内部模型 |
25| `jy_cli/dist/` | 编译产物 |
26| `jy_cli/binaries/` | 各平台二进制 |
27| `jy_cli/worker/` | cutcli.com 的 worker 实现 |
28| `jy_cli/scripts/build-*.sh` | 构建脚本 |
29| `jy_cli/.env` | 任何 .env 内容 |
30 
31> ✅ 公开仓**自己**的 `worker/`(即 `cutcli-cookbook/worker/`)是 docs.cutcli.com 的反向代理,开源是合理的,不属于禁区。
32 
33### 2. 案例只调用**公开 CLI 命令** `cutcli xxx`
34 
35- ✅ 允许:`cutcli draft create`、`cutcli captions add ...`
36- ❌ 禁止:`import { addCaptions } from 'cut_cli/api/...'`
37- ❌ 禁止:访问 `~/.cut_cli/` 内部数据
38- ❌ 禁止:直接读写剪映草稿 JSON 字段
39 
40### 3. 闭源 → 公开的内容流动**只有一条路径**
41 
42```text
43jy_cli/docs/cli.md, api.md, README.md (中文源)
44jy_cli/docs/cli.en.md, api.en.md, README.en.md (英文源;TODO 待补)
45 ↓
46jy_cli/scripts/sync-to-cookbook.mjs (单向 + sanitizer + 双输出)
47 ↓
48cutcli-cookbook/docs/reference/{cli,api,concepts}.md ← 英文
49cutcli-cookbook/docs/zh/reference/{cli,api,concepts}.md ← 中文
50```
51 
52详见 `jy_cli/scripts/sync.config.json`。所有同步都过:
53 
54- `stripBlocks`:删除 `<!-- internal -->...<!-- /internal -->` 段落
55- `stripBlocks`:删除 `<!-- TODO-internal: ... -->` 单行
56- `replacements`:`cut <subcommand>` → `cutcli <subcommand>`
57- `replacements`:`npm install -g cut_cli` → `curl -s https://cutcli.com/cli | bash`
58 
59#### 当前过渡态(cookbook 仓 i18n 已上线、闭源 sync 待升级)
60 
61闭源 sync 脚本目前**只有中文输出**。在它升级成双输出之前,本仓采取保底措施:
62 
63- `docs/reference/{cli,api,concepts}.md`:暂时仍是中文,等闭源仓产出英文源后由 sync 覆盖
64- `docs/zh/reference/{cli,api,concepts}.md`:直接是中文(PR 1 时从 root 复制过来)
65- `scripts/check-i18n-pairs.mjs` 把这三个文件加入 `SYNC_GENERATED` 白名单,跳过强制成对
66 
67闭源仓升级后:
68 
691. `jy_cli/docs/` 增加 `cli.en.md` / `api.en.md` / `README.en.md` 三份英文源
702. `jy_cli/scripts/sync-to-cookbook.mjs` 改成双输出,sync.test.mjs 增加双语用例
713. 跑 `node scripts/sync-to-cookbook.mjs` 同时覆盖 cookbook 的 root 与 zh
724. 公开仓侧:把 `SYNC_GENERATED` 白名单从 `check-i18n-pairs.mjs` 移除(双语都强制存在)
73 
74### 4. 命令名严格用 `cutcli`,不是 `cut`
75 
76`cut` 是 Unix 系统命令,混用会让用户复制即报错。CI 里 `scripts/check-command-name.mjs` grep 出现 `cut <draft|captions|...>` 即 fail。
77 
78## 加内容前必查
79 
80写或修改任何文件前,问自己:
81 
82- [ ] 我添加的代码 / 文档**只**用了 cutcli 的公开 CLI 接口吗?
83- [ ] 我引用的素材 URL 在 `CONTRIBUTING.md` 的白名单里吗?
84- [ ] 我的命令示例都是 `cutcli` 而非 `cut` 吗?
85- [ ] 我没有意外贴上 `~/.cut_cli/`、`/Users/m007/codes/jy_cli/` 等本地路径吗?
86- [ ] 我没有暴露任何 token、cookie、密钥吗?
87 
88如果对答案有任何不确定,**停下问维护者**,不要盲目提交。
89 
90## CI 防线
91 
92| 检查 | 阻断 |
93|---|---|
94| `scripts/check-command-name.mjs` | 公开仓出现裸 `cut <subcommand>` 即 fail |
95| `scripts/validate-example.mjs` | URL 不在白名单 / README 提及绝对本地路径,fail |
96| `.github/workflows/ci.yml` | 三个 lint 任何一个不过都不能 merge |
97 
98## 同步脚本边界
99 
100`jy_cli/scripts/sync-to-cookbook.mjs`:
101 
102- ✅ 输出**只**写 `../cutcli-cookbook/docs/reference/`,绝不碰其他目录
103- ✅ 默认 dry-run 友好;用 `--dry-run` 总能预览
104- ✅ 输出文件第一行有 `THIS FILE IS GENERATED ... DO NOT EDIT` 注释
105- ✅ 单元测试 `scripts/sync.test.mjs` 覆盖核心转换
106 
107如果维护者改了同步脚本,**必须**先跑 `node scripts/sync.test.mjs` 确保 8/8 PASS。
108 
109## 如果不小心泄露了
110 
1111. **立刻**停止 push
1122. 用 `git filter-repo` 或 BFG 清掉敏感 commit
1133. force push 覆盖远程历史
1144. 如已有 fork / clone,**默认这条信息已失守**,必须重新生成所有相关 secret / token
1155. 在 release 公告中说明(如果对用户有影响)
116 
117## 报告漏洞
118 
119发现可能泄露的代码 / 文档,请**不要**开公开 issue,直接邮件 maintainer,或在 GitHub Security Advisories 私下报告。
120 

Commands it names

  • npm install -g cut_cli
  • node scripts/sync-to-cookbook.mjs
  • node scripts/sync.test.mjs
  • git filter-repo

Sections

  • 开源 / 闭源边界(安全关键)
  • 仓库定位
  • 四条铁律
  • 1. 公开仓**永远不出现**这些路径的内容
  • 2. 案例只调用**公开 CLI 命令** `cutcli xxx`
  • 3. 闭源 → 公开的内容流动**只有一条路径**
  • 4. 命令名严格用 `cutcli`,不是 `cut`
  • 加内容前必查
  • CI 防线
  • 同步脚本边界
  • 如果不小心泄露了
  • 报告漏洞

What it covers

setup

Stack — with the evidence

javascript

(1.00)

vue

(0.70)

cloudflare

(0.70)

typescript

(0.60)

github-actions

(0.60)

Glob targeting

  • **/*

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
xuliang2024
Language
—
License
—
Archived
no

All configs in this repo

Also in xuliang2024/cutcli-cookbook

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
xuliang2024/cutcli-cookbook.cursor/rules/deploy.mdc · 66Cursor rulesjavascriptvue+4gitapideploymentdocs74/1003 days ago
xuliang2024/cutcli-cookbook.cursor/rules/commands.mdc · 66Cursor rulesjavascriptvue+4lint-formatgitsecuritydeployment+178/1003 days ago
xuliang2024/cutcli-cookbook.cursor/rules/commit-flow.mdc · 66Cursor rulesjavascriptvue+4gitdeploymentdocs74/1003 days ago
xuliang2024/cutcli-cookbook.cursor/rules/directory-index.mdc · 66Cursor rulesjavascriptvue+3do-notagent-behaviourdocs69/1003 days ago
xuliang2024/cutcli-cookbook.cursor/rules/docs-style.mdc · 66Cursor rulesjavascriptvue+4builddocs73/1003 days ago
xuliang2024/cutcli-cookbook.cursor/rules/example-spec.mdc · 66Cursor rulesjavascriptvue+4typessecuritydatabasedocs69/1003 days ago
xuliang2024/cutcli-cookbook.cursor/rules/project-info.mdc · 66Cursor rulesjavascriptvue+3no sections50/1003 days ago
Diff against .cursor/rules/deploy.mdc Diff against .cursor/rules/commands.mdc Diff against .cursor/rules/commit-flow.mdc Diff against .cursor/rules/directory-index.mdc Diff against .cursor/rules/docs-style.mdc Diff against .cursor/rules/example-spec.mdc Diff against .cursor/rules/project-info.mdc

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack