universal-dev-standards 6.7.5 → 6.8.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.
Files changed (35) hide show
  1. package/bin/uds.js +7 -0
  2. package/bundled/ai/standards/ai-instruction-standards.ai.yaml +6 -6
  3. package/bundled/core/ai-instruction-standards.md +9 -7
  4. package/bundled/locales/zh-CN/CHANGELOG.md +21 -3
  5. package/bundled/locales/zh-CN/README.md +6 -6
  6. package/bundled/locales/zh-CN/SECURITY.md +1 -1
  7. package/bundled/locales/zh-CN/core/ai-instruction-standards.md +10 -8
  8. package/bundled/locales/zh-CN/docs/CHEATSHEET.md +20 -6
  9. package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +149 -11
  10. package/bundled/locales/zh-CN/skills/agents/README.md +1 -1
  11. package/bundled/locales/zh-CN/skills/reverse-engineer/tdd-analysis.md +13 -23
  12. package/bundled/locales/zh-CN/skills/workflows/README.md +2 -11
  13. package/bundled/locales/zh-TW/CHANGELOG.md +21 -3
  14. package/bundled/locales/zh-TW/README.md +6 -6
  15. package/bundled/locales/zh-TW/SECURITY.md +1 -1
  16. package/bundled/locales/zh-TW/core/ai-instruction-standards.md +10 -8
  17. package/bundled/locales/zh-TW/docs/CHEATSHEET.md +20 -6
  18. package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +149 -11
  19. package/bundled/locales/zh-TW/skills/agents/README.md +1 -1
  20. package/bundled/locales/zh-TW/skills/reverse-engineer/tdd-analysis.md +13 -23
  21. package/bundled/locales/zh-TW/skills/workflows/README.md +2 -11
  22. package/bundled/skills/agents/README.md +1 -1
  23. package/bundled/skills/reverse-engineer/tdd-analysis.md +16 -23
  24. package/bundled/skills/workflows/README.md +2 -11
  25. package/package.json +4 -2
  26. package/src/commands/lint.js +96 -0
  27. package/src/commands/quickstart.js +16 -13
  28. package/src/i18n/messages.js +3 -3
  29. package/src/reconciler/actual-state-scanner.js +14 -3
  30. package/src/utils/hasher.js +63 -8
  31. package/src/utils/integration-generator.js +21 -3
  32. package/src/utils/skills-installer.js +17 -3
  33. package/src/utils/spec-linter.js +35 -76
  34. package/standards-registry.json +7 -7
  35. package/src/commands/sync.js +0 -133
@@ -1,133 +0,0 @@
1
- /**
2
- * Sync Command — Export current work context for session resume
3
- * Zero AI tokens — pure shell/JS execution
4
- *
5
- * @module commands/sync
6
- * @see specs/superspec-borrowing-phase1-2-spec.md (AC-16, AC-17)
7
- */
8
-
9
- import { execSync } from 'child_process';
10
- import { readFileSync, writeFileSync, existsSync, readdirSync, mkdirSync } from 'fs';
11
- import { join } from 'path';
12
-
13
- const MAX_LINES = 500;
14
-
15
- /**
16
- * Generate context.md from git info and optional workflow state
17
- * @param {string} projectPath - Project root directory
18
- * @returns {string} Path to generated context.md
19
- */
20
- export function generateContext(projectPath) {
21
- const lines = [];
22
-
23
- lines.push('# Development Context');
24
- lines.push(`> Auto-generated by \`uds sync\` at ${new Date().toISOString()}`);
25
- lines.push('> This file helps restore context in a new AI session.');
26
- lines.push('');
27
-
28
- // ─── Git Status ───
29
- lines.push('## Git Status');
30
- lines.push('');
31
-
32
- const branch = gitCmd('git rev-parse --abbrev-ref HEAD', projectPath);
33
- lines.push(`- **Branch**: ${branch}`);
34
-
35
- const baseBranch = detectBaseBranch(projectPath);
36
- if (baseBranch && baseBranch !== branch) {
37
- const commitCount = gitCmd(`git rev-list --count ${baseBranch}..HEAD`, projectPath) || '0';
38
- lines.push(`- **Base**: ${baseBranch} (+${commitCount} commits)`);
39
- }
40
-
41
- lines.push('');
42
- lines.push('### Recent Commits');
43
- lines.push('');
44
-
45
- const logOutput = gitCmd('git log --oneline -20', projectPath);
46
- if (logOutput) {
47
- lines.push(...logOutput.split('\n').map(l => `- ${l}`));
48
- } else {
49
- lines.push('(no commits)');
50
- }
51
- lines.push('');
52
-
53
- lines.push('### Changed Files');
54
- lines.push('');
55
-
56
- if (baseBranch && baseBranch !== branch) {
57
- const diffStat = gitCmd(`git diff --stat ${baseBranch}..HEAD`, projectPath);
58
- if (diffStat) {
59
- lines.push('```');
60
- lines.push(...diffStat.split('\n'));
61
- lines.push('```');
62
- }
63
- } else {
64
- lines.push('(on base branch, no diff)');
65
- }
66
- lines.push('');
67
-
68
- // ─── Workflow State ───
69
- const workflowState = readWorkflowState(projectPath);
70
- if (workflowState) {
71
- lines.push('## Workflow State');
72
- lines.push('');
73
- lines.push(...workflowState);
74
- lines.push('');
75
- }
76
-
77
- // Truncate to MAX_LINES
78
- const truncated = lines.slice(0, MAX_LINES);
79
-
80
- // Write to .workflow-state/context.md
81
- const outputDir = join(projectPath, '.workflow-state');
82
- mkdirSync(outputDir, { recursive: true });
83
- const outputPath = join(outputDir, 'context.md');
84
- writeFileSync(outputPath, truncated.join('\n'), 'utf-8');
85
-
86
- return outputPath;
87
- }
88
-
89
- // ─── Helpers ───
90
-
91
- function gitCmd(cmd, cwd) {
92
- try {
93
- return execSync(cmd, { cwd, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
94
- } catch {
95
- return '';
96
- }
97
- }
98
-
99
- function detectBaseBranch(projectPath) {
100
- // Check for common base branches
101
- for (const name of ['main', 'master']) {
102
- const exists = gitCmd(`git rev-parse --verify ${name}`, projectPath);
103
- if (exists) return name;
104
- }
105
- return null;
106
- }
107
-
108
- function readWorkflowState(projectPath) {
109
- const stateDir = join(projectPath, '.workflow-state');
110
- if (!existsSync(stateDir)) return null;
111
-
112
- const yamlFiles = readdirSync(stateDir)
113
- .filter(f => f.endsWith('.yaml') && !f.endsWith('.log.yaml'))
114
- .sort();
115
-
116
- if (yamlFiles.length === 0) return null;
117
-
118
- // Read the most recent state file
119
- const latestFile = yamlFiles[yamlFiles.length - 1];
120
- const content = readFileSync(join(stateDir, latestFile), 'utf-8');
121
-
122
- const lines = [];
123
- // Extract key fields
124
- const specMatch = content.match(/spec_id:\s*(.+)/);
125
- const phaseMatch = content.match(/current_phase:\s*(.+)/);
126
- const statusMatch = content.match(/status:\s*(.+)/);
127
-
128
- if (specMatch) lines.push(`- **Spec**: ${specMatch[1].trim()}`);
129
- if (phaseMatch) lines.push(`- **Phase**: ${phaseMatch[1].trim()}`);
130
- if (statusMatch) lines.push(`- **Status**: ${statusMatch[1].trim()}`);
131
-
132
- return lines.length > 0 ? lines : null;
133
- }