-
Notifications
You must be signed in to change notification settings - Fork 62
docs(ai-docs): add core AI-docs framework - README, AGENTS, RULES #571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
| ## Architectural principles | ||
|
|
||
| - Clear layering: Widgets → UI components (`cc-components`) → Store (MobX) → SDK/backends (where applicable). | ||
| - Web Components are thin wrappers over React widgets via r2wc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can avoid this.. not sure if we should mention web components now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no harm in providing the extra info , as it may help LLM to understand the context more efficiently .
|
|
||
| ## Components & APIs | ||
|
|
||
| - Strongly typed props and public surfaces (`index.ts` per package/widget). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we want to add another section here, talking about how utils are for utility functions and hooks while presentational layer hosts the UI.
|
|
||
| ## Error handling | ||
|
|
||
| - Surface user-friendly errors in UI; avoid swallowing exceptions. <!-- TODO: add error boundary patterns if present --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can mention the error boundary here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let us create a single separate PR for all the todos of doc. As for these we need teams's input
| ## Testing standards | ||
|
|
||
| - Unit/component tests per package under `tests/`. | ||
| - E2E tests in `playwright/` with suites and helpers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we have a more detailed doc in this folder? Playwright md files would be different here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I can see more detailed doc in playwright/ folder .
| @@ -0,0 +1,196 @@ | |||
| # Contact Center Widgets | |||
|
|
|||
| Monorepo for Webex Contact Center UI widgets built with React, MobX, and Web Components. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repo also has meeting widgets, should we include them as well?
I feel leaving them out and only having contact center widgets can cause conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets discuss this , if its required we will take it in another commit .
or whenever we will do the same exercise for Meeting widgets , will update it . And as I understand the meeting widgets are very old , are we actively supporting it ?
MAy i be let us redefine the statement something like "Contact centre Widget is part of widgets mono repo", so that it will avoid any conflicts with meetings widgets .
make sense ?
|
|
||
| ## Components | ||
|
|
||
| ### Active Widgets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the remaining widgets be added as part of another PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this is missed . thanks for catching this .. we will add in this PR only
|
|
||
| **When developer provides a task, follow this workflow:** | ||
|
|
||
| 1. **Understand the task** - Identify what type of work is needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add another point asking it to break down the task, if it is too big. It is essential we inform the AI that tasks could be big.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah make sense , ideally developer, should provide one task only in the prompt like
- create new widget
- or fix a bug
- add new feature .
But even if developers are giving multiple type of task , we should break it . Will add the gaurdrail for the same .
|
|
||
| **STOP! Before generating ANY new widget code, collect design input.** | ||
|
|
||
| #### Required Input (ONE of these): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This basic rule is mainly for the new widget code , so ideally developers has to provide the UI/UX in some format , Figma link is the ideal , .Currently yeah there is no MCP server added for the figma , but developers can add it in their chat session . SO no optional for this .
| ``` | ||
|
|
||
| **Key Rules:** | ||
| - Widget NEVER calls SDK directly (use hook) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Widget NEVER calls SDK directly (use hook) | |
| - Widget consumes SDK methods via the store (through a hook). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
| - Linting passes: `yarn test:styles` | ||
| - Build succeeds: `yarn build` | ||
|
|
||
| 2. **Code quality checks** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A line mentioning it should have precise and concise code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, we will add it
|
|
||
| **When developer provides a task, follow this workflow:** | ||
|
|
||
| 1. **Understand the task** - Identify what type of work is needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah make sense , ideally developer, should provide one task only in the prompt like
- create new widget
- or fix a bug
- add new feature .
But even if developers are giving multiple type of task , we should break it . Will add the gaurdrail for the same .
|
|
||
| **STOP! Before generating ANY new widget code, collect design input.** | ||
|
|
||
| #### Required Input (ONE of these): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This basic rule is mainly for the new widget code , so ideally developers has to provide the UI/UX in some format , Figma link is the ideal , .Currently yeah there is no MCP server added for the figma , but developers can add it in their chat session . SO no optional for this .
| ``` | ||
|
|
||
| **Key Rules:** | ||
| - Widget NEVER calls SDK directly (use hook) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
| - Linting passes: `yarn test:styles` | ||
| - Build succeeds: `yarn build` | ||
|
|
||
| 2. **Code quality checks** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, we will add it
| @@ -0,0 +1,196 @@ | |||
| # Contact Center Widgets | |||
|
|
|||
| Monorepo for Webex Contact Center UI widgets built with React, MobX, and Web Components. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets discuss this , if its required we will take it in another commit .
or whenever we will do the same exercise for Meeting widgets , will update it . And as I understand the meeting widgets are very old , are we actively supporting it ?
MAy i be let us redefine the statement something like "Contact centre Widget is part of widgets mono repo", so that it will avoid any conflicts with meetings widgets .
make sense ?
|
|
||
| ## Components | ||
|
|
||
| ### Active Widgets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this is missed . thanks for catching this .. we will add in this PR only
| - Location: `packages/contact-center/cc-widgets/` | ||
|
|
||
| ### Future Widgets | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets remove this section
| ## Architectural principles | ||
|
|
||
| - Clear layering: Widgets → UI components (`cc-components`) → Store (MobX) → SDK/backends (where applicable). | ||
| - Web Components are thin wrappers over React widgets via r2wc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no harm in providing the extra info , as it may help LLM to understand the context more efficiently .
|
|
||
| ## Error handling | ||
|
|
||
| - Surface user-friendly errors in UI; avoid swallowing exceptions. <!-- TODO: add error boundary patterns if present --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let us create a single separate PR for all the todos of doc. As for these we need teams's input
| ## Testing standards | ||
|
|
||
| - Unit/component tests per package under `tests/`. | ||
| - E2E tests in `playwright/` with suites and helpers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I can see more detailed doc in playwright/ folder .
COMPLETES N/A - Documentation Enhancement
This pull request addresses
Adding the core AI-driven development documentation framework to enable AI assistants (like GitHub Copilot, Cursor, etc.) to better understand and work with the Contact Center Widgets codebase.
by making the following changes
ai-docs/README.md- Overview of the monorepo, technologies, components, and development workflowai-docs/AGENTS.md- Main orchestrator for AI assistants with task routing, SDK consultation, and validation workflowsai-docs/RULES.md- Repository-wide architectural principles, naming conventions, and standardsChange Type
The following scenarios were tested
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging
Make sure to have followed the contributing guidelines before submitting.