Skip to content

code

The code parent type covers software-related content including repositories, package registries, code snippets, gists, notebooks, and code documentation. It captures the metadata developers and agents need to evaluate, compare, and use software.

SubtypeQualified TypeDescription
repositorycode.repositorySource code repository (e.g., GitHub repo)
packagecode.packagePackage registry listing (e.g., npm, PyPI)
snippetcode.snippetCode snippet or example
gistcode.gistGist or short code share
notebookcode.notebookJupyter or computational notebook
documentationcode.documentationCode-level documentation (e.g., JSDoc, Rustdoc)
FieldTypeRequiredDescription
repositorystringYesRepository or package name
languagestringNoPrimary programming language
licensestringNoLicense identifier (SPDX format preferred)
starsintegerNoStar or favorite count
forksintegerNoFork count
dependenciesarray<string>NoKey dependencies
package_managerstringNoPackage manager (npm, pip, cargo, etc.)
code type_data
{
"type_data": {
"repository": "vercel/next.js",
"language": "TypeScript",
"license": "MIT",
"stars": 128400,
"forks": 27200,
"dependencies": [
"react",
"react-dom",
"webpack",
"turbopack",
"swc"
],
"package_manager": "npm"
}
}
  • repository should use the owner/repo format for repositories, or the package name for package listings.
  • language is the primary language. Multi-language projects should list the dominant language here; secondary languages can be captured in entities or sections.
  • license should use SPDX identifiers where possible (e.g., "MIT", "Apache-2.0", "GPL-3.0-only").
  • stars and forks are point-in-time counts from when the page was fetched. Use source.fetch_timestamp to determine currency.
  • dependencies lists key dependencies, not the complete dependency tree. The intent is to give agents a quick signal about the project’s ecosystem.
  • For code documentation that also serves as API reference, use aspects: ["documentation.api_reference"].