- Provide a lean
gitstatsfield method that resolves repository identifiers (long GitHub URLs orowner/reposhorthand) into normalized metadata. - Keep the plugin read-only and lightweight; prioritize GitHub first, with room to extend to other providers later.
- Normalize common stats such as stars, forks, watchers/subscribers, open issues, URLs, descriptions, language, default branch, and timestamps.
- Cache responses through Kirby’s cache component with a sensible default TTL and an option to disable caching during development.
index.phpregisters the plugin atlemmon/gitstats, sets defaults, and exposes thetoGitStatsfield method.src/GitStats.phpparses repository references, handles network calls, normalizes responses, and manages caching.- Add future helpers inside
src/. Keep blueprints and snippets underblueprints/andsnippets/if UI elements are introduced later. - Keep AGENTS.md focused on contributor process; place deeper implementation notes in
TECHNICAL-NOTES.mdif needed. - Assume the code always runs inside a Kirby instance; no guards for the global
kirby()helper are needed.
- Follow PSR-12 for PHP: four-space indentation, brace on the next line for classes and methods, and meaningful namespaces (e.g.,
Lemmon\Gitstats). - Name Kirby blueprints and snippets using lowercase single-word identifiers (
gitstats.yml,gitstats.php) if/when added. - Stick to ASCII punctuation in code, docs, and comments (prefer
--over an em dash) so diffs stay predictable. - Document non-trivial helpers with concise docblocks. Prefer descriptive method names such as
fetchGithub. - Reserve emojis for rare emphasis; moderate use is fine, but avoid emoji-driven lists.
- Use GitHub-style unchecked checkboxes (
- [ ]) when documenting roadmap items to keep documentation consistent.
- Add PHPUnit under
tests/when functionality expands; start with configuration inphpunit.xml.dist. - Name test classes after the class under test (
GitStatsTest). Execute locally withvendor/bin/phpunit. - Maintain manual regression notes in
docs/testing.mduntil automated coverage is available.
- Follow the Conventional Commits spec (
fix:,refactor:,docs:) and keep messages in the imperative mood. - Use concise Conventional Commit summaries:
<type>(<scope>): <short action>. Avoid verbose release blurbs in commit messages; keep release notes in CHANGELOG/release tagging. - Ensure each commit addresses a single concern; couple tests with implementation, but leave unrelated formatting for a separate change.
- Reference related issues in commit bodies using
Refs #123when applicable. - PRs must summarize intent, list functional changes, and include screenshots or GIFs when UI elements are added.
- Prefer annotated tags for releases (author, date, message/signing) over lightweight tags.
- Annotated tags should use
vX.Y.Z - <concise headline>; keep detailed notes in CHANGELOG/releases.
- Add concise PHPDoc blocks where behavior is not immediately obvious, especially for helpers touching I/O streams.