dev-ready 0.1.4__tar.gz → 0.2.1__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.
Files changed (67) hide show
  1. {dev_ready-0.1.4 → dev_ready-0.2.1}/.gitignore +2 -0
  2. {dev_ready-0.1.4 → dev_ready-0.2.1}/CLAUDE.md +2 -2
  3. {dev_ready-0.1.4 → dev_ready-0.2.1}/PKG-INFO +1 -1
  4. {dev_ready-0.1.4 → dev_ready-0.2.1}/docs/architecture.md +5 -5
  5. {dev_ready-0.1.4 → dev_ready-0.2.1}/pyproject.toml +1 -1
  6. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/__init__.py +1 -1
  7. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/fetch/snapshot.py +3 -2
  8. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/generate.py +16 -0
  9. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/manifest/loader.py +35 -9
  10. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/manifest/models.py +4 -0
  11. dev_ready-0.2.1/src/dev_ready/manifest.json +41 -0
  12. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/overlay/__init__.py +8 -2
  13. dev_ready-0.2.1/src/dev_ready/templates/readme/README.md.tmpl +27 -0
  14. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/verify.py +11 -1
  15. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/integration/test_fetch_real.py +4 -1
  16. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/unit/test_fetch.py +15 -0
  17. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/unit/test_generate.py +4 -2
  18. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/unit/test_manifest.py +46 -1
  19. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/unit/test_overlay.py +27 -1
  20. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/unit/test_verify.py +20 -1
  21. {dev_ready-0.1.4 → dev_ready-0.2.1}/uv.lock +1 -1
  22. dev_ready-0.1.4/docs/v0.2-plan.md +0 -56
  23. dev_ready-0.1.4/src/dev_ready/manifest.json +0 -22
  24. {dev_ready-0.1.4 → dev_ready-0.2.1}/.bob/qa.md +0 -0
  25. {dev_ready-0.1.4 → dev_ready-0.2.1}/.bob/security.md +0 -0
  26. {dev_ready-0.1.4 → dev_ready-0.2.1}/.bob/sre.md +0 -0
  27. {dev_ready-0.1.4 → dev_ready-0.2.1}/.github/dependabot.yml +0 -0
  28. {dev_ready-0.1.4 → dev_ready-0.2.1}/.github/workflows/ci.yml +0 -0
  29. {dev_ready-0.1.4 → dev_ready-0.2.1}/.github/workflows/release.yml +0 -0
  30. {dev_ready-0.1.4 → dev_ready-0.2.1}/.github/workflows/upstream-bump.yml +0 -0
  31. {dev_ready-0.1.4 → dev_ready-0.2.1}/.python-version +0 -0
  32. {dev_ready-0.1.4 → dev_ready-0.2.1}/LICENSE +0 -0
  33. {dev_ready-0.1.4 → dev_ready-0.2.1}/README-pypi.md +0 -0
  34. {dev_ready-0.1.4 → dev_ready-0.2.1}/README.md +0 -0
  35. {dev_ready-0.1.4 → dev_ready-0.2.1}/THIRD_PARTY_NOTICES.md +0 -0
  36. {dev_ready-0.1.4 → dev_ready-0.2.1}/docs/cli-spec.md +0 -0
  37. {dev_ready-0.1.4 → dev_ready-0.2.1}/docs/releasing.md +0 -0
  38. {dev_ready-0.1.4 → dev_ready-0.2.1}/docs/requirements.md +0 -0
  39. {dev_ready-0.1.4 → dev_ready-0.2.1}/docs/v0.1-overview.md +0 -0
  40. {dev_ready-0.1.4 → dev_ready-0.2.1}/scripts/bump_upstream.py +0 -0
  41. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/README.md +0 -0
  42. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/__main__.py +0 -0
  43. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/cli.py +0 -0
  44. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/errors.py +0 -0
  45. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/fetch/__init__.py +0 -0
  46. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/manifest/__init__.py +0 -0
  47. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/prompts/__init__.py +0 -0
  48. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/prompts/_questionary_asker.py +0 -0
  49. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/prompts/answers.py +0 -0
  50. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/prompts/asker.py +0 -0
  51. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/prompts/collect.py +0 -0
  52. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/report/__init__.py +0 -0
  53. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/report/render.py +0 -0
  54. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/templates/claude/CLAUDE.md.tmpl +0 -0
  55. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/templates/claude/skills/project-orientation/SKILL.md +0 -0
  56. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/templates/docs/architecture.md.tmpl +0 -0
  57. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/templates/docs/requirements.md.tmpl +0 -0
  58. {dev_ready-0.1.4 → dev_ready-0.2.1}/src/dev_ready/templates/mcp/mcp.json +0 -0
  59. {dev_ready-0.1.4 → dev_ready-0.2.1}/templates/README.md +0 -0
  60. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/README.md +0 -0
  61. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/e2e/.gitkeep +0 -0
  62. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/e2e/test_init_real.py +0 -0
  63. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/integration/.gitkeep +0 -0
  64. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/unit/test_bump_upstream.py +0 -0
  65. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/unit/test_cli.py +0 -0
  66. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/unit/test_prompts.py +0 -0
  67. {dev_ready-0.1.4 → dev_ready-0.2.1}/tests/unit/test_report.py +0 -0
