Skip to content

Conversation

@ciscoRankush
Copy link

@ciscoRankush ciscoRankush commented Dec 11, 2025

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

  • Added ai-docs/README.md - Overview of the monorepo, technologies, components, and development workflow
  • Added ai-docs/AGENTS.md - Main orchestrator for AI assistants with task routing, SDK consultation, and validation workflows
  • Added ai-docs/RULES.md - Repository-wide architectural principles, naming conventions, and standards

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

  • The testing is done with the amplify link

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify: Cursor AI
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

Checklist before merging

  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the testing document
  • I have tested the functionality with amplify link

Make sure to have followed the contributing guidelines before submitting.

@aws-amplify-us-east-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-571.d1b38q61t1z947.amplifyapp.com

## 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.
Copy link
Contributor

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.

Copy link
Author

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).
Copy link
Contributor

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 -->
Copy link
Contributor

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.

Copy link
Author

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.
Copy link
Contributor

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.

Copy link
Author

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.
Copy link
Contributor

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.

Copy link
Author

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
Copy link
Contributor

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?

Copy link
Author

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
Copy link
Contributor

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.

Copy link
Author

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):
Copy link
Contributor

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?

Copy link
Author

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Widget NEVER calls SDK directly (use hook)
- Widget consumes SDK methods via the store (through a hook).

Copy link
Author

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**
Copy link
Contributor

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.

Copy link
Author

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
Copy link
Author

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):
Copy link
Author

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)
Copy link
Author

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**
Copy link
Author

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.
Copy link
Author

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
Copy link
Author

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

Copy link
Author

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.
Copy link
Author

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 -->
Copy link
Author

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.
Copy link
Author

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 .

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