commory-backend

Implement a Go backend with JWT auth and MsgLayer import APIs.

Updated May 11, 2026
One-click install
npx skills add https://github.com/IsKenKenYa/Commory --skill commory-backend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commory-backend
Source: https://github.com/IsKenKenYa/Commory/tree/main/.agents/skills/commory-backend
Command: npx skills add https://github.com/IsKenKenYa/Commory --skill commory-backend

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you build and maintain a reliable Commory server that can authenticate users, import and validate MsgLayer data, and expose a consistent mobile API without breaking the contract.

Core Features & Use Cases

  • JWT auth with secure password hashing and refresh rotation: Supports login, refresh, and logout while enforcing rate-limiting and one-use refresh tokens.
  • First-run setup wizard: Initializes admin user and setup status with migration-safe persistence.
  • MsgLayer import, validation, and querying: Validates MsgLayer payloads (including schema checks and additionalProperties constraints), then imports and serves timeline/search/threads/identities via bearer-auth routes.
  • File-backed storage with a storage provider abstraction: Enables predictable persistence-on-write and provider switching (e.g., JSON-file and SQLite adapters).

Quick Start

Implement your change by following the thin-handler pattern in backend/internal/api and verifying contract alignment with docs/mobile-api.md, then run go vet and go test in the backend directory.

Frequently Asked Questions about commory-backend

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement JWT auth with refresh token rotation in a Go API server?

JWT auth with refresh token rotation in a Go API server is implemented by enforcing rate-limiting and one-use refresh tokens across login, refresh, and logout workflows. Secure password hashing protects credentials while bearer-auth middleware restricts protected route access.

How do I validate MsgLayer v0.1 schema structures before importing data?

MsgLayer v0.1 schema validation requires checking payload structures and enforcing additionalProperties constraints before import. The import pipeline validates data against the schema to ensure contract compliance before serving it through timeline and search endpoints.

What's the best way to structure Go backend HTTP handlers for API contract alignment?

The best way to structure Go backend HTTP handlers is using a thin-handler pattern where handlers in the API layer delegate logic to services. This enforces auth middleware boundaries between public and protected routes while maintaining predictable contract alignment.

Does this Go backend support file-backed storage and SQLite adapters?

The Go backend supports file-backed storage with a storage provider abstraction that enables persistence-on-write. It includes optional SQLite adapter wiring, allowing you to switch between JSON-file and SQLite providers predictably.

How do I set up a first-run admin initialization workflow in a Go backend?

A first-run admin initialization workflow in a Go backend is set up using a setup wizard that initializes the admin user and setup status. It uses migration-safe persistence to ensure the initial state is securely stored before API access is granted.