Provides address handling for Orchard Core: per-country formats, validation, autocomplete via Google Places, and integration with commerce modules like checkout, shipping, and taxation.
Ships in crestapps-orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Addresses (new in CrestApps.OrchardCore 3.0) gives the platform one address structure for every country. Each country's rules decide which parts it has, which are required, and how it is checked and printed. The data is a snapshot of Google's address data (CC BY 4.0) inside the package; a site never calls Google for formats.
| Module | Relationship |
|---|---|
Shipping (orchardcore-shipping) | Requires Addresses; zones and rates use Address |
Customers (orchardcore-customers) | Address book edited with the address editor |
Checkout and Orders (orchardcore-checkout, orchardcore-orders) | Contact and shipping steps, immutable order copies, printed with IAddressFormatter |
Taxation (orchardcore-taxation) | Jurisdictions match region codes; country lists come from ICountryService |
CrestApps Content Fields (orchardcore-crestapps-content-fields) | Address Field (CrestApps.OrchardCore.ContentFields.Address) on any content type |
Addresses depends on nothing and can be used outside commerce.
| Feature ID | Name | Depends on |
|---|---|---|
CrestApps.OrchardCore.Addresses | Addresses | none |
CrestApps.OrchardCore.Addresses.Countries | Address Countries | Addresses, OrchardCore.Contents, OrchardCore.ContentFields, OrchardCore.Title |
CrestApps.OrchardCore.Addresses.GooglePlaces | Address Suggestions (Google Places) | Addresses |
CrestApps.OrchardCore.Addresses in the web/startup project.Address values, never free-text address strings, and keep a copy (Clone()) on records that must not change.CA, 13, D) so tax jurisdictions match; IAddressValidator tidies names into codes.IAddressEditorService.ValidateAsync and keep the returned Address.OrchardCore.RateLimits wherever a paid suggestion provider is set up.{ "steps": [...] }.sealed modifier, except View Models.{
"steps": [
{
"name": "Feature",
"enable": [
"CrestApps.OrchardCore.Addresses",
"CrestApps.OrchardCore.Addresses.Countries",
"CrestApps.OrchardCore.Addresses.GooglePlaces",
"OrchardCore.RateLimits"
],
"disable": []
}
]
}
Address (CrestApps.OrchardCore.Addresses.Models, in CrestApps.OrchardCore.Addresses.Abstractions) is immutable with init-only parts: Name, Company, AddressLine1, AddressLine2, DependentLocality, City, Region, PostalCode, SortingCode, Country (ISO alpha-2), County, District (for tax) and Phone. It also carries optional coordinates, Latitude, Longitude, GeocodedUtc and GeocodeSource (a geocoding provider's name, or Manual when pinned on a map), which Clone() copies. AddressComparison.IsSameAddress(left, right) compares the street lines, city, region, postal code and country, trimmed and case-insensitively.
var address = new Address
{
Name = "Avery Brooks",
AddressLine1 = "1 Main Street",
City = "Springfield",
Region = "IL",
PostalCode = "62701",
Country = "US",
};
These shared building blocks live in CrestApps.OrchardCore.Addresses.Abstractions so modules stop declaring their own copies:
ContactInfo (record): Name, Email, Phone (a PhoneNumber in E.164 form) and Address, plus HasAnyValue. New records that keep a contact snapshot keep a ContactInfo. ContactInfo.From(name, email, phone, address) builds one from text, keeping the phone only when it is already E.164. Records that predate it (orders, returns, transactions, subscriptions, receipts, the checkout contact and others) keep their own fields, because moving them would need a data migration.NamedAddress (record): Id, Name, Address, for listing places such as a store's locations.IShippingAddressBook (CrestApps.OrchardCore.Addresses.Services): GetAsync(userId) returns a ShippingAddressBook (Addresses of ShippingAddressBookEntry, DefaultShippingAddressId, DefaultBillingAddressId, MaxAddresses, CanAdd), and AddAsync(userId, address) saves one. Customers implements it (CustomerShippingAddressBook); Shipping reads it in its checkout step, so it does not depend on Customers.Normalize a phone typed into a form with PhoneNumberNormalization.ToE164OrTrimmed(text, phoneNumberService, country) (PhoneNumbers.Abstractions); see orchardcore-phone-numbers.
Registered with services.AddAddressesCore() (the Addresses feature does this):
| Service | Use |
|---|---|
IAddressFormatProvider.GetFormatAsync(countryCode) | AddressFormat: Layout (and LatinLayout), Required, Uppercase, PostalCodePattern, PostalCodeExamples, labels (RegionLabel, PostalCodeLabel), Regions; FindRegion by code, key or name. Unknown countries get a generic format. |
IAddressValidator.ValidateAsync(address) | AddressValidationResult with Problems (AddressProblem(Component, Kind), kinds Missing, Invalid, Unknown, NotInRegion), IsValid, and the tidied Address |
IAddressFormatter.GetLinesAsync(address, options) | Lines in the country's order; AddressFormatOptions.Envelope capitalizes as the post wants, IncludeCountry adds the country name |
public sealed class WarehouseAddressService
{
private readonly IAddressValidator _validator;
private readonly IAddressFormatter _formatter;
public WarehouseAddressService(IAddressValidator validator, IAddressFormatter formatter)
{
_validator = validator;
_formatter = formatter;
}
public async Task<IReadOnlyList<string>> GetLabelLinesAsync(Address address)
{
var result = await _validator.ValidateAsync(address);
if (!result.IsValid)
{
return [];
}
return await _formatter.GetLinesAsync(result.Address, new AddressFormatOptions { Envelope = true });
}
}
Validation checks the form of an address, not that the place exists.
Every address form (address book, admin, checkout, Address Field) uses the AddressEditor shape: country first, then fields in the country's order with its labels, required marks and region list. IAddressEditorService (CrestApps.OrchardCore.Addresses.Core.Editing):
| Method | Use |
|---|---|
BuildAsync(address, options) | Editor model for an address or a new one |
PopulateAsync(model, options) | Lay a posted model out again for its country |
ValidateAsync(model, modelState, prefix, options) | Add problems to ModelState under prefix, in the visitor's language; returns the tidied address |
GetLayoutAsync(countryCode) | The AddressEditorLayout |
AddressEditorOptions: ShowName, RequireName, ShowCompany, ShowPhone, Countries (all the site serves when null), DefaultCountry.
// GET
var editor = await _addressEditor.BuildAsync(customerAddress, options);
model.AddressEditor = await _shapeFactory.CreateAddressEditorAsync(editor, prefix: "Address");
// POST
var posted = new AddressEditorViewModel();
await TryUpdateModelAsync(posted, "Address");
var result = await _addressEditor.ValidateAsync(posted, ModelState, "Address", options);
A display driver can return Initialize<AddressEditorViewModel>("AddressEditor", ...) with its own prefix. CreateAddressDisplayAsync(address) gives the AddressDisplay shape. When the country changes, the editor script fetches ~/addresses/formats/{countryCode} (anonymous, cached an hour); without script the server re-lays the form on post. AddressEditorViewModel.HasAnyValue() tells a blank optional address from one started; AddressEditorViewModel.From(address) copies a stored Address into an editor model (null for none) and ToAddress() turns a posted model back into an Address, for editors that bind the view model directly.
ICountryService.GetCountriesAsync() returns the ISO list from the .NET runtime, or with Address Countries on, the published Country content items (seeded from the ISO list, unique codes in CountryPart's Code field, CountryIndex: one row per Country content item, declared .ExclusiveToDocumentType().SingleRecordPerDocument()), falling back to ISO while there are none. Read and write the code with GetCountryCode() and SetCountryCode(); CountryCodeUtility normalizes codes. Managed countries decide which countries are offered and their names, not how addresses are written. Taxation stores codes, so toggling either feature never orphans tax data.
public interface IAddressAutocompleteProvider
{
Task<bool> IsAvailableAsync(CancellationToken cancellationToken = default);
Task<IReadOnlyList<AddressSuggestion>> SuggestAsync(AddressSuggestionRequest request, CancellationToken cancellationToken = default);
Task<Address> ResolveAsync(string suggestionId, string sessionToken, CancellationToken cancellationToken = default);
}
Register your provider as a scoped IAddressAutocompleteProvider in your own feature; the first that IsAvailableAsync answers. It runs only on the server, so keys never reach the browser. AddressSuggestionRequest has Text, Country, SessionToken and Language.
| Endpoint | Answers |
|---|---|
GET addresses/suggest?q=&country=&session= | [{ "id", "text" }]; q under 3 or over 120 characters answers [] |
GET addresses/resolve?id=&session= | The address parts, or 404 |
Both answer 404 with no provider and 429 over the limit. They are in the address-autocomplete rate-limit group (AddressConstants.AutocompleteRateLimitGroup); with OrchardCore.RateLimits on, a built-in limit allows 60 calls a minute per visitor IP, and a Group policy can add stricter limits (see orchardcore-rate-limits). Behind a proxy, enable Orchard Core's Reverse Proxy Configuration. The editor shows suggestions only when data-suggest-url is set, which happens only when a provider is available.
GooglePlacesAddressAutocompleteProvider calls the Places API (New) with the named HttpClient GooglePlaces (5-second timeout). The key is set under Settings > Address Suggestions (group address-suggestions, permission ManageAddressSuggestions) and kept protected in GooglePlacesSettings.ApiKey (purpose CrestApps.OrchardCore.Addresses.GooglePlaces.ApiKey); it is never shown again, a blank field keeps it, and Remove the key clears it. Restrict the key to the Places API (New). Errors and timeouts are logged and give no suggestions.
| Permission | Allows | Default roles |
|---|---|---|
ManageAddressSuggestions | Settings > Address Suggestions | Administrator |
What SKILL.md sets; muted values are Claude Code's defaults
/crestapps-orchardcore:orchardcore-addressesfrom crestapps-orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-orchardcore137 skills in this plugin
/orchardcore-accountsSkill for the CrestApps Orchard Core Accounts module (CrestApps.OrchardCore.Accounts) with its Account Members, Account Team, Account E-mail Domains and Account Locations features. Covers the Account type and AccountPart, the account picker and search, IAccountChildTypeRule, account page sections (AccountPageTabs, AddPageSection, Notes), members and IAccountMemberService, account invitations, the account owner and team picked from staff, e-mail domains, locations with a billing location, the account's billing profile and party members, the Accounts recipe and deployment steps, and the admin menu. Use this skill when requests mention accounts, the businesses or households records belong to, an account page tab, members, invitations, owners, domains or locations. Strong matches include AccountPart, AccountPageTabs, IAccountMemberService, IAccountInvitationService, AccountInvitation, AccountTeamPart, AccountEmailDomainsPart, IAccountEmailDomains, AccountLocationsPart and ManageAccountMembers./orchardcore-accounts-b2bSkill for the CrestApps Orchard Core Accounts B2B module (CrestApps.OrchardCore.Accounts.B2B), business selling on an Account content item. Covers B2BAccountPart and B2BAccount, buyers as account members and ship-to addresses as account locations, terms (deposit, net days, credit limit) through the account-terms tender billed to the account, the account's billing profile, purchase order numbers, quotes, price lists through IBuyerPriceProvider, order limits, approvals and budgets, OCI punchout, the account/business page and API, the PriceLists recipe and deployment steps, the B2BAccounts report source, and the move from the removed Companies module. Use this skill when requests mention B2B, wholesale or business buyers, net terms, purchase orders, price lists, order approvals or punchout. Strong matches include B2BAccountPart, B2BAccount, AccountTerms, AccountTermsTenderProvider, B2BAccountBillingProfileSource, IB2BAccountStore, PriceList, B2BPriceProvider, B2BApprovalService and ManageB2BAccounts.Other plugins' skills for the same job