Skip to content

Phase 1 — TMP fixes for templates with UIS services - #25

Merged
terchris merged 6 commits into
mainfrom
feature/p1-tmp-template-docs-fixes
Apr 9, 2026
Merged

Phase 1 — TMP fixes for templates with UIS services#25
terchris merged 6 commits into
mainfrom
feature/p1-tmp-template-docs-fixes

Conversation

@terchris

@terchris terchris commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ships the TMP-side Phase 1 work from INVESTIGATE-improve-template-docs-with-services.md. Fixes the bugs real-user testing surfaced in python-basic-webserver-database and postgresql-demo, plus the cross-cutting MDX generator and template hygiene issues.

Cross-team dependencies (both already shipped):

Changes by phase

Phase 1 — Independent TMP fixes (no external deps)

  • Generator routes install command by template context — postgresql-demo now shows uis template install postgresql-demo instead of dev-template postgresql-demo
  • Generator stops emitting the duplicated ## Summary section
  • Add .gitignore to both templates (excludes .env*, .venv/, Python build artifacts)

Phase 2 — postgresql-demo README rewrite

  • Drop "From the UIS provision-host:" prefix throughout — commands work from DCT via the v1.7.34 shim
  • Populate related: [python-basic-webserver-database] so the auto-generated "Related Templates" section appears
  • Add Prerequisites section explaining UIS provision-host requirement
  • Replace manual psql connection example with uis connect postgresql demo_db

Phase 3 — python-basic-webserver-database README rewrite

  • Add "What this is" section with endpoints table (/, /tasks, /health)
  • Add Prerequisites section
  • Replace Quick Start with the canonical 7-step workflow:
    1. dev-template python-basic-webserver-database
    2. Edit template-info.yaml params
    3. (Optional) Customise config/init-database.sql
    4. dev-template-configure
    5. uis connect postgresql my_cool_app_db (verify the database)
    6. uv venv && uv pip install -r requirements.txt && python app/app.py
    7. Open in browser via VS Code Ports tab
  • Embed template-info.yaml and config/init-database.sql content inline so users see what they're editing
  • Drop "Docker Build" and "Kubernetes Deployment" sections, replace with single "Deploy" section using GitHub Actions + ArgoCD
  • Quick Start uses uv (not pip) — DCT ships uv

Phase 4 — Cross-cutting docs

  • readme-structure.md documents the new conventions for templates with requires
  • Drop "Docker Build" and "Kubernetes Deployment" from suggested optional sections
  • validate-rules.conf no longer warns on those headings — new templates should use a single "Deploy" section instead

What's NOT in this PR (intentionally)

  • .vscode/settings.json for python-envs.alwaysUseUv — initially shipped, then reverted to avoid risk of overwriting users' existing .vscode/extensions.json (which contains the devcontainer recommendation needed for the project to start). The setting is documented in the README as a manual one-line addition users can make if they hit the cosmetic VS Code warning.

Follow-ups for DCT (not blocking this PR)

