create-clis 0.1.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.
Files changed (104) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +113 -0
  3. package/README.zh-CN.md +113 -0
  4. package/assets/manifest.json +99 -0
  5. package/assets/template/.editorconfig +12 -0
  6. package/assets/template/.gitattributes +18 -0
  7. package/assets/template/.github/ISSUE_TEMPLATE/bug_report.yml +86 -0
  8. package/assets/template/.github/ISSUE_TEMPLATE/feature_request.yml +45 -0
  9. package/assets/template/.github/PULL_REQUEST_TEMPLATE.md +26 -0
  10. package/assets/template/.github/workflows/ci.yml +42 -0
  11. package/assets/template/.github/workflows/release.yml +65 -0
  12. package/assets/template/.gitignorerc.json +21 -0
  13. package/assets/template/.nvmrc +1 -0
  14. package/assets/template/.oxlintrc.json +52 -0
  15. package/assets/template/.prettierignore +11 -0
  16. package/assets/template/.prettierrc +11 -0
  17. package/assets/template/.releaserc.json +17 -0
  18. package/assets/template/.vscode/extensions.json +8 -0
  19. package/assets/template/.vscode/launch.json +13 -0
  20. package/assets/template/.vscode/settings.json +14 -0
  21. package/assets/template/AGENTS.md +25 -0
  22. package/assets/template/CODE_OF_CONDUCT.md +91 -0
  23. package/assets/template/CONTRIBUTING.md +85 -0
  24. package/assets/template/CONTRIBUTING.zh-CN.md +85 -0
  25. package/assets/template/LICENSE +21 -0
  26. package/assets/template/README.md +22 -0
  27. package/assets/template/README.zh-CN.md +22 -0
  28. package/assets/template/SECURITY.md +21 -0
  29. package/assets/template/_gitignore +409 -0
  30. package/assets/template/_npmrc +6 -0
  31. package/assets/template/bunfig.toml +16 -0
  32. package/assets/template/docs/README.md +30 -0
  33. package/assets/template/docs/adrs/README.md +7 -0
  34. package/assets/template/docs/designs/README.md +11 -0
  35. package/assets/template/docs/designs/tech-debt.md +22 -0
  36. package/assets/template/docs/development.md +59 -0
  37. package/assets/template/lefthook.yml +55 -0
  38. package/assets/template/package.json +38 -0
  39. package/assets/template/packages/{{NAME}}/CHANGELOG.md +3 -0
  40. package/assets/template/packages/{{NAME}}/LICENSE +21 -0
  41. package/assets/template/packages/{{NAME}}/README.md +33 -0
  42. package/assets/template/packages/{{NAME}}/README.zh-CN.md +33 -0
  43. package/assets/template/packages/{{NAME}}/docs/README.md +21 -0
  44. package/assets/template/packages/{{NAME}}/package.json +40 -0
  45. package/assets/template/packages/{{NAME}}/scripts/build.ts +82 -0
  46. package/assets/template/packages/{{NAME}}/scripts/verify-release.test.ts +214 -0
  47. package/assets/template/packages/{{NAME}}/scripts/verify-release.ts +152 -0
  48. package/assets/template/packages/{{NAME}}/src/index.ts +15 -0
  49. package/assets/template/packages/{{NAME}}/tsconfig.build.json +12 -0
  50. package/assets/template/packages/{{NAME}}/tsconfig.json +5 -0
  51. package/assets/template/packages/{{NAME}}-cli/CHANGELOG.md +3 -0
  52. package/assets/template/packages/{{NAME}}-cli/LICENSE +21 -0
  53. package/assets/template/packages/{{NAME}}-cli/README.md +35 -0
  54. package/assets/template/packages/{{NAME}}-cli/README.zh-CN.md +35 -0
  55. package/assets/template/packages/{{NAME}}-cli/bin/{{BIN_NAME}} +30 -0
  56. package/assets/template/packages/{{NAME}}-cli/bin/{{BIN_NAME}}.cmd +30 -0
  57. package/assets/template/packages/{{NAME}}-cli/bin/{{BIN_NAME}}.d.mts +23 -0
  58. package/assets/template/packages/{{NAME}}-cli/bin/{{BIN_NAME}}.mjs +212 -0
  59. package/assets/template/packages/{{NAME}}-cli/docs/README.md +21 -0
  60. package/assets/template/packages/{{NAME}}-cli/package.json +48 -0
  61. package/assets/template/packages/{{NAME}}-cli/scripts/release-artifact.ts +141 -0
  62. package/assets/template/packages/{{NAME}}-cli/scripts/release.fixtures.ts +70 -0
  63. package/assets/template/packages/{{NAME}}-cli/scripts/verify-release.test.ts +444 -0
  64. package/assets/template/packages/{{NAME}}-cli/scripts/verify-release.ts +72 -0
  65. package/assets/template/packages/{{NAME}}-cli/scripts/write-dist-manifest.test.ts +126 -0
  66. package/assets/template/packages/{{NAME}}-cli/scripts/write-dist-manifest.ts +81 -0
  67. package/assets/template/packages/{{NAME}}-cli/src/cli.ts +36 -0
  68. package/assets/template/packages/{{NAME}}-cli/tsconfig.json +4 -0
  69. package/assets/template/scripts/ci.ts +163 -0
  70. package/assets/template/scripts/install-git-hooks.mjs +122 -0
  71. package/assets/template/scripts/install-git-hooks.test.ts +418 -0
  72. package/assets/template/scripts/lib/git-env.ts +21 -0
  73. package/assets/template/scripts/lib/release-verify.ts +431 -0
  74. package/assets/template/scripts/lib/tmp-root.ts +17 -0
  75. package/assets/template/scripts/lib/workspace.test.ts +92 -0
  76. package/assets/template/scripts/lib/workspace.ts +100 -0
  77. package/assets/template/scripts/lint-doc-examples.test.ts +129 -0
  78. package/assets/template/scripts/lint-doc-examples.ts +249 -0
  79. package/assets/template/scripts/lint-doc-references.test.ts +158 -0
  80. package/assets/template/scripts/lint-doc-references.ts +308 -0
  81. package/assets/template/scripts/lint-doc-shared.ts +59 -0
  82. package/assets/template/scripts/lint-stray-backups.test.ts +53 -0
  83. package/assets/template/scripts/lint-stray-backups.ts +39 -0
  84. package/assets/template/scripts/npm-trust-guard.test.ts +253 -0
  85. package/assets/template/scripts/npm-trust-guard.ts +533 -0
  86. package/assets/template/scripts/safe-install.ts +39 -0
  87. package/assets/template/scripts/transcription/api-harness.ts +219 -0
  88. package/assets/template/scripts/transcription/compare.ts +421 -0
  89. package/assets/template/scripts/transcription/corpus.ts +208 -0
  90. package/assets/template/scripts/transcription/fixture.ts +290 -0
  91. package/assets/template/scripts/transcription/make-mutants.ts +425 -0
  92. package/assets/template/scripts/transcription/report.ts +86 -0
  93. package/assets/template/scripts/transcription/run-conformance.ts +344 -0
  94. package/assets/template/scripts/transcription/validate-coverage.test.ts +119 -0
  95. package/assets/template/scripts/transcription/validate-coverage.ts +144 -0
  96. package/assets/template/scripts/transcription/validate.ts +366 -0
  97. package/assets/template/tsconfig.json +46 -0
  98. package/assets/template/turbo.jsonc +60 -0
  99. package/bin/create-clis +35 -0
  100. package/bin/create-clis.cmd +32 -0
  101. package/bin/create-clis.mjs +219 -0
  102. package/dist/create-clis.js +87682 -0
  103. package/dist/manifest.json +7 -0
  104. package/package.json +57 -0
@@ -0,0 +1,21 @@
1
+ {
2
+ "topics": [
3
+ "macOS",
4
+ "Windows",
5
+ "Linux",
6
+ "Node",
7
+ "JetBrains",
8
+ "VisualStudioCode",
9
+ "SublimeText",
10
+ "Vim",
11
+ "Archives"
12
+ ],
13
+ "custom": [
14
+ "package-lock.json",
15
+ "*.log",
16
+ "*.modified",
17
+ "packages/{{NAME}}/bench/results/",
18
+ "scripts/transcription/mutants/gen-*/",
19
+ ".turbo/"
20
+ ]
21
+ }
@@ -0,0 +1 @@
1
+ 24
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "plugins": ["typescript", "oxc", "import", "promise", "node", "unicorn"],
4
+ "categories": {},
5
+ "rules": {
6
+ "no-useless-concat": "deny",
7
+ "no-unused-vars": "deny",
8
+ "no-await-in-loop": "allow",
9
+ "no-bitwise": "deny",
10
+ "no-plusplus": "deny",
11
+ "no-undefined": "allow",
12
+ "max-depth": ["deny", { "max": 4 }],
13
+ "max-lines": [
14
+ "deny",
15
+ { "max": 450, "skipBlankLines": true, "skipComments": true }
16
+ ],
17
+ "max-lines-per-function": [
18
+ "deny",
19
+ { "max": 200, "skipBlankLines": true, "skipComments": true }
20
+ ],
21
+ "max-nested-callbacks": ["deny", { "max": 3 }],
22
+ "max-params": ["deny", { "max": 6 }],
23
+ "max-classes-per-file": ["deny", { "max": 1 }],
24
+ "oxc/no-accumulating-spread": "deny",
25
+ "import/no-cycle": "deny",
26
+ "import/no-duplicates": "deny",
27
+ "import/named": "deny",
28
+ "import/no-mutable-exports": "deny",
29
+ "unicorn/prefer-set-has": "deny",
30
+ "unicorn/no-anonymous-default-export": "deny",
31
+ "unicorn/no-array-for-each": "deny",
32
+ "unicorn/no-nested-ternary": "deny",
33
+ "unicorn/prefer-node-protocol": "deny",
34
+ "promise/catch-or-return": "deny",
35
+ "promise/no-nesting": "deny",
36
+ "promise/prefer-await-to-then": "allow"
37
+ },
38
+ "env": { "builtin": true, "node": true },
39
+ "globals": {
40
+ "console": "readonly",
41
+ "process": "readonly",
42
+ "Bun": "readonly",
43
+ "setTimeout": "readonly",
44
+ "clearTimeout": "readonly"
45
+ },
46
+ "ignorePatterns": [
47
+ "dist/**",
48
+ "node_modules/**",
49
+ "scripts/transcription/mutants/**",
50
+ "packages/create-clis/assets/**"
51
+ ]
52
+ }
@@ -0,0 +1,11 @@
1
+ node_modules
2
+ dist
3
+ coverage
4
+ package-lock.json
5
+ bun.lock
6
+ bun.lockb
7
+ CHANGELOG.md
8
+ CODE_OF_CONDUCT.md
9
+ *.modified
10
+ *.deleted
11
+ packages/create-clis/assets
@@ -0,0 +1,11 @@
1
+ {
2
+ "tabWidth": 2,
3
+ "useTabs": false,
4
+ "singleQuote": true,
5
+ "trailingComma": "all",
6
+ "endOfLine": "lf",
7
+ "importOrder": ["^bun:", "^node:", "<THIRD_PARTY_MODULES>", "^[./]"],
8
+ "importOrderSeparation": true,
9
+ "importOrderSortSpecifiers": true,
10
+ "plugins": ["@trivago/prettier-plugin-sort-imports"]
11
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "branches": ["main"],
3
+ "plugins": [
4
+ "@semantic-release/commit-analyzer",
5
+ "@semantic-release/release-notes-generator",
6
+ "@semantic-release/changelog",
7
+ "@semantic-release/npm",
8
+ "@semantic-release/github",
9
+ [
10
+ "@semantic-release/git",
11
+ {
12
+ "assets": ["package.json", "CHANGELOG.md"],
13
+ "message": "chore(release): ${nextRelease.name} [skip ci]"
14
+ }
15
+ ]
16
+ ]
17
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "recommendations": [
3
+ "oxc.oxc-vscode",
4
+ "oven.bun-vscode",
5
+ "esbenp.prettier-vscode",
6
+ "editorconfig.editorconfig"
7
+ ]
8
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "type": "bun",
6
+ "request": "launch",
7
+ "name": "调试 CLI (从源码运行)",
8
+ "program": "./packages/{{NAME}}-cli/src/cli.ts",
9
+ "cwd": "${workspaceFolder}",
10
+ "runtime": "bun"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "files.exclude": {
3
+ "**/.git": true,
4
+ "**/.svn": true,
5
+ "**/.hg": true,
6
+ "**/.DS_Store": true,
7
+ "**/Thumbs.db": true,
8
+ "**/*.modified": true,
9
+ "**/*.deleted": true,
10
+ "**/dist": true,
11
+ "**/node_modules": true,
12
+ "**/.turbo": true
13
+ }
14
+ }
@@ -0,0 +1,25 @@
1
+ <!-- BEGIN:turborepo-agent-rules -->
2
+
3
+ # This is NOT the Turborepo you know
4
+
5
+ Turborepo configuration, task behavior, and CLI commands can vary between installed versions and may differ from your training data. Resolve the `turbo` package from this file's directory or relevant workspace; in monorepos, it may not be visible from the repository root. For example, run `node -p "require.resolve('turbo/package.json')"` from a workspace that depends on `turbo`.
6
+
7
+ Read `docs/README.md` inside that installed package first, then read the relevant pages from its `docs/` directory before changing Turborepo configuration or commands. Heed deprecation notices. These bundled docs match the installed package version and are available without network access.
8
+
9
+ This block is written and re-added by `turbo` before repository-scoped commands when an AI agent is detected. In the Turborepo source repository, its template is defined in `crates/turborepo-cli/src/cli/agent_guidance.rs`. Removing the managed block while updates are enabled means a later qualifying invocation will add it again. Set `"agentGuidance": false` in the root `turbo.json` or `turbo.jsonc` to opt out; this does not remove an existing block. Keep the block committed with your work to avoid an uncommitted change on the next agent invocation.
10
+ <!-- END:turborepo-agent-rules -->
11
+
12
+ # 仓库导航 (供 AI Agent 与人类读者)
13
+
14
+ > 本仓库是 CLI 工具集合仓。本节说明**文档之间的关系和阅读顺序**。
15
+
16
+ ## 文档分层与读取路径
17
+
18
+ - **仓库级文档**在 `docs/`: 先读[文档总索引](docs/README.md); 仓库级设计的入口是[设计文档索引](docs/designs/README.md);
19
+ - **包级文档**在各包 `packages/*/docs/`, 入口固定是包内 `docs/README.md` (里面有该包的文档清单、包级 ADR 和指回上级的链接);
20
+ - **ADR 编号全仓库共用一套, 不会重号**: 仓库级的在 `docs/adrs/`, 包级的在各包 `docs/adrs/`; 总索引 [docs/adrs/README.md](docs/adrs/README.md) 列出全部编号。
21
+
22
+ ## 结构事实
23
+
24
+ - 工程闸门链只有一份步骤清单, 就是 `scripts/ci.ts` (本地全链、pre-push、CI、Release verify 跑的是同一套);
25
+ - 提交信息与发布链的约定见 [CONTRIBUTING.md](CONTRIBUTING.md)。
@@ -0,0 +1,91 @@
1
+
2
+ # Contributor Covenant 3.0 Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We pledge to make our community welcoming, safe, and equitable for all.
7
+
8
+ We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.
9
+
10
+
11
+ ## Encouraged Behaviors
12
+
13
+ While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.
14
+
15
+ With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:
16
+
17
+ 1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
18
+ 2. Engaging **kindly and honestly** with others.
19
+ 3. Respecting **different viewpoints** and experiences.
20
+ 4. **Taking responsibility** for our actions and contributions.
21
+ 5. Gracefully giving and accepting **constructive feedback**.
22
+ 6. Committing to **repairing harm** when it occurs.
23
+ 7. Behaving in other ways that promote and sustain the **well-being of our community**.
24
+
25
+
26
+ ## Restricted Behaviors
27
+
28
+ We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.
29
+
30
+ 1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
31
+ 2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
32
+ 3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits.
33
+ 4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
34
+ 5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission.
35
+ 6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
36
+ 7. Behaving in other ways that **threaten the well-being** of our community.
37
+
38
+ ### Other Restrictions
39
+
40
+ 1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
41
+ 2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
42
+ 3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
43
+ 4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors.
44
+
45
+
46
+ ## Reporting an Issue
47
+
48
+ Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm.
49
+
50
+ When an incident does occur, it is important to report it promptly. To report a possible violation, use GitHub's private reporting form: open the repository's Security tab, go to Advisories, and click Report a vulnerability. If the private form is unavailable, open a short issue mentioning @{{OWNER}} and ask for a private channel, and leave out the details until one is arranged.
51
+
52
+ Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution.
53
+
54
+
55
+ ## Addressing and Repairing Harm
56
+
57
+ If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped.
58
+
59
+ 1) Warning
60
+ 1) Event: A violation involving a single incident or series of incidents.
61
+ 2) Consequence: A private, written warning from the Community Moderators.
62
+ 3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations.
63
+ 2) Temporarily Limited Activities
64
+ 1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation.
65
+ 2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members.
66
+ 3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over.
67
+ 3) Temporary Suspension
68
+ 1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation.
69
+ 2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions.
70
+ 3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted.
71
+ 4) Permanent Ban
72
+ 1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member.
73
+ 2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior.
74
+ 3) Repair: There is no possible repair in cases of this severity.
75
+
76
+ This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community.
77
+
78
+
79
+ ## Scope
80
+
81
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
82
+
83
+
84
+ ## Attribution
85
+
86
+ This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
87
+
88
+ Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)
89
+
90
+ For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion).
91
+
@@ -0,0 +1,85 @@
1
+ # Contributing to {{NAME}}
2
+
3
+ **English** | [中文](CONTRIBUTING.zh-CN.md)
4
+
5
+ Thanks for taking the time to contribute. Bug reports, feature requests, documentation fixes, and pull requests are all welcome.
6
+
7
+ Everyone taking part in this project is covered by the [Code of Conduct](CODE_OF_CONDUCT.md).
8
+
9
+ ## Ways to contribute
10
+
11
+ - Report a bug: open an issue with the bug report form.
12
+ - Request a feature: open an issue with the feature request form.
13
+ - Send a change: open a pull request. For anything beyond a small fix, open an issue first, so the approach can be settled before work starts.
14
+ - Report a security problem: do not open a public issue; follow [SECURITY.md](SECURITY.md).
15
+
16
+ <!-- 模板骨架: 示例包是占位实现; 换成自己的工具后, 同步下面「Repository layout」与两条命令示例。 -->
17
+
18
+ ## Repository layout
19
+
20
+ The repository is a monorepo managed with turbo, and every tool lives under `packages/`:
21
+
22
+ - `packages/{{NAME}}-cli`: the `{{BIN_NAME}}` command-line tool, published as `{{SCOPE}}/{{NAME}}-cli`;
23
+ - `packages/{{NAME}}`: the programmable API package, published as `{{SCOPE}}/{{NAME}}`.
24
+
25
+ ## Development setup
26
+
27
+ Prerequisites: bun and node.
28
+
29
+ - bun is the development toolchain and package manager; the repository pins its version through `packageManager`.
30
+ - node, >= 22.18.0, is required as well.
31
+ - `.nvmrc` pins the node major for version managers, and `.gitattributes` enforces LF line endings in the repository.
32
+
33
+ ```shell
34
+ # Install dependencies; in a clone this also installs the git hooks (lefthook)
35
+ bun install
36
+ ```
37
+
38
+ The hooks check code on the way in (pre-commit: a project-wide type check, plus prettier and oxlint over the staged files) and re-run the full checks before a push (pre-push runs `bun scripts/ci.ts`, the single source of the gate list). Where lefthook is not installed, the hook chain falls back to a pinned version fetched through bunx. Configuration: [lefthook.yml](lefthook.yml).
39
+
40
+ ## Common commands
41
+
42
+ Run from the repository root:
43
+
44
+ ```shell
45
+ # Type check (tsc --noEmit, through turbo)
46
+ bun run typecheck
47
+
48
+ # Lint (oxlint); `bun run lint:fix` applies the automatic fixes
49
+ bun run lint
50
+
51
+ # Format (prettier --write .)
52
+ bun run format
53
+
54
+ # Tests (through turbo; `bun test` runs the test runner directly)
55
+ bun run test
56
+
57
+ # Bundle the release artifacts of every package
58
+ bun run build
59
+
60
+ # Local CI rehearsal (the same gate list GitHub Actions runs)
61
+ bun run ci
62
+ ```
63
+
64
+ The [development guide](docs/development.md) covers environment setup, the commit hooks, and the release chain.
65
+
66
+ ## Commits
67
+
68
+ - Use a Conventional Commits type prefix (`feat`, `fix`, `chore`, `test`, `refactor`,...) with a short description.
69
+ - Keep each commit to a single topic, and split unrelated changes into separate commits.
70
+ - Breaking changes must carry both markers: the `!` after the type (`feat!: ...`) drives the version bump, and an English `BREAKING CHANGE: <description>` footer is what the release-notes generator recognizes. A `!` commit without a recognizable footer is dropped from the generated CHANGELOG entirely.
71
+
72
+ ## Pull requests
73
+
74
+ - Fill in the pull request template and keep the pull request focused on one topic.
75
+ - Link the issue it addresses; for larger changes, that issue is where the approach was discussed.
76
+ - CI runs the full check suite on every pull request: build, typecheck, tests, lint, and the formatting check.
77
+ - Do not bump versions or edit changelogs; releases are automated from `main` (semantic-release, behind a maintainer approval gate).
78
+
79
+ ## Documentation
80
+
81
+ Engineering docs live under `docs/`; the index is [docs/README.md](docs/README.md). New documents must be registered in the index they belong to (the README under `adrs/` or `designs/`, or the top-level index for everything else); orphan documents are not accepted. If a change alters behavior or a documented contract, update the matching document in the same pull request.
82
+
83
+ ## Questions
84
+
85
+ Open an issue, or mention @{{OWNER}} in an existing thread.
@@ -0,0 +1,85 @@
1
+ # 向 {{NAME}} 贡献
2
+
3
+ [English](CONTRIBUTING.md) | **中文**
4
+
5
+ 感谢你抽出时间参与贡献。缺陷报告、功能建议、文档修正与 pull request 都欢迎。
6
+
7
+ 参与本项目的所有人都受[行为准则](CODE_OF_CONDUCT.md)约束。
8
+
9
+ ## 贡献方式
10
+
11
+ - 报缺陷: 用缺陷报告表单开一个 issue;
12
+ - 提功能: 用功能建议表单开一个 issue;
13
+ - 提改动: 开一个 pull request。超出小修的改动请先开 issue, 把做法谈定再动手;
14
+ - 报安全问题: 不要开公开 issue, 按 [SECURITY.md](SECURITY.md) 走。
15
+
16
+ <!-- 模板骨架: 示例包是占位实现; 换成自己的工具后, 同步下面「仓库结构」与两条命令示例。 -->
17
+
18
+ ## 仓库结构
19
+
20
+ 本仓库是 turbo 管理的 monorepo, 每个工具都住在 `packages/` 下:
21
+
22
+ - `packages/{{NAME}}-cli`: 命令行工具 `{{BIN_NAME}}`, 发布为 `{{SCOPE}}/{{NAME}}-cli`;
23
+ - `packages/{{NAME}}`: 可编程 API 包, 发布为 `{{SCOPE}}/{{NAME}}`。
24
+
25
+ ## 环境准备
26
+
27
+ 前置: bun 与 node。
28
+
29
+ - bun 是开发工具链与包管理器; 版本经 `packageManager` 锁定;
30
+ - node 亦为必需, `>= 22.18.0`;
31
+ - `.nvmrc` 给版本管理器锁 node 大版本, `.gitattributes` 强制仓库内 LF 行尾。
32
+
33
+ ```shell
34
+ # 装依赖; 在检出态同时装好 git 钩子 (lefthook)
35
+ bun install
36
+ ```
37
+
38
+ 钩子在入口把关 (pre-commit: 全项目类型检查 + prettier / oxlint 扫暂存文件), 推送前再跑一遍全量检查 (pre-push 跑 `bun scripts/ci.ts`, 步骤清单的单一来源)。机器上没有 lefthook 时, 钩子链经 bunx 取 pin 版兜底。配置见 [lefthook.yml](lefthook.yml)。
39
+
40
+ ## 常用命令
41
+
42
+ 以下命令均在仓库根执行:
43
+
44
+ ```shell
45
+ # 类型检查 (tsc --noEmit, 经 turbo)
46
+ bun run typecheck
47
+
48
+ # 代码检查 (oxlint); `bun run lint:fix` 自动修复
49
+ bun run lint
50
+
51
+ # 格式化 (prettier --write .)
52
+ bun run format
53
+
54
+ # 测试 (经 turbo; `bun test` 直跑测试器)
55
+ bun run test
56
+
57
+ # 打包各包的发布产物
58
+ bun run build
59
+
60
+ # 本地 CI 预演 (与 GitHub Actions 同一套步骤清单)
61
+ bun run ci
62
+ ```
63
+
64
+ 环境准备、提交钩子与发布链的完整说明见[开发指南](docs/development.md)。
65
+
66
+ ## 提交
67
+
68
+ - 用 Conventional Commits 类型前缀 (`feat` / `fix` / `chore` / `test` / `refactor` 等) 加一句短描述;
69
+ - 守单一主题原则: 一个提交只含一个完整逻辑变更, 跨主题须拆分;
70
+ - 破坏性变更必须双标齐备: 类型后的 `!` (`feat!: ...`) 驱动版本判定, 英文 `BREAKING CHANGE: <描述>` footer 是发布说明生成器认得的形态; 只有 `!` 而 footer 不可识别时, 该提交会整个丢掉、不进 CHANGELOG。
71
+
72
+ ## Pull request
73
+
74
+ - 填好 pull request 模板, 让 PR 聚焦单一主题;
75
+ - 关联它解决的 issue; 较大改动, 那个 issue 就是讨论做法的地方;
76
+ - CI 对每个 PR 跑完整检查: 构建 / 类型 / 测试 / lint / 格式;
77
+ - 不要手动改版本号或 CHANGELOG; 发布由 `main` 上的自动链完成 (semantic-release, 带维护者批准闸门)。
78
+
79
+ ## 文档
80
+
81
+ 工程技术文档在 `docs/` 下, 索引是 [docs/README.md](docs/README.md)。新增文档必须登记到它所属的索引 (`adrs/`、`designs/` 下的登记到各自 README, 其余登记到总索引); 不接受索引之外的孤岛文档。改动行为或已登记契约时, 同一个 PR 里把对应文档一并更新。
82
+
83
+ ## 提问
84
+
85
+ 开一个 issue, 或在既有讨论里 @{{OWNER}}。
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 {{OWNER}}
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,22 @@
1
+ # {{NAME}}
2
+
3
+ [![CI]({{REPO_URL}}/actions/workflows/ci.yml/badge.svg)]({{REPO_URL}}/actions/workflows/ci.yml)
4
+ [![Release]({{REPO_URL}}/actions/workflows/release.yml/badge.svg)]({{REPO_URL}}/actions/workflows/release.yml)
5
+
6
+ **English** | [中文](README.zh-CN.md)
7
+
8
+ <!-- 模板骨架: 用一句话说清这个集合仓是什么、装有哪些工具; 落地时替换本节与「Packages」。 -->
9
+
10
+ A collection of command-line tools, managed as a monorepo: every tool lives under `packages/`, each with docs starting from its own `README.md`.
11
+
12
+ ## Packages
13
+
14
+ <!-- 模板骨架: 示例包 {{NAME}} 与 {{NAME}}-cli 是占位实现 (一个 greet 示例), 替换为自己的工具后同步本节。 -->
15
+
16
+ - **`{{SCOPE}}/{{NAME}}-cli`**: the `{{BIN_NAME}}` command-line tool; installation, usage, and configuration live in its [README](packages/{{NAME}}-cli/README.md).
17
+ - **`{{SCOPE}}/{{NAME}}`**: the API package, for use in your own programs or scripts; usage is documented in its [README](packages/{{NAME}}/README.md).
18
+
19
+ ## Documentation
20
+
21
+ - [Engineering documentation index](docs/README.md): the repository-level entry to design docs, ADRs, and development docs;
22
+ - [Development guide](docs/development.md): environment setup, common commands, and commit hooks.
@@ -0,0 +1,22 @@
1
+ # {{NAME}}
2
+
3
+ [![CI]({{REPO_URL}}/actions/workflows/ci.yml/badge.svg)]({{REPO_URL}}/actions/workflows/ci.yml)
4
+ [![Release]({{REPO_URL}}/actions/workflows/release.yml/badge.svg)]({{REPO_URL}}/actions/workflows/release.yml)
5
+
6
+ [English](README.md) | **中文**
7
+
8
+ <!-- 模板骨架: 用一句话说清这个集合仓是什么、装有哪些工具; 落地时替换本节与「包」一节。 -->
9
+
10
+ CLI 工具集合仓: 每个工具都住在 `packages/` 下, 文档从各自的 `README.md` 读起。
11
+
12
+ ## 包
13
+
14
+ <!-- 模板骨架: 示例包 {{NAME}} 与 {{NAME}}-cli 是占位实现 (一个 greet 示例), 替换为自己的工具后同步本节。 -->
15
+
16
+ - **`{{SCOPE}}/{{NAME}}-cli`**: 命令行工具 `{{BIN_NAME}}`; 安装、用法与配置见其 [README](packages/{{NAME}}-cli/README.md);
17
+ - **`{{SCOPE}}/{{NAME}}`**: 可编程 API 包, 供自己的程序或脚本调用; 用法见其 [README](packages/{{NAME}}/README.md)。
18
+
19
+ ## 文档
20
+
21
+ - [工程技术文档总索引](docs/README.md): 仓库级设计与 ADR、开发文档的入口;
22
+ - [开发指南](docs/development.md): 环境准备、常用命令与提交钩子。
@@ -0,0 +1,21 @@
1
+ # Security Policy
2
+
3
+ ## Supported versions
4
+
5
+ Security fixes are released as new versions; only the latest published release of each package is supported. Older releases do not receive fixes.
6
+
7
+ ## Reporting a vulnerability
8
+
9
+ Please report suspected vulnerabilities privately, through GitHub's private reporting form: open the repository's Security tab, go to Advisories, and click Report a vulnerability. Do not open a public issue for a security problem.
10
+
11
+ A useful report includes:
12
+
13
+ - what the issue is, and how it could be exploited;
14
+ - the affected package and version, or the commit hash when running from a clone;
15
+ - the runtime and its version (bun or node), and the operating system;
16
+ - the exact command used, and the configuration in effect;
17
+ - a minimal reproduction, if possible.
18
+
19
+ ## What to expect
20
+
21
+ Responses are best effort, and security reports are handled through the advisory thread. Please allow time for a fix before disclosing anything publicly.