Skip to content

Commit 9dca058

Browse files
authored
Merge pull request #646 from AJLange/lookup-agents
adding agents.md to lookup project including claude and copilot files
2 parents b5bd5fd + 74914f6 commit 9dca058

3 files changed

Lines changed: 130 additions & 0 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<!-- Auto-synced from AGENTS.md — do not edit directly. -->
2+
# Phone Number Lookup
3+
4+
A Twilio Serverless Function and web UI that lets you look up detailed intelligence about any phone number using the Twilio Lookup v2 API — including validation, line type, carrier, caller name, SMS pumping risk, SIM swap detection, and more.
5+
6+
## Commands
7+
8+
```bash
9+
# Initialize a new project from this template
10+
twilio serverless:init lookup-sample --template=lookup && cd lookup-sample
11+
12+
# Install dependencies
13+
npm install
14+
15+
# Run locally
16+
npm start
17+
18+
# Open the UI
19+
# Visit http://localhost:3000/index.html in your browser
20+
21+
# Deploy to Twilio
22+
twilio serverless:deploy
23+
```
24+
25+
## Environment Variables
26+
27+
Copy `.env.example` to `.env`. Never commit `.env`.
28+
29+
```bash
30+
cp .env.example .env
31+
```
32+
33+
| Variable | Where to find | Format |
34+
| -------- | ------------- | ------ |
35+
| `ACCOUNT_SID` | [Console](https://console.twilio.com) homepage | Starts with `AC` |
36+
| `AUTH_TOKEN` | Console homepage → click to reveal | 32-char string. Treat as a password. |
37+
38+
## Project Structure
39+
40+
- `functions/lookup.js` — Serverless Function handler; calls the Lookup v2 API and returns phone number intelligence as JSON
41+
- `assets/index.html` — Web UI; accepts a phone number and selected data packages, displays the JSON response
42+
- `tests/lookup.test.js` — Jest tests for the Function handler
43+
44+
## Agent Boundaries
45+
46+
**Always:**
47+
- Confirm `.env` is populated with `ACCOUNT_SID` and `AUTH_TOKEN` before starting the server
48+
- Remind the user that Validation and Formatting is free; all other data packages are billed per lookup
49+
- Note that SIM Swap, Call Forwarding, and Line Status require additional carrier approval before use
50+
51+
**Never:**
52+
- Hardcode credentials in source files
53+
- Run the app with missing or placeholder credentials
54+
55+
## Verify It's Working
56+
57+
1. Start the server with `npm start` and open `http://localhost:3000/index.html`
58+
2. Enter any phone number, select one or more data packages, and click **Lookup** — you should see a JSON response with the number's validation status and the requested intelligence fields
59+
60+
## Twilio Resources
61+
62+
- [Twilio Console](https://console.twilio.com) — credentials and account management
63+
- [Lookup v2 API docs](https://www.twilio.com/docs/lookup/v2-api)
64+
- [Lookup data packages](https://www.twilio.com/docs/lookup/v2-api#data-packages)
65+
- [Twilio Serverless Toolkit](https://www.twilio.com/docs/labs/serverless-toolkit)

lookup/AGENTS.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Phone Number Lookup
2+
3+
A Twilio Serverless Function and web UI that lets you look up detailed intelligence about any phone number using the Twilio Lookup v2 API — including validation, line type, carrier, caller name, SMS pumping risk, SIM swap detection, and more.
4+
5+
## Commands
6+
7+
```bash
8+
# Initialize a new project from this template
9+
twilio serverless:init lookup-sample --template=lookup && cd lookup-sample
10+
11+
# Install dependencies
12+
npm install
13+
14+
# Run locally
15+
npm start
16+
17+
# Open the UI
18+
# Visit http://localhost:3000/index.html in your browser
19+
20+
# Deploy to Twilio
21+
twilio serverless:deploy
22+
```
23+
24+
## Environment Variables
25+
26+
Copy `.env.example` to `.env`. Never commit `.env`.
27+
28+
```bash
29+
cp .env.example .env
30+
```
31+
32+
| Variable | Where to find | Format |
33+
| -------- | ------------- | ------ |
34+
| `ACCOUNT_SID` | [Console](https://console.twilio.com) homepage | Starts with `AC` |
35+
| `AUTH_TOKEN` | Console homepage → click to reveal | 32-char string. Treat as a password. |
36+
37+
## Project Structure
38+
39+
- `functions/lookup.js` — Serverless Function handler; calls the Lookup v2 API and returns phone number intelligence as JSON
40+
- `assets/index.html` — Web UI; accepts a phone number and selected data packages, displays the JSON response
41+
- `tests/lookup.test.js` — Jest tests for the Function handler
42+
43+
## Agent Boundaries
44+
45+
**Always:**
46+
- Confirm `.env` is populated with `ACCOUNT_SID` and `AUTH_TOKEN` before starting the server
47+
- Remind the user that Validation and Formatting is free; all other data packages are billed per lookup
48+
- Note that SIM Swap, Call Forwarding, and Line Status require additional carrier approval before use
49+
50+
**Never:**
51+
- Hardcode credentials in source files
52+
- Run the app with missing or placeholder credentials
53+
54+
## Verify It's Working
55+
56+
1. Start the server with `npm start` and open `http://localhost:3000/index.html`
57+
2. Enter any phone number, select one or more data packages, and click **Lookup** — you should see a JSON response with the number's validation status and the requested intelligence fields
58+
59+
## Twilio Resources
60+
61+
- [Twilio Console](https://console.twilio.com) — credentials and account management
62+
- [Lookup v2 API docs](https://www.twilio.com/docs/lookup/v2-api)
63+
- [Lookup data packages](https://www.twilio.com/docs/lookup/v2-api#data-packages)
64+
- [Twilio Serverless Toolkit](https://www.twilio.com/docs/labs/serverless-toolkit)

lookup/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

0 commit comments

Comments
 (0)