Skip to content

docs(skill): add explicit HTTP verb guidance for server actions in agent skill - #1369

Merged
vivek7405 merged 1 commit into
mainfrom
docs/http-verb-action-guidance
Aug 9, 2026
Merged

vivek7405 merged 1 commit into
mainfrom
docs/http-verb-action-guidance

Conversation

@vivek7405

Copy link
Copy Markdown
Collaborator

Closes #1367

Add a comprehensive HTTP Verbs Decision Guide for server actions to .agents/skills/webjs/ (SKILL.md, references/data-and-actions.md, references/muscle-memory-gotchas.md) and the website documentation (website/app/docs/server-actions/page.ts).

Summary of Changes

  1. Form-Bound Actions: Clarified that form-bound actions (<form action=${fn}>) strictly require POST (default). Binding a GET action to a form produces a 405 runtime error and webjs check violation (form-action-not-a-get-action). Manually setting method="get" on a bound form emits a WEBJS_FORM_SUBMITTED_AS_GET diagnostic warning.
  2. RPC Read Actions (Queries): Instructed AI agents to export export const method = 'GET' for read-only RPC queries (await getTodos()) to enable URL search param passing, ETags, 304 revalidation, and export const cache = ... HTTP headers.
  3. RPC Mutation Actions: Details usage of POST, PUT, PATCH, DELETE verbs with tag eviction (export const invalidates = (args...) => ['tag']).

Definition of Done Verification Checklist

  • Unit tests: node --test packages/cli/test/**/*.js packages/cli/test/**/*.mjs test/scaffolds/scaffold-integration.test.js (84/84 pass)
  • Convention check: ( cd examples/blog && npx webjs check ) && ( cd website && npx webjs check )
  • Docs parity: website/app/docs/server-actions/page.ts updated

Add a comprehensive HTTP Verbs Decision Guide for server actions to .agents/skills/webjs/ (SKILL.md, references/data-and-actions.md, references/muscle-memory-gotchas.md) and website docs (website/app/docs/server-actions/page.ts). Explicitly guides AI agents to use export const method = 'GET' for RPC data queries while keeping form-bound actions strictly on POST.
@vivek7405 vivek7405 self-assigned this Aug 9, 2026

@vivek7405 vivek7405 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review: HTTP verb guidance addition verified

Reviewed the updated skill reference documentation and website docs. The decision table and explicit rules clearly delineate form-bound POST actions vs RPC GET read queries and mutating verbs. All 84 unit and scaffold integration tests pass and webjs check is green.

@vivek7405
vivek7405 marked this pull request as ready for review August 9, 2026 18:44

@vivek7405 vivek7405 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review: HTTP verb decision guide additions verified

The documentation updates clearly delineate form-bound POST actions vs RPC GET read queries and mutating verbs across .agents/skills/webjs/ and the website docs site. All 84 unit and scaffold integration tests pass and webjs check is green.

@vivek7405
vivek7405 merged commit 00af256 into main Aug 9, 2026
10 checks passed
@vivek7405
vivek7405 deleted the docs/http-verb-action-guidance branch August 9, 2026 19:07
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.

docs(skill): add explicit HTTP verb guidance for server actions in agent skill

1 participant