sedd 0.1.4 → 0.1.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/README.md +59 -10
- package/commands/sedd.clarify.md +54 -1
- package/commands/sedd.dashboard.md +24 -126
- package/commands/sedd.implement.md +139 -4
- package/dist/cli/index.js +17 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/status.d.ts.map +1 -1
- package/dist/cli/status.js +0 -2
- package/dist/cli/status.js.map +1 -1
- package/dist/cli/update.d.ts +7 -0
- package/dist/cli/update.d.ts.map +1 -0
- package/dist/cli/update.js +390 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/cli/version-check.d.ts +9 -0
- package/dist/cli/version-check.d.ts.map +1 -0
- package/dist/cli/version-check.js +48 -0
- package/dist/cli/version-check.js.map +1 -0
- package/hooks/README.md +20 -0
- package/hooks/check-roadmap.js +33 -8
- package/hooks/check-roadmap.ps1 +71 -6
- package/package.json +1 -1
- package/templates/acceptance-template.md +39 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/cli/update.ts"],"names":[],"mappings":"AAYA,UAAU,aAAa;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAsVD,wBAAsB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqIvE"}
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, copyFileSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { checkForUpdates, showUpdateNotification, getInstalledVersion } from './version-check.js';
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const TEMPLATES_DIR = join(__dirname, '../../templates');
|
|
8
|
+
const COMMANDS_DIR = join(__dirname, '../../commands');
|
|
9
|
+
const HOOKS_DIR = join(__dirname, '../../hooks');
|
|
10
|
+
const SCRIPTS_DIR = join(__dirname, '../../scripts');
|
|
11
|
+
function countDirectoryFiles(dir) {
|
|
12
|
+
if (!existsSync(dir))
|
|
13
|
+
return 0;
|
|
14
|
+
let count = 0;
|
|
15
|
+
for (const item of readdirSync(dir, { withFileTypes: true })) {
|
|
16
|
+
if (item.isDirectory()) {
|
|
17
|
+
count += countDirectoryFiles(join(dir, item.name));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
count++;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return count;
|
|
24
|
+
}
|
|
25
|
+
function copyDirectory(src, dest) {
|
|
26
|
+
if (!existsSync(src))
|
|
27
|
+
return 0;
|
|
28
|
+
mkdirSync(dest, { recursive: true });
|
|
29
|
+
let count = 0;
|
|
30
|
+
for (const item of readdirSync(src, { withFileTypes: true })) {
|
|
31
|
+
const srcPath = join(src, item.name);
|
|
32
|
+
const destPath = join(dest, item.name);
|
|
33
|
+
if (item.isDirectory()) {
|
|
34
|
+
count += copyDirectory(srcPath, destPath);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
copyFileSync(srcPath, destPath);
|
|
38
|
+
count++;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return count;
|
|
42
|
+
}
|
|
43
|
+
function previewFileCounts() {
|
|
44
|
+
return {
|
|
45
|
+
templates: countDirectoryFiles(TEMPLATES_DIR),
|
|
46
|
+
commands: countDirectoryFiles(COMMANDS_DIR),
|
|
47
|
+
hooks: countDirectoryFiles(HOOKS_DIR),
|
|
48
|
+
scripts: countDirectoryFiles(SCRIPTS_DIR),
|
|
49
|
+
schema: existsSync(join(TEMPLATES_DIR, 'sedd.schema.json')),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function scanFeatures(seddDir) {
|
|
53
|
+
const features = [];
|
|
54
|
+
if (!existsSync(seddDir))
|
|
55
|
+
return features;
|
|
56
|
+
const items = readdirSync(seddDir, { withFileTypes: true });
|
|
57
|
+
for (const item of items) {
|
|
58
|
+
if (!item.isDirectory() || !/^\d{3}-/.test(item.name))
|
|
59
|
+
continue;
|
|
60
|
+
if (item.name === 'templates' || item.name === 'scripts' || item.name === 'cache')
|
|
61
|
+
continue;
|
|
62
|
+
const featurePath = join(seddDir, item.name);
|
|
63
|
+
const metaPath = join(featurePath, '_meta.json');
|
|
64
|
+
const specPath = join(featurePath, 'spec.md');
|
|
65
|
+
let hasMetaExpectation = false;
|
|
66
|
+
if (existsSync(metaPath)) {
|
|
67
|
+
try {
|
|
68
|
+
const meta = JSON.parse(readFileSync(metaPath, 'utf-8'));
|
|
69
|
+
hasMetaExpectation = !!meta.expectation;
|
|
70
|
+
}
|
|
71
|
+
catch { }
|
|
72
|
+
}
|
|
73
|
+
let hasSpecExpectation = false;
|
|
74
|
+
if (existsSync(specPath)) {
|
|
75
|
+
try {
|
|
76
|
+
const spec = readFileSync(specPath, 'utf-8');
|
|
77
|
+
hasSpecExpectation = /^##\s*Expectat/im.test(spec);
|
|
78
|
+
}
|
|
79
|
+
catch { }
|
|
80
|
+
}
|
|
81
|
+
const migrations = [];
|
|
82
|
+
const contents = readdirSync(featurePath, { withFileTypes: true });
|
|
83
|
+
for (const content of contents) {
|
|
84
|
+
if (!content.isDirectory())
|
|
85
|
+
continue;
|
|
86
|
+
if (!/^\d{3}[_-]/.test(content.name))
|
|
87
|
+
continue;
|
|
88
|
+
const migPath = join(featurePath, content.name);
|
|
89
|
+
const hasAcceptance = existsSync(join(migPath, 'acceptance.md'));
|
|
90
|
+
let taskCount = 0;
|
|
91
|
+
const tasksPath = join(migPath, 'tasks.md');
|
|
92
|
+
if (existsSync(tasksPath)) {
|
|
93
|
+
try {
|
|
94
|
+
const tasks = readFileSync(tasksPath, 'utf-8');
|
|
95
|
+
const matches = tasks.match(/^\s*-\s*\[[\sx]\]\s*T\d{3}-\d{3}/gim);
|
|
96
|
+
taskCount = matches ? matches.length : 0;
|
|
97
|
+
}
|
|
98
|
+
catch { }
|
|
99
|
+
}
|
|
100
|
+
const migId = content.name.split(/[_-]/)[0];
|
|
101
|
+
migrations.push({
|
|
102
|
+
id: migId,
|
|
103
|
+
folder: content.name,
|
|
104
|
+
path: migPath,
|
|
105
|
+
hasAcceptance,
|
|
106
|
+
taskCount,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
migrations.sort((a, b) => a.id.localeCompare(b.id));
|
|
110
|
+
features.push({
|
|
111
|
+
name: item.name,
|
|
112
|
+
path: featurePath,
|
|
113
|
+
hasMetaExpectation,
|
|
114
|
+
hasSpecExpectation,
|
|
115
|
+
migrations,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return features.sort((a, b) => a.name.localeCompare(b.name));
|
|
119
|
+
}
|
|
120
|
+
function updateSeddFiles(cwd) {
|
|
121
|
+
const seddDir = join(cwd, '.sedd');
|
|
122
|
+
const claudeDir = join(cwd, '.claude');
|
|
123
|
+
console.log(chalk.cyan('\n📦 Atualizando arquivos SEDD...\n'));
|
|
124
|
+
// 1. Templates
|
|
125
|
+
const templatesCount = copyDirectory(TEMPLATES_DIR, join(seddDir, 'templates'));
|
|
126
|
+
console.log(chalk.green(` ✓ Templates: ${templatesCount} arquivos atualizados`));
|
|
127
|
+
// 2. Commands
|
|
128
|
+
const commandsCount = copyDirectory(COMMANDS_DIR, join(claudeDir, 'commands'));
|
|
129
|
+
console.log(chalk.green(` ✓ Commands: ${commandsCount} arquivos atualizados`));
|
|
130
|
+
// 3. Hooks
|
|
131
|
+
const hooksCount = copyDirectory(HOOKS_DIR, join(claudeDir, 'hooks'));
|
|
132
|
+
console.log(chalk.green(` ✓ Hooks: ${hooksCount} arquivos atualizados`));
|
|
133
|
+
// 4. Scripts (platform specific)
|
|
134
|
+
const scriptsDir = join(seddDir, 'scripts');
|
|
135
|
+
const bashCount = copyDirectory(join(SCRIPTS_DIR, 'bash'), join(scriptsDir, 'bash'));
|
|
136
|
+
const psCount = copyDirectory(join(SCRIPTS_DIR, 'powershell'), join(scriptsDir, 'powershell'));
|
|
137
|
+
console.log(chalk.green(` ✓ Scripts: ${bashCount + psCount} arquivos atualizados`));
|
|
138
|
+
// 5. Schema
|
|
139
|
+
const schemaPath = join(TEMPLATES_DIR, 'sedd.schema.json');
|
|
140
|
+
let schemaUpdated = false;
|
|
141
|
+
if (existsSync(schemaPath)) {
|
|
142
|
+
copyFileSync(schemaPath, join(seddDir, 'sedd.schema.json'));
|
|
143
|
+
console.log(chalk.green(' ✓ Schema atualizado'));
|
|
144
|
+
schemaUpdated = true;
|
|
145
|
+
}
|
|
146
|
+
console.log(chalk.cyan('\n✅ Atualização concluída!\n'));
|
|
147
|
+
return {
|
|
148
|
+
templates: templatesCount,
|
|
149
|
+
commands: commandsCount,
|
|
150
|
+
hooks: hooksCount,
|
|
151
|
+
scripts: bashCount + psCount,
|
|
152
|
+
schema: schemaUpdated,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
async function migrateFeature(feature) {
|
|
156
|
+
const { default: inquirer } = await import('inquirer');
|
|
157
|
+
console.log(chalk.blue(`\n📝 Migrando ${feature.name}...\n`));
|
|
158
|
+
let specSummary = '';
|
|
159
|
+
const specPath = join(feature.path, 'spec.md');
|
|
160
|
+
if (existsSync(specPath)) {
|
|
161
|
+
const spec = readFileSync(specPath, 'utf-8');
|
|
162
|
+
const lines = spec.split('\n').slice(0, 20);
|
|
163
|
+
const descLine = lines.find(l => l.startsWith('>') || (l.length > 20 && !l.startsWith('#')));
|
|
164
|
+
if (descLine) {
|
|
165
|
+
specSummary = descLine.replace(/^>\s*/, '').slice(0, 100);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (specSummary) {
|
|
169
|
+
console.log(chalk.gray('Resumo da feature:'));
|
|
170
|
+
console.log(chalk.white(`> ${specSummary}\n`));
|
|
171
|
+
}
|
|
172
|
+
const { expectation } = await inquirer.prompt([{
|
|
173
|
+
type: 'input',
|
|
174
|
+
name: 'expectation',
|
|
175
|
+
message: '🎯 Qual é a EXPECTATIVA para esta feature?',
|
|
176
|
+
validate: (input) => input.length > 5 || 'Expectativa muito curta',
|
|
177
|
+
}]);
|
|
178
|
+
const metaPath = join(feature.path, '_meta.json');
|
|
179
|
+
if (existsSync(metaPath)) {
|
|
180
|
+
try {
|
|
181
|
+
const meta = JSON.parse(readFileSync(metaPath, 'utf-8'));
|
|
182
|
+
meta.expectation = expectation;
|
|
183
|
+
writeFileSync(metaPath, JSON.stringify(meta, null, 2) + '\n');
|
|
184
|
+
console.log(chalk.green('✓'), 'Adicionado ao _meta.json');
|
|
185
|
+
}
|
|
186
|
+
catch (e) {
|
|
187
|
+
console.log(chalk.red('✗'), 'Erro ao atualizar _meta.json');
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (existsSync(specPath) && !feature.hasSpecExpectation) {
|
|
191
|
+
try {
|
|
192
|
+
const spec = readFileSync(specPath, 'utf-8');
|
|
193
|
+
const lines = spec.split('\n');
|
|
194
|
+
let insertIndex = 0;
|
|
195
|
+
for (let i = 0; i < lines.length; i++) {
|
|
196
|
+
if (lines[i].startsWith('# ')) {
|
|
197
|
+
insertIndex = i + 1;
|
|
198
|
+
while (insertIndex < lines.length && lines[insertIndex].trim() === '') {
|
|
199
|
+
insertIndex++;
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const expectationSection = `\n## Expectation\n\n> ${expectation}\n`;
|
|
205
|
+
lines.splice(insertIndex, 0, expectationSection);
|
|
206
|
+
writeFileSync(specPath, lines.join('\n'));
|
|
207
|
+
console.log(chalk.green('✓'), 'Adicionado ao spec.md');
|
|
208
|
+
}
|
|
209
|
+
catch (e) {
|
|
210
|
+
console.log(chalk.red('✗'), 'Erro ao atualizar spec.md');
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (feature.migrations.length > 0) {
|
|
214
|
+
const migrationsWithoutAC = feature.migrations.filter(m => !m.hasAcceptance && m.taskCount > 0);
|
|
215
|
+
if (migrationsWithoutAC.length > 0) {
|
|
216
|
+
const { createAC } = await inquirer.prompt([{
|
|
217
|
+
type: 'confirm',
|
|
218
|
+
name: 'createAC',
|
|
219
|
+
message: `Criar acceptance.md para ${migrationsWithoutAC.length} migration(s)?`,
|
|
220
|
+
default: true,
|
|
221
|
+
}]);
|
|
222
|
+
if (createAC) {
|
|
223
|
+
for (const mig of migrationsWithoutAC) {
|
|
224
|
+
await generateAcceptance(mig, expectation);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
async function generateAcceptance(migration, expectation) {
|
|
231
|
+
const tasksPath = join(migration.path, 'tasks.md');
|
|
232
|
+
if (!existsSync(tasksPath))
|
|
233
|
+
return;
|
|
234
|
+
const tasks = readFileSync(tasksPath, 'utf-8');
|
|
235
|
+
const taskMatches = tasks.match(/^\s*-\s*\[[\sx]\]\s*(T\d{3}-\d{3})\s*\[?[^\]]*\]?\s*(.+)/gim) || [];
|
|
236
|
+
const criteria = [];
|
|
237
|
+
let acNum = 1;
|
|
238
|
+
for (const match of taskMatches) {
|
|
239
|
+
const parts = match.match(/^\s*-\s*\[[\sx]\]\s*(T\d{3}-\d{3})\s*\[?[^\]]*\]?\s*(.+)/i);
|
|
240
|
+
if (parts && parts[2]) {
|
|
241
|
+
const taskDesc = parts[2].replace(/`[^`]+`/g, '').trim();
|
|
242
|
+
const acId = `AC-${String(acNum).padStart(3, '0')}`;
|
|
243
|
+
criteria.push(`- [ ] **${acId}:** ${taskDesc}`);
|
|
244
|
+
acNum++;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (criteria.length === 0)
|
|
248
|
+
return;
|
|
249
|
+
const timestamp = new Date().toISOString().slice(0, 19).replace('T', ' ');
|
|
250
|
+
const acceptance = `# Acceptance Criteria - Migration ${migration.id}
|
|
251
|
+
|
|
252
|
+
> Generated from tasks
|
|
253
|
+
> Timestamp: ${timestamp}
|
|
254
|
+
|
|
255
|
+
## Expectativa
|
|
256
|
+
|
|
257
|
+
> ${expectation}
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Checklist de Aceite
|
|
262
|
+
|
|
263
|
+
${criteria.join('\n - Verificar: Testar manualmente\n\n')}
|
|
264
|
+
- Verificar: Testar manualmente
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Sign-off
|
|
269
|
+
|
|
270
|
+
| Critério | Status | Verificado Por | Data |
|
|
271
|
+
|----------|--------|----------------|------|
|
|
272
|
+
${criteria.map((_, i) => `| AC-${String(i + 1).padStart(3, '0')} | pending | - | - |`).join('\n')}
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Notas
|
|
277
|
+
|
|
278
|
+
_Gerado automaticamente por \`sedd update\`_
|
|
279
|
+
`;
|
|
280
|
+
writeFileSync(join(migration.path, 'acceptance.md'), acceptance);
|
|
281
|
+
console.log(chalk.green('✓'), `Criado ${migration.folder}/acceptance.md (${criteria.length} critérios)`);
|
|
282
|
+
}
|
|
283
|
+
export async function update(options = {}) {
|
|
284
|
+
const cwd = process.cwd();
|
|
285
|
+
const seddDir = join(cwd, '.sedd');
|
|
286
|
+
const claudeDir = join(cwd, '.claude');
|
|
287
|
+
if (!existsSync(seddDir) && !existsSync(claudeDir)) {
|
|
288
|
+
console.log(chalk.red('\n❌ SEDD não inicializado neste projeto.'));
|
|
289
|
+
console.log(chalk.gray(' Execute'), chalk.cyan('sedd init'), chalk.gray('primeiro.\n'));
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const version = getInstalledVersion();
|
|
293
|
+
console.log(chalk.blue(`\n🔄 SEDD Update - v${version}\n`));
|
|
294
|
+
// Check for newer version on npm
|
|
295
|
+
const versionInfo = await checkForUpdates();
|
|
296
|
+
if (versionInfo?.needsUpdate) {
|
|
297
|
+
showUpdateNotification(versionInfo);
|
|
298
|
+
}
|
|
299
|
+
// Preview files that will be updated
|
|
300
|
+
const preview = previewFileCounts();
|
|
301
|
+
const totalFiles = preview.templates + preview.commands + preview.hooks + preview.scripts + (preview.schema ? 1 : 0);
|
|
302
|
+
console.log(chalk.white('Arquivos que serão substituídos:'));
|
|
303
|
+
console.log(chalk.gray(` .sedd/templates/ (${preview.templates} arquivos)`));
|
|
304
|
+
console.log(chalk.gray(` .sedd/scripts/ (${preview.scripts} arquivos)`));
|
|
305
|
+
console.log(chalk.gray(` .claude/commands/ (${preview.commands} arquivos)`));
|
|
306
|
+
console.log(chalk.gray(` .claude/hooks/ (${preview.hooks} arquivos)`));
|
|
307
|
+
if (preview.schema) {
|
|
308
|
+
console.log(chalk.gray(` .sedd/sedd.schema.json`));
|
|
309
|
+
}
|
|
310
|
+
console.log(chalk.gray(`\n Total: ${totalFiles} arquivos\n`));
|
|
311
|
+
// Confirmation prompt (unless --force)
|
|
312
|
+
if (!options.force) {
|
|
313
|
+
const { default: inquirer } = await import('inquirer');
|
|
314
|
+
const { confirm } = await inquirer.prompt([{
|
|
315
|
+
type: 'confirm',
|
|
316
|
+
name: 'confirm',
|
|
317
|
+
message: 'Continuar com a atualização?',
|
|
318
|
+
default: true,
|
|
319
|
+
}]);
|
|
320
|
+
if (!confirm) {
|
|
321
|
+
console.log(chalk.gray('\nAbortado.\n'));
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
console.log(chalk.gray('Escaneando projeto...\n'));
|
|
326
|
+
const features = scanFeatures(seddDir);
|
|
327
|
+
if (features.length === 0) {
|
|
328
|
+
console.log(chalk.yellow('Nenhuma feature encontrada.\n'));
|
|
329
|
+
console.log(chalk.gray('Atualizando templates/commands/hooks...\n'));
|
|
330
|
+
updateSeddFiles(cwd);
|
|
331
|
+
console.log(chalk.green('\n✨ Atualização concluída!\n'));
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
console.log(chalk.white(`📁 Features encontradas: ${features.length}`));
|
|
335
|
+
for (const f of features) {
|
|
336
|
+
console.log(chalk.gray(` ${f.name}`));
|
|
337
|
+
}
|
|
338
|
+
console.log('');
|
|
339
|
+
console.log(chalk.bold('📋 Análise de compatibilidade:\n'));
|
|
340
|
+
const maxName = Math.max(...features.map(f => f.name.length), 15);
|
|
341
|
+
console.log(chalk.gray(`┌${'─'.repeat(maxName + 2)}┬──────────┬────────────┬─────────────┐`));
|
|
342
|
+
console.log(chalk.gray(`│ ${'Feature'.padEnd(maxName)} │ meta.exp │ spec.exp │ migrations │`));
|
|
343
|
+
console.log(chalk.gray(`├${'─'.repeat(maxName + 2)}┼──────────┼────────────┼─────────────┤`));
|
|
344
|
+
let needsMigration = 0;
|
|
345
|
+
for (const f of features) {
|
|
346
|
+
const metaIcon = f.hasMetaExpectation ? chalk.green('✅') : chalk.red('❌');
|
|
347
|
+
const specIcon = f.hasSpecExpectation ? chalk.green('✅') : chalk.red('❌');
|
|
348
|
+
const migsWithAC = f.migrations.filter(m => m.hasAcceptance).length;
|
|
349
|
+
const migInfo = f.migrations.length > 0
|
|
350
|
+
? `${f.migrations.length} (${migsWithAC} c/ AC)`
|
|
351
|
+
: '0';
|
|
352
|
+
if (!f.hasMetaExpectation || !f.hasSpecExpectation)
|
|
353
|
+
needsMigration++;
|
|
354
|
+
console.log(chalk.gray(`│ `) + f.name.padEnd(maxName) + chalk.gray(` │ `) + metaIcon.padEnd(8) + chalk.gray(` │ `) + specIcon.padEnd(10) + chalk.gray(` │ `) + migInfo.padEnd(11) + chalk.gray(` │`));
|
|
355
|
+
}
|
|
356
|
+
console.log(chalk.gray(`└${'─'.repeat(maxName + 2)}┴──────────┴────────────┴─────────────┘`));
|
|
357
|
+
console.log(chalk.gray('\nLegenda:'));
|
|
358
|
+
console.log(chalk.gray(' meta.exp = _meta.json tem campo expectation'));
|
|
359
|
+
console.log(chalk.gray(' spec.exp = spec.md tem seção ## Expectation'));
|
|
360
|
+
console.log(chalk.gray(' AC = acceptance.md\n'));
|
|
361
|
+
if (needsMigration > 0) {
|
|
362
|
+
console.log(chalk.yellow(`⚠️ ${needsMigration} feature(s) sem expectation definida\n`));
|
|
363
|
+
}
|
|
364
|
+
const { default: inquirer } = await import('inquirer');
|
|
365
|
+
const choices = [
|
|
366
|
+
{ name: '1. Atualizar só templates/commands (novas features terão expectation)', value: 'templates' },
|
|
367
|
+
];
|
|
368
|
+
if (needsMigration > 0) {
|
|
369
|
+
choices.push({ name: '2. Migrar features existentes (perguntar expectation para cada)', value: 'migrate' });
|
|
370
|
+
}
|
|
371
|
+
choices.push({ name: needsMigration > 0 ? '3. Cancelar' : '2. Cancelar', value: 'cancel' });
|
|
372
|
+
const { action } = await inquirer.prompt([{
|
|
373
|
+
type: 'list',
|
|
374
|
+
name: 'action',
|
|
375
|
+
message: 'O que deseja fazer?',
|
|
376
|
+
choices,
|
|
377
|
+
}]);
|
|
378
|
+
if (action === 'cancel') {
|
|
379
|
+
console.log(chalk.gray('\nAbortado.\n'));
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
if (action === 'migrate') {
|
|
383
|
+
const featuresToMigrate = features.filter(f => !f.hasMetaExpectation || !f.hasSpecExpectation);
|
|
384
|
+
for (const feature of featuresToMigrate) {
|
|
385
|
+
await migrateFeature(feature);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
updateSeddFiles(cwd);
|
|
389
|
+
}
|
|
390
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/cli/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAY,MAAM,SAAS,CAAC;AAClH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,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ersionInfo | null>;
|
|
7
|
+
export declare function showUpdateNotification(info: VersionInfo): void;
|
|
8
|
+
export declare function getInstalledVersion(): string;
|
|
9
|
+
//# sourceMappingURL=version-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-check.d.ts","sourceRoot":"","sources":["../../src/cli/version-check.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAkBnE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAc9D;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAQ5C"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { join, dirname } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
export async function checkForUpdates() {
|
|
8
|
+
try {
|
|
9
|
+
const pkgPath = join(__dirname, '../../package.json');
|
|
10
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
11
|
+
const current = pkg.version;
|
|
12
|
+
const latest = execSync('npm view sedd version', {
|
|
13
|
+
encoding: 'utf8',
|
|
14
|
+
timeout: 5000,
|
|
15
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
16
|
+
}).trim();
|
|
17
|
+
const needsUpdate = current !== latest;
|
|
18
|
+
return { current, latest, needsUpdate };
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function showUpdateNotification(info) {
|
|
25
|
+
if (!info.needsUpdate)
|
|
26
|
+
return;
|
|
27
|
+
const currentPad = info.current.padEnd(6);
|
|
28
|
+
const latestPad = info.latest.padEnd(6);
|
|
29
|
+
console.log();
|
|
30
|
+
console.log(chalk.yellow('╭─────────────────────────────────────────────────────╮'));
|
|
31
|
+
console.log(chalk.yellow('│') + chalk.white(' 📦 Nova versão do SEDD disponível! ') + chalk.yellow('│'));
|
|
32
|
+
console.log(chalk.yellow('│') + chalk.gray(` Atual: ${currentPad} → Nova: ${latestPad}`) + ' ' + chalk.yellow('│'));
|
|
33
|
+
console.log(chalk.yellow('│') + chalk.cyan(' npm install -g sedd@latest') + ' ' + chalk.yellow('│'));
|
|
34
|
+
console.log(chalk.yellow('│') + chalk.gray(' Depois execute: sedd update') + ' ' + chalk.yellow('│'));
|
|
35
|
+
console.log(chalk.yellow('╰─────────────────────────────────────────────────────╯'));
|
|
36
|
+
console.log();
|
|
37
|
+
}
|
|
38
|
+
export function getInstalledVersion() {
|
|
39
|
+
try {
|
|
40
|
+
const pkgPath = join(__dirname, '../../package.json');
|
|
41
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
42
|
+
return pkg.version || 'unknown';
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return 'unknown';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=version-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-check.js","sourceRoot":"","sources":["../../src/cli/version-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,SAAS,GAAG,O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AAC,CAAC,CAAC;IACzH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,UAAU,YAAY,SAAS,EAAE,CAAC,GAAG,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACtI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,iCAAiC,CAAC,GAAG,sBAAsB,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5H,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,GAAG,qBAAqB,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5H,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,yDAAyD,CAAC,CAAC,CAAC;IACrF,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QACtD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QACvD,OAAO,GAAG,CAAC,OAAO,IAAI,SAAS,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/hooks/README.md
CHANGED
|
@@ -67,6 +67,10 @@ The hook detects keywords and **FORCES** skills into context:
|
|
|
67
67
|
|
|
68
68
|
🎯 **EXPECTATIVA:** User can toggle dark mode and have it persist across sessions
|
|
69
69
|
|
|
70
|
+
⛔ **NÃO DEVE:**
|
|
71
|
+
- ❌ Criar endpoint no serviço X
|
|
72
|
+
- ❌ Usar localStorage (usar banco)
|
|
73
|
+
|
|
70
74
|
Pending tasks:
|
|
71
75
|
- T004-001: Create ThemeContext
|
|
72
76
|
- T004-002: Add toggle component
|
|
@@ -78,6 +82,22 @@ Pending tasks:
|
|
|
78
82
|
|
|
79
83
|
O hook **sempre mostra a EXPECTATIVA** do `_meta.json` para lembrar a AI do objetivo final. Isso garante que todas as ações estejam alinhadas com o que o usuário espera.
|
|
80
84
|
|
|
85
|
+
### Structured Expectations
|
|
86
|
+
|
|
87
|
+
O hook suporta expectativas estruturadas com `must` e `mustNot`:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"expectation": {
|
|
92
|
+
"summary": "User can toggle dark mode",
|
|
93
|
+
"must": ["Criar toggle", "Persistir no banco"],
|
|
94
|
+
"mustNot": ["Criar endpoint no serviço X", "Usar localStorage"]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Quando `mustNot` está presente, o hook exibe as restrições em destaque para que a AI **nunca as viole**.
|
|
100
|
+
|
|
81
101
|
---
|
|
82
102
|
|
|
83
103
|
## post-tool-use.js
|
package/hooks/check-roadmap.js
CHANGED
|
@@ -164,25 +164,50 @@ const getScoreEmoji = (score) => {
|
|
|
164
164
|
return '🔴';
|
|
165
165
|
};
|
|
166
166
|
|
|
167
|
+
const getExpectationSummary = (expectation) => {
|
|
168
|
+
if (!expectation) return null;
|
|
169
|
+
if (typeof expectation === 'string') return expectation;
|
|
170
|
+
return expectation.summary || null;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const getMustNotList = (expectation) => {
|
|
174
|
+
if (!expectation || typeof expectation === 'string') return [];
|
|
175
|
+
return expectation.mustNot || [];
|
|
176
|
+
};
|
|
177
|
+
|
|
167
178
|
const buildSeddContext = (branch, currentMigration, completed, pending, featureExpectation, migrationExpectation) => {
|
|
168
|
-
|
|
179
|
+
const featureSummary = getExpectationSummary(featureExpectation);
|
|
180
|
+
const migrationSummary = getExpectationSummary(migrationExpectation);
|
|
181
|
+
const mustNotList = getMustNotList(migrationExpectation) || getMustNotList(featureExpectation);
|
|
182
|
+
|
|
183
|
+
if (pending.length === 0 && !featureSummary && !migrationSummary) return null;
|
|
169
184
|
|
|
170
185
|
const total = completed + pending.length;
|
|
171
186
|
const migrationInfo = currentMigration ? ` | Migration: ${currentMigration}` : '';
|
|
172
187
|
|
|
173
188
|
let expectationBlock = '';
|
|
174
|
-
const activeExpectation =
|
|
189
|
+
const activeExpectation = migrationSummary || featureSummary;
|
|
175
190
|
|
|
176
|
-
if (
|
|
191
|
+
if (featureSummary && migrationSummary && featureSummary !== migrationSummary) {
|
|
177
192
|
expectationBlock = `
|
|
178
|
-
🎯 **FEATURE:** ${
|
|
179
|
-
📍 **MIGRATION ${currentMigration}:** ${
|
|
193
|
+
🎯 **FEATURE:** ${featureSummary}
|
|
194
|
+
📍 **MIGRATION ${currentMigration}:** ${migrationSummary}
|
|
180
195
|
`;
|
|
181
196
|
} else if (activeExpectation) {
|
|
182
|
-
const prefix =
|
|
197
|
+
const prefix = migrationSummary ? `📍 M${currentMigration}` : '🎯';
|
|
183
198
|
expectationBlock = `\n${prefix} **EXPECTATIVA:** ${activeExpectation}\n`;
|
|
184
199
|
}
|
|
185
200
|
|
|
201
|
+
// Add mustNot block if restrictions exist
|
|
202
|
+
let mustNotBlock = '';
|
|
203
|
+
if (mustNotList.length > 0) {
|
|
204
|
+
const restrictions = mustNotList.map((item) => `- ❌ ${item}`).join('\n');
|
|
205
|
+
mustNotBlock = `
|
|
206
|
+
⛔ **NÃO DEVE:**
|
|
207
|
+
${restrictions}
|
|
208
|
+
`;
|
|
209
|
+
}
|
|
210
|
+
|
|
186
211
|
let scoreBlock = '';
|
|
187
212
|
if (activeExpectation && pending.length > 0) {
|
|
188
213
|
const score = calculateAlignmentScore(activeExpectation, pending);
|
|
@@ -192,7 +217,7 @@ const buildSeddContext = (branch, currentMigration, completed, pending, featureE
|
|
|
192
217
|
|
|
193
218
|
if (pending.length === 0) {
|
|
194
219
|
return `<sedd-context>
|
|
195
|
-
**Branch: ${branch}**${migrationInfo}${expectationBlock}
|
|
220
|
+
**Branch: ${branch}**${migrationInfo}${expectationBlock}${mustNotBlock}
|
|
196
221
|
</sedd-context>`;
|
|
197
222
|
}
|
|
198
223
|
|
|
@@ -205,7 +230,7 @@ const buildSeddContext = (branch, currentMigration, completed, pending, featureE
|
|
|
205
230
|
|
|
206
231
|
return `<sedd-context>
|
|
207
232
|
**Branch: ${branch}**${migrationInfo} | Progress: ${completed}/${total} tasks${scoreBlock}
|
|
208
|
-
${expectationBlock}
|
|
233
|
+
${expectationBlock}${mustNotBlock}
|
|
209
234
|
Pending tasks:
|
|
210
235
|
${tasksList}${moreText}
|
|
211
236
|
</sedd-context>`;
|