universal-dev-standards 5.0.0-beta.5 → 5.0.0-beta.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-dev-standards",
3
- "version": "5.0.0-beta.5",
3
+ "version": "5.0.0-beta.6",
4
4
  "description": "CLI tool for adopting Universal Development Standards",
5
5
  "keywords": [
6
6
  "documentation",
@@ -2,7 +2,7 @@ import chalk from 'chalk';
2
2
  import ora from 'ora';
3
3
  import { execSync } from 'child_process';
4
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
5
- import { join } from 'path';
5
+ import { basename, join } from 'path';
6
6
  import {
7
7
  manifestExists as isInitialized
8
8
  } from '../core/manifest.js';
@@ -88,6 +88,7 @@ export async function initCommand(options) {
88
88
 
89
89
  // 1. Install Standards
90
90
  const standardsResults = await installStandards(config, projectPath);
91
+ config.installedStandards = standardsResults.standards.map(s => basename(s));
91
92
 
92
93
  // 2. Install Integrations
93
94
  const integrationResults = await installIntegrations(config, projectPath);
@@ -5,6 +5,7 @@ import {
5
5
  integrationFileExists,
6
6
  getToolFilePath
7
7
  } from '../utils/integration-generator.js';
8
+ import { calculateCategoriesFromStandards } from '../utils/reference-sync.js';
8
9
  import { t } from '../i18n/messages.js';
9
10
 
10
11
  /**
@@ -105,10 +106,15 @@ export async function installIntegrations(config, projectPath) {
105
106
  }
106
107
 
107
108
  // Build enhanced config with installed standards
109
+ // Filter categories to only those backed by installed standards to avoid orphaned references
110
+ const requestedCategories = integrationConfigs[tool]?.categories || ['anti-hallucination', 'commit-standards', 'code-review'];
111
+ const validCategories = installedStandards.length > 0
112
+ ? requestedCategories.filter(cat => calculateCategoriesFromStandards(installedStandards).includes(cat))
113
+ : requestedCategories;
108
114
  const enhancedConfig = {
109
115
  ...integrationConfigs[tool],
110
116
  tool,
111
- categories: integrationConfigs[tool]?.categories || ['anti-hallucination', 'commit-standards', 'code-review'],
117
+ categories: validCategories,
112
118
  language: integrationConfigs[tool]?.language || commonLanguage,
113
119
  installedStandards,
114
120
  contentMode,
@@ -200,9 +206,13 @@ export async function generateClaudeMd(config, projectPath) {
200
206
 
201
207
  const claudeSpinner = ora(msg.generatingClaudeMd).start();
202
208
 
209
+ // Derive categories from installedStandards to avoid referencing non-installed standards
210
+ const categories = installedStandards.length > 0
211
+ ? calculateCategoriesFromStandards(installedStandards)
212
+ : ['anti-hallucination', 'commit-standards', 'code-review'];
203
213
  const claudeConfig = {
204
214
  tool: 'claude-code',
205
- categories: ['anti-hallucination', 'commit-standards', 'code-review'],
215
+ categories,
206
216
  languages: [],
207
217
  exclusions: [],
208
218
  customRules: [],
@@ -26,7 +26,7 @@ export const CATEGORY_TO_STANDARDS = {
26
26
  * Reverse mapping from standard filename to category ID
27
27
  */
28
28
  export const STANDARD_TO_CATEGORY = {
29
- // Core Rules
29
+ // Core Rules (human .md format)
30
30
  'anti-hallucination.md': 'anti-hallucination',
31
31
  'commit-message-guide.md': 'commit-standards',
32
32
  'code-review-checklist.md': 'code-review',
@@ -40,6 +40,20 @@ export const STANDARD_TO_CATEGORY = {
40
40
  'project-structure.md': 'project-structure',
41
41
  'refactoring-standards.md': 'refactoring',
42
42
  'requirement-engineering.md': 'requirement',
43
+ // Core Rules (AI .ai.yaml format)
44
+ 'anti-hallucination.ai.yaml': 'anti-hallucination',
45
+ 'commit-message.ai.yaml': 'commit-standards',
46
+ 'code-review.ai.yaml': 'code-review',
47
+ 'checkin-standards.ai.yaml': 'code-review',
48
+ 'spec-driven-development.ai.yaml': 'spec-driven-development',
49
+ 'testing.ai.yaml': 'testing',
50
+ 'documentation-structure.ai.yaml': 'documentation',
51
+ 'git-workflow.ai.yaml': 'git-workflow',
52
+ 'error-codes.ai.yaml': 'error-handling',
53
+ 'logging.ai.yaml': 'error-handling',
54
+ 'project-structure.ai.yaml': 'project-structure',
55
+ 'refactoring-standards.ai.yaml': 'refactoring',
56
+ 'requirement-engineering.ai.yaml': 'requirement',
43
57
  // Guides (educational content)
44
58
  'anti-hallucination-guide.md': 'anti-hallucination',
45
59
  'sdd-guide.md': 'spec-driven-development',
@@ -104,26 +118,43 @@ export function getStandardCategory(sourcePath) {
104
118
  * - syncedRefs: Standards that are properly synced
105
119
  */
106
120
  export function compareStandardsWithReferences(manifestStandards, integrationReferences) {
107
- // Get filenames from manifest standards (only those that have category mappings)
108
- const manifestFileNames = new Set();
121
+ // Compare at category level to handle .md vs .ai.yaml format differences
122
+ // e.g., manifest has 'anti-hallucination.ai.yaml' but integration references 'anti-hallucination.md'
123
+ const manifestCategories = new Set();
109
124
  for (const std of manifestStandards) {
110
125
  const fileName = std.split('/').pop();
111
- // Only include standards that are part of the category system
112
- if (STANDARD_TO_CATEGORY[fileName]) {
113
- manifestFileNames.add(fileName);
126
+ const category = STANDARD_TO_CATEGORY[fileName];
127
+ if (category) {
128
+ manifestCategories.add(category);
114
129
  }
115
130
  }
116
131
 
117
- const refSet = new Set(integrationReferences);
118
-
119
- // References in integration file but not in manifest
120
- const orphanedRefs = integrationReferences.filter(ref => !manifestFileNames.has(ref));
132
+ // References in integration file but not backed by any manifest standard (by category)
133
+ const orphanedRefs = integrationReferences.filter(ref => {
134
+ const category = STANDARD_TO_CATEGORY[ref];
135
+ return !category || !manifestCategories.has(category);
136
+ });
121
137
 
122
- // Standards in manifest but not referenced
123
- const missingRefs = [...manifestFileNames].filter(fileName => !refSet.has(fileName));
138
+ // Categories in manifest but not referenced in integration file
139
+ const refCategories = new Set();
140
+ for (const ref of integrationReferences) {
141
+ const category = STANDARD_TO_CATEGORY[ref];
142
+ if (category) {
143
+ refCategories.add(category);
144
+ }
145
+ }
146
+ const missingCategories = [...manifestCategories].filter(cat => !refCategories.has(cat));
147
+ // Convert missing categories back to representative filenames for reporting
148
+ const missingRefs = missingCategories.flatMap(cat => {
149
+ const paths = CATEGORY_TO_STANDARDS[cat] || [];
150
+ return paths.map(p => p.split('/').pop());
151
+ });
124
152
 
125
153
  // Properly synced references
126
- const syncedRefs = integrationReferences.filter(ref => manifestFileNames.has(ref));
154
+ const syncedRefs = integrationReferences.filter(ref => {
155
+ const category = STANDARD_TO_CATEGORY[ref];
156
+ return category && manifestCategories.has(category);
157
+ });
127
158
 
128
159
  return { orphanedRefs, missingRefs, syncedRefs };
129
160
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "version": "5.0.0-beta.5",
3
+ "version": "5.0.0-beta.6",
4
4
  "lastUpdated": "2026-02-04",
5
5
  "description": "Standards registry for universal-dev-standards with integrated skills and AI-optimized formats",
6
6
  "formats": {
@@ -48,14 +48,14 @@
48
48
  "standards": {
49
49
  "name": "universal-dev-standards",
50
50
  "url": "https://github.com/AsiaOstrich/universal-dev-standards",
51
- "version": "5.0.0-beta.5"
51
+ "version": "5.0.0-beta.6"
52
52
  },
53
53
  "skills": {
54
54
  "name": "universal-dev-standards",
55
55
  "url": "https://github.com/AsiaOstrich/universal-dev-standards",
56
56
  "localPath": "skills",
57
57
  "rawUrl": "https://raw.githubusercontent.com/AsiaOstrich/universal-dev-standards/main/skills",
58
- "version": "5.0.0-beta.5",
58
+ "version": "5.0.0-beta.6",
59
59
  "note": "Skills are now included in the main repository under skills/"
60
60
  }
61
61
  },