Skip to content

Package Documentation Standard

Capell package docs have two jobs: help a developer change the package safely, and help an owner understand why the package belongs in a Capell build. Keep both jobs visible.

Every package README should include these sections, in this order when practical:

SectionPurpose
Opening sentenceName the package and the workflow it improves.
At A GlanceComposer package, namespace, surfaces, service providers, dependencies.
Why It Helps Your Capell WorkflowConcrete business/editor/developer/operator value. This is product copy, but it must be grounded in code.
What It AddsUser-facing and runtime features the package owns.
Boundaries or Maintenance NotesWhat the package owns, what it does not own, and unsafe integration paths to avoid.
Runtime Surface or Code MapProviders, routes, commands, Actions, Data, models, settings, jobs, views, resources, and tests.
DocsLinks to all package docs and important neighboring docs.
Testing or VerificationSmallest useful package test command and any focused commands for risky areas.
TroubleshootingSymptom table for packages with install, queue, cache, external API, or public output failure modes.

Write from the reader’s job:

  • For owners: explain what capability this unlocks in a Capell site, dashboard, workflow, or package bundle.
  • For editors: explain what becomes easier to create, approve, reuse, publish, inspect, or recover.
  • For developers: explain what extension point, Action, Data object, or provider surface saves custom code.
  • For operators: explain what gets monitored, cached, audited, migrated, protected, or debugged.

Avoid vague claims. Use specific outcomes that the code supports. For example:

WeakBetter
Adds generic content tools.Adds article, archive, and tag page types so teams can publish editorial content without custom page schemas.
Improves performance.Indexes cached model URLs and exposes admin cache widgets so operators can see stale HTML and refresh affected pages.
Integrates with Shopify.Stores site-scoped Shopify OAuth connections and syncs products into local tables for admin-side catalog search.

Check these source locations before documenting a package:

SurfaceSource of truth
Composer name and namespacepackages/<package>/composer.json
Product group, capabilities, surfacespackages/<package>/capell.json
Providerscomposer.json.extra.laravel.providers, src/Providers
Config and env varsconfig/*.php, settings classes, tests
Routesroutes/*.php
Commandssrc/Console/Commands
Actionssrc/Actions
Data objectssrc/Data
Models and tablessrc/Models, database/migrations
Settingssrc/Settings, database/settings, Filament settings schemas
Admin surfacessrc/Filament, registered CapellAdmin calls
Frontend surfacesresources/views, src/Livewire, render hooks, frontend providers
Extension pointscontracts, registries, tags, provider registration calls
Testspackages/<package>/tests, shared package tests under tests/Packages

For every package-owned extension point, document:

FieldRequired answer
What to implementInterface, class, enum, registry payload, or Action call.
Where to register itProvider method, registry call, config key, or container tag.
When it runsBoot, admin render, public request, queue job, install command, sync command, publish flow, cache invalidation.
Safe fallbackWhat happens when no extension is registered or the dependency is not installed.
Focused testProvider/registry test, Action test, admin render test, public output safety test, cache invalidation test, or failure test.

Do not invent extension points to make docs feel complete. If the package only exposes Actions today, say that and name the Actions.

Use symptom tables:

SymptomLikely causeCheckFix
Concrete failure visible to a user/operatorSpecific code/config/runtime causeExact command, table, route, cache key, log message, or config keySmallest safe fix and verification step

Include exact names when relevant: route names, command signatures, table names, cache key prefixes, queue/job names, config keys, settings keys, and logs.

  • Public Blade, cached HTML, and theme output must not expose authoring state, package internals, model ids, field paths, permissions, signed admin URLs, tokens, OAuth state, or editor selectors.
  • Public Blade views must not query the database or lazy-load relationships. Document render data loaders, Actions, Livewire components, or view components instead.
  • Package docs must not advise replacing core classes, bypassing registries, writing provider-side data mutations, or storing designed page/widget markup in seed content.
  • Core must not import optional package classes. Cross-package docs should describe events, Actions, registries, string command names, or documented package APIs.
ReviewerQuestions to answer
DeveloperAre all classes, routes, commands, config keys, env vars, tables, settings, Actions, and examples real?
Content writerDoes the README explain a concrete workflow benefit in plain language without filler or unsupported claims?
OwnerCan a buyer or site owner tell why this package matters and which package bundle it belongs to?
OperatorAre install, queue, cache, migration, external API, and rollback risks visible where relevant?
Security/cacheDoes the doc preserve public-output safety and avoid leaking admin/editor internals?
QADo local Markdown links resolve, stale package names disappear, and focused package tests pass?

Use the narrowest useful checks while editing:

Terminal window
vendor/bin/pest packages/<package>/tests --configuration=phpunit.xml

Run repository-level docs checks before finishing a broad documentation pass:

Terminal window
find packages -maxdepth 2 -name README.md -print
rg -n "$STALE_DOC_PATTERN" packages/*/README.md packages/*/docs docs

When a package README documents behavior covered by tests, run the package-local Pest command or the specific test file named in the README.