[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C0SN7CGQHB8MY7NKHP7VRZ":3,"skill-same:01M6C0SN7CGQHB8MY7NKHP7VRZ":119},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":15,"repositoryHtmlUrl":59,"repositoryHomepageUrl":17,"ownerHtmlUrl":60,"ownerBlogUrl":17,"ownerDescription":61,"updatedAt":62,"install":63,"resources":76},"01M6C0SN7CGQHB8MY7NKHP7VRZ","django-patterns","Django\u002FDRF 实现模式","Django 5.2 + DRF implementation patterns specific to Aprender Sistema v2 (modular apps\u002Fcore layout, HasPerm RBAC, read\u002Fwrite serializers, service layer, owner-scoped querysets). Use when writing a model, serializer, view\u002Fviewset, service, permission, or test in the v2 backend.","针对 Aprender Sistema v2 的 Django 5.2 + DRF 实现模式（模块化 apps\u002Fcore 布局、HasPerm RBAC、读写分离的序列化器、服务层、按所有者限定作用域的查询集）。在 v2 后端编写模型、序列化器、视图\u002F视图集、服务、权限或测试时使用。","matheusnorjosa\u002Faprender_sistema","matheusnorjosa","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F117673804?v=4","01M6C0S19FG12BDFBTRWY9TTEQ","Matheus Norjosa","01M6C0S1DF0YB17TKGEYC70GSP",0,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdjango-patterns\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BT7QVANT4709358VEJK53E","代码实现","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"django patterns","django","patterns","view","when","scoped","apps","layout","permission","implementation","backend","use","writing","write","read","model","core","rbac","modular","test","2026-11-10 10:12:30",false,"---\nname: django-patterns\ndescription: Django 5.2 + DRF implementation patterns specific to Aprender Sistema v2 (modular apps\u002Fcore layout, HasPerm RBAC, read\u002Fwrite serializers, service layer, owner-scoped querysets). Use when writing a model, serializer, view\u002Fviewset, service, permission, or test in the v2 backend.\n---\n\n# Django\u002FDRF Patterns — Aprender Sistema v2\n\nImplementation patterns for the v2 backend. This file holds the AS-v2-specific deltas;\nthe full copy-paste scaffolds live in `reference\u002F` (see pointers below). For anything\ngeneric to Django\u002FDRF, follow the framework defaults — this skill only documents where\nAS v2 diverges.\n\n## Backend layout (modular)\n\nThe only real apps are `apps\u002Fcore` (39 models, `serializers\u002F`, `services\u002F`) and\n`apps\u002Fdev_tools` (15 seed commands, disabled in prod). `apps\u002Fcore` is split into Python\npackages, each with an `__init__.py` that re-exports its public names:\n\n```\napps\u002Fcore\u002F\n├── models\u002F        # by domain; __init__.py re-exports all models\n├── serializers\u002F   # by domain; __init__.py re-exports\n├── views\u002F         # compat re-export wrappers (e.g. views\u002Fsolicitacao.py)\n├── views_*.py     # canonical view modules (views_solicitacao.py, views_availability.py, …)\n├── views_gcal\u002F    # GCal views\n├── rbac\u002F          # RBAC SSOT (HasPerm, helpers, matrix, policies)\n└── services\u002F      # business logic (availability_service.py, gcal\u002F, …)\n```\n\n**Re-export discipline**: when you add a model\u002Fserializer, re-export it in the package's\n`__init__.py` so existing imports keep working. Note `apps\u002Fcore\u002Fviews\u002Fsolicitacao.py` is a\nthin compat wrapper — the canonical ViewSet lives in `apps\u002Fcore\u002Fviews_solicitacao.py`.\n\n## Quick reference\n\n| Task | Pattern | Pointer |\n|------|---------|---------|\n| Model | SSOT + constraints + indexes + re-export | `reference\u002Fmodel-template.md` |\n| Serializer (read) | `StringRelatedField`, formatted fields | `reference\u002Fserializer-template.md` |\n| Serializer (write) | `PrimaryKeyRelatedField` + validation | `reference\u002Fserializer-template.md` |\n| ViewSet | thin controller, logic in services | `reference\u002Fviewset-template.md` |\n| Permission | `HasPerm(\"codename\")` | RBAC section below |\n| Owner\u002Fsector scope | filter in `get_queryset()` | RBAC section below |\n| Test | nested classes per requirement, behavior asserts | `reference\u002Ftest-template.md` |\n| Query perf | `select_related` \u002F `prefetch_related` | Performance section below |\n\n---\n\n## Models\n\nFull scaffold: **`reference\u002Fmodel-template.md`**.\n\nAS-v2 deltas to keep in mind:\n- **Timezone**: `DateTimeField` stores UTC; display converts to `America\u002FFortaleza`.\n- **Constraints in the DB**: prefer `CheckConstraint`\u002F`UniqueConstraint` in `Meta`; reach\n  for Python validators only when the rule needs relations or runtime data.\n- **`save()` deriving fields**: real pattern in `apps\u002Fcore\u002Fmodels\u002Fdat_registro.py` — `save()`\n  calls `_calcular_nr_codigos()` to compute `nr_codigos` from `projeto_geral`.\n- **Default masks required**: a model field with `default=` makes `ModelSerializer` accept a\n  payload that omits it. When the field must be supplied, declare it as\n  `ChoiceField(required=True)` on the write serializer (case `Projeto.fluxo`, #1312).\n\n---\n\n## Serializers (DRF)\n\nFull scaffold + gotchas: **`reference\u002Fserializer-template.md`**.\n\nRead\u002Fwrite split is the house style: read serializers are user-friendly\n(`StringRelatedField`, formatted fields, nested), write serializers take IDs\n(`PrimaryKeyRelatedField`) and validate. Pick per request in the ViewSet's\n`get_serializer_class()`.\n\n---\n\n## Views \u002F ViewSets\n\nFull scaffold: **`reference\u002Fviewset-template.md`**.\n\nAS-v2 deltas:\n- **Thin controllers**: views validate + delegate to `apps\u002Fcore\u002Fservices\u002F`; keep business\n  logic out of the view body.\n- **`get_serializer_class()`** switches read vs write by `self.action`.\n- **Owner\u002Fsector scope** is filtered in `get_queryset()` (see RBAC below), not re-checked in\n  the body.\n- **`get_permissions()` override hides `@action(permission_classes=...)`** — if a ViewSet\n  overrides `get_permissions()`, the action decorator's classes are ignored. Check it before\n  assuming an action's permissions. (`SolicitacaoViewSet` does this, mapping `approve`\u002F\n  `batch_approve` to the Policy `CanAccessSolicitationApprovals`.)\n\n---\n\n## Permissions (RBAC)\n\nThe AS v2 RBAC is **capability-based**. SSOT is `apps.core.rbac` (DRF permissions, helpers,\ndata-scope constants, matrix, policies). **NEVER** use `user.groups.filter(name=...)` in\nviews\u002Fpermissions — it is banned by `scripts\u002Frbac_lint.py` (CI job `[required] backend\nrbac-lint`). `apps\u002Fcore\u002Fpermissions.py` is a compat shim — import from `apps.core.rbac`.\n\nCanonical idiom — capability codenames are English (`approve_solicitation`,\n`create_solicitation`, `import_spreadsheet`, `operate_preagenda`, …):\n\n```python\nfrom apps.core.rbac import HasPerm\n\npermission_classes = [HasPerm(\"create_solicitation\")]                 # single capability\npermission_classes = [HasPerm(\"operate_preagenda\") | HasPerm(\"create_solicitation\")]  # OR\npermission_classes = [IsAuthenticated, HasPerm(\"import_spreadsheet\")]  # AND\npermission_classes = [~HasPerm(\"bloqueado\")]                          # NOT\n```\n\nAprovar **não** se gateia por `HasPerm(\"approve_solicitation\")`: a decisão é a Policy\n`CanAccessSolicitationApprovals` (regra única `solicitation_approval_basis`, 3 bases:\nsuperuser, GERENTE vigente na gerência Superintendência, ou a capacidade de aprovar vinda do\npacote do perfil da gerência — DAT\u002FControle). A base do GERENTE não é capacidade, então\n`HasPerm` a negaria. Ver `reference\u002Fviewset-template.md`.\n\n`HasPerm(\"a\") | HasPerm(\"b\")` composition is tactical (ok for ≤2 capabilities). For ≥3 caps,\na shared rule, or \"who can see this and why\" repeated across sites, promote it to a **Policy\nclass** in `apps\u002Fcore\u002Frbac\u002Fpolicies.py` (e.g. `CanAccessSolicitationApprovals`,\n`CanUseGcal`).\n\nProgrammatic checks outside views (services, signals, commands):\n\n```python\nfrom apps.core.rbac import user_has_any_perm, user_has_all_perms\n\nif user_has_any_perm(user, \"operate_preagenda\", \"create_solicitation\"):\n    ...\n```\n\n**Data-scope \u002F object-level**: filter in `get_queryset()` + capabilities — don't reimplement\nidentity checks by group.\n\n```python\nfrom apps.core.services.solicitacao_scope import scope_solicitacoes\n\ndef get_queryset(self):\n    base = Solicitacao.objects.select_related(\"usuario\")  # dono = `usuario`\n    # escopo SSOT: global (superuser\u002Fcapacidades) + gestora (GERENTE vigente) + APOIO + próprias\n    return scope_solicitacoes(base, self.request.user)\n```\n\nFull naming convention: `v2\u002Fdocs\u002FRBAC_NAMING.md` + `v2\u002Fdocs\u002Fspecs\u002Fbackend\u002Frbac.spec.md`.\n\n---\n\n## Testing\n\nFull scaffold + conventions: **`reference\u002Ftest-template.md`**.\n\nAS-v2 deltas:\n- **Nested classes per requirement** (`TestSolicitacaoApproval` → `TestManualApproval` for\n  PA-01, `TestPermissions` for PA-02); docstrings name the rule.\n- **Test behavior, not implementation** — assert status code \u002F persisted state \u002F audit log,\n  never that a method was called.\n- **RBAC asserts the 403 status**, not `\"Setor\" in response.data` (that ties the test to the\n  legacy org chart).\n- **Determinism**: atomic counter for unique CPF\u002Femail (not `abs(hash(str)) % N`); never\n  hardcode a date whose assertion depends on a not-yet-reached deadline.\n- **Pyright header**: a new test file needs the same `# pyright: ...=false` header its\n  neighbors carry, or CI breaks.\n\nReal suites in `apps\u002Fcore\u002Ftests\u002F`: `test_solicitacao_fluxo.py`,\n`test_solicitacao_approval_concurrency.py`, `test_views_solicitacao_coverage.py`,\n`test_solicitacao_serializer_meet_link.py`.\n\n---\n\n## Performance\n\nQuick rule: `select_related` (FK\u002FOneToOne) + `prefetch_related` (M2M\u002Freverse FK) to kill N+1.\nEndpoint-level caching exists (e.g. `availability_check:` keys at `timeout=300` via the\n`cache_availability_check` decorator; the monthly availability grid caches in\n`views_availability_monthly.py` with a TTL+jitter). For slow endpoints, deep N+1, bundle, or\nCore Web Vitals, **use the `performance-optimization` skill** (perf SSOT) — don't duplicate\nguidance here.\n\n```python\nsolicitacoes = Solicitacao.objects.select_related(\"usuario\")  # avoids N+1\n```\n\n---\n\n## Real implementations to copy from\n\n- **CRUD**: models `apps\u002Fcore\u002Fmodels\u002Fsolicitacao.py`, `usuario.py`, `organizacao.py`;\n  serializers `serializers\u002Fsolicitacao.py`, `serializers\u002Fusuario.py`; view\n  `views_solicitacao.py`; permissions `apps\u002Fcore\u002Frbac`.\n- **DAT module** (4-step workflow Carta → Contato → Reunião → Entrega): models\n  `models\u002Fdat_acao.py`, `dat_cadastro.py`, `dat_registro.py` (`save()` auto-derives\n  `nr_codigos`).\n- **PlanoFormacoes**: models `models\u002Fplano_formacoes.py`, `formacao.py`, `acompanhamento.py`,\n  `prova.py`; `recalcular_ch()` + `taxa_realizacao` property.\n- **Service layer**: `services\u002Favailability_service.py` (RD-01..RD-08),\n  `services\u002Fgcal\u002Fsync.py` + `gcal\u002Fpayload.py` (RF05\u002FRF06),\n  `services\u002Fsolicitacao_approval.py` (PA-01..PA-07).\n- **Import**: command `import_export_contract` + `services\u002Fexport_contract_importer.py`\n  (dry-run by default).\n\n## Related\n\n- **Business rules**: `aprender-domain` skill (CP, RD, PA, RF, DAT, PlanoFormacoes)\n- **RBAC**: `v2\u002Fdocs\u002FRBAC_NAMING.md` + `v2\u002Fdocs\u002Fspecs\u002Fbackend\u002Frbac.spec.md`\n- **Performance**: `performance-optimization` skill\n- **Imports**: `v2\u002Fdocs\u002Fspecs\u002Fbackend\u002Fimports.spec.md` (legacy ETL removed — use\n  `import_export_contract` + DRF endpoints)\n","# Django\u002FDRF Patterns — Aprender Sistema v2\n\nImplementation patterns for the v2 backend. This file holds the AS-v2-specific deltas;\nthe full copy-paste scaffolds live in `reference\u002F` (see pointers below). For anything\ngeneric to Django\u002FDRF, follow the framework defaults — this skill only documents where\nAS v2 diverges.\n\n## Backend layout (modular)\n\nThe only real apps are `apps\u002Fcore` (39 models, `serializers\u002F`, `services\u002F`) and\n`apps\u002Fdev_tools` (15 seed commands, disabled in prod). `apps\u002Fcore` is split into Python\npackages, each with an `__init__.py` that re-exports its public names:\n\n```\napps\u002Fcore\u002F\n├── models\u002F        # by domain; __init__.py re-exports all models\n├── serializers\u002F   # by domain; __init__.py re-exports\n├── views\u002F         # compat re-export wrappers (e.g. views\u002Fsolicitacao.py)\n├── views_*.py     # canonical view modules (views_solicitacao.py, views_availability.py, …)\n├── views_gcal\u002F    # GCal views\n├── rbac\u002F          # RBAC SSOT (HasPerm, helpers, matrix, policies)\n└── services\u002F      # business logic (availability_service.py, gcal\u002F, …)\n```\n\n**Re-export discipline**: when you add a model\u002Fserializer, re-export it in the package's\n`__init__.py` so existing imports keep working. Note `apps\u002Fcore\u002Fviews\u002Fsolicitacao.py` is a\nthin compat wrapper — the canonical ViewSet lives in `apps\u002Fcore\u002Fviews_solicitacao.py`.\n\n## Quick reference\n\n| Task | Pattern | Pointer |\n|------|---------|---------|\n| Model | SSOT + constraints + indexes + re-export | `reference\u002Fmodel-template.md` |\n| Serializer (read) | `StringRelatedField`, formatted fields | `reference\u002Fserializer-template.md` |\n| Serializer (write) | `PrimaryKeyRelatedField` + validation | `reference\u002Fserializer-template.md` |\n| ViewSet | thin controller, logic in services | `reference\u002Fviewset-template.md` |\n| Permission | `HasPerm(\"codename\")` | RBAC section below |\n| Owner\u002Fsector scope | filter in `get_queryset()` | RBAC section below |\n| Test | nested classes per requirement, behavior asserts | `reference\u002Ftest-template.md` |\n| Query perf | `select_related` \u002F `prefetch_related` | Performance section below |\n\n---\n\n## Models\n\nFull scaffold: **`reference\u002Fmodel-template.md`**.\n\nAS-v2 deltas to keep in mind:\n- **Timezone**: `DateTimeField` stores UTC; display converts to `America\u002FFortaleza`.\n- **Constraints in the DB**: prefer `CheckConstraint`\u002F`UniqueConstraint` in `Meta`; reach\n  for Python validators only when the rule needs relations or runtime data.\n- **`save()` deriving fields**: real pattern in `apps\u002Fcore\u002Fmodels\u002Fdat_registro.py` — `save()`\n  calls `_calcular_nr_codigos()` to compute `nr_codigos` from `projeto_geral`.\n- **Default masks required**: a model field with `default=` makes `ModelSerializer` accept a\n  payload that omits it. When the field must be supplied, declare it as\n  `ChoiceField(required=True)` on the write serializer (case `Projeto.fluxo`, #1312).\n\n---\n\n## Serializers (DRF)\n\nFull scaffold + gotchas: **`reference\u002Fserializer-template.md`**.\n\nRead\u002Fwrite split is the house style: read serializers are user-friendly\n(`StringRelatedField`, formatted fields, nested), write serializers take IDs\n(`PrimaryKeyRelatedField`) and validate. Pick per request in the ViewSet's\n`get_serializer_class()`.\n\n---\n\n## Views \u002F ViewSets\n\nFull scaffold: **`reference\u002Fviewset-template.md`**.\n\nAS-v2 deltas:\n- **Thin controllers**: views validate + delegate to `apps\u002Fcore\u002Fservices\u002F`; keep business\n  logic out of the view body.\n- **`get_serializer_class()`** switches read vs write by `self.action`.\n- **Owner\u002Fsector scope** is filtered in `get_queryset()` (see RBAC below), not re-checked in\n  the body.\n- **`get_permissions()` override hides `@action(permission_classes=...)`** — if a ViewSet\n  overrides `get_permissions()`, the action decorator's classes are ignored. Check it before\n  assuming an action's permissions. (`SolicitacaoViewSet` does this, mapping `approve`\u002F\n  `batch_approve` to the Policy `CanAccessSolicitationApprovals`.)\n\n---\n\n## Permissions (RBAC)\n\nThe AS v2 RBAC is **capability-based**. SSOT is `apps.core.rbac` (DRF permissions, helpers,\ndata-scope constants, matrix, policies). **NEVER** use `user.groups.filter(name=...)` in\nviews\u002Fpermissions — it is banned by `scripts\u002Frbac_lint.py` (CI job `[required] backend\nrbac-lint`). `apps\u002Fcore\u002Fpermissions.py` is a compat shim — import from `apps.core.rbac`.\n\nCanonical idiom — capability codenames are English (`approve_solicitation`,\n`create_solicitation`, `import_spreadsheet`, `operate_preagenda`, …):\n\n```python\nfrom apps.core.rbac import HasPerm\n\npermission_classes = [HasPerm(\"create_solicitation\")]                 # single capability\npermission_classes = [HasPerm(\"operate_preagenda\") | HasPerm(\"create_solicitation\")]  # OR\npermission_classes = [IsAuthenticated, HasPerm(\"import_spreadsheet\")]  # AND\npermission_classes = [~HasPerm(\"bloqueado\")]                          # NOT\n```\n\nAprovar **não** se gateia por `HasPerm(\"approve_solicitation\")`: a decisão é a Policy\n`CanAccessSolicitationApprovals` (regra única `solicitation_approval_basis`, 3 bases:\nsuperuser, GERENTE vigente na gerência Superintendência, ou a capacidade de aprovar vinda do\npacote do perfil da gerência — DAT\u002FControle). A base do GERENTE não é capacidade, então\n`HasPerm` a negaria. Ver `reference\u002Fviewset-template.md`.\n\n`HasPerm(\"a\") | HasPerm(\"b\")` composition is tactical (ok for ≤2 capabilities). For ≥3 caps,\na shared rule, or \"who can see this and why\" repeated across sites, promote it to a **Policy\nclass** in `apps\u002Fcore\u002Frbac\u002Fpolicies.py` (e.g. `CanAccessSolicitationApprovals`,\n`CanUseGcal`).\n\nProgrammatic checks outside views (services, signals, commands):\n\n```python\nfrom apps.core.rbac import user_has_any_perm, user_has_all_perms\n\nif user_has_any_perm(user, \"operate_preagenda\", \"create_solicitation\"):\n    ...\n```\n\n**Data-scope \u002F object-level**: filter in `get_queryset()` + capabilities — don't reimplement\nidentity checks by group.\n\n```python\nfrom apps.core.services.solicitacao_scope import scope_solicitacoes\n\ndef get_queryset(self):\n    base = Solicitacao.objects.select_related(\"usuario\")  # dono = `usuario`\n    # escopo SSOT: global (superuser\u002Fcapacidades) + gestora (GERENTE vigente) + APOIO + próprias\n    return scope_solicitacoes(base, self.request.user)\n```\n\nFull naming convention: `v2\u002Fdocs\u002FRBAC_NAMING.md` + `v2\u002Fdocs\u002Fspecs\u002Fbackend\u002Frbac.spec.md`.\n\n---\n\n## Testing\n\nFull scaffold + conventions: **`reference\u002Ftest-template.md`**.\n\nAS-v2 deltas:\n- **Nested classes per requirement** (`TestSolicitacaoApproval` → `TestManualApproval` for\n  PA-01, `TestPermissions` for PA-02); docstrings name the rule.\n- **Test behavior, not implementation** — assert status code \u002F persisted state \u002F audit log,\n  never that a method was called.\n- **RBAC asserts the 403 status**, not `\"Setor\" in response.data` (that ties the test to the\n  legacy org chart).\n- **Determinism**: atomic counter for unique CPF\u002Femail (not `abs(hash(str)) % N`); never\n  hardcode a date whose assertion depends on a not-yet-reached deadline.\n- **Pyright header**: a new test file needs the same `# pyright: ...=false` header its\n  neighbors carry, or CI breaks.\n\nReal suites in `apps\u002Fcore\u002Ftests\u002F`: `test_solicitacao_fluxo.py`,\n`test_solicitacao_approval_concurrency.py`, `test_views_solicitacao_coverage.py`,\n`test_solicitacao_serializer_meet_link.py`.\n\n---\n\n## Performance\n\nQuick rule: `select_related` (FK\u002FOneToOne) + `prefetch_related` (M2M\u002Freverse FK) to kill N+1.\nEndpoint-level caching exists (e.g. `availability_check:` keys at `timeout=300` via the\n`cache_availability_check` decorator; the monthly availability grid caches in\n`views_availability_monthly.py` with a TTL+jitter). For slow endpoints, deep N+1, bundle, or\nCore Web Vitals, **use the `performance-optimization` skill** (perf SSOT) — don't duplicate\nguidance here.\n\n```python\nsolicitacoes = Solicitacao.objects.select_related(\"usuario\")  # avoids N+1\n```\n\n---\n\n## Real implementations to copy from\n\n- **CRUD**: models `apps\u002Fcore\u002Fmodels\u002Fsolicitacao.py`, `usuario.py`, `organizacao.py`;\n  serializers `serializers\u002Fsolicitacao.py`, `serializers\u002Fusuario.py`; view\n  `views_solicitacao.py`; permissions `apps\u002Fcore\u002Frbac`.\n- **DAT module** (4-step workflow Carta → Contato → Reunião → Entrega): models\n  `models\u002Fdat_acao.py`, `dat_cadastro.py`, `dat_registro.py` (`save()` auto-derives\n  `nr_codigos`).\n- **PlanoFormacoes**: models `models\u002Fplano_formacoes.py`, `formacao.py`, `acompanhamento.py`,\n  `prova.py`; `recalcular_ch()` + `taxa_realizacao` property.\n- **Service layer**: `services\u002Favailability_service.py` (RD-01..RD-08),\n  `services\u002Fgcal\u002Fsync.py` + `gcal\u002Fpayload.py` (RF05\u002FRF06),\n  `services\u002Fsolicitacao_approval.py` (PA-01..PA-07).\n- **Import**: command `import_export_contract` + `services\u002Fexport_contract_importer.py`\n  (dry-run by default).\n\n## Related\n\n- **Business rules**: `aprender-domain` skill (CP, RD, PA, RF, DAT, PlanoFormacoes)\n- **RBAC**: `v2\u002Fdocs\u002FRBAC_NAMING.md` + `v2\u002Fdocs\u002Fspecs\u002Fbackend\u002Frbac.spec.md`\n- **Performance**: `performance-optimization` skill\n- **Imports**: `v2\u002Fdocs\u002Fspecs\u002Fbackend\u002Fimports.spec.md` (legacy ETL removed — use\n  `import_export_contract` + DRF endpoints)\n",{"name":5,"description":7},"main","9e3a882d83e0853bdc570ae9d89c02d2a53bed82",".agents\u002Fskills\u002Fdjango-patterns","https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema","https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa","Dev Python | IA | Automation | HTML | CSS | Data | Process | Projects","2026-11-14 04:59:13",{"source":9,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add matheusnorjosa\u002Faprender_sistema --skill django-patterns",{"tool":69,"command":70},"bunx","bunx skills add matheusnorjosa\u002Faprender_sistema --skill django-patterns",{"tool":72,"command":73},"pnpm","pnpm dlx skills add matheusnorjosa\u002Faprender_sistema --skill django-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdjango-patterns\u002FSKILL.md",true,[77,83,87,91,95,99,103,107,111,115],{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"checklist.md","REFERENCE","参考文档",3364,"https:\u002F\u002Fgithub.com\u002FStarksJohn\u002FCursorUserDir\u002Fblob\u002Fmain\u002Fskills\u002Fbmad-code-review\u002Fchecklist.md",{"path":84,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":85,"sourceHtmlUrl":86},"reference\u002Fmodel-template.md",3633,"https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdjango-patterns\u002Freference\u002Fmodel-template.md",{"path":88,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":89,"sourceHtmlUrl":90},"reference\u002Fserializer-template.md",4036,"https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdjango-patterns\u002Freference\u002Fserializer-template.md",{"path":92,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":93,"sourceHtmlUrl":94},"reference\u002Ftest-template.md",4666,"https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdjango-patterns\u002Freference\u002Ftest-template.md",{"path":96,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":97,"sourceHtmlUrl":98},"reference\u002Fviewset-template.md",3826,"https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdjango-patterns\u002Freference\u002Fviewset-template.md",{"path":100,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":101,"sourceHtmlUrl":102},"steps\u002Fstep-01-gather-context.md",5144,"https:\u002F\u002Fgithub.com\u002FStarksJohn\u002FCursorUserDir\u002Fblob\u002Fmain\u002Fskills\u002Fbmad-code-review\u002Fsteps\u002Fstep-01-gather-context.md",{"path":104,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":105,"sourceHtmlUrl":106},"steps\u002Fstep-02-review.md",2142,"https:\u002F\u002Fgithub.com\u002FStarksJohn\u002FCursorUserDir\u002Fblob\u002Fmain\u002Fskills\u002Fbmad-code-review\u002Fsteps\u002Fstep-02-review.md",{"path":108,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":109,"sourceHtmlUrl":110},"steps\u002Fstep-03-triage.md",2692,"https:\u002F\u002Fgithub.com\u002FStarksJohn\u002FCursorUserDir\u002Fblob\u002Fmain\u002Fskills\u002Fbmad-code-review\u002Fsteps\u002Fstep-03-triage.md",{"path":112,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":113,"sourceHtmlUrl":114},"steps\u002Fstep-04-present.md",6366,"https:\u002F\u002Fgithub.com\u002FStarksJohn\u002FCursorUserDir\u002Fblob\u002Fmain\u002Fskills\u002Fbmad-code-review\u002Fsteps\u002Fstep-04-present.md",{"path":116,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":117,"sourceHtmlUrl":118},"workflow.md",2087,"https:\u002F\u002Fgithub.com\u002FStarksJohn\u002FCursorUserDir\u002Fblob\u002Fmain\u002Fskills\u002Fbmad-code-review\u002Fworkflow.md",[120,154,185,207,227,267],{"skillNo":121,"name":122,"nameZh":123,"description":124,"descriptionZh":125,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":126,"categories":127,"keywords":134,"publishedAt":51},"01M6C0WHSP7S2QMJGGMQRXJ6PD","writing-standards","技术文档写作规范","Apply AS v2 technical-writing standards (clarity, brevity, active voice, Python\u002FDjango conventions). Use when writing a README, a docstring (PEP 257), a commit message, a PR description, an error message, or any technical doc.","遵循 AS v2 技术写作规范（清晰、简洁、主动语态、Python\u002FDjango 惯例）。适用于撰写 README、文档字符串（PEP 257）、提交信息、PR 描述、错误信息或任何技术文档。","https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwriting-standards\u002FSKILL.md",[128,131],{"categoryNo":129,"categoryName":130,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BVB0FJ0RR8KXYVFTKEA3XX","技术文档工程师",{"categoryNo":132,"categoryName":133,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C5C7NGT4DWWBE15R6QGEX5","技术文档编写",[43,135,136,137,138,139,140,141,142,143,144,32,145,146,147,148,149,150,151,152,153,35],"writing standards","standards","python","commit","pr","pr description","commit message","doc","voice","clarity","technical","README","message","active","as","error","technical-writing","brevity","docstring",{"skillNo":155,"name":156,"nameZh":157,"description":158,"descriptionZh":159,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":160,"categories":161,"keywords":168,"publishedAt":51},"01M6C0WG2SBP9PJG1YQFGGVJAR","verification-gate","成果验证关卡","Verify before claiming success. Use when about to say something works\u002Fis done, after implementing a feature, after a bugfix, or before pushing — run the proof command and confirm output first.","在宣称成功之前先进行验证。适用于准备表示某功能可用\u002F已完成、实现功能后、修复缺陷后，或推送代码前——先运行验证命令并确认输出。","https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fverification-gate\u002FSKILL.md",[162,165],{"categoryNo":163,"categoryName":164,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":166,"categoryName":167,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C48JNVH0P83Z0KVKAQ4819","成果验证与价值评估",[169,170,171,172,173,174,175,42,176,177,178,179,180,181,182,183,184,35],"verification","verification gate","gate","run","first","verify","command","verify before claiming","say","done","feature","proof","bugfix","output","about","implementing",{"skillNo":186,"name":187,"nameZh":188,"description":189,"descriptionZh":190,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":191,"categories":192,"keywords":197,"publishedAt":51},"01M6C0WE010G12KH45YZW6M7K5","test-driven-development","测试驱动开发","Write the failing test before the implementation in AS v2 (pytest + Django\u002FDRF). Use when implementing a feature or fixing a bug, before any production code is written.","在 AS v2（pytest + Django\u002FDRF）中先编写失败的测试，再进行实现。适用于实现功能或修复缺陷时，在编写任何生产代码之前使用。","https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[193,194],{"categoryNo":163,"categoryName":164,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":195,"categoryName":196,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[50,198,199,200,201,202,32,44,42,203,40,204,179,149,205,184,35,206],"test driven development","development","driven","code","Production","bug","pytest","drf","failing",{"skillNo":208,"name":209,"nameZh":210,"description":211,"descriptionZh":212,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":213,"categories":214,"keywords":221,"publishedAt":51},"01M6C0WC6Y81XRVBJQSTKA96XQ","subagent-development","子智能体编排开发","Orquestra subagents no AS v2 — decompõe a tarefa em domínios independentes, paraleliza e revisa em 2 estágios. Use ao delegar exploração, implementação ou validação cross-arquivo para acelerar o trabalho e poupar o contexto principal.","在 AS v2 中编排子智能体——将任务拆解为相互独立的领域，并行处理并进行两阶段审查。适用于委派探索、实现或跨文件验证，以加快工作进度并节省主上下文。","https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsubagent-development\u002FSKILL.md",[215,218],{"categoryNo":216,"categoryName":217,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRN0DBCRG4XGJMB6QQEP11","编码任务委派",{"categoryNo":219,"categoryName":220,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师",[199,222,223,224,225,42,226,149],"subagent","subagent development","para","subagents","ao",{"skillNo":228,"name":229,"nameZh":230,"description":231,"descriptionZh":232,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":233,"categories":234,"keywords":241,"publishedAt":51},"01M6C0W9W8D6JJWXW28Q7ZHAC9","security-scan","自动化安全扫描","Automated security scanning for AS v2. Use before commits or when reviewing changes for vulnerabilities. Runs dependency audit (pip-audit, npm audit), secret detection (grep patterns), and code pattern scanning (SQL injection, XSS, eval, pickle, hardcoded secrets). Integrates with project hooks system.","为 AS v2 提供自动化安全扫描。在提交前或审查变更中的漏洞时使用。执行依赖审计（pip-audit、npm audit）、密钥检测（grep 模式）和代码模式扫描（SQL 注入、XSS、eval、pickle、硬编码密钥）。与项目 hooks 系统集成。","https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsecurity-scan\u002FSKILL.md",[235,238],{"categoryNo":236,"categoryName":237,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师",{"categoryNo":239,"categoryName":240,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSJ8FPTACYEEYRWQRNFXKY","安全检测工程",[242,243,244,245,246,201,247,248,249,250,251,252,253,254,255,256,257,258,42,259,260,261,149,262,263,264,265,266,35],"security","security scan","scan","vulnerabilities","sql","npm","audit","dependency audit","detection","injection","xss","secrets","pip-audit","commits","system","grep","eval","hooks","security scanning","project","with","true","pip","for","changes",{"skillNo":268,"name":269,"nameZh":270,"description":271,"descriptionZh":272,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":273,"categories":274,"keywords":279,"publishedAt":51},"01M6C0W7RE3G3C2852YXQKR5J9","resume-handoff","交接文档恢复工作","Resume work from a saved handoff document, validating its state against the current codebase before continuing. Use when resuming work from a saved handoff after a context clear or in a new session (path, session name, or GitHub issue).","从保存的交接文档恢复工作，在继续之前先根据当前代码库验证其状态。适用于上下文清空后或在新会话中（通过路径、会话名称或 GitHub issue）从保存的交接文档恢复工作。","https:\u002F\u002Fgithub.com\u002Fmatheusnorjosa\u002Faprender_sistema\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fresume-handoff\u002FSKILL.md",[275,276],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":277,"categoryName":278,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTBRVQZ06FQWD8P64214B2","会话上下文交接",[280,281,282,283,284,285,286,287,288,42,289,290,291,292,293,294,295,296,35,297],"handoff","resume handoff","resume","github","state","new session","work","context","session","github issue","issue","document","clear","name","saved","codebase","resuming","new"]