@@ -219,3 +219,5 @@ __marimo__/
219
219
 
220
220
  handoff/
221
221
  .bob/reviews/
222
+
223
+ .vscode/
@@ -31,14 +31,14 @@ Current phase: v0.1 complete (v0.1.4 fixes pending release); v0.2 in progress
31
31
 
32
32
  ## Multi-agent workflow (ADR-007)
33
33
 
34
- Roles are fixed. Agents communicate ONLY through committed handoff documents in `docs/handoffs/phase-N/` — never assume chat context from another agent.
34
+ Roles are fixed. Agents communicate ONLY through on-disk handoff documents in `handoff/<version>/phaseN/` (gitignored — handoffs are working files, never committed; code is committed normally) — never assume chat context from another agent.
35
35
 
36
36
  | Role | Agent | Does | Never does |
37
37
  |---|---|---|---|
38
38
  | CEO | Moofon | Sets goals, approves plans, merges | — |
39
39
  | Tech Lead | Claude Fable 5 (Cowork) | Decisions, plans, handoff docs | Write or edit code |
40
40
  | Senior Engineer | Claude Opus 4.8 | Task breakdown for the junior, code review (logic + architecture), fixes escalated hard bugs | Write code the junior can handle |
41
- | Junior Engineer | Gemini 3.1 Pro (Antigravity) | Implements tasks — writes most of the code; execution report per phase | Keep grinding on a hard bug (STOP, escalate to senior via `reports/escalation-*.md`, move to next task) |
41
+ | Junior Engineer | Gemini 3.1 Pro (Antigravity) | Implements tasks in the working tree — writes most of the code; execution report per phase | Run state-changing git (commit/branch/push — only the CEO commits, after reviews); keep grinding on a hard bug (STOP, log it in `reports/problems.md`, move to next task) |
42
42
  | QA / Security / SRE | IBM Bob | Reviews per `.bob/qa.md`, `.bob/security.md`, `.bob/sre.md` | — |
43
43
 
44
44
  Handoff files per phase: `01-opus-plan.md`, `02-gemini-implementation.md`, `03-opus-review.md`, `04-bob-qa.md`, `05-bob-security.md`, `06-bob-sre.md`; junior outputs in `reports/`.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dev-ready
3
- Version: 0.1.4
3
+ Version: 0.2.1
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
 
@@ -78,16 +78,16 @@ uvx dev-ready init my-app
78
78
 
79
79
  ### ADR-007: Multi-agent development team and handoff protocol (v0.2)
80
80
 
81
- - Status: Accepted (2026-07-16)
81
+ - Status: Accepted (2026-07-16); amended (2026-07-16): handoffs live under `handoff/<version>/phaseN/` and are gitignored — they are working artifacts of the dev process, not repo content. "Committed" in the original decision is replaced by "on-disk": agents still start from a written document, never from chat history; only source code and docs are committed.
82
82
  - Context: dev-ready is developed by one human with several AI agents. v0.1 used a loose Architect -> Engineer -> reviewers flow. Adding Antigravity (Gemini) as a code-writing agent requires explicit roles and explicit handoff artifacts, or agents duplicate work and burn tokens re-deriving context.
