Skip to content

Commit c5d2ffc

Browse files
committed
update: updated the format
1 parent d719964 commit c5d2ffc

File tree

20 files changed

+174
-206
lines changed

20 files changed

+174
-206
lines changed

.cursor/rules/README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
# Cursor rules (contentstack-cli-content-type)
1+
# Cursor (optional)
22

3-
Rules are `.mdc` files under `.cursor/rules/`. For each rule here, **`alwaysApply` is `false`**: Cursor applies it when files matching **`globs`** are in context (open or relevant to the task).
3+
**Cursor** users: start at **[AGENTS.md](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**.
44

5-
| Rule file | Globs | Purpose | Related skill |
6-
|-----------|--------|---------|----------------|
7-
| [dev-workflow.mdc](dev-workflow.mdc) | `src/**/*.ts`, `tests/**/*.ts`, `package.json`, `jest.config.js` | Run `npm test` / ESLint / `test:coverage` before PR; oclif docs when commands change | [AGENTS.md](../../AGENTS.md), [.cursor/skills/testing/SKILL.md](../skills/testing/SKILL.md) |
8-
| [content-type-plugin.mdc](content-type-plugin.mdc) | `src/commands/**`, `src/core/**`, `src/utils/**`, `src/types/**`, `src/config/**` | OCLIF commands, `ContentTypeCommand`, utils/types/config, Management SDK + axios client, no secret logging, `oclif readme` when commands change | [.cursor/skills/contentstack-cli-content-type/SKILL.md](../skills/contentstack-cli-content-type/SKILL.md) |
9-
| [testing.mdc](testing.mdc) | `tests/**/*.ts`, `jest.config.js` | Jest + ts-jest, mock boundaries, `npm test` / posttest ESLint | [.cursor/skills/testing/SKILL.md](../skills/testing/SKILL.md) |
10-
| [review.mdc](review.mdc) | `compare.ts`, `diagram.ts`, `src/core/contentstack/**`, `package.json` | Security and PR review highlights for high-risk paths and dependency changes | [.cursor/skills/review/SKILL.md](../skills/review/SKILL.md) |
11-
| [typescript-build.mdc](typescript-build.mdc) | `tsconfig.json` | `strict`, `rootDir`/`outDir`, `tsc -b` / prepack alignment | [.cursor/skills/contentstack-cli-content-type/SKILL.md](../skills/contentstack-cli-content-type/SKILL.md) |
12-
| [eslint-config.mdc](eslint-config.mdc) | `.eslintrc` | oclif-typescript style, posttest eslint expectations ||
13-
| [oclif-docs.mdc](oclif-docs.mdc) | `README.md`, `oclif.manifest.json` | Regenerate command docs/manifest via `oclif readme` / `oclif manifest` after command changes | [.cursor/skills/contentstack-cli-content-type/SKILL.md](../skills/contentstack-cli-content-type/SKILL.md) |
14-
15-
See also [.cursor/skills/README.md](../skills/README.md) for the full skill index.
5+
This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs.

.cursor/rules/content-type-plugin.mdc

Lines changed: 0 additions & 22 deletions
This file was deleted.

.cursor/rules/dev-workflow.mdc

Lines changed: 0 additions & 18 deletions
This file was deleted.

.cursor/rules/eslint-config.mdc

Lines changed: 0 additions & 12 deletions
This file was deleted.

.cursor/rules/oclif-docs.mdc

Lines changed: 0 additions & 15 deletions
This file was deleted.

.cursor/rules/review.mdc

Lines changed: 0 additions & 18 deletions
This file was deleted.

.cursor/rules/testing.mdc

Lines changed: 0 additions & 16 deletions
This file was deleted.

.cursor/rules/typescript-build.mdc

Lines changed: 0 additions & 14 deletions
This file was deleted.

.cursor/skills/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

AGENTS.md

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,51 @@
1-
# contentstack-cli-content-type
1+
# contentstack-cli-content-type – Agent guide
22

3-
TypeScript npm package: a **Contentstack CLI** (`csdx`) plugin that reads Content Type metadata from a stack—list, field details, audit log lines, same-stack or cross-stack comparison, and stack content-model diagrams. It does not perform bulk mutations on entries or assets.
3+
**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**.
44

5-
## Stack
5+
## What this repo is
66

7-
- **Language**: TypeScript (`strict` in [tsconfig.json](tsconfig.json))
8-
- **CLI**: oclif; commands under `src/commands/content-type/`
9-
- **Tests**: Jest + ts-jest; tests under `tests/` (see [jest.config.js](jest.config.js))
10-
- **Core logic**: `src/core/content-type/`, shared command base in `src/core/command.ts`, HTTP in `src/core/contentstack/`
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. |
1112

12-
## Scripts
13+
## Tech stack (at a glance)
1314

14-
| Script | Purpose |
15-
|--------|---------|
16-
| `npm test` | Run Jest |
17-
| `npm run posttest` | ESLint on `.ts` files (see [package.json](package.json)) |
18-
| `npm run test:coverage` | Jest with coverage; terminal summary plus **HTML** report at `coverage/lcov-report/index.html` (see [jest.config.js](jest.config.js)) |
19-
| `npm run prepack` | `tsc -b`, `oclif manifest`, `oclif readme` — run when commands, flags, or descriptions change |
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 |
2022

21-
## Workflow
23+
## Commands (quick reference)
2224

23-
- Prefer adding or updating tests for behavioral changes in `src/core/` and `src/utils/`.
24-
- Do not commit `test.only` / `test.skip` (or `describe.only` / `it.only`).
25-
- After changing command IDs, flags, or help text, regenerate CLI docs so `README.md` and `oclif.manifest.json` stay aligned (see `prepack` / `version` in [package.json](package.json)).
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`) |
2631

27-
## Coverage
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.
2833

29-
- **Target**: **80%** minimum on statements, branches, functions, and lines.
30-
- **Enforcement**: [jest.config.js](jest.config.js) sets **global** `coverageThreshold` at **80%** for all four metrics. Run `npm run test:coverage` so thresholds apply.
31-
- **HTML report**: after `npm run test:coverage`, open `coverage/lcov-report/index.html` in a browser. The `coverage/` directory is gitignored.
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).
3244

3345
## Security
3446

3547
See [SECURITY.md](SECURITY.md) for reporting issues.
3648

37-
## Cursor: rules and skills
38-
39-
- **Rules index**: [.cursor/rules/README.md](.cursor/rules/README.md) — context-specific `.mdc` rules.
40-
- **Skills index**: [.cursor/skills/README.md](.cursor/skills/README.md)`ContentTypeCommand`, CMA client, testing, PR review.
49+
## Using Cursor (optional)
4150

42-
For detailed plugin architecture and commands, start with [.cursor/skills/contentstack-cli-content-type/SKILL.md](.cursor/skills/contentstack-cli-content-type/SKILL.md).
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

Comments
 (0)