Skip to content

Commit 6790217

Browse files
fix: scaffold emits type-correct workflow set and derives stale literals
mcp-server repos no longer get the cursor-plugin-specific validate.yml and release.yml. Per standards/ci-cd.md, validate.yml's checks all assume a plugin.json and publish.yml replaces release.yml, so the emitted set now matches standards/drift-checker.config.json exactly (drift-check, stale, publish) plus the optional-for-both pages and label-sync. Also derive the LICENSE copyright year from the current UTC year instead of a hardcoded 2026, make plugin.json keywords type-aware (drop the stock "mcp" keyword unless the repo has an MCP server), add PyYAML to the CI test environment so the YAML-validating tests stop silently importorskip-ing, and add a born-green integration test that renders each type and asserts detected type, empty drift, current markers/pins, README counts, and the exact workflow set. Bumps VERSION 1.16.2 -> 1.16.3. Signed-off-by: fOuttaMyPaint <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 3be50f3 commit 6790217

9 files changed

Lines changed: 275 additions & 113 deletions

File tree

.github/workflows/validate.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,12 @@ jobs:
204204
grep -q '<!-- standards-version:' /tmp/scaffold-test/ci-test-plugin/AGENTS.md \
205205
|| { echo "::error::AGENTS.md missing standards-version marker"; exit 1; }
206206
207-
# LICENSE has correct CC-BY-NC-ND-4.0 copyright (TM Hospitality Strategies, not TMHSDigital)
208-
grep -q 'Copyright (c) 2026 TM Hospitality Strategies' /tmp/scaffold-test/ci-test-plugin/LICENSE \
209-
|| { echo "::error::LICENSE missing canonical 'TM Hospitality Strategies' copyright line"; exit 1; }
207+
# LICENSE has correct CC-BY-NC-ND-4.0 copyright (TM Hospitality Strategies, not TMHSDigital).
208+
# The year is DERIVED from the current UTC year at generation time, so assert against
209+
# that rather than a hardcoded literal (which would itself go stale every January 1).
210+
YEAR=$(date -u +%Y)
211+
grep -q "Copyright (c) ${YEAR} TM Hospitality Strategies" /tmp/scaffold-test/ci-test-plugin/LICENSE \
212+
|| { echo "::error::LICENSE missing canonical 'Copyright (c) ${YEAR} TM Hospitality Strategies' line"; exit 1; }
210213
grep -q 'SPDX-License-Identifier: CC-BY-NC-ND-4.0' /tmp/scaffold-test/ci-test-plugin/LICENSE \
211214
|| { echo "::error::LICENSE missing SPDX-License-Identifier"; exit 1; }
212215

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.16.2
1+
1.16.3

requirements-test.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
pytest>=8.0,<9.0
2+
# PyYAML is required by the YAML-validating tests (test_release_doc_sync.py,
3+
# test_composite_action_shape.py). Without it those tests pytest.importorskip
4+
# and silently skip in CI, hiding real coverage.
5+
PyYAML>=6.0,<7.0
6+
# Jinja2 is required by the born-green scaffold integration test, which renders
7+
# a repo of each type and runs the drift checker against the output.
8+
Jinja2>=3.1,<4.0

scaffold/create-tool.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"""
88

99
import argparse
10+
import datetime
1011
import os
1112
import re
1213
import sys
@@ -206,6 +207,7 @@ def main():
206207
"meta_minor": meta_minor,
207208
"meta_patch": meta_patch,
208209
"meta_version": f"{meta_major}.{meta_minor}.{meta_patch}",
210+
"year": datetime.datetime.now(datetime.timezone.utc).year,
209211
}
210212

211213
print(f"\nScaffolding '{args.name}' ({slug}) into {output_dir}\n")
@@ -214,15 +216,22 @@ def main():
214216
if args.type == "cursor-plugin":
215217
write_file(output_dir, ".cursor-plugin/plugin.json", render_template(env, "plugin.json.j2", ctx))
216218

217-
# GitHub workflows — branched by type
219+
# GitHub workflows - emitted set is type-specific and must match the
220+
# per-type required_workflows in standards/drift-checker.config.json plus
221+
# the two optional-for-both workflows (pages, label-sync). Do NOT emit
222+
# cursor-plugin-specific workflows for mcp-server repos: validate.yml's
223+
# checks all assume a plugin.json and publish.yml replaces release.yml
224+
# (see standards/ci-cd.md "MCP-server Variations").
218225
if args.type == "mcp-server":
219-
write_file(output_dir, ".github/workflows/validate.yml", render_template(env, "validate.mcp.yml.j2", ctx))
220-
write_file(output_dir, ".github/workflows/release.yml", render_template(env, "release.mcp.yml.j2", ctx))
221-
write_file(output_dir, ".github/workflows/pages.yml", render_template(env, "pages.mcp.yml.j2", ctx))
226+
# Required for mcp-server: drift-check, stale, publish.
222227
write_file(output_dir, ".github/workflows/publish.yml", render_template(env, "publish.yml.j2", ctx))
228+
# Optional-for-both: pages (mcp variant), label-sync.
229+
write_file(output_dir, ".github/workflows/pages.yml", render_template(env, "pages.mcp.yml.j2", ctx))
223230
else:
231+
# Required for cursor-plugin: validate, release, stale, drift-check.
224232
write_file(output_dir, ".github/workflows/validate.yml", render_template(env, "validate.yml.j2", ctx))
225233
write_file(output_dir, ".github/workflows/release.yml", render_template(env, "release.yml.j2", ctx))
234+
# Optional-for-both: pages, label-sync.
226235
write_file(output_dir, ".github/workflows/pages.yml", render_template(env, "pages.yml.j2", ctx))
227236
write_file(output_dir, ".github/workflows/stale.yml", render_template(env, "stale.yml.j2", ctx))
228237
write_file(output_dir, ".github/workflows/drift-check.yml", render_template(env, "drift-check.yml.j2", ctx))

scaffold/templates/LICENSE.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% if license_key == 'mit' %}
22
MIT License
33

4-
Copyright (c) 2026 {{ author_name }}
4+
Copyright (c) {{ year }} {{ author_name }}
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
@@ -25,7 +25,7 @@ Apache License
2525
Version 2.0, January 2004
2626
http://www.apache.org/licenses/
2727

28-
Copyright (c) 2026 {{ author_name }}
28+
Copyright (c) {{ year }} {{ author_name }}
2929

3030
Licensed under the Apache License, Version 2.0 (the "License");
3131
you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ limitations under the License.
4141
{% else %}
4242
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International
4343

44-
Copyright (c) 2026 TM Hospitality Strategies
44+
Copyright (c) {{ year }} TM Hospitality Strategies
4545

4646
This work is licensed under the Creative Commons
4747
Attribution-NonCommercial-NoDerivatives 4.0 International License.

scaffold/templates/plugin.json.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"license": "{{ license_spdx }}",
1111
"keywords": [
1212
"cursor-plugin",
13-
"developer-tools",
14-
"mcp"
13+
"developer-tools"{% if has_mcp %},
14+
"mcp"{% endif +%}
1515
],
1616
"skills": [
1717
{% for skill in skills %}

scaffold/templates/release.mcp.yml.j2

Lines changed: 0 additions & 72 deletions
This file was deleted.

scaffold/templates/validate.mcp.yml.j2

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)