con un clic
api-and-namespace-design
// API design conventions, namespace coordinate system, RBAC roles, ClawHub compatibility layer, OpenAPI contract sync rules, and CSRF/session handling.
// API design conventions, namespace coordinate system, RBAC roles, ClawHub compatibility layer, OpenAPI contract sync rules, and CSRF/session handling.
Rules for the SkillHub backend Maven multi-module clean architecture. Ensures agents place new code in the correct module and respect dependency direction.
Code style, logging, and testing conventions for SkillHub backend (Java) and frontend (TypeScript). Use when writing or reviewing code.
The complete development workflow for SkillHub contributors including local dev, staging validation, testing, and PR creation. Ensures agents follow the correct sequence of steps.
Coding conventions, architecture patterns, and testing rules for the SkillHub React frontend. Ensures agents follow Feature-Sliced Design and use the generated OpenAPI types.
PR title format, commit conventions, and pre-PR checklist for SkillHub. Use when preparing or reviewing pull requests.
The authoritative skill lifecycle state model including container states, version states, review workflow states, visibility overlay, and governance actions. Ensures agents don't introduce invalid states or transitions.
| name | api-and-namespace-design |
| description | API design conventions, namespace coordinate system, RBAC roles, ClawHub compatibility layer, OpenAPI contract sync rules, and CSRF/session handling. |
| license | Apache-2.0 |
Use this skill when:
SkillHub uses a two-axis coordinate model:
@{namespace_slug}/{skill_slug}
@global/my-skill — Global namespace skill@my-team/my-skill — Team namespace skill (namespace slug is any valid slug)@department-ops/my-skill — Department namespace skillNamespaces (domain/namespace/):
SlugValidatorACTIVE, FROZEN, ARCHIVEDOWNER, ADMIN, MEMBERNamespace-level (domain/namespace/NamespaceRole):
OWNER — Full control over namespace and all skillsADMIN — Can manage members, archive skills, publishMEMBER — Can publish skills to the namespacePlatform-level:
SUPER_ADMIN — Bypasses all permission checks, can publish directly without reviewClawHub CLI uses a single-slug model (no / allowed in slugs). Mapping:
| SkillHub Coordinate | Canonical Slug | Notes |
|---|---|---|
@global/my-skill | my-skill | Global namespace omits prefix |
@team-name/my-skill | team-name--my-skill | Double-dash separator |
Conflict resolution: -- split takes priority. @global/team-name--my-skill would conflict
with @team-name/my-skill, resolved to the team namespace skill. Global skill slugs must NOT
contain --.
skillhub-app (com.iflytek.skillhub.controller/) are transport onlyskillhub-domain) or app services@Operation, @ApiResponse) for API documentationcom.iflytek.skillhub.dto/ReviewTaskRequest / ReviewTaskResponse for review workflowDomainBadRequestException with i18n message keysXSRF-TOKEN cookie and X-XSRF-TOKEN headerX-Mock-User-Id header in local dev/.well-known/clawhub.json returns { "apiBase": "/api/v1" } for ClawHub CLI auto-discovery.
When backend API contracts change:
make generate-api
This runs openapi-typescript http://localhost:8080/v3/api-docs -o src/api/generated/schema.d.ts.
Commit the updated web/src/api/generated/schema.d.ts with the PR.
To verify no drift:
./scripts/check-openapi-generated.sh
This starts local dependencies, boots the backend, regenerates the schema, and fails if the checked-in SDK is stale.
major.minor.patch)latest tag is system-reserved, read-only, auto-follows Skill.latestVersionIdstable, beta) are manually maintainedlatest cannot be moved manuallyyyyyMMdd.HHmmss format when no version is specified in SKILL.md| Method | Path | Purpose |
|---|---|---|
GET | /api/v1/auth/me | Current user info (401 if unauthenticated) |
POST | /api/v1/auth/local/login | Local account login |
POST | /api/v1/auth/local/register | Local account registration |
POST | /api/v1/auth/logout | Logout (302/200/204) |
POST | /api/v1/auth/local/change-password | Password change |
GET | /api/v1/namespaces | List namespaces |
GET | /api/v1/labels | List visible labels (public) |
POST | /api/v1/admin/labels | Create label definition (admin) |
DELETE | /api/v1/admin/labels/{slug} | Delete label definition (admin) |
GET | /actuator/health | Health check |
GET | /actuator/prometheus | Prometheus metrics |
X-XSRF-TOKEN header)