Skip to content

Add an adaptive prompt section describing the available context and what each template contains - #1417

Open
ad4mou wants to merge 3 commits into
mainfrom
feat/improve-context-by-explaining-templates-980
Open

Add an adaptive prompt section describing the available context and what each template contains#1417
ad4mou wants to merge 3 commits into
mainfrom
feat/improve-context-by-explaining-templates-980

Conversation

@ad4mou

@ad4mou ad4mou commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The agent now gets a short guide to the project context in its system prompt: what each folder is for, and what each per-table file contains and when to read it. Before, it was only told the files existed, so it often read the wrong one or none.
  • The guide only mentions what the project actually has. The per-table file list comes from nao_config.yaml, and folders like semantics/ or docs/ appear only when they exist and have something in them so the agent never goes looking for something that isn't there.
  • annotations.md is now called out as the place for human notes, and the agent is told to trust it over the generated files when they disagree.
  • Removed leftover mentions of description.md and how_to_use.md in the recommendations prompt and the two context skills. Those files were deleted a while back and no longer exist.
  • The checks run once per user message.

Closes #980

Two decisions regarding the issue

  • Per project, not per table. The issue asked for the file list to adapt to each table. The config already decides which files sync writes, and checking every table folder would mean scanning thousands of directories for the same answer. So the list adapts per project instead.
  • No regeneration on context push. : The genuinely useful version where the prompt adapts to the user's DB ("read annotations.md first for what a column means", "check crm.md before sales questions") needs a model to read the files and understand them which is already what the write-context-rules skill already does, with a human reviewing the result. Doing it automatically on every sync would pay for that pass every time and ship it unreviewed.

Review in cubic

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

URL https://pr-1417-74129c5.preview.getnao.io
Commit 74129c5

⚠️ No LLM API keys configured - you'll see the API key setup flow when trying to chat.


Preview will be automatically removed when this PR is closed.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 10 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread skills/setup-context/SKILL.md Outdated
Comment thread apps/backend/src/utils/nao-config.ts Outdated
Comment thread apps/backend/src/utils/nao-config.ts Outdated
Comment thread apps/backend/src/components/ai/nao-context-structure.tsx Outdated
Comment thread apps/backend/src/services/agent.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/backend/src/utils/nao-config.ts Outdated
Comment thread apps/backend/src/components/ai/context-recommendations-prompt.tsx Outdated
const migratedTemplates = [
...new Set(
templates
.filter((template) => template !== 'description')

@ad4mou ad4mou Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels stale but it's actually because we still accept desription in nao_config without labelling it a bad config so that users upgrading from older versions don't get their sync refused. So we need to filter it out here since our new prompt doesn't support description

@ad4mou

ad4mou commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

LGTM

@ad4mou
ad4mou requested review from Bl3f and ClaireGz August 19, 2026 10:11
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.

[feature] Improve agent system prompt to navigate file system

1 participant