Skip to content

Comments

feat: faster blueprint for minimal templates#337

Merged
karishnu merged 3 commits intonightlyfrom
feat/faster-blueprint
Feb 20, 2026
Merged

feat: faster blueprint for minimal templates#337
karishnu merged 3 commits intonightlyfrom
feat/faster-blueprint

Conversation

@karishnu
Copy link
Collaborator

@karishnu karishnu commented Feb 20, 2026

Summary

Introduces a lightweight blueprint generation mode for minimal templates to improve performance and reduce LLM inference costs.

Changes

  • Added LitePhasicBlueprintSchema with simplified fields (condensed userFlow, max 5 pitfalls, shorter descriptions)
  • Created LITE_PHASIC_SYSTEM_PROMPT optimized for rapid prototyping (~800 word limit)
  • Added liteToPhasicBlueprint() conversion function to maintain compatibility with existing code
  • Auto-detects minimal templates via name matching and routes to lite blueprint path

Motivation

Minimal templates don't require the full verbose blueprint generation. This optimization:

  • Reduces token usage and inference time for simple projects
  • Produces more focused, concise blueprints proportional to project complexity
  • Maintains full compatibility by converting lite blueprints to standard format

Testing

  • Test with a minimal template (e.g., minimal-react) and verify blueprint generation completes faster
  • Verify the generated blueprint converts correctly to PhasicBlueprint format
  • Ensure non-minimal templates still use the full PHASIC_SYSTEM_PROMPT

Breaking Changes

None - the lite blueprint is converted to full PhasicBlueprint before returning, maintaining API compatibility.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2026

Claude finished @karishnu's task in 1m 36s —— View job


Code Quality & Security Review

Recommendation: ✅ APPROVE

PR Summary

Introduces a lightweight "lite" blueprint generation mode for minimal templates, reducing token usage and inference time while maintaining full API compatibility through automatic conversion.

PR Description

  • Updated: Yes
  • Notes: Generated complete description covering summary, changes, motivation, testing, and breaking changes sections.

Addressed Issues

  • None identified in issue tracker

Code Quality

Severity Count Details
Critical 0 -
High 0 -
Medium 1 Template detection via string matching
Low 2 Redundant assignments, empty string defaults

Medium - Template Detection (blueprint.ts:368)

const isLiteTemplate = !isAgentic && templateDetails?.name?.includes('minimal');

Using includes('minimal') for template detection is somewhat fragile. Consider adding an explicit isMinimal or blueprintMode: 'lite' | 'full' property to template metadata for more robust detection. Current approach works if naming conventions are strictly followed.

Low - Redundant Assignments (blueprint.ts:287-302)
The liteToPhasicBlueprint function spreads ...lite then explicitly reassigns fields that are already included:

return {
    ...lite,
    detailedDescription: lite.detailedDescription, // redundant
    views: lite.views,                             // redundant
    pitfalls: lite.pitfalls,                       // redundant
    initialPhase: lite.initialPhase,               // redundant
    // ...
};

These can be removed since the spread already includes them. Only userFlow, architecture, and implementationRoadmap need explicit handling since they differ from the lite schema.

Low - Empty String Defaults
The conversion sets uiDesign: '' and userJourney: ''. Downstream code should gracefully handle these empty values.

Security

Severity Count Details
Critical 0 -
High 0 -
Medium 0 -
Low 0 -

No security concerns - changes are limited to schema definitions and prompt templates with no user input handling vulnerabilities.

Testing

  • Manual testing recommended: verify minimal template detection and lite blueprint conversion
  • No automated tests added for the new liteToPhasicBlueprint function (consider adding unit tests)

Final Recommendation

Approve - The implementation is sound and achieves the goal of faster blueprint generation for minimal templates. The code quality issues noted are minor and don't block merging. The conversion function ensures backward compatibility. Consider the suggestions above as improvements for a follow-up.


Review checklist
  • Gather context (PR diff, CLAUDE.md)
  • Check and update PR description
  • Review code quality and security
  • Post final review summary

@karishnu karishnu merged commit 1321e43 into nightly Feb 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant