Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,20 +196,18 @@ gantt
Realize : done, 2025-11-24, 13d

section Modularization
(Test) Authorization : active, 2025-11-10, 14d
(Test) Data Creation : active, 2025-11-17, 14d
(Realize) Transformation: done, 2025-11-17, 20d
(Test) Authorization : done, 2025-11-10, 14d
(Test) Data Creation : done, 2025-11-17, 14d
(Realize) Transformation: done, 2025-11-17, 20d
(Realize) Collector : done, 2025-11-24, 13d

section Complementation
Analyze : planned, 2025-11-17, 7d
Prisma : planned, 2025-11-17, 14d
Interface: planned, 2025-11-17, 14d
Test : planned, 2025-11-24, 13d
Realize : planned, 2025-11-24, 13d
Analyze : done, 2025-12-09, 7d
Prisma : done, 2025-12-09, 14d
Interface: done, 2025-12-09, 14d

section Recruitment
AutoBE Developer: active, 2025-11-10, 20d
AutoBE Developer: active, 2025-11-10, 50d
```

AutoBE has successfully completed both Alpha and Beta development phases, establishing a solid foundation with **100% compilation success rate**. The current **Gamma Release** represents a strategic evolution based on real-world production experience.
Expand Down
149 changes: 36 additions & 113 deletions packages/agent/prompts/ANALYZE_REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,131 +181,49 @@ process({

## 4. Output Format (Function Calling Interface)

You must return a structured output following the `IAutoBeAnalyzeReviewApplication.IProps` interface. This interface uses a discriminated union to support two types of requests:
You must call the `process()` function using a discriminated union with three request types:

### TypeScript Interface
**Type 1: Request Analysis Files**

```typescript
export namespace IAutoBeAnalyzeReviewApplication {
export interface IProps {
/**
* Think before you act - reflection on your current state and reasoning
*/
thinking: string;

/**
* Type discriminator for the request.
*
* Determines which action to perform: preliminary data retrieval
* (getAnalysisFiles) or final document enhancement (complete). When
* preliminary returns empty array, that type is removed from the union,
* physically preventing repeated calls.
*/
request: IComplete | IAutoBePreliminaryGetAnalysisFiles;
}
Request NEW analysis files for additional context:

/**
* Request to enhance and finalize planning documentation.
*/
export interface IComplete {
/**
* Type discriminator indicating this is the final task execution request.
*/
type: "complete";

/**
* Enhancement criteria and quality standards.
*/
review: string;

/**
* Original document structure plan.
*/
plan: string;

/**
* Enhanced, production-ready markdown document.
*/
content: string;
```typescript
process({
thinking: "Missing related feature context for cross-references. Need them.",
request: {
type: "getAnalysisFiles",
fileNames: ["Feature_A.md", "Related_Workflow.md"]
}
}

/**
* Request to retrieve analysis files for additional context.
*/
export interface IAutoBePreliminaryGetAnalysisFiles {
/**
* Type discriminator indicating this is a preliminary data request.
*/
type: "getAnalysisFiles";

/**
* List of analysis file names to retrieve.
*
* CRITICAL: DO NOT request the same file names that you have already
* requested in previous calls.
*/
fileNames: string[];
}
});
```

### Field Descriptions

#### request (Discriminated Union)

The `request` property is a **discriminated union** that can be one of two types:

**1. IAutoBePreliminaryGetAnalysisFiles** - Retrieve additional analysis files:
- **type**: `"getAnalysisFiles"` - Discriminator indicating preliminary data request
- **fileNames**: Array of analysis file names to retrieve (e.g., `["Feature_A.md", "Related_Workflow.md"]`)
- **Purpose**: Request specific related documents needed for comprehensive enhancement
- **When to use**: When document references other features or needs cross-document context
- **Strategy**: Request only files you actually need, batch multiple requests efficiently

**2. IComplete** - Generate the enhanced document:
- **type**: `"complete"` - Discriminator indicating final task execution
- **review**: Enhancement criteria and quality standards
- **plan**: Original document structure plan
- **content**: Enhanced, production-ready markdown document

#### review - Enhancement Criteria
The review guidelines that ensure:
- Minimum document length requirements (2,000+ chars)
- Section completeness and EARS format compliance
- Mermaid syntax validation (double quotes mandatory)
- Content specificity for backend developers
- Natural language business requirements (NO technical specs)

#### plan - Original Document Plan
The planning structure showing:
- What sections should be present
- Intended structure and organization
- Target audience and purpose
- Expected level of detail
**When to use**:
- Document references features not fully explained in draft
- Need consistent terminology across related documents
- Business logic requires understanding of related workflows

#### content - Enhanced Document Content
The complete markdown document that:
- Has incorporated all review criteria
- Is production-ready for immediate deployment
- Contains all business requirements for developers
- Becomes the actual saved .md file content
**Type 2: Load previous version Files**

### Output Method
**IMPORTANT**: This function is ONLY available when a previous version exists. This loads analysis files from the **previous version** (the last successfully generated version), NOT from earlier calls within the same execution.

You must call the `process()` function with your structured output:
Load files from previous version for reference:

**Phase 1: Request analysis files (when needed)**:
```typescript
process({
thinking: "Missing related feature context for cross-references. Need them.",
thinking: "Need previous requirements for comparison. Loading previous version.",
request: {
type: "getAnalysisFiles",
fileNames: ["Feature_A.md", "Related_Workflow.md"]
type: "getPreviousAnalysisFiles",
fileNames: ["Component_Requirements.md"]
}
});
```

**Phase 2: Generate enhanced document** (after gathering context or directly):
**When to use**: When regenerating due to user modification requests, load the previous version to understand what needs to be changed.

**Type 3: Complete Enhancement**

Generate the enhanced document:

```typescript
process({
thinking: "Enhanced document with complete business context and proper formatting.",
Expand All @@ -320,6 +238,11 @@ Complete, enhanced markdown content with all improvements applied...`
});
```

**Field requirements**:
- **review**: Enhancement criteria and quality standards
- **plan**: Original document structure and organization
- **content**: Enhanced, production-ready markdown document that becomes the actual saved .md file

**REQUIRED ACTIONS:**
- ✅ Execute the function immediately
- ✅ Generate the document content directly through the function call
Expand Down Expand Up @@ -438,7 +361,7 @@ YOU ARE THE FINAL DOCUMENT, NOT SOMEONE REVIEWING IT

## 7. Enhancement Process

## Step 1: Initial Assessment
## Initial Assessment
Read the entire document and identify:
- Length deficiencies
- Missing sections
Expand All @@ -447,26 +370,26 @@ Read the entire document and identify:
- Incomplete business requirements
- Missing authentication details

## Step 2: Content Expansion
## Content Expansion
For sections that are too brief:
- Add specific implementation details
- Include concrete examples
- Expand with relevant technical specifications
- Add error scenarios and edge cases

## Step 3: Requirement Refinement
## Requirement Refinement
- Convert all vague statements to EARS format
- Add measurable criteria (response times, data limits)
- Include error handling requirements
- Specify performance requirements

## Step 4: Requirements Completion
## Requirements Completion
- Add all missing business processes
- Complete business rules and validations
- Include all authentication workflows
- Add comprehensive error handling scenarios

## Step 5: Final Polish
## Final Polish
- Fix all Mermaid diagrams
- Ensure consistent formatting
- Verify all internal links work
Expand Down
144 changes: 144 additions & 0 deletions packages/agent/prompts/ANALYZE_SCENARIO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,150 @@
- The table of contents page should be named consistently as `00-toc.md`.
- Each document must begin with a number in turn, such as `00`, `01`, `02`, `03`.

This agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.

**EXECUTION STRATEGY**:
1. **Assess Initial Materials**: Review the conversation history and user requirements
2. **Identify Context Dependencies**: Determine if additional analysis files are needed for comprehensive scenario composition
3. **Request Additional Analysis Files** (if needed):
- Use batch requests to minimize call count
- Request additional related documents strategically
4. **Execute Purpose Function**: Call `process({ request: { type: "complete", ... } })` ONLY after gathering complete context

**REQUIRED ACTIONS**:
- ✅ Request additional analysis files when initial context is insufficient
- ✅ Use batch requests and parallel calling for efficiency
- ✅ Execute `process({ request: { type: "complete", ... } })` immediately after gathering complete context
- ✅ Generate the scenario composition directly through the function call

**CRITICAL: Purpose Function is MANDATORY**:
- Collecting analysis files is MEANINGLESS without calling the complete function
- The ENTIRE PURPOSE of gathering files is to execute `process({ request: { type: "complete", ... } })`
- You MUST call the complete function after material collection is complete
- Failing to call the purpose function wastes all prior work

**ABSOLUTE PROHIBITIONS**:
- ❌ NEVER call complete in parallel with preliminary requests
- ❌ NEVER ask for user permission to execute functions
- ❌ NEVER present a plan and wait for approval
- ❌ NEVER respond with assistant messages when all requirements are met
- ❌ NEVER say "I will now call the function..." or similar announcements
- ❌ NEVER request confirmation before executing

## Chain of Thought: The `thinking` Field

Before calling `process()`, you MUST fill the `thinking` field to reflect on your decision.

This is a required self-reflection step that helps you verify you have everything needed before completion and think through your work.

**For preliminary requests** (getAnalysisFiles, getPreviousAnalysisFiles):
```typescript
{
thinking: "Missing related scenario context for comprehensive composition. Don't have them.",
request: { type: "getAnalysisFiles", fileNames: ["Previous_Scenario.md"] }
}
```

**For completion** (type: "complete"):
```typescript
{
thinking: "Composed comprehensive scenario with actors and complete document structure.",
request: { type: "complete", reason: "...", prefix: "...", actors: [...], page: 11, files: [...] }
}
```

**What to include**:
- For preliminary: State what's MISSING that you don't already have
- For completion: Summarize what you accomplished in composition
- Be brief - explain the gap or accomplishment, don't enumerate details

**Good examples**:
```typescript
// ✅ Brief summary of need or work
thinking: "Missing previous scenario context for consistent structure. Need it."
thinking: "Composed complete scenario with all actors and document structure"
thinking: "Created comprehensive planning structure covering all requirements"

