Skip to content

refactor(examples): flatten single-agent layout (dir:".", prompts at root)#1045

Merged
buremba merged 3 commits into
mainfrom
feat/flatten-agent-dir
May 25, 2026
Merged

refactor(examples): flatten single-agent layout (dir:".", prompts at root)#1045
buremba merged 3 commits into
mainfrom
feat/flatten-agent-dir

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented May 25, 2026

What

All 12 examples are single-agent, so the agents/<id>/ wrapper was redundant nesting (agent-community/agents/agent-community/SOUL.md). Each example now sets dir: "." and keeps everything in one folder:

lobu-crm/
  lobu.config.ts
  SOUL.md  IDENTITY.md  USER.md
  funnel-form.connector.ts
  inbound-triage.reaction.ts  funnel-digest.reaction.ts
  skills/crm-ops/SKILL.md

Why it's safe

agent.dir is consumed only by readMarkdown (SOUL/IDENTITY/USER) in the apply path — verified there's no wholesale agent-dir sync to the worker (prompts reach workers via DB settings, skills via .skills/). So dir: "." just changes where those three files are read from; no runtime/worker behavior changes.

Scaffolder stays nested (deliberate)

lobu init keeps generating agents/<id>/, because lobu agent add places additional agents under agents/<id>/ — so the recommended/grows-to-multi-agent structure stays uniform. Single-agent projects (the examples) opt into the flat layout with dir: ".". Documented in the agent-prompts guide.

Scope

