From b67457f7c5caec2ab8ee6ebb6d9f33fc08901d6f Mon Sep 17 00:00:00 2001 From: Chris Krough <461869+ckrough@users.noreply.github.com> Date: Fri, 9 Jan 2026 10:10:13 -0500 Subject: [PATCH] feat: add project create command with E2E integration tests Add `agentspaces project create` command for initializing new projects: - Creates project skeleton (CLAUDE.md, README.md, docs/, .claude/) - Optional Python language pack with --python flag (pyproject.toml, ruff, mypy, pytest, pre-commit, GitHub Actions) - Runs git init if not already a git repo - Shows preview and asks for confirmation Also adds comprehensive E2E integration tests: - 23 tests across 6 categories (basic, python naming, errors, content, git, edge cases) - pytest integration marker for selective test runs - Isolated test fixtures with temp directories and git config isolation Other changes: - Remove docs scaffold command (replaced by project create) - Remove TODO.md and deployment templates (Beads replaces planning) - Add task description standards to CLAUDE.md for Beads issues - Update documentation with new command usage --- CLAUDE.md | 47 +- README.md | 15 +- pyproject.toml | 3 + src/agentspaces/cli/app.py | 3 +- src/agentspaces/cli/docs.py | 97 ---- src/agentspaces/cli/project.py | 306 +++++++++++++ src/agentspaces/infrastructure/design.py | 89 ++++ src/agentspaces/infrastructure/git.py | 14 + src/agentspaces/infrastructure/resources.py | 24 + src/agentspaces/infrastructure/skeleton.py | 45 ++ .../languages/python/dot_github-ci.md | 51 +++ .../languages/python/dot_gitignore-python.md | 69 +++ .../languages/python/dot_pre-commit-config.md | 33 ++ .../languages/python/dot_python-version.md | 10 + .../languages/python/pyproject-toml.md | 105 +++++ .../templates/languages/python/src-init.md | 12 + .../languages/python/tests-conftest.md | 19 + src/agentspaces/templates/skeleton/TODO.md | 35 -- .../skeleton/docs/planning/deployment.md | 270 ----------- tests/integration/cli/__init__.py | 1 + tests/integration/cli/conftest.py | 116 +++++ tests/integration/cli/test_project_create.py | 430 ++++++++++++++++++ tests/unit/infrastructure/test_design.py | 2 - tests/unit/infrastructure/test_resources.py | 4 +- 24 files changed, 1385 insertions(+), 415 deletions(-) create mode 100644 src/agentspaces/cli/project.py create mode 100644 src/agentspaces/infrastructure/skeleton.py create mode 100644 src/agentspaces/templates/languages/python/dot_github-ci.md create mode 100644 src/agentspaces/templates/languages/python/dot_gitignore-python.md create mode 100644 src/agentspaces/templates/languages/python/dot_pre-commit-config.md create mode 100644 src/agentspaces/templates/languages/python/dot_python-version.md create mode 100644 src/agentspaces/templates/languages/python/pyproject-toml.md create mode 100644 src/agentspaces/templates/languages/python/src-init.md create mode 100644 src/agentspaces/templates/languages/python/tests-conftest.md delete mode 100644 src/agentspaces/templates/skeleton/TODO.md delete mode 100644 src/agentspaces/templates/skeleton/docs/planning/deployment.md create mode 100644 tests/integration/cli/__init__.py create mode 100644 tests/integration/cli/conftest.py create mode 100644 tests/integration/cli/test_project_create.py diff --git a/CLAUDE.md b/CLAUDE.md index 0a9e11c..2310afe 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -22,6 +22,7 @@ src/agentspaces/ ├── main.py # CLI entry point ├── cli/ # Typer commands │ ├── app.py # Main app +│ ├── project.py # Project initialization │ ├── workspace.py # Workspace subcommands │ └── docs.py # Design template commands ├── modules/ @@ -33,15 +34,17 @@ src/agentspaces/ │ ├── naming.py # Name generation │ ├── paths.py # Path resolution │ ├── design.py # Template rendering +│ ├── skeleton.py # Project structure definitions │ ├── resources.py # Package resource access │ ├── frontmatter.py # YAML frontmatter parser │ └── logging.py # structlog config └── templates/ # Bundled project templates - └── skeleton/ # Project skeleton templates - ├── CLAUDE.md # Agent constitution template - ├── TODO.md # Task list template - ├── .claude/ # Agent/command templates - └── docs/ # ADR and design templates + ├── skeleton/ # Project skeleton templates + │ ├── CLAUDE.md # Agent constitution template + │ ├── .claude/ # Agent/command templates + │ └── docs/ # ADR and design templates + └── languages/ # Language-specific packs + └── python/ # Python tooling templates ``` ## Architecture @@ -70,6 +73,10 @@ A workspace is: ## Commands ```bash +# Project initialization +agentspaces project create # Initialize new project in current dir +agentspaces project create --python # With Python language pack + # Workspaces agentspaces workspace create [branch] # Create workspace agentspaces workspace list # List workspaces @@ -152,7 +159,6 @@ See [RELEASING.md](RELEASING.md) for full details on versioning and releases. ## Documentation -- [TODO.md](TODO.md) - Active task list - [CONTRIBUTING.md](CONTRIBUTING.md) - Development guide - [RELEASING.md](RELEASING.md) - Version management and release process - [CHANGELOG.md](CHANGELOG.md) - Project changelog (auto-generated) @@ -168,7 +174,7 @@ Use [Beads](https://github.com/steveyegge/beads) for lightweight issue tracking bd ready --json # Create issues -bd create "title" -t -p +bd create "title" -t -p -d # Types: feature, bug, task, chore # Priority: 1 (critical) to 4 (low) @@ -185,6 +191,33 @@ bd dep add --type discovered-from bd sync ``` +### Task Description Standards + +When creating Beads issues, include comprehensive standalone context so tasks can be independently executed by an agent without conversation history: + +- **Context**: What system/command is involved, relevant source files +- **Goal**: Specific objective of the task +- **Implementation**: Code examples, file paths, specific steps +- **Dependencies**: What other tasks/files are prerequisites +- **Verification**: Commands to confirm task completion + +Example: +```bash +bd create "Add validation to user input" -t task -p 2 -d "## Context +The user registration form in src/api/routes/auth.py accepts email without validation. + +## Goal +Add email format validation before creating user accounts. + +## Implementation +1. Add email-validator to dependencies in pyproject.toml +2. Create validate_email() in src/api/validators.py +3. Call validator in register_user() route handler + +## Verification +uv run pytest tests/api/test_auth.py -k email_validation" +``` + ## Learned Patterns diff --git a/README.md b/README.md index fba2b28..1ca88ad 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,10 @@ Workspace orchestration for AI coding agents. Manage isolated workspaces for par ## Features +- **Project Initialization** - Create new projects with templates, documentation, and Python tooling - **Parallel Development** - Work on multiple features simultaneously without branch switching - **Isolated Environments** - Each workspace has its own Python venv and dependencies -- **Project Templates** - Generate documentation optimized for AI agents (CLAUDE.md, TODO.md, ADRs) +- **Project Templates** - Generate documentation optimized for AI agents (CLAUDE.md, ADRs, architecture docs) - **Workspace Tracking** - Purpose, metadata, and timestamps per workspace ## Quick Start @@ -36,6 +37,16 @@ agentspaces workspace create main --purpose "Add user authentication" ## Usage +### Initialize a New Project + +```bash +mkdir my-project && cd my-project +agentspaces project create -n "My Project" -d "Description" + +# With Python tooling (pyproject.toml, ruff, mypy, pytest, GitHub Actions) +agentspaces project create --python -n "My CLI" -d "A CLI tool" +``` + ### Workspace Commands ```bash @@ -53,7 +64,7 @@ agentspaces docs info