Skip to content

feat: restructure main.md generation for reliable single-agent AI consumption#2

Merged
trmquang93 merged 1 commit intomainfrom
feat/improve-main-md-for-ai-consumption
Mar 15, 2026
Merged

feat: restructure main.md generation for reliable single-agent AI consumption#2
trmquang93 merged 1 commit intomainfrom
feat/improve-main-md-for-ai-consumption

Conversation

@trmquang93
Copy link
Copy Markdown
Collaborator

Summary

  • Rewrites generateMainMd() so an AI given only main.md still reads the full spec files (screens.md, navigation.md, build-guide.md, images/) instead of implementing from the summary alone
  • Adds a prominent Instruction Files table before the Screen Roster with a "same directory" callout
  • Adds Planning Requirements section that requires AI plans to embed spec file references per screen, so those references survive the context shift from planning to implementation
  • Replaces the "Your Role as Orchestrator" section (which explicitly told the AI to skip detail files) with dual-mode How to Use These Instructions that works for both single-agent and multi-agent workflows
  • Converts the Sub-Agent Contract fenced code block into a proper H3-headed Implementation Workflow (so AI treats it as instructions to follow, not a template to emit)
  • Adds Spec column to the Screen Roster table pointing each row to its section in screens.md
  • Renames "Orchestrator Responsibilities" → Final Integration
  • Removes the redundant bottom "File Reference" section (absorbed into Instruction Files table)

Test plan

  • Run the app, create a flow with 3+ screens with hotspots and connections
  • Click Generate and open the Instructions panel
  • Verify main.md tab shows "Instruction Files" table before the Screen Roster
  • Verify "How to Use These Instructions" section has dual-mode language with no "you do NOT need to read" instruction
  • Verify Screen Roster has a Spec column with screens.md > SCR-XXXXXXXX references
  • Verify "Implementation Workflow" section uses H3 headings (not a fenced code block)
  • Verify no "File Reference" section at the bottom
  • Feed the generated main.md to an AI and confirm it creates plans that include spec file references per screen

…sumption

Rewrites generateMainMd() so AIs reading only main.md still consult the
full spec files instead of implementing from the summary alone.

Key changes:
- Add "Instruction Files" table prominently before the roster with a
  "same directory" callout so the AI knows where to find sibling files
- Replace "Your Role as Orchestrator" (which told the AI to skip detail
  files) with dual-mode "How to Use These Instructions" section that
  works for both single-agent and multi-agent workflows
- Add "Planning Requirements" section requiring AI plans to include
  screen ID, image path, spec reference, and connection list per screen,
  so file references survive the context shift from planning to coding
- Add "Spec" column to Screen Roster table pointing to each screen's
  section in screens.md
- Replace Sub-Agent Contract fenced code block with proper H3-headed
  "Implementation Workflow" markdown (6 named steps) so AI treats it
  as instructions to follow, not a template to emit
- Add explicit failure mode warning to Delegation section
- Rename "Orchestrator Responsibilities" to "Final Integration"
- Remove bottom "File Reference" section (absorbed into Instruction Files table)
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flow-forge Ready Ready Preview, Comment Mar 15, 2026 7:02am

@trmquang93 trmquang93 merged commit 5682812 into main Mar 15, 2026
2 checks passed
@trmquang93 trmquang93 deleted the feat/improve-main-md-for-ai-consumption branch March 15, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant