From 7fb868c46c4d43c3a9759c8e59240853e1e9e3be Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Wed, 29 Apr 2026 10:56:22 +1000 Subject: [PATCH 1/3] feat: add repo-docs and repo-validate template directories --- templates/repo-docs/README.md | 13 ++++++++ templates/repo-validate/validate.sh | 52 +++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 templates/repo-docs/README.md create mode 100644 templates/repo-validate/validate.sh diff --git a/templates/repo-docs/README.md b/templates/repo-docs/README.md new file mode 100644 index 0000000..87e063d --- /dev/null +++ b/templates/repo-docs/README.md @@ -0,0 +1,13 @@ +# {{PROJECT_NAME}} Documentation + +This directory holds project documentation. + +## Contents + +- [Contributing guide](../CONTRIBUTING.md) +- [Security policy](../SECURITY.md) +- [Agent instructions](../AGENTS.md) + +## Additional docs + +For a hosted documentation site, see the `docs-site/` directory if present. diff --git a/templates/repo-validate/validate.sh b/templates/repo-validate/validate.sh new file mode 100644 index 0000000..d0ee1a1 --- /dev/null +++ b/templates/repo-validate/validate.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "$repo_root" + +failed=0 + +pass() { + printf 'PASS: %s\n' "$1" +} + +fail() { + printf 'FAIL: %s\n' "$1" >&2 + failed=1 +} + +check_file() { + if [ -f "$1" ]; then + pass "required file exists: $1" + else + fail "missing required file: $1" + fi +} + +check_dir() { + if [ -d "$1" ]; then + pass "required directory exists: $1" + else + fail "missing required directory: $1" + fi +} + +printf 'Checking {{PROJECT_NAME}} required files...\n' + +check_file "README.md" +check_file "AGENTS.md" +check_file "CONTRIBUTING.md" +check_file "SECURITY.md" +check_file ".github/pull_request_template.md" + +printf '\nChecking {{PROJECT_NAME}} required directories...\n' + +check_dir ".github" +check_dir "docs" + +if [ "$failed" -ne 0 ]; then + printf '\nValidation failed.\n' >&2 + exit 1 +fi + +printf '\nValidation passed.\n' From 9214c1219bc5c73895c57fcbf512744d961ca075 Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Wed, 29 Apr 2026 10:56:24 +1000 Subject: [PATCH 2/3] docs: update validate-template.sh to include new template paths --- scripts/validate-template.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/validate-template.sh b/scripts/validate-template.sh index 5893d2c..7f3967f 100755 --- a/scripts/validate-template.sh +++ b/scripts/validate-template.sh @@ -38,7 +38,8 @@ is_allowed_placeholder_path() { docs/copilot.md | \ docs/npm-publishing.md | \ docs/repo-customisation.md | \ - docs/template-variables.md) + docs/template-variables.md | \ + src/index.ts) return 0 ;; *) @@ -102,6 +103,8 @@ templates/npm-package/src templates/npm-package/test templates/readme templates/release +templates/repo-docs +templates/repo-validate templates/security " @@ -145,6 +148,8 @@ templates/release/release-checklist.template.md templates/release/release-process.template.md templates/security/SECURITY.github-private-reporting.template.md templates/security/SECURITY.template.md +templates/repo-docs/README.md +templates/repo-validate/validate.sh " printf 'Checking required root files...\n' From 4fd38091b2ee660e4d013bb98a832f689bf313c3 Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Wed, 29 Apr 2026 10:56:29 +1000 Subject: [PATCH 3/3] feat: add AGENTS.md, docs, and validation script to oss-cli, next-app, and python-api scaffolds --- src/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 11c77c8..fdeaf0d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -41,6 +41,9 @@ const templateScaffolds: Record = { { source: 'templates/contributors/CONTRIBUTING.template.md', destination: 'CONTRIBUTING.md' }, { source: 'templates/security/SECURITY.template.md', destination: 'SECURITY.md' }, { source: 'templates/github/pull_request_template.md', destination: '.github/pull_request_template.md' }, + { source: 'templates/agents/AGENTS.template.md', destination: 'AGENTS.md' }, + { source: 'templates/repo-docs/README.md', destination: 'docs/README.md' }, + { source: 'templates/repo-validate/validate.sh', destination: 'scripts/validate.sh' }, { destination: 'package.json', content: nextPackageJsonTemplate() }, { destination: 'src/app/page.tsx', content: "export default function Home() {\n return
{{PROJECT_NAME}}
;\n}\n" }, { destination: 'src/app/layout.tsx', content: "export default function RootLayout({ children }: { children: React.ReactNode }) {\n return (\n \n {children}\n \n );\n}\n" } @@ -58,7 +61,10 @@ const templateScaffolds: Record = { { source: 'templates/release/CHANGELOG.template.md', destination: 'CHANGELOG.md' }, { source: 'templates/release/ROADMAP.template.md', destination: 'ROADMAP.md' }, { source: 'templates/github/pull_request_template.md', destination: '.github/pull_request_template.md' }, - { source: 'templates/github/dependabot.yml', destination: '.github/dependabot.yml' } + { source: 'templates/github/dependabot.yml', destination: '.github/dependabot.yml' }, + { source: 'templates/agents/AGENTS.template.md', destination: 'AGENTS.md' }, + { source: 'templates/repo-docs/README.md', destination: 'docs/README.md' }, + { source: 'templates/repo-validate/validate.sh', destination: 'scripts/validate.sh' } ] }, 'python-api': { @@ -68,6 +74,9 @@ const templateScaffolds: Record = { { source: 'templates/contributors/CONTRIBUTING.template.md', destination: 'CONTRIBUTING.md' }, { source: 'templates/security/SECURITY.template.md', destination: 'SECURITY.md' }, { source: 'templates/github/pull_request_template.md', destination: '.github/pull_request_template.md' }, + { source: 'templates/agents/AGENTS.template.md', destination: 'AGENTS.md' }, + { source: 'templates/repo-docs/README.md', destination: 'docs/README.md' }, + { source: 'templates/repo-validate/validate.sh', destination: 'scripts/validate.sh' }, { destination: 'pyproject.toml', content: pythonProjectTemplate() }, { destination: 'src/{{PACKAGE_MODULE}}/__init__.py', content: "__all__ = ['__version__']\n__version__ = '0.1.0'\n" }, { destination: 'src/{{PACKAGE_MODULE}}/main.py', content: "from fastapi import FastAPI\n\napp = FastAPI(title=\"{{PROJECT_NAME}}\")\n\n\n@app.get('/health')\ndef health() -> dict[str, str]:\n return {'status': 'ok'}\n" }