Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 40 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -168,7 +174,7 @@ Use [Beads](https://github.com/steveyegge/beads) for lightweight issue tracking
bd ready --json

# Create issues
bd create "title" -t <type> -p <priority>
bd create "title" -t <type> -p <priority> -d <task details>
# Types: feature, bug, task, chore
# Priority: 1 (critical) to 4 (low)

Expand All @@ -185,6 +191,33 @@ bd dep add <new-id> <current-id> --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

<!-- Add entries when Claude makes mistakes. Format: When X happens, do Y instead of Z -->
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -53,7 +64,7 @@ agentspaces docs info <template> # Show template details
agentspaces docs create <template> # Generate from template
```

Available templates: `readme`, `claude-md`, `todo-md`, `architecture`, `development-standards`, `deployment`, `adr-template`
Available templates: `readme`, `claude-md`, `architecture`, `development-standards`, `adr-template`

## Configuration

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = "-v --tb=short"
markers = [
"integration: marks tests as integration tests (deselect with '-m \"not integration\"')",
]

[tool.coverage.run]
source = ["src"]
Expand Down
3 changes: 2 additions & 1 deletion src/agentspaces/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import typer

from agentspaces import __version__
from agentspaces.cli import docs, workspace
from agentspaces.cli import docs, project, workspace
from agentspaces.infrastructure.logging import configure_logging

# Main application
Expand All @@ -18,6 +18,7 @@

# Register subcommand groups
app.add_typer(docs.app, name="docs")
app.add_typer(project.app, name="project")
app.add_typer(workspace.app, name="workspace")


Expand Down
97 changes: 0 additions & 97 deletions src/agentspaces/cli/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,100 +250,3 @@ def create(
raise typer.Exit(1) from e

console.print(f"[green]✓[/green] Created: {result_path}")


# Mapping of template names to their output paths relative to project root
SCAFFOLD_STRUCTURE: dict[str, str] = {
# Root files
"readme": "README.md",
"claude-md": "CLAUDE.md",
"todo-md": "TODO.md",
# .claude directory
"agents-readme": ".claude/agents/README.md",
"commands-readme": ".claude/commands/README.md",
# Design docs
"architecture": "docs/design/architecture.md",
"development-standards": "docs/design/development-standards.md",
# Planning/operational
"deployment": "docs/planning/deployment.md",
# ADR
"adr-template": "docs/adr/000-template.md",
"adr-example": "docs/adr/001-example.md",
}


@app.command("scaffold")
def scaffold(
target: Annotated[
Path,
typer.Argument(help="Target directory to scaffold (created if needed)"),
],
project_name: Annotated[
str,
typer.Option("--project-name", "-n", help="Project name"),
],
project_description: Annotated[
str,
typer.Option("--project-description", "-d", help="Project description"),
],
force: Annotated[
bool,
typer.Option("--force", "-f", help="Overwrite existing files"),
] = False,
) -> None:
"""Create all documentation templates in a new project directory.

Scaffolds a complete project documentation structure with all templates
pre-populated with your project name and description.

\b
Examples:
agentspaces docs scaffold ./my-project -n "MyApp" -d "A web application"
agentspaces docs scaffold /tmp/new-proj -n "CLI Tool" -d "Command-line utility" -f
"""
# Create target directory
target = target.resolve()
target.mkdir(parents=True, exist_ok=True)

context: dict[str, Any] = {
"project_name": project_name,
"project_description": project_description,
# Defaults for ADR template
"adr_number": "000",
"adr_title": "ADR Template",
}

created: list[Path] = []
skipped: list[Path] = []

for template_name, relative_path in SCAFFOLD_STRUCTURE.items():
output_path = target / relative_path

# Check for existing file
if output_path.exists() and not force:
skipped.append(output_path)
continue

# Create parent directories
output_path.parent.mkdir(parents=True, exist_ok=True)

try:
render_design_template(template_name, context, output_path)
created.append(output_path)
except DesignError as e:
error_console.print(f"[red]✗[/red] {template_name}: {e}")

# Summary
console.print()
if created:
console.print(f"[green]✓[/green] Created {len(created)} files in {target}")
for path in created:
rel = path.relative_to(target)
console.print(f" [dim]•[/dim] {rel}")

if skipped:
console.print(f"\n[yellow]![/yellow] Skipped {len(skipped)} existing files")
for path in skipped:
rel = path.relative_to(target)
console.print(f" [dim]•[/dim] {rel}")
console.print("[dim]Use --force to overwrite[/dim]")
Loading