[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D2JNFN05SGAZV6DWYB2PK6":3,"skill-same:01M7D2JNFN05SGAZV6DWYB2PK6":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7D2JNFN05SGAZV6DWYB2PK6","backend-hexagonal-architecture",null,"Enforces Skillscope's hexagonal Python backend architecture. Use when creating, modifying, or reviewing backend domain models, application services, ports, FastAPI routes, CLI commands, SQLite repositories, harness plugins, composition wiring, or other code under src\u002Fskillscope.","ganan-s\u002Fskillscope","ganan-s","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F35375634?v=4","01M7D2JD9JNTDC32EMNQK3SZ8K","Ganan","01M7D2JDA79T5R2JXDV9RWEAG3",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fganan-s\u002Fskillscope\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fbackend-hexagonal-architecture\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: backend-hexagonal-architecture\ndescription: Enforces Skillscope's hexagonal Python backend architecture. Use when creating, modifying, or reviewing backend domain models, application services, ports, FastAPI routes, CLI commands, SQLite repositories, harness plugins, composition wiring, or other code under src\u002Fskillscope.\n---\n\n# Backend hexagonal architecture\n\nApply these requirements to Skillscope backend work. Read\n`docs\u002F02-backend-architecture.md` and `docs\u002F03-ingestion-contract.md` when a\nchange touches their contracts.\n\n## Dependency rule\n\nDependencies point toward the application core:\n\n```text\ndriving adapters -> application -> domain\ndriven adapters  -> application ports\ncomposition root -> all concrete adapters\n```\n\nThe domain and application layers never import FastAPI, `sqlite3`, Cursor\nformats, filesystem discovery, CLI frameworks, or frontend code.\n\n## Layers\n\n### Domain\n\nPlace harness-neutral business concepts in `skillscope.domain`:\n\n- conversation snapshots;\n- canonical ingestion events;\n- skill activations and resource reads;\n- source revisions, readiness, evidence, and diagnostics; and\n- invariants that do not depend on transport or persistence.\n\nUse immutable dataclasses or similarly plain Python types. Domain types must not\nbe database rows, Pydantic HTTP schemas, or native Cursor payloads.\n\n### Application\n\nPlace use cases and ports in `skillscope.application`.\n\nDriving ports express product operations:\n\n- ingest ready conversation snapshots;\n- list conversations;\n- get one conversation; and\n- read store metadata.\n\nDriven ports describe capabilities required by those use cases:\n\n- discover and parse harness conversations;\n- persist conversation aggregates transactionally;\n- query conversation projections;\n- inspect schema\u002Fstore metadata; and\n- obtain time or filesystem configuration only when determinism requires a\n  port.\n\nDefine ports with `typing.Protocol` or abstract base classes. Use cases depend\non ports and domain types, never concrete adapters.\n\nApplication services own orchestration and transaction boundaries. They do not\nparse Cursor JSONL, write SQL, construct HTTP responses, or read live skill\nfiles.\n\n### Driving adapters\n\nDriving adapters translate external requests into application use cases:\n\n- CLI commands;\n- FastAPI routes; and\n- a future scheduler or worker.\n\nRoutes validate and map REST DTOs, invoke one use case, and map its result.\nRoutes must not call repositories, issue SQL, invoke harness plugins, or read\nthe filesystem.\n\nCLI commands parse options, invoke use cases, and render results. They contain\nno ingest, database, or HTTP business logic.\n\n### Driven adapters\n\nDriven adapters implement application ports:\n\n- the Cursor harness adapter owns transcript roots, hook spools, native parsing,\n  and conversion to the canonical ingestion contract;\n- SQLite adapters own connections, migrations, explicit SQL, row mapping, and\n  read\u002Fwrite enforcement; and\n- compiled frontend hosting is an HTTP delivery concern, not an application\n  use case.\n\nNative Cursor shapes stop at the Cursor adapter. SQLite row shapes stop at the\nstorage adapter. Neither may leak into application or domain APIs.\n\n### Composition root\n\nKeep concrete construction in an explicit composition root such as\n`skillscope.bootstrap`.\n\nThe composition root selects configuration, creates concrete adapters, injects\nthem into use cases, and supplies those use cases to CLI or FastAPI adapters.\nDo not instantiate SQLite repositories or Cursor plugins inside use cases or\nroutes.\n\n## Required boundaries\n\n### Ingest and serve\n\nPreserve the write\u002Fread split:\n\n- `skillscope ingest` may discover harness data, migrate SQLite, and write\n  snapshots.\n- `skillscope serve` opens SQLite read-only and may only execute query ports.\n\nDo not let API routes trigger ingest, migrations, transcript discovery, or\nfilesystem snapshots.\n\n### Harness ingestion contract\n\nTreat `HarnessPlugin` as a driven port. A plugin:\n\n1. discovers native conversations;\n2. determines revision-scoped ingest eligibility;\n3. merges native evidence sources;\n4. emits one complete canonical conversation snapshot plus diagnostics; and\n5. performs no database writes.\n\nOnly confirmed successful native evidence produces `skill.activated`.\nHarness-specific tool names, fields, paths, and evidence rules remain inside\nthe adapter.\n\n### REST contract\n\nPydantic request and response models belong to the API adapter. Convert them to\napplication input\u002Foutput models at the route boundary.\n\nThe public REST contract must not expose:\n\n- SQLite column or row structures;\n- Cursor-native records;\n- internal repository objects; or\n- live filesystem behavior.\n\n## Transactions and idempotency\n\nThe ingest use case defines one transaction per conversation aggregate.\nRepository adapters implement that transaction atomically.\n\nRe-ingesting an unchanged source revision is a no-op. Re-ingesting a continued\nconversation replaces stale child snapshots. Do not scatter commits across\nparsers or repositories.\n\n## Error mapping\n\nDefine domain\u002Fapplication errors independently of transports:\n\n- not found;\n- incompatible store;\n- invalid canonical snapshot;\n- deferred or rejected native source; and\n- persistence conflict\u002Ffailure.\n\nDriving adapters map these errors to CLI exit behavior or REST responses.\nDriven adapters translate native exceptions before crossing their port.\n\nDo not expose SQL errors, raw hook payloads, or internal filesystem details\nthrough the REST API.\n\n## Implementation workflow\n\nFor each backend change:\n\n1. Identify the use case and domain behavior.\n2. Change domain types or invariants only if the product concept changed.\n3. Define or adjust the smallest necessary port.\n4. Implement behavior against the port in the application layer.\n5. Implement transport or infrastructure details in an adapter.\n6. Wire the concrete adapter only in the composition root.\n7. Verify import direction and the ingest\u002Fserve read-write boundary.\n\nDo not create an interface for internal helpers that have no adapter boundary.\nHexagonal architecture is for dependency control, not class proliferation.\n\n## Review checklist\n\n- Domain and application code are framework- and storage-independent.\n- FastAPI routes call use cases, not repositories or plugins.\n- CLI commands call use cases, not implementation helpers.\n- Cursor parsing and native evidence stay inside the Cursor adapter.\n- SQL and row mapping stay inside SQLite adapters.\n- Concrete implementations are selected only in the composition root.\n- Ingest owns writes; serve remains read-only.\n- Transactions wrap complete conversation aggregates.\n- Public DTOs do not leak adapter-specific shapes.\n- New abstractions represent real ports rather than unnecessary indirection.\n","# Backend hexagonal architecture\n\nApply these requirements to Skillscope backend work. Read\n`docs\u002F02-backend-architecture.md` and `docs\u002F03-ingestion-contract.md` when a\nchange touches their contracts.\n\n## Dependency rule\n\nDependencies point toward the application core:\n\n```text\ndriving adapters -> application -> domain\ndriven adapters  -> application ports\ncomposition root -> all concrete adapters\n```\n\nThe domain and application layers never import FastAPI, `sqlite3`, Cursor\nformats, filesystem discovery, CLI frameworks, or frontend code.\n\n## Layers\n\n### Domain\n\nPlace harness-neutral business concepts in `skillscope.domain`:\n\n- conversation snapshots;\n- canonical ingestion events;\n- skill activations and resource reads;\n- source revisions, readiness, evidence, and diagnostics; and\n- invariants that do not depend on transport or persistence.\n\nUse immutable dataclasses or similarly plain Python types. Domain types must not\nbe database rows, Pydantic HTTP schemas, or native Cursor payloads.\n\n### Application\n\nPlace use cases and ports in `skillscope.application`.\n\nDriving ports express product operations:\n\n- ingest ready conversation snapshots;\n- list conversations;\n- get one conversation; and\n- read store metadata.\n\nDriven ports describe capabilities required by those use cases:\n\n- discover and parse harness conversations;\n- persist conversation aggregates transactionally;\n- query conversation projections;\n- inspect schema\u002Fstore metadata; and\n- obtain time or filesystem configuration only when determinism requires a\n  port.\n\nDefine ports with `typing.Protocol` or abstract base classes. Use cases depend\non ports and domain types, never concrete adapters.\n\nApplication services own orchestration and transaction boundaries. They do not\nparse Cursor JSONL, write SQL, construct HTTP responses, or read live skill\nfiles.\n\n### Driving adapters\n\nDriving adapters translate external requests into application use cases:\n\n- CLI commands;\n- FastAPI routes; and\n- a future scheduler or worker.\n\nRoutes validate and map REST DTOs, invoke one use case, and map its result.\nRoutes must not call repositories, issue SQL, invoke harness plugins, or read\nthe filesystem.\n\nCLI commands parse options, invoke use cases, and render results. They contain\nno ingest, database, or HTTP business logic.\n\n### Driven adapters\n\nDriven adapters implement application ports:\n\n- the Cursor harness adapter owns transcript roots, hook spools, native parsing,\n  and conversion to the canonical ingestion contract;\n- SQLite adapters own connections, migrations, explicit SQL, row mapping, and\n  read\u002Fwrite enforcement; and\n- compiled frontend hosting is an HTTP delivery concern, not an application\n  use case.\n\nNative Cursor shapes stop at the Cursor adapter. SQLite row shapes stop at the\nstorage adapter. Neither may leak into application or domain APIs.\n\n### Composition root\n\nKeep concrete construction in an explicit composition root such as\n`skillscope.bootstrap`.\n\nThe composition root selects configuration, creates concrete adapters, injects\nthem into use cases, and supplies those use cases to CLI or FastAPI adapters.\nDo not instantiate SQLite repositories or Cursor plugins inside use cases or\nroutes.\n\n## Required boundaries\n\n### Ingest and serve\n\nPreserve the write\u002Fread split:\n\n- `skillscope ingest` may discover harness data, migrate SQLite, and write\n  snapshots.\n- `skillscope serve` opens SQLite read-only and may only execute query ports.\n\nDo not let API routes trigger ingest, migrations, transcript discovery, or\nfilesystem snapshots.\n\n### Harness ingestion contract\n\nTreat `HarnessPlugin` as a driven port. A plugin:\n\n1. discovers native conversations;\n2. determines revision-scoped ingest eligibility;\n3. merges native evidence sources;\n4. emits one complete canonical conversation snapshot plus diagnostics; and\n5. performs no database writes.\n\nOnly confirmed successful native evidence produces `skill.activated`.\nHarness-specific tool names, fields, paths, and evidence rules remain inside\nthe adapter.\n\n### REST contract\n\nPydantic request and response models belong to the API adapter. Convert them to\napplication input\u002Foutput models at the route boundary.\n\nThe public REST contract must not expose:\n\n- SQLite column or row structures;\n- Cursor-native records;\n- internal repository objects; or\n- live filesystem behavior.\n\n## Transactions and idempotency\n\nThe ingest use case defines one transaction per conversation aggregate.\nRepository adapters implement that transaction atomically.\n\nRe-ingesting an unchanged source revision is a no-op. Re-ingesting a continued\nconversation replaces stale child snapshots. Do not scatter commits across\nparsers or repositories.\n\n## Error mapping\n\nDefine domain\u002Fapplication errors independently of transports:\n\n- not found;\n- incompatible store;\n- invalid canonical snapshot;\n- deferred or rejected native source; and\n- persistence conflict\u002Ffailure.\n\nDriving adapters map these errors to CLI exit behavior or REST responses.\nDriven adapters translate native exceptions before crossing their port.\n\nDo not expose SQL errors, raw hook payloads, or internal filesystem details\nthrough the REST API.\n\n## Implementation workflow\n\nFor each backend change:\n\n1. Identify the use case and domain behavior.\n2. Change domain types or invariants only if the product concept changed.\n3. Define or adjust the smallest necessary port.\n4. Implement behavior against the port in the application layer.\n5. Implement transport or infrastructure details in an adapter.\n6. Wire the concrete adapter only in the composition root.\n7. Verify import direction and the ingest\u002Fserve read-write boundary.\n\nDo not create an interface for internal helpers that have no adapter boundary.\nHexagonal architecture is for dependency control, not class proliferation.\n\n## Review checklist\n\n- Domain and application code are framework- and storage-independent.\n- FastAPI routes call use cases, not repositories or plugins.\n- CLI commands call use cases, not implementation helpers.\n- Cursor parsing and native evidence stay inside the Cursor adapter.\n- SQL and row mapping stay inside SQLite adapters.\n- Concrete implementations are selected only in the composition root.\n- Ingest owns writes; serve remains read-only.\n- Transactions wrap complete conversation aggregates.\n- Public DTOs do not leak adapter-specific shapes.\n- New abstractions represent real ports rather than unnecessary indirection.\n",{"name":5,"description":7},"main","38802a07d3275daa93def8f87bb59ed53b4a2ad7",".cursor\u002Fskills\u002Fbackend-hexagonal-architecture","https:\u002F\u002Fgithub.com\u002Fganan-s\u002Fskillscope","https:\u002F\u002Fgithub.com\u002Fganan-s","2026-09-20 10:11:27",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add ganan-s\u002Fskillscope --skill backend-hexagonal-architecture",{"tool":36,"command":37},"bunx","bunx skills add ganan-s\u002Fskillscope --skill backend-hexagonal-architecture",{"tool":39,"command":40},"pnpm","pnpm dlx skills add ganan-s\u002Fskillscope --skill backend-hexagonal-architecture","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fganan-s\u002Fskillscope\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fbackend-hexagonal-architecture\u002FSKILL.md",true,[],[45,52,57,64,71],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M7D2KBS5S4MG82STB8SG9C6S","skillscope-probe","Benign fixture used to verify Cursor read-hook payloads.","https:\u002F\u002Fgithub.com\u002Fganan-s\u002Fskillscope\u002Fblob\u002Fmain\u002Fexperiments\u002Fcursor-hook-probe\u002Ffixtures\u002Fprobe-skill\u002FSKILL.md",[],[],{"skillNo":53,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7D2K91SSKZKFCFJRPWN6C56","https:\u002F\u002Fgithub.com\u002Fganan-s\u002Fskillscope\u002Fblob\u002Fmain\u002Fexperiments\u002Fcursor-golden-session\u002Ffixtures\u002Fprobe-skill\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7D2JZ5P0TX8HMCVEPMZ7VX5","backend-unit-testing","Enforces Skillscope's pytest unit-test conventions for the Python backend. Use when creating, modifying, or reviewing unit tests, domain logic, application use cases, canonical event parsing, test doubles, fixtures, or code under tests\u002Funit.","https:\u002F\u002Fgithub.com\u002Fganan-s\u002Fskillscope\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fbackend-unit-testing\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7D2JSWWDGZBENQ96RCKXVNV","backend-integration-testing","Enforces Skillscope's pytest integration-test conventions for the Python backend. Use when testing SQLite repositories and migrations, Cursor transcript and hook adapters, FastAPI routes, CLI wiring, composition roots, filesystem fixtures, or code under tests\u002Fintegration.","https:\u002F\u002Fgithub.com\u002Fganan-s\u002Fskillscope\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fbackend-integration-testing\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7D2JGZX7JCC3ZRPMAT2XHV4","backend-e2e-testing","Enforces Skillscope's end-to-end testing conventions for installed wheels, subprocesses, Testcontainers, Docker-compatible runtimes, live HTTP requests, and Playwright. Use when creating or reviewing tests under tests\u002Fe2e or testing packaged service and dashboard workflows.","https:\u002F\u002Fgithub.com\u002Fganan-s\u002Fskillscope\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fbackend-e2e-testing\u002FSKILL.md",[],[]]