44 renames (prompts/evals/skills → root across all 12) + config edits (dir: ".", skill paths ./skills/...), example tsconfig includes (**/*.ts), lobu-crm README tree, agent-prompts doc note, and the landing snippet generator + regenerated JSON (office-bot skill path).

Verification

  • bun run typecheck clean; biome check clean; cd packages/landing && bun run build clean (regenerates snippets from new paths).
  • All 12 examples load end-to-end via loadDesiredStateFromConfig — prompts (soulMd) from root, skills from root, connectors resolved.

Summary by CodeRabbit

  • Refactor

    • Flattened example project structures so agent files can live at the project root and simplified TypeScript include patterns to cover all TS files.
  • Documentation

    • Updated guides, READMEs, and example evals to clarify dir behavior for single vs multi-agent projects and point eval instructions to the new promptfoo config location.

Review Change Stack

…root)

All 12 examples are single-agent, so the agents/<id>/ wrapper was redundant
nesting (e.g. agent-community/agents/agent-community/SOUL.md). Set dir:"." and
move SOUL/IDENTITY/USER + evals + skills to each project root, so an example is
one readable folder: config + prompts + connector + reaction + skill side by
side. `dir` is consumed only by readMarkdown when reading the prompt files (no
worker/runtime implications), so this is purely a layout change.

The scaffolder (lobu init) keeps agents/<id>/ — `lobu agent add` grows a project
to multi-agent uniformly, so the recommended structure stays nested; single-agent
projects opt into the flat layout via dir:".". Docs, the landing snippet
generator, example tsconfig globs, and the lobu-crm README updated to match.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 47a2c09a-ef8c-4a99-971e-24a0d8dfadd0

📥 Commits

Reviewing files that changed from the base of the PR and between 8fc7793 and 570eda0.

📒 Files selected for processing (3)
  • examples/personal-finance/evals/promptfooconfig.yaml
  • examples/personal-finance/package.json
  • packages/landing/src/content/docs/guides/evals.md

📝 Walkthrough

Walkthrough

Flatten example project layouts by setting agent dir to ., moving skills to top-level ./skills where applicable, standardizing example tsconfig.json includes to **/*.ts, and updating docs/scripts/README references (notably the personal-finance Promptfoo config path).

Changes

Example Project Directory Restructuring

Layer / File(s) Summary
Agent directory configuration updates
examples/agent-community/lobu.config.ts, examples/atlas/lobu.config.ts, examples/delivery/lobu.config.ts, examples/ecommerce/lobu.config.ts, examples/finance/lobu.config.ts, examples/leadership/lobu.config.ts, examples/legal/lobu.config.ts, examples/market/lobu.config.ts, examples/sales/lobu.config.ts, examples/personal-finance/lobu.config.ts
Agent dir settings changed from ./agents/<name> to . across single-agent examples.
Multi-agent skill path restructuring
examples/lobu-crm/lobu.config.ts, examples/office-bot/lobu.config.ts
Skills moved from ./agents/.../skills/... to ./skills/... and agent dir set to . where applicable.
TypeScript compilation include pattern standardization
examples/agent-community/tsconfig.json, examples/atlas/tsconfig.json, examples/delivery/tsconfig.json, examples/ecommerce/tsconfig.json, examples/finance/tsconfig.json, examples/leadership/tsconfig.json, examples/legal/tsconfig.json, examples/lobu-crm/tsconfig.json, examples/market/tsconfig.json, examples/office-bot/tsconfig.json, examples/personal-finance/tsconfig.json, examples/sales/tsconfig.json
tsconfig.json include entries simplified to ["**/*.ts"] across example projects.
Documentation and reference path updates
CHANGELOG.md, examples/lobu-crm/README.md, packages/cli/README.md, packages/landing/scripts/gen-landing-snippets.ts, packages/landing/src/content/docs/guides/agent-prompts.md, packages/landing/src/content/docs/guides/evals.md, skills/lobu/SKILL.md, examples/personal-finance/evals/promptfooconfig.yaml, examples/personal-finance/package.json
CHANGELOG, guides, READMEs, landing snippet generator, SKILL checklist, and example eval config/scripts updated to reference the new flattened paths and the examples/personal-finance/evals/promptfooconfig.yaml location.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • lobu-ai/lobu#988: Updates landing snippet generation paths (PINNED.skill.path) similar to this PR.
  • lobu-ai/lobu#911: Introduced the Promptfoo provider and removed the lobu eval runner; related migration context for eval config paths.
  • lobu-ai/lobu#1034: Changes to example tsconfig.json files; overlaps with include pattern standardization.

Suggested labels

skip-size-check

Poem

🐰 Directories flattened neat and spry,
Skills hopped up where roots touch sky,
TypeScript globs now catch each file,
Docs point to prompts in a simpler style,
A little hop — the repo’s tidy!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: converting 12 single-agent examples to a flat layout by setting dir:".", which is the primary refactoring objective.
Description check ✅ Passed The description is comprehensive and well-structured, covering what was changed, why it's safe, and how it was verified, though it does not follow the template's section headings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/flatten-agent-dir

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@buremba
Copy link
Copy Markdown
Member Author

buremba commented May 25, 2026

bug_free 88, simplicity 96, slop 0, bugs 0, 0 blockers

Read diff/logs. Typecheck/unit passed. [env] integration failed because DATABASE_URL pointed at database "postgres" and the harness refused destructive setup; failing files are untouched. Explored by running lobu validate in all 12 changed example projects; all valid.

Suggested fixes

File Line Change
packages/landing/src/content/docs/guides/evals.md 100 Remove em dashes from this landing-copy line, e.g. use evals: ... and boundary, two independent cases.
Full verdict JSON
{
  "bug_free_confidence": 88,
  "bugs": 0,
  "slop": 0,
  "simplicity": 96,
  "blockers": [],
  "change_type": "refactor",
  "behavior_change_risk": "low",
  "tests_adequate": true,
  "suggested_fixes": [
    {
      "file": "packages/landing/src/content/docs/guides/evals.md",
      "line": 100,
      "change": "Remove em dashes from this landing-copy line, e.g. use `evals: ...` and `boundary, two independent cases`."
    }
  ],
  "notes": "Read diff/logs. Typecheck/unit passed. [env] integration failed because DATABASE_URL pointed at database \"postgres\" and the harness refused destructive setup; failing files are untouched. Explored by running `lobu validate` in all 12 changed example projects; all valid.",
  "categories": {
    "src": 2,
    "tests": 0,
    "docs": 21,
    "config": 112,
    "deps": 2,
    "migrations": 0,
    "ci": 0,
    "generated": 6
  }
}

Local review gate — branch protection can require the pi-review commit status. See docs/REVIEW_SCHEMA.md.

buremba added 2 commits May 25, 2026 16:44
…vals/ path

The promptfoo evals script + quick-start comment still referenced
agents/personal-finance/evals/promptfooconfig.yaml, which moved to evals/ in the
flatten. (Only personal-finance has a real evals script.)
@buremba buremba merged commit f7d417e into main May 25, 2026
16 of 17 checks passed
@buremba buremba deleted the feat/flatten-agent-dir branch May 25, 2026 15:48
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.

2 participants