@terreno/agent-plugin 0.0.0-stage → 58.0.0-beta.2

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 (98) hide show
  1. package/.claude-plugin/plugin.json +32 -0
  2. package/CHANGELOG.md +2213 -0
  3. package/LICENSE +21 -0
  4. package/README.md +57 -2
  5. package/agents/pre-commit.md +65 -0
  6. package/agents/ui-verifier.md +93 -0
  7. package/package.json +32 -4
  8. package/references/async-review-bots.md +76 -0
  9. package/references/documentation-contract.md +61 -0
  10. package/references/execution-state.schema.json +77 -0
  11. package/references/github-attention-contract.md +165 -0
  12. package/references/independent-review.md +31 -0
  13. package/references/lifecycle-contract.md +211 -0
  14. package/references/loop-engineering.md +125 -0
  15. package/references/pick-roast-loop.md +112 -0
  16. package/references/pr-deployments.md +69 -0
  17. package/references/product-ci.md +164 -0
  18. package/references/push-ownership.md +91 -0
  19. package/references/stage-result.schema.json +82 -0
  20. package/references/subagent-briefing.md +43 -0
  21. package/references/testing-plan.md +163 -0
  22. package/references/user-guide.md +171 -0
  23. package/skills/1-grow/SKILL.md +145 -0
  24. package/skills/1-grow/references/grilling.md +243 -0
  25. package/skills/2-pick/SKILL.md +170 -0
  26. package/skills/2-pick/references/mocking.md +34 -0
  27. package/skills/2-pick/references/testing.md +43 -0
  28. package/skills/3-roast/SKILL.md +168 -0
  29. package/skills/4-brew/SKILL.md +201 -0
  30. package/skills/5-taste/SKILL.md +311 -0
  31. package/skills/ai-prompt-governance/SKILL.md +100 -0
  32. package/skills/attach-pr-media/SKILL.md +89 -0
  33. package/skills/attach-pr-media/scripts/upload-pr-media.sh +151 -0
  34. package/skills/backend-test-env/SKILL.md +64 -0
  35. package/skills/backfill-regression/SKILL.md +101 -0
  36. package/skills/backfill-user-guide/SKILL.md +96 -0
  37. package/skills/bootstrap-mcp-server/SKILL.md +244 -0
  38. package/skills/building-admin-interfaces/SKILL.md +86 -0
  39. package/skills/building-admin-interfaces/agents/openai.yaml +4 -0
  40. package/skills/building-admin-interfaces/references/nav-and-shell.md +42 -0
  41. package/skills/building-admin-interfaces/references/patterns-and-tools.md +74 -0
  42. package/skills/building-admin-interfaces/references/screens-and-routes.md +50 -0
  43. package/skills/building-terreno-apps/SKILL.md +294 -0
  44. package/skills/building-terreno-apps/agents/openai.yaml +4 -0
  45. package/skills/building-terreno-apps/references/navigation.md +108 -0
  46. package/skills/building-terreno-apps/references/route-structure.md +104 -0
  47. package/skills/building-terreno-apps/references/screen-patterns.md +174 -0
  48. package/skills/debug-syncdb-with-mcp/SKILL.md +75 -0
  49. package/skills/deploy-gcp/SKILL.md +73 -0
  50. package/skills/deploy-gcp/references/troubleshooting.md +29 -0
  51. package/skills/generate-release-announcements/SKILL.md +145 -0
  52. package/skills/generate-sdk/SKILL.md +165 -0
  53. package/skills/mongoose-schema-safety/SKILL.md +164 -0
  54. package/skills/pick-roast-loop/SKILL.md +152 -0
  55. package/skills/planning-loop/SKILL.md +161 -0
  56. package/skills/prd/SKILL.md +138 -0
  57. package/skills/set-up-social-login/SKILL.md +76 -0
  58. package/skills/store-assets/SKILL.md +221 -0
  59. package/skills/store-assets/examples/screenshots.yaml +31 -0
  60. package/skills/store-assets/examples/storeAssets.config.json +44 -0
  61. package/skills/store-assets/scripts/banner.ts +165 -0
  62. package/skills/store-assets/scripts/config.ts +255 -0
  63. package/skills/store-assets/scripts/devClient.ts +635 -0
  64. package/skills/store-assets/scripts/devices.ts +286 -0
  65. package/skills/store-assets/scripts/icon.ts +81 -0
  66. package/skills/store-assets/scripts/maestro/goHome.yaml +21 -0
  67. package/skills/store-assets/scripts/maestro/login.yaml +27 -0
  68. package/skills/store-assets/scripts/maestro/openApp.yaml +26 -0
  69. package/skills/store-assets/scripts/screenshots.ts +848 -0
  70. package/skills/taste-sweep/SKILL.md +172 -0
  71. package/skills/terreno-backend-api/SKILL.md +355 -0
  72. package/skills/terreno-backend-api/agents/openai.yaml +4 -0
  73. package/skills/terreno-backend-api/references/custom-routes.md +132 -0
  74. package/skills/terreno-backend-api/references/model-router.md +112 -0
  75. package/skills/terreno-backend-api/references/server-setup.md +116 -0
  76. package/skills/terreno-backend-tests/SKILL.md +176 -0
  77. package/skills/terreno-data-fetching/SKILL.md +288 -0
  78. package/skills/terreno-data-fetching/agents/openai.yaml +4 -0
  79. package/skills/terreno-data-fetching/references/auth-and-tokens.md +89 -0
  80. package/skills/terreno-data-fetching/references/realtime.md +50 -0
  81. package/skills/terreno-data-fetching/references/sdk-customization.md +55 -0
  82. package/skills/terreno-frontend-tests/SKILL.md +190 -0
  83. package/skills/terreno-mobile-tests/SKILL.md +127 -0
  84. package/skills/terreno-test-setup/SKILL.md +81 -0
  85. package/skills/terreno-test-setup/references/backend.md +131 -0
  86. package/skills/terreno-test-setup/references/frontend.md +169 -0
  87. package/skills/terreno-test-setup/references/mobile.md +134 -0
  88. package/skills/terreno-ui/SKILL.md +252 -0
  89. package/skills/terreno-ui/agents/openai.yaml +4 -0
  90. package/skills/terreno-ui/references/data-display.md +87 -0
  91. package/skills/terreno-ui/references/feedback.md +122 -0
  92. package/skills/terreno-ui/references/forms.md +119 -0
  93. package/skills/terreno-ui/references/layout.md +124 -0
  94. package/skills/terreno-ui/references/theming.md +87 -0
  95. package/skills/update-docs/SKILL.md +82 -0
  96. package/skills/upgrading-terreno/SKILL.md +93 -0
  97. package/skills/upgrading-terreno/references/ordering.md +40 -0
  98. package/skills/verify-ui-changes/SKILL.md +605 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Flourish Health, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,58 @@