Two findings during 1.6 verification:

  1. Hidden-directory copy bug: the bulk cp -r "$TEMPLATE_PATH/"* "$CALLER_DIR/" in dev-template.sh doesn't include hidden directories like .vscode/. The .gitignore is handled explicitly so that part works.
  2. JSON merge needed for .vscode/: if DCT ever wants to support .vscode/ files in templates, they need (a) hidden-directory copy AND (b) JSON-merge for .vscode/*.json files (like they already have for .gitignore's line-merge).
  3. Ship python-envs.alwaysUseUv globally: ideally as a base devcontainer setting. Then no template needs to ship it.

Test plan

  • bash scripts/validate-metadata.sh — 5 categories, 10 templates valid
  • bash scripts/validate-docs.sh — 0 errors, 2 warnings (unrelated plan-based-workflow README)
  • bash scripts/generate-docs-markdown.sh --force — generates 10 template detail pages
  • npm run build --prefix website — passes inside the devcontainer
  • postgresql-demo MDX page shows install="uis template install postgresql-demo"
  • python-basic-webserver-database MDX page uses the new canonical workflow
  • No ## Summary section emitted by generator for any template
  • CI pipeline is green after merge
  • Real-user re-test against the rewritten python-basic-webserver-database README (post-merge)

🤖 Generated with Claude Code

terchris and others added 6 commits April 9, 2026 12:09
Cross-team investigation (TMP, UIS, DCT) capturing real-user testing
of python-basic-webserver-database. Phased fix plan: ship now (Phase 1),
improvements (Phase 2), polish (Phase 3), explicit deferrals (Future).

UIS shipped item 1.10 (uis configure --namespace) in PR #121.
DCT shipped items 1.8 + 1.9 in v1.7.34 (PR #90). TMP is unblocked
to start the README rewrites.

Also includes:
- INVESTIGATE-github-actions-node24-migration.md (deferred work)
- PLAN-p1-tmp-template-docs-fixes.md (this PR's plan)
- .gitignore: ignore .claude/ and .devcontainer/backup/

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tasks 1.1-1.7 from PLAN-p1-tmp-template-docs-fixes.md (no external
dependencies — DCT v1.7.34 and UIS PR #121 are already live for the
later phases).

Generator fixes:
- 1.1: Route install command by template context. UIS stack templates
  (context: uis) now show `uis template install <id>` instead of the
  incorrect `dev-template <id>`. Solves A2.
- 1.2: Stop emitting the duplicated `## Summary` section. The
  TemplateHeader description and README intro carry the content.
  Solves C1.

Template hygiene:
- 1.3: Add .gitignore to python-basic-webserver-database (excludes
  .env*, .venv/, Python build artifacts). Solves C6.
- 1.4: Add .gitignore to postgresql-demo (sets the standard for stack
  templates).
- 1.5: Add .vscode/settings.json with python-envs.alwaysUseUv: true so
  VS Code uses uv for package operations on uv-created venvs. Solves B6.

Verification (1.6) found a DCT bug to flag in a follow-up: the bulk
copy `cp -r .../*` in dev-template.sh does not include hidden
directories like .vscode/. The .gitignore is handled explicitly so
that part works. Not blocking this PR — we ship the template files;
DCT fixes their copy logic separately.

Validation (1.7):
- validate-metadata.sh: 5 categories, 10 templates valid
- validate-docs.sh: 0 errors
- npm run build: SUCCESS in devcontainer

Plan moved from backlog/ to active/, Phase 1 marked DONE.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tasks 2.1-2.5 from PLAN-p1-tmp-template-docs-fixes.md.

- 2.1: Drop "From the UIS provision-host:" prefix. Commands now work
  from DCT (via the v1.7.34 shim), host, or UIS context.
- 2.2: Populate related: in template-info.yaml with
  python-basic-webserver-database. The auto-generated "Related
  Templates" section now appears at the bottom of the page.
- 2.3: Add a "Before you start" section explaining the UIS
  provision-host requirement.
- 2.4: Replace manual psql connection example with `uis connect
  postgresql demo_db` as the primary verify path.
- 2.5: Regenerate docs and rebuild — passes.

The "Try this with" section now links to python-basic-webserver-database
as the consumer-side companion, completing the producer/consumer
discovery loop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…eadme-structure.md updates

Phase 3 — python-basic-webserver-database README rewrite around the
canonical 7-step workflow:

- 3.1: Add "What this is" section with endpoints table
- 3.2: Add Prerequisites section (UIS provision-host running check,
  uis shim mention)
- 3.3: Replace Quick Start with the canonical workflow:
  1. dev-template python-basic-webserver-database
  2. Edit template-info.yaml params
  3. (Optional) Customise config/init-database.sql
  4. dev-template-configure
  5. uis connect postgresql my_cool_app_db (verify the database)
  6. uv venv + uv pip install + python app/app.py
  7. Open in browser via VS Code Ports tab
- 3.4: Embed template-info.yaml content inline
- 3.5: Embed config/init-database.sql content inline
- 3.6: Drop "Docker Build" and "Kubernetes Deployment" sections,
  replace with single "Deploy" section using GitHub Actions + ArgoCD
- 3.7: Quick Start uses uv (matches B5 + the .vscode/settings.json
  shipped in 1.5)
- 3.8: Validation passes, build SUCCESS

Phase 4 — Cross-cutting docs and validation rules:

- 4.1+4.2: readme-structure.md documents Prerequisites and
  "Verify it worked" requirements for templates with requires
- 4.3: Drop "Docker Build" and "Kubernetes Deployment" from both
  validate-rules.conf (no more spurious warnings) and
  readme-structure.md (no longer in suggested optional sections list).
  New templates should use a single "Deploy" section instead.
- 4.4: readme-structure.md requires inline embedding of
  template-info.yaml and init file contents for templates with requires
- 4.5: Per-template enforcement deferred — would need template-info
  awareness in validate-docs.sh, tracked as follow-up.

Validation results after both phases:
- validate-metadata.sh: 5 categories, 10 templates valid
- validate-docs.sh: 0 errors, 2 warnings (unrelated plan-based-workflow)
- npm run build: SUCCESS

Plan status: Completed (pending PR merge).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The .vscode/settings.json shipped in 1.5 risks overwriting the user's
existing .vscode/extensions.json (which contains the devcontainer
recommendation needed for the project to start) if DCT ever fixes its
hidden-directory copy bug. Naive bulk-copy of .vscode/ would clobber
project files.

Reverted approach:
- Remove templates/python-basic-webserver-database/.vscode/settings.json
- Document the python-envs.alwaysUseUv setting in the README as a
  manual one-line addition users can make to their workspace settings
  if they hit the VS Code "Error refreshing packages" cosmetic error.
- Note that they should add it to their existing settings.json, not
  replace the file.

DCT follow-up (tracked in 1.5/1.6 plan notes):
- Ideally DCT ships python-envs.alwaysUseUv globally in the base
  devcontainer image. Then no template needs to ship it.
- If DCT wants to support .vscode/ files in templates in the future,
  they need (a) hidden-directory copy AND (b) JSON-merge for
  .vscode/*.json files (similar to the .gitignore line-merge they
  already have).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@terchris
terchris merged commit d48b1b9 into main Apr 9, 2026
@terchris
terchris deleted the feature/p1-tmp-template-docs-fixes branch April 9, 2026 10:48
terchris added a commit that referenced this pull request Apr 9, 2026
Phase 1 of PLAN-p1-tmp-template-docs-fixes.md is fully shipped:
- All 4 sub-phases complete
- PR #25 merged
- CI green (generate, build, deploy all passed)
- Site deployed

The investigation INVESTIGATE-improve-template-docs-with-services.md
stays in backlog/ — it has Phase 2 and Phase 3 still pending. Only the
TMP Phase 1 portion is done.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant