init-prettier-git-hooks
初始化 Prettier + Git Hooks 格式化流程
本技能用于在任何 Node.js 项目中初始化或补强基于 lint-staged + simple-git-hooks + prettier 的 git 提交前格式化流程。重点不是“把模板复制进去”,而是对目标项目做检查、合并、补全、精确覆盖。
目标结果
当用户要求处理本技能时,最终应让项目具备这一整条 LF 统一链路:
.gitattributes:* text=auto eol=lf.editorconfig:[*]区块内存在end_of_line = lfprettier.config.mjs:endOfLine: "lf",禁止保留"auto"package.json、lint-staged.config.js、simple-git-hooks.mjs的格式化链路可正常工作- 执行
git add --renormalize .后,git 行尾归一化完成
1. 定位根 package.json 并检查依赖
在安装任何依赖之前,必须先定位到项目的根 package.json 文件所在位置,并检查必需依赖是否已经安装。
1.1. 定位根 package.json
More from ruan-cat/monorepo
git-commit
创建高质量的 git 提交:审查/暂存预期的变更,拆分为逻辑提交,并编写清晰的提交信息(遵循 Conventional Commits 规范,支持 Emoji)。当用户要求提交代码、编写提交信息、暂存变更或将工作拆分为多个提交时使用此技能。当用户提及【破坏性变更】关键词时,必须按照本技能的 BREAKING CHANGE 规范使用感叹号格式编写提交信息。优先针对 git 暂存区(staged)中的文件进行提交,只有当暂存区为空时才考虑整个工作树。当用户提及【分门别类】关键词时,必须按照本技能的多提交拆分规范,从文件类型、业务模块、修改类型、修改范围四个维度认真拆分多个提交。
27openspec
|
20openspec-sync-specs
Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.
13openspec-ff-change
Fast-forward through OpenSpec artifact creation. Use when the user wants to quickly create all artifacts needed for implementation without stepping through each one individually.
13openspec-new-change
Start a new OpenSpec change using the experimental artifact workflow. Use when the user wants to create a new feature, fix, or modification with a structured step-by-step approach.
13openspec-apply-change
Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
13