83
- - Decision: fixed roles, communicating only through committed markdown handoffs under `docs/handoffs/`:
83
+ - Decision: fixed roles, communicating only through on-disk markdown handoffs under `handoff/<version>/`:
84
84
  - CEO (Moofon): sets goals, approves plans, merges.
85
85
  - Tech Lead (Claude Fable 5, Cowork): talks with the CEO; writes decisions, plans, and handoff documents ONLY — never writes or edits code.
86
86
  - Senior Engineer (Claude Opus 4.8): reads the tech lead's phase plan, breaks it into implementation tasks with acceptance criteria (a handoff for the junior), reviews the junior's code for logic and architecture, and personally fixes hard bugs the junior escalates.
87
- - Junior Engineer (Gemini 3.1 Pro, Antigravity): implements the senior's tasks — writes most of the code. On completion writes an execution report (md). On a hard bug or an unimplementable task: STOP generating code (do not thrash tokens), move to the next task, and write an escalation handoff for the senior describing where, what happened, and the suspected cause.
87
+ - Junior Engineer (Gemini 3.1 Pro, Antigravity): implements the senior's tasks in the working tree — writes most of the code, but NEVER runs state-changing git (no commit/branch/push; only the CEO commits, after all reviews pass). On completion ALWAYS writes an execution report (md). On a hard bug or an unimplementable task: STOP generating code (do not thrash tokens), log the bug in `reports/problems.md` (where, what happened, suspected cause), and move to the next task. The presence of `problems.md` blocks the phase on the senior; the senior deletes it when all bugs are fixed, or marks it ESCALATED-TO-CEO if unfixable.
88
88
  - IBM Bob (QA / Security / SRE): unchanged; reviewer expectations stay in `.bob/qa.md`, `.bob/security.md`, `.bob/sre.md`.
89
- - Handoff artifacts per phase, under `docs/handoffs/phase-N/`: `01-opus-plan.md` (senior's task breakdown for the junior), `02-gemini-implementation.md` (junior's brief: role, tasks, stop rules), `03-opus-review.md` (senior's review brief: read the junior's report, fix hard bugs, close the phase), `04-bob-qa.md`, `05-bob-security.md`, `06-bob-sre.md`. The junior's outputs go to `docs/handoffs/phase-N/reports/` (`execution-report.md`, `escalation-*.md`).
90
- - Consequences: Every agent starts from a committed document, not from chat history; token spend concentrates in the cheapest capable agent (junior writes most code, senior only reviews and unblocks); the tech lead's no-code rule keeps decisions and implementation auditable separately. FR-10 ships the same scaffold to generated projects as an optional overlay component, so dev-ready users get this workflow for free.
89
+ - Handoff artifacts per phase, under `handoff/<version>/phaseN/`: `01-opus-plan.md` (tech lead's brief to the senior; the senior writes his task breakdown + implementation details into 02's designated section), `02-gemini-implementation.md` (the single file the junior receives: working rules from the tech lead + the senior's task breakdown), `03-opus-review.md` (senior's review brief: entry check on `reports/problems.md` — if present, fix mode from problems.md + 02; if absent, review the branch, and write problems.md for any non-trivial finding), `04-bob-qa.md`, `05-bob-security.md`, `06-bob-sre.md`. The junior's outputs go to `handoff/<version>/phaseN/reports/` (`execution-report.md` always; `problems.md` when hard bugs exist).
90
+ - Consequences: Every agent starts from a written on-disk document, not from chat history; token spend concentrates in the cheapest capable agent (junior writes most code, senior only reviews and unblocks); the tech lead's no-code rule keeps decisions and implementation auditable separately. FR-10 ships the same scaffold to generated projects as an optional overlay component, so dev-ready users get this workflow for free.
91
91
 
92
92
  ## Module Boundary
93
93
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dev-ready"
3
- version = "0.1.4"
3
+ version = "0.2.1"
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" }
@@ -4,4 +4,4 @@ Bootstrap phase: package structure only, no business logic yet.
4
4
  See docs/architecture.md for module boundaries.
