adi_dev_workflow 1.0.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/index.js +8 -0
- package/frameworks/commands/generate-prompt.md +98 -0
- package/frameworks/commands/ministack/README.md +151 -0
- package/frameworks/commands/ministack/code-review.md +67 -0
- package/frameworks/commands/ministack/generate-intent.md +20 -0
- package/frameworks/commands/ministack/generate-scope.md +37 -0
- package/frameworks/commands/ministack/generate-tasks.md +25 -0
- package/frameworks/commands/ministack/generate-tests.md +37 -0
- package/frameworks/commands/ministack/run-ministack-tasks.md +55 -0
- package/frameworks/commands/ministack/run-ministack-withlinear.md +94 -0
- package/frameworks/commands/sdd/code-review.md +499 -0
- package/frameworks/commands/sdd/generate-prd.md +23 -0
- package/frameworks/commands/sdd/generate-spec-tech.md +37 -0
- package/frameworks/commands/sdd/generate-task-plan.md +27 -0
- package/frameworks/commands/sdd/generate-tests.md +37 -0
- package/frameworks/commands/sdd/run_tasks.md +166 -0
- package/frameworks/commands/sdd/run_tasks_withlinear.md +519 -0
- package/frameworks/commands/sdd/validate-sdd.md +179 -0
- package/frameworks/commands/sync-tasks-to-linear.md +588 -0
- package/frameworks/commands/taskcard/generate-taskcard.md +25 -0
- package/frameworks/commands/taskcard/generate-tests.md +37 -0
- package/frameworks/commands/taskcard/run-taskcard.md +34 -0
- package/frameworks/skills/ministack-expert/SKILL.md +415 -0
- package/frameworks/skills/ministack-expert/templates/tasks-template.md +141 -0
- package/frameworks/skills/ministack-intent-expert/SKILL.md +160 -0
- package/frameworks/skills/ministack-intent-expert/templates/intent-template.md +45 -0
- package/frameworks/skills/ministack-qa-expert/SKILL.md +273 -0
- package/frameworks/skills/ministack-qa-expert/templates/task_tests_template.md +24 -0
- package/frameworks/skills/ministack-qa-expert/templates/test_strategy_template.md +75 -0
- package/frameworks/skills/ministack-scope-expert/SKILL.md +171 -0
- package/frameworks/skills/ministack-scope-expert/templates/scope-template.md +85 -0
- package/frameworks/skills/ministack-scope-expert/templates/tech_direction-template.md +17 -0
- package/frameworks/skills/sdd-prd-expert/SKILL.md +236 -0
- package/frameworks/skills/sdd-prd-expert/templates/prd_template.md +126 -0
- package/frameworks/skills/sdd-qa-expert/SKILL.md +284 -0
- package/frameworks/skills/sdd-qa-expert/templates/task_tests_template.md +24 -0
- package/frameworks/skills/sdd-qa-expert/templates/test_strategy_template.md +75 -0
- package/frameworks/skills/sdd-spec-tech-expert/SKILL.md +387 -0
- package/frameworks/skills/sdd-spec-tech-expert/templates/spec_tech_template.md +246 -0
- package/frameworks/skills/sdd-spec-tech-expert/templates/tech_direction-template.md +23 -0
- package/frameworks/skills/sdd-task-plan-expert/SKILL.md +353 -0
- package/frameworks/skills/sdd-task-plan-expert/templates/task_plan_template.md +83 -0
- package/frameworks/skills/sdd-task-plan-expert/templates/task_template.md +89 -0
- package/frameworks/skills/taskcard-expert/SKILL.md +308 -0
- package/frameworks/skills/taskcard-expert/templates/template.md +134 -0
- package/frameworks/skills/taskcard-qa-expert/SKILL.md +265 -0
- package/frameworks/skills/taskcard-qa-expert/templates/task_tests_template.md +78 -0
- package/frameworks/templates/prompt_template.md +164 -0
- package/package.json +28 -0
- package/src/cli.js +121 -0
- package/src/installer.js +136 -0
- package/src/transformer.js +86 -0
package/src/installer.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { readdir, readFile, writeFile, mkdir, stat } from 'node:fs/promises';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { transformContent } from './transformer.js';
|
|
5
|
+
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const FRAMEWORKS_DIR = join(__dirname, '..', 'frameworks');
|
|
8
|
+
|
|
9
|
+
const FRAMEWORK_MAP = {
|
|
10
|
+
sdd: {
|
|
11
|
+
commands: 'sdd',
|
|
12
|
+
skills: ['sdd-prd-expert', 'sdd-spec-tech-expert', 'sdd-task-plan-expert', 'sdd-qa-expert'],
|
|
13
|
+
},
|
|
14
|
+
ministack: {
|
|
15
|
+
commands: 'ministack',
|
|
16
|
+
skills: ['ministack-intent-expert', 'ministack-scope-expert', 'ministack-expert', 'ministack-qa-expert'],
|
|
17
|
+
},
|
|
18
|
+
taskcard: {
|
|
19
|
+
commands: 'taskcard',
|
|
20
|
+
skills: ['taskcard-expert', 'taskcard-qa-expert'],
|
|
21
|
+
},
|
|
22
|
+
shared: {
|
|
23
|
+
commands: null, // root-level commands
|
|
24
|
+
skills: [],
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const IDE_DIRS = {
|
|
29
|
+
claude: '.claude',
|
|
30
|
+
cursor: '.cursor',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Copy a directory recursively, applying transformation.
|
|
35
|
+
*/
|
|
36
|
+
async function copyDir(src, dest, target) {
|
|
37
|
+
await mkdir(dest, { recursive: true });
|
|
38
|
+
const entries = await readdir(src, { withFileTypes: true });
|
|
39
|
+
|
|
40
|
+
for (const entry of entries) {
|
|
41
|
+
const srcPath = join(src, entry.name);
|
|
42
|
+
const destPath = join(dest, entry.name);
|
|
43
|
+
|
|
44
|
+
if (entry.isDirectory()) {
|
|
45
|
+
await copyDir(srcPath, destPath, target);
|
|
46
|
+
} else if (entry.name.endsWith('.md')) {
|
|
47
|
+
const content = await readFile(srcPath, 'utf-8');
|
|
48
|
+
const transformed = transformContent(content, target);
|
|
49
|
+
await writeFile(destPath, transformed, 'utf-8');
|
|
50
|
+
} else {
|
|
51
|
+
const content = await readFile(srcPath);
|
|
52
|
+
await writeFile(destPath, content);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Check if a path exists.
|
|
59
|
+
*/
|
|
60
|
+
async function exists(path) {
|
|
61
|
+
try {
|
|
62
|
+
await stat(path);
|
|
63
|
+
return true;
|
|
64
|
+
} catch {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Install selected frameworks to the target directory.
|
|
71
|
+
*
|
|
72
|
+
* @param {Object} options
|
|
73
|
+
* @param {string} options.cwd - Current working directory
|
|
74
|
+
* @param {'claude'|'cursor'} options.target - Target IDE
|
|
75
|
+
* @param {string[]} options.frameworks - Frameworks to install ('sdd', 'ministack', 'taskcard', 'shared')
|
|
76
|
+
* @returns {Object} Summary of installed items
|
|
77
|
+
*/
|
|
78
|
+
export async function install({ cwd, target, frameworks }) {
|
|
79
|
+
const ideDir = join(cwd, IDE_DIRS[target]);
|
|
80
|
+
const commandsDir = join(ideDir, 'commands');
|
|
81
|
+
const skillsDir = join(ideDir, 'skills');
|
|
82
|
+
const templatesDir = join(ideDir, 'templates');
|
|
83
|
+
|
|
84
|
+
const summary = { commands: 0, skills: 0, templates: 0 };
|
|
85
|
+
|
|
86
|
+
for (const fw of frameworks) {
|
|
87
|
+
const config = FRAMEWORK_MAP[fw];
|
|
88
|
+
if (!config) continue;
|
|
89
|
+
|
|
90
|
+
// Copy commands
|
|
91
|
+
if (fw === 'shared') {
|
|
92
|
+
// Root-level commands (generate-prompt.md, sync-tasks-to-linear.md)
|
|
93
|
+
await mkdir(commandsDir, { recursive: true });
|
|
94
|
+
const srcCmds = join(FRAMEWORKS_DIR, 'commands');
|
|
95
|
+
const entries = await readdir(srcCmds, { withFileTypes: true });
|
|
96
|
+
|
|
97
|
+
for (const entry of entries) {
|
|
98
|
+
if (entry.isFile() && entry.name.endsWith('.md')) {
|
|
99
|
+
const content = await readFile(join(srcCmds, entry.name), 'utf-8');
|
|
100
|
+
const transformed = transformContent(content, target);
|
|
101
|
+
await writeFile(join(commandsDir, entry.name), transformed, 'utf-8');
|
|
102
|
+
summary.commands++;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Shared templates
|
|
107
|
+
const srcTemplates = join(FRAMEWORKS_DIR, 'templates');
|
|
108
|
+
if (await exists(srcTemplates)) {
|
|
109
|
+
await copyDir(srcTemplates, templatesDir, target);
|
|
110
|
+
const tplEntries = await readdir(srcTemplates);
|
|
111
|
+
summary.templates += tplEntries.filter((f) => f.endsWith('.md')).length;
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
// Framework-specific commands
|
|
115
|
+
if (config.commands) {
|
|
116
|
+
const srcCmdDir = join(FRAMEWORKS_DIR, 'commands', config.commands);
|
|
117
|
+
const destCmdDir = join(commandsDir, config.commands);
|
|
118
|
+
await copyDir(srcCmdDir, destCmdDir, target);
|
|
119
|
+
const entries = await readdir(srcCmdDir);
|
|
120
|
+
summary.commands += entries.filter((f) => f.endsWith('.md')).length;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Framework-specific skills
|
|
124
|
+
for (const skillName of config.skills) {
|
|
125
|
+
const srcSkillDir = join(FRAMEWORKS_DIR, 'skills', skillName);
|
|
126
|
+
const destSkillDir = join(skillsDir, skillName);
|
|
127
|
+
if (await exists(srcSkillDir)) {
|
|
128
|
+
await copyDir(srcSkillDir, destSkillDir, target);
|
|
129
|
+
summary.skills++;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return summary;
|
|
136
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const REPLACEMENTS = [
|
|
2
|
+
// Remove Claude Code specific tool instructions
|
|
3
|
+
{
|
|
4
|
+
pattern: /- \*\*Claude Code\*\*: use a ferramenta `AskUserQuestion`[^\n]*/g,
|
|
5
|
+
replacement: '',
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
pattern: /\*\*Claude Code\*\*: use a ferramenta `AskUserQuestion`[^\n]*/g,
|
|
9
|
+
replacement: '',
|
|
10
|
+
},
|
|
11
|
+
// Replace AskUserQuestion references with generic
|
|
12
|
+
{
|
|
13
|
+
pattern: /`AskUserQuestion`/g,
|
|
14
|
+
replacement: 'perguntas interativas ao usuario',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
pattern: /AskUserQuestion/g,
|
|
18
|
+
replacement: 'pergunte ao usuario',
|
|
19
|
+
},
|
|
20
|
+
// Replace directory references
|
|
21
|
+
{
|
|
22
|
+
pattern: /\.claude\/rules\//g,
|
|
23
|
+
replacement: '.cursor/rules/',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
pattern: /\.claude\/templates\//g,
|
|
27
|
+
replacement: '.cursor/templates/',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
pattern: /\.claude\/skills\//g,
|
|
31
|
+
replacement: '.cursor/skills/',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
pattern: /\.claude\/commands\//g,
|
|
35
|
+
replacement: '.cursor/commands/',
|
|
36
|
+
},
|
|
37
|
+
// Replace .claude/agents/ references
|
|
38
|
+
{
|
|
39
|
+
pattern: /\.claude\/agents\//g,
|
|
40
|
+
replacement: '.cursor/agents/',
|
|
41
|
+
},
|
|
42
|
+
// Replace all remaining .claude/ references
|
|
43
|
+
{
|
|
44
|
+
pattern: /`\.claude\//g,
|
|
45
|
+
replacement: '`.cursor/',
|
|
46
|
+
},
|
|
47
|
+
// Replace tool/IDE name references
|
|
48
|
+
{
|
|
49
|
+
pattern: /no Claude Code/g,
|
|
50
|
+
replacement: 'no Cursor',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
pattern: /do Claude Code/g,
|
|
54
|
+
replacement: 'do Cursor',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
pattern: /Claude Code Review Agent/g,
|
|
58
|
+
replacement: 'Code Review Agent',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
pattern: /\(Claude Code\)/g,
|
|
62
|
+
replacement: '(Cursor)',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
pattern: /Claude Code/g,
|
|
66
|
+
replacement: 'Cursor',
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Transform file content from Claude Code format to Cursor format.
|
|
72
|
+
* Returns unchanged content if target is 'claude'.
|
|
73
|
+
*/
|
|
74
|
+
export function transformContent(content, target) {
|
|
75
|
+
if (target === 'claude') return content;
|
|
76
|
+
|
|
77
|
+
let result = content;
|
|
78
|
+
for (const { pattern, replacement } of REPLACEMENTS) {
|
|
79
|
+
result = result.replace(pattern, replacement);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Clean up empty lines left by removed lines
|
|
83
|
+
result = result.replace(/\n{3,}/g, '\n\n');
|
|
84
|
+
|
|
85
|
+
return result;
|
|
86
|
+
}
|