Skip to content

Commit 288ea74

Browse files
Merge pull request #140 from contentstack/fix/dx-6043-update-cursor-rules-skills
docs(DX-6043): add AGENTS.md, skills, and Cursor rules entry
2 parents 46135b7 + d178b32 commit 288ea74

File tree

10 files changed

+362
-299
lines changed

10 files changed

+362
-299
lines changed

.cursor/rules/README.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
# Cursor rules — @contentstack/marketplace-sdk
1+
# Cursor (optional)
22

3-
Rules live in this directory. Each file states its scope in YAML frontmatter (`description`, and either `globs` and/or `alwaysApply`).
3+
**Cursor** users: start at **[AGENTS.md](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**.
44

5-
| Rule file | `alwaysApply` | Globs | When it applies |
6-
|-----------|---------------|-------|-----------------|
7-
| [dev-workflow.mdc](dev-workflow.mdc) | no | `**/*` | Branching, local commands, CI expectations, releases |
8-
| [javascript.mdc](javascript.mdc) | no | `lib/**`, `test/**`, `types/**`, config roots | ESLint Standard, ES modules, project layout |
9-
| [contentstack-javascript-marketplace.mdc](contentstack-javascript-marketplace.mdc) | no | `lib/**` only | Developer Hub host/region, auth, HTTP client behavior, marketplace modules |
10-
| [testing.mdc](testing.mdc) | no | `test/**` | Mocha vs Jest, sanity env, naming |
11-
| [code-review.mdc](code-review.mdc) | **yes** || Every session — PR / change checklist |
12-
13-
## Referencing rules in chat
14-
15-
In Cursor, mention a rule by **filename** or **@ mention** when the picker lists project rules, for example:
16-
17-
- `@dev-workflow` or `.cursor/rules/dev-workflow.mdc`
18-
- `@javascript` / `@contentstack-javascript-marketplace` / `@testing` / `@code-review`
19-
20-
See also the repository [AGENTS.md](../../AGENTS.md) (repo root) and [skills/README.md](../../skills/README.md).
5+
This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs.

AGENTS.md

Lines changed: 32 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,43 @@
1-
# Agent guide — @contentstack/marketplace-sdk
1+
# Contentstack Marketplace SDK – Agent guide
22

3-
## What this package is
3+
**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**.
44

5-
**Contentstack Marketplace SDK** — a **JavaScript client for Marketplace / Developer Hub** operations (apps, installations, hosting, OAuth, webhooks, authorization flows against the Developer Hub API). It is **not** the [Content Delivery API (CDA)](https://www.contentstack.com/docs/developers/apis/content-delivery-api/) SDK and **not** a general stack **Content Management API (CMA)** content SDK; it targets **marketplace app lifecycle and related management APIs** using the same style of auth as CMA (authtoken, `authorization` header, optional `login`).
5+
## What this repo is
66

7-
- **Repository:** [github.com/contentstack/contentstack-marketplace-sdk](https://github.com/contentstack/contentstack-marketplace-sdk)
8-
- **npm:** `@contentstack/marketplace-sdk`
7+
| Field | Detail |
8+
|--------|--------|
9+
| **Name:** | [contentstack-marketplace-sdk](https://github.com/contentstack/contentstack-marketplace-sdk) (`@contentstack/marketplace-sdk`) |
10+
| **Purpose:** | Node/browser SDK for managing Contentstack **Marketplace** app content and related APIs. |
11+
| **Out of scope:** | Not the core Delivery/Management content APIs for arbitrary stacks—scope changes belong to product requirements. |
912

10-
## Tech stack
13+
## Tech stack (at a glance)
1114

12-
| Area | Choice |
13-
|------|--------|
14-
| Language | JavaScript (ES modules in `lib/`), transpiled with Babel; TypeScript only for `test/typescript/` and `types/` |
15-
| Runtime | Node (README: 10+; CI uses Node 22.x) |
16-
| HTTP / JSON | [axios](https://axios-http.com/), [qs](https://github.com/ljharb/qs) for query serialization |
17-
| Config / regions | [@contentstack/utils](https://www.npmjs.com/package/@contentstack/utils) (`getContentstackEndpoint` for Developer Hub host) |
18-
| Unit / API-style tests | Mocha, Chai, NYC; Babel register for `lib/` |
19-
| Typecheck tests | Jest + ts-jest (`jest.config.js`) |
20-
| Lint | ESLint + `eslint-config-standard` (`.eslintrc.js`) |
21-
| Bundling | Webpack → `dist/node`, `dist/web`, etc. |
15+
| Area | Details |
16+
|------|---------|
17+
| Language | JavaScript (Babel transpilation); TypeScript tests via Jest (`test/typescript`) |
18+
| Build | Webpack configs under **`webpack/`**; outputs under **`dist/`** (`npm run build`) |
19+
| Tests | Mocha + NYC for unit/API tests; `npm run test:typescript` for Jest subset |
20+
| Lint / coverage | ESLint on `lib` and `test` (`npm run lint`); NYC coverage |
21+
| CI | `.github/workflows/unit-test.yml`, `check_branch.yml`, `sca-scan.yml`, `policy-scan.yml`, `npm-publish.yml` |
2222

23-
## Public entry points (source of truth)
23+
## Commands (quick reference)
2424

25-
| Role | Path |
26-
|------|------|
27-
| Factory | `lib/contentstack.js``client()`, exports `Region` |
28-
| Request surface | `lib/contentstackClient.js``login`, `marketplace`, `logout` |
29-
| HTTP stack | `lib/core/contentstackHTTPClient.js`, `lib/core/concurrency-queue.js`, `lib/core/messageHandler.js` |
30-
| Errors | `lib/core/contentstackError.js` |
31-
| Marketplace domain | `lib/marketplace/**` |
32-
| Published `main` | `dist/node/contentstack-marketplace.js` (build output) |
33-
| Type declarations | `types/contentstackClient.d.ts` and `types/marketplace/**` |
25+
| Command type | Command |
26+
|--------------|---------|
27+
| Build | `npm run build` |
28+
| Test | `npm test` (runs API + unit per `package.json`) |
29+
| Lint | `npm run lint` |
3430

35-
## Commands
31+
## Where the documentation lives: skills
3632

37-
```bash
38-
npm install
39-
npm run build # clean + Babel + webpack targets
40-
npm run lint # eslint lib test
41-
npm run format # eslint --fix lib test
42-
npm run test:unit # Mocha unit suite + NYC (also runs lint via pretest)
43-
npm run test:typescript # Jest on test/typescript
44-
npm run test:sanity-test # Mocha live stack under test/sanity-check (long timeout)
45-
```
33+
| Skill | Path | What it covers |
34+
|-------|------|----------------|
35+
| **Development workflow** | [`skills/dev-workflow/SKILL.md`](skills/dev-workflow/SKILL.md) | npm scripts, Husky, CI |
36+
| **Marketplace SDK** | [`skills/marketplace-sdk/SKILL.md`](skills/marketplace-sdk/SKILL.md) | Public API in `lib/`, axios usage |
37+
| **JavaScript tooling** | [`skills/javascript/SKILL.md`](skills/javascript/SKILL.md) | Babel, Webpack targets, dual builds |
38+
| **Testing** | [`skills/testing/SKILL.md`](skills/testing/SKILL.md) | Mocha, NYC, Jest, fixtures |
39+
| **Code review** | [`skills/code-review/SKILL.md`](skills/code-review/SKILL.md) | PR checklist |
4640

47-
**CI (`.github/workflows/unit-test.yml`):** `npm ci` then `npm run test:unit:report:json`.
41+
## Using Cursor (optional)
4842

49-
> **`npm test` caveat:** `package.json` defines `"test": "npm run test:api && npm run test:unit"` but there is **no** `test:api` script. Use `npm run test:unit` (or fix the `test` script when adding `test:api`).
50-
51-
## Credentials and live tests
52-
53-
Sanity tests under `test/sanity-check/` use **dotenv** and env vars such as `HOST` / `DEFAULTHOST`, `ORG_UID`, `ADMIN_EMAIL`, `USER_EMAIL`, `EMAIL`, `PASSWORD`. They also read/write JSON fixtures (e.g. `loggedinAdmin.json`) via `test/sanity-check/utility/fileOperations/readwrite.js`. Do not commit real tokens; use `.env` locally (see `.gitignore`).
54-
55-
## Further reading for agents
56-
57-
- [Cursor rules index](.cursor/rules/README.md) — when each rule applies and how to reference it.
58-
- [Skills index](skills/README.md) — deeper checklists and SDK mental model.
43+
If you use **Cursor**, [`.cursor/rules/README.md`](.cursor/rules/README.md) only points to **`AGENTS.md`**—same docs as everyone else.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## [v1.5.1](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.5.0) (2026-03-23)
3+
## [v1.5.1](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.5.2) (2026-03-23)
44
- Fix snyk issues
55

66
## [v1.5.0](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.5.0) (2026-02-02)

0 commit comments

Comments
 (0)