Skip to content

Commit 1564374

Browse files
Updated rules as per new structure
1 parent feb36f1 commit 1564374

File tree

11 files changed

+78
-148
lines changed

11 files changed

+78
-148
lines changed

.cursor/rules/README.md

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,16 @@
11
# Cursor Rules — Contentstack Python CDA SDK
22

3-
Rules for **contentstack-python**: Python **Content Delivery API (CDA)** SDK (`pip` package **Contentstack**).
3+
This repository keeps **project guidance in [skills](../../skills/)** (one folder per topic, each with **`SKILL.md`**), not as separate rule files under `.cursor/rules/`.
44

5-
## Rules overview
5+
## Where to look
66

7-
| Rule | Role |
8-
|------|------|
9-
| [`dev-workflow.md`](dev-workflow.md) | Branch/PR, install, tests |
10-
| [`python.mdc`](python.mdc) | Python layout, `contentstack/`, `setup.py` |
11-
| [`contentstack-delivery-python.mdc`](contentstack-delivery-python.mdc) | **Stack**, queries, live preview, **HTTPSConnection** / **requests** |
12-
| [`testing.mdc`](testing.mdc) | **pytest** + **unittest** under `tests/` |
13-
| [`code-review.mdc`](code-review.mdc) | PR checklist (**always applied**) |
7+
| Topic | Skill |
8+
|-------|--------|
9+
| PR checklist, public API, semver | [`skills/code-review/SKILL.md`](../../skills/code-review/SKILL.md) |
10+
| Branch, install, tests, versioning | [`skills/dev-workflow/SKILL.md`](../../skills/dev-workflow/SKILL.md) |
11+
| **Stack**, queries, CDA features | [`skills/contentstack-utils/SKILL.md`](../../skills/contentstack-utils/SKILL.md) |
12+
| **requests**, retries, **HTTPSConnection** | [`skills/framework/SKILL.md`](../../skills/framework/SKILL.md) |
13+
| Python layout and package conventions | [`skills/python-style/SKILL.md`](../../skills/python-style/SKILL.md) |
14+
| **pytest**, **`tests/`**, **`config.py`** | [`skills/testing/SKILL.md`](../../skills/testing/SKILL.md) |
1415

15-
## Rule application
16-
17-
| Context | Typical rules |
18-
|---------|----------------|
19-
| **Every session** | `code-review.mdc` |
20-
| **Most files** | `dev-workflow.md` |
21-
| **`contentstack/`** | `python.mdc` + `contentstack-delivery-python.mdc` |
22-
| **`tests/**`** | `testing.mdc` |
23-
| **Packaging** | `python.mdc` |
24-
25-
## Quick reference
26-
27-
| File | `alwaysApply` | Globs (summary) |
28-
|------|---------------|-----------------|
29-
| `dev-workflow.md` | no | `**/*.py`, `requirements.txt`, `setup.py`, `tests/pytest.ini` |
30-
| `python.mdc` | no | `contentstack/**/*.py`, `setup.py` |
31-
| `contentstack-delivery-python.mdc` | no | `contentstack/**/*.py` |
32-
| `testing.mdc` | no | `tests/**/*.py`, `tests/pytest.ini` |
33-
| `code-review.mdc` | **yes** ||
34-
35-
## Skills
36-
37-
- [`skills/README.md`](../../skills/README.md) · [`AGENTS.md`](../../AGENTS.md)
16+
**Index:** [`skills/README.md`](../../skills/README.md) · [`AGENTS.md`](../../AGENTS.md)

.cursor/rules/code-review.mdc

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

.cursor/rules/testing.mdc

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

skills/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
| Skill | When to use |
44
|-------|-------------|
55
| [`code-review/`](code-review/SKILL.md) | PR review, semver, public API on **Stack** |
6-
| [`testing/`](testing/SKILL.md) | **pytest** + **`tests/`** + **`config.py`** |
7-
| [`contentstack-delivery-python/`](contentstack-delivery-python/SKILL.md) | **Stack**, queries, entries, assets, live preview |
6+
| [`contentstack-utils/`](contentstack-utils/SKILL.md) | **Stack**, queries, entries, assets, live preview, CDA behavior |
7+
| [`dev-workflow/`](dev-workflow/SKILL.md) | Branch/PR, install, tests, **config.py**, versioning |
88
| [`framework/`](framework/SKILL.md) | **requests**, **HTTPSConnection**, retries |
9+
| [`python-style/`](python-style/SKILL.md) | **`contentstack/`** layout, **setup.py**, Python conventions |
10+
| [`testing/`](testing/SKILL.md) | **pytest** + **`tests/`** + **`config.py`** |
911

10-
**Overview:** [`AGENTS.md`](../AGENTS.md) · **Rules:** [`.cursor/rules/README.md`](../.cursor/rules/README.md)
12+
**Overview:** [`AGENTS.md`](../AGENTS.md) · **Cursor rules index:** [`.cursor/rules/README.md`](../.cursor/rules/README.md)

