agentleFS
iflytekiflytek/skillhub/.agents/skills/code-conventions/SKILL.md

code-conventions

Skill5.1k starsChanged 3 months agoApache-2.0View on GitHub

Code style, logging, and testing conventions for SkillHub backend (Java) and frontend (TypeScript). Use when writing or reviewing code.

5 other projects use a version of this.

Trending

Less talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 6 mentionsApr 2026: 13 mentionsMay 2026: 3 mentionsJun 2026: 5 mentionsJul 2026: 6 mentionsAug 2026: 7 mentionsSep 2026: 6 mentionsOct 2026: 3 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the iflytek/skillhub repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about iflytek/skillhub

The biggest 5 of 49 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 49

Talked about on GitHub and Bluesky (49 times).

On GitHub · 48

43 more on GitHub

The file

Show its rules and text

We split this skill into the rules it gives an agent

25 rules. 0 are common, 13 are distinctive, and 12 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never introduce int, long, or bigint as user identifiers.

    line 20
  2. Very specific:

    Use LocalizedDomainException for user-facing error messages (supports i18n)

    line 25
  3. Very specific:

    Use DomainBadRequestException for invalid client input

    line 26
  4. Very specific:

    Use DomainNotFoundException for missing resources

    line 27
  5. Very specific:

    Use DomainForbiddenException for authorization failures

    line 28
  6. Distinctive:

    Use domain events for cross-cutting side effects (publishing, notifications)

    line 35
  7. Distinctive:

    No business logic in controllers

    line 41
  8. Distinctive:

    Should express "what this endpoint does", not "how it assembles DTOs"

    line 54
  9. Distinctive:

    Use SLF4J with structured logging

    line 59
  10. Distinctive:

    Use MDC for request tracing

    line 60
  11. Very specific:

    Use generated OpenAPI types from web/src/api/generated/schema.d.ts for all API interactions.

    line 68
  12. Very specific:

    Use openapi-fetch client for type-safe API calls

    line 75
  13. Distinctive:

    Place code at the lowest appropriate layer.

    line 99
  14. Distinctive:

    Follow existing component patterns

    line 104
  15. Very specific:

    Use cn() for conditional class merging

    line 105
  16. Distinctive:

    Use i18next + react-i18next

    line 109
  17. Distinctive:

    All user-facing text must be translatable

    line 110
  18. Very specific:

    Use Spring Boot test slices where possible (@WebMvcTest, @DataJpaTest)

    line 118
  19. Distinctive:

    Test behaviors, not implementations

    line 119
  20. Very specific:

    Use make test-backend-app (includes -am for dependent modules)

    line 120
  21. Very specific:

    Never run ./mvnw -pl skillhub-app clean test directly — stale Maven cache causes misleading errors

    line 121
  22. Distinctive:

    Test component behavior and user interactions

    line 127
  23. Very specific:

    Maven multi-module: Always use -am flag or Makefile targets to include dependent modules

    line 131
  24. Distinctive:

    OpenAPI types: Must regenerate and commit after API contract changes

    line 132
  25. Distinctive:

    String identity: Never use numeric types for user identifiers

    line 133

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Conventions Skill

Java / Backend Conventions

User Identity Type

User identity is always String throughout the codebase. This covers:

  • Authentication and authorization
  • API parameters and responses
  • Permission checks
  • Audit logs
  • Resource owner, creator, reviewer, actor, submittedBy fields

Never introduce int, long, or bigint as user identifiers. The platform needs to support external SSO/OIDC/SCIM identity sources whose UIDs are typically stable strings.

Exception Handling

  • Use LocalizedDomainException for user-facing error messages (supports i18n)
  • Use DomainBadRequestException for invalid client input
  • Use DomainNotFoundException for missing resources
  • Use DomainForbiddenException for authorization failures
  • Exception classes live in skillhub-domain/shared/exception/

Domain Services

  • Return domain objects, not DTOs
  • Contain business rules and state transitions
  • Use domain events for cross-cutting side effects (publishing, notifications)
  • Located in domain/{submodule}/service/

Controllers

  • Transport only: extract auth context, bind request params, wrap responses
  • No business logic in controllers
  • Located in com.iflytek.skillhub.controller/

Query Repositories

  • Handle read-model joins and presentation projection
  • Return DTOs or presentation models
  • Located in com.iflytek.skillhub.repository/
  • Named like *QueryRepository (e.g., GovernanceQueryRepository, MySkillQueryRepository)

App Services

  • Workflow orchestration: coordinate domain services and query repositories
  • Should express "what this endpoint does", not "how it assembles DTOs"
  • Located in com.iflytek.skillhub.service/

Logging

  • Use SLF4J with structured logging
  • Use MDC for request tracing
  • Log at appropriate levels: INFO for business events, DEBUG for troubleshooting, ERROR for failures

TypeScript / Frontend Conventions

Type Safety

  • Strict TypeScript mode. No any types.
  • Use generated OpenAPI types from web/src/api/generated/schema.d.ts for all API interactions.
  • Additional types in web/src/types/

Data Fetching

  • Always use TanStack Query (@tanstack/react-query) for server state
  • Never use useEffect for data fetching
  • Use openapi-fetch client for type-safe API calls

Component Composition

  • Radix UI primitives: @radix-ui/react-dropdown-menu, @radix-ui/react-select
  • class-variance-authority (cva) for component variants
  • clsx + tailwind-merge for class merging
  • cn() utility: web/src/shared/lib/utils.ts
  • shadcn/ui is NOT used as a library

State Management

  • TanStack Query for server state (API data, caching, invalidation)
  • Zustand for local/UI state (theme, sidebar, modals, form state)

Feature-Sliced Design

LayerPathPurpose
Pagesweb/src/pages/Route-level page components
Featuresweb/src/features/Self-contained business features
Entitiesweb/src/entities/Domain entity display logic
Sharedweb/src/shared/Reusable UI components, hooks, utilities

Place code at the lowest appropriate layer. Do not put page-level logic in shared.

Styling

  • Tailwind CSS for all styling
  • Follow existing component patterns
  • Use cn() for conditional class merging

Internationalization

  • Use i18next + react-i18next
  • All user-facing text must be translatable
  • Translation keys in web/src/i18n/

Testing Philosophy

Backend

  • JUnit 5 + Mockito + AssertJ
  • Use Spring Boot test slices where possible (@WebMvcTest, @DataJpaTest)
  • Test behaviors, not implementations
  • Use make test-backend-app (includes -am for dependent modules)
  • Never run ./mvnw -pl skillhub-app clean test directly — stale Maven cache causes misleading errors

Frontend

  • Vitest for unit tests
  • Playwright for E2E tests
  • Test component behavior and user interactions

Common Pitfalls

  • Maven multi-module: Always use -am flag or Makefile targets to include dependent modules
  • OpenAPI types: Must regenerate and commit after API contract changes
  • String identity: Never use numeric types for user identifiers
  • Controller business logic: Move to domain service or app service
  • Complex read-models in app service: Extract to query repository

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.