universal-dev-standards 6.8.0 → 6.10.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/bin/uds.js +12 -2
- package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +14 -2
- package/bundled/ai/standards/adr-standards.ai.yaml +14 -2
- package/bundled/ai/standards/code-review.ai.yaml +13 -3
- package/bundled/ai/standards/commit-message.ai.yaml +8 -4
- package/bundled/ai/standards/deferred-item-exit.ai.yaml +225 -0
- package/bundled/ai/standards/feature-discovery-standards.ai.yaml +14 -2
- package/bundled/ai/standards/governance-layer.ai.yaml +128 -2
- package/bundled/ai/standards/logging.ai.yaml +2 -2
- package/bundled/ai/standards/retrospective-standards.ai.yaml +14 -2
- package/bundled/ai/standards/reverse-engineering-standards.ai.yaml +73 -2
- package/bundled/ai/standards/security-standards.ai.yaml +2 -2
- package/bundled/ai/standards/spec-driven-development.ai.yaml +14 -2
- package/bundled/ai/standards/tech-debt-standards.ai.yaml +87 -3
- package/bundled/ai/standards/turn-completion-integrity.ai.yaml +131 -0
- package/bundled/core/acceptance-criteria-traceability.md +5 -2
- package/bundled/core/adr-standards.md +26 -2
- package/bundled/core/agent-communication-protocol.md +8 -0
- package/bundled/core/branch-completion.md +8 -0
- package/bundled/core/change-batching-standards.md +8 -0
- package/bundled/core/code-review-checklist.md +5 -2
- package/bundled/core/context-aware-loading.md +1 -1
- package/bundled/core/deferred-item-exit.md +254 -0
- package/bundled/core/execution-history.md +8 -0
- package/bundled/core/feature-discovery-standards.md +5 -1
- package/bundled/core/governance-layer.md +114 -2
- package/bundled/core/pipeline-integration-standards.md +8 -0
- package/bundled/core/retrospective-standards.md +4 -2
- package/bundled/core/reverse-engineering-standards.md +81 -2
- package/bundled/core/spec-driven-development.md +8 -2
- package/bundled/core/tech-debt-standards.md +67 -8
- package/bundled/core/turn-completion-integrity.md +196 -0
- package/bundled/core/workflow-enforcement.md +8 -0
- package/bundled/core/workflow-state-protocol.md +8 -0
- package/bundled/hooks/check-dangerous-cmd.mjs +60 -0
- package/bundled/hooks/check-logging-standard.mjs +59 -0
- package/bundled/hooks/check-turn-completion.mjs +233 -0
- package/bundled/hooks/inject-standards.mjs +183 -0
- package/bundled/hooks/telemetry-wrapper.mjs +77 -0
- package/bundled/hooks/turn-completion/detect.mjs +99 -0
- package/bundled/hooks/turn-completion/locales/en.mjs +159 -0
- package/bundled/hooks/turn-completion/locales/zh-TW.mjs +166 -0
- package/bundled/hooks/validate-commit-msg.mjs +104 -0
- package/bundled/locales/zh-CN/CHANGELOG.md +73 -3
- package/bundled/locales/zh-CN/CLAUDE.md +1 -1
- package/bundled/locales/zh-CN/README.md +2 -2
- package/bundled/locales/zh-CN/SECURITY.md +1 -1
- package/bundled/locales/zh-CN/core/adr-standards.md +1 -1
- package/bundled/locales/zh-CN/core/agent-communication-protocol.md +7 -0
- package/bundled/locales/zh-CN/core/branch-completion.md +7 -0
- package/bundled/locales/zh-CN/core/change-batching-standards.md +7 -0
- package/bundled/locales/zh-CN/core/execution-history.md +7 -0
- package/bundled/locales/zh-CN/core/governance-layer.md +118 -6
- package/bundled/locales/zh-CN/core/pipeline-integration-standards.md +7 -0
- package/bundled/locales/zh-CN/core/retrospective-standards.md +1 -1
- package/bundled/locales/zh-CN/core/tech-debt-standards.md +71 -4
- package/bundled/locales/zh-CN/core/turn-completion-integrity.md +190 -0
- package/bundled/locales/zh-CN/core/workflow-enforcement.md +7 -0
- package/bundled/locales/zh-CN/core/workflow-state-protocol.md +7 -0
- package/bundled/locales/zh-CN/docs/CHEATSHEET.md +8 -1
- package/bundled/locales/zh-CN/docs/CLI-INIT-OPTIONS.md +29 -68
- package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +25 -15
- package/bundled/locales/zh-CN/docs/MIGRATION-v6.md +8 -4
- package/bundled/locales/zh-CN/docs/USAGE-MODES-COMPARISON.md +1 -2
- package/bundled/locales/zh-CN/integrations/google-antigravity/{INSTRUCTIONS.md → AGENTS.md} +1 -1
- package/bundled/locales/zh-CN/integrations/google-antigravity/README.md +3 -3
- package/bundled/locales/zh-CN/skills/atdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-CN/skills/bdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +22 -12
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +12 -9
- package/bundled/locales/zh-CN/skills/code-review-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/commands/brainstorm.md +17 -13
- package/bundled/locales/zh-CN/skills/commands/config.md +0 -1
- package/bundled/locales/zh-CN/skills/commands/init.md +1 -2
- package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +2 -0
- package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +2 -0
- package/bundled/locales/zh-CN/skills/observability-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/project-structure-guide/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/release-standards/SKILL.md +3 -0
- package/bundled/locales/zh-CN/skills/requirement-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +3 -0
- package/bundled/locales/zh-CN/skills/runbook-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/slo-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/tdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/CHANGELOG.md +74 -3
- package/bundled/locales/zh-TW/CLAUDE.md +1 -1
- package/bundled/locales/zh-TW/README.md +2 -2
- package/bundled/locales/zh-TW/SECURITY.md +1 -1
- package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +2 -0
- package/bundled/locales/zh-TW/core/adr-standards.md +26 -5
- package/bundled/locales/zh-TW/core/agent-communication-protocol.md +7 -0
- package/bundled/locales/zh-TW/core/branch-completion.md +7 -0
- package/bundled/locales/zh-TW/core/change-batching-standards.md +7 -0
- package/bundled/locales/zh-TW/core/code-review-checklist.md +2 -0
- package/bundled/locales/zh-TW/core/container-image-standards.md +2 -2
- package/bundled/locales/zh-TW/core/contract-testing-standards.md +2 -2
- package/bundled/locales/zh-TW/core/cross-flow-regression.md +8 -7
- package/bundled/locales/zh-TW/core/data-contract.md +2 -2
- package/bundled/locales/zh-TW/core/data-migration-testing.md +2 -2
- package/bundled/locales/zh-TW/core/data-pipeline.md +2 -2
- package/bundled/locales/zh-TW/core/deferred-item-exit.md +251 -0
- package/bundled/locales/zh-TW/core/documentation-writing-standards.md +228 -3
- package/bundled/locales/zh-TW/core/execution-history.md +7 -0
- package/bundled/locales/zh-TW/core/full-coverage-testing.md +15 -2
- package/bundled/locales/zh-TW/core/governance-layer.md +118 -5
- package/bundled/locales/zh-TW/core/iac-design-principles.md +2 -2
- package/bundled/locales/zh-TW/core/incident-response.md +2 -2
- package/bundled/locales/zh-TW/core/model-provenance.md +4 -2
- package/bundled/locales/zh-TW/core/pii-classification.md +42 -6
- package/bundled/locales/zh-TW/core/pipeline-integration-standards.md +7 -0
- package/bundled/locales/zh-TW/core/prd-standards.md +4 -2
- package/bundled/locales/zh-TW/core/product-metrics-standards.md +4 -2
- package/bundled/locales/zh-TW/core/release-readiness-gate.md +2 -2
- package/bundled/locales/zh-TW/core/resource-cost-boundary.md +2 -2
- package/bundled/locales/zh-TW/core/retrospective-standards.md +5 -3
- package/bundled/locales/zh-TW/core/reverse-engineering-standards.md +83 -5
- package/bundled/locales/zh-TW/core/runbook.md +2 -2
- package/bundled/locales/zh-TW/core/schema-evolution.md +2 -2
- package/bundled/locales/zh-TW/core/secret-management-standards.md +2 -2
- package/bundled/locales/zh-TW/core/slo-sli.md +2 -2
- package/bundled/locales/zh-TW/core/spec-driven-development.md +2 -0
- package/bundled/locales/zh-TW/core/tech-debt-standards.md +71 -4
- package/bundled/locales/zh-TW/core/turn-completion-integrity.md +190 -0
- package/bundled/locales/zh-TW/core/user-journey-testing.md +2 -2
- package/bundled/locales/zh-TW/core/user-story-mapping.md +2 -2
- package/bundled/locales/zh-TW/core/verification-oracle.md +2 -2
- package/bundled/locales/zh-TW/core/workflow-enforcement.md +7 -0
- package/bundled/locales/zh-TW/core/workflow-state-protocol.md +7 -0
- package/bundled/locales/zh-TW/docs/CHEATSHEET.md +8 -1
- package/bundled/locales/zh-TW/docs/CLI-INIT-OPTIONS.md +29 -68
- package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +25 -15
- package/bundled/locales/zh-TW/docs/MIGRATION-v6.md +8 -4
- package/bundled/locales/zh-TW/docs/USAGE-MODES-COMPARISON.md +1 -2
- package/bundled/locales/zh-TW/integrations/google-antigravity/{INSTRUCTIONS.md → AGENTS.md} +1 -1
- package/bundled/locales/zh-TW/integrations/google-antigravity/README.md +3 -3
- package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/atdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/bdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +22 -12
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +12 -9
- package/bundled/locales/zh-TW/skills/code-review-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/commands/brainstorm.md +17 -13
- package/bundled/locales/zh-TW/skills/commands/config.md +0 -1
- package/bundled/locales/zh-TW/skills/commands/init.md +1 -2
- package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +2 -1
- package/bundled/locales/zh-TW/skills/dev-methodology/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/knowledge-graph/guide.md +2 -2
- package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/observability-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/project-discovery/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/project-structure-guide/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/release-standards/SKILL.md +3 -0
- package/bundled/locales/zh-TW/skills/requirement-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +3 -0
- package/bundled/locales/zh-TW/skills/runbook-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/slo-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/tdd-assistant/SKILL.md +2 -0
- package/bundled/skills/atdd-assistant/SKILL.md +2 -0
- package/bundled/skills/bdd-assistant/SKILL.md +2 -0
- package/bundled/skills/brainstorm-assistant/SKILL.md +31 -13
- package/bundled/skills/brainstorm-assistant/guide.md +9 -6
- package/bundled/skills/code-review-assistant/SKILL.md +1 -0
- package/bundled/skills/commands/brainstorm.md +12 -9
- package/bundled/skills/commands/config.md +0 -1
- package/bundled/skills/commands/init.md +2 -3
- package/bundled/skills/commit-standards/SKILL.md +2 -0
- package/bundled/skills/contract-test-assistant/SKILL.md +1 -0
- package/bundled/skills/dev-methodology/SKILL.md +4 -0
- package/bundled/skills/observability-assistant/SKILL.md +1 -0
- package/bundled/skills/project-discovery/SKILL.md +1 -0
- package/bundled/skills/project-structure-guide/SKILL.md +1 -0
- package/bundled/skills/release-standards/SKILL.md +3 -0
- package/bundled/skills/requirement-assistant/SKILL.md +2 -0
- package/bundled/skills/reverse-engineer/SKILL.md +3 -0
- package/bundled/skills/runbook-assistant/SKILL.md +1 -0
- package/bundled/skills/slo-assistant/SKILL.md +1 -0
- package/bundled/skills/tdd-assistant/SKILL.md +2 -0
- package/bundled/templates/.ai-context.yaml.template +194 -0
- package/bundled/templates/CLAUDE.md.template +145 -0
- package/bundled/templates/DESIGN.md +237 -0
- package/bundled/templates/SKILL-BRIEF-TEMPLATE.md +57 -0
- package/bundled/templates/SKILL-CANDIDATES.md +39 -0
- package/bundled/templates/gates/check-error-exit.mjs +309 -0
- package/bundled/templates/mcp-config.json +10 -0
- package/bundled/templates/methodology-template.yaml +209 -0
- package/bundled/templates/migration-template.md +408 -0
- package/bundled/templates/requirement-checklist.md +410 -0
- package/bundled/templates/requirement-document-template.md +591 -0
- package/bundled/templates/requirement-template.md +881 -0
- package/bundled/templates/reverse-spec-template.md +409 -0
- package/bundled/templates/test-case-template.md +74 -0
- package/bundled/templates/test-plan-template.md +74 -0
- package/package.json +12 -9
- package/src/commands/audit.js +82 -0
- package/src/commands/check.js +227 -34
- package/src/commands/config.js +19 -19
- package/src/commands/init.js +174 -20
- package/src/commands/spec.js +2 -2
- package/src/commands/update.js +537 -43
- package/src/compilers/claude-code-compiler.js +4 -1
- package/src/config/ai-agent-paths.js +62 -17
- package/src/core/constants.js +42 -11
- package/src/core/manifest.js +201 -3
- package/src/core/paths.js +2 -2
- package/src/i18n/messages.js +42 -29
- package/src/installers/hooks-installer.js +167 -75
- package/src/installers/integration-installer.js +13 -9
- package/src/installers/skills-installer.js +4 -4
- package/src/installers/standards-installer.js +3 -3
- package/src/prompts/init.js +47 -18
- package/src/reconciler/diff-engine.js +57 -2
- package/src/reconciler/plan-executor.js +31 -11
- package/src/utils/detector.js +21 -1
- package/src/utils/effect-boundary.js +1093 -0
- package/src/utils/hasher.js +166 -1
- package/src/utils/hook-stats.js +1 -1
- package/src/utils/integration-generator.js +288 -82
- package/src/utils/reference-sync.js +107 -8
- package/src/utils/registry.js +57 -0
- package/src/utils/spinner.js +31 -0
- package/src/utils/yaml-generator.js +51 -9
- package/standards-registry.json +32 -9
|
@@ -3,7 +3,7 @@ import { dirname, join, basename } from 'path';
|
|
|
3
3
|
import { getLanguageRules } from '../prompts/integrations.js';
|
|
4
4
|
import { computeIntegrationBlockHash } from './hasher.js';
|
|
5
5
|
import { UDS_MARKERS, SUPPORTED_AI_TOOLS, LEGACY_TOOL_MAPPINGS } from '../core/constants.js';
|
|
6
|
-
import { resolveSelectedOptionSources, resolveStandardFilename } from './registry.js';
|
|
6
|
+
import { resolveSelectedOptionSources, resolveStandardFilename, getAllStandards } from './registry.js';
|
|
7
7
|
import { getAgentConfig, getAgentTier } from '../config/ai-agent-paths.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -32,7 +32,10 @@ export function resolveContentModeForTool(tool, userContentMode) {
|
|
|
32
32
|
? { contentMode: 'minimal', level: 3 }
|
|
33
33
|
: { contentMode: 'index', level: 2 };
|
|
34
34
|
case 'partial':
|
|
35
|
-
|
|
35
|
+
// Was 'full'. Every partial-tier tool was being auto-assigned a mode
|
|
36
|
+
// that generated exactly the same bytes as 'index', so this is a rename
|
|
37
|
+
// of what these tools already got, not a change to it. (XSPEC-357 R7)
|
|
38
|
+
return { contentMode: 'index', level: 1 };
|
|
36
39
|
case 'preview':
|
|
37
40
|
return { contentMode: 'index', level: 2 };
|
|
38
41
|
case 'minimal':
|
|
@@ -70,6 +73,31 @@ function getToolFileName(tool) {
|
|
|
70
73
|
if (KNOWN_TOOL_FILES.has(tool) || /\.(md|yaml|yml|json)$/i.test(tool)) {
|
|
71
74
|
return tool;
|
|
72
75
|
}
|
|
76
|
+
|
|
77
|
+
// 🔴 A tool THIS system already knows, missing from THIS table, is an internal
|
|
78
|
+
// inconsistency — never a future tool. It must fail rather than get a generated
|
|
79
|
+
// filename.
|
|
80
|
+
//
|
|
81
|
+
// Measured 2026-09-08: `roo-code` is the key used by `ai-agent-paths.js`,
|
|
82
|
+
// `REGISTRY.json`, `agent-adapter.js` and `agents-installer.js`, while
|
|
83
|
+
// `SUPPORTED_AI_TOOLS` said `roo`. Every lookup here missed and fell through, so a
|
|
84
|
+
// real `uds init` in a Roo Code repo wrote its instructions to `roo-code.md` — a
|
|
85
|
+
// filename Roo Code's docs never mention. Nothing failed. Nothing warned. Same
|
|
86
|
+
// class as `.codex/skills/`, which this repo's own comments call "a directory UDS
|
|
87
|
+
// invented"; the line below was a *rule* for inventing them.
|
|
88
|
+
//
|
|
89
|
+
// ⚠️ The fallback itself is KEPT, because it is a deliberate design decision, not
|
|
90
|
+
// an accident: three tests assert it as "forward compatibility with future tools".
|
|
91
|
+
// Narrowing beats reversing — a genuinely unknown name still gets `<name>.md`; only
|
|
92
|
+
// the self-contradiction fails.
|
|
93
|
+
if (getAgentConfig(normalizedName)) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
`getToolFileName: "${tool}" is a known agent in ai-agent-paths.js but is missing ` +
|
|
96
|
+
'from SUPPORTED_AI_TOOLS in cli/src/core/constants.js. Add it with the file that ' +
|
|
97
|
+
`tool actually reads. Refusing to invent "${tool}.md" — that is how a Roo Code ` +
|
|
98
|
+
'repo got its instructions written to a file Roo Code never reads.'
|
|
99
|
+
);
|
|
100
|
+
}
|
|
73
101
|
return `${tool}.md`;
|
|
74
102
|
}
|
|
75
103
|
|
|
@@ -1975,6 +2003,16 @@ src/
|
|
|
1975
2003
|
/**
|
|
1976
2004
|
* Tool-specific file headers
|
|
1977
2005
|
*/
|
|
2006
|
+
// 🔴 These headers used to open by telling the agent to "PRIORITIZE reading the
|
|
2007
|
+
// concise rules in `core/`". `uds init` installs standards into `.standards/`
|
|
2008
|
+
// and has never created a `core/` directory in an adopter's project — `core/`
|
|
2009
|
+
// is where the standards live in the UDS repo, not in the repos that adopt it.
|
|
2010
|
+
// So the first instruction in every generated file, for every tool, in every
|
|
2011
|
+
// language, pointed at nothing. An adopter reported the symptom on 2026-09-16
|
|
2012
|
+
// and read it as residue from an old install; it was not residue, a clean
|
|
2013
|
+
// `uds init` wrote it. 36 copies of the same two sentences, all wrong the same
|
|
2014
|
+
// way. `tests/unit/utils/tool-headers-no-core.test.js` walks the generated
|
|
2015
|
+
// output so a tenth tool cannot reintroduce it.
|
|
1978
2016
|
const TOOL_HEADERS = {
|
|
1979
2017
|
cursor: {
|
|
1980
2018
|
en: `# Cursor Rules
|
|
@@ -1987,8 +2025,8 @@ You are an expert software engineer assistant. Follow these project standards.
|
|
|
1987
2025
|
All responses should be in **English**.
|
|
1988
2026
|
|
|
1989
2027
|
## Core Standards Usage Rule
|
|
1990
|
-
> When verifying standards, checking code, or performing tasks,
|
|
1991
|
-
>
|
|
2028
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2029
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
1992
2030
|
> This ensures token efficiency and focused context.`,
|
|
1993
2031
|
'zh-tw': `# Cursor 規則
|
|
1994
2032
|
# 由 Universal Dev Standards CLI 生成
|
|
@@ -2000,8 +2038,8 @@ All responses should be in **English**.
|
|
|
2000
2038
|
所有回覆必須使用**繁體中文 (Traditional Chinese)**。
|
|
2001
2039
|
|
|
2002
2040
|
## 核心標準使用規則 / Core Standards Usage Rule
|
|
2003
|
-
>
|
|
2004
|
-
>
|
|
2041
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2042
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2005
2043
|
> 這確保了 Token 效率和上下文聚焦。`,
|
|
2006
2044
|
bilingual: `# Cursor Rules | Cursor 規則
|
|
2007
2045
|
# Generated by Universal Dev Standards CLI
|
|
@@ -2016,10 +2054,10 @@ All responses should be in **Traditional Chinese (繁體中文)**, with technica
|
|
|
2016
2054
|
所有回覆必須使用**繁體中文**,技術術語可保留英文。
|
|
2017
2055
|
|
|
2018
2056
|
## Core Standards Usage Rule / 核心標準使用規則
|
|
2019
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2020
|
-
>
|
|
2021
|
-
>
|
|
2022
|
-
>
|
|
2057
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2058
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2059
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2060
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2023
2061
|
> This ensures token efficiency and focused context.
|
|
2024
2062
|
> 這確保了 Token 效率和上下文聚焦。`
|
|
2025
2063
|
},
|
|
@@ -2034,8 +2072,8 @@ You are an expert software engineer assistant. Follow these project standards.
|
|
|
2034
2072
|
All responses should be in **English**.
|
|
2035
2073
|
|
|
2036
2074
|
## Core Standards Usage Rule
|
|
2037
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2038
|
-
>
|
|
2075
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2076
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2039
2077
|
> This ensures token efficiency and focused context.`,
|
|
2040
2078
|
'zh-tw': `# Windsurf 規則
|
|
2041
2079
|
# 由 Universal Dev Standards CLI 生成
|
|
@@ -2047,8 +2085,8 @@ All responses should be in **English**.
|
|
|
2047
2085
|
所有回覆必須使用**繁體中文 (Traditional Chinese)**。
|
|
2048
2086
|
|
|
2049
2087
|
## 核心標準使用規則 / Core Standards Usage Rule
|
|
2050
|
-
>
|
|
2051
|
-
>
|
|
2088
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2089
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2052
2090
|
> 這確保了 Token 效率和上下文聚焦。`,
|
|
2053
2091
|
bilingual: `# Windsurf Rules | Windsurf 規則
|
|
2054
2092
|
# Generated by Universal Dev Standards CLI
|
|
@@ -2063,10 +2101,10 @@ All responses should be in **Traditional Chinese (繁體中文)**, with technica
|
|
|
2063
2101
|
所有回覆必須使用**繁體中文**,技術術語可保留英文。
|
|
2064
2102
|
|
|
2065
2103
|
## Core Standards Usage Rule / 核心標準使用規則
|
|
2066
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2067
|
-
>
|
|
2068
|
-
>
|
|
2069
|
-
>
|
|
2104
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2105
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2106
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2107
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2070
2108
|
> This ensures token efficiency and focused context.
|
|
2071
2109
|
> 這確保了 Token 效率和上下文聚焦。`
|
|
2072
2110
|
},
|
|
@@ -2081,8 +2119,8 @@ You are an expert software engineer assistant. Follow these project standards.
|
|
|
2081
2119
|
All responses should be in **English**.
|
|
2082
2120
|
|
|
2083
2121
|
## Core Standards Usage Rule
|
|
2084
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2085
|
-
>
|
|
2122
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2123
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2086
2124
|
> This ensures token efficiency and focused context.`,
|
|
2087
2125
|
'zh-tw': `# Cline 規則
|
|
2088
2126
|
# 由 Universal Dev Standards CLI 生成
|
|
@@ -2094,8 +2132,8 @@ All responses should be in **English**.
|
|
|
2094
2132
|
所有回覆必須使用**繁體中文 (Traditional Chinese)**。
|
|
2095
2133
|
|
|
2096
2134
|
## 核心標準使用規則 / Core Standards Usage Rule
|
|
2097
|
-
>
|
|
2098
|
-
>
|
|
2135
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2136
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2099
2137
|
> 這確保了 Token 效率和上下文聚焦。`,
|
|
2100
2138
|
bilingual: `# Cline Rules | Cline 規則
|
|
2101
2139
|
# Generated by Universal Dev Standards CLI
|
|
@@ -2110,10 +2148,10 @@ All responses should be in **Traditional Chinese (繁體中文)**, with technica
|
|
|
2110
2148
|
所有回覆必須使用**繁體中文**,技術術語可保留英文。
|
|
2111
2149
|
|
|
2112
2150
|
## Core Standards Usage Rule / 核心標準使用規則
|
|
2113
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2114
|
-
>
|
|
2115
|
-
>
|
|
2116
|
-
>
|
|
2151
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2152
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2153
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2154
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2117
2155
|
> This ensures token efficiency and focused context.
|
|
2118
2156
|
> 這確保了 Token 效率和上下文聚焦。`
|
|
2119
2157
|
},
|
|
@@ -2128,8 +2166,8 @@ You are an expert software engineer assistant. Follow these project standards.
|
|
|
2128
2166
|
All responses should be in **English**.
|
|
2129
2167
|
|
|
2130
2168
|
## Core Standards Usage Rule
|
|
2131
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2132
|
-
>
|
|
2169
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2170
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2133
2171
|
> This ensures token efficiency and focused context.`,
|
|
2134
2172
|
'zh-tw': `# GitHub Copilot 說明
|
|
2135
2173
|
# 由 Universal Dev Standards CLI 生成
|
|
@@ -2141,8 +2179,8 @@ All responses should be in **English**.
|
|
|
2141
2179
|
所有回覆必須使用**繁體中文 (Traditional Chinese)**。
|
|
2142
2180
|
|
|
2143
2181
|
## 核心標準使用規則 / Core Standards Usage Rule
|
|
2144
|
-
>
|
|
2145
|
-
>
|
|
2182
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2183
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2146
2184
|
> 這確保了 Token 效率和上下文聚焦。`,
|
|
2147
2185
|
bilingual: `# GitHub Copilot Instructions | GitHub Copilot 說明
|
|
2148
2186
|
# Generated by Universal Dev Standards CLI
|
|
@@ -2157,10 +2195,10 @@ All responses should be in **Traditional Chinese (繁體中文)**, with technica
|
|
|
2157
2195
|
所有回覆必須使用**繁體中文**,技術術語可保留英文。
|
|
2158
2196
|
|
|
2159
2197
|
## Core Standards Usage Rule / 核心標準使用規則
|
|
2160
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2161
|
-
>
|
|
2162
|
-
>
|
|
2163
|
-
>
|
|
2198
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2199
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2200
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2201
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2164
2202
|
> This ensures token efficiency and focused context.
|
|
2165
2203
|
> 這確保了 Token 效率和上下文聚焦。`
|
|
2166
2204
|
},
|
|
@@ -2176,8 +2214,8 @@ Follow these project standards.
|
|
|
2176
2214
|
All responses should be in **English**.
|
|
2177
2215
|
|
|
2178
2216
|
## Core Standards Usage Rule
|
|
2179
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2180
|
-
>
|
|
2217
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2218
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2181
2219
|
> This ensures token efficiency and focused context.`,
|
|
2182
2220
|
'zh-tw': `# Antigravity 系統指令
|
|
2183
2221
|
# 由 Universal Dev Standards CLI 生成
|
|
@@ -2190,8 +2228,8 @@ Google Antigravity (Gemini Advanced Agent) 的推薦系統指令。
|
|
|
2190
2228
|
所有回覆必須使用**繁體中文 (Traditional Chinese)**。
|
|
2191
2229
|
|
|
2192
2230
|
## 核心標準使用規則 / Core Standards Usage Rule
|
|
2193
|
-
>
|
|
2194
|
-
>
|
|
2231
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2232
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2195
2233
|
> 這確保了 Token 效率和上下文聚焦。`,
|
|
2196
2234
|
bilingual: `# Antigravity System Instructions | Antigravity 系統指令
|
|
2197
2235
|
# Generated by Universal Dev Standards CLI
|
|
@@ -2206,10 +2244,10 @@ All responses should be in **Traditional Chinese (繁體中文)**, with technica
|
|
|
2206
2244
|
所有回覆必須使用**繁體中文**,技術術語可保留英文。
|
|
2207
2245
|
|
|
2208
2246
|
## Core Standards Usage Rule / 核心標準使用規則
|
|
2209
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2210
|
-
>
|
|
2211
|
-
>
|
|
2212
|
-
>
|
|
2247
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2248
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2249
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2250
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2213
2251
|
> This ensures token efficiency and focused context.
|
|
2214
2252
|
> 這確保了 Token 效率和上下文聚焦。`
|
|
2215
2253
|
},
|
|
@@ -2222,8 +2260,8 @@ All responses should be in **Traditional Chinese (繁體中文)**, with technica
|
|
|
2222
2260
|
All responses should be in **English**.
|
|
2223
2261
|
|
|
2224
2262
|
## Core Standards Usage Rule
|
|
2225
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2226
|
-
>
|
|
2263
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2264
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2227
2265
|
> This ensures token efficiency and focused context.`,
|
|
2228
2266
|
'zh-tw': `# Claude Code 專案指南
|
|
2229
2267
|
# 由 Universal Dev Standards CLI 生成
|
|
@@ -2234,8 +2272,8 @@ All responses should be in **English**.
|
|
|
2234
2272
|
AI 助手應以繁體中文回覆使用者的問題與請求。
|
|
2235
2273
|
|
|
2236
2274
|
## 核心標準使用規則 / Core Standards Usage Rule
|
|
2237
|
-
>
|
|
2238
|
-
>
|
|
2275
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2276
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2239
2277
|
> 這確保了 Token 效率和上下文聚焦。`,
|
|
2240
2278
|
bilingual: `# Project Guidelines for Claude Code | Claude Code 專案指南
|
|
2241
2279
|
# Generated by Universal Dev Standards CLI
|
|
@@ -2248,10 +2286,10 @@ All responses should be in **Traditional Chinese (繁體中文)**, with technica
|
|
|
2248
2286
|
AI 助手應以繁體中文回覆使用者的問題與請求。
|
|
2249
2287
|
|
|
2250
2288
|
## Core Standards Usage Rule / 核心標準使用規則
|
|
2251
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2252
|
-
>
|
|
2253
|
-
>
|
|
2254
|
-
>
|
|
2289
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2290
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2291
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2292
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2255
2293
|
> This ensures token efficiency and focused context.
|
|
2256
2294
|
> 這確保了 Token 效率和上下文聚焦。`
|
|
2257
2295
|
},
|
|
@@ -2266,8 +2304,8 @@ You are an expert software engineer assistant. Follow these project standards.
|
|
|
2266
2304
|
All responses should be in **English**.
|
|
2267
2305
|
|
|
2268
2306
|
## Core Standards Usage Rule
|
|
2269
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2270
|
-
>
|
|
2307
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2308
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2271
2309
|
> This ensures token efficiency and focused context.`,
|
|
2272
2310
|
'zh-tw': `# AGENTS.md - OpenAI Codex CLI 規則
|
|
2273
2311
|
# 由 Universal Dev Standards CLI 生成
|
|
@@ -2279,8 +2317,8 @@ All responses should be in **English**.
|
|
|
2279
2317
|
所有回覆必須使用**繁體中文 (Traditional Chinese)**。
|
|
2280
2318
|
|
|
2281
2319
|
## 核心標準使用規則 / Core Standards Usage Rule
|
|
2282
|
-
>
|
|
2283
|
-
>
|
|
2320
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2321
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2284
2322
|
> 這確保了 Token 效率和上下文聚焦。`,
|
|
2285
2323
|
bilingual: `# AGENTS.md - OpenAI Codex CLI Rules | OpenAI Codex CLI 規則
|
|
2286
2324
|
# Generated by Universal Dev Standards CLI
|
|
@@ -2295,10 +2333,10 @@ All responses should be in **Traditional Chinese (繁體中文)**, with technica
|
|
|
2295
2333
|
所有回覆必須使用**繁體中文**,技術術語可保留英文。
|
|
2296
2334
|
|
|
2297
2335
|
## Core Standards Usage Rule / 核心標準使用規則
|
|
2298
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2299
|
-
>
|
|
2300
|
-
>
|
|
2301
|
-
>
|
|
2336
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2337
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2338
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2339
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2302
2340
|
> This ensures token efficiency and focused context.
|
|
2303
2341
|
> 這確保了 Token 效率和上下文聚焦。`
|
|
2304
2342
|
},
|
|
@@ -2313,8 +2351,8 @@ You are an expert software engineer assistant powered by Gemini. Follow these pr
|
|
|
2313
2351
|
All responses should be in **English**.
|
|
2314
2352
|
|
|
2315
2353
|
## Core Standards Usage Rule
|
|
2316
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2317
|
-
>
|
|
2354
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2355
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2318
2356
|
> This ensures token efficiency and focused context.`,
|
|
2319
2357
|
'zh-tw': `# GEMINI.md - Gemini CLI 規則
|
|
2320
2358
|
# 由 Universal Dev Standards CLI 生成
|
|
@@ -2326,8 +2364,8 @@ All responses should be in **English**.
|
|
|
2326
2364
|
所有回覆必須使用**繁體中文 (Traditional Chinese)**。
|
|
2327
2365
|
|
|
2328
2366
|
## 核心標準使用規則 / Core Standards Usage Rule
|
|
2329
|
-
>
|
|
2330
|
-
>
|
|
2367
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2368
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2331
2369
|
> 這確保了 Token 效率和上下文聚焦。`,
|
|
2332
2370
|
bilingual: `# GEMINI.md - Gemini CLI Rules | Gemini CLI 規則
|
|
2333
2371
|
# Generated by Universal Dev Standards CLI
|
|
@@ -2342,10 +2380,10 @@ All responses should be in **Traditional Chinese (繁體中文)**, with technica
|
|
|
2342
2380
|
所有回覆必須使用**繁體中文**,技術術語可保留英文。
|
|
2343
2381
|
|
|
2344
2382
|
## Core Standards Usage Rule / 核心標準使用規則
|
|
2345
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2346
|
-
>
|
|
2347
|
-
>
|
|
2348
|
-
>
|
|
2383
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2384
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2385
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2386
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2349
2387
|
> This ensures token efficiency and focused context.
|
|
2350
2388
|
> 這確保了 Token 效率和上下文聚焦。`
|
|
2351
2389
|
},
|
|
@@ -2360,8 +2398,8 @@ You are an expert software engineer assistant. Follow these project standards.
|
|
|
2360
2398
|
All responses should be in **English**.
|
|
2361
2399
|
|
|
2362
2400
|
## Core Standards Usage Rule
|
|
2363
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2364
|
-
>
|
|
2401
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2402
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2365
2403
|
> This ensures token efficiency and focused context.`,
|
|
2366
2404
|
'zh-tw': `# AGENTS.md - OpenCode 規則
|
|
2367
2405
|
# 由 Universal Dev Standards CLI 生成
|
|
@@ -2373,8 +2411,8 @@ All responses should be in **English**.
|
|
|
2373
2411
|
所有回覆必須使用**繁體中文 (Traditional Chinese)**。
|
|
2374
2412
|
|
|
2375
2413
|
## 核心標準使用規則 / Core Standards Usage Rule
|
|
2376
|
-
>
|
|
2377
|
-
>
|
|
2414
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2415
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2378
2416
|
> 這確保了 Token 效率和上下文聚焦。`,
|
|
2379
2417
|
bilingual: `# AGENTS.md - OpenCode Rules | OpenCode 規則
|
|
2380
2418
|
# Generated by Universal Dev Standards CLI
|
|
@@ -2389,15 +2427,61 @@ All responses should be in **Traditional Chinese (繁體中文)**, with technica
|
|
|
2389
2427
|
所有回覆必須使用**繁體中文**,技術術語可保留英文。
|
|
2390
2428
|
|
|
2391
2429
|
## Core Standards Usage Rule / 核心標準使用規則
|
|
2392
|
-
> When verifying standards, checking code, or performing tasks,
|
|
2393
|
-
>
|
|
2394
|
-
>
|
|
2395
|
-
>
|
|
2430
|
+
> When verifying standards, checking code, or performing tasks, read the rules in \`.standards/\` — that is where this project's standards are installed.
|
|
2431
|
+
> 當驗證標準、檢查程式碼或執行任務時,讀取 \`.standards/\` 裡的規則——那是本專案標準實際安裝的位置。
|
|
2432
|
+
> Each file states its own requirements; read the one the task is about rather than all of them.
|
|
2433
|
+
> 每個檔案各自寫明它要求什麼;讀與當下任務相關的那一份,不必全部讀完。
|
|
2396
2434
|
> This ensures token efficiency and focused context.
|
|
2397
2435
|
> 這確保了 Token 效率和上下文聚焦。`
|
|
2398
2436
|
}
|
|
2399
2437
|
};
|
|
2400
2438
|
|
|
2439
|
+
/**
|
|
2440
|
+
* Generate the index disclosure that opens every UDS-managed block.
|
|
2441
|
+
*
|
|
2442
|
+
* XSPEC-357 R7 — the block an adopter receives is an index. In no content mode
|
|
2443
|
+
* does it carry rule bodies, and inlining them is not an option: 143 `.ai.yaml`
|
|
2444
|
+
* files come to roughly 248k tokens. What can be fixed is the block pretending
|
|
2445
|
+
* otherwise. A file that lists 72 standard paths under a heading reading
|
|
2446
|
+
* "Standards Compliance Instructions" reads, to an agent, like the compliance
|
|
2447
|
+
* instructions — and Codex was measured on 2026-07-23 doing exactly that:
|
|
2448
|
+
* it enumerated the standards and opened none of them.
|
|
2449
|
+
*
|
|
2450
|
+
* This wording was added to the universal `AGENTS.md` summary on 2026-08-18
|
|
2451
|
+
* (`generateAgentsMdSummary`). That fixed one of the two producers. The other
|
|
2452
|
+
* one is this — and the split is worse than it sounds, because the two are
|
|
2453
|
+
* mutually exclusive for the same filename: selecting codex or opencode turns
|
|
2454
|
+
* the universal summary OFF and routes `AGENTS.md` through here instead. The
|
|
2455
|
+
* disclosure written for Codex was therefore in the only file a Codex adopter
|
|
2456
|
+
* never receives. Measured 2026-08-20 before this change: 8 distinct adopter
|
|
2457
|
+
* files across 3 content modes, 0 carrying the disclosure.
|
|
2458
|
+
*
|
|
2459
|
+
* @param {string} format - Output format: 'markdown' or 'plaintext'
|
|
2460
|
+
* @param {string} language - Language: 'en', 'zh-tw', 'zh-cn' or 'bilingual'
|
|
2461
|
+
* @returns {string} Disclosure paragraph, already format-adjusted
|
|
2462
|
+
*/
|
|
2463
|
+
export function generateIndexDisclosure(format, language = 'en') {
|
|
2464
|
+
const lines = language === 'en'
|
|
2465
|
+
? [
|
|
2466
|
+
'**This block is an index, not the standards.** The rules are NOT reproduced here.',
|
|
2467
|
+
'Before acting on anything below, open the relevant file under `.standards/` and',
|
|
2468
|
+
'follow its contents. Working from this block alone means working without the',
|
|
2469
|
+
'standards.'
|
|
2470
|
+
]
|
|
2471
|
+
: [
|
|
2472
|
+
'**這個區塊是索引,不是標準本文。** 規則並未複製於此。',
|
|
2473
|
+
'在依照下方任何一項行動之前,請打開 `.standards/` 底下對應的檔案並遵守其內容。',
|
|
2474
|
+
'只憑這個區塊工作,等同於沒有採用標準。'
|
|
2475
|
+
];
|
|
2476
|
+
|
|
2477
|
+
if (format === 'markdown') {
|
|
2478
|
+
return lines.map((l) => `> ${l}`).join('\n');
|
|
2479
|
+
}
|
|
2480
|
+
// Plaintext targets (.cursorrules / .clinerules / .windsurfrules) render
|
|
2481
|
+
// neither blockquotes nor backticks, so both are stripped rather than shown.
|
|
2482
|
+
return lines.map((l) => l.replace(/\*\*/g, '').replace(/`/g, '')).join('\n');
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2401
2485
|
/**
|
|
2402
2486
|
* Generate minimal standards reference for minimal content mode
|
|
2403
2487
|
* @param {string[]} installedStandards - List of installed standard file paths
|
|
@@ -2662,6 +2746,86 @@ function generateWorkflowGateContent(language) {
|
|
|
2662
2746
|
* @param {Object} config - Integration configuration
|
|
2663
2747
|
* @returns {string} Generated content
|
|
2664
2748
|
*/
|
|
2749
|
+
/**
|
|
2750
|
+
* Point every `.standards/<file>` reference at the file this project actually has.
|
|
2751
|
+
*
|
|
2752
|
+
* `RULE_TEMPLATES` spells its references as `.standards/<name>.md` because that
|
|
2753
|
+
* is what UDS shipped when they were written. A project installed with
|
|
2754
|
+
* `--format ai` holds `<name>.ai.yaml`, so those lines named files that are not
|
|
2755
|
+
* there — reproduced on 6.9.0 (2026-09-16): a clean `--format ai` project got
|
|
2756
|
+
* `.standards/anti-hallucination.md` and `.standards/checkin-standards.md`, and
|
|
2757
|
+
* `uds check` called the file in sync because it compared names with the
|
|
2758
|
+
* extension stripped and never asked whether the file existed.
|
|
2759
|
+
*
|
|
2760
|
+
* Rewrites by stem against the installed set; a reference whose standard this
|
|
2761
|
+
* project did not install is dropped rather than left dangling, and if that
|
|
2762
|
+
* empties the line, the line goes too.
|
|
2763
|
+
*
|
|
2764
|
+
* @param {string} content - Generated integration content
|
|
2765
|
+
* @param {string[]} installedStandards - Manifest standards (IDs or paths)
|
|
2766
|
+
* @param {string} standardsFormat - 'ai' | 'human'
|
|
2767
|
+
* @returns {string}
|
|
2768
|
+
*/
|
|
2769
|
+
function resolveStandardReferences(content, installedStandards = [], standardsFormat = 'ai', projectPath = null) {
|
|
2770
|
+
if (!content) return content;
|
|
2771
|
+
|
|
2772
|
+
const stemOf = (value) => basename(String(value)).replace(/\.(ai\.yaml|yaml|md)$/i, '');
|
|
2773
|
+
// Every stem UDS itself ships — the only references this function may delete.
|
|
2774
|
+
//
|
|
2775
|
+
// Read defensively: this runs inside pure content generation, and callers
|
|
2776
|
+
// (including this repo's own tests) may have the registry or `fs` mocked. A
|
|
2777
|
+
// registry that cannot be read means "delete nothing", which degrades to
|
|
2778
|
+
// rewriting matched paths only — never to removing a line.
|
|
2779
|
+
const udsOwnedStems = new Set();
|
|
2780
|
+
try {
|
|
2781
|
+
for (const std of getAllStandards()) {
|
|
2782
|
+
if (std?.id) udsOwnedStems.add(stemOf(std.id));
|
|
2783
|
+
const sources = typeof std?.source === 'string'
|
|
2784
|
+
? [std.source]
|
|
2785
|
+
: [std?.source?.ai, std?.source?.human].filter(Boolean);
|
|
2786
|
+
for (const src of sources) udsOwnedStems.add(stemOf(src));
|
|
2787
|
+
}
|
|
2788
|
+
} catch {
|
|
2789
|
+
// Registry unavailable — keep every reference that does not match.
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
const installedByStem = new Map();
|
|
2793
|
+
for (const entry of installedStandards) {
|
|
2794
|
+
const filename = resolveStandardFilename(entry, standardsFormat) || basename(String(entry));
|
|
2795
|
+
installedByStem.set(stemOf(entry), filename);
|
|
2796
|
+
installedByStem.set(stemOf(filename), filename);
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2799
|
+
const referenceLine = /^([^\n]*(?:Reference|參考|参考)[::])([^\n]*)$/gim;
|
|
2800
|
+
return content.replace(referenceLine, (line, label, rest) => {
|
|
2801
|
+
let dropped = 0;
|
|
2802
|
+
let kept = 0;
|
|
2803
|
+
const rewritten = rest.replace(/(\.standards\/)([^\s,`)\]]+)/g, (match, prefix, path) => {
|
|
2804
|
+
// Option files live in `.standards/options/…` and are named by path, not ID.
|
|
2805
|
+
if (path.startsWith('options/')) { kept++; return match; }
|
|
2806
|
+
const actual = installedByStem.get(stemOf(path));
|
|
2807
|
+
if (actual) { kept++; return `${prefix}${actual}`; }
|
|
2808
|
+
|
|
2809
|
+
// 🔴 Only UDS's own standards may be dropped. The first version of this
|
|
2810
|
+
// rewrite removed every unmatched reference, which deleted a project's own
|
|
2811
|
+
// `.standards/our-house-rule.md` line — a file it had put there on purpose.
|
|
2812
|
+
// Removing a user's line is worse than the dead link this exists to fix.
|
|
2813
|
+
let onDisk = false;
|
|
2814
|
+
try {
|
|
2815
|
+
onDisk = Boolean(projectPath) && existsSync(join(projectPath, '.standards', path));
|
|
2816
|
+
} catch {
|
|
2817
|
+
onDisk = false;
|
|
2818
|
+
}
|
|
2819
|
+
if (onDisk || !udsOwnedStems.has(stemOf(path))) { kept++; return match; }
|
|
2820
|
+
dropped++;
|
|
2821
|
+
return '';
|
|
2822
|
+
});
|
|
2823
|
+
if (kept === 0 && dropped > 0) return '';
|
|
2824
|
+
// Tidy the separators left behind by a dropped path.
|
|
2825
|
+
return `${label}${rewritten.replace(/,\s*,/g, ',').replace(/[::]?\s*,\s*$/, '').replace(/\s+,/g, ',')}`;
|
|
2826
|
+
}).replace(/\n{3,}/g, '\n\n');
|
|
2827
|
+
}
|
|
2828
|
+
|
|
2665
2829
|
export function generateIntegrationContent(config) {
|
|
2666
2830
|
const {
|
|
2667
2831
|
tool,
|
|
@@ -2733,6 +2897,10 @@ export function generateIntegrationContent(config) {
|
|
|
2733
2897
|
}
|
|
2734
2898
|
|
|
2735
2899
|
if (installedStandards.length > 0) {
|
|
2900
|
+
// XSPEC-357 R7 — every mode, every tool. Placed first because it is a
|
|
2901
|
+
// precondition for reading the rest, not a footnote to it.
|
|
2902
|
+
standardsContent = generateIndexDisclosure(format, language) + '\n\n' + standardsContent;
|
|
2903
|
+
|
|
2736
2904
|
if (contentMode === 'minimal') {
|
|
2737
2905
|
// Minimal mode: simple reference list
|
|
2738
2906
|
standardsContent += generateMinimalStandardsReference(
|
|
@@ -2812,7 +2980,8 @@ export function generateIntegrationContent(config) {
|
|
|
2812
2980
|
sections.push('\n');
|
|
2813
2981
|
}
|
|
2814
2982
|
|
|
2815
|
-
|
|
2983
|
+
const assembled = sections.join('\n').trim() + '\n';
|
|
2984
|
+
return resolveStandardReferences(assembled, installedStandards, standardsFormat, config.projectPath || null);
|
|
2816
2985
|
}
|
|
2817
2986
|
|
|
2818
2987
|
/**
|
|
@@ -2895,6 +3064,19 @@ export function writeIntegrationFile(tool, config, projectPath) {
|
|
|
2895
3064
|
}
|
|
2896
3065
|
}
|
|
2897
3066
|
|
|
3067
|
+
// 🔴 The rule sections live OUTSIDE the markers, so a marker-based update
|
|
3068
|
+
// never refreshes them: a file first written by an older CLI kept
|
|
3069
|
+
// `.standards/commit-message-guide.md` for ever, and a regenerate on the
|
|
3070
|
+
// fixed generator still left it (measured 2026-09-16). Repoint stale
|
|
3071
|
+
// `.standards/` paths across the whole file — it touches nothing but the
|
|
3072
|
+
// paths, and a path to a file that is not there helps no reader.
|
|
3073
|
+
content = resolveStandardReferences(
|
|
3074
|
+
content,
|
|
3075
|
+
config.installedStandards || [],
|
|
3076
|
+
config.standardsFormat || 'ai',
|
|
3077
|
+
projectPath
|
|
3078
|
+
);
|
|
3079
|
+
|
|
2898
3080
|
writeFileSync(filePath, content);
|
|
2899
3081
|
|
|
2900
3082
|
// Compute block hash for tracking UDS content separately from user content
|
|
@@ -3123,9 +3305,19 @@ function withSelectedOptions(manifest) {
|
|
|
3123
3305
|
|
|
3124
3306
|
export function buildToolIntegrationConfig(manifest, tool) {
|
|
3125
3307
|
const selected = manifest.options?.output_language || manifest.options?.commit_language || 'english';
|
|
3126
|
-
|
|
3308
|
+
|
|
3309
|
+
// Content language comes from `display_language` — the setting whose entire
|
|
3310
|
+
// job is "what language do you want to read" — and only falls back to
|
|
3311
|
+
// `output_language`, which is the commit-message language, when the project
|
|
3312
|
+
// has no display setting to go on. They are different questions: `uds init`
|
|
3313
|
+
// has always used the first, every regeneration path used the second, and a
|
|
3314
|
+
// project installed with `--locale zh-tw` therefore got Chinese instructions
|
|
3315
|
+
// from `init` and English ones from the next `uds update`, silently.
|
|
3316
|
+
const display = manifest.options?.display_language;
|
|
3317
|
+
const fromOutput = selected === 'bilingual'
|
|
3127
3318
|
? 'bilingual'
|
|
3128
3319
|
: selected === 'traditional-chinese' ? 'zh-tw' : 'en';
|
|
3320
|
+
const language = ['en', 'zh-tw', 'bilingual'].includes(display) ? display : fromOutput;
|
|
3129
3321
|
const resolved = resolveContentModeForTool(tool, manifest.contentMode || 'auto');
|
|
3130
3322
|
|
|
3131
3323
|
return {
|
|
@@ -3353,6 +3545,7 @@ export function generateAgentsMdSummary(config = {}) {
|
|
|
3353
3545
|
language = 'en',
|
|
3354
3546
|
outputLanguage = 'english',
|
|
3355
3547
|
standardOptions = {},
|
|
3548
|
+
standardsFormat = 'ai',
|
|
3356
3549
|
projectPath
|
|
3357
3550
|
} = config;
|
|
3358
3551
|
|
|
@@ -3445,12 +3638,25 @@ export function generateAgentsMdSummary(config = {}) {
|
|
|
3445
3638
|
// only the option files. On one adopter that meant seven lines standing in
|
|
3446
3639
|
// for seventy, under a heading reading "Installed Standards", with nothing
|
|
3447
3640
|
// anywhere reporting the sixty-three that had been dropped.
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3641
|
+
// Two things this used to get wrong, both of which produced a list of paths
|
|
3642
|
+
// that are not there — under a heading telling the agent to read them.
|
|
3643
|
+
//
|
|
3644
|
+
// Options install one directory deeper (`.standards/options/…`), and this
|
|
3645
|
+
// wrote every entry at the top level. The sibling renderer in this file has
|
|
3646
|
+
// always handled that; the docblock above it says a previous fix reached
|
|
3647
|
+
// "one of the two producers", and this is the other one.
|
|
3648
|
+
//
|
|
3649
|
+
// And the format was pinned to `ai`, so a `--format human` project was
|
|
3650
|
+
// handed `.ai.yaml` names for files it holds as `.md`.
|
|
3651
|
+
const format = standardsFormat === 'human' ? 'human' : 'ai';
|
|
3652
|
+
const suffix = format === 'human' ? '.md' : '.ai.yaml';
|
|
3653
|
+
|
|
3654
|
+
for (const entry of installedStandards) {
|
|
3655
|
+
const filename = resolveStandardFilename(entry, format);
|
|
3656
|
+
if (!filename?.endsWith(suffix)) continue;
|
|
3657
|
+
const isOption = entry.includes('/options/') || entry.includes('\\options\\');
|
|
3658
|
+
const dir = isOption ? '.standards/options' : '.standards';
|
|
3659
|
+
lines.push(`- \`${dir}/${filename}\` — ${filename.replace(suffix, '')}`);
|
|
3454
3660
|
}
|
|
3455
3661
|
} else {
|
|
3456
3662
|
lines.push('No standards installed yet. Run `npx uds init` to install.');
|