skills/code-review/SKILL.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,28 @@ description: PR review for Contentstack Python CDA SDK — public API, Stack, HT
1313
- [ ] **Tests:** **`pytest tests/`** passes; extend **`tests/`** when CDA behavior changes.
1414
- [ ] **Secrets:** No tokens in repo; **`config.py`** remains local-only when it holds real credentials.
1515

16+
## Public API
17+
18+
- **Exported** **`Stack`**, **ContentType**, **Query**, asset/entry helpers match **README** and consumer expectations; **`contentstack/__init__.py`** **`__all__`** stays accurate when exports change.
19+
- **Docstrings** on **`Stack`** and key public methods when behavior or options change.
20+
21+
## Compatibility
22+
23+
- Avoid breaking **`Stack.__init__`** signatures or method chains without a semver strategy; document migration for breaking changes (**`setup.py`** / **`__version__`**).
24+
25+
## HTTP / dependencies
26+
27+
- Changes to **`requests`**, **retry** behavior, or **`HTTPSConnection`** should stay consistent with **`contentstack/controller.py`** and **`urllib3`** **`Retry`** usage in **`stack.py`**.
28+
29+
## Tests
30+
31+
- **Tests** hit the live CDA when using **`config`** credentials; extend **`tests/`** when request/response behavior changes. Do not commit new secrets.
32+
33+
## Security
34+
35+
- No hardcoded tokens in source or docs; no logging of **api keys**, **delivery tokens**, **preview**, or **management** tokens.
36+
1637
## References
1738

18-
- `.cursor/rules/code-review.mdc`
19-
- `.cursor/rules/dev-workflow.md`
39+
- [`dev-workflow/SKILL.md`](../dev-workflow/SKILL.md)
40+
- [`python-style/SKILL.md`](../python-style/SKILL.md)

skills/contentstack-delivery-python/SKILL.md

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

.cursor/rules/contentstack-delivery-python.mdc renamed to skills/contentstack-utils/SKILL.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
description: "CDA Delivery SDK — Stack, queries, live preview, requests session"
3-
globs: ["contentstack/**/*.py"]
4-
alwaysApply: false
2+
name: contentstack-utils
3+
description: Contentstack Python CDA SDK — Stack, queries, entries, assets, live preview, taxonomy, HTTP session.
54
---
65

76
# Contentstack Python Delivery SDK (`contentstack/`)
@@ -26,6 +25,19 @@ alwaysApply: false
2625

2726
- **`https_connection.py`****`requests.Session`**, **`HTTPAdapter`**, **`get_request`** from **`controller.py`**; user-agent uses **`contentstack.__title__`** / **`__version__`**.
2827

28+
## Extending
29+
30+
- Add query or stack methods consistent with [CDA query parameters](https://www.contentstack.com/docs/developers/apis/content-delivery-api/).
31+
- Keep transport logic in **`HTTPSConnection`** / **`controller`** rather than duplicating **`requests`** setup.
32+
33+
## Dependencies
34+
35+
- **`requests`**, **`urllib3`** (**Retry**), **`python-dateutil`**
36+
37+
## Related skills
38+
39+
- [`framework/SKILL.md`](../framework/SKILL.md) — retries, **`HTTPAdapter`**, timeouts
40+
2941
## Docs
3042

3143
- [Content Delivery API](https://www.contentstack.com/docs/developers/apis/content-delivery-api/)
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
description: "Branches, install, and tests for contentstack-python"
3-
globs: ["**/*.py", "requirements.txt", "setup.py", "tests/pytest.ini"]
4-
alwaysApply: false
2+
name: dev-workflow
3+
description: Branches, install, tests, and versioning for contentstack-python.
54
---
65

76
# Development workflow — Contentstack Python CDA SDK
@@ -16,6 +15,6 @@ alwaysApply: false
1615

1716
- Bump **`contentstack/__init__.py`** **`__version__`** and **`setup.py`**-driven releases per semver for user-visible SDK changes.
1817

19-
## Links
18+
## References
2019

21-
- [`AGENTS.md`](../../AGENTS.md) · [`skills/contentstack-delivery-python/SKILL.md`](../../skills/contentstack-delivery-python/SKILL.md)
20+
- [`AGENTS.md`](../../AGENTS.md) · [`contentstack-utils/SKILL.md`](../contentstack-utils/SKILL.md)

skills/framework/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ description: HTTP layer for the Python CDA SDK — requests Session, urllib3 ret
1919

2020
- **Integration** — full stack via **`tests/`** and **`config`**; **unit-style** assertions on URL building and headers where tests exist.
2121

22-
## Rule shortcut
22+
## Related skills
2323

24-
- `.cursor/rules/contentstack-delivery-python.mdc`
24+
- [`contentstack-utils/SKILL.md`](../contentstack-utils/SKILL.md)
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
---
2-
description: "Python conventions for the CDA SDK package and packaging"
3-
globs:
4-
- "contentstack/**/*.py"
5-
- "setup.py"
6-
alwaysApply: false
2+
name: python-style
3+
description: Python layout, packaging, and conventions for the Contentstack CDA SDK package.
74
---
85

9-
# Python — Contentstack CDA SDK
6+
# Python style — Contentstack CDA SDK
107

118
## Layout
129

0 commit comments

Comments
 (0)