Skip to content

feat(create): add --describe with generated-project layout hints - #176

Merged
webup merged 1 commit into
ob-labs:mainfrom
popwatt:feat/create-describe-template
Aug 12, 2026
Merged

feat(create): add --describe with generated-project layout hints#176
webup merged 1 commit into
ob-labs:mainfrom
popwatt:feat/create-describe-template

Conversation

@popwatt

@popwatt popwatt commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

From-scratch implementation of the template description mode for agentseek create (issue #90).

  • agentseek create bub/default --describe prints the template spec, its description from templates/index.json, the template path, every Cookiecutter input variable from cookiecutter.json, and the project layout the template will generate (top-level entries expanded one level).
  • Bundled templates are resolved exactly like normal create (same catalog, same --checkout/--template-repo handling).
  • Does not run Cookiecutter and creates no files in describe mode.
  • External specs (URL / absolute path) with --describe exit 2 with a clear message.
  • Preserves existing --list-templates, --template, --checkout, --no-input, and --filter behavior.

Note: #115 already merged a baseline --describe. This PR is a re-implementation that additionally covers the "key generated-project hints when available" requirement from #90 (the Generated project layout block), which #115 does not print.

Testing

  • uv run python -m pytest tests/cli_commands/test_create.py -q (119 passed, 6 skipped)
  • uv run python -m pytest tests/ -q (1098 passed, 53 skipped)
  • uv run ruff check src/agentseek/cli/commands/create.py tests/cli_commands/test_create.py
  • uv run ruff format --check src/agentseek/cli/commands/create.py tests/cli_commands/test_create.py
  • Manual: describe output shows Template / Description / Path / Cookiecutter variables / Generated project layout

Refs #90

@popwatt
popwatt force-pushed the feat/create-describe-template branch from 21eeebd to 157127b Compare August 11, 2026 15:09
@popwatt

popwatt commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

#90

@webup webup left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the generated-project layout hints. There is one blocking correctness issue:

  • _template_layout_hints() enumerates every entry directly under template_dir, but Cookiecutter selects the templated child directory (for example, {{cookiecutter.project_slug}}/) and renders only that tree. As a result, bundled templates such as bub/default report the template repository’s outer, author-facing README.md as generated output even though Cookiecutter ignores it; the output can show a second root-level README.md that will not exist in the generated project.

Please locate the actual project template directory using Cookiecutter’s selection semantics (or equivalent), derive the hints from that directory, and add a regression test asserting that a template-root metadata file is excluded from the generated layout.

From-scratch implementation of template inspection for `agentseek create`:
print template spec, description from templates/index.json, cookiecutter.json
input variables, and the project layout the template will generate. Does not
run cookiecutter or create any files; external specs are rejected.
@popwatt
popwatt force-pushed the feat/create-describe-template branch from 157127b to c764d3f Compare August 12, 2026 06:10
@popwatt

popwatt commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review! Fixed the blocking issue.

_template_layout_hints now locates the templated project directory using Cookiecutter's selection semantics (see cookiecutter.find.find_template: the child whose name contains cookiecutter plus the {{ / }} Jinja2 delimiters) and derives the layout from that directory only. Template-root metadata such as the author-facing README.md, cookiecutter.json, and hooks/ are no longer reported as generated output.

Added regression coverage:

  • test_template_layout_hints_uses_cookiecutter_project_dir — asserts a template-root README.md is excluded from the layout and that hints come from {{cookiecutter.project_slug}}/.
  • test_template_layout_hints_empty_without_templated_dir — a template without a templated project dir yields no layout hints.

Verified: pytest tests/cli_commands/test_create.py -q (121 passed, 6 skipped), ruff check / ruff format --check clean. Manual describe output for bub/default now shows only the {{cookiecutter.project_slug}}/ tree.

@popwatt
popwatt force-pushed the feat/create-describe-template branch from c764d3f to 451b5cc Compare August 12, 2026 06:18
@webup
webup merged commit 34bdd8f into ob-labs:main Aug 12, 2026
13 checks passed
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.

2 participants