agentleFS
MicrosoftKnown publishermicrosoft/BotFramework-WebChat/AGENTS.md

BotFramework-WebChat

AGENTS.md1.8k starsChanged 6 months agoMITView on GitHub

Trending

Quiet this year.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/BotFramework-WebChat repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/BotFramework-WebChat

The biggest 5 of 34 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 34

Talked about on GitHub (34 times).

On GitHub · 34

29 more on GitHub

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

35 rules. About 0 are common, 7 are distinctive, and 28 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 28

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Avoid spaghetti code: on new feature with a similar existing feature, refactor existing one before writing new feature

    line 9
  2. Very specific:

    Avoid global pollution, do not modify window object

    line 11
  3. Very specific:

    Use /prettierrc.yml to format

    line 13
  4. Distinctive:

    Avoid one-use variable, inline them instead

    line 15
  5. Very specific:

    Prefer && over if-statement if it is a oneliner

    line 19
  6. Very specific:

    Prefer truthy/false check like !array.length over array.length === 0

    line 21
  7. Very specific:

    Prefer numValue over valueCount for "how many values are there"

    line 22
  8. Very specific:

    Prefer uppercase for acronyms instead of Pascal case, e.g.

    line 23
  9. Very specific:

    Use fewer shorthands, only allow min, max, num

    line 25
  10. Very specific:

    Prefer ternary operator over one-liner if statement

    line 26
  11. Very specific:

    Use immutability as much as possible, add object.freeze()

    line 30
  12. Distinctive:

    Follow W3C convention for API design

    line 31
  13. Very specific:

    Consider IntersectionObserver-like pattern for allow userland to subscribe to live changes

    line 33
  14. Very specific:

    Use TypeScript CLI instead of tsc

    line 39
  15. Very specific:

    Use valibot for runtime type checker, never use zod

    line 40
  16. Very specific:

    Avoid as, use valibot instead

    line 43
  17. Very specific:

    If absolutely needed, use satisifes X as Y to make sure it is X before force casting to Y

    line 44
  18. Very specific:

    Use as few unknown as possible

    line 45
  19. Very specific:

    All optional properties must be undefined-able, i.e.

    line 46
  20. Very specific:

    If need to look inside the object to check for types, use valibot

    line 48
  21. Very specific:

    Use { readonly value: string } instead of Readonly<{ value: string }>

    line 50
  22. Very specific:

    Use as much readonly as possible

    line 51
  23. Very specific:

    Start container by docker compose -f docker-compose-wsl2.yml up --detach --scale chrome=2

    line 95
  24. Very specific:

    Run curl http://localhost:4444/wd/hub/status and wait until .value.ready become true

    line 96
  25. Very specific:

    Run npm test, or npm test -- --testPathPattern test-html-file.html to focus on one

    line 97
  26. Very specific:

    Test files are HTML files under /__tests__/html2/, they are not JS

    line 98
  27. Distinctive:

    Follow other HTML files under the same folder on how to write tests

    line 99
  28. Very specific:

    Use @testduet/given-when-then package instead of xUnit style describe/before/test/after

    line 102
  29. Distinctive:

    Prefer integration/end-to-end testing than unit testing

    line 103
  30. Very specific:

    Use as realistic setup as possible, such as using msw than mocking calls

    line 104
  31. Very specific:

    Use emulateIncomingActivity and emulateOutgoingActivity to emulate conversation

    line 105
  32. Distinctive:

    Run new test and all of them must be green

    line 109
  33. Very specific:

    Run npm run precommit to make sure it pass all linting process

    line 110
  34. Very specific:

    Add changelog entry to CHANGELOG.md, follow our existing format

    line 111
  35. Distinctive:

    All inputs SHOULD be validated

    line 116

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md for Bot Framework Web Chat

Coding

