[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DJKN8AXK7640N0WEZJXC2Q":3,"skill-same:01M7DJKN8AXK7640N0WEZJXC2Q":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},"01M7DJKN8AXK7640N0WEZJXC2Q","new-payload",null,"Checklist for adding a payload type to the payload registry. Use when creating a message type that travels inside a BaseMessage, or any type a decoder must rebuild from its registered name.","C360Studio\u002Fsemengine","C360Studio","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F107274645?v=4","01M6NQ809JZG513TZ7FJX8SAKQ","Complete 360 Studio","01M7DJK5W1EEP4D1Z9F5WVJG1T",0,"MIT","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnew-payload\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: new-payload\ndescription: >-\n  Checklist for adding a payload type to the payload registry. Use when creating a message type that travels inside a\n  BaseMessage, or any type a decoder must rebuild from its registered name.\n---\n\n# Add a payload type\n\nStart from the type the user names. A payload is the typed body of a `message.BaseMessage`; the payload registry\n(`payloadregistry`) maps each type's name, `domain.category.version`, to a factory, so a decoder can rebuild the\npayload from the wire.\n\n## Step 1: Define the type\n\nThe struct implements `message.Payload` (`Schema() message.Type`, `Validate() error`, `json.Marshaler`,\n`json.Unmarshaler`):\n\n```go\n\u002F\u002F yourpackage\u002Ftypes.go\npackage yourpackage\n\nimport (\n    \"fmt\"\n\n    \"github.com\u002Fc360studio\u002Fsemengine\u002Fmessage\"\n)\n\nconst (\n    Domain          = \"yourdomain\"\n    CategoryYourCat = \"your_category\"\n    Version         = \"v1\"\n)\n\ntype YourMessage struct {\n    ID      string `json:\"id\"`\n    Content string `json:\"content\"`\n}\n\nfunc (m *YourMessage) Schema() message.Type {\n    return message.Type{Domain: Domain, Category: CategoryYourCat, Version: Version}\n}\n\nfunc (m *YourMessage) Validate() error {\n    if m.ID == \"\" {\n        return fmt.Errorf(\"id is required\")\n    }\n    return nil\n}\n```\n\nIf the payload is a graph fact and not only a transport envelope, it also implements `graph.Graphable`\n(`EntityID() string`, `Triples() []message.Triple`). `inference.ContainerEntity` (`graph\u002Finference\u002Fcontainer_entity.go`)\nis a worked example in this tree.\n\n## Step 2: MarshalJSON and UnmarshalJSON\n\nA payload's `MarshalJSON` marshals only its own fields; `BaseMessage` builds the `{\"type\":...,\"payload\":...}`\nenvelope around it (Step 5). Use a type alias, or `json.Marshal` calls the same method again and never returns:\n\n```go\nfunc (m *YourMessage) MarshalJSON() ([]byte, error) {\n    type Alias YourMessage\n    return json.Marshal((*Alias)(m))\n}\n\nfunc (m *YourMessage) UnmarshalJSON(data []byte) error {\n    type Alias YourMessage\n    return json.Unmarshal(data, (*Alias)(m))\n}\n```\n\n## Step 3: Add RegisterPayloads to your package\n\nNo `init()`. Export `RegisterPayloads(reg *payloadregistry.Registry) error`, which a composition root calls. The\nregistration carries what the framework knows about the type: the factory, the indexing profile graph-ingest stamps\non an entity born with the type when the producer declares none, and any projection contracts bound to the type.\ngraph-ingest refuses an `entity.create` stamp its registry does not hold with `message_type_unregistered`.\n\n```go\n\u002F\u002F yourpackage\u002Fpayload_registry.go\npackage yourpackage\n\nimport (\n    \"github.com\u002Fc360studio\u002Fsemengine\u002Fpayloadregistry\"\n    \"github.com\u002Fc360studio\u002Fsemengine\u002Fpkg\u002Fprojection\u002Fcontract\"\n    \"github.com\u002Fc360studio\u002Fsemengine\u002Fvocabulary\"\n)\n\n\u002F\u002F RegisterPayloads registers YourMessage (yourdomain.your_category.v1) with reg.\nfunc RegisterPayloads(reg *payloadregistry.Registry) error {\n    return reg.Register(&payloadregistry.Registration{\n        Domain:      Domain,\n        Category:    CategoryYourCat,\n        Version:     Version,\n        Description: \"Description of your message type\",\n        Factory:     func() any { return &YourMessage{} },\n        \u002F\u002F content, control, signal or trace; \"\" is accepted and counted under\n        \u002F\u002F indexing_profile_default_total{message_type}.\n        IndexingProfile: vocabulary.IndexingProfileControl,\n        \u002F\u002F Optional. An empty contract MessageType is filled with this type;\n        \u002F\u002F a different one is a registration error.\n        Contracts: []contract.Contract{YourBirthContract()},\n    })\n}\n```\n\n`Register` returns an error, never panics, when `Domain`, `Category`, `Version` or `Factory` is empty, when the name\nis already registered, when the factory's payload reports a different `Schema()`, when `IndexingProfile` is not one\nof the vocabulary's, or when a contract names another type. Join several registrations in one package with\n`errors.Join`.\nA registered Graphable's `EntityID()` and `Triples()` never panic on decoded input: return `\"\"` or omit the\ntriple whose identity cannot be constructed, and let graph-ingest reject it.\n\nA unit test that needs only a type name to pass graph-ingest's create check registers a stub with\n`payloadfixture.RegisterTestType(t, reg, types.Type{...})` (`internal\u002Fharness\u002Fpayloadfixture`); production code has\nno such helper.\n\n## Step 4: Call it from the composition root\n\nA `RegisterPayloads` that nothing calls never runs, and an import does not call it. No package of this module calls\ntwo packages' registrations (`TestNoAggregatorPackage`): the consumer's `main` package, its composition root, calls\neach package's `RegisterPayloads` itself. This module has no binary of its own. Its packages that register payloads\ntoday are `message`, `graph\u002Finference` and `pkg\u002Flifecycle`.\n\nA type registered in one of a consumer's binaries but not another fails to decode in the second. Check every binary\n(Step 6).\n\n## Step 5: Round-trip through the production decoder\n\nDrive the real wrap (`message.NewBaseMessage`) through the real decoder (`message.NewDecoder`), never a cast to an\nanonymous struct:\n\n```go\nfunc TestYourMessage_ProductionDecoderRoundTrip(t *testing.T) {\n    reg := payloadfixture.NewForTest(t)\n    require.NoError(t, yourpackage.RegisterPayloads(reg))\n\n    msg := &yourpackage.YourMessage{ID: \"test-1\", Content: \"hello\"}\n    data, err := json.Marshal(message.NewBaseMessage(msg.Schema(), msg, \"test\"))\n    require.NoError(t, err)\n\n    decoded, err := message.NewDecoder(reg).Decode(data)\n    require.NoError(t, err)\n\n    got, ok := decoded.Payload().(*yourpackage.YourMessage)\n    require.Truef(t, ok, \"decoded payload must be *YourMessage, got %T\", decoded.Payload())\n    require.Equal(t, \"test-1\", got.ID)\n}\n```\n\n## Step 6: Trace registration from every composition root\n\nFind each `main` package that should carry the type and follow the call to your `RegisterPayloads` from it. A search\nhit on the package name is not proof of a call. Where the call is missing, a message of the type fails to decode\nwith `unregistered payload type: domain.category.version` (`message\u002Fbase_message.go`); there is no fallback.\n\n## Checklist\n\n- [ ] The `Schema()` constants match the `Registration`.\n- [ ] `MarshalJSON` and `UnmarshalJSON` use a type alias; no `BaseMessage` literal.\n- [ ] `RegisterPayloads(reg *payloadregistry.Registry) error` is in the package; no `init()`.\n- [ ] The registration declares its `IndexingProfile` and any `Contracts` bound to the type.\n- [ ] A Graphable's `EntityID()` and `Triples()` return `\"\"` or omit a triple rather than panic on decoded input.\n- [ ] Every type stamped on `entity.create` is registered where graph-ingest runs; unit tests use\n      `payloadfixture.RegisterTestType`.\n- [ ] The consumer's composition root calls `RegisterPayloads`; no package of this module aggregates it.\n- [ ] The production-decoder round-trip test passes.\n\n## Common mistakes\n\n| Symptom | Cause | Fix |\n| --- | --- | --- |\n| `unregistered payload type: domain.category.version` at decode | The package's `RegisterPayloads` is never called | Call it from the composition root |\n| Stack overflow in `Marshal` or `Unmarshal` | No type alias | Add `type Alias YourMessage` |\n| `Register` returns a schema error | `Schema()` and the `Registration` disagree | Use the same constants in both |\n| `Register` returns \"already registered\" | The name is registered twice | Pick another name, or remove the second call |\n| Decodes in one binary, fails in another | One composition root lacks the call | Trace every root (Step 6) |\n\n## Debugging\n\n```go\n\u002F\u002F Every registered type in a registry.\nfor name, r := range reg.List() {\n    fmt.Printf(\"%s: %s\\n\", name, r.Description)\n}\n\n\u002F\u002F The wire shape a BaseMessage produces.\ndata, _ := json.MarshalIndent(message.NewBaseMessage(msg.Schema(), msg, \"debug\"), \"\", \"  \")\nfmt.Println(string(data))\n```\n","# Add a payload type\n\nStart from the type the user names. A payload is the typed body of a `message.BaseMessage`; the payload registry\n(`payloadregistry`) maps each type's name, `domain.category.version`, to a factory, so a decoder can rebuild the\npayload from the wire.\n\n## Step 1: Define the type\n\nThe struct implements `message.Payload` (`Schema() message.Type`, `Validate() error`, `json.Marshaler`,\n`json.Unmarshaler`):\n\n```go\n\u002F\u002F yourpackage\u002Ftypes.go\npackage yourpackage\n\nimport (\n    \"fmt\"\n\n    \"github.com\u002Fc360studio\u002Fsemengine\u002Fmessage\"\n)\n\nconst (\n    Domain          = \"yourdomain\"\n    CategoryYourCat = \"your_category\"\n    Version         = \"v1\"\n)\n\ntype YourMessage struct {\n    ID      string `json:\"id\"`\n    Content string `json:\"content\"`\n}\n\nfunc (m *YourMessage) Schema() message.Type {\n    return message.Type{Domain: Domain, Category: CategoryYourCat, Version: Version}\n}\n\nfunc (m *YourMessage) Validate() error {\n    if m.ID == \"\" {\n        return fmt.Errorf(\"id is required\")\n    }\n    return nil\n}\n```\n\nIf the payload is a graph fact and not only a transport envelope, it also implements `graph.Graphable`\n(`EntityID() string`, `Triples() []message.Triple`). `inference.ContainerEntity` (`graph\u002Finference\u002Fcontainer_entity.go`)\nis a worked example in this tree.\n\n## Step 2: MarshalJSON and UnmarshalJSON\n\nA payload's `MarshalJSON` marshals only its own fields; `BaseMessage` builds the `{\"type\":...,\"payload\":...}`\nenvelope around it (Step 5). Use a type alias, or `json.Marshal` calls the same method again and never returns:\n\n```go\nfunc (m *YourMessage) MarshalJSON() ([]byte, error) {\n    type Alias YourMessage\n    return json.Marshal((*Alias)(m))\n}\n\nfunc (m *YourMessage) UnmarshalJSON(data []byte) error {\n    type Alias YourMessage\n    return json.Unmarshal(data, (*Alias)(m))\n}\n```\n\n## Step 3: Add RegisterPayloads to your package\n\nNo `init()`. Export `RegisterPayloads(reg *payloadregistry.Registry) error`, which a composition root calls. The\nregistration carries what the framework knows about the type: the factory, the indexing profile graph-ingest stamps\non an entity born with the type when the producer declares none, and any projection contracts bound to the type.\ngraph-ingest refuses an `entity.create` stamp its registry does not hold with `message_type_unregistered`.\n\n```go\n\u002F\u002F yourpackage\u002Fpayload_registry.go\npackage yourpackage\n\nimport (\n    \"github.com\u002Fc360studio\u002Fsemengine\u002Fpayloadregistry\"\n    \"github.com\u002Fc360studio\u002Fsemengine\u002Fpkg\u002Fprojection\u002Fcontract\"\n    \"github.com\u002Fc360studio\u002Fsemengine\u002Fvocabulary\"\n)\n\n\u002F\u002F RegisterPayloads registers YourMessage (yourdomain.your_category.v1) with reg.\nfunc RegisterPayloads(reg *payloadregistry.Registry) error {\n    return reg.Register(&payloadregistry.Registration{\n        Domain:      Domain,\n        Category:    CategoryYourCat,\n        Version:     Version,\n        Description: \"Description of your message type\",\n        Factory:     func() any { return &YourMessage{} },\n        \u002F\u002F content, control, signal or trace; \"\" is accepted and counted under\n        \u002F\u002F indexing_profile_default_total{message_type}.\n        IndexingProfile: vocabulary.IndexingProfileControl,\n        \u002F\u002F Optional. An empty contract MessageType is filled with this type;\n        \u002F\u002F a different one is a registration error.\n        Contracts: []contract.Contract{YourBirthContract()},\n    })\n}\n```\n\n`Register` returns an error, never panics, when `Domain`, `Category`, `Version` or `Factory` is empty, when the name\nis already registered, when the factory's payload reports a different `Schema()`, when `IndexingProfile` is not one\nof the vocabulary's, or when a contract names another type. Join several registrations in one package with\n`errors.Join`.\nA registered Graphable's `EntityID()` and `Triples()` never panic on decoded input: return `\"\"` or omit the\ntriple whose identity cannot be constructed, and let graph-ingest reject it.\n\nA unit test that needs only a type name to pass graph-ingest's create check registers a stub with\n`payloadfixture.RegisterTestType(t, reg, types.Type{...})` (`internal\u002Fharness\u002Fpayloadfixture`); production code has\nno such helper.\n\n## Step 4: Call it from the composition root\n\nA `RegisterPayloads` that nothing calls never runs, and an import does not call it. No package of this module calls\ntwo packages' registrations (`TestNoAggregatorPackage`): the consumer's `main` package, its composition root, calls\neach package's `RegisterPayloads` itself. This module has no binary of its own. Its packages that register payloads\ntoday are `message`, `graph\u002Finference` and `pkg\u002Flifecycle`.\n\nA type registered in one of a consumer's binaries but not another fails to decode in the second. Check every binary\n(Step 6).\n\n## Step 5: Round-trip through the production decoder\n\nDrive the real wrap (`message.NewBaseMessage`) through the real decoder (`message.NewDecoder`), never a cast to an\nanonymous struct:\n\n```go\nfunc TestYourMessage_ProductionDecoderRoundTrip(t *testing.T) {\n    reg := payloadfixture.NewForTest(t)\n    require.NoError(t, yourpackage.RegisterPayloads(reg))\n\n    msg := &yourpackage.YourMessage{ID: \"test-1\", Content: \"hello\"}\n    data, err := json.Marshal(message.NewBaseMessage(msg.Schema(), msg, \"test\"))\n    require.NoError(t, err)\n\n    decoded, err := message.NewDecoder(reg).Decode(data)\n    require.NoError(t, err)\n\n    got, ok := decoded.Payload().(*yourpackage.YourMessage)\n    require.Truef(t, ok, \"decoded payload must be *YourMessage, got %T\", decoded.Payload())\n    require.Equal(t, \"test-1\", got.ID)\n}\n```\n\n## Step 6: Trace registration from every composition root\n\nFind each `main` package that should carry the type and follow the call to your `RegisterPayloads` from it. A search\nhit on the package name is not proof of a call. Where the call is missing, a message of the type fails to decode\nwith `unregistered payload type: domain.category.version` (`message\u002Fbase_message.go`); there is no fallback.\n\n## Checklist\n\n- [ ] The `Schema()` constants match the `Registration`.\n- [ ] `MarshalJSON` and `UnmarshalJSON` use a type alias; no `BaseMessage` literal.\n- [ ] `RegisterPayloads(reg *payloadregistry.Registry) error` is in the package; no `init()`.\n- [ ] The registration declares its `IndexingProfile` and any `Contracts` bound to the type.\n- [ ] A Graphable's `EntityID()` and `Triples()` return `\"\"` or omit a triple rather than panic on decoded input.\n- [ ] Every type stamped on `entity.create` is registered where graph-ingest runs; unit tests use\n      `payloadfixture.RegisterTestType`.\n- [ ] The consumer's composition root calls `RegisterPayloads`; no package of this module aggregates it.\n- [ ] The production-decoder round-trip test passes.\n\n## Common mistakes\n\n| Symptom | Cause | Fix |\n| --- | --- | --- |\n| `unregistered payload type: domain.category.version` at decode | The package's `RegisterPayloads` is never called | Call it from the composition root |\n| Stack overflow in `Marshal` or `Unmarshal` | No type alias | Add `type Alias YourMessage` |\n| `Register` returns a schema error | `Schema()` and the `Registration` disagree | Use the same constants in both |\n| `Register` returns \"already registered\" | The name is registered twice | Pick another name, or remove the second call |\n| Decodes in one binary, fails in another | One composition root lacks the call | Trace every root (Step 6) |\n\n## Debugging\n\n```go\n\u002F\u002F Every registered type in a registry.\nfor name, r := range reg.List() {\n    fmt.Printf(\"%s: %s\\n\", name, r.Description)\n}\n\n\u002F\u002F The wire shape a BaseMessage produces.\ndata, _ := json.MarshalIndent(message.NewBaseMessage(msg.Schema(), msg, \"debug\"), \"\", \"  \")\nfmt.Println(string(data))\n```\n",{"name":5,"description":7},"main","a8dd79128471bb120c59ffc1f2c5fdcc74d28c2b",".agents\u002Fskills\u002Fnew-payload","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine","https:\u002F\u002Fgithub.com\u002FC360Studio","2026-11-15 06:29:50",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add C360Studio\u002Fsemengine --skill new-payload",{"tool":36,"command":37},"bunx","bunx skills add C360Studio\u002Fsemengine --skill new-payload",{"tool":39,"command":40},"pnpm","pnpm dlx skills add C360Studio\u002Fsemengine --skill new-payload","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnew-payload\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"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},"01M7DJNADQDES9RFB0RF39MARV","semengine-status","Report SemEngine Slice 04A package port progress, active PR claims, known flakes, and GitHub milestone\u002Fissue queue hygiene, and sync the GitHub Project v2 tracker. Use when asked for port status, auditing the issue queue, or updating the project board.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsemengine-status\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7DJN7JPA0M9VZZ5RRZ6XEMW","review-pr","Adapter for review-pr.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Freview-pr\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7DJN4VWVKR8B6Z7XVPKWGD8","query-pattern","Choose how code reads the graph: graph-ingest's declared request verbs, the typed exact-entity reader, or an owner's bucket access. Use when a component or a consumer needs to read entities.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fquery-pattern\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7DJN0VZEF1BYN6QCZDGRNF5","preflight","Select and run the existing SemEngine verification gates for a concrete diff before an implementation push or local-readiness assessment.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpreflight\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7DJMZVCQQ7C0XBF8S65SAV2","ponytail","Adapter for ponytail.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fponytail\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7DJMYVPY0TAV1TBKSAP36ZZ","pickup","Adapter for pickup.","https:\u002F\u002Fgithub.com\u002FC360Studio\u002Fsemengine\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpickup\u002FSKILL.md",[],[]]