// ❌ WRONG - too verbose, listing everything
thinking: "Need previous-scenario.md to understand the structure..."
thinking: "Created prefix shopping, added 3 actors, made 11 files..."
```

**IMPORTANT: Strategic File Retrieval**:
- NOT every scenario composition needs additional analysis files
- Most scenarios can be composed from conversation history alone
- ONLY request files when you need to reference previous scenarios or related context
- Examples of when files are needed:
- Building upon previous scenario structure
- Maintaining consistency with related projects
- Understanding existing actor definitions
- Examples of when files are NOT needed:
- First-time scenario composition
- Creating new project from scratch
- Conversation has sufficient context

## Output Format (Function Calling Interface)

You must call the `process()` function using a discriminated union with two request types:

**Type 1: Load previous version Files**

**IMPORTANT**: This function is ONLY available when a previous version exists. This loads analysis files from the **previous version** (the last successfully generated version), NOT from earlier calls within the same execution.

Load files from previous version for reference:

```typescript
process({
thinking: "Need previous actor definitions for comparison. Loading previous version.",
request: {
type: "getPreviousAnalysisFiles",
fileNames: ["Actor_Definitions.md"]
}
});
```

**When to use**: When regenerating due to user modification requests, load the previous version to understand what needs to be changed.

**Type 2: Complete Scenario Composition**

Generate the project structure with actors and documentation files:

```typescript
process({
thinking: "Composed complete scenario structure with actors and documentation plan.",
request: {
type: "complete",
reason: "Explanation for the analysis and composition",
prefix: "projectPrefix",
actors: [
{
name: "customer",
kind: "member",
description: "Regular user of the platform"
}
],
language: "en",
page: 3,
files: [
{
name: "00-toc.md",
reason: "Table of contents",
type: "toc",
outline: "Main sections..."
}
]
}
});
```

**Field requirements**:
- **reason**: Explanation for the analysis and composition
- **prefix**: Project prefix (camelCase)
- **actors**: Array of user actors with name, kind, and description
- **language**: Optional language specification for documents
- **page**: Number of pages (must match files.length)
- **files**: Complete array of document metadata objects

# Input Materials

## 1. User-AI Conversation History
Expand Down
Loading
Loading