From 0d03b42a19621628d1578e404abdae73329dfecb Mon Sep 17 00:00:00 2001 From: piyushbijarania Date: Sun, 13 Sep 2026 21:26:19 +0530 Subject: [PATCH] feat: add AI agent readiness kit and machine-readable endpoints - Add OpenAPI 3.0.1 specification (public/openapi.json) - Add Model Context Protocol manifest (public/.well-known/mcp.json) - Add static HTML API documentation at /api and /api/v1 - Add structured JSON metadata endpoint at /api/info and public/api/info.json - Update robots.txt to explicitly allow major AI crawler user-agents - Add Schema.org JSON-LD structured data in root layout - Update AI plugin manifest and llms.txt with machine-readable links --- public/.well-known/ai-plugin.json | 8 ++--- public/.well-known/mcp.json | 15 ++++++++ public/api/index.html | 33 ++++++++++++++++++ public/api/info.json | 20 +++++++++++ public/api/v1/index.html | 21 +++++++++++ public/llms.txt | 10 +++++- public/openapi.json | 58 +++++++++++++++++++++++++++++++ public/robots.txt | 19 +++++++++- src/app/[locale]/layout.tsx | 39 +++++++++++++++++++-- src/app/api/info/route.ts | 28 +++++++++++++++ 10 files changed, 243 insertions(+), 8 deletions(-) create mode 100644 public/.well-known/mcp.json create mode 100644 public/api/index.html create mode 100644 public/api/info.json create mode 100644 public/api/v1/index.html create mode 100644 public/openapi.json create mode 100644 src/app/api/info/route.ts diff --git a/public/.well-known/ai-plugin.json b/public/.well-known/ai-plugin.json index 0301ffd..47cb087 100644 --- a/public/.well-known/ai-plugin.json +++ b/public/.well-known/ai-plugin.json @@ -1,18 +1,18 @@ { "schema_version": "v1", - "name_for_human": "TODO Project name (AOSSIE Webpage Starter)", + "name_for_human": "TODO Project Name (AOSSIE Webpage Starter)", "name_for_model": "todo_project_name (aossie_webpage_starter)", - "description_for_human": "TODO Project description (AOSSIE Webpage Starter)", + "description_for_human": "TODO Project Description (AOSSIE Webpage Starter)", "description_for_model": "Retrieve settings, theme configuration, and supported locales from the TODO: Project (AOSSIE webpage starter).", "auth": { "type": "none" }, "api": { "type": "openapi", - "url": "https://TODO:project.aossie.org/openapi.yaml", + "url": "https://TODO:project.aossie.org/openapi.json", "is_user_authenticated": false }, "logo_url": "https://TODO:project.aossie.org/brand/icons/aossie_logo.svg", "contact_email": "admin@aossie.org", "legal_info_url": "https://TODO:project.aossie.org/legal" -} +} \ No newline at end of file diff --git a/public/.well-known/mcp.json b/public/.well-known/mcp.json new file mode 100644 index 0000000..9d7cc1c --- /dev/null +++ b/public/.well-known/mcp.json @@ -0,0 +1,15 @@ +{ + "schema_version": "v1", + "name": "TODO: Project Name MCP Server (AOSSIE Webpage Starter)", + "description": "Model Context Protocol server for TODO: Project (AOSSIE webpage starter)", + "version": "1.0.0", + "transport": { + "type": "sse", + "url": "https://TODO:project.aossie.org/api/mcp" + }, + "capabilities": { + "tools": true, + "resources": true, + "prompts": true + } +} \ No newline at end of file diff --git a/public/api/index.html b/public/api/index.html new file mode 100644 index 0000000..8c02ba2 --- /dev/null +++ b/public/api/index.html @@ -0,0 +1,33 @@ + + + + + + TODO: Project Name API + + + +

TODO: Project Name API

+

Version: 1.0.0

+

Machine-readable API endpoints and documentation for TODO: Project (AOSSIE Webpage Starter).

+ +

Endpoints

+ + +

Example Response

+
GET /api/info.json
+
+{
+  "name": "TODO: Project Name (AOSSIE Webpage Starter)",
+  "version": "1.0.0",
+  "description": "TODO: Project Description (AOSSIE Webpage Starter)",
+  "features": [...]
+}
+ + diff --git a/public/api/info.json b/public/api/info.json new file mode 100644 index 0000000..390d419 --- /dev/null +++ b/public/api/info.json @@ -0,0 +1,20 @@ +{ + "name": "TODO: Project Name (AOSSIE Webpage Starter)", + "version": "1.0.0", + "description": "TODO: Project Description (AOSSIE Webpage Starter)", + "repository": "https://github.com/AOSSIE-Org/Template-Repo-NextJS", + "documentation": "https://TODO:project.aossie.org/api/", + "features": [ + "Next.js 16 (App Router)", + "React 19", + "Tailwind CSS v4", + "Internationalization (next-intl)", + "AI Agent Readiness (LLMs.txt, OpenAPI, MCP)" + ], + "links": { + "home": "https://TODO:project.aossie.org/", + "docs": "https://TODO:project.aossie.org/api/", + "openapi": "https://TODO:project.aossie.org/openapi.json", + "llms": "https://TODO:project.aossie.org/llms.txt" + } +} \ No newline at end of file diff --git a/public/api/v1/index.html b/public/api/v1/index.html new file mode 100644 index 0000000..6c77ae4 --- /dev/null +++ b/public/api/v1/index.html @@ -0,0 +1,21 @@ + + + + + + TODO: Project Name API v1 + + + +