5
5
  """
6
6
 
7
- __version__ = "0.1.0"
7
+ __version__ = "0.2.1"
@@ -72,8 +72,9 @@ def _run_copier(pin: UpstreamPin, staging_dir: Path, data: dict[str, Any]) -> No
72
72
  # copier.yml/.yaml would otherwise be copied into the
73
73
  # generated project (the .git worktree file makes the output
74
74
  # look like a checkout of the upstream template).
75
- # See manifest.json and UpstreamPin.exclude.
76
- exclude=pin.exclude,
75
+ # See manifest.json and UpstreamPin.exclude. `pin.prune`
76
+ # (curated repo-maintenance files, ADR-006) is merged in alongside `pin.exclude`.
77
+ exclude=pin.exclude + pin.prune,
77
78
  # Unanswered template questions take the template's defaults;
78
79
  # dev-ready's own prompting happens in `prompts`, never here.
79
80
  defaults=True,
@@ -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
+
@@ -105,7 +105,8 @@ def _parse_pin(name: str, entry: object, source: str) -> UpstreamPin:
105
105
  f"{source}: upstream '{name}' field 'verified_at' must be a string or null"
106
106
  )
107
107
 
108
- exclude = _parse_exclude(name, entry, source)
108
+ exclude = _parse_path_list(name, entry, source, "exclude")
109
+ prune = _parse_path_list(name, entry, source, "prune")
109
110
 
110
111
  return UpstreamPin(
111
112
  repo=values["repo"],
@@ -114,26 +115,51 @@ def _parse_pin(name: str, entry: object, source: str) -> UpstreamPin:
114
115
  license=values["license"],
115
116
  verified_at=verified_at,
116
117
  exclude=exclude,
118
+ prune=prune,
117
119
  )
118
120
 
119
121
 
120
- def _parse_exclude(name: str, entry: dict, source: str) -> tuple[str, ...]:
121
- """Validate the optional per-pin 'exclude' list (Copier source-path patterns)."""
122
- raw = entry.get("exclude")
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).
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
+ """
138
+ raw = entry.get(field)
123
139
  if raw is None:
124
140
  return ()
125
141
  if not isinstance(raw, list):
126
- raise ManifestError(f"{source}: upstream '{name}' field 'exclude' must be a list")
142
+ raise ManifestError(f"{source}: upstream '{name}' field '{field}' must be a list")
127
143
  patterns: list[str] = []
128
144
  for item in raw:
129
145
  if not isinstance(item, str) or not item:
130
146
  raise ManifestError(
131
- f"{source}: upstream '{name}' 'exclude' entries must be non-empty strings"
147
+ f"{source}: upstream '{name}' '{field}' entries must be non-empty strings"
132
148
  )
133
- if item.startswith(("/", "\\")) or ".." in item.split("/"):
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
+ ):
134
159
  raise ManifestError(
135
- f"{source}: upstream '{name}' 'exclude' entries must be relative"
136
- f" paths without '..', got {item!r}"
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}"
137
163
  )
138
164
  patterns.append(item)
139
165
  return tuple(patterns)
@@ -14,6 +14,9 @@ class UpstreamPin:
14
14
  Copier follows symlinks by default. The list lives next to the pin so a
15
15
  weekly bump PR that hits new dangling entries fails CI loudly and gets
16
16
  fixed here, in one reviewed place (ADR-002/ADR-005).