General

  • Unless stated otherwise, avoid Node.js
  • Apply our latest coding style to every file changed
  • Avoid spaghetti code: on new feature with a similar existing feature, refactor existing one before writing new feature
    • This does not applies to test code
  • Avoid global pollution, do not modify window object
  • Markdown are always space-indented with 3 spaces
  • Use /prettierrc.yml to format
  • Sort names in property bags
  • Avoid one-use variable, inline them instead
  • More new lines to separate code with different responsibilities
    • Multiple lines of code that can run in random order, put them into a group, no need new line between them
    • Otherwise, lines of code that depends on each other in a specific order, separate them with new line
  • Prefer && over if-statement if it is a oneliner
  • Importing relative file should always include file extension
  • Prefer truthy/false check like !array.length over array.length === 0
  • Prefer numValue over valueCount for "how many values are there"
  • Prefer uppercase for acronyms instead of Pascal case, e.g. getURL() over getUrl()
    • The only exception is id, e.g. getId() over getID()
  • Use fewer shorthands, only allow min, max, num
  • Prefer ternary operator over one-liner if statement

Design

  • Use immutability as much as possible, add object.freeze()
  • Follow W3C convention for API design
    • Extends EventTarget when eventing is needed, do not use Node.js on/off
    • Consider IntersectionObserver-like pattern for allow userland to subscribe to live changes
  • Allow ESNext code that is polyfilled by core-js-pure or iter-fest package

Typing

  • TypeScript is best-effort checking, use valibot for strict type checking
  • Use TypeScript CLI instead of tsc
  • Use valibot for runtime type checker, never use zod
    • Assume all externally exported functions will receive unsafe/invalid input, always check with valibot
  • Avoid any
  • Avoid as, use valibot instead
    • If absolutely needed, use satisifes X as Y to make sure it is X before force casting to Y
  • Use as few unknown as possible
  • All optional properties must be undefined-able, i.e. use value?: number | undefined over value?: number
  • For functions exported outside of current file, make sure all arguments and return value are typed
  • If need to look inside the object to check for types, use valibot
    • E.g. if (obj && typeof obj === 'object' && 'value' in obj && typeof obj.value === 'string') should be replaced with is(object({ value: string }), obj)
  • Use { readonly value: string } instead of Readonly<{ value: string }>
  • Use as much readonly as possible

React template

import { reactNode, validateProps } from '@msinternal/botframework-webchat-react-valibot';
import React from 'react';
import { number, object, pipe, readonly } from 'valibot';

// Use valibot to validate props.
const MyComponentPropsSchema = pipe(
  object({
    children: optional(reactNode())
  }),
  readonly()
);

type MyComponentProps = InferInput<typeof MyComponentPropsSchema>;

// Use big function instead of arrow function.
function MyComponent(props: MyComponentProps) {
  // Call `validateProps` to get a validated props.
  const { children } = validateProps(MyComponentPropsSchema, props);

  // Use `<>` instead of `<Fragment>`.
  // Never export `children` by itself, always wrap with `<>`.
  return <>{children}</>;
}

// Set `displayName`.
MyComponent.displayName = 'MyComponent';

// Export as memoized/exotic component, export as default.
export default memo(MyComponent);

// Export both schema and typing.
export { MyComponentPropsSchema, type MyComponentProps };

Testing instructions

  • Practice test-driven development
  • Build and run Docker to host WebDriver-controlled browser instances
    • Build container by docker compose -f docker-compose-wsl2.yml build --build-arg REGISTRY=mcr.microsoft.com
    • Start container by docker compose -f docker-compose-wsl2.yml up --detach --scale chrome=2
  • Run curl http://localhost:4444/wd/hub/status and wait until .value.ready become true
  • Run npm test, or npm test -- --testPathPattern test-html-file.html to focus on one
  • Test files are HTML files under /__tests__/html2/, they are not JS
  • Follow other HTML files under the same folder on how to write tests
  • Page conditions, page elements, and page objects can be found at /packages/test/page-object/src/globals
  • Use expect instead of assert
  • Use @testduet/given-when-then package instead of xUnit style describe/before/test/after
  • Prefer integration/end-to-end testing than unit testing
  • Use as realistic setup as possible, such as using msw than mocking calls
  • Use emulateIncomingActivity and emulateOutgoingActivity to emulate conversation

PR instructions

  • Run new test and all of them must be green
  • Run npm run precommit to make sure it pass all linting process
  • Add changelog entry to CHANGELOG.md, follow our existing format

Code review

  • Code should use as much immutable (via Object.freeze()) as possible, DO NOT trust readonly
  • All inputs SHOULD be validated

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.