open-codev-workflow 0.1.0__py3-none-any.whl
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.
- codev_workflow/__init__.py +5 -0
- codev_workflow/__main__.py +4 -0
- codev_workflow/bundle/.agents/skills/build-change/SKILL.md +96 -0
- codev_workflow/bundle/.agents/skills/build-change/agents/openai.yaml +4 -0
- codev_workflow/bundle/.agents/skills/build-change/assets/implementation-plan.template.md +51 -0
- codev_workflow/bundle/.agents/skills/define-product/SKILL.md +79 -0
- codev_workflow/bundle/.agents/skills/define-product/agents/openai.yaml +4 -0
- codev_workflow/bundle/.agents/skills/define-product/assets/brief.template.md +50 -0
- codev_workflow/bundle/.agents/skills/design-solution/SKILL.md +75 -0
- codev_workflow/bundle/.agents/skills/design-solution/agents/openai.yaml +4 -0
- codev_workflow/bundle/.agents/skills/design-solution/assets/decision.template.md +26 -0
- codev_workflow/bundle/.agents/skills/design-solution/assets/design.template.md +76 -0
- codev_workflow/bundle/.agents/skills/launch-product/SKILL.md +66 -0
- codev_workflow/bundle/.agents/skills/launch-product/agents/openai.yaml +4 -0
- codev_workflow/bundle/.agents/skills/launch-product/assets/launch-plan.template.md +48 -0
- codev_workflow/bundle/.agents/skills/plan-delivery/SKILL.md +140 -0
- codev_workflow/bundle/.agents/skills/plan-delivery/agents/openai.yaml +4 -0
- codev_workflow/bundle/.agents/skills/plan-delivery/assets/delivery-plan.template.md +41 -0
- codev_workflow/bundle/.agents/skills/review-change/SKILL.md +48 -0
- codev_workflow/bundle/.agents/skills/review-change/agents/openai.yaml +4 -0
- codev_workflow/bundle/.agents/skills/specify-project/SKILL.md +205 -0
- codev_workflow/bundle/.agents/skills/specify-project/agents/openai.yaml +4 -0
- codev_workflow/bundle/.agents/skills/specify-project/assets/specification.template.md +151 -0
- codev_workflow/bundle/.agents/skills/specify-project/references/interview-coverage.md +303 -0
- codev_workflow/bundle/.agents/skills/specify-project/scripts/validate_specification.py +143 -0
- codev_workflow/bundle/.opencode/agents/builder.md +54 -0
- codev_workflow/bundle/.opencode/agents/orchestrator.md +72 -0
- codev_workflow/bundle/.opencode/agents/reviewer.md +35 -0
- codev_workflow/bundle/AGENTS.md +23 -0
- codev_workflow/bundle/docs/AI-WORKFLOW-PROMPTS.md +318 -0
- codev_workflow/bundle/docs/WORKFLOW-COOKBOOK.md +419 -0
- codev_workflow/bundle/docs/WORKFLOW-HUMAN.md +212 -0
- codev_workflow/bundle/docs/for-ai/WORKFLOW-AGENTS.md +171 -0
- codev_workflow/bundle/docs/handbooks/IDEA-TO-PRODUCTION-HANDBOOK.md +1190 -0
- codev_workflow/bundle/docs/handbooks/LANGUAGE-AGNOSTIC-PROJECT-HANDBOOK.md +745 -0
- codev_workflow/bundle/docs/handbooks/PYTHON-PROJECT-HANDBOOK.md +960 -0
- codev_workflow/bundle/evals/development-workflow/scenarios.json +132 -0
- codev_workflow/bundle/scripts/evaluate-development-workflow.py +352 -0
- codev_workflow/bundle/scripts/validate-development-workflow.py +213 -0
- codev_workflow/cli.py +140 -0
- codev_workflow/installer.py +891 -0
- open_codev_workflow-0.1.0.dist-info/METADATA +150 -0
- open_codev_workflow-0.1.0.dist-info/RECORD +47 -0
- open_codev_workflow-0.1.0.dist-info/WHEEL +5 -0
- open_codev_workflow-0.1.0.dist-info/entry_points.txt +2 -0
- open_codev_workflow-0.1.0.dist-info/licenses/LICENSE +28 -0
- open_codev_workflow-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,745 @@
|
|
|
1
|
+
# Google-Inspired Language-Agnostic Project Handbook
|
|
2
|
+
|
|
3
|
+
**Audience:** developers, technical leads, engineering managers, platform teams,
|
|
4
|
+
and AI-assisted contributors working in any programming language
|
|
5
|
+
|
|
6
|
+
**Purpose:** provide a precise repository and engineering standard that can be
|
|
7
|
+
adapted to a service, library, command-line tool, desktop application, mobile
|
|
8
|
+
application, embedded system, data product, or monorepo
|
|
9
|
+
|
|
10
|
+
**Interpretation of "Google style":** this handbook applies publicly documented
|
|
11
|
+
Google engineering principles: one source of truth, clear ownership, design
|
|
12
|
+
review for consequential work, small reviewed changes, trunk-oriented
|
|
13
|
+
development, automated evidence, and gradual release. It does not claim that
|
|
14
|
+
every Google team uses this exact directory tree, Git host, or toolchain.
|
|
15
|
+
|
|
16
|
+
## 1. The project standard
|
|
17
|
+
|
|
18
|
+
Use the repository's four human-facing steps—Understand, Build, Review, and
|
|
19
|
+
Ship—from the [Product Development Workflow](../WORKFLOW-HUMAN.md). Developers
|
|
20
|
+
describe their work normally; the AI routes to detailed skills internally.
|
|
21
|
+
|
|
22
|
+
A production repository has a small set of enforceable properties:
|
|
23
|
+
|
|
24
|
+
1. The problem, users, outcome, scope, and success measures are written down.
|
|
25
|
+
2. One repository location is canonical; the default branch is protected.
|
|
26
|
+
3. A new developer can build, test, and run the project from documented commands.
|
|
27
|
+
4. The build is reproducible from declared tools, dependencies, and lockfiles.
|
|
28
|
+
5. Formatting, linting, static analysis, tests, and artifact construction run in CI.
|
|
29
|
+
6. Architecture boundaries, public contracts, and ownership are explicit.
|
|
30
|
+
7. Changes are small, independently reviewed, and safe to integrate continuously.
|
|
31
|
+
8. Secrets are external to source control and automation uses least privilege.
|
|
32
|
+
9. Releases are immutable, observable, staged when risk requires it, and reversible.
|
|
33
|
+
10. Documentation is owned, reviewed, searchable, and maintained with the code.
|
|
34
|
+
11. AI proposes and performs bounded work; humans retain consequential authority.
|
|
35
|
+
12. Production evidence closes the loop from delivery back to product decisions.
|
|
36
|
+
|
|
37
|
+
These are outcomes. Teams may select different tools if they preserve the same
|
|
38
|
+
properties.
|
|
39
|
+
|
|
40
|
+
## 2. Decide before creating files
|
|
41
|
+
|
|
42
|
+
Record the following in an issue or short product brief before scaffolding a
|
|
43
|
+
significant project:
|
|
44
|
+
|
|
45
|
+
| Decision | Required answer |
|
|
46
|
+
|---|---|
|
|
47
|
+
| User | Who has the problem? |
|
|
48
|
+
| Problem | What costly or frustrating situation exists today? |
|
|
49
|
+
| Outcome | What user behavior or system state should change? |
|
|
50
|
+
| Evidence | How will the team know the outcome occurred? |
|
|
51
|
+
| Product shape | Service, library, application, tool, data job, or collection? |
|
|
52
|
+
| Runtime | Where will it execute, and who operates that environment? |
|
|
53
|
+
| Data | What is stored, for how long, and under which classification? |
|
|
54
|
+
| Interfaces | Which humans and systems consume it? |
|
|
55
|
+
| Risk | What happens if it is wrong, unavailable, slow, or compromised? |
|
|
56
|
+
| Ownership | Who accepts changes, incidents, and compatibility obligations? |
|
|
57
|
+
| Support window | Which operating systems, runtimes, architectures, or browsers? |
|
|
58
|
+
| Constraints | Budget, deadline, regulation, latency, scale, accessibility? |
|
|
59
|
+
|
|
60
|
+
Do not start with an architecture diagram for an unvalidated problem. For a
|
|
61
|
+
throwaway experiment, write the hypothesis, time box, evaluation, and deletion
|
|
62
|
+
date. Promote an experiment to a product only after replacing shortcuts that are
|
|
63
|
+
not safe to operate.
|
|
64
|
+
|
|
65
|
+
When a new product needs a thorough combined product-and-architecture interview,
|
|
66
|
+
use `specify-project` and create one canonical `SPECIFICATION.md` before the
|
|
67
|
+
repository skeleton. It accepts the product frame before technical design. For a
|
|
68
|
+
bounded feature, use the lighter modular `define-product` and optional
|
|
69
|
+
`design-solution` path. Do not duplicate the same facts across a specification,
|
|
70
|
+
brief, and design.
|
|
71
|
+
|
|
72
|
+
## 3. Create the repository
|
|
73
|
+
|
|
74
|
+
### 3.1 Establish the canonical location
|
|
75
|
+
|
|
76
|
+
1. Create one repository in the organization's approved version-control system.
|
|
77
|
+
2. Set `main` as the default branch.
|
|
78
|
+
3. Disable direct pushes to `main` except controlled automation or emergencies.
|
|
79
|
+
4. Require successful checks and at least one independent approval.
|
|
80
|
+
5. Require review from owners for sensitive paths.
|
|
81
|
+
6. Prevent force pushes and branch deletion on protected release branches.
|
|
82
|
+
7. Enable secret scanning, dependency alerts, and audit logging where available.
|
|
83
|
+
8. Define who may administer repository rules; keep that group small.
|
|
84
|
+
|
|
85
|
+
A repository is canonical only if issues, source, configuration, reviews, build
|
|
86
|
+
definitions, and release provenance point back to it. Do not maintain active
|
|
87
|
+
copies in shared drives or chat attachments.
|
|
88
|
+
|
|
89
|
+
### 3.2 Add the initial files
|
|
90
|
+
|
|
91
|
+
Use this tree as a starting point, then remove directories that have no current
|
|
92
|
+
purpose:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
project/
|
|
96
|
+
|-- SPECIFICATION.md # optional canonical greenfield blueprint
|
|
97
|
+
|-- .agents/
|
|
98
|
+
| `-- skills/ # repository-specific AI workflows
|
|
99
|
+
|-- .github/ # or equivalent host configuration
|
|
100
|
+
| |-- CODEOWNERS
|
|
101
|
+
| |-- pull_request_template.md
|
|
102
|
+
| `-- workflows/
|
|
103
|
+
| |-- presubmit.yml
|
|
104
|
+
| `-- release.yml
|
|
105
|
+
|-- configs/ # non-secret configuration defaults/schemas
|
|
106
|
+
|-- deploy/ # deployment definitions and environment policy
|
|
107
|
+
|-- docs/
|
|
108
|
+
| |-- product/ # briefs and outcome decisions
|
|
109
|
+
| |-- design/ # system designs and durable decisions
|
|
110
|
+
| | `-- decisions/
|
|
111
|
+
| |-- operations/ # runbooks, SLOs, dashboards, incident guidance
|
|
112
|
+
| |-- features/ # bounded feature briefs/designs when useful
|
|
113
|
+
| |-- for-ai/ # concise repository instructions for AI
|
|
114
|
+
| |-- WORKFLOW-HUMAN.md
|
|
115
|
+
| `-- README.md
|
|
116
|
+
|-- examples/ # tested consumer examples
|
|
117
|
+
|-- src/ # product source; adapt to ecosystem convention
|
|
118
|
+
|-- tests/
|
|
119
|
+
| |-- unit/
|
|
120
|
+
| |-- contract/
|
|
121
|
+
| |-- integration/
|
|
122
|
+
| |-- end_to_end/
|
|
123
|
+
| `-- performance/
|
|
124
|
+
|-- tools/ # checked-in developer/build helpers
|
|
125
|
+
|-- .editorconfig
|
|
126
|
+
|-- .gitignore
|
|
127
|
+
|-- AGENTS.md # short AI entry policy
|
|
128
|
+
|-- CHANGELOG.md # only if releases need a curated change record
|
|
129
|
+
|-- CONTRIBUTING.md
|
|
130
|
+
|-- LICENSE
|
|
131
|
+
|-- README.md
|
|
132
|
+
|-- SECURITY.md
|
|
133
|
+
`-- <build and dependency manifests>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Empty architecture is not architecture. Do not pre-create `controllers`,
|
|
137
|
+
`services`, `repositories`, or dozens of packages merely because a template
|
|
138
|
+
contains them. Add a boundary when it isolates a real responsibility, owner,
|
|
139
|
+
dependency, or change rate.
|
|
140
|
+
|
|
141
|
+
### 3.3 Define the purpose of root files
|
|
142
|
+
|
|
143
|
+
| File | Minimum content |
|
|
144
|
+
|---|---|
|
|
145
|
+
| `README.md` | purpose, status, quick start, commands, docs links, support |
|
|
146
|
+
| `CONTRIBUTING.md` | prerequisites, workflow, quality gates, review and release rules |
|
|
147
|
+
| `SECURITY.md` | supported versions, private reporting channel, response expectations |
|
|
148
|
+
| `LICENSE` | approved legal terms; do not invent a licence |
|
|
149
|
+
| `.gitignore` | generated output, local state, caches, credentials; never source |
|
|
150
|
+
| `.editorconfig` | charset, line endings, indentation, trailing whitespace |
|
|
151
|
+
| `AGENTS.md` | concise AI constraints and links; no duplicated design specification |
|
|
152
|
+
| build manifest | source roots, targets, dependencies, tasks, versions |
|
|
153
|
+
| lockfile | exact resolved dependencies; commit when the ecosystem supports it |
|
|
154
|
+
|
|
155
|
+
The README is the front door, not the complete manual. Link to canonical details
|
|
156
|
+
instead of creating a second version of them.
|
|
157
|
+
|
|
158
|
+
## 4. Choose and pin the toolchain
|
|
159
|
+
|
|
160
|
+
For each tool category, select one default and write down the supported version:
|
|
161
|
+
|
|
162
|
+
| Category | Examples | Required property |
|
|
163
|
+
|---|---|---|
|
|
164
|
+
| Runtime/compiler | JDK, Go, Rust, Node.js, Python, .NET | supported version is explicit |
|
|
165
|
+
| Package manager | ecosystem standard | lockfile and authenticated registry |
|
|
166
|
+
| Build runner | native tool, Make, task runner, Bazel | one documented entry point |
|
|
167
|
+
| Formatter | ecosystem standard | deterministic and automated |
|
|
168
|
+
| Linter/static checks | ecosystem standard | local and CI parity |
|
|
169
|
+
| Type/API checker | compiler, type checker, API diff | breaks unsafe contracts early |
|
|
170
|
+
| Test runner | ecosystem standard | machine-readable reports and filtering |
|
|
171
|
+
| Artifact builder | compiler/packager/container builder | immutable, reproducible output |
|
|
172
|
+
| Vulnerability checks | dependency and source scanners | actionable severity policy |
|
|
173
|
+
|
|
174
|
+
Pin tool versions in files the repository can review. Update them through small,
|
|
175
|
+
automated pull requests with the full checks. Avoid instructions that merely say
|
|
176
|
+
"install the latest version" because two developers then use different systems.
|
|
177
|
+
|
|
178
|
+
## 5. Build and developer experience
|
|
179
|
+
|
|
180
|
+
### 5.1 Offer one obvious command surface
|
|
181
|
+
|
|
182
|
+
Every repository should expose equivalent tasks, regardless of implementation:
|
|
183
|
+
|
|
184
|
+
```text
|
|
185
|
+
bootstrap install or verify tools and dependencies
|
|
186
|
+
format rewrite source into canonical formatting
|
|
187
|
+
lint run non-mutating style and policy checks
|
|
188
|
+
typecheck compile or check static types and APIs
|
|
189
|
+
test run the normal deterministic test suite
|
|
190
|
+
test-all run slower integration/end-to-end checks
|
|
191
|
+
build create the releasable artifact
|
|
192
|
+
run start the project locally with safe defaults
|
|
193
|
+
verify run the complete presubmit gate
|
|
194
|
+
clean remove only documented generated output
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
The task runner is an adapter, not a second build system. It should invoke the
|
|
198
|
+
same compiler and package-manager commands developers can diagnose directly.
|
|
199
|
+
Commands must be non-interactive in CI and return nonzero on failure.
|
|
200
|
+
|
|
201
|
+
### 5.2 Make builds reproducible
|
|
202
|
+
|
|
203
|
+
- Declare every input: source, tool version, dependency, build option, and
|
|
204
|
+
generated file source.
|
|
205
|
+
- Resolve dependencies from lockfiles or content-addressed manifests.
|
|
206
|
+
- Do not depend on undeclared files from a developer's home directory.
|
|
207
|
+
- Normalize timestamps and ordering where the artifact format permits it.
|
|
208
|
+
- Separate platform-specific targets instead of relying on accidental host state.
|
|
209
|
+
- Build release candidates in hosted automation from a known, green commit.
|
|
210
|
+
- Record source commit, toolchain, dependency set, and artifact digest.
|
|
211
|
+
- Test the artifact that will be released, not a separately rebuilt approximation.
|
|
212
|
+
|
|
213
|
+
Hermeticity is a spectrum. Document unavoidable external inputs and verify them
|
|
214
|
+
with checksums, versions, and access controls.
|
|
215
|
+
|
|
216
|
+
### 5.3 Treat generated code as a product of its generator
|
|
217
|
+
|
|
218
|
+
Check in generated output only when consumers or build constraints require it.
|
|
219
|
+
In either case:
|
|
220
|
+
|
|
221
|
+
1. pin the generator;
|
|
222
|
+
2. store the source definition;
|
|
223
|
+
3. provide one regeneration command;
|
|
224
|
+
4. fail CI if regeneration changes a supposedly current file; and
|
|
225
|
+
5. review semantic source changes, not just generated noise.
|
|
226
|
+
|
|
227
|
+
## 6. Dependencies and supply chain
|
|
228
|
+
|
|
229
|
+
For every new dependency, record or review:
|
|
230
|
+
|
|
231
|
+
- the exact capability it supplies;
|
|
232
|
+
- why existing platform or standard-library functionality is insufficient;
|
|
233
|
+
- licence and organizational policy compatibility;
|
|
234
|
+
- maintenance activity and security posture;
|
|
235
|
+
- transitive dependency cost;
|
|
236
|
+
- runtime, binary-size, privacy, and availability effects;
|
|
237
|
+
- ownership and replacement plan.
|
|
238
|
+
|
|
239
|
+
Separate production, development, test, build, and optional dependencies. Remove
|
|
240
|
+
unused dependencies. Authenticate private registries. Use short-lived credentials
|
|
241
|
+
in automation. Verify checksums or signatures when supported.
|
|
242
|
+
|
|
243
|
+
For higher-assurance projects, generate a software bill of materials, sign
|
|
244
|
+
artifacts, retain provenance, and raise the target SLSA level deliberately.
|
|
245
|
+
|
|
246
|
+
## 7. Architecture and source organization
|
|
247
|
+
|
|
248
|
+
### 7.1 Organize around responsibilities
|
|
249
|
+
|
|
250
|
+
A healthy component has:
|
|
251
|
+
|
|
252
|
+
- one clear purpose;
|
|
253
|
+
- a small public interface;
|
|
254
|
+
- private implementation details;
|
|
255
|
+
- explicit incoming and outgoing dependencies;
|
|
256
|
+
- an owner for changes and incidents; and
|
|
257
|
+
- tests at the boundary where failures matter.
|
|
258
|
+
|
|
259
|
+
Prefer dependency direction from volatile delivery mechanisms toward stable
|
|
260
|
+
domain rules, or another explicit architecture appropriate to the project.
|
|
261
|
+
Business logic should not require a live network, UI framework, or production
|
|
262
|
+
database merely to be tested.
|
|
263
|
+
|
|
264
|
+
### 7.2 Make contracts explicit
|
|
265
|
+
|
|
266
|
+
A contract can be a typed interface, schema, protocol, command syntax, database
|
|
267
|
+
migration rule, event definition, or user-facing behavior. For each shared
|
|
268
|
+
contract specify:
|
|
269
|
+
|
|
270
|
+
- producer and consumers;
|
|
271
|
+
- syntax and semantics;
|
|
272
|
+
- validation and error behavior;
|
|
273
|
+
- compatibility rules;
|
|
274
|
+
- versioning and deprecation window;
|
|
275
|
+
- security and privacy classification;
|
|
276
|
+
- performance or availability expectations; and
|
|
277
|
+
- contract tests or fixtures.
|
|
278
|
+
|
|
279
|
+
Parallel development is safe only when collaborators can build against an
|
|
280
|
+
accepted contract and independently verify compatibility.
|
|
281
|
+
|
|
282
|
+
### 7.3 Record durable decisions
|
|
283
|
+
|
|
284
|
+
Use a short design decision record when a choice will otherwise be repeatedly
|
|
285
|
+
re-litigated. Include context, decision, considered alternatives, consequences,
|
|
286
|
+
owner, date, and superseding decision. Do not create a record for routine local
|
|
287
|
+
implementation choices that are obvious in code.
|
|
288
|
+
|
|
289
|
+
## 8. Configuration, environments, and secrets
|
|
290
|
+
|
|
291
|
+
Define a typed or schema-validated configuration interface. Safe local defaults
|
|
292
|
+
may live in Git. Secrets never do.
|
|
293
|
+
|
|
294
|
+
- Keep development, test, staging, and production differences in deployment
|
|
295
|
+
configuration, not conditional source branches.
|
|
296
|
+
- Retrieve secrets from an approved secret manager at runtime.
|
|
297
|
+
- Use workload identity or short-lived tokens instead of static cloud keys.
|
|
298
|
+
- Validate required values at startup with clear, non-secret error messages.
|
|
299
|
+
- Define precedence among command arguments, environment, files, and remote config.
|
|
300
|
+
- Rotate credentials and test the rotation procedure.
|
|
301
|
+
- Redact tokens, credentials, personal data, and sensitive payloads from logs.
|
|
302
|
+
|
|
303
|
+
An environment variable is a transport mechanism, not automatically a secure
|
|
304
|
+
secret-management system.
|
|
305
|
+
|
|
306
|
+
## 9. Code conventions and maintainability
|
|
307
|
+
|
|
308
|
+
Adopt the ecosystem's established style guide and enforce the machine-checkable
|
|
309
|
+
parts. Repository rules should cover:
|
|
310
|
+
|
|
311
|
+
- names, file layout, imports, and visibility;
|
|
312
|
+
- error handling and resource cleanup;
|
|
313
|
+
- concurrency and cancellation;
|
|
314
|
+
- logging and telemetry;
|
|
315
|
+
- nullability or optional data;
|
|
316
|
+
- API documentation;
|
|
317
|
+
- generated code;
|
|
318
|
+
- dependency injection and test seams; and
|
|
319
|
+
- forbidden unsafe constructs.
|
|
320
|
+
|
|
321
|
+
Optimize for the reader. Prefer straightforward code, precise names, small
|
|
322
|
+
interfaces, and comments that explain why. Avoid framework layers, generalized
|
|
323
|
+
factories, or configuration points without a demonstrated second use.
|
|
324
|
+
|
|
325
|
+
Warnings must either fail the relevant gate, be suppressed with an owned reason,
|
|
326
|
+
or be removed. A permanently noisy check is not a control.
|
|
327
|
+
|
|
328
|
+
## 10. Testing and evaluation
|
|
329
|
+
|
|
330
|
+
### 10.1 Use a layered test strategy
|
|
331
|
+
|
|
332
|
+
| Layer | Purpose | Normal trigger |
|
|
333
|
+
|---|---|---|
|
|
334
|
+
| Unit | deterministic behavior in one component | every change |
|
|
335
|
+
| Contract | compatibility between independently changed components | interface changes and presubmit |
|
|
336
|
+
| Integration | real adapters such as database, queue, filesystem, or service | presubmit or postsubmit |
|
|
337
|
+
| End-to-end | critical user journey across deployed boundaries | staging and selected presubmit |
|
|
338
|
+
| Performance | latency, throughput, memory, scale, regression | scheduled and release candidates |
|
|
339
|
+
| Resilience | timeout, retry, partial failure, restore, failover | risk-based and scheduled |
|
|
340
|
+
| Security | abuse cases, authorization, dependency and source scanning | every relevant change plus scheduled |
|
|
341
|
+
| Accessibility/usability | actual user interaction quality | feature and release review |
|
|
342
|
+
|
|
343
|
+
Most tests should be fast and deterministic; a small number should exercise the
|
|
344
|
+
real integration. Test observable behavior, not private method shape.
|
|
345
|
+
|
|
346
|
+
### 10.2 Protect the evaluator
|
|
347
|
+
|
|
348
|
+
AI-assisted implementation can optimize toward visible tests. For critical
|
|
349
|
+
behavior:
|
|
350
|
+
|
|
351
|
+
- derive acceptance tests from the brief and contracts, not from generated code;
|
|
352
|
+
- have a human or independent reviewer examine test adequacy;
|
|
353
|
+
- use hidden, immutable, or independently owned evaluation cases where gaming is
|
|
354
|
+
consequential;
|
|
355
|
+
- add property, fuzz, mutation, differential, or fault-injection tests when useful;
|
|
356
|
+
- validate negative paths and authorization boundaries;
|
|
357
|
+
- track false positives and false negatives in quality gates.
|
|
358
|
+
|
|
359
|
+
A passing test suite proves only what the suite measures.
|
|
360
|
+
|
|
361
|
+
### 10.3 Control flaky tests
|
|
362
|
+
|
|
363
|
+
Do not normalize retries as success. On a flaky failure:
|
|
364
|
+
|
|
365
|
+
1. preserve diagnostics;
|
|
366
|
+
2. identify an owner;
|
|
367
|
+
3. reproduce or quantify the failure rate;
|
|
368
|
+
4. fix it promptly, or quarantine it with a deadline and visible risk; and
|
|
369
|
+
5. restore the protection or remove the invalid test.
|
|
370
|
+
|
|
371
|
+
## 11. Version control and change management
|
|
372
|
+
|
|
373
|
+
### 11.1 Use trunk-oriented development
|
|
374
|
+
|
|
375
|
+
- Branch from current `main`.
|
|
376
|
+
- Keep branches short-lived.
|
|
377
|
+
- Rebase or merge the latest target branch before final validation according to
|
|
378
|
+
repository policy.
|
|
379
|
+
- Integrate incomplete but safe work behind an inactive feature flag.
|
|
380
|
+
- Delete merged branches.
|
|
381
|
+
- Release from known green commits rather than long-lived integration branches.
|
|
382
|
+
|
|
383
|
+
Long-lived branches hide integration risk. Use them only for an explicit support
|
|
384
|
+
or release policy, with a named merge strategy.
|
|
385
|
+
|
|
386
|
+
### 11.2 Keep changes small
|
|
387
|
+
|
|
388
|
+
One change should have one coherent purpose. Include tests with the behavior.
|
|
389
|
+
Separate preparatory refactors, mechanical migration, generated output, and
|
|
390
|
+
behavior changes when they can be reviewed independently.
|
|
391
|
+
|
|
392
|
+
Line count is a warning, not a universal rule. Reviewability is the requirement:
|
|
393
|
+
the reviewer must be able to understand the complete effect, validate it, and
|
|
394
|
+
spot unrelated work. Google guidance notes that roughly 100 lines can often be
|
|
395
|
+
reasonable and 1,000 lines usually is not, while generated code and deletions
|
|
396
|
+
need judgment.
|
|
397
|
+
|
|
398
|
+
### 11.3 Require a useful change description
|
|
399
|
+
|
|
400
|
+
Every pull request or change list should state:
|
|
401
|
+
|
|
402
|
+
- problem and intended outcome;
|
|
403
|
+
- what changed and why this approach was chosen;
|
|
404
|
+
- what deliberately did not change;
|
|
405
|
+
- test and validation evidence;
|
|
406
|
+
- risk, compatibility, migration, security, and privacy effects;
|
|
407
|
+
- screenshots or recordings for user-interface changes;
|
|
408
|
+
- rollout and rollback plan when behavior reaches users; and
|
|
409
|
+
- links to the accepted brief, design, decision, and work item.
|
|
410
|
+
|
|
411
|
+
Commit messages and review descriptions explain intent and rationale; the diff
|
|
412
|
+
already shows mechanics.
|
|
413
|
+
|
|
414
|
+
## 12. Code review
|
|
415
|
+
|
|
416
|
+
The author and approving reviewer must differ. Review the exact snapshot that
|
|
417
|
+
will merge. The reviewer examines:
|
|
418
|
+
|
|
419
|
+
1. **Design:** does the change belong here and preserve system boundaries?
|
|
420
|
+
2. **Functionality:** does behavior meet the accepted outcome, including errors?
|
|
421
|
+
3. **Complexity:** is the solution simpler than its problem warrants?
|
|
422
|
+
4. **Tests:** would they fail for realistic regressions, and are key gaps present?
|
|
423
|
+
5. **Security/privacy:** are identity, authorization, validation, data, and logs safe?
|
|
424
|
+
6. **Concurrency/resources:** are cancellation, cleanup, ordering, and limits correct?
|
|
425
|
+
7. **Compatibility:** are APIs, schemas, migrations, and clients protected?
|
|
426
|
+
8. **Operations:** are metrics, diagnostics, alerts, rollout, and rollback adequate?
|
|
427
|
+
9. **Maintainability:** can the owning team understand and modify it later?
|
|
428
|
+
10. **Scope:** is unrelated change absent?
|
|
429
|
+
|
|
430
|
+
Review aims to improve overall code health, not demand theoretical perfection.
|
|
431
|
+
Block correctness and material maintainability problems. Label optional ideas as
|
|
432
|
+
non-blocking. Resolve disagreement with evidence, the design owner, and the
|
|
433
|
+
repository's escalation route.
|
|
434
|
+
|
|
435
|
+
## 13. Continuous integration
|
|
436
|
+
|
|
437
|
+
### 13.1 Presubmit pipeline
|
|
438
|
+
|
|
439
|
+
Order fast, broadly diagnostic checks first:
|
|
440
|
+
|
|
441
|
+
```text
|
|
442
|
+
checkout pinned source
|
|
443
|
+
-> verify toolchain and lockfiles
|
|
444
|
+
-> formatting check
|
|
445
|
+
-> lint/static/type/API checks
|
|
446
|
+
-> unit and contract tests
|
|
447
|
+
-> integration tests
|
|
448
|
+
-> build releasable artifact
|
|
449
|
+
-> security/licence/policy scans
|
|
450
|
+
-> publish reports and artifact metadata
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
For every required job:
|
|
454
|
+
|
|
455
|
+
- use a pinned, trusted runner image and action/plugin version;
|
|
456
|
+
- grant the minimum token permissions;
|
|
457
|
+
- avoid executing untrusted contribution code with production credentials;
|
|
458
|
+
- cache only content identified by dependency and tool versions;
|
|
459
|
+
- set timeouts;
|
|
460
|
+
- retain useful logs and test reports;
|
|
461
|
+
- make failures actionable and assign an owning team; and
|
|
462
|
+
- cancel superseded runs when doing so is safe.
|
|
463
|
+
|
|
464
|
+
### 13.2 Postsubmit and scheduled checks
|
|
465
|
+
|
|
466
|
+
Run expensive platform matrices, endurance tests, fuzzing, full vulnerability
|
|
467
|
+
scans, restore drills, and production-like integration after merge or on a
|
|
468
|
+
schedule. Postsubmit must not become a dumping ground for checks that should have
|
|
469
|
+
blocked an unsafe change.
|
|
470
|
+
|
|
471
|
+
Keep the head of `main` green. If it breaks, revert or fix it immediately before
|
|
472
|
+
building more work on an unknown base.
|
|
473
|
+
|
|
474
|
+
## 14. Security and privacy by design
|
|
475
|
+
|
|
476
|
+
Threat-model features that cross trust boundaries, accept untrusted content,
|
|
477
|
+
change authorization, handle sensitive data, or execute generated instructions.
|
|
478
|
+
At minimum:
|
|
479
|
+
|
|
480
|
+
- authenticate the caller and authorize the exact action;
|
|
481
|
+
- validate input at trust boundaries and encode output for its destination;
|
|
482
|
+
- restrict network, filesystem, process, and cloud permissions;
|
|
483
|
+
- encrypt sensitive data in transit and at rest;
|
|
484
|
+
- minimize collection and retention;
|
|
485
|
+
- audit consequential actions without logging secrets;
|
|
486
|
+
- rate-limit and bound expensive work;
|
|
487
|
+
- patch dependencies and supported release lines;
|
|
488
|
+
- define private vulnerability reporting and incident ownership; and
|
|
489
|
+
- test backup restoration, not only backup creation.
|
|
490
|
+
|
|
491
|
+
For AI features, treat model output, retrieved documents, web pages, issue text,
|
|
492
|
+
and code comments as untrusted data. Tool permissions must be narrower than the
|
|
493
|
+
model's possible suggestions. Require human authorization for irreversible or
|
|
494
|
+
externally consequential actions.
|
|
495
|
+
|
|
496
|
+
## 15. Release and operations
|
|
497
|
+
|
|
498
|
+
### 15.1 Build once, promote the same artifact
|
|
499
|
+
|
|
500
|
+
Produce an immutable artifact from a green commit. Identify it by digest, attach
|
|
501
|
+
provenance and test evidence, deploy it to preproduction, and promote that same
|
|
502
|
+
artifact. Do not rebuild separately for production.
|
|
503
|
+
|
|
504
|
+
### 15.2 Use progressive delivery
|
|
505
|
+
|
|
506
|
+
Select controls proportional to impact:
|
|
507
|
+
|
|
508
|
+
1. development and automated evaluation;
|
|
509
|
+
2. internal or test-account exposure;
|
|
510
|
+
3. staging or production shadow traffic;
|
|
511
|
+
4. small canary cohort;
|
|
512
|
+
5. measured expansion;
|
|
513
|
+
6. broad availability; and
|
|
514
|
+
7. cleanup of temporary flags and compatibility code.
|
|
515
|
+
|
|
516
|
+
Before each step define success metrics, guardrails, observation duration,
|
|
517
|
+
decision owner, stop threshold, and rollback action. A feature flag is temporary
|
|
518
|
+
control state: name an owner and expiration date.
|
|
519
|
+
|
|
520
|
+
### 15.3 Make systems operable
|
|
521
|
+
|
|
522
|
+
Before production, define:
|
|
523
|
+
|
|
524
|
+
- service-level indicators and objectives where relevant;
|
|
525
|
+
- logs, metrics, traces, dashboards, and actionable alerts;
|
|
526
|
+
- on-call or support ownership;
|
|
527
|
+
- dependency failure and capacity behavior;
|
|
528
|
+
- data migration, backup, restore, and disaster-recovery procedures;
|
|
529
|
+
- incident response and communication routes;
|
|
530
|
+
- rollback or forward-fix procedures; and
|
|
531
|
+
- lifecycle, deprecation, and deletion policy.
|
|
532
|
+
|
|
533
|
+
An alert should represent user impact or an actionable precursor, not merely a
|
|
534
|
+
metric crossing an arbitrary line.
|
|
535
|
+
|
|
536
|
+
## 16. Documentation as engineering work
|
|
537
|
+
|
|
538
|
+
Documentation should be:
|
|
539
|
+
|
|
540
|
+
- **canonical:** one authoritative location;
|
|
541
|
+
- **owned:** a person or team is accountable;
|
|
542
|
+
- **reviewed:** technical changes receive the same scrutiny as code;
|
|
543
|
+
- **versioned:** it evolves with the system;
|
|
544
|
+
- **discoverable:** readers can find it from the repository front door; and
|
|
545
|
+
- **maintained:** obsolete guidance is removed or explicitly superseded.
|
|
546
|
+
|
|
547
|
+
Use the lightest artifact that preserves a necessary fact:
|
|
548
|
+
|
|
549
|
+
| Fact | Canonical location |
|
|
550
|
+
|---|---|
|
|
551
|
+
| problem, outcome, scope, success | brief, or accepted combined specification |
|
|
552
|
+
| architecture, contracts, trade-offs | design/API source, or accepted combined specification |
|
|
553
|
+
| durable decision rationale | decision record |
|
|
554
|
+
| owner and current status | issue/project tracker |
|
|
555
|
+
| executable behavior | code and tests |
|
|
556
|
+
| developer commands | repository README/contributing guide |
|
|
557
|
+
| production response | runbook and observability system |
|
|
558
|
+
| rollout state and evidence | launch record |
|
|
559
|
+
|
|
560
|
+
Avoid status duplicated in multiple Markdown plans. Git is the revision history;
|
|
561
|
+
the issue tracker is the current work state.
|
|
562
|
+
|
|
563
|
+
## 17. Human-AI development policy
|
|
564
|
+
|
|
565
|
+
This repository's overhauled system uses six lifecycle skills plus one optional
|
|
566
|
+
guided project facade:
|
|
567
|
+
|
|
568
|
+
| Need | Skill | Output or effect |
|
|
569
|
+
|---|---|---|
|
|
570
|
+
| frame and design a whole new product through one interview | `specify-project` | accepted canonical `SPECIFICATION.md` |
|
|
571
|
+
| clarify an idea | `define-product` | accepted product or feature brief |
|
|
572
|
+
| decide a material solution | `design-solution` | practical design and decisions |
|
|
573
|
+
| coordinate a team | `plan-delivery` | milestones, ready items, owners, dependencies |
|
|
574
|
+
| implement one item | `build-change` | small validated change with checkpoints |
|
|
575
|
+
| independently inspect it | `review-change` | evidence-based findings on an exact snapshot |
|
|
576
|
+
| release safely | `launch-product` | readiness, rollout, rollback, and learning |
|
|
577
|
+
|
|
578
|
+
Use the lightest safe path:
|
|
579
|
+
|
|
580
|
+
- **Quick change:** issue -> `build-change` -> human review -> merge.
|
|
581
|
+
- **Feature:** `define-product` -> optional `design-solution` -> repeated
|
|
582
|
+
`build-change`/`review-change` -> proportionate rollout.
|
|
583
|
+
- **Greenfield guided product:** `specify-project` -> `plan-delivery` -> repeated
|
|
584
|
+
build/review loops -> `launch-product`.
|
|
585
|
+
- **Product, modular:** `define-product` -> `design-solution` -> all later
|
|
586
|
+
lifecycle skills, with only the next milestone decomposed in detail.
|
|
587
|
+
|
|
588
|
+
The guided facade is not a seventh lifecycle stage. It combines the first two
|
|
589
|
+
forms of thinking while preserving separate human acceptance for the product
|
|
590
|
+
frame and technical design. Once accepted, the specification replaces the brief
|
|
591
|
+
and design as their source of truth for that project.
|
|
592
|
+
|
|
593
|
+
Humans own intent, accepted trade-offs, merge, deployment, migration,
|
|
594
|
+
publication, and rollout expansion. AI may inspect, propose, implement, test,
|
|
595
|
+
summarize, and independently review within granted scope. AI must stop when a
|
|
596
|
+
material choice is absent, requirements conflict, the base changes, work
|
|
597
|
+
collides, or required evidence cannot be obtained.
|
|
598
|
+
|
|
599
|
+
Repository instructions for AI should be concise and hierarchical:
|
|
600
|
+
|
|
601
|
+
1. organization policy;
|
|
602
|
+
2. repository `AGENTS.md`;
|
|
603
|
+
3. relevant workflow skill;
|
|
604
|
+
4. accepted specification, or accepted brief and design;
|
|
605
|
+
5. current work item and exact code snapshot.
|
|
606
|
+
|
|
607
|
+
Do not paste the entire company handbook into every prompt. Give AI the smallest
|
|
608
|
+
complete context, explicitly identify untrusted text, and require citations to
|
|
609
|
+
repository facts for consequential claims.
|
|
610
|
+
|
|
611
|
+
## 18. Solo and team operation
|
|
612
|
+
|
|
613
|
+
### 18.1 Solo developer
|
|
614
|
+
|
|
615
|
+
A solo developer still separates roles in time:
|
|
616
|
+
|
|
617
|
+
- write acceptance behavior before implementation;
|
|
618
|
+
- use a fresh AI context for independent review;
|
|
619
|
+
- leave high-risk work overnight before final review when feasible;
|
|
620
|
+
- protect `main` and require CI even if approval rules cannot require a second human;
|
|
621
|
+
- ask a human specialist to review security, privacy, legal, or irreversible data work;
|
|
622
|
+
- stage releases and observe evidence before expansion.
|
|
623
|
+
|
|
624
|
+
Do not manufacture project-management ceremony for a one-day change. Preserve
|
|
625
|
+
the decisions and evidence that a future maintainer needs.
|
|
626
|
+
|
|
627
|
+
### 18.2 Multi-developer team
|
|
628
|
+
|
|
629
|
+
- Assign each important component and interface an owner.
|
|
630
|
+
- Agree shared contracts and fixtures before parallel implementation.
|
|
631
|
+
- Default to one implementation item per developer.
|
|
632
|
+
- Name the reviewer before work starts; author and reviewer differ.
|
|
633
|
+
- Record only `Blocked by`, `Integrates with`, and `Lands after` unless a more
|
|
634
|
+
complex relation genuinely changes scheduling.
|
|
635
|
+
- Name an integration owner where several work items meet.
|
|
636
|
+
- Demonstrate working behavior at milestone boundaries.
|
|
637
|
+
- Plan the next wave from current evidence, not a frozen months-long task list.
|
|
638
|
+
|
|
639
|
+
Use review capacity, not developer count, as the practical limit on parallel work.
|
|
640
|
+
|
|
641
|
+
## 19. Project readiness levels
|
|
642
|
+
|
|
643
|
+
### Level 0: exploration
|
|
644
|
+
|
|
645
|
+
- hypothesis and time box;
|
|
646
|
+
- isolated, non-production data;
|
|
647
|
+
- no unsupported security or reliability claims;
|
|
648
|
+
- explicit keep/rewrite/delete decision.
|
|
649
|
+
|
|
650
|
+
### Level 1: collaborative development
|
|
651
|
+
|
|
652
|
+
- canonical repository and ownership;
|
|
653
|
+
- bootstrap, format, lint, test, build, verify commands;
|
|
654
|
+
- protected main and review;
|
|
655
|
+
- brief and design proportional to risk;
|
|
656
|
+
- dependency lock and secrets policy.
|
|
657
|
+
|
|
658
|
+
### Level 2: releasable
|
|
659
|
+
|
|
660
|
+
- immutable artifact from hosted CI;
|
|
661
|
+
- complete functional, security, compatibility, and migration evidence;
|
|
662
|
+
- release notes and version policy;
|
|
663
|
+
- staging or equivalent verification;
|
|
664
|
+
- rollout and rollback plan.
|
|
665
|
+
|
|
666
|
+
### Level 3: production operated
|
|
667
|
+
|
|
668
|
+
- SLOs or explicit operational targets;
|
|
669
|
+
- observability and actionable alerts;
|
|
670
|
+
- support and incident ownership;
|
|
671
|
+
- tested restore and rollback;
|
|
672
|
+
- vulnerability and dependency maintenance;
|
|
673
|
+
- post-launch measurement and learning.
|
|
674
|
+
|
|
675
|
+
Do not label a prototype production-ready because its code is tidy.
|
|
676
|
+
|
|
677
|
+
## 20. Repository inception checklist
|
|
678
|
+
|
|
679
|
+
### Before the first implementation
|
|
680
|
+
|
|
681
|
+
- [ ] Brief names user, problem, outcome, success, scope, non-goals, and owner.
|
|
682
|
+
- [ ] Runtime, support window, data class, risk, and constraints are explicit.
|
|
683
|
+
- [ ] Repository is canonical and `main` is protected.
|
|
684
|
+
- [ ] Licence and security reporting policy are approved.
|
|
685
|
+
- [ ] Toolchain and dependency versions are pinned.
|
|
686
|
+
- [ ] Bootstrap and verify work in a disposable environment.
|
|
687
|
+
- [ ] Source and test boundaries follow ecosystem convention.
|
|
688
|
+
- [ ] Secrets and environment configuration are externalized.
|
|
689
|
+
- [ ] CI runs on the initial change.
|
|
690
|
+
|
|
691
|
+
### Before accepting a change
|
|
692
|
+
|
|
693
|
+
- [ ] Acceptance behavior and non-goals are still correct.
|
|
694
|
+
- [ ] The diff has one coherent purpose.
|
|
695
|
+
- [ ] Contracts, compatibility, data, security, and operations were considered.
|
|
696
|
+
- [ ] Tests are behavior-focused and sufficiently independent.
|
|
697
|
+
- [ ] All required automation passed on the exact snapshot.
|
|
698
|
+
- [ ] An independent human reviewed the complete diff.
|
|
699
|
+
- [ ] Documentation, rollout, rollback, and metrics are updated as needed.
|
|
700
|
+
|
|
701
|
+
### Before production
|
|
702
|
+
|
|
703
|
+
- [ ] Release artifact is immutable, identifiable, and reproducible.
|
|
704
|
+
- [ ] Required security/privacy/compliance reviews are recorded.
|
|
705
|
+
- [ ] Migration and rollback were rehearsed at the appropriate fidelity.
|
|
706
|
+
- [ ] Dashboards, alerts, runbook, ownership, and support route exist.
|
|
707
|
+
- [ ] Exposure stages, thresholds, observation windows, and decision owner exist.
|
|
708
|
+
- [ ] Temporary flags and compatibility layers have cleanup owners and dates.
|
|
709
|
+
|
|
710
|
+
## 21. Common failure modes
|
|
711
|
+
|
|
712
|
+
| Failure | Better control |
|
|
713
|
+
|---|---|
|
|
714
|
+
| elaborate tree with empty abstractions | add boundaries only for real responsibilities |
|
|
715
|
+
| local-only setup knowledge | executable bootstrap plus concise contributing guide |
|
|
716
|
+
| unpinned tools and floating dependencies | reviewed version files and lockfiles |
|
|
717
|
+
| long-lived feature branches | small trunk-oriented changes behind safe flags |
|
|
718
|
+
| tests written only to satisfy generated code | independent behavior/evaluator review |
|
|
719
|
+
| AI infers a missing product or API decision | explicit stop and human decision checkpoint |
|
|
720
|
+
| dozens of workflow documents | one source of truth for each kind of fact |
|
|
721
|
+
| green CI with unusable errors | actionable logs, owner, and fast feedback |
|
|
722
|
+
| production rebuilt from source | promote the same verified artifact |
|
|
723
|
+
| feature flag becomes permanent architecture | owner, expiry, cleanup work item |
|
|
724
|
+
| rollout judged by absence of complaints | defined product and reliability evidence |
|
|
725
|
+
| process copied uniformly to every change | lightest safe path, risk-based controls |
|
|
726
|
+
|
|
727
|
+
## 22. Authoritative references
|
|
728
|
+
|
|
729
|
+
- [Software Engineering at Google](https://abseil.io/resources/swe-book)
|
|
730
|
+
- [Google Engineering Practices: Code Review](https://google.github.io/eng-practices/review/)
|
|
731
|
+
- [Google Engineering Practices: Small CLs](https://google.github.io/eng-practices/review/developer/small-cls.html)
|
|
732
|
+
- [DORA: Trunk-Based Development](https://dora.dev/capabilities/trunk-based-development/)
|
|
733
|
+
- [DORA: Working in Small Batches](https://dora.dev/capabilities/working-in-small-batches/)
|
|
734
|
+
- [Google SRE Workbook: Canarying Releases](https://sre.google/workbook/canarying-releases/)
|
|
735
|
+
- [SLSA specification](https://slsa.dev/spec/v1.2/)
|
|
736
|
+
- [OpenSSF Scorecard](https://www.scorecard.dev/)
|
|
737
|
+
- [GitHub Actions: Secure Use](https://docs.github.com/en/actions/reference/security/secure-use)
|
|
738
|
+
|
|
739
|
+
## 23. Companion guides
|
|
740
|
+
|
|
741
|
+
- [Google-Inspired Python Project Handbook](PYTHON-PROJECT-HANDBOOK.md)
|
|
742
|
+
- [Idea-to-Production Handbook](IDEA-TO-PRODUCTION-HANDBOOK.md)
|
|
743
|
+
- [Product Development Workflow](../WORKFLOW-HUMAN.md)
|
|
744
|
+
- [Four Common Workflow Recipes](../WORKFLOW-COOKBOOK.md)
|
|
745
|
+
- [AI Agent Workflow](../for-ai/WORKFLOW-AGENTS.md)
|