|
| 1 | +# Contentstack Dart SDK – 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-dart](https://github.com/contentstack/contentstack-dart) | |
| 10 | +| *Purpose:* | Official Dart package for Contentstack’s **Content Delivery API (CDA)**—fetch and query published content (entries, assets, content types), live preview, sync, and image transforms. | |
| 11 | +| *Out of scope (if any):* | Not the Management API, not a Flutter UI kit, and not a standalone HTTP server—this is a client library built on the `http` package. | |
| 12 | + |
| 13 | +## Tech stack (at a glance) |
| 14 | + |
| 15 | +| Area | Details | |
| 16 | +| --- | --- | |
| 17 | +| Language | Dart SDK `>=2.12.0 <4.0.0` (`environment` in `pubspec.yaml`) | |
| 18 | +| Build | `dart pub get`; JSON models use `json_serializable`—regenerate with `dart run build_runner build --delete-conflicting-outputs` when `*.dart` parts change (`pubspec.yaml`, `analysis_options.yaml` excludes `*.g.dart`) | |
| 19 | +| Tests | `package:test`; tests under `test/*.dart` (see `test/run_test.sh` for optional coverage steps) | |
| 20 | +| Lint / coverage | Analyzer + linter rules in `analysis_options.yaml` (`flutter_lints`-aligned custom rule set); coverage via `dart test --coverage=./coverage` and tooling described in `test/run_test.sh` | |
| 21 | +| Other | Runtime deps: `http`, `json_annotation`, `logger`, `path`, `dotenv`, `file`; API docs generated with `dartdoc` (dev dependency) | |
| 22 | + |
| 23 | +## Commands (quick reference) |
| 24 | + |
| 25 | +| Command Type | Command | |
| 26 | +| --- | --- | |
| 27 | +| Build | `dart pub get` | |
| 28 | +| Codegen (when models / `part` files change) | `dart run build_runner build --delete-conflicting-outputs` | |
| 29 | +| Test | `dart test` | |
| 30 | +| Lint | `dart analyze` | |
| 31 | +| Format (optional) | `dart format .` | |
| 32 | + |
| 33 | +**CI / automation:** workflows under [.github/workflows/](.github/workflows/) (e.g. branch checks, publish to pub.dev on version tags, policy scan, Jira integration). |
| 34 | + |
| 35 | +## Where the documentation lives: skills |
| 36 | + |
| 37 | +| Skill | Path | What it covers | |
| 38 | +| --- | --- | --- | |
| 39 | +| Dev workflow | [skills/dev-workflow/SKILL.md](skills/dev-workflow/SKILL.md) | Branches, PR expectations, local commands, optional codegen | |
| 40 | +| Contentstack Dart SDK (API) | [skills/contentstack-dart-sdk/SKILL.md](skills/contentstack-dart-sdk/SKILL.md) | Public surface, `Stack`/queries, errors, integration boundaries | |
| 41 | +| Dart style & layout | [skills/dart-style/SKILL.md](skills/dart-style/SKILL.md) | Package layout, imports, analyzer conventions | |
| 42 | +| Testing | [skills/testing/SKILL.md](skills/testing/SKILL.md) | Test layout, env/credentials, coverage notes | |
| 43 | +| Code review | [skills/code-review/SKILL.md](skills/code-review/SKILL.md) | PR checklist and severity hints | |
| 44 | +| Runtime & HTTP | [skills/runtime-and-http/SKILL.md](skills/runtime-and-http/SKILL.md) | HTTP client usage, env config, logging, packaging | |
| 45 | + |
| 46 | +An index with “when to use” hints is in [skills/README.md](skills/README.md). |
| 47 | + |
| 48 | +## Using Cursor (optional) |
| 49 | + |
| 50 | +If you use *Cursor*, [.cursor/rules/README.md](.cursor/rules/README.md) only points to *AGENTS.md*—same docs as everyone else. |
0 commit comments