Contribution Guide
Start with the product contract
Before you edit code, identify the contract that changes. ArchLex publishes language syntax, TypeScript APIs, provider catalogs, diagnostic codes, SVG behavior, playground workflows, MCP tools, and documentation. Update the code, tests, and matching docs in one change.
Run pnpm install with Node.js 22 or later. Use pnpm check for the full build,
typecheck, test, and lint pipeline.
Provider map
All provider packages use the same core structure.
| Concern | AWS | Cloudflare | Google Cloud | Kubernetes |
|---|---|---|---|---|
| Package | packages/aws | packages/cloudflare | packages/gcp | packages/k8s |
| Provider ID | aws | cloudflare | gcp | k8s |
| Factory | awsProvider() | cloudflareProvider() | gcpProvider() | k8sProvider() |
| Diagnostic prefix | AWS- | CLOUDFLARE- | GCP- | K8S- |
| Example resource | lambda | workers | cloud-run | deployment |
| Main scopes | account, region, VPC, subnet | root, account, group | account, region, VPC, subnet | cluster, namespace |
Each provider keeps catalog definitions in src/catalog/, rule modules in
src/rules/, diagnostic constants in src/registry.ts, and public exports in
src/index.ts. Provider packages also keep icon definitions under src/icons/
and official source files under assets/official/ when licensing permits local
bundling.
Add a catalog resource
- Add the resource through the package
defineServicehelper. - Choose a stable canonical ID and unique aliases.
- Set the shared category, display name, icon key, and allowed containment.
- Add bundled artwork or a CDN path mapping.
- Add catalog, alias, containment, and icon tests.
- Run
pnpm validate:catalog.
Use provider-qualified aliases consistently:
// AWS
aliases: ["aws.lambda", "function"];
// Google Cloud
aliases: ["gcp.cloud-run"];
// Kubernetes
aliases: ["k8s.deployment", "deploy"];
// Cloudflare
aliases: ["cloudflare.workers"];Do not reuse an existing canonical ID or alias within one provider. Keep canonical IDs stable within a major version. Add a deprecated alias when you need to preserve an old spelling.
Add or update icons
Provider imports convert upstream artwork into deterministic sanitized
fragments. Do not edit src/icons/generated.ts by hand.
pnpm --filter @archlex/aws icons:generate
pnpm --filter @archlex/gcp icons:generate
pnpm --filter @archlex/k8s icons:generate
pnpm --filter @archlex/cloudflare icons:generateRun the matching icons:check command before you commit generated artwork.
Keep CDN definitions pure. They may declare a pinned base URL, host allowlist,
release ID, mappings, response limits, and attribution. They must not register a
loader or start a request during import.
AWS and Google Cloud importers account for their upstream file conventions.
The Kubernetes importer uses the pinned kubernetes/community icon set and
prefers unlabeled resource artwork. Cloudflare bundles sanitized official
artwork and does not register a CDN adapter.
Add a semantic rule
- Register a stable code in
src/registry.ts. - Implement the rule with the package
defineRulehelper. - Export the rule from
src/rules/index.ts. - Include it in the provider validation pass.
- Test
normal,strict, andoffmodes. - Update the matching provider semantics page.
- Run
pnpm generate-docswhen the shared diagnostic registry or templates change.
Use the provider prefix and a descriptive domain:
AWS-RDS-PROXY-NETWORK-001
GCP-DATA-CLOUD-SQL-NETWORK-001
K8S-NETWORKING-SERVICE-TARGET-001
CLOUDFLARE-CONTAINMENT-001Rules may use only facts present in CloudGraph. Do not infer IAM policies,
firewall contents, Kubernetes selectors, storage provisioning, or runtime state
unless the language models that information.
Add a provider
- Create
packages/<provider>with catalog, icons, rules, registry, and public factory modules. - Implement
CloudProviderfrom@archlex/model. - Add the package to core dependencies and re-export its factory.
- Register the package in CLI, playground, MCP, scripts, TypeScript references, and test aliases.
- Add a pure
CdnProviderDefinitionwhen the provider offers suitable artwork. - Extend parser and model scope unions only when the provider needs a reusable scope that the language does not support.
- Add provider, integration, browser, and boundary tests.
- Add a provider semantics page and update every provider list.
Kubernetes demonstrates a provider that introduced reusable cluster and
namespace scopes. A provider that reuses existing scopes does not need parser
changes.
Test the affected surface
Run focused checks while you work:
pnpm --filter @archlex/core test
pnpm --filter @archlex/aws test
pnpm --filter @archlex/gcp test
pnpm --filter @archlex/k8s test
pnpm --filter @archlex/cloudflare test
pnpm validate:catalogRun pnpm test:browser when you change playground interaction, SVG behavior,
responsive layout, or CDN routing. Inject fixture-backed fetchFn
implementations in automated icon tests. Do not make unit tests depend on a
public CDN.
Add a changeset
Run pnpm changeset when you modify a published package under packages/.
Describe the reader-visible effect and choose the release level that matches the
public contract. Private packages are not published, so changes that only touch
them do not require a changeset.
.changeset/config.json versions private workspace packages and leaves them
unpublished and untagged (privatePackages.version: true,
privatePackages.tag: false). Published @archlex/icons depends on private
@archlex/icons-node. Changesets 3 treats an unversioned private package as
skipped, and changeset publish then rejects that dependency.
Dependabot pull requests that change dependencies or peerDependencies of a
published package are handled by .github/workflows/dependabot-changeset.yml.
That workflow commits one patch changeset for those packages. Bumps that only
touch devDependencies do not get a changeset, and the Require changeset check
ignores those edits. Release pull requests titled chore: release packages
skip that check. PAT_TOKEN must be saved as a Dependabot secret, not only as
an Actions secret, so the workflow can push to the Dependabot branch and CI
can re-run.
Keep documentation current
Update the relevant docs/ page in the same change as product behavior. The
docs app publishes these Markdown files through symlinks, and the MCP build
embeds them as documentation resources.
Do not edit generated diagnostic pages under docs/errors/AL-*.md or
docs/errors/index.md. Change the registry or generator, then run:
pnpm generate-docs
pnpm build:docs
pnpm verify:sitesReview AGENTS.md for repository-wide requirements.