This document defines the development standards and context for the Universal Development Standards project.
Universal Development Standards is a language-agnostic, framework-agnostic documentation standards framework. It provides:
- Core Standards (
core/): 23 fundamental development standards - AI Skills (
skills/): AI skills for assisted development - CLI Tool (
cli/): Node.js CLI for adopting standards - Integrations (
integrations/): Configurations for various AI tools - Localization (
locales/): Multi-language support (English, Traditional Chinese)
| Component | Technology | Version |
|---|---|---|
| Runtime | Node.js | >= 18.0.0 |
| Module System | ES Modules | - |
| Testing | Vitest | ^4.0.16 |
| Linting | ESLint | ^8.56.0 |
| CLI Framework | Commander.js | ^12.1.0 |
| Interactive Prompts | Inquirer.js | ^9.2.12 |
Reference: core/anti-hallucination.md
- Evidence-Based Analysis: You MUST read files before analyzing them. Do NOT guess APIs or versions. If you haven't seen the code, state: "I need to read [file] to confirm".
- Source Attribution: Every factual claim about the code MUST cite sources (e.g.,
[Source: Code] path/to/file:line). - Spec-Driven Development (SDD): When SDD tools (OpenSpec, Spec Kit) are present, prioritize using their commands (e.g.,
/openspec,/spec) over manual editing. - Language: All conversations with AI assistants should be conducted in Traditional Chinese (繁體中文) unless otherwise requested.
Follow Conventional Commits (core/commit-message-guide.md):
<type>(<scope>): <subject>
<body>
<footer>
Types: feat, fix, docs, chore, test, refactor, style
| Branch | Purpose |
|---|---|
main |
Stable, production-ready releases |
feature/* |
New features and enhancements |
fix/* |
Bug fixes |
docs/* |
Documentation updates |
chore/* |
Maintenance tasks |
JavaScript:
- Single quotes, Semicolons
- ES Module syntax
- Follow ESLint (
cli/.eslintrc.json)
Markdown:
- ATX-style headers (
#,##) - Blank lines around headers
cd cli
npm install # Install dependencies
npm test # Run tests (runs full suite, ~6 mins)
npm run test:quick # Quick dev testing (recommended for AI)
npm run test:unit # Unit tests only (< 3s)
npm run lint # Check code style
npm run test:coverage # Generate coverage# Sync Checks
./scripts/check-translation-sync.sh # Translations
./scripts/check-version-sync.sh # Versions
./scripts/check-standards-sync.sh # Standards consistency
./scripts/check-ai-agent-sync.sh # AI integration sync
./scripts/check-spec-sync.sh # Core↔Skill sync
./scripts/check-scope-sync.sh # Scope universality
# Pre-release (Runs all checks)
./scripts/pre-release-check.shWindows Users: Use .ps1 equivalents (e.g., .\scripts\pre-release-check.ps1).
- Development: Use
npm run test:watchornpm run test:quickfor instant feedback. - Pre-Commit: Git hooks will automatically run unit tests and linting.
- Discovery: Use
npm run test:discoverto find relevant tests. - Reference:
core/testing-standards.md
Before finishing a task, ensure:
- Build: Code compiles with zero errors.
- Tests: All tests pass (100%). New code has tests.
- Quality: No hardcoded secrets. Follows coding standards.
- Docs: API docs and
CHANGELOG.mdupdated. - Compliance: Correct branch name and commit message format.
Do NOT manually run npm publish.
- Ask for release type: stable, beta, alpha, rc.
- Run pre-release checks:
./scripts/pre-release-check.sh. - Update Version Files:
cli/package.jsoncli/standards-registry.json.claude-plugin/plugin.json.claude-plugin/marketplace.jsonREADME.md(Stable only)
- Update CHANGELOG.md.
- Tag & Push: Create git tag (
vX.Y.Z) and push. - GitHub Release: Create release; Action handles publishing.
Reference: core/refactoring-standards.md
- Tactical: Boy Scout Rule, Preparatory Refactoring (Minutes)
- Strategic: Strangler Fig, Anti-Corruption Layer (Weeks-Months)
- Safety: Add characterization tests BEFORE refactoring legacy code.
所有提交訊息必須使用繁體中文撰寫。
格式:<類型>(<範圍>): <主旨>
MUST follow (每次都要遵守):
| Task | Standard | When |
|---|---|---|
| Writing commits | commit-message.ai.yaml | Every commit |
| Project context | project-context-memory.ai.yaml | Planning & Coding |
SHOULD follow (相關任務時參考):
| Task | Standard | When |
|---|---|---|
| Git workflow | git-workflow.ai.yaml | Branch/merge decisions |
| Writing tests | testing.ai.yaml | When creating tests |
| Developer memory | developer-memory.ai.yaml | Always (protocol) |
本專案採用 UDS 標準。所有規範位於 .standards/:
anti-hallucination.ai.yaml- anti-hallucination.ai.yamlai-friendly-architecture.ai.yaml- ai-friendly-architecture.ai.yamlcommit-message.ai.yaml- 提交訊息格式english.ai.yaml- english.ai.yamlcheckin-standards.ai.yaml- checkin-standards.ai.yamlspec-driven-development.ai.yaml- spec-driven-development.ai.yamlcode-review.ai.yaml- code-review.ai.yamlgit-workflow.ai.yaml- Git 工作流程github-flow.ai.yaml- github-flow.ai.yamlsquash-merge.ai.yaml- squash-merge.ai.yamlversioning.ai.yaml- versioning.ai.yamlchangelog.ai.yaml- changelog.ai.yamltesting.ai.yaml- 測試標準unit-testing.ai.yaml- unit-testing.ai.yamlintegration-testing.ai.yaml- integration-testing.ai.yamldocumentation-structure.ai.yaml- documentation-structure.ai.yamldocumentation-writing-standards.ai.yaml- documentation-writing-standards.ai.yamlai-instruction-standards.ai.yaml- ai-instruction-standards.ai.yamlproject-structure.ai.yaml- project-structure.ai.yamlerror-codes.ai.yaml- error-codes.ai.yamllogging.ai.yaml- logging.ai.yamltest-completeness-dimensions.ai.yaml- test-completeness-dimensions.ai.yamltest-driven-development.ai.yaml- test-driven-development.ai.yamlbehavior-driven-development.ai.yaml- behavior-driven-development.ai.yamlacceptance-test-driven-development.ai.yaml- acceptance-test-driven-development.ai.yamlreverse-engineering-standards.ai.yaml- reverse-engineering-standards.ai.yamlforward-derivation-standards.ai.yaml- forward-derivation-standards.ai.yamlai-agreement-standards.ai.yaml- ai-agreement-standards.ai.yamlvirtual-organization-standards.ai.yaml- virtual-organization-standards.ai.yamlrefactoring-standards.ai.yaml- refactoring-standards.ai.yamlrequirement-engineering.ai.yaml- requirement-engineering.ai.yamlsecurity-standards.ai.yaml- security-standards.ai.yamlperformance-standards.ai.yaml- performance-standards.ai.yamlaccessibility-standards.ai.yaml- accessibility-standards.ai.yamlrequirement-checklist.md- requirement-checklist.mdrequirement-template.md- requirement-template.mdrequirement-document-template.md- requirement-document-template.mddeployment-standards.ai.yaml- deployment-standards.ai.yamldeveloper-memory.ai.yaml- 開發者持久記憶project-context-memory.ai.yaml- 專案情境記憶