universal-dev-standards 3.5.1-beta.1 → 3.5.1-beta.11
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/bin/uds.js +2 -0
- package/bundled/core/ai-instruction-standards.md +205 -0
- package/bundled/core/anti-hallucination.md +684 -0
- package/bundled/core/changelog-standards.md +556 -0
- package/bundled/core/checkin-standards.md +935 -0
- package/bundled/core/code-review-checklist.md +684 -0
- package/bundled/core/commit-message-guide.md +915 -0
- package/bundled/core/documentation-structure.md +1117 -0
- package/bundled/core/documentation-writing-standards.md +487 -0
- package/bundled/core/error-code-standards.md +382 -0
- package/bundled/core/git-workflow.md +859 -0
- package/bundled/core/logging-standards.md +323 -0
- package/bundled/core/project-structure.md +354 -0
- package/bundled/core/refactoring-standards.md +636 -0
- package/bundled/core/spec-driven-development.md +207 -0
- package/bundled/core/test-completeness-dimensions.md +536 -0
- package/bundled/core/test-driven-development.md +995 -0
- package/bundled/core/testing-standards.md +3061 -0
- package/bundled/core/versioning.md +902 -0
- package/bundled/locales/README.md +88 -0
- package/bundled/locales/zh-CN/CHANGELOG.md +705 -0
- package/bundled/locales/zh-CN/CLAUDE.md +213 -0
- package/bundled/locales/zh-CN/MAINTENANCE.md +689 -0
- package/bundled/locales/zh-CN/README.md +707 -0
- package/bundled/locales/zh-CN/STANDARDS-MAPPING.md +177 -0
- package/bundled/locales/zh-CN/adoption/ADOPTION-GUIDE.md +392 -0
- package/bundled/locales/zh-CN/adoption/STATIC-DYNAMIC-GUIDE.md +302 -0
- package/bundled/locales/zh-CN/adoption/checklists/enterprise.md +332 -0
- package/bundled/locales/zh-CN/adoption/checklists/minimal.md +141 -0
- package/bundled/locales/zh-CN/adoption/checklists/recommended.md +272 -0
- package/bundled/locales/zh-CN/ai/MAINTENANCE.md +739 -0
- package/bundled/locales/zh-CN/ai/options/changelog/auto-generated.ai.yaml +76 -0
- package/bundled/locales/zh-CN/ai/options/changelog/keep-a-changelog.ai.yaml +99 -0
- package/bundled/locales/zh-CN/ai/options/code-review/automated-review.ai.yaml +120 -0
- package/bundled/locales/zh-CN/ai/options/code-review/pair-programming.ai.yaml +109 -0
- package/bundled/locales/zh-CN/ai/options/code-review/pr-review.ai.yaml +104 -0
- package/bundled/locales/zh-CN/ai/options/commit-message/bilingual.ai.yaml +105 -0
- package/bundled/locales/zh-CN/ai/options/commit-message/english.ai.yaml +79 -0
- package/bundled/locales/zh-CN/ai/options/commit-message/traditional-chinese.ai.yaml +100 -0
- package/bundled/locales/zh-CN/ai/options/documentation/api-docs.ai.yaml +140 -0
- package/bundled/locales/zh-CN/ai/options/documentation/markdown-docs.ai.yaml +89 -0
- package/bundled/locales/zh-CN/ai/options/documentation/wiki-style.ai.yaml +119 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/gitflow.ai.yaml +133 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/github-flow.ai.yaml +73 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/merge-commit.ai.yaml +88 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/rebase-ff.ai.yaml +113 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/squash-merge.ai.yaml +85 -0
- package/bundled/locales/zh-CN/ai/options/git-workflow/trunk-based.ai.yaml +117 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/dotnet.ai.yaml +108 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/go.ai.yaml +115 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/java.ai.yaml +113 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/kotlin.ai.yaml +123 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/nodejs.ai.yaml +101 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/php.ai.yaml +147 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/python.ai.yaml +116 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/ruby.ai.yaml +140 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/rust.ai.yaml +117 -0
- package/bundled/locales/zh-CN/ai/options/project-structure/swift.ai.yaml +143 -0
- package/bundled/locales/zh-CN/ai/options/testing/contract-testing.ai.yaml +254 -0
- package/bundled/locales/zh-CN/ai/options/testing/e2e-testing.ai.yaml +116 -0
- package/bundled/locales/zh-CN/ai/options/testing/industry-pyramid.ai.yaml +144 -0
- package/bundled/locales/zh-CN/ai/options/testing/integration-testing.ai.yaml +90 -0
- package/bundled/locales/zh-CN/ai/options/testing/istqb-framework.ai.yaml +108 -0
- package/bundled/locales/zh-CN/ai/options/testing/performance-testing.ai.yaml +272 -0
- package/bundled/locales/zh-CN/ai/options/testing/security-testing.ai.yaml +160 -0
- package/bundled/locales/zh-CN/ai/options/testing/system-testing.ai.yaml +101 -0
- package/bundled/locales/zh-CN/ai/options/testing/unit-testing.ai.yaml +82 -0
- package/bundled/locales/zh-CN/ai/standards/anti-hallucination.ai.yaml +145 -0
- package/bundled/locales/zh-CN/ai/standards/changelog.ai.yaml +146 -0
- package/bundled/locales/zh-CN/ai/standards/checkin-standards.ai.yaml +170 -0
- package/bundled/locales/zh-CN/ai/standards/code-review.ai.yaml +148 -0
- package/bundled/locales/zh-CN/ai/standards/commit-message.ai.yaml +175 -0
- package/bundled/locales/zh-CN/ai/standards/documentation-structure.ai.yaml +124 -0
- package/bundled/locales/zh-CN/ai/standards/documentation-writing-standards.ai.yaml +190 -0
- package/bundled/locales/zh-CN/ai/standards/error-codes.ai.yaml +139 -0
- package/bundled/locales/zh-CN/ai/standards/git-workflow.ai.yaml +95 -0
- package/bundled/locales/zh-CN/ai/standards/logging.ai.yaml +128 -0
- package/bundled/locales/zh-CN/ai/standards/project-structure.ai.yaml +134 -0
- package/bundled/locales/zh-CN/ai/standards/spec-driven-development.ai.yaml +169 -0
- package/bundled/locales/zh-CN/ai/standards/test-completeness-dimensions.ai.yaml +220 -0
- package/bundled/locales/zh-CN/ai/standards/testing.ai.yaml +137 -0
- package/bundled/locales/zh-CN/ai/standards/versioning.ai.yaml +211 -0
- package/bundled/locales/zh-CN/core/ai-instruction-standards.md +213 -0
- package/bundled/locales/zh-CN/core/anti-hallucination.md +691 -0
- package/bundled/locales/zh-CN/core/changelog-standards.md +147 -0
- package/bundled/locales/zh-CN/core/checkin-standards.md +943 -0
- package/bundled/locales/zh-CN/core/code-review-guide.md +693 -0
- package/bundled/locales/zh-CN/core/commit-message-guide.md +129 -0
- package/bundled/locales/zh-CN/core/documentation-structure.md +173 -0
- package/bundled/locales/zh-CN/core/documentation-writing-standards.md +495 -0
- package/bundled/locales/zh-CN/core/error-code-standards.md +180 -0
- package/bundled/locales/zh-CN/core/git-workflow.md +193 -0
- package/bundled/locales/zh-CN/core/logging-standards.md +174 -0
- package/bundled/locales/zh-CN/core/project-structure.md +184 -0
- package/bundled/locales/zh-CN/core/refactoring-standards.md +642 -0
- package/bundled/locales/zh-CN/core/spec-driven-development.md +215 -0
- package/bundled/locales/zh-CN/core/test-completeness-dimensions.md +544 -0
- package/bundled/locales/zh-CN/core/test-driven-development.md +1002 -0
- package/bundled/locales/zh-CN/core/testing-standards.md +170 -0
- package/bundled/locales/zh-CN/core/versioning.md +177 -0
- package/bundled/locales/zh-CN/docs/AI-AGENT-ROADMAP.md +303 -0
- package/bundled/locales/zh-CN/docs/CLI-INIT-OPTIONS.md +990 -0
- package/bundled/locales/zh-CN/docs/OPERATION-WORKFLOW.md +1064 -0
- package/bundled/locales/zh-CN/docs/USAGE-MODES-COMPARISON.md +333 -0
- package/bundled/locales/zh-CN/docs/WINDOWS-GUIDE.md +215 -0
- package/bundled/locales/zh-CN/integrations/codex/AGENTS.md +115 -0
- package/bundled/locales/zh-CN/integrations/codex/README.md +67 -0
- package/bundled/locales/zh-CN/integrations/gemini-cli/GEMINI.md +102 -0
- package/bundled/locales/zh-CN/integrations/gemini-cli/README.md +140 -0
- package/bundled/locales/zh-CN/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +269 -0
- package/bundled/locales/zh-CN/integrations/github-copilot/README.md +167 -0
- package/bundled/locales/zh-CN/integrations/github-copilot/copilot-instructions.md +263 -0
- package/bundled/locales/zh-CN/integrations/github-copilot/skills-mapping.md +192 -0
- package/bundled/locales/zh-CN/integrations/google-antigravity/INSTRUCTIONS.md +61 -0
- package/bundled/locales/zh-CN/integrations/google-antigravity/README.md +84 -0
- package/bundled/locales/zh-CN/integrations/opencode/AGENTS.md +111 -0
- package/bundled/locales/zh-CN/integrations/opencode/README.md +176 -0
- package/bundled/locales/zh-CN/integrations/opencode/skills-mapping.md +396 -0
- package/bundled/locales/zh-CN/integrations/openspec/AGENTS.md +301 -0
- package/bundled/locales/zh-CN/integrations/openspec/README.md +43 -0
- package/bundled/locales/zh-CN/integrations/spec-kit/AGENTS.md +184 -0
- package/bundled/locales/zh-CN/integrations/spec-kit/README.md +43 -0
- package/bundled/locales/zh-CN/options/commit-message/bilingual.md +161 -0
- package/bundled/locales/zh-CN/options/commit-message/english.md +137 -0
- package/bundled/locales/zh-CN/options/commit-message/traditional-chinese.md +162 -0
- package/bundled/locales/zh-CN/options/git-workflow/gitflow.md +147 -0
- package/bundled/locales/zh-CN/options/git-workflow/github-flow.md +124 -0
- package/bundled/locales/zh-CN/options/git-workflow/merge-commit.md +124 -0
- package/bundled/locales/zh-CN/options/git-workflow/rebase-ff.md +160 -0
- package/bundled/locales/zh-CN/options/git-workflow/squash-merge.md +117 -0
- package/bundled/locales/zh-CN/options/git-workflow/trunk-based.md +125 -0
- package/bundled/locales/zh-CN/options/project-structure/dotnet.md +183 -0
- package/bundled/locales/zh-CN/options/project-structure/go.md +226 -0
- package/bundled/locales/zh-CN/options/project-structure/java.md +213 -0
- package/bundled/locales/zh-CN/options/project-structure/nodejs.md +185 -0
- package/bundled/locales/zh-CN/options/project-structure/python.md +229 -0
- package/bundled/locales/zh-CN/options/testing/e2e-testing.md +207 -0
- package/bundled/locales/zh-CN/options/testing/integration-testing.md +230 -0
- package/bundled/locales/zh-CN/options/testing/system-testing.md +183 -0
- package/bundled/locales/zh-CN/options/testing/unit-testing.md +165 -0
- package/bundled/locales/zh-CN/skills/INTEGRATION-GUIDE.md +218 -0
- package/bundled/locales/zh-CN/skills/README.md +134 -0
- package/bundled/locales/zh-CN/skills/_shared/README.md +68 -0
- package/bundled/locales/zh-CN/skills/claude-code/CONTRIBUTING.template.md +151 -0
- package/bundled/locales/zh-CN/skills/claude-code/README.md +174 -0
- package/bundled/locales/zh-CN/skills/claude-code/ai-collaboration-standards/SKILL.md +175 -0
- package/bundled/locales/zh-CN/skills/claude-code/ai-collaboration-standards/anti-hallucination.md +223 -0
- package/bundled/locales/zh-CN/skills/claude-code/ai-collaboration-standards/certainty-labels.md +132 -0
- package/bundled/locales/zh-CN/skills/claude-code/changelog-guide/SKILL.md +237 -0
- package/bundled/locales/zh-CN/skills/claude-code/checkin-assistant/SKILL.md +407 -0
- package/bundled/locales/zh-CN/skills/claude-code/code-review-assistant/SKILL.md +154 -0
- package/bundled/locales/zh-CN/skills/claude-code/code-review-assistant/checkin-checklist.md +257 -0
- package/bundled/locales/zh-CN/skills/claude-code/code-review-assistant/review-checklist.md +246 -0
- package/bundled/locales/zh-CN/skills/claude-code/commands/bdd.md +142 -0
- package/bundled/locales/zh-CN/skills/claude-code/commands/methodology.md +274 -0
- package/bundled/locales/zh-CN/skills/claude-code/commit-standards/SKILL.md +191 -0
- package/bundled/locales/zh-CN/skills/claude-code/commit-standards/conventional-commits.md +264 -0
- package/bundled/locales/zh-CN/skills/claude-code/commit-standards/language-options.md +172 -0
- package/bundled/locales/zh-CN/skills/claude-code/documentation-guide/SKILL.md +421 -0
- package/bundled/locales/zh-CN/skills/claude-code/documentation-guide/documentation-structure.md +357 -0
- package/bundled/locales/zh-CN/skills/claude-code/documentation-guide/readme-template.md +412 -0
- package/bundled/locales/zh-CN/skills/claude-code/error-code-guide/SKILL.md +269 -0
- package/bundled/locales/zh-CN/skills/claude-code/git-workflow-guide/SKILL.md +218 -0
- package/bundled/locales/zh-CN/skills/claude-code/git-workflow-guide/branch-naming.md +220 -0
- package/bundled/locales/zh-CN/skills/claude-code/git-workflow-guide/git-workflow.md +321 -0
- package/bundled/locales/zh-CN/skills/claude-code/logging-guide/SKILL.md +285 -0
- package/bundled/locales/zh-CN/skills/claude-code/methodology-system/SKILL.md +131 -0
- package/bundled/locales/zh-CN/skills/claude-code/methodology-system/create-methodology.md +350 -0
- package/bundled/locales/zh-CN/skills/claude-code/methodology-system/runtime.md +279 -0
- package/bundled/locales/zh-CN/skills/claude-code/project-structure-guide/SKILL.md +143 -0
- package/bundled/locales/zh-CN/skills/claude-code/project-structure-guide/language-patterns.md +271 -0
- package/bundled/locales/zh-CN/skills/claude-code/refactoring-assistant/SKILL.md +162 -0
- package/bundled/locales/zh-CN/skills/claude-code/release-standards/SKILL.md +191 -0
- package/bundled/locales/zh-CN/skills/claude-code/release-standards/changelog-format.md +247 -0
- package/bundled/locales/zh-CN/skills/claude-code/release-standards/release-workflow.md +345 -0
- package/bundled/locales/zh-CN/skills/claude-code/release-standards/semantic-versioning.md +250 -0
- package/bundled/locales/zh-CN/skills/claude-code/requirement-assistant/SKILL.md +227 -0
- package/bundled/locales/zh-CN/skills/claude-code/requirement-assistant/requirement-checklist.md +325 -0
- package/bundled/locales/zh-CN/skills/claude-code/requirement-assistant/requirement-writing.md +399 -0
- package/bundled/locales/zh-CN/skills/claude-code/spec-driven-dev/SKILL.md +243 -0
- package/bundled/locales/zh-CN/skills/claude-code/tdd-assistant/SKILL.md +332 -0
- package/bundled/locales/zh-CN/skills/claude-code/tdd-assistant/language-examples.md +639 -0
- package/bundled/locales/zh-CN/skills/claude-code/tdd-assistant/tdd-workflow.md +486 -0
- package/bundled/locales/zh-CN/skills/claude-code/test-coverage-assistant/SKILL.md +282 -0
- package/bundled/locales/zh-CN/skills/claude-code/testing-guide/SKILL.md +234 -0
- package/bundled/locales/zh-CN/skills/claude-code/testing-guide/testing-pyramid.md +448 -0
- package/bundled/locales/zh-CN/skills/cline/README.md +58 -0
- package/bundled/locales/zh-CN/skills/copilot/README.md +61 -0
- package/bundled/locales/zh-CN/skills/copilot/copilot-instructions.md +79 -0
- package/bundled/locales/zh-CN/skills/cursor/README.md +58 -0
- package/bundled/locales/zh-CN/skills/windsurf/README.md +59 -0
- package/bundled/locales/zh-TW/CHANGELOG.md +707 -0
- package/bundled/locales/zh-TW/CLAUDE.md +213 -0
- package/bundled/locales/zh-TW/MAINTENANCE.md +683 -0
- package/bundled/locales/zh-TW/README.md +687 -0
- package/bundled/locales/zh-TW/STANDARDS-MAPPING.md +177 -0
- package/bundled/locales/zh-TW/adoption/ADOPTION-GUIDE.md +392 -0
- package/bundled/locales/zh-TW/adoption/STATIC-DYNAMIC-GUIDE.md +299 -0
- package/bundled/locales/zh-TW/adoption/checklists/enterprise.md +332 -0
- package/bundled/locales/zh-TW/adoption/checklists/minimal.md +141 -0
- package/bundled/locales/zh-TW/adoption/checklists/recommended.md +272 -0
- package/bundled/locales/zh-TW/ai/MAINTENANCE.md +754 -0
- package/bundled/locales/zh-TW/ai/options/changelog/auto-generated.ai.yaml +76 -0
- package/bundled/locales/zh-TW/ai/options/changelog/keep-a-changelog.ai.yaml +99 -0
- package/bundled/locales/zh-TW/ai/options/code-review/automated-review.ai.yaml +120 -0
- package/bundled/locales/zh-TW/ai/options/code-review/pair-programming.ai.yaml +109 -0
- package/bundled/locales/zh-TW/ai/options/code-review/pr-review.ai.yaml +104 -0
- package/bundled/locales/zh-TW/ai/options/commit-message/bilingual.ai.yaml +105 -0
- package/bundled/locales/zh-TW/ai/options/commit-message/english.ai.yaml +79 -0
- package/bundled/locales/zh-TW/ai/options/commit-message/traditional-chinese.ai.yaml +100 -0
- package/bundled/locales/zh-TW/ai/options/documentation/api-docs.ai.yaml +140 -0
- package/bundled/locales/zh-TW/ai/options/documentation/markdown-docs.ai.yaml +89 -0
- package/bundled/locales/zh-TW/ai/options/documentation/wiki-style.ai.yaml +119 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/gitflow.ai.yaml +133 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/github-flow.ai.yaml +73 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/merge-commit.ai.yaml +88 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/rebase-ff.ai.yaml +113 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/squash-merge.ai.yaml +85 -0
- package/bundled/locales/zh-TW/ai/options/git-workflow/trunk-based.ai.yaml +117 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/dotnet.ai.yaml +108 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/go.ai.yaml +115 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/java.ai.yaml +113 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/kotlin.ai.yaml +123 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/nodejs.ai.yaml +101 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/php.ai.yaml +147 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/python.ai.yaml +116 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/ruby.ai.yaml +140 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/rust.ai.yaml +117 -0
- package/bundled/locales/zh-TW/ai/options/project-structure/swift.ai.yaml +143 -0
- package/bundled/locales/zh-TW/ai/options/testing/contract-testing.ai.yaml +254 -0
- package/bundled/locales/zh-TW/ai/options/testing/e2e-testing.ai.yaml +116 -0
- package/bundled/locales/zh-TW/ai/options/testing/industry-pyramid.ai.yaml +144 -0
- package/bundled/locales/zh-TW/ai/options/testing/integration-testing.ai.yaml +90 -0
- package/bundled/locales/zh-TW/ai/options/testing/istqb-framework.ai.yaml +108 -0
- package/bundled/locales/zh-TW/ai/options/testing/performance-testing.ai.yaml +272 -0
- package/bundled/locales/zh-TW/ai/options/testing/security-testing.ai.yaml +160 -0
- package/bundled/locales/zh-TW/ai/options/testing/system-testing.ai.yaml +101 -0
- package/bundled/locales/zh-TW/ai/options/testing/unit-testing.ai.yaml +82 -0
- package/bundled/locales/zh-TW/ai/standards/anti-hallucination.ai.yaml +145 -0
- package/bundled/locales/zh-TW/ai/standards/changelog.ai.yaml +146 -0
- package/bundled/locales/zh-TW/ai/standards/checkin-standards.ai.yaml +170 -0
- package/bundled/locales/zh-TW/ai/standards/code-review.ai.yaml +148 -0
- package/bundled/locales/zh-TW/ai/standards/commit-message.ai.yaml +175 -0
- package/bundled/locales/zh-TW/ai/standards/documentation-structure.ai.yaml +124 -0
- package/bundled/locales/zh-TW/ai/standards/documentation-writing-standards.ai.yaml +190 -0
- package/bundled/locales/zh-TW/ai/standards/error-codes.ai.yaml +139 -0
- package/bundled/locales/zh-TW/ai/standards/git-workflow.ai.yaml +95 -0
- package/bundled/locales/zh-TW/ai/standards/logging.ai.yaml +128 -0
- package/bundled/locales/zh-TW/ai/standards/project-structure.ai.yaml +134 -0
- package/bundled/locales/zh-TW/ai/standards/spec-driven-development.ai.yaml +169 -0
- package/bundled/locales/zh-TW/ai/standards/test-completeness-dimensions.ai.yaml +220 -0
- package/bundled/locales/zh-TW/ai/standards/testing.ai.yaml +137 -0
- package/bundled/locales/zh-TW/ai/standards/versioning.ai.yaml +211 -0
- package/bundled/locales/zh-TW/core/ai-instruction-standards.md +213 -0
- package/bundled/locales/zh-TW/core/anti-hallucination.md +691 -0
- package/bundled/locales/zh-TW/core/changelog-standards.md +564 -0
- package/bundled/locales/zh-TW/core/checkin-standards.md +943 -0
- package/bundled/locales/zh-TW/core/code-review-checklist.md +693 -0
- package/bundled/locales/zh-TW/core/commit-message-guide.md +809 -0
- package/bundled/locales/zh-TW/core/documentation-structure.md +1125 -0
- package/bundled/locales/zh-TW/core/documentation-writing-standards.md +495 -0
- package/bundled/locales/zh-TW/core/error-code-standards.md +384 -0
- package/bundled/locales/zh-TW/core/git-workflow.md +860 -0
- package/bundled/locales/zh-TW/core/logging-standards.md +325 -0
- package/bundled/locales/zh-TW/core/project-structure.md +362 -0
- package/bundled/locales/zh-TW/core/refactoring-standards.md +642 -0
- package/bundled/locales/zh-TW/core/spec-driven-development.md +215 -0
- package/bundled/locales/zh-TW/core/test-completeness-dimensions.md +544 -0
- package/bundled/locales/zh-TW/core/test-driven-development.md +1004 -0
- package/bundled/locales/zh-TW/core/testing-standards.md +2158 -0
- package/bundled/locales/zh-TW/core/versioning.md +909 -0
- package/bundled/locales/zh-TW/docs/AI-AGENT-ROADMAP.md +303 -0
- package/bundled/locales/zh-TW/docs/CLI-INIT-OPTIONS.md +990 -0
- package/bundled/locales/zh-TW/docs/OPERATION-WORKFLOW.md +1064 -0
- package/bundled/locales/zh-TW/docs/USAGE-MODES-COMPARISON.md +333 -0
- package/bundled/locales/zh-TW/docs/WINDOWS-GUIDE.md +215 -0
- package/bundled/locales/zh-TW/integrations/codex/AGENTS.md +115 -0
- package/bundled/locales/zh-TW/integrations/codex/README.md +113 -0
- package/bundled/locales/zh-TW/integrations/gemini-cli/GEMINI.md +102 -0
- package/bundled/locales/zh-TW/integrations/gemini-cli/README.md +140 -0
- package/bundled/locales/zh-TW/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +269 -0
- package/bundled/locales/zh-TW/integrations/github-copilot/README.md +167 -0
- package/bundled/locales/zh-TW/integrations/github-copilot/copilot-instructions.md +263 -0
- package/bundled/locales/zh-TW/integrations/github-copilot/skills-mapping.md +192 -0
- package/bundled/locales/zh-TW/integrations/google-antigravity/INSTRUCTIONS.md +61 -0
- package/bundled/locales/zh-TW/integrations/google-antigravity/README.md +84 -0
- package/bundled/locales/zh-TW/integrations/opencode/AGENTS.md +111 -0
- package/bundled/locales/zh-TW/integrations/opencode/README.md +176 -0
- package/bundled/locales/zh-TW/integrations/opencode/skills-mapping.md +396 -0
- package/bundled/locales/zh-TW/integrations/openspec/AGENTS.md +301 -0
- package/bundled/locales/zh-TW/integrations/openspec/README.md +43 -0
- package/bundled/locales/zh-TW/integrations/spec-kit/AGENTS.md +184 -0
- package/bundled/locales/zh-TW/integrations/spec-kit/README.md +43 -0
- package/bundled/locales/zh-TW/options/commit-message/bilingual.md +161 -0
- package/bundled/locales/zh-TW/options/commit-message/english.md +137 -0
- package/bundled/locales/zh-TW/options/commit-message/traditional-chinese.md +162 -0
- package/bundled/locales/zh-TW/options/git-workflow/gitflow.md +147 -0
- package/bundled/locales/zh-TW/options/git-workflow/github-flow.md +124 -0
- package/bundled/locales/zh-TW/options/git-workflow/merge-commit.md +124 -0
- package/bundled/locales/zh-TW/options/git-workflow/rebase-ff.md +160 -0
- package/bundled/locales/zh-TW/options/git-workflow/squash-merge.md +117 -0
- package/bundled/locales/zh-TW/options/git-workflow/trunk-based.md +125 -0
- package/bundled/locales/zh-TW/options/project-structure/dotnet.md +183 -0
- package/bundled/locales/zh-TW/options/project-structure/go.md +226 -0
- package/bundled/locales/zh-TW/options/project-structure/java.md +213 -0
- package/bundled/locales/zh-TW/options/project-structure/nodejs.md +185 -0
- package/bundled/locales/zh-TW/options/project-structure/python.md +229 -0
- package/bundled/locales/zh-TW/options/testing/e2e-testing.md +207 -0
- package/bundled/locales/zh-TW/options/testing/integration-testing.md +230 -0
- package/bundled/locales/zh-TW/options/testing/system-testing.md +183 -0
- package/bundled/locales/zh-TW/options/testing/unit-testing.md +165 -0
- package/bundled/locales/zh-TW/skills/INTEGRATION-GUIDE.md +218 -0
- package/bundled/locales/zh-TW/skills/README.md +132 -0
- package/bundled/locales/zh-TW/skills/_shared/README.md +68 -0
- package/bundled/locales/zh-TW/skills/claude-code/CONTRIBUTING.template.md +151 -0
- package/bundled/locales/zh-TW/skills/claude-code/README.md +174 -0
- package/bundled/locales/zh-TW/skills/claude-code/ai-collaboration-standards/SKILL.md +175 -0
- package/bundled/locales/zh-TW/skills/claude-code/ai-collaboration-standards/anti-hallucination.md +223 -0
- package/bundled/locales/zh-TW/skills/claude-code/ai-collaboration-standards/certainty-labels.md +132 -0
- package/bundled/locales/zh-TW/skills/claude-code/changelog-guide/SKILL.md +237 -0
- package/bundled/locales/zh-TW/skills/claude-code/checkin-assistant/SKILL.md +407 -0
- package/bundled/locales/zh-TW/skills/claude-code/code-review-assistant/SKILL.md +154 -0
- package/bundled/locales/zh-TW/skills/claude-code/code-review-assistant/checkin-checklist.md +257 -0
- package/bundled/locales/zh-TW/skills/claude-code/code-review-assistant/review-checklist.md +246 -0
- package/bundled/locales/zh-TW/skills/claude-code/commands/bdd.md +142 -0
- package/bundled/locales/zh-TW/skills/claude-code/commands/methodology.md +274 -0
- package/bundled/locales/zh-TW/skills/claude-code/commit-standards/SKILL.md +191 -0
- package/bundled/locales/zh-TW/skills/claude-code/commit-standards/conventional-commits.md +264 -0
- package/bundled/locales/zh-TW/skills/claude-code/commit-standards/language-options.md +172 -0
- package/bundled/locales/zh-TW/skills/claude-code/documentation-guide/SKILL.md +421 -0
- package/bundled/locales/zh-TW/skills/claude-code/documentation-guide/documentation-structure.md +357 -0
- package/bundled/locales/zh-TW/skills/claude-code/documentation-guide/readme-template.md +412 -0
- package/bundled/locales/zh-TW/skills/claude-code/error-code-guide/SKILL.md +269 -0
- package/bundled/locales/zh-TW/skills/claude-code/git-workflow-guide/SKILL.md +218 -0
- package/bundled/locales/zh-TW/skills/claude-code/git-workflow-guide/branch-naming.md +220 -0
- package/bundled/locales/zh-TW/skills/claude-code/git-workflow-guide/git-workflow.md +321 -0
- package/bundled/locales/zh-TW/skills/claude-code/logging-guide/SKILL.md +285 -0
- package/bundled/locales/zh-TW/skills/claude-code/methodology-system/SKILL.md +131 -0
- package/bundled/locales/zh-TW/skills/claude-code/methodology-system/create-methodology.md +350 -0
- package/bundled/locales/zh-TW/skills/claude-code/methodology-system/runtime.md +279 -0
- package/bundled/locales/zh-TW/skills/claude-code/project-structure-guide/SKILL.md +143 -0
- package/bundled/locales/zh-TW/skills/claude-code/project-structure-guide/language-patterns.md +271 -0
- package/bundled/locales/zh-TW/skills/claude-code/refactoring-assistant/SKILL.md +162 -0
- package/bundled/locales/zh-TW/skills/claude-code/release-standards/SKILL.md +191 -0
- package/bundled/locales/zh-TW/skills/claude-code/release-standards/changelog-format.md +247 -0
- package/bundled/locales/zh-TW/skills/claude-code/release-standards/release-workflow.md +345 -0
- package/bundled/locales/zh-TW/skills/claude-code/release-standards/semantic-versioning.md +250 -0
- package/bundled/locales/zh-TW/skills/claude-code/requirement-assistant/SKILL.md +227 -0
- package/bundled/locales/zh-TW/skills/claude-code/requirement-assistant/requirement-checklist.md +325 -0
- package/bundled/locales/zh-TW/skills/claude-code/requirement-assistant/requirement-writing.md +399 -0
- package/bundled/locales/zh-TW/skills/claude-code/spec-driven-dev/SKILL.md +243 -0
- package/bundled/locales/zh-TW/skills/claude-code/tdd-assistant/SKILL.md +332 -0
- package/bundled/locales/zh-TW/skills/claude-code/tdd-assistant/language-examples.md +639 -0
- package/bundled/locales/zh-TW/skills/claude-code/tdd-assistant/tdd-workflow.md +486 -0
- package/bundled/locales/zh-TW/skills/claude-code/test-coverage-assistant/SKILL.md +282 -0
- package/bundled/locales/zh-TW/skills/claude-code/testing-guide/SKILL.md +234 -0
- package/bundled/locales/zh-TW/skills/claude-code/testing-guide/testing-pyramid.md +448 -0
- package/bundled/locales/zh-TW/skills/cline/README.md +58 -0
- package/bundled/locales/zh-TW/skills/copilot/README.md +61 -0
- package/bundled/locales/zh-TW/skills/copilot/copilot-instructions.md +79 -0
- package/bundled/locales/zh-TW/skills/cursor/README.md +58 -0
- package/bundled/locales/zh-TW/skills/windsurf/README.md +59 -0
- package/bundled/skills/claude-code/CONTRIBUTING.template.md +141 -0
- package/bundled/skills/claude-code/README.md +196 -0
- package/bundled/skills/claude-code/ai/standards/checkin.ai.yaml +21 -0
- package/bundled/skills/claude-code/ai/standards/commit.ai.yaml +20 -0
- package/bundled/skills/claude-code/ai/standards/refactoring.ai.yaml +34 -0
- package/bundled/skills/claude-code/ai/standards/testing.ai.yaml +41 -0
- package/bundled/skills/claude-code/ai-collaboration-standards/SKILL.md +175 -0
- package/bundled/skills/claude-code/ai-collaboration-standards/anti-hallucination.md +215 -0
- package/bundled/skills/claude-code/ai-collaboration-standards/certainty-labels.md +124 -0
- package/bundled/skills/claude-code/changelog-guide/SKILL.md +232 -0
- package/bundled/skills/claude-code/checkin-assistant/SKILL.md +402 -0
- package/bundled/skills/claude-code/code-review-assistant/SKILL.md +220 -0
- package/bundled/skills/claude-code/code-review-assistant/checkin-checklist.md +249 -0
- package/bundled/skills/claude-code/code-review-assistant/review-checklist.md +238 -0
- package/bundled/skills/claude-code/commands/README.md +78 -0
- package/bundled/skills/claude-code/commands/bdd.md +142 -0
- package/bundled/skills/claude-code/commands/changelog.md +57 -0
- package/bundled/skills/claude-code/commands/check.md +91 -0
- package/bundled/skills/claude-code/commands/commit.md +48 -0
- package/bundled/skills/claude-code/commands/config.md +97 -0
- package/bundled/skills/claude-code/commands/coverage.md +58 -0
- package/bundled/skills/claude-code/commands/docs.md +75 -0
- package/bundled/skills/claude-code/commands/init.md +88 -0
- package/bundled/skills/claude-code/commands/methodology.md +268 -0
- package/bundled/skills/claude-code/commands/release.md +50 -0
- package/bundled/skills/claude-code/commands/requirement.md +54 -0
- package/bundled/skills/claude-code/commands/review.md +50 -0
- package/bundled/skills/claude-code/commands/spec.md +69 -0
- package/bundled/skills/claude-code/commands/tdd.md +86 -0
- package/bundled/skills/claude-code/commands/update.md +122 -0
- package/bundled/skills/claude-code/commit-standards/SKILL.md +249 -0
- package/bundled/skills/claude-code/commit-standards/conventional-commits.md +256 -0
- package/bundled/skills/claude-code/commit-standards/language-options.md +164 -0
- package/bundled/skills/claude-code/documentation-guide/SKILL.md +416 -0
- package/bundled/skills/claude-code/documentation-guide/documentation-structure.md +349 -0
- package/bundled/skills/claude-code/documentation-guide/readme-template.md +404 -0
- package/bundled/skills/claude-code/error-code-guide/SKILL.md +264 -0
- package/bundled/skills/claude-code/git-workflow-guide/SKILL.md +226 -0
- package/bundled/skills/claude-code/git-workflow-guide/branch-naming.md +212 -0
- package/bundled/skills/claude-code/git-workflow-guide/git-workflow.md +313 -0
- package/bundled/skills/claude-code/logging-guide/SKILL.md +280 -0
- package/bundled/skills/claude-code/methodology-system/SKILL.md +215 -0
- package/bundled/skills/claude-code/methodology-system/create-methodology.md +450 -0
- package/bundled/skills/claude-code/methodology-system/runtime.md +271 -0
- package/bundled/skills/claude-code/project-structure-guide/SKILL.md +143 -0
- package/bundled/skills/claude-code/project-structure-guide/language-patterns.md +263 -0
- package/bundled/skills/claude-code/refactoring-assistant/SKILL.md +205 -0
- package/bundled/skills/claude-code/release-standards/SKILL.md +191 -0
- package/bundled/skills/claude-code/release-standards/changelog-format.md +239 -0
- package/bundled/skills/claude-code/release-standards/release-workflow.md +337 -0
- package/bundled/skills/claude-code/release-standards/semantic-versioning.md +242 -0
- package/bundled/skills/claude-code/requirement-assistant/SKILL.md +222 -0
- package/bundled/skills/claude-code/requirement-assistant/requirement-checklist.md +317 -0
- package/bundled/skills/claude-code/requirement-assistant/requirement-writing.md +391 -0
- package/bundled/skills/claude-code/spec-driven-dev/SKILL.md +238 -0
- package/bundled/skills/claude-code/tdd-assistant/SKILL.md +384 -0
- package/bundled/skills/claude-code/tdd-assistant/language-examples.md +1276 -0
- package/bundled/skills/claude-code/tdd-assistant/tdd-workflow.md +659 -0
- package/bundled/skills/claude-code/test-coverage-assistant/SKILL.md +277 -0
- package/bundled/skills/claude-code/testing-guide/SKILL.md +317 -0
- package/bundled/skills/claude-code/testing-guide/testing-pyramid.md +440 -0
- package/package.json +4 -2
- package/src/commands/check.js +38 -6
- package/src/commands/init.js +20 -6
- package/src/commands/list.js +7 -2
- package/src/commands/skills.js +0 -2
- package/src/commands/update.js +271 -0
- package/src/i18n/messages.js +161 -11
- package/src/utils/copier.js +63 -10
- package/src/utils/skills-installer.js +47 -11
- package/standards-registry.json +6 -3
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/logging-standards.md
|
|
3
|
+
source_version: 1.1.0
|
|
4
|
+
translation_version: 1.1.0
|
|
5
|
+
last_synced: 2026-01-05
|
|
6
|
+
status: current
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 日誌標準
|
|
10
|
+
|
|
11
|
+
> 版本: 1.1.0 | 最後更新: 2026-01-05
|
|
12
|
+
|
|
13
|
+
## 概述
|
|
14
|
+
|
|
15
|
+
本文件定義日誌標準,確保所有環境中的應用程式日誌具有一致性、結構化且可操作。
|
|
16
|
+
|
|
17
|
+
## 日誌等級
|
|
18
|
+
|
|
19
|
+
### 標準日誌等級
|
|
20
|
+
|
|
21
|
+
| 等級 | 代碼 | 使用時機 | 生產環境 |
|
|
22
|
+
|------|------|---------|---------|
|
|
23
|
+
| TRACE | 10 | 非常詳細的除錯資訊 | 關閉 |
|
|
24
|
+
| DEBUG | 20 | 詳細的除錯資訊 | 關閉 |
|
|
25
|
+
| INFO | 30 | 正常操作事件 | 開啟 |
|
|
26
|
+
| WARN | 40 | 潛在問題、可恢復的錯誤 | 開啟 |
|
|
27
|
+
| ERROR | 50 | 需要關注的錯誤 | 開啟 |
|
|
28
|
+
| FATAL | 60 | 關鍵故障、應用程式終止 | 開啟 |
|
|
29
|
+
|
|
30
|
+
### 等級選擇指南
|
|
31
|
+
|
|
32
|
+
**TRACE**: 用於非常詳細的診斷輸出
|
|
33
|
+
- 函數進入/退出
|
|
34
|
+
- 迴圈迭代
|
|
35
|
+
- 除錯時的變數值
|
|
36
|
+
|
|
37
|
+
**DEBUG**: 用於診斷資訊
|
|
38
|
+
- 狀態變更
|
|
39
|
+
- 設定值
|
|
40
|
+
- 查詢參數
|
|
41
|
+
|
|
42
|
+
**INFO**: 用於正常操作事件
|
|
43
|
+
- 應用程式啟動/關閉
|
|
44
|
+
- 使用者操作完成
|
|
45
|
+
- 排程任務執行
|
|
46
|
+
- 外部服務呼叫完成
|
|
47
|
+
|
|
48
|
+
**WARN**: 用於潛在問題
|
|
49
|
+
- 已棄用的 API 使用
|
|
50
|
+
- 重試嘗試
|
|
51
|
+
- 資源接近限制
|
|
52
|
+
- 觸發後備行為
|
|
53
|
+
|
|
54
|
+
**ERROR**: 用於需要關注的錯誤
|
|
55
|
+
- 需要調查的失敗操作
|
|
56
|
+
- 有影響的已捕獲例外
|
|
57
|
+
- 整合失敗
|
|
58
|
+
- 資料驗證失敗
|
|
59
|
+
|
|
60
|
+
**FATAL**: 用於關鍵故障
|
|
61
|
+
- 無法恢復的錯誤
|
|
62
|
+
- 啟動失敗
|
|
63
|
+
- 關鍵資源遺失
|
|
64
|
+
|
|
65
|
+
## 結構化日誌
|
|
66
|
+
|
|
67
|
+
### 必要欄位
|
|
68
|
+
|
|
69
|
+
所有日誌條目應包含:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"timestamp": "2025-01-15T10:30:00.123Z",
|
|
74
|
+
"level": "INFO",
|
|
75
|
+
"message": "使用者登入成功",
|
|
76
|
+
"service": "auth-service",
|
|
77
|
+
"environment": "production"
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 建議欄位
|
|
82
|
+
|
|
83
|
+
加入情境相關欄位:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"timestamp": "2025-01-15T10:30:00.123Z",
|
|
88
|
+
"level": "INFO",
|
|
89
|
+
"message": "使用者登入成功",
|
|
90
|
+
"service": "auth-service",
|
|
91
|
+
"environment": "production",
|
|
92
|
+
"trace_id": "abc123",
|
|
93
|
+
"span_id": "def456",
|
|
94
|
+
"user_id": "usr_12345",
|
|
95
|
+
"request_id": "req_67890",
|
|
96
|
+
"duration_ms": 150,
|
|
97
|
+
"http_method": "POST",
|
|
98
|
+
"http_path": "/api/v1/login",
|
|
99
|
+
"http_status": 200
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 欄位命名慣例
|
|
104
|
+
|
|
105
|
+
- 欄位名稱使用 `snake_case`
|
|
106
|
+
- 跨服務使用一致的名稱
|
|
107
|
+
- 加上領域前綴:`http_`、`db_`、`queue_`
|
|
108
|
+
|
|
109
|
+
| 領域 | 常用欄位 |
|
|
110
|
+
|------|---------|
|
|
111
|
+
| HTTP | http_method, http_path, http_status, http_duration_ms |
|
|
112
|
+
| 資料庫 | db_query_type, db_table, db_duration_ms, db_rows_affected |
|
|
113
|
+
| 佇列 | queue_name, queue_message_id, queue_delay_ms |
|
|
114
|
+
| 使用者 | user_id, user_role, user_action |
|
|
115
|
+
| 請求 | request_id, trace_id, span_id |
|
|
116
|
+
|
|
117
|
+
## 敏感資料處理
|
|
118
|
+
|
|
119
|
+
### 絕不記錄
|
|
120
|
+
|
|
121
|
+
- 密碼或機密
|
|
122
|
+
- API 金鑰或令牌
|
|
123
|
+
- 信用卡號碼
|
|
124
|
+
- 身分證字號
|
|
125
|
+
- 完整的驗證令牌
|
|
126
|
+
|
|
127
|
+
### 遮罩或編輯
|
|
128
|
+
|
|
129
|
+
```javascript
|
|
130
|
+
// 錯誤
|
|
131
|
+
logger.info('登入嘗試', { password: userPassword });
|
|
132
|
+
|
|
133
|
+
// 正確
|
|
134
|
+
logger.info('登入嘗試', { password: '***REDACTED***' });
|
|
135
|
+
|
|
136
|
+
// 正確 - 部分遮罩
|
|
137
|
+
logger.info('卡片已處理', { last_four: '4242' });
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 個人識別資訊 (PII) 處理
|
|
141
|
+
|
|
142
|
+
- 盡可能記錄使用者 ID,而非電子郵件地址
|
|
143
|
+
- 對敏感查詢使用雜湊識別碼
|
|
144
|
+
- 設定資料保留政策
|
|
145
|
+
|
|
146
|
+
## 日誌格式標準
|
|
147
|
+
|
|
148
|
+
### JSON 格式(建議用於生產環境)
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{"timestamp":"2025-01-15T10:30:00.123Z","level":"INFO","message":"請求完成","request_id":"req_123","duration_ms":45}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 人類可讀格式(開發環境)
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
2025-01-15T10:30:00.123Z [INFO] 請求完成 request_id=req_123 duration_ms=45
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 多行訊息
|
|
161
|
+
|
|
162
|
+
對於堆疊追蹤或大型資料:
|
|
163
|
+
- 主日誌條目保持單行
|
|
164
|
+
- 將堆疊追蹤包含在 `stack` 欄位中
|
|
165
|
+
- 使用 `...(truncated)` 截斷大型資料
|
|
166
|
+
|
|
167
|
+
## 錯誤日誌
|
|
168
|
+
|
|
169
|
+
### 必要錯誤欄位
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"level": "ERROR",
|
|
174
|
+
"message": "資料庫連線失敗",
|
|
175
|
+
"error_type": "ConnectionError",
|
|
176
|
+
"error_message": "連線被拒絕",
|
|
177
|
+
"error_code": "ECONNREFUSED",
|
|
178
|
+
"stack": "Error: Connection refused\n at connect (/app/db.js:45:11)..."
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 錯誤情境
|
|
183
|
+
|
|
184
|
+
始終包含:
|
|
185
|
+
- 嘗試執行的操作
|
|
186
|
+
- 相關識別碼(user_id、request_id)
|
|
187
|
+
- 輸入參數(已清理)
|
|
188
|
+
- 重試次數(如適用)
|
|
189
|
+
|
|
190
|
+
```javascript
|
|
191
|
+
logger.error('訂單處理失敗', {
|
|
192
|
+
error_type: err.name,
|
|
193
|
+
error_message: err.message,
|
|
194
|
+
order_id: orderId,
|
|
195
|
+
user_id: userId,
|
|
196
|
+
retry_count: 2,
|
|
197
|
+
stack: err.stack
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## 關聯與追蹤
|
|
202
|
+
|
|
203
|
+
### 請求關聯
|
|
204
|
+
|
|
205
|
+
使用 `request_id` 關聯單一請求內的所有日誌:
|
|
206
|
+
|
|
207
|
+
```javascript
|
|
208
|
+
// 中介軟體設定 request_id
|
|
209
|
+
app.use((req, res, next) => {
|
|
210
|
+
req.requestId = req.headers['x-request-id'] || generateId();
|
|
211
|
+
res.setHeader('x-request-id', req.requestId);
|
|
212
|
+
next();
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// 後續所有日誌都包含它
|
|
216
|
+
logger.info('處理請求', { request_id: req.requestId });
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### 分散式追蹤
|
|
220
|
+
|
|
221
|
+
對於微服務,包含:
|
|
222
|
+
- `trace_id`:整個請求流程的唯一 ID
|
|
223
|
+
- `span_id`:此特定操作的 ID
|
|
224
|
+
- `parent_span_id`:呼叫操作的 ID
|
|
225
|
+
|
|
226
|
+
## 效能考量
|
|
227
|
+
|
|
228
|
+
### 日誌量管理
|
|
229
|
+
|
|
230
|
+
| 環境 | 等級 | 量策略 |
|
|
231
|
+
|------|------|--------|
|
|
232
|
+
| 開發 | DEBUG | 所有日誌 |
|
|
233
|
+
| 預備 | INFO | 大部分日誌 |
|
|
234
|
+
| 生產 | INFO | 高流量採樣 |
|
|
235
|
+
|
|
236
|
+
### 高流量端點
|
|
237
|
+
|
|
238
|
+
對於每秒呼叫數千次的端點:
|
|
239
|
+
- 使用採樣(每 100 個記錄 1 個)
|
|
240
|
+
- 使用聚合指標而非個別日誌
|
|
241
|
+
- 使用獨立的日誌串流
|
|
242
|
+
|
|
243
|
+
### 非同步日誌
|
|
244
|
+
|
|
245
|
+
- 生產環境使用非同步/緩衝日誌
|
|
246
|
+
- 設定適當的緩衝區大小
|
|
247
|
+
- 優雅處理緩衝區溢位
|
|
248
|
+
|
|
249
|
+
## 日誌聚合
|
|
250
|
+
|
|
251
|
+
### 建議技術堆疊
|
|
252
|
+
|
|
253
|
+
| 元件 | 選項 |
|
|
254
|
+
|------|------|
|
|
255
|
+
| 收集 | Fluentd, Filebeat, Vector |
|
|
256
|
+
| 儲存 | Elasticsearch, Loki, CloudWatch |
|
|
257
|
+
| 視覺化 | Kibana, Grafana, Datadog |
|
|
258
|
+
| 告警 | PagerDuty, OpsGenie, Slack |
|
|
259
|
+
|
|
260
|
+
### 保留政策
|
|
261
|
+
|
|
262
|
+
| 日誌等級 | 保留期間 |
|
|
263
|
+
|---------|---------|
|
|
264
|
+
| DEBUG | 7 天 |
|
|
265
|
+
| INFO | 30 天 |
|
|
266
|
+
| WARN | 90 天 |
|
|
267
|
+
| ERROR/FATAL | 1 年 |
|
|
268
|
+
|
|
269
|
+
## 快速參考卡
|
|
270
|
+
|
|
271
|
+
### 日誌等級選擇
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
只是除錯用途? → DEBUG(生產環境關閉)
|
|
275
|
+
正常操作完成? → INFO
|
|
276
|
+
意外但可接受的情況? → WARN
|
|
277
|
+
操作失敗? → ERROR
|
|
278
|
+
應用程式無法繼續? → FATAL
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### 必要欄位檢查清單
|
|
282
|
+
|
|
283
|
+
- [ ] timestamp(ISO 8601)
|
|
284
|
+
- [ ] level
|
|
285
|
+
- [ ] message
|
|
286
|
+
- [ ] 服務名稱
|
|
287
|
+
- [ ] request_id 或 trace_id
|
|
288
|
+
|
|
289
|
+
### 安全檢查清單
|
|
290
|
+
|
|
291
|
+
- [ ] 無密碼或機密
|
|
292
|
+
- [ ] 無完整令牌
|
|
293
|
+
- [ ] PII 已遮罩或雜湊
|
|
294
|
+
- [ ] 永不記錄信用卡
|
|
295
|
+
- [ ] 已設定保留政策
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
**相關標準:**
|
|
300
|
+
- [測試標準](testing-standards.md) - 測試日誌輸出(或使用 `/testing-guide` 技能)
|
|
301
|
+
- [程式碼審查清單](code-review-checklist.md) - 審查日誌實踐
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## 版本歷史
|
|
306
|
+
|
|
307
|
+
| 版本 | 日期 | 變更 |
|
|
308
|
+
|-----|------|------|
|
|
309
|
+
| 1.1.0 | 2026-01-05 | 新增:參考標準章節,包含 OWASP、RFC 5424、OpenTelemetry 和 12 Factor App |
|
|
310
|
+
| 1.0.0 | 2025-12-30 | 初始日誌標準 |
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## 參考標準
|
|
315
|
+
|
|
316
|
+
- [OWASP 日誌備忘單](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html) - 安全日誌最佳實踐
|
|
317
|
+
- [RFC 5424 - Syslog 協定](https://datatracker.ietf.org/doc/html/rfc5424) - 標準日誌訊息格式
|
|
318
|
+
- [OpenTelemetry 日誌](https://opentelemetry.io/docs/specs/otel/logs/) - 現代可觀測性標準
|
|
319
|
+
- [12 Factor App - 日誌](https://12factor.net/logs) - 雲原生日誌原則
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## 授權
|
|
324
|
+
|
|
325
|
+
本標準以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權釋出。
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/project-structure.md
|
|
3
|
+
source_version: 1.0.1
|
|
4
|
+
translation_version: 1.0.1
|
|
5
|
+
last_synced: 2025-12-30
|
|
6
|
+
status: current
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 專案結構標準
|
|
10
|
+
|
|
11
|
+
**版本**: 1.0.1
|
|
12
|
+
**最後更新**: 2025-12-24
|
|
13
|
+
**適用範圍**: 所有軟體專案
|
|
14
|
+
|
|
15
|
+
[English](../../../core/project-structure.md) | **繁體中文**
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 目的
|
|
20
|
+
|
|
21
|
+
本標準定義專案目錄結構的規範(不僅限於文件檔案),涵蓋常見的工具目錄、建置輸出以及各程式語言的慣例。
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 常見專案目錄
|
|
26
|
+
|
|
27
|
+
### 建議目錄結構
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
project-root/
|
|
31
|
+
├── README.md # Project overview
|
|
32
|
+
├── CONTRIBUTING.md # Contribution guidelines
|
|
33
|
+
├── CHANGELOG.md # Version history
|
|
34
|
+
├── LICENSE # License file
|
|
35
|
+
│
|
|
36
|
+
├── .standards/ or .claude/ # Development standards
|
|
37
|
+
│ └── ...
|
|
38
|
+
│
|
|
39
|
+
├── docs/ # Documentation
|
|
40
|
+
│ └── ...
|
|
41
|
+
│
|
|
42
|
+
├── src/ # Source code (language-dependent)
|
|
43
|
+
│ └── ...
|
|
44
|
+
│
|
|
45
|
+
├── tests/ # Test files (if separate from src)
|
|
46
|
+
│ └── ...
|
|
47
|
+
│
|
|
48
|
+
├── tools/ # Development/deployment scripts
|
|
49
|
+
│ ├── deployment/ # Deployment scripts
|
|
50
|
+
│ ├── migration/ # Database migration tools
|
|
51
|
+
│ └── scripts/ # Utility scripts
|
|
52
|
+
│
|
|
53
|
+
├── examples/ # Usage examples
|
|
54
|
+
│ └── ...
|
|
55
|
+
│
|
|
56
|
+
├── dist/ # Build output (gitignored)
|
|
57
|
+
├── build/ # Compiled artifacts (gitignored)
|
|
58
|
+
└── publish/ # Release packages (partially gitignored)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 目錄定義
|
|
64
|
+
|
|
65
|
+
### 原始碼與建置目錄
|
|
66
|
+
|
|
67
|
+
| Directory | Purpose | gitignore? | Notes |
|
|
68
|
+
|-----------|---------|------------|-------|
|
|
69
|
+
| `src/` | Source code | No | Language-dependent; see conventions below |
|
|
70
|
+
| `lib/` | Library/dependency code | Depends | Vendored deps may be committed |
|
|
71
|
+
| `dist/` | Distribution/build output | **Yes** | Generated files, never commit |
|
|
72
|
+
| `build/` | Compiled artifacts | **Yes** | Intermediate build files |
|
|
73
|
+
| `out/` | Output directory | **Yes** | Alternative to dist/build |
|
|
74
|
+
| `bin/` | Binary executables | **Yes** | Compiled binaries |
|
|
75
|
+
| `obj/` | Object files | **Yes** | .NET intermediate files |
|
|
76
|
+
|
|
77
|
+
### 工具與腳本目錄
|
|
78
|
+
|
|
79
|
+
| Directory | Purpose | gitignore? | Notes |
|
|
80
|
+
|-----------|---------|------------|-------|
|
|
81
|
+
| `tools/` | Development/deployment tools | No | Shell scripts, Python tools, etc. |
|
|
82
|
+
| `scripts/` | Build/CI scripts | No | Often at root or under tools/ |
|
|
83
|
+
| `.github/` | GitHub-specific configs | No | Actions, templates, workflows |
|
|
84
|
+
| `.gitlab/` | GitLab-specific configs | No | CI templates |
|
|
85
|
+
|
|
86
|
+
### 資料與設定目錄
|
|
87
|
+
|
|
88
|
+
| Directory | Purpose | gitignore? | Notes |
|
|
89
|
+
|-----------|---------|------------|-------|
|
|
90
|
+
| `data/` | Test/seed data | Depends | Large files should be gitignored |
|
|
91
|
+
| `config/` | Configuration files | Depends | Secrets must be gitignored |
|
|
92
|
+
| `assets/` | Static assets | No | Images, templates, etc. |
|
|
93
|
+
| `resources/` | Resource files | No | Alternative to assets/ |
|
|
94
|
+
|
|
95
|
+
### 發佈目錄
|
|
96
|
+
|
|
97
|
+
| Directory | Purpose | gitignore? | Notes |
|
|
98
|
+
|-----------|---------|------------|-------|
|
|
99
|
+
| `publish/` | Release packages | Partial | May keep release notes, gitignore binaries |
|
|
100
|
+
| `release/` | Release artifacts | **Yes** | Generated release files |
|
|
101
|
+
| `packages/` | Monorepo packages | No | For monorepo projects |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 各程式語言慣例
|
|
106
|
+
|
|
107
|
+
### .NET / C#
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
project-root/
|
|
111
|
+
├── ProjectName.sln # Solution file at root
|
|
112
|
+
├── ProjectName/ # Main project
|
|
113
|
+
│ ├── ProjectName.csproj
|
|
114
|
+
│ ├── Program.cs
|
|
115
|
+
│ ├── Controllers/
|
|
116
|
+
│ └── ...
|
|
117
|
+
├── ProjectName.Domain/ # Domain layer (Clean Architecture)
|
|
118
|
+
├── ProjectName.Application/ # Application layer
|
|
119
|
+
├── ProjectName.Infrastructure/ # Infrastructure layer
|
|
120
|
+
├── ProjectName.Tests/ # Test project
|
|
121
|
+
└── docs/
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**慣例**: 專案為根目錄的子目錄,不放在 `src/` 下。Solution 檔案 (`.sln`) 放在根目錄。
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### Node.js / TypeScript
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
project-root/
|
|
132
|
+
├── package.json
|
|
133
|
+
├── tsconfig.json # If TypeScript
|
|
134
|
+
├── src/ # Source code
|
|
135
|
+
│ ├── index.ts
|
|
136
|
+
│ ├── controllers/
|
|
137
|
+
│ └── services/
|
|
138
|
+
├── dist/ # Compiled output (gitignored)
|
|
139
|
+
├── tests/ or __tests__/ # Test files
|
|
140
|
+
├── node_modules/ # Dependencies (gitignored)
|
|
141
|
+
└── docs/
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**慣例**: 原始碼放在 `src/`,編譯輸出放在 `dist/`。測試可放在 `tests/`、`__tests__/` 或與原始碼放在一起。
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
### Python
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
project-root/
|
|
152
|
+
├── pyproject.toml or setup.py
|
|
153
|
+
├── src/ # src-layout (recommended)
|
|
154
|
+
│ └── package_name/
|
|
155
|
+
│ ├── __init__.py
|
|
156
|
+
│ └── module.py
|
|
157
|
+
├── tests/
|
|
158
|
+
│ └── test_module.py
|
|
159
|
+
├── docs/
|
|
160
|
+
├── .venv/ # Virtual environment (gitignored)
|
|
161
|
+
└── dist/ # Built packages (gitignored)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**慣例**: 函式庫使用 src-layout (`src/package_name/`)。應用程式可使用平面結構(`package_name/` 在根目錄)。
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### Java / Maven
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
project-root/
|
|
172
|
+
├── pom.xml
|
|
173
|
+
├── src/
|
|
174
|
+
│ ├── main/
|
|
175
|
+
│ │ ├── java/
|
|
176
|
+
│ │ │ └── com/example/
|
|
177
|
+
│ │ └── resources/
|
|
178
|
+
│ └── test/
|
|
179
|
+
│ ├── java/
|
|
180
|
+
│ └── resources/
|
|
181
|
+
├── target/ # Build output (gitignored)
|
|
182
|
+
└── docs/
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**慣例**: Maven 標準目錄結構,不應偏離。
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
### Go
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
project-root/
|
|
193
|
+
├── go.mod
|
|
194
|
+
├── go.sum
|
|
195
|
+
├── main.go # Or cmd/app/main.go for multiple binaries
|
|
196
|
+
├── cmd/ # Application entry points
|
|
197
|
+
│ └── myapp/
|
|
198
|
+
│ └── main.go
|
|
199
|
+
├── pkg/ # Public library code
|
|
200
|
+
│ └── mylib/
|
|
201
|
+
├── internal/ # Private application code
|
|
202
|
+
│ └── ...
|
|
203
|
+
├── api/ # API definitions (protobuf, OpenAPI)
|
|
204
|
+
└── docs/
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**慣例**: 使用 `cmd/` 存放執行檔、`internal/` 存放私有程式碼、`pkg/` 存放公開函式庫。
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Monorepo 結構
|
|
212
|
+
|
|
213
|
+
對於包含多個套件/應用程式的專案:
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
project-root/
|
|
217
|
+
├── package.json # Root package.json (if using npm/yarn workspaces)
|
|
218
|
+
├── packages/ # Shared packages
|
|
219
|
+
│ ├── shared-utils/
|
|
220
|
+
│ ├── ui-components/
|
|
221
|
+
│ └── api-client/
|
|
222
|
+
├── apps/ # Applications
|
|
223
|
+
│ ├── web/
|
|
224
|
+
│ ├── mobile/
|
|
225
|
+
│ └── api-server/
|
|
226
|
+
├── tools/ # Shared build tools
|
|
227
|
+
├── docs/ # Shared documentation
|
|
228
|
+
└── README.md
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## IDE 與編輯器產生檔案
|
|
234
|
+
|
|
235
|
+
### 應加入 .gitignore 的常見檔案
|
|
236
|
+
|
|
237
|
+
```gitignore
|
|
238
|
+
# IDE - JetBrains (IntelliJ, Rider, WebStorm)
|
|
239
|
+
.idea/
|
|
240
|
+
*.iml
|
|
241
|
+
|
|
242
|
+
# IDE - Visual Studio
|
|
243
|
+
.vs/
|
|
244
|
+
*.user
|
|
245
|
+
*.suo
|
|
246
|
+
|
|
247
|
+
# IDE - VS Code (optional, some teams commit .vscode/)
|
|
248
|
+
.vscode/
|
|
249
|
+
!.vscode/settings.json # May commit shared settings
|
|
250
|
+
!.vscode/extensions.json # May commit recommended extensions
|
|
251
|
+
|
|
252
|
+
# IDE - Eclipse
|
|
253
|
+
.project
|
|
254
|
+
.classpath
|
|
255
|
+
.settings/
|
|
256
|
+
|
|
257
|
+
# macOS
|
|
258
|
+
.DS_Store
|
|
259
|
+
|
|
260
|
+
# Windows
|
|
261
|
+
Thumbs.db
|
|
262
|
+
desktop.ini
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### 偵測異常檔案
|
|
266
|
+
|
|
267
|
+
提交前,確認沒有追蹤 IDE 產生檔案:
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# Check for common IDE artifacts in git
|
|
271
|
+
git ls-files | grep -E '^\$|^\.idea|^\.vs/|\.user$|\.suo$'
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**已知問題**: VSCode 變數展開錯誤可能會建立像 `${workspaceFolder}/` 這樣的目錄。如果發現,請移除:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
# Remove if exists and not tracked
|
|
278
|
+
rm -rf '${workspaceFolder}'
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## 反模式
|
|
284
|
+
|
|
285
|
+
### ❌ 避免以下模式
|
|
286
|
+
|
|
287
|
+
1. **無意義的巢狀 src 目錄**
|
|
288
|
+
```
|
|
289
|
+
❌ project/src/src/main/...
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
2. **建置輸出與原始碼混合**
|
|
293
|
+
```
|
|
294
|
+
❌ src/
|
|
295
|
+
├── app.ts
|
|
296
|
+
└── app.js # Compiled file mixed with source
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
3. **一個 repo 中有多個無關專案且未使用 monorepo 結構**
|
|
300
|
+
```
|
|
301
|
+
❌ project/
|
|
302
|
+
├── backend/ # Unrelated project
|
|
303
|
+
└── frontend/ # Another unrelated project
|
|
304
|
+
# No shared tooling, no workspace config
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
4. **提交產生檔案**
|
|
308
|
+
```
|
|
309
|
+
❌ dist/ tracked in git
|
|
310
|
+
❌ node_modules/ tracked in git
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
5. **儲存庫中的密碼**
|
|
314
|
+
```
|
|
315
|
+
❌ config/secrets.json committed
|
|
316
|
+
❌ .env with real credentials committed
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## 驗證檢查清單
|
|
322
|
+
|
|
323
|
+
提交前請確認:
|
|
324
|
+
|
|
325
|
+
- [ ] 建置輸出 (`dist/`, `build/`, `bin/`, `obj/`) 已加入 gitignore
|
|
326
|
+
- [ ] 相依套件 (`node_modules/`, `.venv/`, `vendor/`) 已加入 gitignore
|
|
327
|
+
- [ ] IDE 產生檔案 (`.idea/`, `.vs/`) 已加入 gitignore
|
|
328
|
+
- [ ] 提交檔案中沒有密碼
|
|
329
|
+
- [ ] 原始碼結構遵循程式語言慣例
|
|
330
|
+
- [ ] 沒有異常目錄(例如 `${workspaceFolder}/`)
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## 相關標準
|
|
335
|
+
|
|
336
|
+
- [Documentation Structure Standard](documentation-structure.md) - 文件結構標準
|
|
337
|
+
- [Code Check-in Standards](checkin-standards.md) - 程式碼簽入標準
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## 版本歷史
|
|
342
|
+
|
|
343
|
+
| Version | Date | Changes |
|
|
344
|
+
|---------|------|---------|
|
|
345
|
+
| 1.0.1 | 2025-12-24 | Added: Related Standards section |
|
|
346
|
+
| 1.0.0 | 2025-12-11 | Initial project structure standard |
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## 參考資料
|
|
351
|
+
|
|
352
|
+
- [.NET Project Structure](https://docs.microsoft.com/en-us/dotnet/core/porting/project-structure)
|
|
353
|
+
- [Node.js Project Structure Best Practices](https://github.com/goldbergyoni/nodebestpractices)
|
|
354
|
+
- [Python Packaging User Guide](https://packaging.python.org/en/latest/)
|
|
355
|
+
- [Standard Go Project Layout](https://github.com/golang-standards/project-layout)
|
|
356
|
+
- [Maven Standard Directory Layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html)
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## 授權
|
|
361
|
+
|
|
362
|
+
本標準以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權發布。
|