chore(docs): document new frontend patterns in AGENTS.md#4466
chore(docs): document new frontend patterns in AGENTS.md#4466ardaerzin wants to merge 2 commits into
Conversation
Adds three sections capturing patterns from recent FE work, primarily PR #4425 (workflow Fern migration + playground vitest setup): - "Frontend API: Use the Fern Client" — all new FE API code goes through @agenta/sdk's getAgentaSdkClient, not raw axios. Pattern, anti-patterns, migration policy, references to existing Fern-using domains. - "Code Placement: Packages vs. Application Code" — quick heuristic + hard rules, with a forward pointer to the existing agenta-package-practices skill for the full ruleset. - "Package Unit Tests" — layout (tests/unit/, not src/), minimal vitest config, scripts, Fern-client mocking pattern, what to test / skip. References commit 1c0a900 (exclude in-src tests from package build). Dev Environment Tips section now points to the three new sections so they're discoverable from the top of the file. Source: Slack thread between Mahmoud and Arda, 2026-05-27.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesFrontend Contributor Guidance
🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
AGENTS.md (2)
1554-1565: 💤 Low valueSpecify language for fenced code block.
The fenced code block should specify a language identifier for proper rendering. Use
textfor plain-text diagrams.📝 Proposed fix
-``` +```text Is the code used by 2+ features, or could be?
1584-1593: 💤 Low valueSpecify language for fenced code block.
The directory tree structure should specify a language identifier for proper rendering. Use
textfor plain-text diagrams.📝 Proposed fix
-``` +```text web/packages/<pkg>/
Four refinements to the new sections, all surfaced by /plan-eng-review:
1. Frontend API: Use the Fern Client
- Add a Prerequisite subsection: new packages adopting Fern must
declare @agenta/sdk in package.json dependencies. Without it,
tsc --noEmit fails on the import before runtime.
- Migration policy: replace the single paragraph with three explicit
bullets so the edge case "new function in existing axios-using
file" is covered (use Fern; don't migrate sibling functions).
2. Package Unit Tests
- Mocking the Fern client: add a one-paragraph note about singleton
behaviour. The mock returns a fresh object per call; tests that
depend on the production singleton need a stricter mock.
- New "Integration tests" subsection covering vitest.integration
.config.ts: separate config, raised timeouts, sequential
execution, when to choose integration over unit. References
@agenta/entities's existing integration test infra (4 files,
setup/global.ts + setup/worker.ts).
No structural changes, no anchor changes, no removed content.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
AGENTS.md (1)
486-489: 💤 Low valueMinor wording clarification: "before the code runs" → "at type-check time".
The phrase "before the code runs" is slightly ambiguous. Consider "at type-check time" since
tsc --noEmitis a compile-time check, not a runtime check.📝 Suggested clarification
-The consuming package must declare `"`@agenta/sdk`": "workspace:../agenta-sdk"` in its `package.json` `dependencies`. Today `@agenta/entities` is the main consumer; any new package adopting Fern must add this dep first, otherwise `tsc --noEmit` fails on the `@agenta/sdk` import before the code runs. +The consuming package must declare `"`@agenta/sdk`": "workspace:../agenta-sdk"` in its `package.json` `dependencies`. Today `@agenta/entities` is the main consumer; any new package adopting Fern must add this dep first, otherwise `tsc --noEmit` fails on the `@agenta/sdk` import at type-check time.
|
|
||
| Layout: | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Add language marker to fenced code block.
The directory tree structure should specify a language for the fenced code block to satisfy markdownlint.
📝 Proposed fix
-```
+```text
web/packages/<pkg>/
├── vitest.integration.config.ts # separate from vitest.config.ts
└── tests/📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 1715-1715: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
Summary
Follow-up to a Slack thread with @mmabrouk: adds three sections to
AGENTS.mdcapturing patterns from recent frontend work — primarily #4425 (workflow Fern migration + playground vitest setup).New sections in
AGENTS.md@agenta/sdk'sgetAgentaSdkClient, not raw axios. Pattern, anti-patterns, migration policy, and a list of existing Fern-using domains (@agenta/entities/{gatewayTool,secret,event,testset,workflow}).agenta-package-practicesskill for the full ruleset.tests/unit/layout (notsrc/), minimalvitest.config.ts, required scripts, Fern-client mocking pattern, what to test / skip. References commit1c0a900(exclude in-src tests from package build).The "Dev Environment Tips" section at the top now points at the three new sections so they're discoverable on first read.
Patterns sourced from PR #4425
c3572fdagenta-package-practicesskill, summarized + linkedb59eddbtests/unit/retrieveWorkflowRevision.test.tsTest plan
Documentation only — no functional changes.
Checklist
Contributor Resources