product-spec-mcp 0.3.30 → 0.3.31
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/dist/index.cjs +38 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -23784,7 +23784,18 @@ function buildPmGateClarification(decision) {
|
|
|
23784
23784
|
defaultAssumptions: Object.fromEntries(questions.map((question) => [question.field, question.defaultAssumption]))
|
|
23785
23785
|
};
|
|
23786
23786
|
}
|
|
23787
|
-
function
|
|
23787
|
+
function buildPmGateReadiness(decision, readiness) {
|
|
23788
|
+
const draftReadyNeed = decision.needType === "personal_local_tool" || decision.needType === "content_marketing_site" || decision.needType === "data_visualization_site";
|
|
23789
|
+
if (!draftReadyNeed) return readiness;
|
|
23790
|
+
return {
|
|
23791
|
+
...readiness,
|
|
23792
|
+
score: Math.max(readiness.score, 64),
|
|
23793
|
+
status: "Draft Ready"
|
|
23794
|
+
};
|
|
23795
|
+
}
|
|
23796
|
+
function formatPmGateInterrogateResult(decision, readiness, clarification) {
|
|
23797
|
+
const canDraft = readiness.status !== "Not Ready";
|
|
23798
|
+
const nextStep = decision.needType === "personal_local_tool" ? "\u53EF\u4EE5\u6309\u9ED8\u8BA4\u5047\u8BBE\u76F4\u63A5\u8FDB\u5165 spec_compile \u751F\u6210 MVP \u8349\u6848\uFF1B\u5982\u679C\u8981\u95EE\u7528\u6237\uFF0C\u6700\u591A\u53EA\u95EE\u4E00\u53E5\uFF1A\u662F\u5426\u6309\u6D4F\u89C8\u5668\u672C\u5730\u4FDD\u5B58\u3001\u4E0D\u767B\u5F55\u4E0D\u505A\u540E\u53F0\u3001\u9875\u9762\u5185\u63D0\u9192\u7EE7\u7EED\uFF1F" : canDraft ? "\u53EF\u4EE5\u6309\u9ED8\u8BA4\u5047\u8BBE\u751F\u6210\u8349\u6848\uFF0C\u540C\u65F6\u53EA\u786E\u8BA4\u4F1A\u6539\u53D8\u67B6\u6784\u7684\u8FB9\u754C\u95EE\u9898\u3002" : "\u5148\u786E\u8BA4\u4F1A\u6539\u53D8\u67B6\u6784\u7684\u8FB9\u754C\u95EE\u9898\uFF0C\u518D\u8FDB\u5165 spec_compile\u3002";
|
|
23788
23799
|
return `# PM Gate \u5224\u65AD\uFF1A${needTypeTitle(decision.needType)}
|
|
23789
23800
|
|
|
23790
23801
|
- **\u9700\u6C42\u95E8:** ${decision.needType}
|
|
@@ -23800,7 +23811,27 @@ function formatPmGateInterrogatePrelude(decision) {
|
|
|
23800
23811
|
${decision.defaultAssumptions.map((item) => `- ${item}`).join("\n")}
|
|
23801
23812
|
|
|
23802
23813
|
> \u5148\u786E\u8BA4\u4F7F\u7528\u8303\u56F4\u3001\u7EF4\u62A4\u65B9\u5F0F\u548C\u8BBF\u95EE\u8FB9\u754C\uFF1B\u4E0D\u8981\u5957\u7528\u65E0\u5173 domain \u6A21\u677F\u3002
|
|
23803
|
-
|
|
23814
|
+
|
|
23815
|
+
## \u53EF\u6267\u884C\u72B6\u6001
|
|
23816
|
+
|
|
23817
|
+
- **Score:** ${readiness.score} / 100
|
|
23818
|
+
- **\u72B6\u6001:** ${readiness.status}
|
|
23819
|
+
- **\u4E0B\u4E00\u6B65:** ${nextStep}
|
|
23820
|
+
|
|
23821
|
+
## \u8FB9\u754C\u95EE\u9898
|
|
23822
|
+
|
|
23823
|
+
${clarification.questions.map(formatQuestion).join("\n\n")}
|
|
23824
|
+
|
|
23825
|
+
## \u9ED8\u8BA4\u5047\u8BBE
|
|
23826
|
+
|
|
23827
|
+
${Object.entries(clarification.defaultAssumptions).map(([field, value]) => `- **${field}:** ${value}`).join("\n")}`;
|
|
23828
|
+
}
|
|
23829
|
+
function formatQuestion(question) {
|
|
23830
|
+
return `### ${question.question}
|
|
23831
|
+
- **\u4E3E\u4E2A\u4F8B\u5B50:** ${question.example || "\u6309\u7528\u6237\u539F\u8BDD\u8865\u5145\u5373\u53EF\u3002"}
|
|
23832
|
+
- **\u4E3A\u4EC0\u4E48\u8981\u95EE:** ${question.whyImportant}
|
|
23833
|
+
- **\u63A8\u8350\u9009\u9879:** ${question.options.join(" / ")}
|
|
23834
|
+
- **\u9ED8\u8BA4\u5047\u8BBE:** \u5982\u679C\u4E0D\u56DE\u7B54\uFF0C\u9ED8\u8BA4\u4E3A\u300C${question.defaultAssumption}\u300D`;
|
|
23804
23835
|
}
|
|
23805
23836
|
function questionsForDecision(decision) {
|
|
23806
23837
|
switch (decision.needType) {
|
|
@@ -23980,19 +24011,18 @@ function registerSpecInterrogate(server) {
|
|
|
23980
24011
|
const technicalProfile = buildTechnicalProfile(input.raw_idea, input.known_context || {});
|
|
23981
24012
|
const pmIntentDecision = decidePmIntent(input.raw_idea, input.known_context || {});
|
|
23982
24013
|
const usePmGate = input.scenario !== "modify_ui" && shouldUsePmGateClarification(pmIntentDecision);
|
|
24014
|
+
const effectiveReadiness = usePmGate ? buildPmGateReadiness(pmIntentDecision, readiness) : readiness;
|
|
23983
24015
|
const clarification = usePmGate ? buildPmGateClarification(pmIntentDecision) : generateClarification(
|
|
23984
24016
|
input.raw_idea,
|
|
23985
|
-
|
|
24017
|
+
effectiveReadiness,
|
|
23986
24018
|
input.scenario,
|
|
23987
24019
|
input.target_platform,
|
|
23988
24020
|
input.strictness,
|
|
23989
24021
|
input.known_context
|
|
23990
24022
|
);
|
|
23991
|
-
const
|
|
23992
|
-
const markdown = usePmGate ? `${formatPmGateInterrogatePrelude(pmIntentDecision)}
|
|
23993
|
-
${baseMarkdown}` : baseMarkdown;
|
|
24023
|
+
const markdown = usePmGate ? formatPmGateInterrogateResult(pmIntentDecision, effectiveReadiness, clarification) : formatInterrogateResult(effectiveReadiness, clarification);
|
|
23994
24024
|
const structuredContent = buildInterrogateStructuredOutput(
|
|
23995
|
-
|
|
24025
|
+
effectiveReadiness,
|
|
23996
24026
|
clarification,
|
|
23997
24027
|
technicalProfile,
|
|
23998
24028
|
usePmGate ? pmIntentDecision : void 0
|
|
@@ -29939,7 +29969,7 @@ function registerProductSpecAssist(server) {
|
|
|
29939
29969
|
function createServer() {
|
|
29940
29970
|
const server = new McpServer({
|
|
29941
29971
|
name: "product-spec-mcp",
|
|
29942
|
-
version: "0.3.
|
|
29972
|
+
version: "0.3.31"
|
|
29943
29973
|
});
|
|
29944
29974
|
registerSpecInterrogate(server);
|
|
29945
29975
|
registerSpecCompile(server);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "product-spec-mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.31",
|
|
4
4
|
"description": "MCP Server for product specification - requirement interrogation, architecture decision, UI translation, debug guidance, and acceptance generation",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/index.cjs",
|