17
+
18
+ `prune` = paths that generate fine but do not belong in a user project
19
+ (curated, reviewed at bump time), vs `exclude` = broken-by-design paths (ADR-006).
17
20
  """
18
21
 
19
22
  repo: str
@@ -22,6 +25,7 @@ class UpstreamPin:
22
25
  license: str
23
26
  verified_at: str | None = None
24
27
  exclude: tuple[str, ...] = ()
28
+ prune: tuple[str, ...] = ()
25
29
 
26
30
 
27
31
  @dataclass(frozen=True)
@@ -0,0 +1,41 @@
1
+ {
2
+ "manifest_version": 1,
3
+ "upstream": {
4
+ "base_template": {
5
+ "repo": "fastapi/full-stack-fastapi-template",
6
+ "ref": "master",
7
+ "commit": "4cd0d9e51aebd1af6f82d91ad0df4c9e41f4dea2",
8
+ "verified_at": "2026-07-04",
9
+ "license": "MIT",
10
+ "exclude": [
11
+ ".git",
12
+ "copier.yml",
13
+ "copier.yaml",
14
+ ".agents/skills/fastapi",
15
+ ".agents/skills/sqlmodel",
16
+ ".claude/skills/fastapi",
17
+ ".claude/skills/sqlmodel"
18
+ ],
19
+ "prune": [
20
+ ".github/workflows/deploy-production.yml",
21
+ ".github/workflows/deploy-staging.yml",
22
+ ".github/workflows/issue-manager.yml",
23
+ ".github/workflows/labeler.yml",
24
+ ".github/workflows/add-to-project.yml",
25
+ ".github/workflows/latest-changes.yml",
26
+ ".github/workflows/smokeshow.yml",
27
+ ".github/workflows/detect-conflicts.yml",
28
+ ".github/workflows/zizmor.yml",
29
+ ".github/workflows/guard-dependencies.yml",
30
+ ".github/labeler.yml",
31
+ "CONTRIBUTING.md",
32
+ "release-notes.md",
33
+ "/README.md",
34
+ "img/**",
35
+ "scripts/add_latest_release_date.py",
36
+ "hooks/**"
37
+ ]
38
+ }
39
+ },
40
+ "overlay_version": "0.1.0"
41
+ }
@@ -22,7 +22,7 @@ _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 is always applied; `.claude/skills/`, `.mcp.json`, and `docs/`
25
+ CLAUDE.md and README.md are always applied; `.claude/skills/`, `.mcp.json`, and `docs/`
26
26
  follow `answers.include_skills` / `include_mcp` / `include_docs`.
27
27
 
28
28
  Returns the paths written, relative to `project_dir`. Raises
@@ -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:
@@ -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).
@@ -12,7 +12,7 @@ from pathlib import Path
12
12
 
13
13
  from dev_ready.errors import VerificationError
14
14
 
15
- __all__ = ["verify_project", "REQUIRED_UPSTREAM_PATHS"]
15
+ __all__ = ["verify_project", "REQUIRED_UPSTREAM_PATHS", "FORBIDDEN_PATHS"]
16
16
 
17
17
  # Derived from a real fetch of the manifest-pinned commit
18
18
  # (fastapi/full-stack-fastapi-template @ 4cd0d9e51aebd1af6f82d91ad0df4c9e41f4dea2).
@@ -28,6 +28,8 @@ REQUIRED_UPSTREAM_PATHS: tuple[str, ...] = (
28
28
  "LICENSE",
29
29
  )
30
30
 
31
+ FORBIDDEN_PATHS: tuple[str, ...] = (".git", "copier.yml", "copier.yaml")
32
+
31
33
 
32
34
  def verify_project(project_dir: Path) -> None:
33
35
  """Check that `project_dir` has the upstream paths dev-ready depends on.
@@ -43,3 +45,11 @@ def verify_project(project_dir: Path) -> None:
43
45
  "commit. Action: file an issue against dev-ready, or do not use "
44
46
  "this pin."
45
47
  )
48
+
49
+ for path in FORBIDDEN_PATHS:
50
+ if (project_dir / path).exists():
51
+ raise VerificationError(
52
+ f"generated project contains forbidden path {path!r} — an upstream/Copier change "
53
+ "reintroduced a template-repo leak (.git worktree or copier.yml). Action: "
54
+ "file an issue against dev-ready; do not use this pin."
55
+ )
@@ -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
- assert (dest / "README.md").exists()
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()
@@ -98,6 +98,21 @@ def test_pin_without_exclude_passes_empty_exclude(
98
98
  assert recorded["kwargs"]["exclude"] == ()
99
99
 
100
100
 
101
+ def test_pin_with_exclude_and_prune_merges_them(
102
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
103
+ ) -> None:
104
+ recorded: dict[str, Any] = {}
105
+ _install_fake_run_copy(monkeypatch, recorded)
106
+ pin = UpstreamPin(
107
+ repo=PIN.repo, ref=PIN.ref, commit=PIN.commit, license=PIN.license,
108
+ exclude=(".agents/skills/fastapi",), prune=("CONTRIBUTING.md", "img")
109
+ )
110
+
111
+ fetch_snapshot(pin, tmp_path / "snapshot")
112
+
113
+ assert recorded["kwargs"]["exclude"] == pin.exclude + pin.prune
114
+
115
+
101
116
  def test_template_data_defaults_to_empty_dict(
102
117
  tmp_path: Path, monkeypatch: pytest.MonkeyPatch
103
118
  ) -> None:
@@ -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").read_text(encoding="utf-8") == "hello"
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", ["/etc/passwd", "\\windows", "../outside", "a/../b"])
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]
@@ -174,9 +174,54 @@ def test_exclude_entries_must_be_relative_without_traversal(bad_entry: str) -> N
174
174
  parse_manifest(json.dumps(data))
