@bovinphang/craft-common 1.0.1 → 2.0.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/CHANGELOG.md +39 -0
- package/CHANGELOG.zh-CN.md +39 -0
- package/README.md +17 -3
- package/dist/content/applicability.d.ts +17 -0
- package/dist/content/catalog.d.ts +1 -1
- package/dist/content/snapshot.d.ts +32 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +10873 -208
- package/dist/install/file-transition.d.ts +10 -0
- package/dist/install/product/lifecycle.d.ts +17 -0
- package/dist/install/product/locks.d.ts +2 -0
- package/dist/install/product/ownership.d.ts +3 -0
- package/dist/install/product/paths.d.ts +17 -0
- package/dist/install/product/runtime-descriptors.d.ts +109 -0
- package/dist/install/product/session.d.ts +31 -0
- package/dist/install/product/shared-config/hash.d.ts +9 -0
- package/dist/install/product/shared-config/index.d.ts +16 -0
- package/dist/install/product/shared-config/json.d.ts +11 -0
- package/dist/install/product/shared-config/text.d.ts +5 -0
- package/dist/install/product/shared-config/toml.d.ts +7 -0
- package/dist/install/product/shared-config/types.d.ts +21 -0
- package/dist/install/product/transaction.d.ts +10 -0
- package/dist/install/product/types.d.ts +65 -0
- package/dist/project/discover.d.ts +2 -0
- package/dist/project/evidence.d.ts +37 -0
- package/dist/project/frameworks.d.ts +5 -0
- package/dist/project/recommend.d.ts +17 -0
- package/dist/project/types.d.ts +42 -0
- package/docs/consuming-common.md +65 -6
- package/docs/releases/2.0.0.md +58 -0
- package/localized/zh-CN/methods/engineering-practices.md +237 -0
- package/localized/zh-CN/methods/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/methods/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-c-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary.c +26 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary.h +15 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary_test.c +73 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary.cpp +26 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary.hpp +12 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary_test.cpp +38 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/SKILL.md +21 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.cjs +44 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.test.cjs +44 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/package.json +8 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/README.md +9 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/boundary.cjs +19 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/boundary.test.cjs +7 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/index.html +1 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/main.cjs +20 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/package.json +9 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/preload.cjs +2 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/renderer.js +4 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/practice.md +19 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/verification.md +17 -0
- package/localized/zh-CN/skills/cc-go-concurrency/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-go-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/go.mod +3 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/lifecycle.go +71 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/lifecycle_test.go +22 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-java-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/README.md +5 -0
- package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/ResourceBoundary.java +26 -0
- package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/ResourceBoundaryTest.java +41 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-java-runtime/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-python-async/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-python-async/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-python-async/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-python-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/resource_boundary.py +37 -0
- package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/test_resource_boundary.py +49 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-rust-async/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-rust-async/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-rust-async/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/Cargo.lock +7 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/Cargo.toml +8 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/README.md +5 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/src/lib.rs +43 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/SKILL.md +21 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/README.md +9 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.lock +5 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.toml +9 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/src/lib.rs +46 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/Cargo.toml +12 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/build.rs +5 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/capabilities/main.json +6 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/permissions/documents.toml +4 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/src/main.rs +22 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/tauri.conf.json +13 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/ui/app.js +5 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/ui/index.html +1 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/practice.md +20 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/verification.md +18 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/SKILL.md +60 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/boundary.test.ts +16 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/input.ts +12 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/package.json +12 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/pnpm-lock.yaml +39 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/tsconfig.json +8 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/type-safety-patterns.md +73 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/type-safety.md +154 -0
- package/localized/zh-CN/skills/eval_queries.json +336 -0
- package/localized/zh-CN/skills/metadata.json +545 -7
- package/localized/zh-CN/skills/relations.json +143 -0
- package/methods/engineering-practices.md +237 -0
- package/methods/engineering-practices.rules.json +121 -0
- package/methods/engineering-practices.sources.json +377 -0
- package/package.json +10 -2
- package/skills/cc-c-project-standard/SKILL.md +25 -0
- package/skills/cc-c-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-c-project-standard/examples/engineering/boundary.c +26 -0
- package/skills/cc-c-project-standard/examples/engineering/boundary.h +15 -0
- package/skills/cc-c-project-standard/examples/engineering/boundary_test.c +73 -0
- package/skills/cc-c-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-c-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-c-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-c-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-c-project-standard/references/practice.md +37 -0
- package/skills/cc-cpp-project-standard/SKILL.md +25 -0
- package/skills/cc-cpp-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-cpp-project-standard/examples/engineering/boundary.cpp +26 -0
- package/skills/cc-cpp-project-standard/examples/engineering/boundary.hpp +12 -0
- package/skills/cc-cpp-project-standard/examples/engineering/boundary_test.cpp +38 -0
- package/skills/cc-cpp-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-cpp-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-cpp-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-cpp-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-cpp-project-standard/references/practice.md +37 -0
- package/skills/cc-electron-project-standard/SKILL.md +21 -0
- package/skills/cc-electron-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.cjs +44 -0
- package/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.test.cjs +44 -0
- package/skills/cc-electron-project-standard/examples/engineering/package.json +8 -0
- package/skills/cc-electron-project-standard/examples/minimal/README.md +9 -0
- package/skills/cc-electron-project-standard/examples/minimal/boundary.cjs +19 -0
- package/skills/cc-electron-project-standard/examples/minimal/boundary.test.cjs +7 -0
- package/skills/cc-electron-project-standard/examples/minimal/index.html +1 -0
- package/skills/cc-electron-project-standard/examples/minimal/main.cjs +20 -0
- package/skills/cc-electron-project-standard/examples/minimal/package.json +9 -0
- package/skills/cc-electron-project-standard/examples/minimal/preload.cjs +2 -0
- package/skills/cc-electron-project-standard/examples/minimal/renderer.js +4 -0
- package/skills/cc-electron-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-electron-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-electron-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-electron-project-standard/references/engineering-practices.md +73 -0
- package/skills/cc-electron-project-standard/references/practice.md +19 -0
- package/skills/cc-electron-project-standard/references/verification.md +17 -0
- package/skills/cc-go-concurrency/SKILL.md +25 -0
- package/skills/cc-go-concurrency/references/common/engineering-practices.md +237 -0
- package/skills/cc-go-concurrency/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-go-concurrency/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-go-concurrency/references/engineering-practices.md +73 -0
- package/skills/cc-go-concurrency/references/practice.md +37 -0
- package/skills/cc-go-project-standard/SKILL.md +25 -0
- package/skills/cc-go-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-go-project-standard/examples/engineering/go.mod +3 -0
- package/skills/cc-go-project-standard/examples/engineering/lifecycle.go +71 -0
- package/skills/cc-go-project-standard/examples/engineering/lifecycle_test.go +22 -0
- package/skills/cc-go-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-go-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-go-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-go-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-go-project-standard/references/practice.md +37 -0
- package/skills/cc-java-project-standard/SKILL.md +25 -0
- package/skills/cc-java-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-java-project-standard/examples/engineering/ResourceBoundary.java +26 -0
- package/skills/cc-java-project-standard/examples/engineering/ResourceBoundaryTest.java +41 -0
- package/skills/cc-java-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-java-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-java-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-java-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-java-project-standard/references/practice.md +35 -0
- package/skills/cc-java-runtime/SKILL.md +25 -0
- package/skills/cc-java-runtime/references/common/engineering-practices.md +237 -0
- package/skills/cc-java-runtime/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-java-runtime/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-java-runtime/references/engineering-practices.md +73 -0
- package/skills/cc-java-runtime/references/practice.md +37 -0
- package/skills/cc-native-memory-safety/SKILL.md +25 -0
- package/skills/cc-native-memory-safety/references/common/engineering-practices.md +237 -0
- package/skills/cc-native-memory-safety/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-native-memory-safety/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-native-memory-safety/references/engineering-practices.md +73 -0
- package/skills/cc-native-memory-safety/references/practice.md +37 -0
- package/skills/cc-python-async/SKILL.md +25 -0
- package/skills/cc-python-async/references/common/engineering-practices.md +237 -0
- package/skills/cc-python-async/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-python-async/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-python-async/references/engineering-practices.md +73 -0
- package/skills/cc-python-async/references/practice.md +37 -0
- package/skills/cc-python-project-standard/SKILL.md +25 -0
- package/skills/cc-python-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-python-project-standard/examples/engineering/resource_boundary.py +37 -0
- package/skills/cc-python-project-standard/examples/engineering/test_resource_boundary.py +49 -0
- package/skills/cc-python-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-python-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-python-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-python-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-python-project-standard/references/practice.md +37 -0
- package/skills/cc-rust-async/SKILL.md +25 -0
- package/skills/cc-rust-async/references/common/engineering-practices.md +237 -0
- package/skills/cc-rust-async/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-rust-async/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-rust-async/references/engineering-practices.md +73 -0
- package/skills/cc-rust-async/references/practice.md +37 -0
- package/skills/cc-rust-project-standard/SKILL.md +25 -0
- package/skills/cc-rust-project-standard/examples/engineering/Cargo.lock +7 -0
- package/skills/cc-rust-project-standard/examples/engineering/Cargo.toml +8 -0
- package/skills/cc-rust-project-standard/examples/engineering/README.md +5 -0
- package/skills/cc-rust-project-standard/examples/engineering/src/lib.rs +43 -0
- package/skills/cc-rust-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-rust-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-rust-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-rust-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-rust-project-standard/references/practice.md +37 -0
- package/skills/cc-tauri-project-standard/SKILL.md +21 -0
- package/skills/cc-tauri-project-standard/examples/minimal/README.md +9 -0
- package/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.lock +5 -0
- package/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.toml +9 -0
- package/skills/cc-tauri-project-standard/examples/minimal/core/src/lib.rs +46 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/Cargo.toml +12 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/build.rs +5 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/capabilities/main.json +6 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/permissions/documents.toml +4 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/src/main.rs +22 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/tauri.conf.json +13 -0
- package/skills/cc-tauri-project-standard/examples/minimal/ui/app.js +5 -0
- package/skills/cc-tauri-project-standard/examples/minimal/ui/index.html +1 -0
- package/skills/cc-tauri-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-tauri-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-tauri-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-tauri-project-standard/references/engineering-practices.md +73 -0
- package/skills/cc-tauri-project-standard/references/practice.md +20 -0
- package/skills/cc-tauri-project-standard/references/verification.md +18 -0
- package/skills/cc-typescript-project-standard/SKILL.md +60 -0
- package/skills/cc-typescript-project-standard/examples/engineering/README.md +9 -0
- package/skills/cc-typescript-project-standard/examples/engineering/boundary.test.ts +16 -0
- package/skills/cc-typescript-project-standard/examples/engineering/input.ts +12 -0
- package/skills/cc-typescript-project-standard/examples/engineering/package.json +12 -0
- package/skills/cc-typescript-project-standard/examples/engineering/pnpm-lock.yaml +39 -0
- package/skills/cc-typescript-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
- package/skills/cc-typescript-project-standard/examples/engineering/tsconfig.json +8 -0
- package/skills/cc-typescript-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-typescript-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-typescript-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-typescript-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-typescript-project-standard/references/type-safety-patterns.md +73 -0
- package/skills/cc-typescript-project-standard/references/type-safety.md +154 -0
- package/skills/eval_queries.json +336 -0
- package/skills/metadata.json +545 -7
- package/skills/relations.json +143 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Minimal Electron IPC application
|
|
2
|
+
|
|
3
|
+
This directory contains main, preload, renderer, trusted protocol assets, an IPC boundary and tests. It requires no neighboring skill package.
|
|
4
|
+
|
|
5
|
+
Run `node --test boundary.test.cjs` to test the production handler. With `CRAFT_EXAMPLE_DEFECTIVE=1`, the same assertions select a clearly marked unsafe function and intentionally fail. Use the normal handler for the application.
|
|
6
|
+
|
|
7
|
+
If a maintained Electron version is already available in the owning environment, run its existing `electron .` command here. The optional peer describes the API baseline; it does not install a runtime or provide a locked release environment. The window uses the secure `app://craft` protocol, exports only `desktop.setTitle`, and refuses arbitrary assets, windows and navigation.
|
|
8
|
+
|
|
9
|
+
The title handler is tested as plain Node code, not a mocked claim that an Electron process ran. Verify real process isolation, IPC authorization and target packaging with the host project's prepared Electron toolchain before release.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Deliberately broken teaching variant: no sender or argument validation. */
|
|
2
|
+
function createSetTitleDefective({ setTitle }) {
|
|
3
|
+
return (_event, payload) => { setTitle(payload.title); return { ok: true }; };
|
|
4
|
+
}
|
|
5
|
+
function createSetTitle({ trustedContentsId, trustedUrl, setTitle }) {
|
|
6
|
+
return (event, payload) => {
|
|
7
|
+
if (event.sender?.id !== trustedContentsId ||
|
|
8
|
+
!event.senderFrame || event.senderFrame !== event.sender.mainFrame ||
|
|
9
|
+
event.senderFrame.url !== trustedUrl) throw new Error('untrusted sender');
|
|
10
|
+
if (!payload || typeof payload !== 'object' || Array.isArray(payload) ||
|
|
11
|
+
Object.keys(payload).length !== 1 || typeof payload.title !== 'string' ||
|
|
12
|
+
!payload.title.trim() || payload.title.length > 80 || /[\x00-\x1f\x7f]/.test(payload.title)) {
|
|
13
|
+
throw new Error('invalid title');
|
|
14
|
+
}
|
|
15
|
+
setTitle(payload.title);
|
|
16
|
+
return { ok: true };
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
module.exports = { createSetTitle, createSetTitleDefective };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const test=require('node:test');const assert=require('node:assert/strict');
|
|
2
|
+
const {createSetTitle,createSetTitleDefective}=require('./boundary.cjs');
|
|
3
|
+
function fixture(){const calls=[],frame={url:'app://craft/index.html'};const sender={id:7,mainFrame:frame};return {calls,event:{sender,senderFrame:frame},handle:(process.env.CRAFT_EXAMPLE_DEFECTIVE==='1'?createSetTitleDefective:createSetTitle)({trustedContentsId:7,trustedUrl:frame.url,setTitle:title=>calls.push(title)})};}
|
|
4
|
+
test('trusted main frame can set a bounded title',()=>{const f=fixture();assert.deepEqual(f.handle(f.event,{title:'Document'}),{ok:true});assert.deepEqual(f.calls,['Document']);});
|
|
5
|
+
test('untrusted sender is rejected before side effects',()=>{const f=fixture();assert.throws(()=>f.handle({...f.event,sender:{...f.event.sender,id:9}},{title:'attack'}));assert.deepEqual(f.calls,[]);});
|
|
6
|
+
test('untrusted sender frame origin is rejected',()=>{const f=fixture();assert.throws(()=>f.handle({...f.event,senderFrame:{url:'https://untrusted.invalid/'}},{title:'attack'}));assert.deepEqual(f.calls,[]);});
|
|
7
|
+
test('malformed arguments are rejected before side effects',()=>{for(const value of [null,[],{}, {title:3},{title:''},{title:'x'.repeat(81)},{title:'ok',extra:true},{title:'line\nbreak'}]){const f=fixture();assert.throws(()=>f.handle(f.event,value));assert.deepEqual(f.calls,[]);}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html lang="en"><meta charset="utf-8"><title>Document</title><body><label>Window title <input id="title" maxlength="80"></label><button id="set">Set title</button><p id="result" role="status"></p><script src="renderer.js"></script></body></html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const { app, BrowserWindow, ipcMain, protocol }=require('electron');
|
|
2
|
+
const fs=require('node:fs/promises');const path=require('node:path');
|
|
3
|
+
const {createSetTitle}=require('./boundary.cjs');
|
|
4
|
+
const trustedUrl='app://craft/index.html';
|
|
5
|
+
protocol.registerSchemesAsPrivileged([{scheme:'app',privileges:{standard:true,secure:true,supportFetchAPI:true}}]);
|
|
6
|
+
app.whenReady().then(()=>{
|
|
7
|
+
const assets=new Map([[trustedUrl,['index.html','text/html']],['app://craft/renderer.js',['renderer.js','text/javascript']]]);
|
|
8
|
+
protocol.handle('app',async request=>{
|
|
9
|
+
const asset=request.method==='GET'&&assets.get(request.url);
|
|
10
|
+
if(!asset)return new Response('Not found',{status:404});
|
|
11
|
+
return new Response(await fs.readFile(path.join(__dirname,asset[0])),{headers:{'Content-Type':asset[1],'Content-Security-Policy':"default-src 'self'; script-src 'self'; object-src 'none'; connect-src 'none'"}});
|
|
12
|
+
});
|
|
13
|
+
const win=new BrowserWindow({webPreferences:{preload:path.join(__dirname,'preload.cjs'),contextIsolation:true,nodeIntegration:false,sandbox:true}});
|
|
14
|
+
ipcMain.handle('document:set-title',createSetTitle({trustedContentsId:win.webContents.id,trustedUrl,setTitle:title=>win.setTitle(title)}));
|
|
15
|
+
win.webContents.on('will-navigate',(event,url)=>{if(url!==trustedUrl)event.preventDefault();});
|
|
16
|
+
win.webContents.setWindowOpenHandler(()=>({action:'deny'}));
|
|
17
|
+
win.on('closed',()=>ipcMain.removeHandler('document:set-title'));
|
|
18
|
+
return win.loadURL(trustedUrl);
|
|
19
|
+
}).catch(()=>{console.error('Application initialization failed');app.quit();});
|
|
20
|
+
app.on('window-all-closed',()=>app.quit());
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "craft-electron-boundary-example",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"main": "main.cjs",
|
|
6
|
+
"scripts": { "test": "node --test boundary.test.cjs", "start": "electron ." },
|
|
7
|
+
"peerDependencies": { "electron": ">=30" },
|
|
8
|
+
"peerDependenciesMeta": { "electron": { "optional": true } }
|
|
9
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
document.querySelector('#set').addEventListener('click',async()=>{
|
|
2
|
+
try {await window.desktop.setTitle(document.querySelector('#title').value);document.querySelector('#result').textContent='Updated';}
|
|
3
|
+
catch {document.querySelector('#result').textContent='Title rejected';}
|
|
4
|
+
});
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Engineering practices
|
|
2
|
+
|
|
3
|
+
Read project contracts first, then only the relevant core sections and local language/scenario cards. These are project-native decisions informed by the linked primary sources, not certification by those organizations. `required` protects stated correctness/safety contracts; `recommended` is a default with reasoned alternatives; `conditional` activates only when its stated predicate holds. Project safety/compatibility and actual toolchain facts take priority over corporate style.
|
|
4
|
+
|
|
5
|
+
<a id="ENG-CONTRACT"></a>
|
|
6
|
+
## ENG-CONTRACT — Contracts before representation
|
|
7
|
+
|
|
8
|
+
Level: required
|
|
9
|
+
|
|
10
|
+
### Risk
|
|
11
|
+
An accepted input can still violate the caller’s operation or output contract.
|
|
12
|
+
|
|
13
|
+
### Applies
|
|
14
|
+
Applies at public APIs, files, IPC and serialized input. Internal trusted values can rely on a proven invariant; rechecking everything is not the goal.
|
|
15
|
+
|
|
16
|
+
### Decision
|
|
17
|
+
Name the caller, accepted values, units, failure/output state and compatibility promise. Validate unknown data once at the boundary before effects; keep protocol mapping outside pure domain logic.
|
|
18
|
+
|
|
19
|
+
### Exceptions
|
|
20
|
+
If a trusted upstream validator owns the invariant, record its scope instead of adding a second schema. Type assertions and generated types alone provide no runtime guarantee.
|
|
21
|
+
|
|
22
|
+
### Examples
|
|
23
|
+
Better: reject a malformed amount before charging. Worse: cast JSON and let a partial effect reveal invalid input.
|
|
24
|
+
|
|
25
|
+
### Verification
|
|
26
|
+
Check invalid, boundary and successful inputs, plus effects/output state; exercise a real packed consumer when shipping a package.
|
|
27
|
+
|
|
28
|
+
### Sources
|
|
29
|
+
- [Publishing declaration files](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) (typescript-publishing)
|
|
30
|
+
- [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/) (rust-api)
|
|
31
|
+
|
|
32
|
+
Case evidence IDs: EP-TS-01, EP-SVC-01. Identifiers are not cross-entry file dependencies; consult local examples and the coverage report for execution status.
|
|
33
|
+
|
|
34
|
+
<a id="ENG-ERROR"></a>
|
|
35
|
+
## ENG-ERROR — Observable failure
|
|
36
|
+
|
|
37
|
+
Level: required
|
|
38
|
+
|
|
39
|
+
### Risk
|
|
40
|
+
A fallback can erase the cause or report success after partial work.
|
|
41
|
+
|
|
42
|
+
### Applies
|
|
43
|
+
Applies when a failure crosses an abstraction or process boundary. Expected absence may use an explicit optional result rather than an exception.
|
|
44
|
+
|
|
45
|
+
### Decision
|
|
46
|
+
Preserve the cause and operation context, return a typed/declared failure, and let the owning boundary choose recovery. Cleanup failure must not silently replace the primary failure.
|
|
47
|
+
|
|
48
|
+
### Exceptions
|
|
49
|
+
Translate sensitive internal details into a safe public error while preserving a correlation path in permitted diagnostics. Do not log credentials or raw private payloads.
|
|
50
|
+
|
|
51
|
+
### Examples
|
|
52
|
+
Better: failure plus original cause and released owned resources. Worse: catch everything and return an empty successful object.
|
|
53
|
+
|
|
54
|
+
### Verification
|
|
55
|
+
Inject a downstream failure; assert the caller observes failure, its cause and the agreed cleanup outcome.
|
|
56
|
+
|
|
57
|
+
### Sources
|
|
58
|
+
- [Try-with-resources](https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html) (oracle-resources)
|
|
59
|
+
- [Go Style Guide](https://github.com/uber-go/guide/blob/master/style.md) (uber-go)
|
|
60
|
+
|
|
61
|
+
Case evidence IDs: EP-RS-01, EP-JAVA-01. Identifiers are not cross-entry file dependencies; consult local examples and the coverage report for execution status.
|
|
62
|
+
|
|
63
|
+
<a id="ENG-RESOURCE"></a>
|
|
64
|
+
## ENG-RESOURCE — Own the full lifecycle
|
|
65
|
+
|
|
66
|
+
Level: required
|
|
67
|
+
|
|
68
|
+
### Risk
|
|
69
|
+
Partial acquisition, borrowed handles and teardown create leaks or double release.
|
|
70
|
+
|
|
71
|
+
### Applies
|
|
72
|
+
Applies when code acquires files, allocations, tasks, subscriptions or external handles. Pure value transformations need no invented resource manager.
|
|
73
|
+
|
|
74
|
+
### Decision
|
|
75
|
+
Identify acquire/use/transfer/release owners. Release acquired resources on every exit, in dependency order; borrowed values stay with their owner. Importing a library should not acquire unrelated external resources.
|
|
76
|
+
|
|
77
|
+
### Exceptions
|
|
78
|
+
A documented transfer or process-lifetime resource needs an explicit recipient or lifetime contract. Finalizers and process exit alone do not prove orderly shutdown.
|
|
79
|
+
|
|
80
|
+
### Examples
|
|
81
|
+
Better: fail the second allocation and release only the first owned allocation. Worse: free the caller’s borrowed buffer.
|
|
82
|
+
|
|
83
|
+
### Verification
|
|
84
|
+
Count acquisitions/releases under each failure point and successful transfer. Record untested drivers, GUI shutdown and sanitizer coverage separately.
|
|
85
|
+
|
|
86
|
+
### Sources
|
|
87
|
+
- [MEM00-C allocation and release](https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/recommendations/memory-management-mem/mem00-c/) (cert-c)
|
|
88
|
+
- [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines) (cpp-core)
|
|
89
|
+
|
|
90
|
+
Case evidence IDs: EP-C-01, EP-CPP-01, EP-PY-01. Identifiers are not cross-entry file dependencies; consult local examples and the coverage report for execution status.
|
|
91
|
+
|
|
92
|
+
<a id="ENG-CONCURRENCY"></a>
|
|
93
|
+
## ENG-CONCURRENCY — Cancellation and completion differ
|
|
94
|
+
|
|
95
|
+
Level: conditional
|
|
96
|
+
|
|
97
|
+
### Risk
|
|
98
|
+
Detached work can outlive owners; an old result may overwrite current state.
|
|
99
|
+
|
|
100
|
+
### Applies
|
|
101
|
+
Applies if the unit starts concurrent work or receives asynchronous results. Sequential pure code need not gain a scheduler.
|
|
102
|
+
|
|
103
|
+
### Decision
|
|
104
|
+
Keep completion handles, cancellation ownership and bounded in-flight work. Stop accepting work, request cancellation/drain, then observe termination. Check request identity/liveness before publishing results.
|
|
105
|
+
|
|
106
|
+
### Exceptions
|
|
107
|
+
Some blocking operations ignore cancellation; expose incomplete shutdown or a caller-owned forced-exit policy. Arc, channel capacity and an abort request are not completion evidence.
|
|
108
|
+
|
|
109
|
+
### Examples
|
|
110
|
+
Better: controlled B-before-A responses keep B visible. Worse: a timed-out caller frees resources while workers still use them.
|
|
111
|
+
|
|
112
|
+
### Verification
|
|
113
|
+
Use barriers/events and controlled futures for cancellation, saturation and late results; arbitrary sleeps are not ordering proof.
|
|
114
|
+
|
|
115
|
+
### Sources
|
|
116
|
+
- [context package](https://pkg.go.dev/context) (go-context)
|
|
117
|
+
- [JoinHandle](https://docs.rs/tokio/latest/tokio/task/struct.JoinHandle.html) (tokio-join)
|
|
118
|
+
- [Coroutines and tasks](https://docs.python.org/3/library/asyncio-task.html) (python-asyncio)
|
|
119
|
+
|
|
120
|
+
Case evidence IDs: EP-GO-01, EP-IPC-01, EP-UI-01. Identifiers are not cross-entry file dependencies; consult local examples and the coverage report for execution status.
|
|
121
|
+
|
|
122
|
+
<a id="ENG-BOUNDARY"></a>
|
|
123
|
+
## ENG-BOUNDARY — Trust is established at an actual boundary
|
|
124
|
+
|
|
125
|
+
Level: required
|
|
126
|
+
|
|
127
|
+
### Risk
|
|
128
|
+
A frontend/backend label can hide privileged operations or untrusted callers.
|
|
129
|
+
|
|
130
|
+
### Applies
|
|
131
|
+
Applies to external input, authorization and privilege changes across UI, IPC, library and service roles. A private pure helper is not a new authentication layer.
|
|
132
|
+
|
|
133
|
+
### Decision
|
|
134
|
+
Verify sender/identity through the actual trusted mechanism, validate operation-specific data and scope permissions. A renderer-provided role or hidden button is not authority.
|
|
135
|
+
|
|
136
|
+
### Exceptions
|
|
137
|
+
Offline/local-only tools still have a caller and data boundary. Do not add network authentication where the contract needs only a constrained local capability.
|
|
138
|
+
|
|
139
|
+
### Examples
|
|
140
|
+
Better: expose one validated IPC operation with sender checks. Worse: expose arbitrary filesystem methods to a renderer.
|
|
141
|
+
|
|
142
|
+
### Verification
|
|
143
|
+
Exercise denied and allowed calls and zero effects after rejection. Native permission activation/signing needs its own actual environment evidence.
|
|
144
|
+
|
|
145
|
+
### Sources
|
|
146
|
+
- [Security](https://www.electronjs.org/docs/latest/tutorial/security) (electron-security)
|
|
147
|
+
- [Permissions](https://v2.tauri.app/security/permissions/) (tauri-permissions)
|
|
148
|
+
|
|
149
|
+
Case evidence IDs: EP-TS-01, EP-IPC-01. Identifiers are not cross-entry file dependencies; consult local examples and the coverage report for execution status.
|
|
150
|
+
|
|
151
|
+
<a id="ENG-DEPENDENCY"></a>
|
|
152
|
+
## ENG-DEPENDENCY — Ship a usable consumer contract
|
|
153
|
+
|
|
154
|
+
Level: recommended
|
|
155
|
+
|
|
156
|
+
### Risk
|
|
157
|
+
Working inside a repository can conceal undeclared dependencies or incompatible artifacts.
|
|
158
|
+
|
|
159
|
+
### Applies
|
|
160
|
+
Applies when publishing, upgrading dependencies or changing exported APIs. A content-only note does not require changing every tool version.
|
|
161
|
+
|
|
162
|
+
### Decision
|
|
163
|
+
Read manifests, locks, supported targets and exports first. Keep dependencies explicit, changes scoped and migration reversible; validate the artifact from an independent consumer.
|
|
164
|
+
|
|
165
|
+
### Exceptions
|
|
166
|
+
Adopt a dependency or compiler change only for an evidenced need and compatible policy. A corporate guide’s preferred build system is not such evidence.
|
|
167
|
+
|
|
168
|
+
### Examples
|
|
169
|
+
Better: declarations resolve with the packed files and declared dependencies. Worse: publish types that only resolve through adjacent source aliases.
|
|
170
|
+
|
|
171
|
+
### Verification
|
|
172
|
+
Inspect real archive bytes, install away from sibling sources and run supported consumer checks; record the exact version/integrity and untested platforms.
|
|
173
|
+
|
|
174
|
+
### Sources
|
|
175
|
+
- [Publishing declaration files](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) (typescript-publishing)
|
|
176
|
+
- [Code review standard](https://google.github.io/eng-practices/review/reviewer/standard.html) (google-review)
|
|
177
|
+
|
|
178
|
+
Case evidence IDs: EP-TS-01. Identifiers are not cross-entry file dependencies; consult local examples and the coverage report for execution status.
|
|
179
|
+
|
|
180
|
+
<a id="ENG-VERIFICATION"></a>
|
|
181
|
+
## ENG-VERIFICATION — Evidence matches the claimed behavior
|
|
182
|
+
|
|
183
|
+
Level: required
|
|
184
|
+
|
|
185
|
+
### Risk
|
|
186
|
+
A green structural check or missing tool can be mistaken for behavioral proof.
|
|
187
|
+
|
|
188
|
+
### Applies
|
|
189
|
+
Applies to implementation, review and delivery claims. Read-only advice can state proposed checks without pretending execution.
|
|
190
|
+
|
|
191
|
+
### Decision
|
|
192
|
+
Choose tests by risk and observable boundaries. Separate environment preparation from execution; keep fixed assertions for faulty/fixed variants and report actual commands, counts and limitations.
|
|
193
|
+
|
|
194
|
+
### Exceptions
|
|
195
|
+
When tools are absent, report MISSING; when intentionally unexecuted, NOT RUN. Compile errors and zero/all-skipped suites do not prove business RED/GREEN.
|
|
196
|
+
|
|
197
|
+
### Examples
|
|
198
|
+
Better: failure injection breaks a named effect assertion, then the fixed version passes it. Worse: only grep for a PASS string.
|
|
199
|
+
|
|
200
|
+
### Verification
|
|
201
|
+
Retain raw output, input/tool hashes and scope. Structure, native behavior and model-task decisions are distinct evidence.
|
|
202
|
+
|
|
203
|
+
### Sources
|
|
204
|
+
- [Test planning](https://microsoft.github.io/code-with-engineering-playbook/automated-testing/test-planning/) (ms-playbook)
|
|
205
|
+
- [Fault injection testing](https://microsoft.github.io/code-with-engineering-playbook/automated-testing/fault-injection-testing/) (ms-faults)
|
|
206
|
+
- [Code review standard](https://google.github.io/eng-practices/review/reviewer/standard.html) (google-review)
|
|
207
|
+
|
|
208
|
+
Case evidence IDs: EP-TS-01, EP-C-01, EP-SVC-01. Identifiers are not cross-entry file dependencies; consult local examples and the coverage report for execution status.
|
|
209
|
+
|
|
210
|
+
<a id="ENG-OPERABILITY"></a>
|
|
211
|
+
## ENG-OPERABILITY — Make recovery explicit and bounded
|
|
212
|
+
|
|
213
|
+
Level: conditional
|
|
214
|
+
|
|
215
|
+
### Risk
|
|
216
|
+
Partial failure, retry amplification and unsafe diagnostics can worsen an incident.
|
|
217
|
+
|
|
218
|
+
### Applies
|
|
219
|
+
Applies where this unit owns an external operation, background lifecycle or recovery decision. Libraries should expose signals, not force service dashboards or HTTP layers.
|
|
220
|
+
|
|
221
|
+
### Decision
|
|
222
|
+
Classify failure and commit uncertainty; make operation intent, total timeout/retry budget and recovery owner explicit. Use a stable idempotency contract for writes before replay. Emit safe correlation and actionable failure state.
|
|
223
|
+
|
|
224
|
+
### Exceptions
|
|
225
|
+
Without server-side safety, leave a write pending confirmation and offer reconciliation. A timeout/cancel is not proof that no effect occurred; 429/5xx alone do not authorize replay.
|
|
226
|
+
|
|
227
|
+
### Examples
|
|
228
|
+
Better: repeat the same key/intent and reuse the committed result. Worse: generate a new key after a payment timeout.
|
|
229
|
+
|
|
230
|
+
### Verification
|
|
231
|
+
Inject failure after commit but before response, replay concurrently and reject a changed intent; separate process-local tests from database or distributed guarantees.
|
|
232
|
+
|
|
233
|
+
### Sources
|
|
234
|
+
- [Timeouts, retries and backoff with jitter](https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/) (aws-retry)
|
|
235
|
+
- [Making retries safe with idempotent APIs](https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/) (aws-idempotency)
|
|
236
|
+
|
|
237
|
+
Case evidence IDs: EP-SVC-01, EP-UI-01. Identifiers are not cross-entry file dependencies; consult local examples and the coverage report for execution status.
|
package/skills/cc-electron-project-standard/references/common/engineering-practices.rules.json
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"rules": [
|
|
4
|
+
{
|
|
5
|
+
"id": "ENG-CONTRACT",
|
|
6
|
+
"kind": "core",
|
|
7
|
+
"level": "required",
|
|
8
|
+
"anchor": "ENG-CONTRACT",
|
|
9
|
+
"sourceIds": [
|
|
10
|
+
"typescript-publishing",
|
|
11
|
+
"rust-api"
|
|
12
|
+
],
|
|
13
|
+
"caseIds": [
|
|
14
|
+
"EP-TS-01",
|
|
15
|
+
"EP-SVC-01"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "ENG-ERROR",
|
|
20
|
+
"kind": "core",
|
|
21
|
+
"level": "required",
|
|
22
|
+
"anchor": "ENG-ERROR",
|
|
23
|
+
"sourceIds": [
|
|
24
|
+
"oracle-resources",
|
|
25
|
+
"uber-go"
|
|
26
|
+
],
|
|
27
|
+
"caseIds": [
|
|
28
|
+
"EP-RS-01",
|
|
29
|
+
"EP-JAVA-01"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "ENG-RESOURCE",
|
|
34
|
+
"kind": "core",
|
|
35
|
+
"level": "required",
|
|
36
|
+
"anchor": "ENG-RESOURCE",
|
|
37
|
+
"sourceIds": [
|
|
38
|
+
"cert-c",
|
|
39
|
+
"cpp-core"
|
|
40
|
+
],
|
|
41
|
+
"caseIds": [
|
|
42
|
+
"EP-C-01",
|
|
43
|
+
"EP-CPP-01",
|
|
44
|
+
"EP-PY-01"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "ENG-CONCURRENCY",
|
|
49
|
+
"kind": "core",
|
|
50
|
+
"level": "conditional",
|
|
51
|
+
"anchor": "ENG-CONCURRENCY",
|
|
52
|
+
"sourceIds": [
|
|
53
|
+
"go-context",
|
|
54
|
+
"tokio-join",
|
|
55
|
+
"python-asyncio"
|
|
56
|
+
],
|
|
57
|
+
"caseIds": [
|
|
58
|
+
"EP-GO-01",
|
|
59
|
+
"EP-IPC-01",
|
|
60
|
+
"EP-UI-01"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "ENG-BOUNDARY",
|
|
65
|
+
"kind": "core",
|
|
66
|
+
"level": "required",
|
|
67
|
+
"anchor": "ENG-BOUNDARY",
|
|
68
|
+
"sourceIds": [
|
|
69
|
+
"electron-security",
|
|
70
|
+
"tauri-permissions"
|
|
71
|
+
],
|
|
72
|
+
"caseIds": [
|
|
73
|
+
"EP-TS-01",
|
|
74
|
+
"EP-IPC-01"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id": "ENG-DEPENDENCY",
|
|
79
|
+
"kind": "core",
|
|
80
|
+
"level": "recommended",
|
|
81
|
+
"anchor": "ENG-DEPENDENCY",
|
|
82
|
+
"sourceIds": [
|
|
83
|
+
"typescript-publishing",
|
|
84
|
+
"google-review"
|
|
85
|
+
],
|
|
86
|
+
"caseIds": [
|
|
87
|
+
"EP-TS-01"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "ENG-VERIFICATION",
|
|
92
|
+
"kind": "core",
|
|
93
|
+
"level": "required",
|
|
94
|
+
"anchor": "ENG-VERIFICATION",
|
|
95
|
+
"sourceIds": [
|
|
96
|
+
"ms-playbook",
|
|
97
|
+
"ms-faults",
|
|
98
|
+
"google-review"
|
|
99
|
+
],
|
|
100
|
+
"caseIds": [
|
|
101
|
+
"EP-TS-01",
|
|
102
|
+
"EP-C-01",
|
|
103
|
+
"EP-SVC-01"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "ENG-OPERABILITY",
|
|
108
|
+
"kind": "core",
|
|
109
|
+
"level": "conditional",
|
|
110
|
+
"anchor": "ENG-OPERABILITY",
|
|
111
|
+
"sourceIds": [
|
|
112
|
+
"aws-retry",
|
|
113
|
+
"aws-idempotency"
|
|
114
|
+
],
|
|
115
|
+
"caseIds": [
|
|
116
|
+
"EP-SVC-01",
|
|
117
|
+
"EP-UI-01"
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|