dev-ready 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dev_ready-0.2.0 → dev_ready-0.2.2}/PKG-INFO +6 -2
- {dev_ready-0.2.0 → dev_ready-0.2.2}/README-pypi.md +5 -1
- {dev_ready-0.2.0 → dev_ready-0.2.2}/README.md +5 -1
- {dev_ready-0.2.0 → dev_ready-0.2.2}/docs/cli-spec.md +3 -2
- dev_ready-0.2.2/docs/v0.2-overview.md +92 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/pyproject.toml +1 -1
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/__init__.py +1 -1
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/cli.py +6 -1
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/generate.py +16 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/manifest/loader.py +28 -4
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/manifest.json +1 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/overlay/__init__.py +19 -3
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/prompts/answers.py +2 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/prompts/collect.py +8 -4
- dev_ready-0.2.2/src/dev_ready/templates/agents/README.md +47 -0
- dev_ready-0.2.2/src/dev_ready/templates/agents/phase-N/01-opus-plan.md +25 -0
- dev_ready-0.2.2/src/dev_ready/templates/agents/phase-N/02-gemini-implementation.md +18 -0
- dev_ready-0.2.2/src/dev_ready/templates/agents/phase-N/03-opus-review.md +16 -0
- dev_ready-0.2.2/src/dev_ready/templates/agents/phase-N/04-bob-qa.md +16 -0
- dev_ready-0.2.2/src/dev_ready/templates/agents/phase-N/05-bob-security.md +16 -0
- dev_ready-0.2.2/src/dev_ready/templates/agents/phase-N/06-bob-sre.md +16 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/templates/claude/CLAUDE.md.tmpl +7 -0
- dev_ready-0.2.2/src/dev_ready/templates/readme/README.md.tmpl +27 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/integration/test_fetch_real.py +4 -1
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/unit/test_cli.py +9 -2
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/unit/test_generate.py +4 -2
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/unit/test_manifest.py +10 -2
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/unit/test_overlay.py +61 -2
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/unit/test_prompts.py +44 -6
- {dev_ready-0.2.0 → dev_ready-0.2.2}/uv.lock +1 -1
- {dev_ready-0.2.0 → dev_ready-0.2.2}/.bob/qa.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/.bob/security.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/.bob/sre.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/.github/dependabot.yml +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/.github/workflows/ci.yml +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/.github/workflows/release.yml +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/.github/workflows/upstream-bump.yml +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/.gitignore +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/.python-version +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/CLAUDE.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/LICENSE +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/THIRD_PARTY_NOTICES.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/docs/architecture.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/docs/releasing.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/docs/requirements.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/docs/v0.1-overview.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/scripts/bump_upstream.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/README.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/__main__.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/errors.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/fetch/__init__.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/fetch/snapshot.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/manifest/__init__.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/manifest/models.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/prompts/__init__.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/prompts/_questionary_asker.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/prompts/asker.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/report/__init__.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/report/render.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/templates/claude/skills/project-orientation/SKILL.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/templates/docs/architecture.md.tmpl +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/templates/docs/requirements.md.tmpl +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/templates/mcp/mcp.json +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/src/dev_ready/verify.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/templates/README.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/README.md +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/e2e/.gitkeep +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/e2e/test_init_real.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/integration/.gitkeep +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/unit/test_bump_upstream.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/unit/test_fetch.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/unit/test_report.py +0 -0
- {dev_ready-0.2.0 → dev_ready-0.2.2}/tests/unit/test_verify.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dev-ready
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Scaffold AI-development-ready FastAPI projects: pinned upstream template plus Claude Code skills, MCP config, and design docs
|
|
5
5
|
License: MIT License
|
|
6
6
|
|
|
@@ -47,6 +47,9 @@ A generated project based on [fastapi/full-stack-fastapi-template](https://githu
|
|
|
47
47
|
- Claude Code skills (e.g. project orientation)
|
|
48
48
|
- MCP server configuration (`mcp.json`)
|
|
49
49
|
- Design-doc templates (`architecture.md`, `requirements.md`)
|
|
50
|
+
- Agent-team handoff scaffold (`docs/handoffs/` — a document-driven multi-agent workflow: Tech Lead → Senior → Junior → QA/Security/SRE)
|
|
51
|
+
|
|
52
|
+
Every generated project also gets its own `README.md` (the upstream template's repo README and other repo-maintenance files — `CONTRIBUTING.md`, release notes, deploy workflows, screenshots — are pruned, so nothing template-repo-specific leaks into your project).
|
|
50
53
|
|
|
51
54
|
## Requirements
|
|
52
55
|
|
|
@@ -84,7 +87,8 @@ uvx dev-ready init my-app \
|
|
|
84
87
|
--dir path/to/target \ # default: ./my-app
|
|
85
88
|
--no-skills \ # skip the Claude Code skills overlay
|
|
86
89
|
--no-mcp \ # skip the MCP configuration overlay
|
|
87
|
-
--no-docs
|
|
90
|
+
--no-docs \ # skip the design-doc templates
|
|
91
|
+
--no-agents # skip the agent-team handoff scaffold
|
|
88
92
|
```
|
|
89
93
|
|
|
90
94
|
Then follow the printed next steps (typically `docker compose watch` inside the generated project).
|
|
@@ -16,6 +16,9 @@ A generated project based on [fastapi/full-stack-fastapi-template](https://githu
|
|
|
16
16
|
- Claude Code skills (e.g. project orientation)
|
|
17
17
|
- MCP server configuration (`mcp.json`)
|
|
18
18
|
- Design-doc templates (`architecture.md`, `requirements.md`)
|
|
19
|
+
- Agent-team handoff scaffold (`docs/handoffs/` — a document-driven multi-agent workflow: Tech Lead → Senior → Junior → QA/Security/SRE)
|
|
20
|
+
|
|
21
|
+
Every generated project also gets its own `README.md` (the upstream template's repo README and other repo-maintenance files — `CONTRIBUTING.md`, release notes, deploy workflows, screenshots — are pruned, so nothing template-repo-specific leaks into your project).
|
|
19
22
|
|
|
20
23
|
## Requirements
|
|
21
24
|
|
|
@@ -53,7 +56,8 @@ uvx dev-ready init my-app \
|
|
|
53
56
|
--dir path/to/target \ # default: ./my-app
|
|
54
57
|
--no-skills \ # skip the Claude Code skills overlay
|
|
55
58
|
--no-mcp \ # skip the MCP configuration overlay
|
|
56
|
-
--no-docs
|
|
59
|
+
--no-docs \ # skip the design-doc templates
|
|
60
|
+
--no-agents # skip the agent-team handoff scaffold
|
|
57
61
|
```
|
|
58
62
|
|
|
59
63
|
Then follow the printed next steps (typically `docker compose watch` inside the generated project).
|
|
@@ -20,6 +20,9 @@ A generated project based on [fastapi/full-stack-fastapi-template](https://githu
|
|
|
20
20
|
- Claude Code skills (e.g. project orientation)
|
|
21
21
|
- MCP server configuration (`mcp.json`)
|
|
22
22
|
- Design-doc templates (`architecture.md`, `requirements.md`)
|
|
23
|
+
- Agent-team handoff scaffold (`docs/handoffs/` — a document-driven multi-agent workflow: Tech Lead → Senior → Junior → QA/Security/SRE)
|
|
24
|
+
|
|
25
|
+
Every generated project also gets its own `README.md` (the upstream template's repo README and other repo-maintenance files — `CONTRIBUTING.md`, release notes, deploy workflows, screenshots — are pruned, so nothing template-repo-specific leaks into your project).
|
|
23
26
|
|
|
24
27
|
## Requirements
|
|
25
28
|
|
|
@@ -57,7 +60,8 @@ uvx dev-ready init my-app \
|
|
|
57
60
|
--dir path/to/target \ # default: ./my-app
|
|
58
61
|
--no-skills \ # skip the Claude Code skills overlay
|
|
59
62
|
--no-mcp \ # skip the MCP configuration overlay
|
|
60
|
-
--no-docs
|
|
63
|
+
--no-docs \ # skip the design-doc templates
|
|
64
|
+
--no-agents # skip the agent-team handoff scaffold
|
|
61
65
|
```
|
|
62
66
|
|
|
63
67
|
Then follow the printed next steps (typically `docker compose watch` inside the generated project).
|
|
@@ -15,6 +15,7 @@ Generate a new project.
|
|
|
15
15
|
| `--no-skills` | bool | false | Skip Claude Code skills overlay |
|
|
16
16
|
| `--no-mcp` | bool | false | Skip MCP server configuration overlay |
|
|
17
17
|
| `--no-docs` | bool | false | Skip design-doc templates overlay |
|
|
18
|
+
| `--no-agents` | bool | false | Skip the agent-team handoff scaffold overlay (`docs/handoffs/`) |
|
|
18
19
|
|
|
19
20
|
Exit codes: 0 success; 1 unexpected error or user abort; 2 invalid arguments; 3 network/fetch failure; 4 target directory conflict; 5 generated project failed verification.
|
|
20
21
|
|
|
@@ -25,14 +26,14 @@ Standard version and help output.
|
|
|
25
26
|
## Interactive Prompt Flow (default path)
|
|
26
27
|
|
|
27
28
|
1. Project name (if not given as argument)
|
|
28
|
-
2. Overlay component selection (skills / MCP / docs — multi-select, all on by default; skipped entirely if any `--no-skills`/`--no-mcp`/`--no-docs` flag was passed)
|
|
29
|
+
2. Overlay component selection (skills / MCP / docs / agents — multi-select, all on by default; skipped entirely if any `--no-skills`/`--no-mcp`/`--no-docs`/`--no-agents` flag was passed)
|
|
29
30
|
3. Confirmation summary before writing anything
|
|
30
31
|
|
|
31
32
|
All answers collect into a single `Answers` model shared with the flag-based path.
|
|
32
33
|
|
|
33
34
|
Declining the confirmation, or cancelling any prompt (Ctrl-C), prints `aborted: nothing was written` to stderr and exits 1 — nothing has been written at that point by construction. `--yes` bypasses every prompt in this flow, including confirmation. A non-TTY stdin with missing inputs and no `--yes` fails fast with an invalid-arguments error (exit 2) instead of hanging.
|
|
34
35
|
|
|
35
|
-
**Windows compatibility:** interactive prompts are tested against Windows Terminal. Legacy `cmd.exe` may render the checkbox prompt incorrectly (missing VT/ANSI support). In environments where terminal support is uncertain, use `--yes` with explicit `--no-skills`/`--no-mcp`/`--no-docs` flags instead of relying on prompts.
|
|
36
|
+
**Windows compatibility:** interactive prompts are tested against Windows Terminal. Legacy `cmd.exe` may render the checkbox prompt incorrectly (missing VT/ANSI support). In environments where terminal support is uncertain, use `--yes` with explicit `--no-skills`/`--no-mcp`/`--no-docs`/`--no-agents` flags instead of relying on prompts.
|
|
36
37
|
|
|
37
38
|
## Planned (not in v0.1)
|
|
38
39
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# dev-ready v0.2 Overview — Phases 1–4
|
|
2
|
+
|
|
3
|
+
Status (2026-07-17): The v0.2 code (covering FR-7 through FR-10, including the `agents` overlay component) is fully implemented, reviewed, and sits uncommitted in the working tree. Phase 4 provides this documentation close-out. The entire codebase will ship together in the release step as **v0.2.2** (the current version in `pyproject.toml` remains `0.2.1`; the version bump will happen as part of the release protocol, not during Phase 4).
|
|
4
|
+
|
|
5
|
+
## What v0.2 adds
|
|
6
|
+
|
|
7
|
+
While dev-ready v0.1 shipped the initial project generator and the interactive components matrix (skills, MCP config, and design-doc templates), v0.2 introduces a fourth optional overlay component (`agents`) along with three major generation-quality and reliability enhancements:
|
|
8
|
+
- **FR-7**: Pruning of upstream repo-maintenance and template-specific files.
|
|
9
|
+
- **FR-8**: Generation of a clean, project-specific root `README.md`.
|
|
10
|
+
- **FR-9**: Integration of a strict leak guard in the verification phase to prevent repository template leaks.
|
|
11
|
+
- **FR-10**: The agent-team overlay facilitating structured multi-agent coordination.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## FR-7 — Prune Upstream Repo-Maintenance Files (ADR-006)
|
|
16
|
+
|
|
17
|
+
To prevent upstream repository-specific metadata from leaking into generated user projects, dev-ready split how paths are omitted into two mechanisms:
|
|
18
|
+
- **`exclude`**: Files and directories that Copier never materializes in the staging directory in the first place. This includes `.git`, `copier.yml`, `copier.yaml`, and vendored skill directories.
|
|
19
|
+
- **`prune`**: A post-generation cleanup step. These are files that are valid output from Copier templates but are only meaningful for maintaining the upstream template repository.
|
|
20
|
+
|
|
21
|
+
Both lists are maintained strictly as data within `src/dev_ready/manifest.json` under `upstream.base_template`.
|
|
22
|
+
|
|
23
|
+
### Pruned Categories
|
|
24
|
+
- **Upstream Root Files**: `/README.md`, `CONTRIBUTING.md`, `release-notes.md`.
|
|
25
|
+
- **Media and Scripts**: `img/**`, `scripts/add_latest_release_date.py`, `hooks/**`.
|
|
26
|
+
- **GitHub Workflows and Labeling**: `.github/workflows/deploy-production.yml`, `.github/workflows/deploy-staging.yml`, `.github/workflows/issue-manager.yml`, `.github/workflows/labeler.yml`, `.github/workflows/add-to-project.yml`, `.github/workflows/latest-changes.yml`, `.github/workflows/smokeshow.yml`, `.github/workflows/detect-conflicts.yml`, `.github/workflows/zizmor.yml`, `.github/workflows/guard-dependencies.yml`, and `.github/labeler.yml`.
|
|
27
|
+
|
|
28
|
+
### Kept Files (The KEEP Set)
|
|
29
|
+
The application's own configuration and integration workflows are explicitly retained to ensure local development and CI continue to function. This "keep" set includes:
|
|
30
|
+
- GitHub Actions workflows: `test-backend.yml`, `test-docker-compose.yml`, `playwright.yml`, `pre-commit.yml`.
|
|
31
|
+
- General docs: `development.md`, `deployment.md`.
|
|
32
|
+
- Copier configuration folder: `.copier/`.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## FR-8 — Project-Specific README
|
|
37
|
+
|
|
38
|
+
Under dev-ready v0.1, the generated project included the upstream repository's `README.md`. In v0.2:
|
|
39
|
+
- The template overlay writes a new, clean `README.md` unconditionally (it is not gated by the `--no-docs` flag).
|
|
40
|
+
- The template README is dynamically populated with the generated project's name.
|
|
41
|
+
- This works safely because the post-generation prune step in **FR-7** deletes the upstream `README.md` first, ensuring that the overlay's "no-overwrite / no-collision" rule is preserved when writing the project-specific `README.md`.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## FR-9 — Leak Guard in Verify
|
|
46
|
+
|
|
47
|
+
To enforce quality and ensure that future upstream or Copier updates do not reintroduce repository metadata leaks, dev-ready has enhanced `verify_project` in `src/dev_ready/verify.py`:
|
|
48
|
+
- A list of `FORBIDDEN_PATHS` (`.git`, `copier.yml`, `copier.yaml`) is validated against the staging directory.
|
|
49
|
+
- If any forbidden paths exist in staging, generation fails loudly by raising a `VerificationError` and exiting with code `5`.
|
|
50
|
+
- This ensures that accidental leaks are blocked during testing and CI when bumping pins, long before they can impact end users.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## FR-10 — Agent-Team Overlay (ADR-007)
|
|
55
|
+
|
|
56
|
+
The `agents` component is introduced as a fourth optional component alongside `skills`, `mcp`, and `docs`.
|
|
57
|
+
|
|
58
|
+
### Features
|
|
59
|
+
- **Workflow Scaffold**: When enabled, the overlay writes to `docs/handoffs/`. This directory contains a `README.md` explaining the fixed-role, document-driven multi-agent coordination protocol, plus a set of templates under `phase-N/` (`01-opus-plan.md`, `02-gemini-implementation.md`, `03-opus-review.md`, `04-bob-qa.md`, `05-bob-security.md`, `06-bob-sre.md`).
|
|
60
|
+
- **CLAUDE.md Integration**: The generated root `CLAUDE.md` automatically carries a dedicated "Multi-agent handoff protocol" section pointing to `docs/handoffs/README.md`.
|
|
61
|
+
- **UI & CLI Integration**:
|
|
62
|
+
- A `--no-agents` flag (type `bool`, defaulting to `false`) is added. By default, the overlay is enabled, and `--no-agents` disables it.
|
|
63
|
+
- Interactive multi-select prompt flow displays `agents` as the fourth checkbox selection.
|
|
64
|
+
- The confirmation summary includes `agents` in the active component list when selected.
|
|
65
|
+
- See [cli-spec.md](cli-spec.md) for full interface details.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## What each phase delivered (v0.2)
|
|
70
|
+
|
|
71
|
+
Because the commits for v0.2 have not yet been finalized (they will be committed during the release step), the exact commit SHAs are not recorded here. The following outlines what was delivered by feature:
|
|
72
|
+
|
|
73
|
+
- **Quality & Pruning (FR-7, FR-8, FR-9)**: Implemented in earlier phases of the v0.2 cycle. This established the post-generation prune step, project README overrides, and the verification leak guard checks.
|
|
74
|
+
- **Agent-Team Component (FR-10)**: Delivered in Phase 3. This introduced the `agents` templates, option flags in the command line interface, interactive Prompts selection updates, and validation testing.
|
|
75
|
+
- **Documentation & Close-out**: Delivered in Phase 4 (this phase). Includes updating user-facing README files, CLI specification docs, and compiling this release overview.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Release Gate for v0.2.2
|
|
80
|
+
|
|
81
|
+
To release the cumulative v0.2 changes under version `v0.2.2`, the following sequence must be completed:
|
|
82
|
+
|
|
83
|
+
1. **Verification**: Confirm that the entire unit test suite passes (`uv run pytest`), ruff checks are clean (`uv run ruff check .`), and the integration tests (`uv run pytest -m network`) succeed.
|
|
84
|
+
2. **CI Check**: Verify that the GitHub Actions `generate-and-verify` job passes successfully.
|
|
85
|
+
3. **Review**: Ensure all QA, Security, and SRE checks pass (as verified by IBM Bob's checklists).
|
|
86
|
+
4. **Release Execution (Phase 7)**:
|
|
87
|
+
- Bump version to `0.2.2` in `pyproject.toml` and `src/dev_ready/__init__.py`.
|
|
88
|
+
- Update lockfile (`uv lock`).
|
|
89
|
+
- Commit all uncommitted changes from Phase 3 and Phase 4 using their designated Conventional Commit messages.
|
|
90
|
+
- Tag the release `v0.2.2`.
|
|
91
|
+
|
|
92
|
+
*Note: No code commits or version bumps occur during Phase 4.*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dev-ready"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.2"
|
|
4
4
|
description = "Scaffold AI-development-ready FastAPI projects: pinned upstream template plus Claude Code skills, MCP config, and design docs"
|
|
5
5
|
readme = "README-pypi.md"
|
|
6
6
|
license = { file = "LICENSE" }
|
|
@@ -53,6 +53,9 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
53
53
|
init_parser.add_argument(
|
|
54
54
|
"--no-docs", action="store_true", help="Skip design-doc templates overlay"
|
|
55
55
|
)
|
|
56
|
+
init_parser.add_argument(
|
|
57
|
+
"--no-agents", action="store_true", help="Exclude the agent-team handoff scaffold (docs/handoffs/)."
|
|
58
|
+
)
|
|
56
59
|
return parser
|
|
57
60
|
|
|
58
61
|
|
|
@@ -80,6 +83,7 @@ def build_answers(args: argparse.Namespace) -> Answers:
|
|
|
80
83
|
include_skills=not args.no_skills,
|
|
81
84
|
include_mcp=not args.no_mcp,
|
|
82
85
|
include_docs=not args.no_docs,
|
|
86
|
+
include_agents=not args.no_agents,
|
|
83
87
|
assume_yes=args.yes,
|
|
84
88
|
)
|
|
85
89
|
|
|
@@ -100,7 +104,8 @@ def _build_partial_answers(args: argparse.Namespace) -> PartialAnswers:
|
|
|
100
104
|
include_skills=not args.no_skills,
|
|
101
105
|
include_mcp=not args.no_mcp,
|
|
102
106
|
include_docs=not args.no_docs,
|
|
103
|
-
|
|
107
|
+
include_agents=not args.no_agents,
|
|
108
|
+
components_explicit=args.no_skills or args.no_mcp or args.no_docs or args.no_agents,
|
|
104
109
|
assume_yes=args.yes,
|
|
105
110
|
)
|
|
106
111
|
|
|
@@ -40,6 +40,7 @@ def generate(answers: Answers, pin: UpstreamPin) -> list[Path]:
|
|
|
40
40
|
fetch_snapshot(pin, project_staging, _template_data(answers))
|
|
41
41
|
written = apply_overlay(answers, project_staging)
|
|
42
42
|
verify_project(project_staging)
|
|
43
|
+
_prune_empty_dirs(project_staging)
|
|
43
44
|
_finalize(project_staging, answers.target_dir)
|
|
44
45
|
finally:
|
|
45
46
|
shutil.rmtree(staging_root, ignore_errors=True)
|
|
@@ -102,3 +103,18 @@ def _finalize(staging_dir: Path, target_dir: Path) -> None:
|
|
|
102
103
|
raise TargetDirectoryError(
|
|
103
104
|
f"failed to write generated project into {target_dir}: {error}"
|
|
104
105
|
) from error
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def _prune_empty_dirs(root: Path) -> None:
|
|
109
|
+
"""Recursively remove empty directories from bottom to top."""
|
|
110
|
+
import os
|
|
111
|
+
for dirpath, _, _ in os.walk(root, topdown=False):
|
|
112
|
+
path = Path(dirpath)
|
|
113
|
+
if path == root:
|
|
114
|
+
continue
|
|
115
|
+
if not any(path.iterdir()):
|
|
116
|
+
try:
|
|
117
|
+
path.rmdir()
|
|
118
|
+
except OSError:
|
|
119
|
+
pass
|
|
120
|
+
|
|
@@ -120,7 +120,21 @@ def _parse_pin(name: str, entry: object, source: str) -> UpstreamPin:
|
|
|
120
120
|
|
|
121
121
|
|
|
122
122
|
def _parse_path_list(name: str, entry: dict, source: str, field: str) -> tuple[str, ...]:
|
|
123
|
-
"""Validate optional per-pin path lists (exclude or prune).
|
|
123
|
+
"""Validate optional per-pin path lists (exclude or prune).
|
|
124
|
+
|
|
125
|
+
Entries are gitwildmatch patterns handed to Copier's path matcher, never to
|
|
126
|
+
filesystem APIs. Two accepted shapes:
|
|
127
|
+
|
|
128
|
+
- relative pattern (``img/**``, ``CONTRIBUTING.md``): gitwildmatch treats a
|
|
129
|
+
slash-free pattern as matching at ANY depth.
|
|
130
|
+
- root-anchored pattern with a single leading ``/`` (``/README.md``): the
|
|
131
|
+
leading slash anchors the match to the template root, so it hits only the
|
|
132
|
+
top-level entry and not same-named entries in subdirectories. The ``/`` is
|
|
133
|
+
a match anchor, not an absolute filesystem path.
|
|
134
|
+
|
|
135
|
+
Rejected in every case: backslash-prefixed entries, a double leading slash,
|
|
136
|
+
``..`` path segments, and empty strings.
|
|
137
|
+
"""
|
|
124
138
|
raw = entry.get(field)
|
|
125
139
|
if raw is None:
|
|
126
140
|
return ()
|
|
@@ -132,10 +146,20 @@ def _parse_path_list(name: str, entry: dict, source: str, field: str) -> tuple[s
|
|
|
132
146
|
raise ManifestError(
|
|
133
147
|
f"{source}: upstream '{name}' '{field}' entries must be non-empty strings"
|
|
134
148
|
)
|
|
135
|
-
|
|
149
|
+
# A single leading '/' is a gitwildmatch root anchor, not an absolute
|
|
150
|
+
# path; strip it before the traversal checks. Backslash prefixes and
|
|
151
|
+
# double leading slashes stay rejected.
|
|
152
|
+
unanchored = item[1:] if item.startswith("/") else item
|
|
153
|
+
if (
|
|
154
|
+
item.startswith("\\")
|
|
155
|
+
or unanchored.startswith(("/", "\\"))
|
|
156
|
+
or not unanchored
|
|
157
|
+
or ".." in unanchored.split("/")
|
|
158
|
+
):
|
|
136
159
|
raise ManifestError(
|
|
137
|
-
f"{source}: upstream '{name}' '{field}' entries must be relative"
|
|
138
|
-
f"
|
|
160
|
+
f"{source}: upstream '{name}' '{field}' entries must be relative paths"
|
|
161
|
+
f" (an optional single leading '/' root anchor is allowed),"
|
|
162
|
+
f" without '..', got {item!r}"
|
|
139
163
|
)
|
|
140
164
|
patterns.append(item)
|
|
141
165
|
return tuple(patterns)
|
|
@@ -22,8 +22,8 @@ _TEMPLATE_TOKEN = "{{project_name}}"
|
|
|
22
22
|
def apply_overlay(answers: Answers, project_dir: Path) -> list[Path]:
|
|
23
23
|
"""Apply the selected overlay components onto `project_dir`.
|
|
24
24
|
|
|
25
|
-
CLAUDE.md
|
|
26
|
-
follow `answers.include_skills` / `include_mcp` / `include_docs`.
|
|
25
|
+
CLAUDE.md and README.md are always applied; `.claude/skills/`, `.mcp.json`, `docs/`, and `docs/handoffs/`
|
|
26
|
+
follow `answers.include_skills` / `include_mcp` / `include_docs` / `include_agents`.
|
|
27
27
|
|
|
28
28
|
Returns the paths written, relative to `project_dir`. Raises
|
|
29
29
|
`OverlayError` on any destination collision, missing asset, or leftover
|
|
@@ -38,7 +38,13 @@ def apply_overlay(answers: Answers, project_dir: Path) -> list[Path]:
|
|
|
38
38
|
project_dir,
|
|
39
39
|
Path("CLAUDE.md"),
|
|
40
40
|
answers.project_name,
|
|
41
|
-
)
|
|
41
|
+
),
|
|
42
|
+
_apply_file(
|
|
43
|
+
templates_root.joinpath("readme", "README.md.tmpl"),
|
|
44
|
+
project_dir,
|
|
45
|
+
Path("README.md"),
|
|
46
|
+
answers.project_name,
|
|
47
|
+
),
|
|
42
48
|
]
|
|
43
49
|
|
|
44
50
|
if answers.include_skills:
|
|
@@ -71,6 +77,16 @@ def apply_overlay(answers: Answers, project_dir: Path) -> list[Path]:
|
|
|
71
77
|
)
|
|
72
78
|
)
|
|
73
79
|
|
|
80
|
+
if answers.include_agents:
|
|
81
|
+
written.extend(
|
|
82
|
+
_apply_tree(
|
|
83
|
+
templates_root.joinpath("agents"),
|
|
84
|
+
project_dir,
|
|
85
|
+
Path("docs") / "handoffs",
|
|
86
|
+
answers.project_name,
|
|
87
|
+
)
|
|
88
|
+
)
|
|
89
|
+
|
|
74
90
|
return written
|
|
75
91
|
|
|
76
92
|
|
|
@@ -13,6 +13,7 @@ class Answers:
|
|
|
13
13
|
include_skills: bool = True
|
|
14
14
|
include_mcp: bool = True
|
|
15
15
|
include_docs: bool = True
|
|
16
|
+
include_agents: bool = True
|
|
16
17
|
assume_yes: bool = False
|
|
17
18
|
|
|
18
19
|
|
|
@@ -30,5 +31,6 @@ class PartialAnswers:
|
|
|
30
31
|
include_skills: bool
|
|
31
32
|
include_mcp: bool
|
|
32
33
|
include_docs: bool
|
|
34
|
+
include_agents: bool
|
|
33
35
|
components_explicit: bool
|
|
34
36
|
assume_yes: bool = False
|
|
@@ -18,7 +18,7 @@ from dev_ready.prompts.asker import Asker
|
|
|
18
18
|
__all__ = ["collect_answers", "confirm_generation"]
|
|
19
19
|
|
|
20
20
|
_PROJECT_NAME_PATTERN = re.compile(r"^[a-zA-Z0-9][a-zA-Z0-9._-]*$")
|
|
21
|
-
_COMPONENT_CHOICES = ("skills", "mcp", "docs")
|
|
21
|
+
_COMPONENT_CHOICES = ("skills", "mcp", "docs", "agents")
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def _is_interactive() -> bool:
|
|
@@ -50,7 +50,7 @@ def collect_answers(partial: PartialAnswers, *, asker: Asker | None = None) -> A
|
|
|
50
50
|
if needs_components and asker is None and not _is_interactive():
|
|
51
51
|
raise InvalidArgumentsError(
|
|
52
52
|
"component selection requires an interactive terminal — pass "
|
|
53
|
-
"--no-skills/--no-mcp/--no-docs explicitly, or use --yes"
|
|
53
|
+
"--no-skills/--no-mcp/--no-docs/--no-agents explicitly, or use --yes"
|
|
54
54
|
)
|
|
55
55
|
|
|
56
56
|
resolved_asker = asker
|
|
@@ -64,11 +64,12 @@ def collect_answers(partial: PartialAnswers, *, asker: Asker | None = None) -> A
|
|
|
64
64
|
|
|
65
65
|
if needs_components:
|
|
66
66
|
assert resolved_asker is not None
|
|
67
|
-
include_skills, include_mcp, include_docs = _prompt_components(resolved_asker)
|
|
67
|
+
include_skills, include_mcp, include_docs, include_agents = _prompt_components(resolved_asker)
|
|
68
68
|
else:
|
|
69
69
|
include_skills = partial.include_skills
|
|
70
70
|
include_mcp = partial.include_mcp
|
|
71
71
|
include_docs = partial.include_docs
|
|
72
|
+
include_agents = partial.include_agents
|
|
72
73
|
|
|
73
74
|
target_dir = (
|
|
74
75
|
partial.target_dir if partial.target_dir is not None else Path.cwd() / project_name
|
|
@@ -80,6 +81,7 @@ def collect_answers(partial: PartialAnswers, *, asker: Asker | None = None) -> A
|
|
|
80
81
|
include_skills=include_skills,
|
|
81
82
|
include_mcp=include_mcp,
|
|
82
83
|
include_docs=include_docs,
|
|
84
|
+
include_agents=include_agents,
|
|
83
85
|
assume_yes=partial.assume_yes,
|
|
84
86
|
)
|
|
85
87
|
|
|
@@ -114,6 +116,7 @@ def _render_confirmation_summary(answers: Answers, pin: UpstreamPin) -> str:
|
|
|
114
116
|
("skills", answers.include_skills),
|
|
115
117
|
("mcp", answers.include_mcp),
|
|
116
118
|
("docs", answers.include_docs),
|
|
119
|
+
("agents", answers.include_agents),
|
|
117
120
|
)
|
|
118
121
|
if included
|
|
119
122
|
]
|
|
@@ -145,7 +148,7 @@ def _prompt_project_name(asker: Asker) -> str:
|
|
|
145
148
|
)
|
|
146
149
|
|
|
147
150
|
|
|
148
|
-
def _prompt_components(asker: Asker) -> tuple[bool, bool, bool]:
|
|
151
|
+
def _prompt_components(asker: Asker) -> tuple[bool, bool, bool, bool]:
|
|
149
152
|
try:
|
|
150
153
|
selected = asker.checkbox("Select components to include:", _COMPONENT_CHOICES)
|
|
151
154
|
except KeyboardInterrupt:
|
|
@@ -157,4 +160,5 @@ def _prompt_components(asker: Asker) -> tuple[bool, bool, bool]:
|
|
|
157
160
|
"skills" in selected_set,
|
|
158
161
|
"mcp" in selected_set,
|
|
159
162
|
"docs" in selected_set,
|
|
163
|
+
"agents" in selected_set,
|
|
160
164
|
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Multi-Agent Handoff Protocol
|
|
2
|
+
|
|
3
|
+
This project was generated with the **agents** component. It sets up a fixed-role,
|
|
4
|
+
document-driven workflow for AI-assisted development. Agents coordinate ONLY through
|
|
5
|
+
the on-disk handoff documents in this directory — never through assumed chat context.
|
|
6
|
+
|
|
7
|
+
## Roles
|
|
8
|
+
|
|
9
|
+
| Role | Does | Never does |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| CEO (you) | Sets goals, approves plans, commits/merges | — |
|
|
12
|
+
| Tech Lead | Decisions, plans, writes handoff docs | Write or edit code |
|
|
13
|
+
| Senior Engineer | Task breakdown for the junior, code + architecture review, fixes escalated hard bugs | Write code the junior can handle |
|
|
14
|
+
| Junior Engineer | Implements tasks in the working tree, writes an execution report per phase | Run state-changing git; keep grinding on a hard bug |
|
|
15
|
+
| QA / Security / SRE | Reviews quality, security, and operability per phase | — |
|
|
16
|
+
|
|
17
|
+
Only the CEO runs state-changing git (commit / branch / push). Every other role edits
|
|
18
|
+
the working tree only.
|
|
19
|
+
|
|
20
|
+
## Per-phase files
|
|
21
|
+
|
|
22
|
+
Work is organized into phases. Each phase lives in `phase-N/` and uses these files, in order:
|
|
23
|
+
|
|
24
|
+
| File | Author | Purpose |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `01-opus-plan.md` | Senior Engineer | Ordered task breakdown with implementation details |
|
|
27
|
+
| `02-gemini-implementation.md` | Junior Engineer | Implementation brief the junior executes |
|
|
28
|
+
| `03-opus-review.md` | Senior Engineer | Logic + architecture review of the implementation |
|
|
29
|
+
| `04-bob-qa.md` | QA | Quality review |
|
|
30
|
+
| `05-bob-security.md` | Security | Security review |
|
|
31
|
+
| `06-bob-sre.md` | SRE | Operability / release review |
|
|
32
|
+
|
|
33
|
+
## `reports/` convention
|
|
34
|
+
|
|
35
|
+
Each phase's Junior writes to `phase-N/reports/`:
|
|
36
|
+
|
|
37
|
+
- `execution-report.md` — ALWAYS written: per-task status, test evidence, files changed.
|
|
38
|
+
- `problems.md` — written ONLY when a hard bug was hit.
|
|
39
|
+
|
|
40
|
+
## The Junior's stop-and-escalate rule
|
|
41
|
+
|
|
42
|
+
A hard bug is: more than 2 failed fix attempts, a failure that cannot be localized to a
|
|
43
|
+
cause, or anything that seems to require crossing a module boundary or changing a
|
|
44
|
+
documented decision. On a hard bug the Junior STOPS, logs it in `phase-N/reports/problems.md`
|
|
45
|
+
(where / what happened / suspected cause / what was tried), and moves to the next
|
|
46
|
+
independent task — it does not keep grinding. The presence of `problems.md` blocks the
|
|
47
|
+
phase on the Senior Engineer.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Phase N — 01: Senior Engineer Plan
|
|
2
|
+
|
|
3
|
+
- Phase: <N — short name>
|
|
4
|
+
- Status: DRAFT
|
|
5
|
+
|
|
6
|
+
## Scope (fixed — do not expand or shrink)
|
|
7
|
+
|
|
8
|
+
<what this phase delivers, and explicit out-of-scope items>
|
|
9
|
+
|
|
10
|
+
## Read before planning
|
|
11
|
+
|
|
12
|
+
<files / docs the implementer must read first>
|
|
13
|
+
|
|
14
|
+
## Task breakdown
|
|
15
|
+
|
|
16
|
+
<ordered tasks; per task: files touched, what "done" means (testable), required tests,
|
|
17
|
+
and a Conventional Commit message for the CEO>
|
|
18
|
+
|
|
19
|
+
## Constraints
|
|
20
|
+
|
|
21
|
+
<hard rules, module boundaries, no-new-dependency notes>
|
|
22
|
+
|
|
23
|
+
## Acceptance criteria
|
|
24
|
+
|
|
25
|
+
<how the CEO decides the phase is done>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Phase N — 02: Junior Engineer Implementation Brief
|
|
2
|
+
|
|
3
|
+
- Phase: <N — short name>
|
|
4
|
+
|
|
5
|
+
## Execution protocol
|
|
6
|
+
|
|
7
|
+
- No state-changing git. Edit the working tree only.
|
|
8
|
+
- Work tasks strictly in order. After each: run the tests and the linter; both must pass.
|
|
9
|
+
- Hard bug -> STOP, log in `reports/problems.md`, move to the next independent task.
|
|
10
|
+
|
|
11
|
+
## Tasks
|
|
12
|
+
|
|
13
|
+
<copied from 01, one section per task with implementation detail>
|
|
14
|
+
|
|
15
|
+
## Output when done
|
|
16
|
+
|
|
17
|
+
- Always write `reports/execution-report.md` (per-task status, test evidence, files changed).
|
|
18
|
+
- On any hard bug, also write `reports/problems.md`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Phase N — 03: Senior Engineer Review
|
|
2
|
+
|
|
3
|
+
- Phase: <N — short name>
|
|
4
|
+
- Verdict: PENDING
|
|
5
|
+
|
|
6
|
+
## Reviewed
|
|
7
|
+
|
|
8
|
+
<files / diffs reviewed>
|
|
9
|
+
|
|
10
|
+
## Findings
|
|
11
|
+
|
|
12
|
+
<logic and architecture findings, most-severe first; empty if none>
|
|
13
|
+
|
|
14
|
+
## Verdict
|
|
15
|
+
|
|
16
|
+
<APPROVE / CHANGES-REQUESTED, with rationale>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Phase N — 05: Security Review
|
|
2
|
+
|
|
3
|
+
- Phase: <N — short name>
|
|
4
|
+
- Verdict: PENDING
|
|
5
|
+
|
|
6
|
+
## Surface reviewed
|
|
7
|
+
|
|
8
|
+
<inputs, secrets, network, filesystem, dependencies>
|
|
9
|
+
|
|
10
|
+
## Findings
|
|
11
|
+
|
|
12
|
+
<security issues, most-severe first>
|
|
13
|
+
|
|
14
|
+
## Verdict
|
|
15
|
+
|
|
16
|
+
<PASS / FAIL, with rationale>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Phase N — 06: SRE Review
|
|
2
|
+
|
|
3
|
+
- Phase: <N — short name>
|
|
4
|
+
- Verdict: PENDING
|
|
5
|
+
|
|
6
|
+
## Operability
|
|
7
|
+
|
|
8
|
+
<build, run, config, failure modes, rollback>
|
|
9
|
+
|
|
10
|
+
## Findings
|
|
11
|
+
|
|
12
|
+
<operability / release issues, most-severe first>
|
|
13
|
+
|
|
14
|
+
## Verdict
|
|
15
|
+
|
|
16
|
+
<PASS / FAIL, with rationale>
|
|
@@ -24,6 +24,13 @@
|
|
|
24
24
|
- `compose.yml` — local development orchestration (`compose.override.yml` adds the local-dev overrides)
|
|
25
25
|
- `docs/` — design docs for this project, if generated with the docs overlay
|
|
26
26
|
|
|
27
|
+
## Multi-agent handoff protocol
|
|
28
|
+
|
|
29
|
+
If this project was generated with the agents component, `docs/handoffs/README.md`
|
|
30
|
+
defines a fixed-role, document-driven workflow (Tech Lead, Senior, Junior, QA/Security/SRE)
|
|
31
|
+
with per-phase handoff files under `docs/handoffs/phase-N/`. See that README before
|
|
32
|
+
coordinating multiple agents.
|
|
33
|
+
|
|
27
34
|
## Working with this repo
|
|
28
35
|
|
|
29
36
|
Read `docs/architecture.md` and `docs/requirements.md` (if present) before making structural changes. This file and any `.claude/skills/` were added by dev-ready; everything else in the tree comes from the upstream template linked above.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# {{project_name}}
|
|
2
|
+
|
|
3
|
+
{{project_name}} is a full-stack FastAPI project — a FastAPI + SQLModel + PostgreSQL backend and a React + TypeScript + Vite frontend, wired together with Docker Compose. It was scaffolded by [dev-ready](https://github.com/MoofonLi/dev-ready) on top of [fastapi/full-stack-fastapi-template](https://github.com/fastapi/full-stack-fastapi-template).
|
|
4
|
+
|
|
5
|
+
## Stack
|
|
6
|
+
|
|
7
|
+
- **Backend**: FastAPI, SQLModel, PostgreSQL, Pydantic — `backend/`
|
|
8
|
+
- **Frontend**: React, TypeScript, Vite — `frontend/`
|
|
9
|
+
- **Infra**: Docker Compose, Traefik reverse proxy — `compose.yml`
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
- `docker compose up -d` — start the full stack (backend, frontend, database, proxy)
|
|
14
|
+
- `docker compose watch` — start with live reload for local development
|
|
15
|
+
- `docker compose down` — stop the stack
|
|
16
|
+
- Backend only: `cd backend && uv run fastapi dev app/main.py`
|
|
17
|
+
- Frontend only: `cd frontend && npm install && npm run dev`
|
|
18
|
+
- Backend tests: `cd backend && bash scripts/test.sh`
|
|
19
|
+
|
|
20
|
+
## Documentation
|
|
21
|
+
|
|
22
|
+
- Per-service setup lives in `backend/README.md` and `frontend/README.md`.
|
|
23
|
+
- `CLAUDE.md` — guidance for AI agents working in this repo (added by dev-ready).
|
|
24
|
+
|
|
25
|
+
## Credits
|
|
26
|
+
|
|
27
|
+
Generated by [dev-ready](https://github.com/MoofonLi/dev-ready). Base template: [fastapi/full-stack-fastapi-template](https://github.com/fastapi/full-stack-fastapi-template) (MIT).
|
|
@@ -18,4 +18,7 @@ def test_fetch_real_pinned_snapshot(tmp_path: Path) -> None:
|
|
|
18
18
|
result = fetch_snapshot(pin, dest)
|
|
19
19
|
|
|
20
20
|
assert result == dest
|
|
21
|
-
|
|
21
|
+
# Root README.md is in the manifest prune list since phase 2 (FR-8):
|
|
22
|
+
# the snapshot must NOT contain it, while subdir READMEs survive.
|
|
23
|
+
assert not (dest / "README.md").exists()
|
|
24
|
+
assert (dest / "backend" / "README.md").exists()
|
|
@@ -28,6 +28,7 @@ def _init_args(**overrides) -> argparse.Namespace:
|
|
|
28
28
|
"no_skills": False,
|
|
29
29
|
"no_mcp": False,
|
|
30
30
|
"no_docs": False,
|
|
31
|
+
"no_agents": False,
|
|
31
32
|
}
|
|
32
33
|
defaults.update(overrides)
|
|
33
34
|
return argparse.Namespace(**defaults)
|
|
@@ -102,6 +103,7 @@ def test_init_success_omits_disabled_components_from_summary(
|
|
|
102
103
|
"--no-skills",
|
|
103
104
|
"--no-mcp",
|
|
104
105
|
"--no-docs",
|
|
106
|
+
"--no-agents",
|
|
105
107
|
]
|
|
106
108
|
)
|
|
107
109
|
== 0
|
|
@@ -110,6 +112,7 @@ def test_init_success_omits_disabled_components_from_summary(
|
|
|
110
112
|
assert "skills" not in out
|
|
111
113
|
assert "mcp" not in out
|
|
112
114
|
assert "docs" not in out
|
|
115
|
+
assert "agents" not in out
|
|
113
116
|
|
|
114
117
|
|
|
115
118
|
@pytest.mark.parametrize(
|
|
@@ -163,6 +166,7 @@ def test_init_flags_reach_generate_via_answers(
|
|
|
163
166
|
assert answers.include_skills is False
|
|
164
167
|
assert answers.include_mcp is False
|
|
165
168
|
assert answers.include_docs is True
|
|
169
|
+
assert answers.include_agents is True
|
|
166
170
|
assert answers.assume_yes is True
|
|
167
171
|
|
|
168
172
|
|
|
@@ -173,27 +177,30 @@ def test_build_answers_defaults() -> None:
|
|
|
173
177
|
assert answers.include_skills is True
|
|
174
178
|
assert answers.include_mcp is True
|
|
175
179
|
assert answers.include_docs is True
|
|
180
|
+
assert answers.include_agents is True
|
|
176
181
|
assert answers.assume_yes is False
|
|
177
182
|
|
|
178
183
|
|
|
179
184
|
def test_build_answers_respects_flags(tmp_path) -> None:
|
|
180
185
|
answers = build_answers(
|
|
181
|
-
_init_args(yes=True, target_dir=tmp_path / "out", no_skills=True, no_mcp=True)
|
|
186
|
+
_init_args(yes=True, target_dir=tmp_path / "out", no_skills=True, no_mcp=True, no_agents=True)
|
|
182
187
|
)
|
|
183
188
|
assert answers.target_dir == tmp_path / "out"
|
|
184
189
|
assert answers.include_skills is False
|
|
185
190
|
assert answers.include_mcp is False
|
|
186
191
|
assert answers.include_docs is True
|
|
192
|
+
assert answers.include_agents is False
|
|
187
193
|
assert answers.assume_yes is True
|
|
188
194
|
|
|
189
195
|
|
|
190
196
|
def test_parser_accepts_all_documented_flags() -> None:
|
|
191
197
|
args = build_parser().parse_args(
|
|
192
|
-
["init", "my-app", "-y", "--dir", "x", "--no-skills", "--no-mcp", "--no-docs"]
|
|
198
|
+
["init", "my-app", "-y", "--dir", "x", "--no-skills", "--no-mcp", "--no-docs", "--no-agents"]
|
|
193
199
|
)
|
|
194
200
|
assert args.command == "init"
|
|
195
201
|
assert args.yes is True
|
|
196
202
|
assert args.target_dir == Path("x")
|
|
203
|
+
assert args.no_agents is True
|
|
197
204
|
|
|
198
205
|
|
|
199
206
|
# --- interactive flow (no --yes): confirm / abort / questionary isolation ---
|
|
@@ -35,7 +35,6 @@ def _fake_fetch_ok(
|
|
|
35
35
|
pin: UpstreamPin, dest: Path, template_data: dict[str, str] | None = None
|
|
36
36
|
) -> Path:
|
|
37
37
|
dest.mkdir(parents=True)
|
|
38
|
-
(dest / "README.md").write_text("hello", encoding="utf-8")
|
|
39
38
|
(dest / "backend").mkdir()
|
|
40
39
|
(dest / "backend" / "main.py").write_text("print('hi')", encoding="utf-8")
|
|
41
40
|
# Every path verify_project checks for must be present, or the happy-path
|
|
@@ -60,7 +59,10 @@ def test_generate_happy_path_merges_upstream_and_overlay(
|
|
|
60
59
|
|
|
61
60
|
written = generate(answers, PIN)
|
|
62
61
|
|
|
63
|
-
assert (target_dir / "README.md").
|
|
62
|
+
assert (target_dir / "README.md").exists()
|
|
63
|
+
readme = (target_dir / "README.md").read_text(encoding="utf-8")
|
|
64
|
+
assert "my-app" in readme
|
|
65
|
+
assert "MoofonLi/dev-ready" in readme
|
|
64
66
|
assert (target_dir / "backend" / "main.py").exists()
|
|
65
67
|
assert (target_dir / "CLAUDE.md").exists()
|
|
66
68
|
assert (target_dir / ".mcp.json").exists()
|
|
@@ -166,7 +166,7 @@ def test_exclude_entries_must_be_non_empty_strings(bad_entry: object) -> None:
|
|
|
166
166
|
parse_manifest(json.dumps(data))
|
|
167
167
|
|
|
168
168
|
|
|
169
|
-
@pytest.mark.parametrize("bad_entry", ["
|
|
169
|
+
@pytest.mark.parametrize("bad_entry", ["//etc/passwd", "\\windows", "../outside", "a/../b"])
|
|
170
170
|
def test_exclude_entries_must_be_relative_without_traversal(bad_entry: str) -> None:
|
|
171
171
|
data = json.loads(json.dumps(VALID))
|
|
172
172
|
data["upstream"]["base_template"]["exclude"] = [bad_entry]
|
|
@@ -201,7 +201,7 @@ def test_prune_entries_must_be_non_empty_strings(bad_entry: object) -> None:
|
|
|
201
201
|
parse_manifest(json.dumps(data))
|
|
202
202
|
|
|
203
203
|
|
|
204
|
-
@pytest.mark.parametrize("bad_entry", ["
|
|
204
|
+
@pytest.mark.parametrize("bad_entry", ["//etc/passwd", "\\windows", "../outside", "a/../b"])
|
|
205
205
|
def test_prune_entries_must_be_relative_without_traversal(bad_entry: str) -> None:
|
|
206
206
|
data = json.loads(json.dumps(VALID))
|
|
207
207
|
data["upstream"]["base_template"]["prune"] = [bad_entry]
|
|
@@ -209,6 +209,14 @@ def test_prune_entries_must_be_relative_without_traversal(bad_entry: str) -> Non
|
|
|
209
209
|
parse_manifest(json.dumps(data))
|
|
210
210
|
|
|
211
211
|
|
|
212
|
+
@pytest.mark.parametrize("field", ["exclude", "prune"])
|
|
213
|
+
def test_path_list_accepts_single_leading_slash_root_anchor(field: str) -> None:
|
|
214
|
+
data = json.loads(json.dumps(VALID))
|
|
215
|
+
data["upstream"]["base_template"][field] = ["/README.md"]
|
|
216
|
+
pin = parse_manifest(json.dumps(data)).upstream["base_template"]
|
|
217
|
+
assert getattr(pin, field) == ("/README.md",) # stored verbatim, anchor kept
|
|
218
|
+
|
|
219
|
+
|
|
212
220
|
def test_bundled_manifest_is_valid() -> None:
|
|
213
221
|
manifest = load_default_manifest()
|
|
214
222
|
assert "base_template" in manifest.upstream
|
|
@@ -25,10 +25,13 @@ def test_happy_path_writes_every_component_with_substitution(tmp_path: Path) ->
|
|
|
25
25
|
written = apply_overlay(_answers(tmp_path), project_dir)
|
|
26
26
|
|
|
27
27
|
assert (project_dir / "CLAUDE.md").exists()
|
|
28
|
+
assert (project_dir / "README.md").exists()
|
|
28
29
|
assert (project_dir / ".claude" / "skills" / "project-orientation" / "SKILL.md").exists()
|
|
29
30
|
assert (project_dir / ".mcp.json").exists()
|
|
30
31
|
assert (project_dir / "docs" / "architecture.md").exists()
|
|
31
32
|
assert (project_dir / "docs" / "requirements.md").exists()
|
|
33
|
+
assert (project_dir / "docs" / "handoffs" / "README.md").exists()
|
|
34
|
+
assert (project_dir / "docs" / "handoffs" / "phase-N" / "01-opus-plan.md").exists()
|
|
32
35
|
|
|
33
36
|
for path in written:
|
|
34
37
|
assert not path.is_absolute()
|
|
@@ -38,11 +41,15 @@ def test_happy_path_writes_every_component_with_substitution(tmp_path: Path) ->
|
|
|
38
41
|
claude_md = (project_dir / "CLAUDE.md").read_text(encoding="utf-8")
|
|
39
42
|
assert "my-app" in claude_md
|
|
40
43
|
assert "{{" not in claude_md
|
|
44
|
+
assert "docs/handoffs/README.md" in claude_md
|
|
41
45
|
|
|
42
46
|
architecture = (project_dir / "docs" / "architecture.md").read_text(encoding="utf-8")
|
|
43
47
|
assert "my-app" in architecture
|
|
44
48
|
assert "{{" not in architecture
|
|
45
49
|
|
|
50
|
+
handoffs_readme = (project_dir / "docs" / "handoffs" / "README.md").read_text(encoding="utf-8")
|
|
51
|
+
assert "{{" not in handoffs_readme
|
|
52
|
+
|
|
46
53
|
|
|
47
54
|
@pytest.mark.parametrize(
|
|
48
55
|
("flag", "missing_path", "sibling_paths"),
|
|
@@ -65,6 +72,15 @@ def test_happy_path_writes_every_component_with_substitution(tmp_path: Path) ->
|
|
|
65
72
|
Path("docs") / "architecture.md",
|
|
66
73
|
[Path(".mcp.json"), Path(".claude") / "skills" / "project-orientation" / "SKILL.md"],
|
|
67
74
|
),
|
|
75
|
+
(
|
|
76
|
+
"include_agents",
|
|
77
|
+
Path("docs") / "handoffs" / "README.md",
|
|
78
|
+
[
|
|
79
|
+
Path(".mcp.json"),
|
|
80
|
+
Path(".claude") / "skills" / "project-orientation" / "SKILL.md",
|
|
81
|
+
Path("docs") / "architecture.md",
|
|
82
|
+
],
|
|
83
|
+
),
|
|
68
84
|
],
|
|
69
85
|
)
|
|
70
86
|
def test_component_flag_skips_exactly_its_component(
|
|
@@ -86,17 +102,60 @@ def test_claude_md_always_present_even_with_all_components_disabled(tmp_path: Pa
|
|
|
86
102
|
project_dir.mkdir()
|
|
87
103
|
|
|
88
104
|
written = apply_overlay(
|
|
89
|
-
_answers(tmp_path, include_skills=False, include_mcp=False, include_docs=False),
|
|
105
|
+
_answers(tmp_path, include_skills=False, include_mcp=False, include_docs=False, include_agents=False),
|
|
90
106
|
project_dir,
|
|
91
107
|
)
|
|
92
108
|
|
|
93
|
-
assert written == [Path("CLAUDE.md")]
|
|
109
|
+
assert written == [Path("CLAUDE.md"), Path("README.md")]
|
|
94
110
|
assert (project_dir / "CLAUDE.md").exists()
|
|
111
|
+
assert (project_dir / "README.md").exists()
|
|
95
112
|
assert not (project_dir / ".claude").exists()
|
|
96
113
|
assert not (project_dir / ".mcp.json").exists()
|
|
97
114
|
assert not (project_dir / "docs").exists()
|
|
98
115
|
|
|
99
116
|
|
|
117
|
+
def test_coexistence_docs_and_agents(tmp_path: Path) -> None:
|
|
118
|
+
project_dir = tmp_path / "project"
|
|
119
|
+
project_dir.mkdir()
|
|
120
|
+
|
|
121
|
+
apply_overlay(_answers(tmp_path, include_docs=True, include_agents=True), project_dir)
|
|
122
|
+
assert (project_dir / "docs" / "architecture.md").exists()
|
|
123
|
+
assert (project_dir / "docs" / "handoffs" / "README.md").exists()
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def test_docs_without_agents(tmp_path: Path) -> None:
|
|
127
|
+
project_dir = tmp_path / "project"
|
|
128
|
+
project_dir.mkdir()
|
|
129
|
+
|
|
130
|
+
apply_overlay(_answers(tmp_path, include_docs=True, include_agents=False), project_dir)
|
|
131
|
+
assert (project_dir / "docs" / "architecture.md").exists()
|
|
132
|
+
assert not (project_dir / "docs" / "handoffs").exists()
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def test_readme_is_about_the_project_not_the_template(tmp_path: Path) -> None:
|
|
136
|
+
project_dir = tmp_path / "project"
|
|
137
|
+
project_dir.mkdir()
|
|
138
|
+
|
|
139
|
+
apply_overlay(_answers(tmp_path), project_dir)
|
|
140
|
+
|
|
141
|
+
readme = (project_dir / "README.md").read_text(encoding="utf-8")
|
|
142
|
+
assert "my-app" in readme
|
|
143
|
+
assert "{{" not in readme
|
|
144
|
+
assert "MoofonLi/dev-ready" in readme
|
|
145
|
+
assert "img/" not in readme
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def test_collision_on_existing_readme_raises_overlay_error(tmp_path: Path) -> None:
|
|
149
|
+
project_dir = tmp_path / "project"
|
|
150
|
+
project_dir.mkdir()
|
|
151
|
+
(project_dir / "README.md").write_text("pre-existing", encoding="utf-8")
|
|
152
|
+
|
|
153
|
+
with pytest.raises(OverlayError, match="README.md"):
|
|
154
|
+
apply_overlay(_answers(tmp_path), project_dir)
|
|
155
|
+
|
|
156
|
+
assert (project_dir / "README.md").read_text(encoding="utf-8") == "pre-existing"
|
|
157
|
+
|
|
158
|
+
|
|
100
159
|
def test_collision_on_existing_claude_md_raises_overlay_error(tmp_path: Path) -> None:
|
|
101
160
|
project_dir = tmp_path / "project"
|
|
102
161
|
project_dir.mkdir()
|
|
@@ -68,6 +68,7 @@ def _partial(**overrides: object) -> PartialAnswers:
|
|
|
68
68
|
"include_skills": True,
|
|
69
69
|
"include_mcp": True,
|
|
70
70
|
"include_docs": True,
|
|
71
|
+
"include_agents": True,
|
|
71
72
|
"components_explicit": True,
|
|
72
73
|
"assume_yes": False,
|
|
73
74
|
}
|
|
@@ -84,6 +85,11 @@ def _answers(**overrides: object) -> Answers:
|
|
|
84
85
|
return Answers(**defaults) # type: ignore[arg-type]
|
|
85
86
|
|
|
86
87
|
|
|
88
|
+
def test_answers_default_has_include_agents() -> None:
|
|
89
|
+
answers = Answers(project_name="my-app", target_dir=Path("/tmp/my-app"))
|
|
90
|
+
assert answers.include_agents is True
|
|
91
|
+
|
|
92
|
+
|
|
87
93
|
# --- name prompt ---
|
|
88
94
|
|
|
89
95
|
|
|
@@ -111,9 +117,10 @@ def test_name_prompt_result_lands_in_answers() -> None:
|
|
|
111
117
|
|
|
112
118
|
|
|
113
119
|
def test_component_prompt_fires_only_when_no_explicit_flag() -> None:
|
|
114
|
-
asker = FakeAsker(checkboxes=[["skills", "mcp", "docs"]])
|
|
120
|
+
asker = FakeAsker(checkboxes=[["skills", "mcp", "docs", "agents"]])
|
|
115
121
|
answers = collect_answers(_partial(components_explicit=False), asker=asker)
|
|
116
|
-
assert (answers.include_skills, answers.include_mcp, answers.include_docs) == (
|
|
122
|
+
assert (answers.include_skills, answers.include_mcp, answers.include_docs, answers.include_agents) == (
|
|
123
|
+
True,
|
|
117
124
|
True,
|
|
118
125
|
True,
|
|
119
126
|
True,
|
|
@@ -122,9 +129,9 @@ def test_component_prompt_fires_only_when_no_explicit_flag() -> None:
|
|
|
122
129
|
|
|
123
130
|
|
|
124
131
|
def test_component_prompt_skipped_when_flag_explicit() -> None:
|
|
125
|
-
asker = FakeAsker(checkboxes=[["skills", "mcp", "docs"]])
|
|
132
|
+
asker = FakeAsker(checkboxes=[["skills", "mcp", "docs", "agents"]])
|
|
126
133
|
answers = collect_answers(
|
|
127
|
-
_partial(components_explicit=True, include_skills=False, include_mcp=True, include_docs=True),
|
|
134
|
+
_partial(components_explicit=True, include_skills=False, include_mcp=True, include_docs=True, include_agents=True),
|
|
128
135
|
asker=asker,
|
|
129
136
|
)
|
|
130
137
|
assert answers.include_skills is False
|
|
@@ -134,13 +141,32 @@ def test_component_prompt_skipped_when_flag_explicit() -> None:
|
|
|
134
141
|
def test_component_prompt_selection_can_disable_some() -> None:
|
|
135
142
|
asker = FakeAsker(checkboxes=[["mcp"]])
|
|
136
143
|
answers = collect_answers(_partial(components_explicit=False), asker=asker)
|
|
137
|
-
assert (answers.include_skills, answers.include_mcp, answers.include_docs) == (
|
|
144
|
+
assert (answers.include_skills, answers.include_mcp, answers.include_docs, answers.include_agents) == (
|
|
138
145
|
False,
|
|
139
146
|
True,
|
|
140
147
|
False,
|
|
148
|
+
False,
|
|
141
149
|
)
|
|
142
150
|
|
|
143
151
|
|
|
152
|
+
@pytest.mark.parametrize(
|
|
153
|
+
("selected", "expected_skills", "expected_mcp", "expected_docs", "expected_agents"),
|
|
154
|
+
[
|
|
155
|
+
(["skills", "mcp", "docs", "agents"], True, True, True, True),
|
|
156
|
+
(["skills", "mcp", "docs"], True, True, True, False),
|
|
157
|
+
(["docs", "agents"], False, False, True, True),
|
|
158
|
+
([], False, False, False, False),
|
|
159
|
+
]
|
|
160
|
+
)
|
|
161
|
+
def test_component_matrix(selected, expected_skills, expected_mcp, expected_docs, expected_agents) -> None:
|
|
162
|
+
asker = FakeAsker(checkboxes=[selected])
|
|
163
|
+
answers = collect_answers(_partial(components_explicit=False), asker=asker)
|
|
164
|
+
assert answers.include_skills is expected_skills
|
|
165
|
+
assert answers.include_mcp is expected_mcp
|
|
166
|
+
assert answers.include_docs is expected_docs
|
|
167
|
+
assert answers.include_agents is expected_agents
|
|
168
|
+
|
|
169
|
+
|
|
144
170
|
# --- cancellation during collect_answers ---
|
|
145
171
|
|
|
146
172
|
|
|
@@ -178,6 +204,7 @@ def test_non_tty_missing_components_raises_invalid_arguments(
|
|
|
178
204
|
with pytest.raises(InvalidArgumentsError) as excinfo:
|
|
179
205
|
collect_answers(_partial(components_explicit=False))
|
|
180
206
|
assert "component selection requires an interactive terminal" in str(excinfo.value)
|
|
207
|
+
assert "--no-agents" in str(excinfo.value)
|
|
181
208
|
|
|
182
209
|
|
|
183
210
|
# --- interactive/flag path convergence (ADR-004) ---
|
|
@@ -195,10 +222,11 @@ def test_interactive_and_flag_paths_produce_identical_answers(tmp_path: Path) ->
|
|
|
195
222
|
include_skills=False,
|
|
196
223
|
include_mcp=True,
|
|
197
224
|
include_docs=True,
|
|
225
|
+
include_agents=True,
|
|
198
226
|
assume_yes=False,
|
|
199
227
|
)
|
|
200
228
|
|
|
201
|
-
asker = FakeAsker(texts=["my-app"], checkboxes=[["mcp", "docs"]])
|
|
229
|
+
asker = FakeAsker(texts=["my-app"], checkboxes=[["mcp", "docs", "agents"]])
|
|
202
230
|
prompt_answers = collect_answers(
|
|
203
231
|
_partial(
|
|
204
232
|
project_name=None,
|
|
@@ -285,3 +313,13 @@ def test_confirm_non_tty_without_injected_asker_raises_invalid_arguments(
|
|
|
285
313
|
monkeypatch.setattr(collect_module, "_is_interactive", lambda: False)
|
|
286
314
|
with pytest.raises(InvalidArgumentsError):
|
|
287
315
|
confirm_generation(_answers(), PIN)
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
def test_render_confirmation_summary_includes_agents() -> None:
|
|
319
|
+
from dev_ready.prompts.collect import _render_confirmation_summary
|
|
320
|
+
# when agents is True
|
|
321
|
+
summary_on = _render_confirmation_summary(_answers(include_agents=True), PIN)
|
|
322
|
+
assert "agents" in summary_on
|
|
323
|
+
# when agents is False
|
|
324
|
+
summary_off = _render_confirmation_summary(_answers(include_agents=False), PIN)
|
|
325
|
+
assert "agents" not in summary_off
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|