TODO: Project Name API v1

+

Version: 1.0.0

+

API v1 endpoints and specifications for TODO: Project (AOSSIE Webpage Starter).

+ +

Endpoints

+ + + diff --git a/public/llms.txt b/public/llms.txt index c20107f..8193d52 100644 --- a/public/llms.txt +++ b/public/llms.txt @@ -36,4 +36,12 @@ This repository is a high-performance webpage built on **Next.js 16 (App Router) ## 📦 Build Commands - **Build:** `npm run build` -- **Develop:** `npm run dev` \ No newline at end of file +- **Develop:** `npm run dev` +--- + +## 🤖 AI & Machine-Readable Interfaces +- [API Reference](/api/): Available API endpoints +- [OpenAPI Spec](/openapi.json): Machine-readable OpenAPI 3.0.1 specification +- [AI Plugin Manifest](/.well-known/ai-plugin.json): OpenAI plugin manifest +- [MCP Manifest](/.well-known/mcp.json): Model Context Protocol server configuration +- [Project Info](/api/info.json): Structured project metadata endpoint diff --git a/public/openapi.json b/public/openapi.json new file mode 100644 index 0000000..bd27c4e --- /dev/null +++ b/public/openapi.json @@ -0,0 +1,58 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "TODO: Project Name API (AOSSIE Webpage Starter)", + "version": "1.0.0", + "description": "API specification for TODO: Project (AOSSIE webpage starter). Replace this description with your project's purpose." + }, + "servers": [ + { + "url": "https://TODO:project.aossie.org", + "description": "Production server (Replace with your actual production domain)" + } + ], + "paths": { + "/api/info.json": { + "get": { + "summary": "Get project metadata and ecosystem information", + "description": "Returns structured JSON with project metadata, version, features, and links.", + "responses": { + "200": { + "description": "Project information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectInfo" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ProjectInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "TODO: Project Name (AOSSIE Webpage Starter)" + }, + "version": { + "type": "string", + "example": "1.0.0" + }, + "description": { + "type": "string", + "example": "TODO: Project Description (AOSSIE Webpage Starter)" + }, + "links": { + "type": "object" + } + } + } + } + } +} \ No newline at end of file diff --git a/public/robots.txt b/public/robots.txt index 47cb468..dcba36c 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,8 +1,25 @@ User-agent: * Allow: / -Disallow: /api/ Disallow: /_vercel/ +# AI crawlers - explicitly allowed +User-agent: GPTBot +Allow: / + +User-agent: ClaudeBot +Allow: / + +User-agent: anthropic-ai +Allow: / + +User-agent: PerplexityBot +Allow: / + +User-agent: CCBot +Allow: / + +User-agent: Google-Extended +Allow: / # Replace the placeholder domain TODO:'project.aossie.org' below with your actual project production domain. Sitemap: https://TODO:project.aossie.org/sitemap.xml diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index 3d7ca06..b7e2388 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -62,12 +62,49 @@ export default async function RootLayout({ // Provide messages to Client Components directly via messagesMap const messages = messagesMap[locale] || defaultMessages; + // Schema.org structured data for AI agent discoverability + // Replace fallback domain 'https://TODO:project.aossie.org' with your target production domain. + const rawSiteUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://TODO:project.aossie.org"; + const siteUrl = rawSiteUrl.replace(/\/$/, ""); + + const jsonLd = { + "@context": "https://schema.org", + "@graph": [ + { + "@type": "WebSite", + "@id": `${siteUrl}/#website`, + "url": `${siteUrl}/`, + "name": "TODO: Project Name (AOSSIE Webpage Starter)", + "description": "TODO: Project Description (AOSSIE Webpage Starter)", + }, + { + "@type": "SoftwareApplication", + "@id": `${siteUrl}/#application`, + "name": "TODO: Project Name (AOSSIE Webpage Starter)", + "applicationCategory": "WebApplication", + "operatingSystem": "Web", + "url": `${siteUrl}/`, + "author": { + "@type": "Organization", + "name": "AOSSIE", + "url": "https://aossie.org", + }, + }, + ], + }; + return ( + +