1
- # Temporary Holding Version
1
+ # Terreno plugin for Claude Code
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Terreno's agent lifecycle and app-building skills for Claude Code. Grow shapes a request
4
+ into an approved plan, Pick and Roast build and prove it one task at a time, Brew opens the
5
+ pull request, and Taste reacts to review and CI until it is mergeable. The plugin also ships
6
+ Terreno backend, UI, data, admin, docs, upgrade, and deployment skills, plus the
7
+ `pre-commit` and `ui-verifier` agents.
8
+
9
+ Reference: https://github.com/TerrenoLabs/terreno/blob/master/docs/reference/lifecycle-plugin.md
10
+
11
+ ## Install
12
+
13
+ Pick one channel and register only that one. Each channel provides a plugin named
14
+ `terreno`, so two channels give duplicate commands.
15
+
16
+ Latest stable release, installed from npm as `@terreno/agent-plugin`:
17
+
18
+ ```text
19
+ /plugin marketplace add https://raw.githubusercontent.com/TerrenoLabs/terreno/master/plugins/claude-release/.claude-plugin/marketplace.json
20
+ /plugin install terreno@terreno-releases
21
+ ```
22
+
23
+ Every merge to `master`:
24
+
25
+ ```text
26
+ /plugin marketplace add TerrenoLabs/terreno
27
+ /plugin install terreno@terreno-plugins
28
+ ```
29
+
30
+ One release, pinned: add `TerrenoLabs/terreno#<version>` as the marketplace instead.
31
+
32
+ Then run `/terreno:1-grow`. Claude Code does not auto-update third-party marketplaces by
33
+ default; run `/plugin update terreno@<marketplace>` to pick up a new release.
34
+
35
+ ## What you get
36
+
37
+ | Command | Does |
38
+ | --- | --- |
39
+ | `/terreno:1-grow` | Research, clarify, and approve an implementation plan and task list |
40
+ | `/terreno:2-pick` | Build one task test-first, then roast it and pick the next |
41
+ | `/terreno:3-roast` | Independently prove or disprove the current task |
42
+ | `/terreno:4-brew` | Final checks, commit, push, open the PR, wait for CI and review bots |
43
+ | `/terreno:5-taste` | React to CI and review on the PR until it is mergeable |
44
+ | `/terreno:pick-roast-loop` | Work an approved plan through every task |
45
+
46
+ ## Maintainers
47
+
48
+ This directory is generated. Do not hand-edit it; run `bun run skills:sync`.
49
+
50
+ Claude Code resolves a plugin skill's command from the frontmatter `name`, so the
51
+ shortened names live here instead of in the shared skill files. Cursor, Codex, and
52
+ `npx skills` keep the canonical names from `plugins/terreno-planning/`.
53
+
54
+ | Source | Owns |
55
+ | --- | --- |
56
+ | `plugins/terreno-planning/skills/` | Lifecycle and Terreno app workflows |
57
+ | `plugins/terreno-planning/agents/` | Reusable verification agents |
58
+ | `plugins/terreno-planning/references/` | Shared lifecycle references |
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: pre-commit
3
+ description: Run lint, type check, and related tests on the current working tree. Fix any failures encountered. Use before commits and after CI fix attempts.
4
+ ---
5
+
6
+ You are the pre-commit checker. Your job is to run lint, type check, and related tests for the current project, fix any issues you find, and report back.
7
+
8
+ ## Steps
9
+
10
+ 1. Find the project root:
11
+ ```bash
12
+ git rev-parse --show-toplevel
13
+ ```
14
+ `cd` into it for the rest of the run.
15
+
16
+ 2. Run lint:
17
+ ```bash
18
+ bun run lint
19
+ ```
20
+ If it fails, read the failing files, fix the issues, and re-run until it passes. Do not use `--no-verify` or skip rules.
21
+
22
+ 3. Run type check / compile:
23
+ ```bash
24
+ bun run compile
25
+ ```
26
+ If it fails, fix the type errors and re-run until it passes.
27
+
28
+ 4. Identify changed files:
29
+ ```bash
30
+ git diff --name-only
31
+ git diff --cached --name-only
32
+ git diff --name-only origin/master...HEAD 2>/dev/null
33
+ ```
34
+
35
+ 5. Find and run related tests:
36
+ - For each changed source file, look for a sibling `*.test.*` / `*.spec.*` or a matching file under `__tests__/`.
37
+ - Run only the discovered tests:
38
+ ```bash
39
+ bun test <files>
40
+ ```
41
+ - If changes are concentrated in one package, inspect that package's scripts and
42
+ prefer its package-level test command.
43
+ - If no specific tests are found, run the documented affected-package suites.
44
+ - Fix failures and re-run until all tests pass.
45
+
46
+ ## Output format
47
+
48
+ Report back as a single concise block:
49
+
50
+ ```
51
+ ## Pre-Commit Report
52
+ - **Lint:** [passed | fixed N issues]
53
+ - **Compile:** [passed | fixed N issues]
54
+ - **Tests:** [N passed | fixed N failures | none found]
55
+ - **Files touched while fixing:** [list, or "none"]
56
+ ```
57
+
58
+ If you cannot fix something after a reasonable number of attempts, stop and report the failure with the exact error and the file(s) involved — do not loop forever.
59
+
60
+ ## Rules
61
+
62
+ - Never use `--no-verify`, `--skip`, or any flag that bypasses checks.
63
+ - Never modify PATH or prepend anything when running `bun` — it is already on PATH.
64
+ - Do not commit, push, or touch git history. Your job is checks + fixes only.
65
+ - Do not create new files unless a fix genuinely requires it.
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: ui-verifier
3
+ description: Verify UI changes end to end when the parent briefing lists UI files. Compile, lint, UI tests, bring up a stack you own, log in, exercise the named feature under the required checks, run the matching Maestro flow (or direct simulator commands when the app has no Maestro) for mobile-focused work, report only and never edit the tree, capture screenshots/videos. Do not run on backend-only slices. Do not diff the whole frontend tree when a file list is provided.
4
+ ---
5
+
6
+ You are the UI verifier. Use the parent's task-scoped briefing (changed screens/components,
7
+ named commands, expected evidence). Follow the `/verify-ui-changes` skill only for the
8
+ steps the briefing still needs; do not reload the whole skill when the briefing already
9
+ names the flow.
10
+
11
+ ## Steps
12
+
13
+ 1. Identify changed frontend files from the briefing. If none were listed, inspect the
14
+ branch and keep rendered UI files (`*.tsx`, `*.jsx`, `*.html`, `*.css`, stories,
15
+ routes, theme/layout/navigation config):
16
+ ```bash
17
+ git diff --name-only origin/master...HEAD
18
+ ```
19
+ If that list is empty, return "not applicable — no UI files" and stop.
20
+
21
+ 2. Run only the named automated checks from the briefing. If the parent already ran
22
+ compile/lint/tests, do not rerun the full monorepo. Otherwise inspect the nearest
23
+ changed package's `package.json` and run its compile/typecheck, lint, and UI test
24
+ scripts. Do not invent script names.
25
+ You are report-only: never edit the tree, including adding `testID`s or Maestro
26
+ flows. A missing `testID` or flow, or a failure, is FAIL with the evidence.
27
+
28
+ 3. State the flow in one sentence (`<entry point> -> <action> -> <expected visible
29
+ result>`), then read the repository's app-launch and test-user instructions. Start
30
+ the documented backend/frontend or demo target **on ports nothing else holds**; when
31
+ the repository ships a `verify-ui` stack script, use it. If a port is already taken by
32
+ something you did not start, stop and report the ports: do not test through it and
33
+ do not kill it, it may be a backend on staging. Seed only through a documented
34
+ command and log in with documented test credentials. If required instructions or
35
+ credentials are absent, report the exact blocker rather than guessing.
36
+
37
+ 4. Navigate to the changed feature and exercise its primary flow end to end, then the
38
+ adversarial paths: invalid input, wrong credentials, empty and error and loading
39
+ states the change touches. For admin changes, use a documented admin test account.
40
+ Prefer an existing Playwright flow and repository selector rules (`testID`s) where
41
+ available; never add arbitrary sleeps.
42
+
43
+ 5. For component/story-only changes, use the repository's documented component demo or
44
+ story host and exercise the changed states.
45
+
46
+ 6. For mobile-focused changes (native screens, gestures, navigation stacks, keyboard,
47
+ safe areas, permissions, `*.native.tsx`, `Platform.OS` branches, or a ticket that says
48
+ "mobile" or "app"), verify on the app's simulator. When the app has Maestro configured
49
+ (`<app>/maestro/`), run the matching flow there, using the repository's `verify-ui`
50
+ Maestro runner when it exists, and do not script taps outside Maestro. When it does
51
+ not, drive the simulator with the direct `xcrun simctl` / `idb` / `adb` commands in
52
+ the skill's "Simulator leg", from a script outside the tree. Web alone is not enough.
53
+
54
+ 7. **Score the required checks** on every run: right page, not blank, no error overlay,
55
+ console clean, DOM assertion, interaction proof, screenshot. A console error in the
56
+ changed code path fails the run even when the screenshot looks right.
57
+
58
+ 8. **Capture and save evidence** (mandatory when manual verification runs), outside the
59
+ source tree:
60
+ - Save screenshots to `/opt/cursor/artifacts/screenshots/` (or your scratchpad)
61
+ - Save screen recordings to `/opt/cursor/artifacts/`
62
+ - Use `RecordScreen` for interaction-flow videos in Cursor Cloud.
63
+ - Seed or QA data only; never capture real user data or PHI.
64
+ - Report artifact paths and what each proves so the parent agent can add only the
65
+ decisive artifact to the PR `Verification` table, or the secret gist link the
66
+ repository's publish script printed.
67
+
68
+ ## Output format
69
+
70
+ ```
71
+ ## UI Verification Report
72
+ - **Result:** [PASS | FAIL | UNVERIFIED — blocker] (worst outcome across every required leg, including Simulator)
73
+ - **Flow under test:** [entry point -> action -> expected visible result]
74
+ - **Compile:** [pass | fail — error | skipped — parent already ran]
75
+ - **Lint:** [pass | fail — error | skipped — parent already ran]
76
+ - **Tests:** [pass | fail — which | skipped]
77
+ - **Environment:** [app URL(s), viewport(s), credentials used (names only), stack you started or ports taken]
78
+ - **Checks:** [per app × viewport: right page / not blank / no error overlay / console clean / DOM assertion / interaction proof / screenshot — pass | fail — detail]
79
+ - **Simulator:** [Maestro flow(s) or direct commands run, device: PASS | FAIL — failure | UNVERIFIED — blocker | n/a — change matches none of the mobile-focused triggers in step 6]
80
+ - **Interaction:** [the steps taken and the assertion after each]
81
+ - **Evidence artifacts:** [paths or links to screenshots/videos/gist, or none if blocked]
82
+ - **Remaining risk:** [states or platforms the change does not require; a required leg that did not run is UNVERIFIED, not risk]
83
+ ```
84
+
85
+ Prefix each verified item with pass, warning, or fail. If an environment limitation prevented verification (no browser, no MongoDB, ports taken, no simulator), say exactly what could not be verified rather than implying it passed.
86
+
87
+ ## Rules
88
+
89
+ - Never use `waitForTimeout()` in any Playwright code you write.
90
+ - Leave dev servers running only if the caller asked for manual follow-up testing; otherwise stop them, and stop only what you started.
91
+ - Report outcomes faithfully — a required check you could not run is UNVERIFIED with its blocker, and makes the Result UNVERIFIED, never PASS.
92
+ - Login + feature exercise is required for authenticated apps; do not treat app-start-only as complete verification.
93
+ - Do not spawn nested reviewers.
package/package.json CHANGED
@@ -1,6 +1,34 @@
1
1
  {
2
+ "description": "Terreno lifecycle and app workflows: Grow, Pick/Roast, Brew, Taste, continuous outer loops, backend/API, UI, data, schema, admin, docs, upgrades, deployment, and verification agents.",
3
+ "files": [
4
+ ".claude-plugin/",
5
+ "agents/",
6
+ "references/",
7
+ "skills/",
8
+ "CHANGELOG.md",
9
+ "LICENSE",
10
+ "README.md"
11
+ ],
12
+ "homepage": "https://github.com/TerrenoLabs/terreno/blob/master/plugins/README.md",
13
+ "keywords": [
14
+ "claude-code",
15
+ "claude-plugin",
16
+ "terreno",
17
+ "planning",
18
+ "sdlc",
19
+ "implementation",
20
+ "review",
21
+ "tdd"
22
+ ],
23
+ "license": "MIT",
2
24
  "name": "@terreno/agent-plugin",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "repository": {
29
+ "directory": "plugins/terreno-claude",
30
+ "type": "git",
31
+ "url": "git+https://github.com/TerrenoLabs/terreno.git"
32
+ },
33
+ "version": "58.0.0-beta.2"
34
+ }
@@ -0,0 +1,76 @@
1
+ # Async review bots
2
+
3
+ Brew and Taste **wait in-process** until async review bots on the current head have
4
+ reported, then continue the stage so they can react. Product test CI is a separate
5
+ Taste wait: follow [`product-ci.md`](product-ci.md) after this procedure, using GitHub
6
+ CLI or CircleCI CLI in a watch loop until jobs are terminal or that wait times out.
7
+
8
+ ## What counts
9
+
10
+ A review bot is an automated GitHub actor that posts a check run, code-scanning alert,
11
+ or PR review/comment after a push. Match by check name, app slug, or review author.
12
+ Examples:
13
+
14
+ - Cursor Bugbot
15
+ - GitHub CodeQL / code scanning
16
+ - Copilot or other review bots when they appear on the PR
17
+
18
+ Do not treat ordinary product CI as a review bot. Product CI is lint, typecheck, unit,
19
+ e2e, and build work on **any** host (GitHub Actions, CircleCI, Buildkite, GitLab CI,
20
+ Jenkins, Azure Pipelines, Bitbucket Pipelines, and similar). Observe those jobs with
21
+ [`product-ci.md`](product-ci.md).
22
+
23
+ ## When to wait
24
+
25
+ Wait after Brew has pushed or created the PR, and whenever Taste's current head has a
26
+ matched bot queued, in progress, or still inside the startup grace.
27
+
28
+ **Do not exit while a matched bot is queued or in progress.**
29
+
30
+ ## Procedure
31
+
32
+ 1. Record the current head SHA.
33
+ 2. **Startup grace (90 seconds).** Use a provider-native hook only when it can await the
34
+ **matched bot**, not arbitrary checks for this SHA. GitHub CLI has no targeted
35
+ check-creation watch, so prefer the harness PR-event subscription. If no targeted
36
+ hook can detect new checks, reviews, and comments, sleep 30 seconds and re-fetch.
37
+ Stop the grace when a matched bot appears or 90 seconds elapse. If none appeared,
38
+ continue.
39
+ 3. **Completion wait.** Use a provider-native hook only when it targets the matched bot,
40
+ not all PR checks. For a bot backed by a resolved GitHub Actions run, prefer
41
+ `gh run watch <run-id> --interval 30`. Its exit code is a wait result, not a Brew
42
+ verdict; always re-fetch and classify the bot outcome. Do **not** use unfiltered
43
+ `gh pr checks --watch`: it also waits for ordinary product CI. For check-run-only or
44
+ review/comment bots, prefer a harness PR-event subscription. If no targeted hook is
45
+ available, sleep 30 seconds and re-fetch the matched bot state. Continue until every
46
+ matched bot is terminal, or 20 minutes have elapsed.
47
+ Terminal means the check completed (success, failure, cancelled, skipped, timed out)
48
+ or the bot posted a completed review/comment batch for this head.
49
+ 4. **Timeout.** If still running at 20 minutes, **stop**. Do not continue the stage
50
+ procedure. Emit `PENDING` with `next: taste` and `wait: 120`. Record which bots are
51
+ still running.
52
+ 5. **Re-observe, then continue — only after a completed wait.** When every matched bot
53
+ is terminal or none appeared after the grace period, use that snapshot. Brew records
54
+ bot outcomes and does not implement fixes. Taste classifies bot findings and acts on
55
+ actionable ones in this invocation.
56
+
57
+ Never hand-roll a sleep loop when the provider CLI or harness supplies a bounded
58
+ watch/subscription hook. If fallback polling is necessary, use the harness sleep
59
+ primitive and record why no hook applied. Do not busy-spin.
60
+
61
+ ## Address every finding
62
+
63
+ Waiting is not the goal; answering is. Taste handles every bot thread and finding on
64
+ the PR per [`push ownership`](push-ownership.md#bot-comments): fixed and resolved,
65
+ declined with a one-sentence reply and resolved, or left open only as a human
66
+ decision. An unanswered bot thread blocks Taste `PASS`.
67
+
68
+ ## Bounds
69
+
70
+ - This wait is only for review bots, never "until all CI is green."
71
+ - After Taste pushes a fix, wait again for review bots on the new head, then run the
72
+ product-CI wait loop, then act on those results **once** in this invocation. A further
73
+ push after that second act emits `PENDING` (`next: taste`); the outer loop owns later
74
+ cycles.
75
+ - Product CI uses Taste's bounded watch loop (`gh` / `circleci`), not this review-bot
76
+ procedure. Unfiltered `gh pr checks --watch` belongs there, not here.
@@ -0,0 +1,61 @@
1
+ # Documentation contract
2
+
3
+ Human-facing docs are the architecture source. Code implements them. Skills never treat
4
+ docs as optional commentary.
5
+
6
+ ## Always read docs first
7
+
8
+ Before shaping, implementing, verifying, or submitting:
9
+
10
+ 1. Open the repository's architecture and domain docs for the affected area.
11
+ 2. Prefer tutorials, how-to guides, reference, and explanation over tribal comments.
12
+ 3. Reconstruct current behavior from those docs plus code/tests. If they disagree, the
13
+ change must resolve the disagreement in the same slice.
14
+ 4. Do not invent architecture from the diff alone when docs exist.
15
+
16
+ If the repository has no docs for the affected area, create them in this slice.
17
+
18
+ ## Always update docs
19
+
20
+ Update docs in the same slice as the behavior when any of these change:
21
+
22
+ - public API, CLI, env, config, routes, models, permissions
23
+ - user-visible UI or operator workflow
24
+ - architecture, data flow, ownership, or runtime topology
25
+ - verification, rollout, or compatibility rules
26
+
27
+ A user-visible change also updates its end-user page in the
28
+ [`user guide`](user-guide.md), unless the repository opts out.
29
+
30
+ Skip docs only for a pure internal refactor that does not change those. Record that skip
31
+ in the stage result `done` list. Missing docs for a user-visible or architectural change is `FAIL`,
32
+ not a follow-up.
33
+
34
+ ## How to write
35
+
36
+ Use the repository's docs layout when one exists. Otherwise use Diátaxis:
37
+
38
+ | Kind | Put |
39
+ | --- | --- |
40
+ | Task a new user must complete | tutorial |
41
+ | Task an operator already understands | how-to |
42
+ | Facts: APIs, props, commands, env | reference |
43
+ | Why the system is shaped this way | explanation |
44
+
45
+ Rules:
46
+
47
+ - Lead with the next action or the canonical fact.
48
+ - Use the repository's standard headings. Do not invent parallel outlines.
49
+ - Prefer tables for options, ownership, and verification.
50
+ - Show one minimal example. Do not paste implementation chronology.
51
+ - Keep a page scannable: short sections, no recap, no preamble.
52
+ - Update the existing page in place. Split only when a page covers two jobs.
53
+ - Generated reference must be regenerated; never hand-edit generated output.
54
+ - Agent-facing rules/skills stay in their canonical source and are regenerated after.
55
+
56
+ ## Done when
57
+
58
+ - A stranger can find the behavior from docs without reading the PR.
59
+ - Architecture docs match the shipped design.
60
+ - Examples and commands in docs are current.
61
+ - The stage result `done` list names every docs file created or updated.
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://terreno.dev/schemas/execution-state.schema.json",
4
+ "title": "Terreno lifecycle execution state",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["v", "stage", "attempt", "next"],
8
+ "properties": {
9
+ "v": {"const": 2},
10
+ "ip": {"type": "string"},
11
+ "task": {"type": "string"},
12
+ "stage": {"enum": ["grow", "pick", "roast", "brew", "taste"]},
13
+ "attempt": {"type": "integer", "minimum": 1},
14
+ "branch": {"type": "string"},
15
+ "sha": {"type": "string"},
16
+ "pr": {"type": "string"},
17
+ "skills": {"type": "array", "items": {"type": "string"}},
18
+ "last": {
19
+ "anyOf": [
20
+ {"type": "null"},
21
+ {"$ref": "stage-result.schema.json"}
22
+ ]
23
+ },
24
+ "artifacts": {"type": "array", "items": {"type": "string"}},
25
+ "tried": {
26
+ "type": "array",
27
+ "items": {
28
+ "type": "object",
29
+ "additionalProperties": false,
30
+ "required": ["stage", "attempt", "why", "status", "ev"],
31
+ "properties": {
32
+ "stage": {"enum": ["grow", "pick", "roast", "brew", "taste"]},
33
+ "attempt": {"type": "integer", "minimum": 1},
34
+ "why": {"type": "string"},
35
+ "status": {"enum": ["PASS", "FAIL", "BLOCKED", "PENDING"]},
36
+ "ev": {"type": "string"}
37
+ }
38
+ }
39
+ },
40
+ "ledger": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": ["task", "stage", "attempt", "sha", "status", "summary", "ev"],
46
+ "properties": {
47
+ "task": {"type": "string"},
48
+ "stage": {"enum": ["pick", "roast"]},
49
+ "attempt": {"type": "integer", "minimum": 1},
50
+ "sha": {"type": "string"},
51
+ "status": {"enum": ["PASS", "FAIL", "BLOCKED"]},
52
+ "summary": {"type": "string"},
53
+ "hypothesis": {"type": "string"},
54
+ "files": {"type": "array", "items": {"type": "string"}},
55
+ "checks": {"type": "array", "items": {"type": "string"}},
56
+ "artifacts": {"type": "array", "items": {"type": "string"}},
57
+ "docs": {"type": "array", "items": {"type": "string"}},
58
+ "risks": {"type": "array", "items": {"type": "string"}},
59
+ "ev": {"type": "string"}
60
+ }
61
+ }
62
+ },
63
+ "next": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": ["stage", "why", "human"],
67
+ "properties": {
68
+ "stage": {
69
+ "type": ["string", "null"],
70
+ "enum": ["grow", "pick", "roast", "brew", "taste", null]
71
+ },
72
+ "why": {"type": "string"},
73
+ "human": {"type": "boolean"}
74
+ }
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,165 @@
1
+ # GitHub attention contract
2
+
3
+ Human attention is the scarcest resource. A PR must be understandable in one glance.
4
+ Put detail behind disclosure controls and post comments only when they cause a human
5
+ decision or preserve context that the diff cannot.
6
+
7
+ ## Pull request title
8
+
9
+ Format: `[ticket] Short feature title`
10
+
11
+ - `ticket` is the attached tracker id, copied in that tracker’s own form:
12
+ Linear `TEAM-n` (`[FH-1632]`) or GitHub `#n` (`[#412]`).
13
+ - Prefer Linear when both are attached. If none is attached, omit the brackets
14
+ and use only the feature title.
15
+ - The feature title names what the change does, short and memorable.
16
+ - Use at most 72 characters including the ticket prefix.
17
+ - Do not use conventional-commit prefixes (`feat:`, `docs:`, `fix:`, `chore:`).
18
+ - Do not use lifecycle labels (`IP Approved`, `Task list`) or other status words.
19
+ - Do not put implementation detail in the title.
20
+
21
+ Use:
22
+
23
+ ```text
24
+ [FH-1632] Standardize planning PR titles
25
+ [#412] Windowed admin table sync
26
+ Rate-limit Better Auth sign-in
27
+ ```
28
+
29
+ Do not use:
30
+
31
+ ```text
32
+ IP Approved: Task list for syncdb
33
+ feat: add PR title format
34
+ [FH-1632] IP Approved — Grow artifacts
35
+ docs: update attention contract
36
+ ```
37
+
38
+ ## Pull request body
39
+
40
+ Use exactly these top-level headings, in this order:
41
+
42
+ ```markdown
43
+ ## Why
44
+
45
+ <The IP's initial justification: problem, user/repository impact, and canonical issue/spec.>
46
+
47
+ Implements `<plan path>` (T1–T3). Closes #<n>.
48
+
49
+ ## What changed
50
+
51
+ - <Brief overview of the approved IP and its intended outcomes; maximum five bullets.>
52
+
53
+ ## Verification
54
+
55
+ | Status | Scope | Evidence / action |
56
+ | --- | --- | --- |
57
+ | ✅ Tested | <behavior or risk> | `<command>` or artifact link |
58
+ | 🧭 Test instructions | <feature or workflow> | <exact steps a reviewer can follow> |
59
+ | ⚠️ Not tested | <remaining risk> | <exact reviewer test or action> |
60
+ | ⚠️ Not tested | Regression cases `<AREA-NNN>`, `<AREA-NNN>` | Walk them in [`<suite file>`](<link>) |
61
+ ```
62
+
63
+ Rules:
64
+
65
+ - Keep the visible body under 250 words.
66
+ - Spell the headings exactly `## Why`, `## What changed`, and `## Verification`. The
67
+ approval bot reads sections by heading; a `What`, `Summary`, or `Testing` heading reads
68
+ as a missing section and raises the PR's risk level.
69
+ - When the PR implements a plan, end `Why` with one line naming the plan file's
70
+ repository path in backticks and the task ids it delivers (`T1–T3`, `Tasks 2.1–2.2`).
71
+ When it closes an issue, add `Closes #<n>`. The approval bot finds the plan only from a
72
+ literal path, the stage result's `ip`, or a plan file changed in the diff; without one it
73
+ scores plan match at most 1 out of 3.
74
+ - Initialize `Why` from the IP's original justification. Preserve the problem and
75
+ motivation that caused the IP to exist; do not replace them with recent-turn context.
76
+ - Initialize `What changed` with a short overview of the approved IP and intended
77
+ outcomes. Explain the feature, not the implementation chronology or last agent turn.
78
+ - Keep `Why` and `What changed` stable while the PR's purpose and scope remain
79
+ accurate. Update them only for an approved scope change, a factual correction, or a
80
+ human edit.
81
+ - Always include executable testing instructions in `Verification`, even after all
82
+ automated tests pass. A reviewer must be able to reproduce the important behavior.
83
+ - Update testing instructions, evidence, and remaining-risk rows whenever verification
84
+ changes. Do not regenerate the rest of the body from the latest turn.
85
+ - Omit empty rows and optional sections. If nothing remains untested, omit the
86
+ `Not tested` row.
87
+ - When the PR adds or changes manual regression cases in the testing-plan suite
88
+ files, list every such case ID in one row that links its suite file. Use
89
+ `⚠️ Not tested`, with walking the cases as the reviewer action, until a person walks
90
+ every listed case on this branch; then use `✅ Tested`, naming who walked them and
91
+ the evidence. Omit the row when the PR adds or changes no case.
92
+ - Put the most decision-relevant verification first.
93
+ - Name what a check proves; a command alone is not evidence. Write the outcome next
94
+ to the command (`` `bun test api` → 412 pass ``).
95
+ - Use only the three-column table, with the status mark (`✅`, `🧭`, or `⚠️`) in the
96
+ first cell of every row. The approval bot reads verification from those marks; a
97
+ bullet list or a `| Check | Result |` table without them reads as no verification.
98
+ - Link one canonical issue/spec in `Why`; do not add a separate metadata section.
99
+ - Embed only the minimum screenshot/video needed to prove user-visible behavior.
100
+ - Put migration notes, full check logs, compatibility matrices, unusual implementation
101
+ detail, and the stage-result YAML in one optional block after the table:
102
+
103
+ ```html
104
+ <details>
105
+ <summary>Details</summary>
106
+ Concise supporting detail.
107
+ <details>
108
+ <summary>Stage result</summary>
109
+ Compact v2 YAML for the next skill. Never duplicate it in the visible body.
110
+ </details>
111
+ </details>
112
+ ```
113
+
114
+ - In the stage-result YAML, set `ip` to the plan's filename without `.md` (for
115
+ `<plans dir>/2026-10-01-post-cache.md`, `ip: 2026-10-01-post-cache`), and
116
+ start each `done` entry with its task id (`T2 Roast PASS`). A later stage that rewrites
117
+ the block keeps `ip` and the delivered task ids.
118
+ - Never put stage-result YAML in the visible body or a comment. Omit the inner Stage
119
+ result toggle when this PR is not a lifecycle handoff.
120
+
121
+ - Do not add checklists, type-of-change sections, commit lists, generated summaries,
122
+ badges, repeated acceptance criteria, or routine CI state.
123
+ - Preserve human-authored text when updating. Reformat it only when explicitly asked.
124
+
125
+ ## Comments and review replies
126
+
127
+ Default to silence.
128
+
129
+ Post only when at least one is true:
130
+
131
+ 1. A human must make a decision or take an action.
132
+ 2. A review thread needs a non-obvious explanation that the diff cannot supply.
133
+ 3. A requested change is intentionally not made and the tradeoff must be recorded.
134
+
135
+ Do not post progress updates, thanks, summaries of the PR body, test reports already in
136
+ the body, “ready for review” messages, CI notifications, or preview/demo URLs. Chat
137
+ already prints PR deployment links per [`pr-deployments.md`](pr-deployments.md).
138
+
139
+ Use the narrowest location:
140
+
141
+ - Reply in the existing review thread instead of posting a top-level comment.
142
+ - Update the PR body instead of commenting when verification evidence changes.
143
+ - Resolve an addressed thread silently when the fix is obvious from the diff.
144
+
145
+ Write at most three short sentences:
146
+
147
+ ```markdown
148
+ **Action needed:** <one decision/action and why it blocks>.
149
+
150
+ <details>
151
+ <summary>Evidence</summary>
152
+
153
+ <only the detail needed to decide>
154
+
155
+ </details>
156
+ ```
157
+
158
+ For a non-obvious resolved thread:
159
+
160
+ ```markdown
161
+ Fixed in `<sha>`: <what changed and why this approach>.
162
+ ```
163
+
164
+ Never split one update across several comments. Never post speculative findings. Never
165
+ quote long logs; link them or place the decisive excerpt in the expandable block.