Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
99f8719
feat(plugin-cc): merging next branch into task-refactor (#4284)
adhmenon May 21, 2025
70fd25c
feat(plugin-cc): added initial task skeleton (#4287)
adhmenon May 30, 2025
f0af195
feat(plugin-cc): merge-next-branch-into-task-refactor (#4325)
adhmenon Jun 6, 2025
4fdf2a3
feat(plugin-cc): refactored-voice-class (#4335)
adhmenon Jun 23, 2025
934f30a
feat(plugin-cc): added-werbtc-task-refactor (#4359)
adhmenon Jul 1, 2025
940f8e2
feat(plugin-cc): digital-task-refactor (#4373)
adhmenon Jul 8, 2025
7437bab
fix(contact center): change the folder name to contact center
arun3528 Oct 29, 2025
76d40a9
Merge branch 'next' into task-refactor
arun3528 Oct 29, 2025
13ffc92
feat(contact-center): merge-next-into-task-refactor (#4605)
adhmenon Dec 11, 2025
6b03a0e
Task with state machine (#4562)
arun3528 Dec 24, 2025
402097c
feat(contact-center): added-mpc (#4639)
adhmenon Feb 9, 2026
8457f6c
feat(contact-center): added-switch-call (#4701)
adhmenon Feb 13, 2026
b0b61aa
fix(contact-center): allow profile update for all fields (#4716)
mkesavan13 Feb 17, 2026
29e65a8
docs(contact-center): add root AGENTS.md and ai-docs framework for SD…
ciscoRankush Feb 23, 2026
83d401d
docs(contact-center): add ai-docs SDD pattern documentation (#4723)
ciscoRankush Feb 25, 2026
41bfe80
docs(contact-center): add SDD templates for new service creation (#4734)
ciscoRankush Feb 27, 2026
dc24066
docs(contact-center): add SDD templates for new method creation (#4735)
ciscoRankush Feb 27, 2026
d95c52c
docs(contact-center): add config service AI documentation-Agents (#4730)
Shreyas281299 Mar 2, 2026
6db9890
docs(contact-center): add core service AI documentation-AGENTS.md (#4…
Shreyas281299 Mar 2, 2026
8c738e3
docs(contact-center): add config service AI documentation-Architectur…
Shreyas281299 Mar 7, 2026
4b90816
docs(contact-center): add state machine AI documentation (#4738)
Kesari3008 Mar 9, 2026
e136f56
docs(contact-center): add core service AI documentation-Architecture …
Shreyas281299 Mar 9, 2026
8b9ad71
docs(contact-center): add task folder AI documentation (#4714)
Kesari3008 Mar 9, 2026
29ff2f2
chore: add spec-drift detection commands and pre-commit hook
ciscoRankush Mar 11, 2026
c6f7ba2
docs(contact-center): agents folder ai docs (#4736)
Kesari3008 Mar 11, 2026
a3e836b
doc(contact-center): add ai-docs SDD templates for code generation (#…
ciscoRankush Mar 16, 2026
ef2162d
docs(service): add root service docs (#4747)
Shreyas281299 Mar 16, 2026
2b90429
chore(contact-center): add spec-drift detection commands and pre-comm…
ciscoRankush Mar 24, 2026
481f68a
docs(metrics): Add ARCHITECTURE.md for Metrics module (SPARK-782335) …
Shreyas281299 Mar 25, 2026
80f776a
docs(metrics): Add AGENTS.md for Metrics module (SPARK-782334) (#4762)
Shreyas281299 Mar 25, 2026
d5dc4bc
feat(task-refactor): export TaskUIControls, getDefaultUIControls; add…
akulakum Mar 26, 2026
2683141
feat(contact-center): real time transcript (#4771)
Kesari3008 Mar 27, 2026
f9b8187
fix(tooling): fix claude settings.json (#4817)
Shreyas281299 Mar 30, 2026
b1af60c
CC playwright PR1 infrastructure (#4807)
lego0110 Apr 1, 2026
03e00c7
feat(cc): playwright tests for station login and user state managemen…
lego0110 Apr 8, 2026
3b0e664
Realtime ws connection (#4813)
Kesari3008 Apr 9, 2026
3f6991c
fix(task-refactor): handle incoming task cleanup in OFFERED state for…
akulakum Apr 10, 2026
2331ee3
fix(task-refactor): Missing Recording Button and Hold/Resume Sync Fai…
akulakum Apr 15, 2026
e172ced
feat(cc): playwright tests for Basic Call Task Controls (#4839)
lego0110 Apr 15, 2026
58fc1fc
docs(contact-center): enhance core AGENTS.md with Utils.ts coverage (…
Shreyas281299 Apr 17, 2026
97d4afc
docs(contact-center): fix unresolved SDD review comments (#4789)
ciscoRankush Apr 17, 2026
ac98bc3
fix(contact-center): consult flow fixes (#4861)
Kesari3008 Apr 20, 2026
37d619a
fix(contact-center): consult flow state-machine fixes for task-refact…
akulakum Apr 23, 2026
fe71103
feat(deploy): add task-refactor in deploy yml
Shreyas281299 Apr 30, 2026
9ad12b0
feat(publish): publish all packages (#4935)
Shreyas281299 Apr 30, 2026
fc6d781
fix(task-refactor): epdn flow fixes (#4950)
akulakum May 5, 2026
965266c
fix(task-refactor): add environment to OrgInfo/Profile for dataCenter…
akulakum May 13, 2026
949790b
fix(task-refactor): consult flow bug bash fixes (#4962)
akulakum May 14, 2026
8ae105a
fix(task-refactor): outdail issue fix (#4987)
akulakum May 20, 2026
4c19a92
feat(cc): playwright e2e tests (#4917)
lego0110 May 26, 2026
8ffeb4b
feat: add multi session tests and stabilize e2e suite
lego0110 Jun 21, 2026
3c06d3d
fix: code cleanup
lego0110 Jun 22, 2026
5ffc748
fix: stablize e2e flows
lego0110 Jun 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 159 additions & 0 deletions .claude/commands/spec-drift-changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Spec Drift Detection — Changed Files Only

Validate ai-docs affected by any staged/unstaged changes — whether the changes are to ai-docs themselves OR to source code that has corresponding ai-docs. Lightweight mode for pre-commit validation.

## Step 1: Find All Changed Files

Run these commands to find all changed files (staged and unstaged):

```bash
# Get both staged and unstaged changed files
(git diff --name-only HEAD 2>/dev/null; git diff --name-only --cached 2>/dev/null) | sort -u
```

## Step 2: Identify ai-docs That Need Validation

From the changed files, build TWO lists:

### List A: Changed ai-docs files
Filter for files matching `ai-docs/*.md`. These docs changed directly and need validation.

### List B: Source code files with corresponding ai-docs
For each changed source file under `packages/@webex/contact-center/` (excluding ai-docs files themselves):
1. Walk up the file's directory path
2. Check if any ancestor directory contains an `ai-docs/` folder
3. If yes, that `ai-docs/` folder needs validation against the updated source code

Use this to discover ai-docs folders:
```bash
find packages/@webex/contact-center -type d -name "ai-docs"
```

Build a mapping like:
```
Changed source file → ai-docs to validate
packages/@webex/contact-center/src/services/task/Task.ts → src/services/task/ai-docs/
packages/@webex/contact-center/src/services/task/contact.ts → src/services/task/ai-docs/
packages/@webex/contact-center/src/services/config/types.ts → src/services/config/ai-docs/
```

**Deduplicate**: If multiple source files map to the same ai-docs folder, validate that folder only once.

### Combine Lists A and B
The final set of ai-docs folders to validate is the union of:
- Folders containing files from List A
- Folders identified from List B

If NEITHER list has entries, report: **"No ai-docs affected by current changes — nothing to check."** and stop.

## Step 3: Validate Affected ai-docs

For each ai-docs folder that needs validation, spawn an Explore agent with this prompt:

```
You are validating SDD documentation accuracy against source code.

SOURCE OF TRUTH (actual code): {source_code_directory}
DOCS TO VALIDATE: {ai_docs_folder} (all .md files in this folder)

CHANGED SOURCE FILES (if any): {list of changed source files in this service}
CHANGED DOC FILES (if any): {list of changed ai-docs files}

Read every markdown file in the ai-docs folder. For each document, check these 7 categories:

1. FILE TREE: Read any documented file/directory trees. Glob the actual directory. Report missing/extra files.

2. METHOD/API SIGNATURES: For every method documented, read the actual source and verify: name, params, param types, return type, modifiers. Flag any mismatch. Pay special attention to methods in changed source files — new methods may be missing from docs, or changed signatures may not be reflected.

3. TYPE DEFINITIONS: For every type/enum/interface documented, find the actual definition in source. Compare name, fields, field types, enum values. Check if changed source files introduced new types not yet documented.

4. EVENT NAMES: For every event constant referenced, verify it exists in source with the exact same name and value. Verify trigger vs emit usage (cc.ts uses trigger, EventEmitter classes use emit). Check if changed source files added new events not yet documented.

5. ARCHITECTURE PATTERNS: Verify claims about HTTP vs WebSocket flow, trigger vs emit, singleton vs factory, bootstrap order, class hierarchy.

6. LINK VALIDATION: For every relative link [text](path), verify the target exists on disk.

7. CODE EXAMPLES: For every code block, verify API names, method names, parameter names, import paths are correct.

For each finding, report:
- File: (path)
- Line/Section: (approximate line or section heading)
- Category: (1-7)
- Severity: Blocking / Important / Medium / Minor
- Blocking = wrong API that would cause runtime errors if an AI agent follows the docs
- Important = wrong params/types that would cause compilation errors
- Medium = incomplete or stale info (e.g., new methods/types/events missing from docs)
- Minor = broken links, cosmetic issues
- What doc says: (quoted)
- What code actually has: (evidence with file:line)
- Suggested fix: (exact replacement text)
```

Run all agents in parallel if multiple ai-docs folders are affected.

## Step 4: Consolidate and Report

Present findings in this format:

```markdown
## Spec Drift Report — Changed Files
Generated: {date}
Trigger: {source code changes / ai-docs changes / both}
ai-docs folders checked: {list}

### Changed Source Files
{list of changed source files and their mapped ai-docs folder}

### Changed ai-docs Files
{list of changed ai-docs files, or "None"}

### Summary

| ai-docs Folder | Findings | Blocking | Important | Medium | Minor |
|----------------|----------|----------|-----------|--------|-------|
| ... | | | | | |

### Blocking Findings
...

### Important Findings
...

### Medium Findings
...

### Minor Findings
...

### Actionable Fixes by File
(grouped by file path, each with exact old text -> new text)
```

## Step 5: Create Verification Marker

After presenting the validation report (regardless of findings), create a verification marker so the pre-commit hook allows the commit:

```bash
# Hash staged content (not just paths) — must match the hook's hash logic exactly
CC_PKG="packages/@webex/contact-center"
STAGED_CC=$(git diff --cached --name-only 2>/dev/null | grep "^${CC_PKG}/")
if [ -n "$STAGED_CC" ]; then
HASH=$(git diff --cached -- "$CC_PKG" | (shasum 2>/dev/null || sha256sum) | cut -d' ' -f1)
touch "/tmp/.spec-drift-verified-${HASH}"
echo "Verification marker created: /tmp/.spec-drift-verified-${HASH}"
fi
```

> **Note:** The verification marker covers only currently **staged** content. If you modify and re-stage files after verification, the content hash changes and you will need to re-run `/spec-drift-changed`.

Report to the user: "Verification marker created. The pre-commit hook will allow the next commit for these staged files."

## Rules

- Do NOT auto-fix anything — report findings only
- Always read actual source code to verify — never assume
- Use the Agent tool with `subagent_type: "Explore"` for checker agents
- Run agents in parallel when multiple folders are affected
- If an agent does not return within a reasonable time, note it as "Timed out — manual review needed" in the report and continue with available results
- Always create the verification marker at the end, even if there are findings — this tool is **advisory**: the developer decides whether to fix or commit as-is
- The marker hash MUST match the hook's hash computation — both use `git diff --cached` content (not just file paths)
194 changes: 194 additions & 0 deletions .claude/commands/spec-drift.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# Spec Drift Detection — Full Scan

Run a comprehensive validation of all SDD ai-docs against actual source code. Deploys a parallel agent team to catch documentation drift across 7 categories.

## Step 1: Auto-Discovery

Detect repo type and discover all ai-docs:

1. **Repo detection**: This is ccSDK — `packages/@webex/contact-center/` exists
2. **Root AGENTS.md**: `packages/@webex/contact-center/AGENTS.md`
3. **Framework docs**: `packages/@webex/contact-center/ai-docs/` (README, RULES, patterns/*, templates/*)
4. **Service-level ai-docs**: Glob for `packages/@webex/contact-center/**/ai-docs/` to find all ai-docs folders
5. **Source root**: `packages/@webex/contact-center/src/`

For each ai-docs folder found, identify its corresponding source code directory (the parent directory of `ai-docs/`).

Build an inventory (example — actual results will vary based on current branch):
```
ai-docs folder → source directory
packages/@webex/contact-center/src/services/core/ai-docs/ → src/services/core/
packages/@webex/contact-center/src/services/config/ai-docs/ → src/services/config/
packages/@webex/contact-center/src/services/task/ai-docs/ → src/services/task/
packages/@webex/contact-center/src/services/agent/ai-docs/ → src/services/agent/
packages/@webex/contact-center/playwright/ai-docs/ → playwright/
... (discover all that exist on the current branch)
```

## Step 2: Spawn Checker Agents in Parallel

Use the Agent tool to spawn agents. **All agents run in parallel.**

### Per-Service Checker Agents (one per ai-docs folder)

For EACH ai-docs folder discovered, spawn one Explore agent with this prompt:

```
You are validating SDD documentation accuracy.

SOURCE OF TRUTH (actual code): {source_code_directory}
DOCS TO VALIDATE: {ai_docs_folder}

Read every markdown file in the ai-docs folder. For each document, check these 7 categories:

### Category 1: FILE TREE
Read any documented file/directory trees in the docs. Glob the actual directory. Report:
- Files listed in docs but missing on disk
- Files on disk but missing from docs
- Wrong nesting or directory structure

### Category 2: METHOD/API SIGNATURES
For every method, function, or API endpoint documented:
- Read the actual source file
- Verify: method name, parameter names, parameter types, return type, access modifiers (public/private/static)
- Check if method actually exists in the documented file
- Flag any param that is documented but doesn't exist, or exists but isn't documented

### Category 3: TYPE DEFINITIONS
For every type, enum, interface, or constant documented:
- Find the actual definition in source (check src/types.ts for public types, src/services/*/types.ts for internal)
- Compare: name, fields/members, field types, enum values
- Flag missing fields, wrong types, renamed types

### Category 4: EVENT NAMES
For every event constant referenced (CC_EVENTS, TASK_EVENTS, AGENT_EVENTS, etc.):
- Find the actual constant definition in source
- Verify the exact string value matches
- Check the event is emitted where the docs say it is
- Verify trigger vs emit usage (cc.ts uses trigger, EventEmitter classes use emit)

### Category 5: ARCHITECTURE PATTERNS
For claims about architectural patterns, verify:
- HTTP vs WebSocket: Is the request flow correctly described?
- trigger vs emit: Does the documented class use the correct emission method?
- Singleton vs factory: Is the instantiation pattern correct?
- Bootstrap/initialization order: Does the documented sequence match actual code?
- Class hierarchy: Are extends/implements relationships correct?
- Dependency injection patterns: Are they accurately described?

### Category 6: LINK VALIDATION
For every relative markdown link [text](path):
- Resolve the path relative to the document's location
- Verify the target file exists on disk
- For anchor links (#section), verify the heading exists in the target

### Category 7: CODE EXAMPLES
For every inline code block or code snippet:
- Verify API names, method names, parameter names are correct
- Verify import paths are valid
- Check that documented usage patterns match actual API signatures
- Verify event listener patterns use named callbacks (not anonymous functions)

## Output Format

For each finding, report:
- **File**: (path to the ai-docs file with the issue)
- **Line/Section**: (approximate line number or section heading)
- **Category**: (1-7 from above)
- **Severity**:
- Blocking = wrong API that would cause runtime errors if an AI agent follows the docs
- Important = wrong params/types that would cause compilation errors
- Medium = incomplete or stale info that would cause confusion
- Minor = broken links, cosmetic issues
- **What doc says**: (quoted text from the doc)
- **What code actually has**: (evidence from source, with file path and line)
- **Suggested fix**: (exact replacement text)

If no issues found in a category, state "No issues found" for that category.
```

### Framework Agent

Spawn one additional Explore agent for root-level framework validation:

```
Validate the root-level SDD framework documents for packages/@webex/contact-center/:

1. **Root AGENTS.md** (packages/@webex/contact-center/AGENTS.md):
- Service Routing Table: Every service listed must exist on disk at the documented path
- Every actual service directory under src/services/ should be listed
- Task classification types must be consistent with template directories that exist
- Quick Start Workflow steps must reference files that exist

2. **ai-docs/RULES.md**:
- Test commands: Verify yarn workspace commands are correct (test:unit, test:style, not test:styles)
- Naming conventions: Verify claims against actual code
- Pattern references: All referenced patterns should exist

3. **ai-docs/README.md**:
- File tree must match actual ai-docs directory structure
- All referenced documents must exist

4. **ai-docs/patterns/*.md**:
- Each pattern file's code examples must match actual source conventions
- Event patterns must use correct trigger vs emit based on class type
- Type location claims (public in src/types.ts, internal in services/*/types.ts) must be accurate
- Test patterns must reference correct commands and configs

5. **ai-docs/templates/**:
- Cross-references to AGENTS.md sections must be valid
- Referenced file paths in templates must exist
- Workflow steps must be internally consistent

For each finding, report:
- **File**: (path)
- **Line/Section**: (section heading or line)
- **Category**: (1-7: File Tree, Method/API, Type Definition, Event Name, Architecture Pattern, Link Validation, Code Example)
- **Severity**: Blocking / Important / Medium / Minor
- **What doc says**: (quoted)
- **What code actually has**: (evidence with file:line)
- **Suggested fix**: (replacement text)
```

## Step 3: Consolidate Results

After ALL agents complete, consolidate into this report format:

```markdown
## Spec Drift Report — ccSDK (@webex/contact-center)
Generated: {date}
Scanned: {N} ai-docs folders, {M} documents

### Summary

| ai-docs Folder | Findings | Blocking | Important | Medium | Minor |
|----------------|----------|----------|-----------|--------|-------|
| (each folder) | | | | | |
| framework | | | | | |
| **Total** | **N** | | | | |

### Blocking Findings
(must fix — wrong APIs that would cause runtime errors if AI agent follows the docs)

### Important Findings
(wrong params, signatures, types — would cause compilation errors)

### Medium Findings
(incomplete info, stale file trees — would cause confusion)

### Minor Findings
(broken links, cosmetic issues)

### Actionable Fixes by File
(grouped by file path, each with exact old text -> new text)
```

## Rules

- Do NOT auto-fix anything — report findings only
- Always read actual source code to verify — never assume
- Use the Agent tool with `subagent_type: "Explore"` for all checker agents
- Run all agents in parallel for speed
- If an agent does not return within a reasonable time, note it as "Timed out — manual review needed" in the report and continue with available results
- If an ai-docs folder has no corresponding source directory, flag it as a Category 1 (File Tree) finding
- Count findings by severity in the summary table
Loading
Loading