175
175
 
176
176
 
177
+ def test_prune_defaults_to_empty_tuple() -> None:
178
+ manifest = parse_manifest(json.dumps(VALID))
179
+ assert manifest.upstream["base_template"].prune == ()
180
+
181
+
182
+ def test_prune_parsed_as_tuple_of_patterns() -> None:
183
+ data = json.loads(json.dumps(VALID))
184
+ data["upstream"]["base_template"]["prune"] = ["docs/junk.md"]
185
+ pin = parse_manifest(json.dumps(data)).upstream["base_template"]
186
+ assert pin.prune == ("docs/junk.md",)
187
+
188
+
189
+ def test_prune_must_be_a_list() -> None:
190
+ data = json.loads(json.dumps(VALID))
191
+ data["upstream"]["base_template"]["prune"] = ".agents"
192
+ with pytest.raises(ManifestError, match="must be a list"):
193
+ parse_manifest(json.dumps(data))
194
+
195
+
196
+ @pytest.mark.parametrize("bad_entry", ["", 42, None])
197
+ def test_prune_entries_must_be_non_empty_strings(bad_entry: object) -> None:
198
+ data = json.loads(json.dumps(VALID))
199
+ data["upstream"]["base_template"]["prune"] = [bad_entry]
200
+ with pytest.raises(ManifestError, match="non-empty strings"):
201
+ parse_manifest(json.dumps(data))
202
+
203
+
204
+ @pytest.mark.parametrize("bad_entry", ["//etc/passwd", "\\windows", "../outside", "a/../b"])
205
+ def test_prune_entries_must_be_relative_without_traversal(bad_entry: str) -> None:
206
+ data = json.loads(json.dumps(VALID))
207
+ data["upstream"]["base_template"]["prune"] = [bad_entry]
208
+ with pytest.raises(ManifestError, match="relative"):
209
+ parse_manifest(json.dumps(data))
210
+
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
+
177
220
  def test_bundled_manifest_is_valid() -> None:
178
221
  manifest = load_default_manifest()
179
222
  assert "base_template" in manifest.upstream
180
223
  # The pinned FastAPI template ships dangling .venv symlinks that Copier
181
224
  # would otherwise follow and crash on (see UpstreamPin.exclude docstring).
182
225
  assert manifest.upstream["base_template"].exclude != ()
226
+ assert manifest.upstream["base_template"].prune != ()
227
+ assert ".github/workflows/test-backend.yml" not in manifest.upstream["base_template"].prune
@@ -25,6 +25,7 @@ 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()
@@ -90,13 +91,38 @@ def test_claude_md_always_present_even_with_all_components_disabled(tmp_path: Pa
90
91
  project_dir,
91
92
  )
92
93
 
93
- assert written == [Path("CLAUDE.md")]
94
+ assert written == [Path("CLAUDE.md"), Path("README.md")]
94
95
  assert (project_dir / "CLAUDE.md").exists()
96
+ assert (project_dir / "README.md").exists()
95
97
  assert not (project_dir / ".claude").exists()
96
98
  assert not (project_dir / ".mcp.json").exists()
97
99
  assert not (project_dir / "docs").exists()
98
100
 
99
101
 
102
+ def test_readme_is_about_the_project_not_the_template(tmp_path: Path) -> None:
103
+ project_dir = tmp_path / "project"
104
+ project_dir.mkdir()
105
+
106
+ apply_overlay(_answers(tmp_path), project_dir)
107
+
108
+ readme = (project_dir / "README.md").read_text(encoding="utf-8")
109
+ assert "my-app" in readme
110
+ assert "{{" not in readme
111
+ assert "MoofonLi/dev-ready" in readme
112
+ assert "img/" not in readme
113
+
114
+
115
+ def test_collision_on_existing_readme_raises_overlay_error(tmp_path: Path) -> None:
116
+ project_dir = tmp_path / "project"
117
+ project_dir.mkdir()
118
+ (project_dir / "README.md").write_text("pre-existing", encoding="utf-8")
119
+
120
+ with pytest.raises(OverlayError, match="README.md"):
121
+ apply_overlay(_answers(tmp_path), project_dir)
122
+
123
+ assert (project_dir / "README.md").read_text(encoding="utf-8") == "pre-existing"
124
+
125
+
100
126
  def test_collision_on_existing_claude_md_raises_overlay_error(tmp_path: Path) -> None:
