|
| 1 | +# contentstack-cli-content-type – Agent guide |
| 2 | + |
| 3 | +**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**. |
| 4 | + |
| 5 | +## What this repo is |
| 6 | + |
| 7 | +| Field | Detail | |
| 8 | +|-------|--------| |
| 9 | +| **Name:** | [contentstack/contentstack-cli-content-type](https://github.com/contentstack/contentstack-cli-content-type) (`contentstack-cli-content-type` on npm) | |
| 10 | +| **Purpose:** | Contentstack CLI (`csdx`) plugin that reads Content Type metadata from a stack: list, details, audit logs, same-stack or cross-stack JSON compare (HTML diff), and stack content-model diagrams. | |
| 11 | +| **Out of scope (if any):** | Bulk entry/asset mutations, Delivery API consumption, and unrelated HTTP clients—this package focuses on content-type introspection via the Management API patterns documented in the plugin skill. | |
| 12 | + |
| 13 | +## Tech stack (at a glance) |
| 14 | + |
| 15 | +| Area | Details | |
| 16 | +|------|---------| |
| 17 | +| Language | TypeScript, **`strict`** ([tsconfig.json](tsconfig.json)), target ES2017, CommonJS | |
| 18 | +| Build | `tsc -b`; output **`lib/`**; **`npm run prepack`** runs compile + `oclif manifest` + `oclif readme` | |
| 19 | +| Tests | Jest + ts-jest; tests under **`tests/`** ([jest.config.js](jest.config.js)) | |
| 20 | +| Lint / coverage | ESLint via **`npm run posttest`** ([.eslintrc](.eslintrc)); Jest coverage **`npm run test:coverage`**, global thresholds in [jest.config.js](jest.config.js) | |
| 21 | +| CLI / runtime | oclif; Node engines per [package.json](package.json); `bin` is `csdx` when installed as a CLI plugin | |
| 22 | + |
| 23 | +## Commands (quick reference) |
| 24 | + |
| 25 | +| Command type | Command | |
| 26 | +|--------------|---------| |
| 27 | +| Build (publishable) | `npm run prepack` | |
| 28 | +| Test | `npm test` | |
| 29 | +| Test + coverage | `npm run test:coverage` | |
| 30 | +| Lint | `npm run posttest` (or `eslint . --ext .ts --config .eslintrc`) | |
| 31 | + |
| 32 | +CI: [.github/workflows](.github/workflows) includes policy/SCA/release/issue automation—there is no single `ci.yml` that only runs `npm test`; follow team merge requirements. |
| 33 | + |
| 34 | +## Where the documentation lives: skills |
| 35 | + |
| 36 | +| Skill | Path | What it covers | |
| 37 | +|-------|------|----------------| |
| 38 | +| Dev workflow | [skills/dev-workflow/SKILL.md](skills/dev-workflow/SKILL.md) | Scripts, `tsconfig`, ESLint, Jest/coverage, oclif README/manifest, PR checks | |
| 39 | +| Content Type plugin | [skills/contentstack-cli-content-type/SKILL.md](skills/contentstack-cli-content-type/SKILL.md) | `ContentTypeCommand`, CMA vs SDK, auth, commands, compare/diagram | |
| 40 | +| Testing | [skills/testing/SKILL.md](skills/testing/SKILL.md) | Jest layout, mocks, conventions, coverage | |
| 41 | +| Code review | [skills/code-review/SKILL.md](skills/code-review/SKILL.md) | PR checklist, security and dependency review | |
| 42 | + |
| 43 | +An index with “when to use” hints is in [skills/README.md](skills/README.md). |
| 44 | + |
| 45 | +## Security |
| 46 | + |
| 47 | +See [SECURITY.md](SECURITY.md) for reporting issues. |
| 48 | + |
| 49 | +## Using Cursor (optional) |
| 50 | + |
| 51 | +If you use **Cursor**, [.cursor/rules/README.md](.cursor/rules/README.md) only points to **[AGENTS.md](AGENTS.md)**—same docs as everyone else. |
0 commit comments