@shahmarasy/prodo 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 +201 -97
- package/bin/prodo.cjs +6 -6
- package/dist/agents/agent-registry.d.ts +13 -0
- package/dist/agents/agent-registry.js +79 -0
- package/dist/agents/anthropic/index.d.ts +9 -0
- package/dist/agents/anthropic/index.js +55 -0
- package/dist/agents/base.d.ts +25 -0
- package/dist/agents/base.js +71 -0
- package/dist/agents/google/index.d.ts +9 -0
- package/dist/agents/google/index.js +53 -0
- package/dist/agents/mock/index.d.ts +11 -0
- package/dist/agents/mock/index.js +26 -0
- package/dist/agents/openai/index.d.ts +9 -0
- package/dist/agents/openai/index.js +57 -0
- package/dist/agents/system-prompts.d.ts +3 -0
- package/dist/agents/system-prompts.js +32 -0
- package/dist/cli/agent-command-installer.d.ts +4 -0
- package/dist/cli/agent-command-installer.js +148 -0
- package/dist/cli/agent-ids.d.ts +15 -0
- package/dist/cli/agent-ids.js +49 -0
- package/dist/cli/doctor.d.ts +1 -0
- package/dist/cli/doctor.js +144 -0
- package/dist/cli/fix-tui.d.ts +4 -0
- package/dist/cli/fix-tui.js +79 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.js +467 -0
- package/dist/cli/init-tui.d.ts +23 -0
- package/dist/cli/init-tui.js +183 -0
- package/dist/cli/init.d.ts +12 -0
- package/dist/cli/init.js +335 -0
- package/dist/cli/normalize-interactive.d.ts +8 -0
- package/dist/cli/normalize-interactive.js +167 -0
- package/dist/cli/preset-loader.d.ts +4 -0
- package/dist/cli/preset-loader.js +210 -0
- package/dist/core/artifact-registry.d.ts +11 -0
- package/dist/core/artifact-registry.js +49 -0
- package/dist/core/artifacts.d.ts +10 -0
- package/dist/core/artifacts.js +892 -0
- package/dist/core/clean.d.ts +10 -0
- package/dist/core/clean.js +74 -0
- package/dist/core/consistency.d.ts +8 -0
- package/dist/core/consistency.js +328 -0
- package/dist/core/constants.d.ts +7 -0
- package/dist/core/constants.js +64 -0
- package/dist/core/errors.d.ts +3 -0
- package/dist/core/errors.js +10 -0
- package/dist/core/fix.d.ts +31 -0
- package/dist/core/fix.js +188 -0
- package/dist/core/hook-executor.d.ts +1 -0
- package/dist/core/hook-executor.js +175 -0
- package/dist/core/markdown.d.ts +16 -0
- package/dist/core/markdown.js +81 -0
- package/dist/core/normalize.d.ts +8 -0
- package/dist/core/normalize.js +125 -0
- package/dist/core/normalized-brief.d.ts +48 -0
- package/dist/core/normalized-brief.js +182 -0
- package/dist/core/output-index.d.ts +13 -0
- package/dist/core/output-index.js +55 -0
- package/dist/core/paths.d.ts +17 -0
- package/dist/core/paths.js +80 -0
- package/dist/core/project-config.d.ts +14 -0
- package/dist/core/project-config.js +69 -0
- package/dist/core/registry.d.ts +13 -0
- package/dist/core/registry.js +115 -0
- package/dist/core/settings.d.ts +8 -0
- package/dist/core/settings.js +43 -0
- package/dist/core/template-engine.d.ts +3 -0
- package/dist/core/template-engine.js +43 -0
- package/dist/core/template-resolver.d.ts +15 -0
- package/dist/core/template-resolver.js +46 -0
- package/dist/core/templates.d.ts +33 -0
- package/dist/core/templates.js +440 -0
- package/dist/core/terminology.d.ts +21 -0
- package/dist/core/terminology.js +143 -0
- package/dist/core/tracing.d.ts +21 -0
- package/dist/core/tracing.js +74 -0
- package/dist/core/types.d.ts +35 -0
- package/dist/core/types.js +5 -0
- package/dist/core/utils.d.ts +7 -0
- package/dist/core/utils.js +66 -0
- package/dist/core/validate.d.ts +10 -0
- package/dist/core/validate.js +226 -0
- package/dist/core/validator.d.ts +5 -0
- package/dist/core/validator.js +76 -0
- package/dist/core/version.d.ts +1 -0
- package/dist/core/version.js +30 -0
- package/dist/core/workflow-commands.d.ts +7 -0
- package/dist/core/workflow-commands.js +29 -0
- package/dist/i18n/en.json +45 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.js +63 -0
- package/dist/i18n/tr.json +45 -0
- package/dist/providers/index.d.ts +2 -1
- package/dist/providers/index.js +20 -6
- package/dist/providers/mock-provider.d.ts +1 -1
- package/dist/providers/mock-provider.js +12 -11
- package/dist/providers/openai-provider.d.ts +1 -1
- package/dist/providers/openai-provider.js +13 -13
- package/dist/skill-engine/context.d.ts +7 -0
- package/dist/skill-engine/context.js +76 -0
- package/dist/skill-engine/discovery.d.ts +2 -0
- package/dist/skill-engine/discovery.js +52 -0
- package/dist/skill-engine/graph.d.ts +4 -0
- package/dist/skill-engine/graph.js +114 -0
- package/dist/skill-engine/index.d.ts +11 -0
- package/dist/skill-engine/index.js +49 -0
- package/dist/skill-engine/pipeline.d.ts +9 -0
- package/dist/skill-engine/pipeline.js +84 -0
- package/dist/skill-engine/registry.d.ts +12 -0
- package/dist/skill-engine/registry.js +74 -0
- package/dist/skill-engine/types.d.ts +66 -0
- package/dist/skill-engine/types.js +2 -0
- package/dist/skill-engine/validator.d.ts +4 -0
- package/dist/skill-engine/validator.js +90 -0
- package/dist/skills/engine.d.ts +10 -0
- package/dist/skills/engine.js +75 -0
- package/dist/skills/fix-skill.d.ts +2 -0
- package/dist/skills/fix-skill.js +38 -0
- package/dist/skills/fix.d.ts +2 -0
- package/dist/skills/fix.js +41 -0
- package/dist/skills/generate-artifact-skill.d.ts +2 -0
- package/dist/skills/generate-artifact-skill.js +32 -0
- package/dist/skills/generate-artifact.d.ts +2 -0
- package/dist/skills/generate-artifact.js +42 -0
- package/dist/skills/generate-pipeline-skill.d.ts +2 -0
- package/dist/skills/generate-pipeline-skill.js +45 -0
- package/dist/skills/normalize-skill.d.ts +2 -0
- package/dist/skills/normalize-skill.js +29 -0
- package/dist/skills/normalize.d.ts +2 -0
- package/dist/skills/normalize.js +29 -0
- package/dist/skills/register-core.d.ts +2 -0
- package/dist/skills/register-core.js +21 -0
- package/dist/skills/types.d.ts +28 -0
- package/dist/skills/types.js +2 -0
- package/dist/skills/validate-skill.d.ts +2 -0
- package/dist/skills/validate-skill.js +29 -0
- package/dist/skills/validate.d.ts +2 -0
- package/dist/skills/validate.js +37 -0
- package/package.json +72 -45
- package/src/agents/agent-registry.ts +93 -0
- package/src/agents/anthropic/index.ts +86 -0
- package/src/agents/anthropic/manifest.json +7 -0
- package/src/agents/base.ts +77 -0
- package/src/agents/google/index.ts +79 -0
- package/src/agents/google/manifest.json +7 -0
- package/src/agents/mock/index.ts +32 -0
- package/src/agents/mock/manifest.json +7 -0
- package/src/agents/openai/index.ts +83 -0
- package/src/agents/openai/manifest.json +7 -0
- package/src/agents/system-prompts.ts +35 -0
- package/src/{agent-command-installer.ts → cli/agent-command-installer.ts} +164 -164
- package/src/{agents.ts → cli/agent-ids.ts} +58 -58
- package/src/{doctor.ts → cli/doctor.ts} +157 -137
- package/src/cli/fix-tui.ts +111 -0
- package/src/{cli.ts → cli/index.ts} +463 -410
- package/src/{init-tui.ts → cli/init-tui.ts} +49 -37
- package/src/{init.ts → cli/init.ts} +399 -398
- package/src/cli/normalize-interactive.ts +241 -0
- package/src/{preset-loader.ts → cli/preset-loader.ts} +237 -237
- package/src/{artifact-registry.ts → core/artifact-registry.ts} +69 -69
- package/src/{artifacts.ts → core/artifacts.ts} +1081 -1072
- package/src/core/clean.ts +88 -0
- package/src/{consistency.ts → core/consistency.ts} +374 -303
- package/src/{constants.ts → core/constants.ts} +72 -72
- package/src/{errors.ts → core/errors.ts} +7 -7
- package/src/core/fix.ts +253 -0
- package/src/{hook-executor.ts → core/hook-executor.ts} +196 -196
- package/src/{markdown.ts → core/markdown.ts} +93 -73
- package/src/{normalize.ts → core/normalize.ts} +145 -137
- package/src/{normalized-brief.ts → core/normalized-brief.ts} +227 -206
- package/src/{output-index.ts → core/output-index.ts} +59 -59
- package/src/{paths.ts → core/paths.ts} +75 -71
- package/src/{project-config.ts → core/project-config.ts} +78 -78
- package/src/{registry.ts → core/registry.ts} +119 -119
- package/src/{settings.ts → core/settings.ts} +8 -2
- package/src/core/template-engine.ts +45 -0
- package/src/{template-resolver.ts → core/template-resolver.ts} +54 -54
- package/src/{templates.ts → core/templates.ts} +452 -452
- package/src/core/terminology.ts +177 -0
- package/src/core/tracing.ts +110 -0
- package/src/{types.ts → core/types.ts} +46 -46
- package/src/{utils.ts → core/utils.ts} +64 -64
- package/src/{validate.ts → core/validate.ts} +252 -246
- package/src/{validator.ts → core/validator.ts} +92 -92
- package/src/{version.ts → core/version.ts} +24 -24
- package/src/{workflow-commands.ts → core/workflow-commands.ts} +32 -32
- package/src/i18n/en.json +45 -0
- package/src/i18n/index.ts +58 -0
- package/src/i18n/tr.json +45 -0
- package/src/providers/index.ts +29 -12
- package/src/providers/mock-provider.ts +200 -199
- package/src/providers/openai-provider.ts +88 -88
- package/src/skill-engine/context.ts +90 -0
- package/src/skill-engine/discovery.ts +57 -0
- package/src/skill-engine/graph.ts +136 -0
- package/src/skill-engine/index.ts +55 -0
- package/src/skill-engine/pipeline.ts +112 -0
- package/src/skill-engine/registry.ts +75 -0
- package/src/skill-engine/types.ts +81 -0
- package/src/skill-engine/validator.ts +135 -0
- package/src/skills/fix.ts +45 -0
- package/src/skills/generate-artifact.ts +48 -0
- package/src/skills/normalize.ts +32 -0
- package/src/skills/register-core.ts +27 -0
- package/src/skills/validate.ts +40 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import { resolveAi, type SupportedAi } from "./agent-command-installer";
|
|
4
|
-
import { UserError } from "
|
|
5
|
-
import { fileExists } from "
|
|
4
|
+
import { UserError } from "../core/errors";
|
|
5
|
+
import { fileExists } from "../core/utils";
|
|
6
6
|
|
|
7
7
|
export type InitSelections = {
|
|
8
8
|
ai?: SupportedAi;
|
|
9
9
|
script: "sh" | "ps";
|
|
10
|
-
lang:
|
|
10
|
+
lang: string;
|
|
11
11
|
author: string;
|
|
12
12
|
interactive: boolean;
|
|
13
13
|
};
|
|
@@ -79,23 +79,18 @@ function renderProjectBox(projectName: string, projectRoot: string): string {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
async function detectAi(projectRoot: string): Promise<SupportedAi | undefined> {
|
|
82
|
+
if (await fileExists(path.join(projectRoot, ".claude"))) return "claude-cli";
|
|
82
83
|
if (await fileExists(path.join(projectRoot, ".agents"))) return "codex";
|
|
83
84
|
if (await fileExists(path.join(projectRoot, ".gemini"))) return "gemini-cli";
|
|
84
|
-
if (await fileExists(path.join(projectRoot, ".claude"))) return "claude-cli";
|
|
85
85
|
return undefined;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
function normalizeLang(lang?: string):
|
|
89
|
-
|
|
88
|
+
function normalizeLang(lang?: string): string {
|
|
89
|
+
const raw = (lang ?? "").trim().toLowerCase();
|
|
90
|
+
if (raw.startsWith("tr")) return "tr";
|
|
90
91
|
return "en";
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
function modelChoiceFromAi(ai?: SupportedAi): "codex" | "gemini" | "auto-detect" {
|
|
94
|
-
if (ai === "codex") return "codex";
|
|
95
|
-
if (ai === "gemini-cli") return "gemini";
|
|
96
|
-
return "auto-detect";
|
|
97
|
-
}
|
|
98
|
-
|
|
99
94
|
function defaultAuthorName(authorInput?: string): string {
|
|
100
95
|
const explicit = (authorInput ?? "").trim();
|
|
101
96
|
if (explicit.length > 0) return explicit;
|
|
@@ -103,7 +98,7 @@ function defaultAuthorName(authorInput?: string): string {
|
|
|
103
98
|
const username = os.userInfo().username.trim();
|
|
104
99
|
if (username.length > 0) return username;
|
|
105
100
|
} catch {
|
|
106
|
-
// ignore
|
|
101
|
+
// ignore
|
|
107
102
|
}
|
|
108
103
|
return "Product Author";
|
|
109
104
|
}
|
|
@@ -126,11 +121,10 @@ export async function gatherInitSelections(options: GatherInitUiOptions): Promis
|
|
|
126
121
|
}
|
|
127
122
|
|
|
128
123
|
const detectedAi = await detectAi(options.projectRoot);
|
|
129
|
-
const initialModel = modelChoiceFromAi(parsedAi ?? detectedAi);
|
|
130
124
|
const projectName = path.basename(options.projectRoot) || ".";
|
|
131
125
|
const width = terminalWidth();
|
|
132
|
-
const subtitle = color("Prodo — Product
|
|
133
|
-
const signature = color("
|
|
126
|
+
const subtitle = color("Prodo — AI-Powered Product Owner", "\u001B[1;37m");
|
|
127
|
+
const signature = color("Built by Shahmarasy · Works with Claude, Codex, and Gemini", "\u001B[38;5;244m");
|
|
134
128
|
const hero = [
|
|
135
129
|
"",
|
|
136
130
|
centerBlock(renderLogo().split("\n"), width),
|
|
@@ -143,26 +137,26 @@ export async function gatherInitSelections(options: GatherInitUiOptions): Promis
|
|
|
143
137
|
clack.intro(hero);
|
|
144
138
|
clack.note(renderProjectBox(projectName, options.projectRoot), "Project Setup");
|
|
145
139
|
|
|
146
|
-
const
|
|
147
|
-
message: "
|
|
148
|
-
initialValue:
|
|
140
|
+
const agentChoice = await clack.select({
|
|
141
|
+
message: "Which AI agent will you use?",
|
|
142
|
+
initialValue: parsedAi ?? detectedAi ?? "claude-cli",
|
|
149
143
|
options: [
|
|
150
|
-
{ value: "
|
|
151
|
-
{ value: "
|
|
152
|
-
{ value: "
|
|
144
|
+
{ value: "claude-cli", label: "Claude Code", hint: "Slash commands → .claude/commands/" },
|
|
145
|
+
{ value: "codex", label: "Codex", hint: "Skills → .agents/skills/" },
|
|
146
|
+
{ value: "gemini-cli", label: "Gemini CLI", hint: "Commands → .gemini/commands/" }
|
|
153
147
|
]
|
|
154
148
|
});
|
|
155
|
-
if (clack.isCancel(
|
|
149
|
+
if (clack.isCancel(agentChoice)) {
|
|
156
150
|
clack.cancel("Initialization cancelled.");
|
|
157
151
|
throw new UserError("Initialization cancelled.");
|
|
158
152
|
}
|
|
159
153
|
|
|
160
154
|
const lang = await clack.select({
|
|
161
|
-
message: "
|
|
155
|
+
message: "Document language",
|
|
162
156
|
initialValue: defaultLang,
|
|
163
157
|
options: [
|
|
164
|
-
{ value: "
|
|
165
|
-
{ value: "
|
|
158
|
+
{ value: "en", label: "English" },
|
|
159
|
+
{ value: "tr", label: "Türkçe" }
|
|
166
160
|
]
|
|
167
161
|
});
|
|
168
162
|
if (clack.isCancel(lang)) {
|
|
@@ -172,7 +166,7 @@ export async function gatherInitSelections(options: GatherInitUiOptions): Promis
|
|
|
172
166
|
|
|
173
167
|
const author = await clack.text({
|
|
174
168
|
message: "Author name",
|
|
175
|
-
placeholder: "
|
|
169
|
+
placeholder: "Your name",
|
|
176
170
|
defaultValue: defaultAuthor
|
|
177
171
|
});
|
|
178
172
|
if (clack.isCancel(author)) {
|
|
@@ -180,15 +174,10 @@ export async function gatherInitSelections(options: GatherInitUiOptions): Promis
|
|
|
180
174
|
throw new UserError("Initialization cancelled.");
|
|
181
175
|
}
|
|
182
176
|
|
|
183
|
-
let selectedAi: SupportedAi | undefined;
|
|
184
|
-
if (model === "codex") selectedAi = "codex";
|
|
185
|
-
else if (model === "gemini") selectedAi = "gemini-cli";
|
|
186
|
-
else selectedAi = detectedAi;
|
|
187
|
-
|
|
188
177
|
return {
|
|
189
|
-
ai:
|
|
178
|
+
ai: agentChoice as SupportedAi,
|
|
190
179
|
script: fallbackScript,
|
|
191
|
-
lang,
|
|
180
|
+
lang: String(lang),
|
|
192
181
|
author: String(author).trim() || defaultAuthor,
|
|
193
182
|
interactive: true
|
|
194
183
|
};
|
|
@@ -198,11 +187,34 @@ export function finishInitInteractive(summary: {
|
|
|
198
187
|
projectRoot: string;
|
|
199
188
|
settingsPath: string;
|
|
200
189
|
ai?: SupportedAi;
|
|
201
|
-
lang:
|
|
190
|
+
lang: string;
|
|
202
191
|
author: string;
|
|
203
192
|
}): Promise<void> {
|
|
204
|
-
const
|
|
193
|
+
const agentLabel = summary.ai === "claude-cli" ? "Claude Code"
|
|
194
|
+
: summary.ai === "codex" ? "Codex"
|
|
195
|
+
: summary.ai === "gemini-cli" ? "Gemini CLI"
|
|
196
|
+
: "none";
|
|
197
|
+
|
|
198
|
+
const commandPrefix = summary.ai === "codex" ? "$" : "/";
|
|
199
|
+
const commands = [
|
|
200
|
+
`${commandPrefix}prodo-normalize`,
|
|
201
|
+
`${commandPrefix}prodo-prd`,
|
|
202
|
+
`${commandPrefix}prodo-workflow`,
|
|
203
|
+
`${commandPrefix}prodo-wireframe`,
|
|
204
|
+
`${commandPrefix}prodo-stories`,
|
|
205
|
+
`${commandPrefix}prodo-techspec`,
|
|
206
|
+
`${commandPrefix}prodo-validate`
|
|
207
|
+
];
|
|
208
|
+
|
|
205
209
|
return loadClack().then((clack) => clack.outro(
|
|
206
|
-
`Scaffold complete
|
|
210
|
+
`Scaffold complete!\n\n` +
|
|
211
|
+
` Agent: ${agentLabel}\n` +
|
|
212
|
+
` Language: ${summary.lang}\n` +
|
|
213
|
+
` Author: ${summary.author}\n\n` +
|
|
214
|
+
`Next steps:\n` +
|
|
215
|
+
` 1. Edit brief.md with your product description\n` +
|
|
216
|
+
` 2. Open this folder in ${agentLabel}\n` +
|
|
217
|
+
` 3. Run commands in sequence:\n` +
|
|
218
|
+
` ${commands.join("\n ")}`
|
|
207
219
|
));
|
|
208
220
|
}
|