Skip to content

feat: add /lfx-intercom skill for LFX Intercom integration#8

Open
mlehotskylf wants to merge 2 commits intomainfrom
add-intercom-skill
Open

feat: add /lfx-intercom skill for LFX Intercom integration#8
mlehotskylf wants to merge 2 commits intomainfrom
add-intercom-skill

Conversation

@mlehotskylf
Copy link

Summary

  • Adds /lfx-intercom skill that adds or fixes Intercom integration in any LFX Angular app
  • Validated against the canonical pattern used in Mentorship, Crowdfunding, and PCC
  • Covers the full integration surface: Angular service, app component wiring, Auth0 configuration, and CSP

What the skill does

Audit-first: produces a gap report against 11 checks before touching any code — exits cleanly if nothing is wrong.

IntercomService (canonical, production-proven):

  • Promise-based boot() with isLoaded/isBooted/isLoading state
  • Intercom stub queue (i.q) so commands work before the real script loads
  • JWT pre-set in window.intercomSettings and stripped from boot options (not leaked into payload)
  • SSR-safe typeof window guards on every method
  • Script onerror handler, 10s timeout with CSP/ad-blocker hint

App component wiring:

  • intercomBootAttempted guard (prevents re-boot on multiple userProfile$ emissions)
  • Explicit JWT/userId null-check with warning log
  • LaunchDarkly enable-intercom flag pattern

Auth0 configuration (required, commonly missed):

  • Exact custom_claims.js case block to add
  • Secret location in AWS Secrets Manager
  • Terraform deployment instructions

CSP: complete entry set including WebSocket sources (wss://) required for real-time chat.

Notes: 127.0.0.1 local dev requirement, new hostname registration (contact Heather's team), deprecated HMAC claim guidance.

Self-maintenance: designates Mentorship as canonical reference; requires updating this skill in the same PR where the app is fixed.

Test plan

  • Run ./install.sh and confirm /lfx-intercom appears in the skill list
  • Open an LFX Angular repo and invoke /lfx-intercom — confirm it asks context questions and produces an audit report
  • Verify the generated IntercomService matches the implementation in lfx-mentorship-upgrade/src/app/services/intercom.service.ts

🤖 Generated with Claude Code

Adds a new skill that adds or fixes Intercom integration in any LFX
Angular app, standardizing against the canonical pattern validated
across Mentorship, Crowdfunding, and PCC.

Key features:
- Audit-first flow: produces a gap report before making any changes
- Full IntercomService implementation (Promise-based boot, isLoaded/
  isBooted/isLoading state, Intercom stub queue, JWT pre-set and
  stripped from boot options, SSR-safe window guards)
- App component wiring with intercomBootAttempted guard
- Auth0 configuration guide (custom_claims.js case block, secret
  location, Terraform deployment steps)
- Complete CSP entries including WebSocket sources for real-time chat
- Notes on 127.0.0.1 local dev requirement, hostname registration,
  and deprecated HMAC claim
- Self-maintenance strategy: canonical reference app + update-in-same-PR rule

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 18, 2026 05:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new /lfx-intercom skill to standardize (or repair) Intercom integration across LFX Angular apps, and documents it in the repository skill index.

Changes:

  • Introduces lfx-intercom/SKILL.md with an audit-first workflow plus canonical implementation guidance (service, app wiring, Auth0 claim, CSP).
  • Updates README.md to list /lfx-intercom in the skill list, overview table, and project structure tree.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
lfx-intercom/SKILL.md New skill definition and end-to-end Intercom integration/audit instructions
README.md Adds /lfx-intercom to the documented skill catalog and repo structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add missing copyright + SPDX header after front matter (matches all
  other skills in the repo)
- Note that the environment import path must be adjusted based on the
  chosen service folder depth

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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