fraim-framework 2.0.56 → 2.0.58
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/CHANGELOG.md +10 -0
- package/bin/fraim-mcp.js +14 -0
- package/bin/fraim.js +23 -0
- package/dist/src/cli/commands/init-project.js +10 -4
- package/dist/src/cli/commands/mcp.js +65 -0
- package/dist/src/cli/setup/mcp-config-generator.js +19 -16
- package/dist/src/fraim/issue-tracking/ado-provider.js +304 -0
- package/dist/src/fraim/issue-tracking/factory.js +63 -0
- package/dist/src/fraim/issue-tracking/github-provider.js +200 -0
- package/dist/src/fraim/issue-tracking/types.js +7 -0
- package/dist/src/fraim/issue-tracking-config.js +83 -0
- package/dist/src/local-mcp-server/stdio-server.js +207 -0
- package/dist/src/utils/workflow-parser.js +81 -0
- package/package.json +17 -12
- package/registry/scripts/pdf-styles.css +172 -0
- package/registry/scripts/prep-issue.sh +46 -4
- package/registry/scripts/profile-server.ts +131 -130
- package/registry/stubs/workflows/customer-development/user-survey-dispatch.md +1 -1
- package/registry/stubs/workflows/customer-development/users-to-target.md +1 -1
- package/registry/stubs/workflows/product-building/design.md +1 -1
- package/registry/stubs/workflows/product-building/implement.md +1 -1
- package/Claude.md +0 -1
- package/dist/registry/ai-manager-rules/customer-development-phases/phase1-customer-profiling.md +0 -101
- package/dist/registry/ai-manager-rules/customer-development-phases/phase2-platform-discovery.md +0 -235
- package/dist/registry/ai-manager-rules/customer-development-phases/phase3-prospect-qualification.md +0 -243
- package/dist/registry/ai-manager-rules/customer-development-phases/phase4-inventory-compilation.md +0 -206
- package/dist/registry/ai-manager-rules/design-phases/design-completeness-review.md +0 -73
- package/dist/registry/ai-manager-rules/design-phases/design-design.md +0 -145
- package/dist/registry/ai-manager-rules/implement-phases/implement-code.md +0 -283
- package/dist/registry/ai-manager-rules/implement-phases/implement-completeness-review.md +0 -120
- package/dist/registry/ai-manager-rules/implement-phases/implement-regression.md +0 -173
- package/dist/registry/ai-manager-rules/implement-phases/implement-repro.md +0 -104
- package/dist/registry/ai-manager-rules/implement-phases/implement-scoping.md +0 -100
- package/dist/registry/ai-manager-rules/implement-phases/implement-smoke.md +0 -237
- package/dist/registry/ai-manager-rules/implement-phases/implement-spike.md +0 -121
- package/dist/registry/ai-manager-rules/implement-phases/implement-validate.md +0 -375
- package/dist/registry/ai-manager-rules/retrospective.md +0 -116
- package/dist/registry/ai-manager-rules/shared-phases/address-pr-feedback.md +0 -188
- package/dist/registry/ai-manager-rules/shared-phases/submit-pr.md +0 -202
- package/dist/registry/ai-manager-rules/shared-phases/wait-for-pr-review.md +0 -170
- package/dist/registry/ai-manager-rules/spec-phases/spec-competitor-analysis.md +0 -105
- package/dist/registry/ai-manager-rules/spec-phases/spec-completeness-review.md +0 -66
- package/dist/registry/ai-manager-rules/spec-phases/spec-spec.md +0 -139
- package/dist/registry/ai-manager-rules/user-survey-phases/phase1-survey-scoping.md +0 -60
- package/dist/registry/ai-manager-rules/user-survey-phases/phase2-survey-build-linkedin.md +0 -23
- package/dist/registry/ai-manager-rules/user-survey-phases/phase3-survey-build-reddit.md +0 -22
- package/dist/registry/ai-manager-rules/user-survey-phases/phase4-survey-build-x.md +0 -21
- package/dist/registry/ai-manager-rules/user-survey-phases/phase5-survey-build-facebook.md +0 -19
- package/dist/registry/ai-manager-rules/user-survey-phases/phase6-survey-build-custom.md +0 -15
- package/dist/registry/ai-manager-rules/user-survey-phases/phase7-survey-dispatch.md +0 -45
- package/dist/registry/providers/ado.json +0 -19
- package/dist/registry/providers/github.json +0 -19
- package/dist/registry/scripts/cleanup-branch.js +0 -287
- package/dist/registry/scripts/evaluate-code-quality.js +0 -66
- package/dist/registry/scripts/exec-with-timeout.js +0 -142
- package/dist/registry/scripts/generate-engagement-emails.js +0 -705
- package/dist/registry/scripts/newsletter-helpers.js +0 -671
- package/dist/registry/scripts/profile-server.js +0 -388
- package/dist/registry/scripts/run-thank-you-workflow.js +0 -92
- package/dist/registry/scripts/send-newsletter-simple.js +0 -85
- package/dist/registry/scripts/send-thank-you-emails.js +0 -54
- package/dist/registry/scripts/validate-openapi-limits.js +0 -311
- package/dist/registry/scripts/validate-test-coverage.js +0 -262
- package/dist/registry/scripts/verify-test-coverage.js +0 -66
- package/dist/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +0 -53
- package/dist/registry/templates/bootstrap/CODE-QUALITY-REPORT-TEMPLATE.md +0 -37
- package/dist/registry/templates/bootstrap/TEST-COVERAGE-REPORT-TEMPLATE.md +0 -35
- package/dist/registry/templates/business-development/IDEATION-REPORT-TEMPLATE.md +0 -29
- package/dist/registry/templates/business-development/PRICING-STRATEGY-TEMPLATE.md +0 -126
- package/dist/registry/templates/customer-development/customer-interview-template.md +0 -99
- package/dist/registry/templates/customer-development/customer-persona-template.md +0 -69
- package/dist/registry/templates/customer-development/follow-up-email-templates.md +0 -132
- package/dist/registry/templates/customer-development/insight-analysis-template.md +0 -74
- package/dist/registry/templates/customer-development/prospect-inventory-template.csv +0 -3
- package/dist/registry/templates/customer-development/search-strategy-template.md +0 -123
- package/dist/registry/templates/customer-development/strategic-recommendations-template.md +0 -53
- package/dist/registry/templates/customer-development/thank-you-email-template.html +0 -124
- package/dist/registry/templates/customer-development/thank-you-note-template.md +0 -16
- package/dist/registry/templates/customer-development/triage-log-template.md +0 -278
- package/dist/registry/templates/customer-development/weekly-newsletter-template.html +0 -204
- package/dist/registry/templates/evidence/Design-Evidence.md +0 -30
- package/dist/registry/templates/evidence/Implementation-BugEvidence.md +0 -94
- package/dist/registry/templates/evidence/Implementation-FeatureEvidence.md +0 -129
- package/dist/registry/templates/evidence/Spec-Evidence.md +0 -19
- package/dist/registry/templates/help/HelpNeeded.md +0 -14
- package/dist/registry/templates/legal/NDA-TEMPLATE.md +0 -170
- package/dist/registry/templates/legal/PATENT-TEMPLATE.md +0 -372
- package/dist/registry/templates/legal/TRADEMARK-TEMPLATE.md +0 -339
- package/dist/registry/templates/legal/contract-review-checklist.md +0 -193
- package/dist/registry/templates/legal/review-report-template.md +0 -198
- package/dist/registry/templates/legal/saas-terms-template.md +0 -174
- package/dist/registry/templates/legal/sow-template.md +0 -117
- package/dist/registry/templates/legal/template-variables.md +0 -131
- package/dist/registry/templates/marketing/DOMAIN-REGISTRATION-TEMPLATE.md +0 -194
- package/dist/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +0 -66
- package/dist/registry/templates/marketing/STORYTELLING-TEMPLATE.md +0 -130
- package/dist/registry/templates/marketing/WEBSITE-TEMPLATE.md +0 -262
- package/dist/registry/templates/marketing/github-pages-workflow.yml +0 -64
- package/dist/registry/templates/replicate/implementation-checklist.md +0 -39
- package/dist/registry/templates/replicate/use-cases-template.md +0 -88
- package/dist/registry/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +0 -55
- package/dist/registry/templates/specs/BUGSPEC-TEMPLATE.md +0 -37
- package/dist/registry/templates/specs/FEATURESPEC-TEMPLATE.md +0 -66
- package/dist/registry/templates/specs/TECHSPEC-TEMPLATE.md +0 -39
- package/dist/registry/workflows/bootstrap/create-architecture.md +0 -38
- package/dist/registry/workflows/bootstrap/detect-broken-windows.md +0 -300
- package/dist/registry/workflows/bootstrap/evaluate-code-quality.md +0 -35
- package/dist/registry/workflows/bootstrap/verify-test-coverage.md +0 -36
- package/dist/registry/workflows/brainstorming/blue-sky-brainstorming.md +0 -211
- package/dist/registry/workflows/brainstorming/codebase-brainstorming.md +0 -165
- package/dist/registry/workflows/business-development/create-business-plan.md +0 -737
- package/dist/registry/workflows/business-development/ideate-business-opportunity.md +0 -55
- package/dist/registry/workflows/business-development/price-product.md +0 -325
- package/dist/registry/workflows/compliance/detect-compliance-requirements.md +0 -78
- package/dist/registry/workflows/compliance/generate-audit-evidence.md +0 -75
- package/dist/registry/workflows/compliance/soc2-evidence-generator.md +0 -332
- package/dist/registry/workflows/customer-development/insight-analysis.md +0 -156
- package/dist/registry/workflows/customer-development/insight-triage.md +0 -938
- package/dist/registry/workflows/customer-development/interview-preparation.md +0 -452
- package/dist/registry/workflows/customer-development/linkedin-outreach.md +0 -593
- package/dist/registry/workflows/customer-development/strategic-brainstorming.md +0 -146
- package/dist/registry/workflows/customer-development/thank-customers.md +0 -203
- package/dist/registry/workflows/customer-development/user-survey-dispatch.md +0 -60
- package/dist/registry/workflows/customer-development/users-to-target.md +0 -112
- package/dist/registry/workflows/customer-development/weekly-newsletter.md +0 -366
- package/dist/registry/workflows/deploy/cloud-deployment.md +0 -310
- package/dist/registry/workflows/improve-fraim/contribute.md +0 -32
- package/dist/registry/workflows/improve-fraim/file-issue.md +0 -32
- package/dist/registry/workflows/learning/build-skillset.md +0 -212
- package/dist/registry/workflows/learning/synthesize-learnings.md +0 -284
- package/dist/registry/workflows/legal/contract-review-analysis.md +0 -382
- package/dist/registry/workflows/legal/nda.md +0 -69
- package/dist/registry/workflows/legal/patent-filing.md +0 -76
- package/dist/registry/workflows/legal/saas-contract-development.md +0 -213
- package/dist/registry/workflows/legal/trademark-filing.md +0 -77
- package/dist/registry/workflows/marketing/content-creation.md +0 -37
- package/dist/registry/workflows/marketing/convert-to-pdf.md +0 -235
- package/dist/registry/workflows/marketing/create-modern-website.md +0 -456
- package/dist/registry/workflows/marketing/domain-registration.md +0 -323
- package/dist/registry/workflows/marketing/hbr-article.md +0 -73
- package/dist/registry/workflows/marketing/launch-checklist.md +0 -37
- package/dist/registry/workflows/marketing/marketing-strategy.md +0 -45
- package/dist/registry/workflows/marketing/storytelling.md +0 -65
- package/dist/registry/workflows/performance/analyze-performance.md +0 -65
- package/dist/registry/workflows/product-building/design.md +0 -103
- package/dist/registry/workflows/product-building/implement.md +0 -74
- package/dist/registry/workflows/product-building/iterate-on-pr-comments.md +0 -70
- package/dist/registry/workflows/product-building/prep-issue.md +0 -41
- package/dist/registry/workflows/product-building/prototype.md +0 -65
- package/dist/registry/workflows/product-building/resolve.md +0 -168
- package/dist/registry/workflows/product-building/retrospect.md +0 -86
- package/dist/registry/workflows/product-building/spec.md +0 -181
- package/dist/registry/workflows/product-building/test.md +0 -125
- package/dist/registry/workflows/productivity-report/productivity-report.md +0 -263
- package/dist/registry/workflows/quality-assurance/browser-validation.md +0 -221
- package/dist/registry/workflows/quality-assurance/iterative-improvement-cycle.md +0 -562
- package/dist/registry/workflows/replicate/replicate-discovery.md +0 -336
- package/dist/registry/workflows/replicate/replicate-to-issues.md +0 -324
- package/dist/registry/workflows/reviewer/review-implementation-vs-design-spec.md +0 -638
- package/dist/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +0 -675
- package/dist/registry/workflows/startup-credits/aws-activate-application.md +0 -535
- package/dist/registry/workflows/startup-credits/google-cloud-application.md +0 -647
- package/dist/registry/workflows/startup-credits/microsoft-azure-application.md +0 -538
- package/dist/scripts/build-stub-registry.js +0 -108
- package/dist/src/ai-manager/ai-manager.js +0 -480
- package/dist/src/ai-manager/phase-flow.js +0 -357
- package/dist/src/ai-manager/types.js +0 -5
- package/dist/src/fraim-mcp-server.js +0 -1885
- package/dist/tests/debug-tools.js +0 -80
- package/dist/tests/shared-server-utils.js +0 -57
- package/dist/tests/test-add-ide.js +0 -283
- package/dist/tests/test-ai-coach-edge-cases.js +0 -420
- package/dist/tests/test-ai-coach-mcp-integration.js +0 -450
- package/dist/tests/test-ai-coach-performance.js +0 -328
- package/dist/tests/test-ai-coach-phase-content.js +0 -264
- package/dist/tests/test-ai-coach-workflows.js +0 -514
- package/dist/tests/test-cli.js +0 -228
- package/dist/tests/test-client-scripts-validation.js +0 -167
- package/dist/tests/test-complete-setup-flow.js +0 -110
- package/dist/tests/test-config-system.js +0 -279
- package/dist/tests/test-debug-session.js +0 -134
- package/dist/tests/test-end-to-end-hybrid-validation.js +0 -328
- package/dist/tests/test-enhanced-session-init.js +0 -188
- package/dist/tests/test-first-run-journey.js +0 -368
- package/dist/tests/test-fraim-issues.js +0 -59
- package/dist/tests/test-genericization.js +0 -44
- package/dist/tests/test-hybrid-script-execution.js +0 -340
- package/dist/tests/test-ide-detector.js +0 -46
- package/dist/tests/test-improved-setup.js +0 -121
- package/dist/tests/test-mcp-config-generator.js +0 -99
- package/dist/tests/test-mcp-connection.js +0 -107
- package/dist/tests/test-mcp-issue-integration.js +0 -156
- package/dist/tests/test-mcp-lifecycle-methods.js +0 -240
- package/dist/tests/test-mcp-shared-server.js +0 -308
- package/dist/tests/test-mcp-template-processing.js +0 -160
- package/dist/tests/test-modular-issue-tracking.js +0 -165
- package/dist/tests/test-node-compatibility.js +0 -95
- package/dist/tests/test-npm-install.js +0 -68
- package/dist/tests/test-package-size.js +0 -108
- package/dist/tests/test-pr-review-workflow.js +0 -307
- package/dist/tests/test-prep-issue.js +0 -129
- package/dist/tests/test-productivity-integration.js +0 -157
- package/dist/tests/test-script-location-independence.js +0 -198
- package/dist/tests/test-script-sync.js +0 -557
- package/dist/tests/test-server-utils.js +0 -32
- package/dist/tests/test-session-rehydration.js +0 -148
- package/dist/tests/test-setup-integration.js +0 -98
- package/dist/tests/test-setup-scenarios.js +0 -322
- package/dist/tests/test-standalone.js +0 -143
- package/dist/tests/test-stub-registry.js +0 -136
- package/dist/tests/test-sync-stubs.js +0 -143
- package/dist/tests/test-sync-version-update.js +0 -93
- package/dist/tests/test-telemetry.js +0 -193
- package/dist/tests/test-token-validator.js +0 -30
- package/dist/tests/test-user-journey.js +0 -236
- package/dist/tests/test-users-to-target-workflow.js +0 -253
- package/dist/tests/test-utils.js +0 -109
- package/dist/tests/test-wizard.js +0 -71
- package/dist/tests/test-workflow-discovery.js +0 -242
- package/labels.json +0 -52
- package/registry/agent-guardrails.md +0 -63
- package/registry/fraim.md +0 -48
- package/setup.js +0 -171
- package/tsconfig.json +0 -23
|
@@ -1,480 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* AI Coach - Provides guidance and coaching for implementation phases
|
|
4
|
-
*
|
|
5
|
-
* Handles coaching requests from agents, provides phase instructions,
|
|
6
|
-
* completion messages, and help when agents encounter challenges.
|
|
7
|
-
*/
|
|
8
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
-
var ownKeys = function(o) {
|
|
26
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
-
var ar = [];
|
|
28
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
-
return ar;
|
|
30
|
-
};
|
|
31
|
-
return ownKeys(o);
|
|
32
|
-
};
|
|
33
|
-
return function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.AICoach = void 0;
|
|
43
|
-
const fs_1 = require("fs");
|
|
44
|
-
const phase_flow_js_1 = require("./phase-flow.js");
|
|
45
|
-
class AICoach {
|
|
46
|
-
constructor(fileIndex) {
|
|
47
|
-
this.fileIndex = fileIndex;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Handle coaching request from agent
|
|
51
|
-
*/
|
|
52
|
-
async handleCoachingRequest(args) {
|
|
53
|
-
console.log(`🤖 AI Coach: Providing guidance for ${args.workflowType} workflow, phase: ${args.currentPhase}, status: ${args.status}`);
|
|
54
|
-
// Validate required parameters
|
|
55
|
-
const requiredParams = ['workflowType', 'currentPhase', 'status'];
|
|
56
|
-
const missingParams = requiredParams.filter(param => !args[param]);
|
|
57
|
-
if (missingParams.length > 0) {
|
|
58
|
-
console.log(`❌ AI Coach: Missing required parameters: ${missingParams.join(', ')}`);
|
|
59
|
-
throw new Error(`Missing required parameters: ${missingParams.join(', ')}`);
|
|
60
|
-
}
|
|
61
|
-
// Handle missing or empty issue number gracefully
|
|
62
|
-
if (!args.issueNumber || args.issueNumber.trim() === '') {
|
|
63
|
-
return `⚠️ **Issue Number Missing**
|
|
64
|
-
|
|
65
|
-
Please provide a valid issue number to get specific guidance for your workflow.
|
|
66
|
-
|
|
67
|
-
**Current Request:**
|
|
68
|
-
- Workflow: ${args.workflowType}
|
|
69
|
-
- Phase: ${args.currentPhase}
|
|
70
|
-
- Status: ${args.status}
|
|
71
|
-
|
|
72
|
-
**Next Steps:**
|
|
73
|
-
1. Identify the GitHub issue number you're working on
|
|
74
|
-
2. Include the issue number in your coaching request
|
|
75
|
-
3. Re-request guidance with complete information
|
|
76
|
-
|
|
77
|
-
Example: \`seekCoachingOnNextStep({ workflowType: "${args.workflowType}", issueNumber: "123", currentPhase: "${args.currentPhase}", status: "${args.status}" })\``;
|
|
78
|
-
}
|
|
79
|
-
// Validate workflow type
|
|
80
|
-
const validWorkflowTypes = ['implement', 'spec', 'design', 'test', 'customer-development', 'user-survey'];
|
|
81
|
-
if (!validWorkflowTypes.includes(args.workflowType)) {
|
|
82
|
-
console.log(`❌ AI Coach: Invalid workflow type: ${args.workflowType}`);
|
|
83
|
-
throw new Error(`Invalid workflow type: ${args.workflowType}. Valid types: ${validWorkflowTypes.join(', ')}`);
|
|
84
|
-
}
|
|
85
|
-
// Validate phase for workflow type
|
|
86
|
-
const issueType = this.extractIssueType(args.findings, args.evidence);
|
|
87
|
-
console.log(`🔍 AI Coach: Extracted issue type: ${issueType}`);
|
|
88
|
-
if (!(0, phase_flow_js_1.isPhaseValidForWorkflow)(args.currentPhase, args.workflowType, issueType)) {
|
|
89
|
-
// Special handling for implement workflow to provide better error messages
|
|
90
|
-
if (args.workflowType === 'implement') {
|
|
91
|
-
const hasIssueType = args.findings?.issueType || args.evidence?.issueType;
|
|
92
|
-
if (!hasIssueType) {
|
|
93
|
-
throw new Error(`❌ Missing Required Field: issueType
|
|
94
|
-
|
|
95
|
-
For implement workflow, you MUST specify issueType in your findings object:
|
|
96
|
-
|
|
97
|
-
**Correct format:**
|
|
98
|
-
\`\`\`javascript
|
|
99
|
-
seekCoachingOnNextStep({
|
|
100
|
-
workflowType: "implement",
|
|
101
|
-
issueNumber: "${args.issueNumber}",
|
|
102
|
-
currentPhase: "${args.currentPhase}",
|
|
103
|
-
status: "${args.status}",
|
|
104
|
-
findings: {
|
|
105
|
-
issueType: "bug" // or "feature" - REQUIRED!
|
|
106
|
-
},
|
|
107
|
-
evidence: {
|
|
108
|
-
// your evidence here
|
|
109
|
-
}
|
|
110
|
-
})
|
|
111
|
-
\`\`\`
|
|
112
|
-
|
|
113
|
-
**Valid phases by issue type:**
|
|
114
|
-
- **Bugs**: implement-scoping → implement-repro → implement-code → implement-validate → implement-smoke → implement-regression → implement-completeness-review → submit-pr → wait-for-pr-review
|
|
115
|
-
- **Features**: implement-scoping → implement-spike → implement-code → implement-validate → implement-smoke → implement-regression → implement-completeness-review → submit-pr → wait-for-pr-review`);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
throw new Error(`❌ Invalid Phase for Issue Type
|
|
119
|
-
|
|
120
|
-
Phase "${args.currentPhase}" is not valid for ${issueType} issues.
|
|
121
|
-
|
|
122
|
-
**Valid phases for ${issueType}s:**
|
|
123
|
-
${this.getValidPhasesForIssueType(issueType).join(' → ')}
|
|
124
|
-
|
|
125
|
-
**Your current request:**
|
|
126
|
-
- Workflow: ${args.workflowType}
|
|
127
|
-
- Issue Type: ${issueType}
|
|
128
|
-
- Phase: ${args.currentPhase} ❌
|
|
129
|
-
|
|
130
|
-
**Suggestion:** Use the correct phase name from the valid flow above.`);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
throw new Error(`Invalid phase "${args.currentPhase}" for workflow type "${args.workflowType}"`);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
if (args.status === 'complete') {
|
|
138
|
-
console.log(`✅ AI Coach: Generating completion message`);
|
|
139
|
-
return await this.generateCompletionMessage(args);
|
|
140
|
-
}
|
|
141
|
-
else if (args.status === 'incomplete') {
|
|
142
|
-
console.log(`🤝 AI Coach: Generating help message`);
|
|
143
|
-
return await this.generateHelpMessage(args);
|
|
144
|
-
}
|
|
145
|
-
else if (args.status === 'failure') {
|
|
146
|
-
console.log(`❌ AI Coach: Generating failure message`);
|
|
147
|
-
return await this.generateFailureMessage(args);
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
console.log(`📖 AI Coach: Getting phase instructions for ${args.currentPhase}`);
|
|
151
|
-
return await this.getPhaseInstructions(args.currentPhase, args.workflowType);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Generate completion message for completed phases
|
|
156
|
-
*/
|
|
157
|
-
async generateCompletionMessage(args) {
|
|
158
|
-
// Determine next phase and provide its instructions
|
|
159
|
-
const issueType = this.extractIssueType(args.findings, args.evidence);
|
|
160
|
-
const nextPhase = (0, phase_flow_js_1.getNextPhase)(args.currentPhase, args.workflowType, issueType);
|
|
161
|
-
if (!nextPhase) {
|
|
162
|
-
// This is the final phase - show completion message
|
|
163
|
-
return `# 🎉 ${args.workflowType.charAt(0).toUpperCase() + args.workflowType.slice(1)} Complete!
|
|
164
|
-
|
|
165
|
-
**Congratulations!** You have successfully completed all ${args.workflowType} phases for issue #${args.issueNumber}.
|
|
166
|
-
|
|
167
|
-
## 🏆 What You've Accomplished
|
|
168
|
-
${this.getAccomplishmentsForWorkflow(args.workflowType)}
|
|
169
|
-
|
|
170
|
-
## 📋 Final Evidence Summary
|
|
171
|
-
${JSON.stringify(args.evidence || args.findings || {}, null, 2)}
|
|
172
|
-
|
|
173
|
-
`;
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
// Get instructions for the next phase
|
|
177
|
-
const nextPhaseInstructions = await this.getPhaseInstructions(nextPhase, args.workflowType);
|
|
178
|
-
return `# 🎉 Phase Complete!
|
|
179
|
-
|
|
180
|
-
**Phase:** ${args.currentPhase}
|
|
181
|
-
**Status:** Complete
|
|
182
|
-
|
|
183
|
-
Great work! You've completed the ${args.currentPhase} phase.
|
|
184
|
-
|
|
185
|
-
## Evidence Summary
|
|
186
|
-
${JSON.stringify(args.evidence || args.findings || {}, null, 2)}
|
|
187
|
-
|
|
188
|
-
## 🚀 Next Phase: ${nextPhase}
|
|
189
|
-
|
|
190
|
-
Here are the instructions for your next phase:
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
${nextPhaseInstructions}
|
|
195
|
-
`;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Get accomplishments list for a workflow type
|
|
200
|
-
*/
|
|
201
|
-
getAccomplishmentsForWorkflow(workflowType) {
|
|
202
|
-
switch (workflowType) {
|
|
203
|
-
case 'implement':
|
|
204
|
-
return `- ✅ **Scoping**: Understood requirements and issue type
|
|
205
|
-
- ✅ **Repro/Spike**: Created reproduction test or validated technical approach
|
|
206
|
-
- ✅ **Implementation**: Built working solution with comprehensive tests
|
|
207
|
-
- ✅ **Validation**: Verified functionality through manual and automated testing
|
|
208
|
-
- ✅ **Smoke Tests**: Confirmed technical health (build, tests, git status)
|
|
209
|
-
- ✅ **Regression Tests**: Ensured bug fixes work or features have proper test coverage
|
|
210
|
-
- ✅ **Completeness Review**: Verified all design aspects implemented
|
|
211
|
-
- ✅ **Submit PR**: Prepared work for human review
|
|
212
|
-
- ✅ **PR Review**: Successfully completed code review process`;
|
|
213
|
-
case 'spec':
|
|
214
|
-
return `- ✅ **Specification**: Created comprehensive feature specification
|
|
215
|
-
- ✅ **Validation**: Verified spec completeness and quality
|
|
216
|
-
- ✅ **Submit PR**: Prepared specification for review
|
|
217
|
-
- ✅ **PR Review**: Successfully completed specification review process`;
|
|
218
|
-
case 'design':
|
|
219
|
-
return `- ✅ **Design**: Created technical design and architecture
|
|
220
|
-
- ✅ **Validation**: Verified design completeness and feasibility
|
|
221
|
-
- ✅ **Submit PR**: Prepared design for implementation phase
|
|
222
|
-
- ✅ **PR Review**: Successfully completed design review process`;
|
|
223
|
-
case 'test':
|
|
224
|
-
return `- ✅ **Testing**: Created comprehensive test suite
|
|
225
|
-
- ✅ **Validation**: Verified test coverage and quality
|
|
226
|
-
- ✅ **Submit PR**: Prepared tests for integration
|
|
227
|
-
- ✅ **PR Review**: Successfully completed test review process`;
|
|
228
|
-
case 'user-survey':
|
|
229
|
-
return `- ✅ **Scoping**: Defined research goals and target audience
|
|
230
|
-
- ✅ **LinkedIn Build**: Generated professional LinkedIn survey content
|
|
231
|
-
- ✅ **Reddit Build**: Targeted relevant communities with specific copy
|
|
232
|
-
- ✅ **X/Twitter Build**: Created high-engagement short-form content
|
|
233
|
-
- ✅ **Facebook Build**: Formulated community-focused content
|
|
234
|
-
- ✅ **Custom Platforms**: Addressed supplementary platform needs
|
|
235
|
-
- ✅ **Dispatch**: Successfully executed survey distribution via automation`;
|
|
236
|
-
default:
|
|
237
|
-
return `- ✅ **${workflowType}**: Completed all phases successfully
|
|
238
|
-
- ✅ **Validation**: Verified work quality and completeness
|
|
239
|
-
- ✅ **Submit PR**: Prepared work for review
|
|
240
|
-
- ✅ **PR Review**: Successfully completed review process`;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Get valid phases for a specific issue type
|
|
245
|
-
*/
|
|
246
|
-
getValidPhasesForIssueType(issueType) {
|
|
247
|
-
if (issueType === 'bug') {
|
|
248
|
-
return ['implement-scoping', 'implement-repro', 'implement-code', 'implement-validate', 'implement-smoke', 'implement-regression', 'implement-completeness-review', 'submit-pr', 'wait-for-pr-review'];
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
return ['implement-scoping', 'implement-spike', 'implement-code', 'implement-validate', 'implement-smoke', 'implement-regression', 'implement-completeness-review', 'submit-pr', 'wait-for-pr-review'];
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Extract issue type from findings or evidence
|
|
256
|
-
*/
|
|
257
|
-
extractIssueType(findings, evidence) {
|
|
258
|
-
// Try to get issue type from findings first
|
|
259
|
-
if (findings?.issueType) {
|
|
260
|
-
return findings.issueType;
|
|
261
|
-
}
|
|
262
|
-
// Try to get from evidence
|
|
263
|
-
if (evidence?.issueType) {
|
|
264
|
-
return evidence.issueType;
|
|
265
|
-
}
|
|
266
|
-
// Default to feature if not specified
|
|
267
|
-
return 'feature';
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Generate failure message for failed phases
|
|
271
|
-
*/
|
|
272
|
-
async generateFailureMessage(args) {
|
|
273
|
-
// Standard failure handling for all phases
|
|
274
|
-
const issueType = this.extractIssueType(args.findings);
|
|
275
|
-
const { getPhaseOnFailure } = await Promise.resolve().then(() => __importStar(require('./phase-flow.js')));
|
|
276
|
-
const nextPhase = getPhaseOnFailure(args.currentPhase, args.workflowType, issueType);
|
|
277
|
-
const nextPhaseInstructions = await this.getPhaseInstructions(nextPhase, args.workflowType);
|
|
278
|
-
return `# ❌ Phase Failed
|
|
279
|
-
|
|
280
|
-
**Workflow:** ${args.workflowType}
|
|
281
|
-
**Failed Phase:** ${args.currentPhase}
|
|
282
|
-
**Issue:** ${args.issueNumber}
|
|
283
|
-
|
|
284
|
-
## Failure Details
|
|
285
|
-
${args.findings ? JSON.stringify(args.findings, null, 2) : 'No specific failure details provided'}
|
|
286
|
-
|
|
287
|
-
## 🚀 Next Phase: ${nextPhase}
|
|
288
|
-
|
|
289
|
-
You'll now return to the **${nextPhase}** phase to address the issues.
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
|
|
293
|
-
${nextPhaseInstructions}
|
|
294
|
-
|
|
295
|
-
---
|
|
296
|
-
|
|
297
|
-
## Action Plan
|
|
298
|
-
1. **Review the failure details above**
|
|
299
|
-
2. **Follow the ${nextPhase} phase instructions**
|
|
300
|
-
3. **Address the root cause of the failure**
|
|
301
|
-
4. **Continue through the workflow**
|
|
302
|
-
`;
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Generate help message for incomplete phases
|
|
306
|
-
*/
|
|
307
|
-
async generateHelpMessage(args) {
|
|
308
|
-
// Standard help message for all phases
|
|
309
|
-
const phaseInstructions = await this.getPhaseInstructions(args.currentPhase, args.workflowType);
|
|
310
|
-
return `# 🤝 AI Coach Assistance
|
|
311
|
-
|
|
312
|
-
**Workflow:** ${args.workflowType}
|
|
313
|
-
**Phase:** ${args.currentPhase}
|
|
314
|
-
**Status:** Incomplete - Need Help
|
|
315
|
-
|
|
316
|
-
I understand you're encountering challenges with the ${args.currentPhase} phase. Let me provide you with the complete guidance for this phase.
|
|
317
|
-
|
|
318
|
-
## Issues You Mentioned
|
|
319
|
-
${args.findings?.uncertainties && Array.isArray(args.findings.uncertainties) ?
|
|
320
|
-
args.findings.uncertainties.map((issue) => `- ${issue}`).join('\n') :
|
|
321
|
-
'No specific issues mentioned'}
|
|
322
|
-
|
|
323
|
-
## Complete Phase Guidance
|
|
324
|
-
Here are the complete instructions for the ${args.currentPhase} phase:
|
|
325
|
-
|
|
326
|
-
---
|
|
327
|
-
|
|
328
|
-
${phaseInstructions}
|
|
329
|
-
|
|
330
|
-
---
|
|
331
|
-
|
|
332
|
-
## Next Steps
|
|
333
|
-
1. Review the complete phase guidance above
|
|
334
|
-
2. Address the specific issues you mentioned
|
|
335
|
-
3. Follow the phase workflow step by step
|
|
336
|
-
4. When ready, call seekCoachingOnNextStep again with status "complete"
|
|
337
|
-
|
|
338
|
-
Remember: Take your time and follow each step carefully. The phase guidance contains everything you need to succeed.
|
|
339
|
-
`;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Get phase instructions from .md files
|
|
343
|
-
*/
|
|
344
|
-
async getPhaseInstructions(phase, workflowType) {
|
|
345
|
-
try {
|
|
346
|
-
// Special handling for shared phases
|
|
347
|
-
const sharedPhases = ['retrospective', 'submit-pr', 'wait-for-pr-review', 'address-pr-feedback'];
|
|
348
|
-
let phasePath;
|
|
349
|
-
if (sharedPhases.includes(phase)) {
|
|
350
|
-
// Check if it's in root ai-manager-rules directory (like retrospective)
|
|
351
|
-
if (phase === 'retrospective') {
|
|
352
|
-
phasePath = `ai-manager-rules/${phase}.md`;
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
// Other shared phases are in shared-phases subdirectory
|
|
356
|
-
phasePath = `ai-manager-rules/shared-phases/${phase}.md`;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
else if (workflowType === 'implement') {
|
|
360
|
-
phasePath = `ai-manager-rules/implement-phases/${phase}.md`;
|
|
361
|
-
}
|
|
362
|
-
else if (workflowType === 'customer-development') {
|
|
363
|
-
// Map phase names to file names
|
|
364
|
-
const phaseFileMap = {
|
|
365
|
-
'customer-profiling': 'phase1-customer-profiling.md',
|
|
366
|
-
'platform-discovery': 'phase2-platform-discovery.md',
|
|
367
|
-
'prospect-qualification': 'phase3-prospect-qualification.md',
|
|
368
|
-
'inventory-compilation': 'phase4-inventory-compilation.md'
|
|
369
|
-
};
|
|
370
|
-
const fileName = phaseFileMap[phase];
|
|
371
|
-
if (fileName) {
|
|
372
|
-
phasePath = `ai-manager-rules/customer-development-phases/${fileName}`;
|
|
373
|
-
}
|
|
374
|
-
else {
|
|
375
|
-
phasePath = `ai-manager-rules/customer-development-phases/${phase}.md`;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
else if (workflowType === 'user-survey') {
|
|
379
|
-
const phaseFileMap = {
|
|
380
|
-
'survey-scoping': 'phase1-survey-scoping.md',
|
|
381
|
-
'survey-build-linkedin': 'phase2-survey-build-linkedin.md',
|
|
382
|
-
'survey-build-reddit': 'phase3-survey-build-reddit.md',
|
|
383
|
-
'survey-build-x': 'phase4-survey-build-x.md',
|
|
384
|
-
'survey-build-facebook': 'phase5-survey-build-facebook.md',
|
|
385
|
-
'survey-build-custom': 'phase6-survey-build-custom.md',
|
|
386
|
-
'survey-dispatch': 'phase7-survey-dispatch.md'
|
|
387
|
-
};
|
|
388
|
-
const fileName = phaseFileMap[phase];
|
|
389
|
-
if (fileName) {
|
|
390
|
-
phasePath = `ai-manager-rules/user-survey-phases/${fileName}`;
|
|
391
|
-
}
|
|
392
|
-
else {
|
|
393
|
-
phasePath = `ai-manager-rules/user-survey-phases/${phase}.md`;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
else {
|
|
397
|
-
phasePath = `ai-manager-rules/${workflowType}-phases/${phase}.md`;
|
|
398
|
-
}
|
|
399
|
-
// Try to get from file index first
|
|
400
|
-
let phaseFile = this.fileIndex.get(phasePath);
|
|
401
|
-
if (phaseFile && (0, fs_1.existsSync)(phaseFile.fullPath)) {
|
|
402
|
-
return (0, fs_1.readFileSync)(phaseFile.fullPath, 'utf8');
|
|
403
|
-
}
|
|
404
|
-
// If not found and not a shared phase, try shared-phases directory
|
|
405
|
-
if (!sharedPhases.includes(phase)) {
|
|
406
|
-
const sharedPhasePath = `ai-manager-rules/shared-phases/${phase}.md`;
|
|
407
|
-
phaseFile = this.fileIndex.get(sharedPhasePath);
|
|
408
|
-
if (phaseFile && (0, fs_1.existsSync)(phaseFile.fullPath)) {
|
|
409
|
-
return (0, fs_1.readFileSync)(phaseFile.fullPath, 'utf8');
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
// Fallback: try to read directly from filesystem
|
|
413
|
-
const { join } = require('path');
|
|
414
|
-
const possiblePaths = [];
|
|
415
|
-
if (sharedPhases.includes(phase)) {
|
|
416
|
-
if (phase === 'retrospective') {
|
|
417
|
-
// Retrospective is in root ai-manager-rules directory
|
|
418
|
-
possiblePaths.push(join(process.cwd(), 'dist', 'registry', `ai-manager-rules/${phase}.md`), join(process.cwd(), 'registry', `ai-manager-rules/${phase}.md`), join(__dirname, '..', '..', 'registry', `ai-manager-rules/${phase}.md`), join(__dirname, '..', 'registry', `ai-manager-rules/${phase}.md`));
|
|
419
|
-
}
|
|
420
|
-
else {
|
|
421
|
-
// Other shared phases are in shared-phases subdirectory
|
|
422
|
-
const sharedPhasePath = `ai-manager-rules/shared-phases/${phase}.md`;
|
|
423
|
-
possiblePaths.push(join(process.cwd(), 'dist', 'registry', sharedPhasePath), join(process.cwd(), 'registry', sharedPhasePath), join(__dirname, '..', '..', 'registry', sharedPhasePath), join(__dirname, '..', 'registry', sharedPhasePath));
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
else {
|
|
427
|
-
// For workflow-specific phases
|
|
428
|
-
possiblePaths.push(join(process.cwd(), 'dist', 'registry', phasePath), join(process.cwd(), 'registry', phasePath), join(__dirname, '..', '..', 'registry', phasePath), join(__dirname, '..', 'registry', phasePath));
|
|
429
|
-
// Also try shared-phases directory
|
|
430
|
-
const sharedPhasePath = `ai-manager-rules/shared-phases/${phase}.md`;
|
|
431
|
-
possiblePaths.push(join(process.cwd(), 'dist', 'registry', sharedPhasePath), join(process.cwd(), 'registry', sharedPhasePath), join(__dirname, '..', '..', 'registry', sharedPhasePath), join(__dirname, '..', 'registry', sharedPhasePath));
|
|
432
|
-
}
|
|
433
|
-
for (const fullPath of possiblePaths) {
|
|
434
|
-
if ((0, fs_1.existsSync)(fullPath)) {
|
|
435
|
-
console.log(`📖 AI Coach: Reading phase file from ${fullPath}`);
|
|
436
|
-
return (0, fs_1.readFileSync)(fullPath, 'utf8');
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
return `# Phase: ${phase}
|
|
440
|
-
|
|
441
|
-
**Error**: Phase instructions not found
|
|
442
|
-
|
|
443
|
-
Tried paths:
|
|
444
|
-
${possiblePaths.map(p => `- ${p}`).join('\n')}
|
|
445
|
-
|
|
446
|
-
Please check that the phase name is correct and the phase file exists.
|
|
447
|
-
|
|
448
|
-
Available phases for ${workflowType} workflow: ${this.getAvailablePhasesForWorkflow(workflowType)}
|
|
449
|
-
`;
|
|
450
|
-
}
|
|
451
|
-
catch (error) {
|
|
452
|
-
return `# Phase: ${phase}
|
|
453
|
-
|
|
454
|
-
**Error**: Failed to load phase instructions: ${error instanceof Error ? error.message : 'Unknown error'}
|
|
455
|
-
`;
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
/**
|
|
459
|
-
* Get available phases for a workflow type
|
|
460
|
-
*/
|
|
461
|
-
getAvailablePhasesForWorkflow(workflowType) {
|
|
462
|
-
switch (workflowType) {
|
|
463
|
-
case 'implement':
|
|
464
|
-
return 'implement-scoping, implement-repro, implement-spike, implement-code, implement-validate, implement-smoke, implement-regression, implement-completeness-review, submit-pr, wait-for-pr-review';
|
|
465
|
-
case 'spec':
|
|
466
|
-
return 'spec-spec, spec-completeness-review, submit-pr, wait-for-pr-review';
|
|
467
|
-
case 'design':
|
|
468
|
-
return 'design-design, design-completeness-review, submit-pr, wait-for-pr-review';
|
|
469
|
-
case 'test':
|
|
470
|
-
return 'test-test, test-validate, submit-pr, wait-for-pr-review';
|
|
471
|
-
case 'customer-development':
|
|
472
|
-
return 'customer-profiling, platform-discovery, prospect-qualification, inventory-compilation';
|
|
473
|
-
case 'user-survey':
|
|
474
|
-
return 'survey-scoping, survey-build-linkedin, survey-build-reddit, survey-build-x, survey-build-facebook, survey-build-custom, survey-dispatch';
|
|
475
|
-
default:
|
|
476
|
-
return 'unknown';
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
exports.AICoach = AICoach;
|