101
127
  project_dir = tmp_path / "project"
102
128
  project_dir.mkdir()
@@ -5,7 +5,7 @@ from pathlib import Path
5
5
  import pytest
6
6
 
7
7
  from dev_ready.errors import VerificationError
8
- from dev_ready.verify import REQUIRED_UPSTREAM_PATHS, verify_project
8
+ from dev_ready.verify import FORBIDDEN_PATHS, REQUIRED_UPSTREAM_PATHS, verify_project
9
9
 
10
10
 
11
11
  _DIRECTORY_ENTRIES = {"backend", "frontend"}
@@ -55,3 +55,22 @@ def test_verify_error_message_contains_actionable_guidance(tmp_path: Path) -> No
55
55
  message = str(excinfo.value)
56
56
  assert "upstream layout changed" in message
57
57
  assert "file an issue" in message
58
+
59
+
60
+ @pytest.mark.parametrize("forbidden_path", FORBIDDEN_PATHS)
61
+ def test_verify_raises_when_forbidden_path_is_present(
62
+ tmp_path: Path, forbidden_path: str
63
+ ) -> None:
64
+ _make_complete_project(tmp_path)
65
+ target = tmp_path / forbidden_path
66
+ if forbidden_path == ".git":
67
+ target.mkdir()
68
+ else:
69
+ target.write_text("stub", encoding="utf-8")
70
+
71
+ with pytest.raises(VerificationError) as excinfo:
72
+ verify_project(tmp_path)
73
+
74
+ message = str(excinfo.value)
75
+ assert forbidden_path in message
76
+ assert "file an issue" in message
@@ -46,7 +46,7 @@ wheels = [
46
46
 
47
47
  [[package]]
48
48
  name = "dev-ready"
49
- version = "0.1.4"
49
+ version = "0.2.1"
50
50
  source = { editable = "." }
51
51
  dependencies = [
52
52
  { name = "copier" },
@@ -1,56 +0,0 @@
1
- # v0.2 Plan — dev-ready
2
-
3
- Status: Accepted (2026-07-16). Written by the Tech Lead (ADR-007). Source of truth for phase handoff generation.
4
-
5
- Scope: FR-7..FR-10 in `docs/requirements.md`; decisions in ADR-006/ADR-007 in `docs/architecture.md`. Everything else is out of scope for v0.2.
6
-
7
- ## Pre-phase: release v0.1.4 first
8
-
9
- The pending fixes on main must ship before v0.2 work starts, since v0.1.3 output is visibly broken (`.git` + `copier.yml` leak):
10
-
11
- 1. manifest `exclude` additions (`.git`, `copier.yml`, `copier.yaml`) + snapshot.py comment
12
- 2. `upstream-bump.yml` token fallback (`BUMP_PR_TOKEN`) — CEO must create the fine-grained PAT and repo secret
13
- 3. CLAUDE.md.tmpl corrections (`compose.yml`, repo link)
14
-
15
- Release: bump version to 0.1.4, tag `v0.1.4`, existing release pipeline does the rest.
16
-
17
- ## Phase 1 — prune list + leak guard (FR-7, FR-9)
18
-
19
- Smallest phase, highest user-visible value. Ships as v0.2.0.
20
-
21
- - `manifest` module: add optional `prune` key (validation identical to `exclude`: non-empty relative-path strings, no leading `/`, no `..` segments). New field on `UpstreamPin`, default empty tuple.
22
- - `fetch`: pass `exclude=pin.exclude + pin.prune` to `copier.run_copy` (order irrelevant to Copier; keep exclude first for readability).
23
- - `manifest.json`: populate `prune` with the audited FR-7 list. NOTE for implementer: Copier exclude patterns are source paths relative to the template root; directory entries need the path form Copier matches (verify `img`, `hooks`, and individual `.github/workflows/*.yml` entries against a real run — the FR-7 list names intents, the implementer confirms exact patterns).
24
- - `verify`: add `FORBIDDEN_PATHS = (".git", "copier.yml", "copier.yaml")`; `verify_project` raises `VerificationError` (exit 5) if any exists in the staged output. Do NOT add pruned paths here — prune is curation, not corruption; only leak-class paths are forbidden.
25
- - Tests: manifest parsing (prune present/absent/invalid), fetch merge behavior (unit, no network), verify forbidden-path (tmp_path fixtures). CI generate-and-verify already exercises the real pipeline.
26
- - Acceptance: a fresh generation contains none of the FR-7 pruned files; all FR-7 KEEP files still present; unit suite green without network.
27
-
28
- ## Phase 2 — project README (FR-8)
29
-
30
- Depends on Phase 1 (prune must remove upstream README.md first).
31
-
32
- - Add `README.md` to the `prune` list.
33
- - New overlay template `templates/readme/README.md.tmpl`: project name heading, one-paragraph stack description, commands section mirroring CLAUDE.md.tmpl, link back to dev-ready and the upstream template. Always applied (like CLAUDE.md), not a selectable component.
34
- - Overlay no-overwrite rule unchanged — prune guarantees no collision. If prune is somehow disabled and README.md exists, the existing `OverlayError` collision path is the correct behavior; do not special-case.
35
- - Tests: overlay unit tests for the new file; template token check already generic.
36
- - Acceptance: generated project has a README about ITSELF, not about the template; no broken `img/` references anywhere.
37
-
38
- ## Phase 3 — agent-team overlay component (FR-10)
39
-
40
- - Fourth optional component `agents` beside skills/mcp/docs: `--no-agents` flag, checkbox entry, `Answers.include_agents`, default on.
41
- - New overlay tree `templates/agents/`: `docs/handoffs/README.md` (the protocol: roles table from ADR-007, file naming `phase-N/01-opus-plan.md` … `06-bob-sre.md`, `reports/` convention, stop-and-escalate rule for the junior) plus one skeleton per handoff type with placeholder sections.
42
- - Generated CLAUDE.md gains an agent-roles section (extend CLAUDE.md.tmpl — keep it short, point at `docs/handoffs/README.md`).
43
- - Tests: prompts (component matrix now 4-wide), cli flag mapping, overlay tree application.
44
- - Acceptance: `--yes` generation includes the scaffold; `--no-agents` excludes it; interactive checkbox shows four components.
45
-
46
- ## Phase 4 — close out
47
-
48
- - Docs: update `docs/v0.1-overview.md` successor or write `v0.2-overview.md`; README-pypi feature list; cli-spec.md flag table (`--no-agents`).
49
- - Bob passes (QA/Security/SRE per `.bob/`), release v0.2.0.
50
-
51
- ## Standing constraints (binding for every phase)
52
-
53
- - Hard rules in CLAUDE.md apply unchanged (pins only in manifest.json, network only in `fetch/`, all-or-nothing generation, no-network unit tests, Conventional Commits).
54
- - No new runtime dependencies in v0.2.
55
- - Module boundaries per architecture.md; a phase that wants to cross one escalates to the Tech Lead instead of crossing it.
56
- - Every phase ends with: unit suite green, `ruff check` clean, CI generate-and-verify green.
@@ -1,22 +0,0 @@
1
- {
2
- "manifest_version": 1,
3
- "upstream": {
4
- "base_template": {
5
- "repo": "fastapi/full-stack-fastapi-template",
6
- "ref": "master",
7
- "commit": "4cd0d9e51aebd1af6f82d91ad0df4c9e41f4dea2",
8
- "verified_at": "2026-07-04",
9
- "license": "MIT",
10
- "exclude": [
11
- ".git",
12
- "copier.yml",
13
- "copier.yaml",
14
- ".agents/skills/fastapi",
15
- ".agents/skills/sqlmodel",
16
- ".claude/skills/fastapi",
17
- ".claude/skills/sqlmodel"
18
- ]
19
- }
20
- },
21
- "overlay_version": "0.1.0"
22
- }
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