@starlein/paperclip-plugin-company-wizard 0.4.6 → 0.4.9

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 (99) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +6 -4
  3. package/dist/manifest.js +1 -1
  4. package/dist/manifest.js.map +1 -1
  5. package/dist/ui/index.css +82 -0
  6. package/dist/ui/index.css.map +2 -2
  7. package/dist/ui/index.js +422 -137
  8. package/dist/ui/index.js.map +4 -4
  9. package/dist/worker.js +352 -21
  10. package/dist/worker.js.map +3 -3
  11. package/package.json +1 -1
  12. package/templates/bootstrap-instructions.md +2 -2
  13. package/templates/modules/architecture-plan/agents/ceo/skills/architecture-plan.bar.md +17 -0
  14. package/templates/modules/architecture-plan/agents/ui-designer/skills/architecture-plan.md +2 -0
  15. package/templates/modules/architecture-plan/agents/ui-designer/skills/design-system.md +5 -4
  16. package/templates/modules/architecture-plan/skills/architecture-plan.md +1 -1
  17. package/templates/modules/architecture-plan/skills/design-system.md +25 -0
  18. package/templates/modules/auto-assign/agents/ceo/heartbeat-section.md +1 -1
  19. package/templates/modules/auto-assign/agents/product-owner/heartbeat-section.md +1 -1
  20. package/templates/modules/backlog/agents/ceo/heartbeat-section.md +1 -1
  21. package/templates/modules/backlog/agents/ceo/skills/backlog-health.fallback.md +2 -0
  22. package/templates/modules/backlog/agents/product-owner/heartbeat-section.md +1 -1
  23. package/templates/modules/backlog/docs/backlog-process.md +38 -1
  24. package/templates/modules/backlog/docs/backlog-template.md +1 -1
  25. package/templates/modules/backlog/module.meta.json +1 -1
  26. package/templates/modules/backlog/skills/backlog-health.bar.md +2 -0
  27. package/templates/modules/backlog/skills/backlog-health.md +7 -4
  28. package/templates/modules/brand-identity/agents/ceo/skills/brand-identity.fallback.md +4 -4
  29. package/templates/modules/brand-identity/skills/brand-identity.md +1 -1
  30. package/templates/modules/ci-cd/agents/engineer/skills/ci-cd.fallback.md +2 -1
  31. package/templates/modules/ci-cd/skills/ci-cd.md +13 -2
  32. package/templates/modules/codebase-onboarding/agents/ceo/skills/codebase-audit.fallback.md +10 -0
  33. package/templates/modules/competitive-intel/agents/product-owner/skills/competitive-tracking.fallback.md +19 -0
  34. package/templates/modules/competitive-intel/skills/competitive-tracking.bar.md +11 -0
  35. package/templates/modules/competitive-intel/skills/competitive-tracking.md +1 -1
  36. package/templates/modules/dependency-management/module.meta.json +9 -0
  37. package/templates/modules/dependency-management/skills/dependency-audit.md +8 -5
  38. package/templates/modules/documentation/skills/project-docs.bar.md +13 -0
  39. package/templates/modules/game-design/skills/game-design.bar.md +13 -0
  40. package/templates/modules/github-repo/agents/engineer/skills/git-workflow.md +79 -17
  41. package/templates/modules/github-repo/docs/git-workflow.md +34 -16
  42. package/templates/modules/market-analysis/agents/ux-researcher/skills/market-analysis.md +1 -1
  43. package/templates/modules/market-analysis/docs/market-analysis-template.md +17 -0
  44. package/templates/modules/market-analysis/skills/market-analysis.md +1 -1
  45. package/templates/modules/monitoring/agents/engineer/skills/monitoring.fallback.md +1 -1
  46. package/templates/modules/monitoring/skills/monitoring.md +3 -1
  47. package/templates/modules/pr-review/agents/code-reviewer/skills/code-review.md +19 -5
  48. package/templates/modules/pr-review/agents/devops/skills/infra-review.md +6 -8
  49. package/templates/modules/pr-review/agents/engineer/skills/pr-workflow.md +47 -12
  50. package/templates/modules/pr-review/agents/product-owner/skills/product-review.md +3 -2
  51. package/templates/modules/pr-review/agents/ui-designer/skills/design-review.md +4 -6
  52. package/templates/modules/pr-review/agents/ux-researcher/skills/ux-review.md +4 -6
  53. package/templates/modules/pr-review/docs/pr-conventions.md +4 -4
  54. package/templates/modules/pr-review/module.meta.json +1 -1
  55. package/templates/modules/release-management/agents/ceo/skills/release-process.fallback.md +20 -0
  56. package/templates/modules/release-management/module.meta.json +9 -0
  57. package/templates/modules/release-management/skills/release-process.md +7 -5
  58. package/templates/modules/security-audit/skills/threat-model.md +1 -1
  59. package/templates/modules/stall-detection/agents/ceo/heartbeat-section.md +1 -1
  60. package/templates/modules/tech-stack/skills/tech-stack.md +1 -1
  61. package/templates/modules/triage/agents/ceo/skills/issue-triage.fallback.md +2 -2
  62. package/templates/modules/triage/skills/issue-triage.md +1 -1
  63. package/templates/modules/user-testing/agents/qa/skills/user-testing.md +1 -1
  64. package/templates/modules/user-testing/skills/user-testing.md +1 -1
  65. package/templates/modules/vision-workshop/agents/ceo/skills/vision-workshop.md +1 -1
  66. package/templates/modules/website-relaunch/module.meta.json +0 -15
  67. package/templates/presets/repo-maintenance/preset.meta.json +3 -3
  68. package/templates/roles/audio-designer/role.meta.json +5 -2
  69. package/templates/roles/ceo/HEARTBEAT.md +1 -1
  70. package/templates/roles/cmo/AGENTS.md +15 -0
  71. package/templates/roles/cmo/HEARTBEAT.md +1 -1
  72. package/templates/roles/cmo/role.meta.json +2 -1
  73. package/templates/roles/code-reviewer/AGENTS.md +3 -3
  74. package/templates/roles/code-reviewer/HEARTBEAT.md +2 -1
  75. package/templates/roles/code-reviewer/role.meta.json +4 -1
  76. package/templates/roles/cto/AGENTS.md +22 -0
  77. package/templates/roles/cto/HEARTBEAT.md +1 -1
  78. package/templates/roles/cto/role.meta.json +2 -1
  79. package/templates/roles/customer-success/role.meta.json +2 -1
  80. package/templates/roles/devops/AGENTS.md +21 -0
  81. package/templates/roles/devops/HEARTBEAT.md +1 -1
  82. package/templates/roles/devops/role.meta.json +2 -1
  83. package/templates/roles/engineer/role.meta.json +2 -1
  84. package/templates/roles/game-artist/role.meta.json +5 -2
  85. package/templates/roles/game-designer/role.meta.json +4 -1
  86. package/templates/roles/level-designer/role.meta.json +4 -1
  87. package/templates/roles/product-owner/SOUL.md +4 -1
  88. package/templates/roles/product-owner/role.meta.json +4 -1
  89. package/templates/roles/qa/HEARTBEAT.md +3 -2
  90. package/templates/roles/qa/role.meta.json +2 -1
  91. package/templates/roles/security-engineer/AGENTS.md +7 -0
  92. package/templates/roles/security-engineer/role.meta.json +2 -1
  93. package/templates/roles/technical-writer/AGENTS.md +1 -1
  94. package/templates/roles/technical-writer/role.meta.json +2 -1
  95. package/templates/roles/ui-designer/HEARTBEAT.md +1 -1
  96. package/templates/roles/ui-designer/role.meta.json +2 -1
  97. package/templates/roles/ux-researcher/AGENTS.md +21 -0
  98. package/templates/roles/ux-researcher/HEARTBEAT.md +1 -1
  99. package/templates/roles/ux-researcher/role.meta.json +4 -1
@@ -2,31 +2,77 @@
2
2
 
3
3
  You work in a GitHub repository. Follow the conventions in `docs/git-workflow.md` in the project root.
4
4
 
5
- ## Direct-to-Base-Ref Flow
5
+ ## PR Self-Merge Flow (no pr-review module)
6
6
 
7
- Use this flow when the **pr-review module is not active** i.e., there is no Code Reviewer role and no executionPolicy review stages. In this flow, you commit and merge directly; there is no external review gate.
7
+ Use this flow when the **pr-review module is not active**. You open a PR and merge it yourself there is no external review gate, but all changes go through a PR so the branch history is preserved and branch protection is respected.
8
8
 
9
9
  1. Before the first push on a project, confirm the GitHub credential helper from `docs/git-workflow.md` -> *GitHub Push Authentication* is installed in the primary repository. If `GH_TOKEN` is not injected or the helper cache is empty, stop and escalate instead of attempting unauthenticated pushes.
10
10
  2. Resolve the base ref from project workspace metadata or the issue's `heartbeat-context`. Use the configured `repoRef`, `defaultRef`, or `executionWorkspacePolicy.workspaceStrategy.baseRef` exactly as Paperclip provides it. Never guess from the current shell branch and never rewrite the configured ref to `main`, `master`, or `origin/*`. If no base ref is configured anywhere, use the repository's actual default branch — whatever `origin/HEAD` points at, regardless of name (`main`/`master`/`trunk`/…); fall back to `main` then `master` only if the remote advertises no default HEAD. See `docs/git-workflow.md` → *Resolving the default branch*. Never hard-code `main`.
11
11
  3. Pull/update latest from that base:
12
12
  - external: `git fetch origin`, then integrate from the configured base ref
13
13
  - local: update from the configured local branch
14
- 4. Make your changes
15
- 5. Run available checks (lint, typecheck, tests)
16
- 6. Commit using Conventional Commits: `<type>: <description>`
17
- 7. Push your branch: `git push -u origin <branch-name>`
18
- 8. Merge to base and push:
19
- - `git checkout <base-ref>` (the same resolved base branch from step 2)
20
- - `git merge <branch-name> --no-edit`
21
- - Resolve any conflicts (favor your changes; if uncertain, escalate to the CEO)
22
- - `git push origin <base-ref>`
23
- 9. Clean up the feature branch: `git push origin --delete <branch-name>` (remote) and `git branch -d <branch-name>` (local)
24
- 10. If the issue uses an isolated execution workspace (worktree), archive it from your `heartbeat-context` after the merge is pushed.
25
- 11. If CI fails on the base branch after the merge, fix immediately.
14
+ 4. **Create a feature branch** from the base ref: `git checkout -b <branch-name> <base-ref>`. Never commit directly on the base branch. The branch name should reference the issue (e.g., `LEA-5-add-landing-hero`). If you are already on a correctly named feature branch, skip this step.
15
+ 5. Verify you are on the feature branch before making changes: `git branch --show-current` must print `<branch-name>`, not the base ref. If it prints the base ref name, you forgot step 4 — create the branch now.
16
+ 6. Make your changes
17
+ 7. Run available checks (lint, typecheck, tests)
18
+ 8. Commit using Conventional Commits: `<type>: <description>`
19
+ 9. Verify the current branch one more time, then push: `git push -u origin <branch-name>`. The branch name in the push command must match `git branch --show-current`. Never push the base ref as a feature branch if `git branch --show-current` returns the base ref name, stop and create a feature branch first.
20
+ 10. Open a pull request against the base ref: `gh pr create --base <github-base-branch> --head <branch-name> --title "<type>: <description>" --body-file <file>`. `<github-base-branch>` is the **plain branch name** — strip any `origin/` prefix from the configured base ref (e.g., configured `origin/main` → `--base main`). GitHub does not recognise remote-tracking names. Write the PR body to a temp file first — never inline `--body "..."`. Register the PR as a Paperclip work product (see *Register the PR as a Work Product* below). Verify the PR base matches the configured base ref before merging.
21
+ 11. Before merging, check that the PR is not conflicting: `gh pr view <PR-number> --json mergeable,mergeStateStatus`. If `mergeable` is `CONFLICTING` or `mergeStateStatus` is `DIRTY`, resolve the conflict before merging — see *Resolving merge conflicts* below.
22
+ 12. Merge the PR yourself: `gh pr merge <PR-number> --merge`. After opening the PR, merge it yourself promptly — do not wait for a reviewer if none is present. Confirm the PR is closed and the base branch updated before continuing.
23
+ 13. Clean up the feature branch: `git push origin --delete <branch-name>` (remote) and `git branch -d <branch-name>` (local). Update the Paperclip work product to `"status": "merged"` via `PATCH /api/work-products/{workProductId}`.
24
+ 14. If the issue uses an isolated execution workspace (worktree), archive it from your `heartbeat-context` after the merge is pushed.
25
+ 15. If CI fails on the base branch after the merge, fix immediately.
26
+
27
+ ## Branch Protection Setup
28
+
29
+ Configure branch protection once during initial repository setup (this is part of the "Prepare GitHub repository" foundation issue). Branch protection must require a PR before merging but must NOT require GitHub-native approving reviews — all agents share one GitHub account and cannot formally approve their own PRs (unless the project has distinct non-author GitHub reviewer credentials, in which case `required_approving_review_count` may be raised).
30
+
31
+ ```bash
32
+ gh api repos/{owner}/{repo}/branches/{base}/protection \
33
+ --method PUT --input - <<'EOF'
34
+ {
35
+ "required_status_checks": null,
36
+ "enforce_admins": true,
37
+ "required_pull_request_reviews": {
38
+ "required_approving_review_count": 0,
39
+ "dismiss_stale_reviews": false
40
+ },
41
+ "restrictions": null
42
+ }
43
+ EOF
44
+ ```
45
+
46
+ Replace `{owner}`, `{repo}`, `{base}` with the actual values. `enforce_admins: true` so the shared admin account cannot bypass the PR requirement with a direct push — with `required_approving_review_count: 0` the admin can still open a PR and merge it with zero approvals, so the self-merge flow keeps working. `restrictions: null` means no push allowlist; the PR gate still applies (do not "fix" it with an empty array, which would block all pushes). If CI is configured (e.g. the ci-cd module is active), replace `"required_status_checks": null` with the CI context string instead of `null`. Escalate to CEO if `GH_TOKEN` does not have admin rights on the repository.
26
47
 
27
48
  ## When PR Review IS Active
28
49
 
29
- If the pr-review module is active and you have a Code Reviewer role on the team, do NOT use the Direct-to-Base-Ref Flow. Instead, use the PR Workflow skill (`skills/pr-workflow.md`) — open a PR, set executionPolicy review stages, and let the merge gate land the branch. Never merge your own branch when a PR review workflow is in place.
50
+ If the pr-review module is active, do NOT use the PR Self-Merge Flow. Instead, use the PR Workflow skill (`skills/pr-workflow.md`):
51
+ - **With a Code Reviewer on the team (PR-Gate mode):** Open a PR, set executionPolicy review stages, and let the Code Reviewer (non-author merge gate) land the branch. Never merge your own branch in this mode.
52
+ - **Without a Code Reviewer (PR Self-Merge Flow):** Open a PR via `gh pr create`, but skip executionPolicy stages entirely. Other review roles (qa, product-owner, security-engineer) may leave advisory comments. Merge the PR yourself via `gh pr merge <N> --merge` once CI is green. See `skills/pr-workflow.md` step 12 for the full self-merge path.
53
+
54
+ ## Register the PR as a Work Product
55
+
56
+ Whenever you open a pull request (via `gh pr create`), immediately register it as a Paperclip work product so it shows up on the issue and the board. Creating the PR on GitHub alone does **not** make it visible in Paperclip.
57
+
58
+ ```
59
+ POST /api/issues/{issueId}/work-products
60
+ Headers: Authorization: Bearer $PAPERCLIP_API_KEY, X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID
61
+ {
62
+ "type": "pull_request",
63
+ "provider": "github",
64
+ "externalId": "<PR number, e.g. 132>",
65
+ "url": "<full PR URL from `gh pr create`>",
66
+ "title": "<PR title>",
67
+ "status": "ready_for_review",
68
+ "isPrimary": true
69
+ }
70
+ ```
71
+
72
+ Notes:
73
+ - `title` and `url` are required; `url` must be the full PR URL.
74
+ - If the issue runs in an isolated execution workspace, also pass `"executionWorkspaceId"` from your `heartbeat-context` so the PR is linked to that worktree.
75
+ - When the PR later merges or closes, update the work product (`PATCH /api/work-products/{workProductId}`) with `"status": "merged"` or `"closed"`.
30
76
 
31
77
  ## Rules
32
78
 
@@ -35,9 +81,25 @@ If the pr-review module is active and you have a Code Reviewer role on the team,
35
81
  - Never force push to the base branch.
36
82
  - Use the configured base ref. For external repos, branch and compare from the configured remote/ref and push/merge back to the matching remote branch.
37
83
  - Treat push authentication as repository setup, not as an issue blocker. If `git push` says credentials are missing or invalid, verify the helper and `GH_TOKEN` binding first.
38
- - If you encounter merge conflicts, resolve them carefully. When in doubt, escalate to the CEO.
84
+ - If `gh pr merge` fails or `gh pr view` reports `mergeable: CONFLICTING` / `mergeStateStatus: DIRTY`, resolve the conflict before retrying — see *Resolving merge conflicts* below. Never leave a PR in an unresolved conflicting state without either fixing it or leaving an explicit issue comment with the blocker.
39
85
  - Reference the issue ID in the commit body (e.g., `Closes YES-5`).
40
86
  - Never mark an issue as `done` unless at least one new commit was created for that issue's work and has been pushed.
41
87
  - Before marking `done`, verify there is no uncommitted work (`git status --short` should be clean).
42
88
  - If no repository change is required, do not mark `done` silently: leave an issue comment explaining why no code change was needed and escalate to the CEO for decision.
43
- - When working without a PR review flow, you are the merge owner. Merge your branch to base promptly after pushing — do not leave branches dangling unmerged.
89
+ - You are always the merge owner when no code-reviewer is present. Open a PR and merge it yourself via `gh pr merge <N> --merge` promptly — do not leave branches dangling unmerged. Never do a direct `git merge` + push to the base branch; always go through a PR so the branch history is preserved and branch protection is respected (typos/comment-only/doc fixes with an issue reference may be committed directly to the base ref only when branch protection allows it — see `docs/git-workflow.md` → *Dev Cycle Rules*).
90
+ - **Always work on a feature branch, never on the base branch.** Create the branch with `git checkout -b <branch-name> <base-ref>` before committing. Verify with `git branch --show-current` before every push.
91
+ - **Never push the base ref as if it were a feature branch.** Before `git push -u origin <branch-name>`, confirm that `git branch --show-current` matches `<branch-name>`. If it prints the base ref name instead, you are on the wrong branch — create or switch to the feature branch first.
92
+
93
+ ## Resolving merge conflicts
94
+
95
+ When `gh pr merge` fails or `gh pr view <N> --json mergeable,mergeStateStatus` returns `CONFLICTING` / `DIRTY`:
96
+
97
+ 1. `git fetch origin`
98
+ 2. `git checkout <branch-name>`
99
+ 3. `git rebase origin/<base-branch>` where `<base-branch>` is the plain branch name — strip any `origin/` prefix from the configured base ref (e.g., configured `origin/main` → `git rebase origin/main`; configured `main` → `git rebase origin/main`). Resolve each conflict marker, then `git rebase --continue`.
100
+ 4. Run the full check suite (lint, typecheck, tests) to confirm nothing broke.
101
+ 5. `git push --force-with-lease origin <branch-name>` — never `--force`, use `--force-with-lease` to avoid overwriting concurrent pushes.
102
+ 6. Verify the conflict is gone: `gh pr view <N> --json mergeable` should return `MERGEABLE`.
103
+ 7. Retry the merge: `gh pr merge <N> --merge`.
104
+
105
+ If the conflict is too complex to resolve safely (e.g., a large structural conflict with another in-flight PR), leave an issue comment describing the exact conflict and escalate to the CEO for prioritization before abandoning the branch.
@@ -79,29 +79,26 @@ Rules:
79
79
  should print the helper path, and `test -s "$(git rev-parse --git-common-dir)/paperclip-gh-token-cache"`
80
80
  should succeed after a run where `GH_TOKEN` was injected.
81
81
 
82
- ## Direct-to-Base-Ref Workflow
82
+ ## PR Self-Merge Flow
83
83
 
84
- Use this workflow when the **pr-review module is not active** (no Code Reviewer role, no executionPolicy review stages). When PR review is active, use the PR workflow from `docs/pr-conventions.md` instead.
84
+ Use this flow when the **pr-review module is not active** (no Code Reviewer role, no executionPolicy review stages). You open a PR and merge it yourself — there is no external review gate, but all changes go through a PR so branch history is preserved and branch protection is respected. When PR review is active, use the PR workflow from `docs/pr-conventions.md` instead.
85
85
 
86
86
  1. Resolve the configured base ref from project workspace metadata or the issue's `heartbeat-context` before touching Git. Do not infer it from the current shell branch and do not rewrite it to `main`, `master`, or `origin/*`.
87
87
  - External repos: use the project/worktree `repoRef`, `defaultRef`, or `executionWorkspacePolicy.workspaceStrategy.baseRef` exactly as configured.
88
88
  - Fresh/local repos: use the configured local branch.
89
89
  - Only if no base ref is configured anywhere, detect the repository's default branch — see *Resolving the default branch* below. Never hard-code `main`.
90
90
  2. Pull/fetch latest from that base before editing.
91
- 3. Make changes
92
- 4. Run tests/linting locally if available
93
- 5. Commit with conventional commit message
94
- 6. Push your feature branch: `git push -u origin <branch-name>`
95
- 7. Merge to base and push:
96
- ```
97
- git checkout <base-ref>
98
- git merge <branch-name> --no-edit
99
- git push origin <base-ref>
100
- ```
101
- Resolve any merge conflicts (favor your changes; if uncertain, escalate).
102
- 8. Delete the feature branch: `git push origin --delete <branch-name>` and `git branch -d <branch-name>`
103
- 9. If the issue uses an isolated execution workspace (worktree), archive it from `heartbeat-context`.
104
- 10. Verify CI passes on the base branch (if configured). If CI fails, fix immediately.
91
+ 3. **Create a feature branch** from the base ref: `git checkout -b <branch-name> <base-ref>`. Never commit directly on the base branch. The branch name should reference the issue (e.g., `LEA-5-add-landing-hero`). If you are already on a correctly named feature branch, skip this step.
92
+ 4. **Verify you are on the feature branch** before making changes: `git branch --show-current` must print `<branch-name>`, not the base ref. If it prints the base ref name, you forgot step 3 — create the branch now.
93
+ 5. Make changes
94
+ 6. Run tests/linting locally if available
95
+ 7. Commit with conventional commit message
96
+ 8. **Verify the current branch one more time**, then push: `git push -u origin <branch-name>`. The branch name in the push command must match `git branch --show-current`. Never push the base ref as a feature branch — if `git branch --show-current` returns the base ref name, stop and create a feature branch first.
97
+ 9. Open a pull request against the base ref: write the PR body to a temp file, then `gh pr create --base <github-base-branch> --head <branch-name> --title "<type>: <description>" --body-file <file>`. Never inline `--body "..."` — a double-quoted shell string keeps `\n` literal (see *Posting PR Bodies & Comments* in `docs/pr-conventions.md`). `<github-base-branch>` is the **plain branch name** — strip any `origin/` prefix from the configured base ref (e.g., configured ref `origin/main` → `--base main`; configured ref `main` → `--base main`). GitHub does not recognise remote-tracking names. Verify the PR base matches the configured base ref before merging.
98
+ 10. Merge the PR yourself: `gh pr merge <PR-number> --merge`. Do not wait for a reviewer if none is present. Confirm the PR is closed and the base branch updated before continuing. Never do a direct `git merge` + push to the base branch; always go through a PR.
99
+ 11. Clean up the feature branch: `git push origin --delete <branch-name>` (remote) and `git branch -d <branch-name>` (local).
100
+ 12. If the issue uses an isolated execution workspace (worktree), archive it from `heartbeat-context` after the merge is pushed.
101
+ 13. Verify CI passes on the base branch (if configured). If CI fails, fix immediately.
105
102
 
106
103
  ## Resolving the default branch
107
104
 
@@ -143,6 +140,27 @@ For a brand-new local repository there is no remote yet, so initialize on `main`
143
140
  - If Paperclip created an isolated execution workspace for this issue, close/archive it after the commit/PR has landed and before marking `done`. If cleanup is blocked or fails, leave the issue open with the exact cleanup blocker. If the issue is in the shared project workspace, do not invent isolated-worktree cleanup.
144
141
  - If no repository change is required, do not silently close as `done`: add an issue comment explaining why no code change was needed and escalate to the CEO for explicit decision.
145
142
 
143
+ ## Branch Safety
144
+
145
+ - **Always work on a feature branch, never on the base branch.** Create the branch with `git checkout -b <branch-name> <base-ref>` before committing any changes. If you are resuming work on an existing issue, `git branch --show-current` should already show the feature branch name.
146
+ - **Verify your branch before pushing.** Before running `git push -u origin <branch-name>`, confirm that `git branch --show-current` prints the feature branch name — not the base ref. If it prints the base ref, you are on the wrong branch: stop and create/switch to the feature branch first. Pushing the base ref as a feature branch corrupts upstream tracking and causes incorrect branch divergence reports.
147
+
148
+ ## Resolving merge conflicts
149
+
150
+ When `gh pr merge` fails or `gh pr view <N> --json mergeable,mergeStateStatus` reports `CONFLICTING` / `DIRTY`:
151
+
152
+ 1. `git fetch origin`
153
+ 2. `git checkout <branch-name>`
154
+ 3. `git rebase origin/<base-branch>` where `<base-branch>` is the plain branch name — strip any `origin/` prefix from the configured base ref first (e.g., configured `origin/main` → `git rebase origin/main`; configured `main` → `git rebase origin/main`). Resolve each conflict marker, then `git rebase --continue`.
155
+ 4. Run the full check suite (lint, typecheck, tests) to confirm nothing broke.
156
+ 5. `git push --force-with-lease origin <branch-name>` — use `--force-with-lease`, never bare `--force`.
157
+ 6. Verify the conflict is resolved: `gh pr view <N> --json mergeable` should now return `MERGEABLE`.
158
+ 7. Retry: `gh pr merge <N> --merge`.
159
+
160
+ Never leave a PR sitting in a conflicting state without either resolving it or leaving an explicit issue comment with the exact blocker. A dirty PR that is never merged or explicitly closed stalls the entire chain indefinitely.
161
+
162
+ If the conflict is too complex to resolve safely (large structural conflict with another in-flight PR), comment on the issue with the exact conflict description and escalate to the CEO.
163
+
146
164
  ## CI
147
165
 
148
166
  If the project has CI configured (e.g., GitHub Actions), always verify your push passes CI. If CI fails, fix it immediately — a broken base ref blocks everyone.
@@ -12,7 +12,7 @@ You own market research with a focus on user needs and behavior. This is your co
12
12
  - **Positioning**: Where the biggest user need gaps are
13
13
  - **Risks**: Adoption barriers, user switching costs, behavioral resistance
14
14
  3. Create follow-up issues for deeper research if needed:
15
- - `POST /api/companies/{companyId}/issues` for user interview plans, usability benchmarks. Include the active `projectId` (and `goalId` / `parentId` when applicable).
15
+ - `POST /api/companies/{companyId}/issues` for user interview plans, usability benchmarks. Include the active `projectId` (and `goalId` / `parentId` when applicable). For top-level issues (no `parentId`), also include `"executionWorkspaceSettings": { "mode": "isolated_workspace" }` so each gets its own worktree; subissues set `parentId` and omit it.
16
16
  4. Share findings by updating the assigned issue/document and assigning concrete follow-up actions to the Product Owner and CEO when needed; do not rely on generic @-mentions.
17
17
 
18
18
  ## Rules
@@ -6,6 +6,23 @@
6
6
  - **Problem**: _What problem are we solving?_
7
7
  - **Market size**: _How big is the opportunity?_
8
8
 
9
+ ## User Segments
10
+
11
+ ### Primary Users
12
+ - **Segment name**: [name]
13
+ - **Description**: [who they are]
14
+ - **Key needs**: [what they need from the product]
15
+ - **Pain points**: [what frustrates them today]
16
+
17
+ ### Secondary Users
18
+ - **Segment name**: [name]
19
+ - **Description**: [who they are]
20
+ - **Key needs**: [what they need from the product]
21
+ - **Relationship to primary**: [how they interact with the primary user's workflow]
22
+
23
+ ### Edge Cases
24
+ - [User groups or scenarios that the product must handle but that aren't core users]
25
+
9
26
  ## Competitive Landscape
10
27
 
11
28
  | Competitor | Strengths | Weaknesses | Differentiation |
@@ -11,7 +11,7 @@ You own market research and competitive analysis. This informs the product roadm
11
11
  - **Positioning**: How do we differentiate? What's our unique value proposition?
12
12
  - **Risks**: Market risks, timing risks, adoption barriers
13
13
  3. Create follow-up issues for any strategic decisions needed:
14
- - `POST /api/companies/{companyId}/issues` with findings that require input. Include the active `projectId` (and `goalId` / `parentId` when applicable).
14
+ - `POST /api/companies/{companyId}/issues` with findings that require input. Include the active `projectId` (and `goalId` / `parentId` when applicable). For top-level issues (no `parentId`), also include `"executionWorkspaceSettings": { "mode": "isolated_workspace" }` so each gets its own worktree; subissues set `parentId` and omit it.
15
15
  4. Record summary in your daily notes
16
16
 
17
17
  ## Rules
@@ -5,7 +5,7 @@ The DevOps engineer primarily owns monitoring and observability. You are the fal
5
5
  ## Monitoring (Fallback)
6
6
 
7
7
  1. If no `docs/MONITORING.md` exists and DevOps hasn't started:
8
- - Add basic health check endpoints (liveness probe returning 200)
8
+ - Add basic health check endpoints (liveness and readiness probes returning 200)
9
9
  - Set up structured JSON logging with timestamp, level, and service fields
10
10
  - Document the setup in `docs/MONITORING.md`
11
11
  - Mark the strategy as **provisional** — it needs DevOps review for alerting, dashboards, and SLOs
@@ -9,7 +9,8 @@ You are responsible for setting up observability, alerting, and health checks fo
9
9
  3. Configure error tracking — capture unhandled exceptions with context (request ID, user, stack trace).
10
10
  4. Set up structured logging — all log output must be machine-parseable JSON with consistent fields.
11
11
  5. Define alert thresholds for key metrics (error rate, latency, uptime, resource usage).
12
- 6. Document the full observability strategy in `docs/MONITORING.md`.
12
+ 6. Set up a basic operational dashboard (in the monitoring tool configured for this project) showing: request rate, error rate, latency (p50/p99), and the key health indicators defined above. Document the dashboard URL/name in `docs/MONITORING.md`.
13
+ 7. Document the full observability strategy in `docs/MONITORING.md`.
13
14
 
14
15
  ## Rules
15
16
 
@@ -18,3 +19,4 @@ You are responsible for setting up observability, alerting, and health checks fo
18
19
  - Log structured JSON — never log unstructured strings. Include timestamp, level, service, and correlation ID.
19
20
  - Health checks must be lightweight — no heavy DB queries or external calls in liveness probes.
20
21
  - Keep dashboards focused — one dashboard per concern (e.g., API latency, error rates, infrastructure).
22
+ - Every alert definition must link to a runbook in `docs/` explaining: what triggered it, what to check first, and how to respond. No alert should fire without a runbook.
@@ -18,11 +18,25 @@ Paperclip's runtime **excludes the issue's original executor (the author) from e
18
18
 
19
19
  ## Merging
20
20
 
21
- 1. Merge with `gh pr merge <number> --merge`. No force pushes.
22
- 2. Confirm the merge landed on the correct base.
23
- 3. If Paperclip created an isolated execution workspace for the issue, read its id from `heartbeat-context`, call close-readiness, and archive it after the merge and once the tree is clean. If cleanup is blocked or fails, do **not** record approval — leave the issue open with the exact blocker. If the issue runs in the shared project workspace, do not invent isolated-worktree cleanup.
24
- 4. **Only after the merge and cleanup succeed**, record `approved` (PATCH toward `done`) with a comment citing the executed verification and the merge confirmation. That closes the issue.
25
- 5. Never record `approved` before the merge has actually succeeded, and never leave the issue `done` with the PR still open.
21
+ 1. Before merging, check whether the PR branch is up to date with the base: `gh pr view <number> --json mergeable,mergeStateStatus`. If `mergeable` is `CONFLICTING` or `mergeStateStatus` is `DIRTY`, **do not attempt to merge** — go to *Merge conflicts* below first.
22
+ 2. Merge with `gh pr merge <number> --merge`. No force pushes.
23
+ 3. Confirm the merge landed on the correct base.
24
+ 4. If Paperclip created an isolated execution workspace for the issue, read its id from `heartbeat-context`, call close-readiness, and archive it after the merge and once the tree is clean. If cleanup is blocked or fails, do **not** record approval leave the issue open with the exact blocker. If the issue runs in the shared project workspace, do not invent isolated-worktree cleanup.
25
+ 5. **Only after the merge and cleanup succeed**, record `approved` (PATCH toward `done`) with a comment citing the executed verification and the merge confirmation. That closes the issue.
26
+ 6. Never record `approved` before the merge has actually succeeded, and never leave the issue `done` with the PR still open.
27
+
28
+ ## Merge conflicts
29
+
30
+ When `gh pr merge` fails or `gh pr view` reports `mergeable: CONFLICTING` / `mergeStateStatus: DIRTY`:
31
+
32
+ 1. Record `changes_requested` on the issue immediately (do not leave it in `in_review` indefinitely) with a comment: "PR has merge conflicts with the base branch — returning to engineer to rebase."
33
+ 2. The issue routes back to the engineer (`returnAssignee`). The engineer must:
34
+ - `git fetch origin && git checkout <branch-name>`
35
+ - `git rebase origin/<base-branch>` where `<base-branch>` is the plain branch name (strip any `origin/` prefix from the configured base ref — e.g., configured `origin/main` → `git rebase origin/main`)
36
+ - Resolve all conflicts, run checks, commit
37
+ - `git push --force-with-lease origin <branch-name>`
38
+ - Leave an issue comment confirming the rebase, then move the issue back to `in_review`
39
+ 3. The issue re-enters the approval chain and returns to you. Re-run the hard verification gate before merging.
26
40
 
27
41
  ## When something is wrong
28
42
 
@@ -14,16 +14,14 @@ You review PRs for infrastructure impact, performance, security, and operational
14
14
 
15
15
  ## How to Review
16
16
 
17
- 1. When you are the active participant of a review stage on an issue with a PR link, review the PR.
17
+ 1. When a PR changes deployments, configs, dependencies, or system behavior, review it for the infra concerns below.
18
18
  2. Focus on infrastructure, deployment, runtime security, observability, and rollback risk.
19
- 3. Record your verdict through the normal issue update route for your review stage:
20
- - **approved** if operationally sound
21
- - **changes_requested** with specific concerns if not
22
- 4. Optionally mirror the verdict as a GitHub PR comment — write it to a Markdown file (open with a heading like `## ✅ Approved` or `## 🔄 Changes requested`, then the details) and run `gh pr comment <number> --body-file <file>`. Never use inline `--body "..."`: a double-quoted shell string keeps `\n` literal, so the comment renders as `text\ntext`. See `docs/pr-conventions.md` → *Posting PR Bodies & Comments*.
19
+ 3. Post your verdict as an **advisory** GitHub PR comment you are not a blocking review stage, so do not record a stage verdict (no `approved`/`changes_requested` on the issue's executionPolicy). Write the comment to a Markdown file (open with a heading like `## ✅ Approved` or `## 🔄 Changes requested`, then the details) and run `gh pr comment <number> --body-file <file>`. Never use inline `--body "..."`: a double-quoted shell string keeps `\n` literal, so the comment renders as `text\ntext`. See `docs/pr-conventions.md` → *Posting PR Bodies & Comments*.
20
+ 4. If you find a concern that should block the merge, flag it as **blocking-severity** in the comment and name who should act on it — for security issues (exposed secrets, critical vulnerabilities), that is the Security Engineer review stage when one exists, otherwise QA or the Code Reviewer merge gate — so a blocking reviewer can incorporate it into their verdict. You do not block the merge yourself.
23
21
 
24
22
  ## Rules
25
23
 
26
- - Security issues are always blockers never approve PRs with exposed secrets or critical vulnerabilities.
27
- - Performance concerns are blockers only if they affect production. Flag others as suggestions.
28
- - Approve changes with no infrastructure impact without comment.
24
+ - Flag security issues (exposed secrets, critical vulnerabilities) as blocking-severity in your advisory comment so the Security Engineer (or merge gate) acts on them; you do not yourself withhold a stage verdict. When a Security Engineer review stage exists, defer security blocking to it.
25
+ - Performance concerns are blocking-severity only if they affect production; flag others as suggestions.
26
+ - Comment only on changes with infrastructure impact.
29
27
  - If a change needs a migration or deployment step, ensure it's documented in the PR.
@@ -9,20 +9,54 @@ When this skill is active, you work in feature branches and open PRs instead of
9
9
  - external: `git fetch origin`, then branch from the configured base ref
10
10
  - local: update from the configured local branch
11
11
  3. Create branch from that base: `git checkout -b <prefix>-<N>/<short-description> <base-ref>`
12
- 4. Make your changes, commit with Conventional Commits format
13
- 5. Push branch: `git push -u origin <branch-name>`
14
- 6. Open PR against the same resolved base: derive the GitHub base branch from the configured ref (for example, strip the remote prefix only when the ref is remote-tracking), write the body (PR Body Template in `docs/pr-conventions.md`) to a file, then `gh pr create --base <github-base-branch> --head <branch-name> --title "<type>: <description>" --body-file <file>`. Never inline `--body "..."`a double-quoted shell string keeps `\n` literal and the PR renders as `text\ntext` (see *Posting PR Bodies & Comments*).
15
- 7. Set the originating issue's `executionPolicy` to gate the merge on review, ending with the Code Reviewer as the merge gate:
12
+ 4. **Verify you are on the feature branch** before making changes: `git branch --show-current` must print your branch name, not the base ref. If it prints the base ref name, you forgot step 3 — create the branch now.
13
+ 5. Make your changes, commit with Conventional Commits format
14
+ 6. **Verify the current branch one more time**, then push: `git push -u origin <branch-name>`. The branch name in the push command must match `git branch --show-current`. Never push the base ref as a feature branchif `git branch --show-current` returns the base ref name, stop and create a feature branch first.
15
+ 7. Open PR against the same resolved base: `gh pr create --base <github-base-branch> --head <branch-name> --title "<type>: <description>" --body-file <file>`. `<github-base-branch>` is the **plain branch name** strip any `origin/` prefix from the configured base ref (e.g., configured `origin/main` → `--base main`; configured `main` → `--base main`). GitHub does not recognise remote-tracking names. Write the PR body (PR Body Template in `docs/pr-conventions.md`) to a file first — never inline `--body "..."` (double-quoted shell string keeps `\n` literal; see *Posting PR Bodies & Comments*).
16
+ 8. **Register the PR as a Paperclip work product** so it is visible on the issue and board (creating it on GitHub alone does not surface it in Paperclip):
17
+ ```
18
+ POST /api/issues/{issueId}/work-products
19
+ Headers: Authorization: Bearer $PAPERCLIP_API_KEY, X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID
20
+ {
21
+ "type": "pull_request",
22
+ "provider": "github",
23
+ "externalId": "<PR number>",
24
+ "url": "<full PR URL>",
25
+ "title": "<PR title>",
26
+ "status": "ready_for_review",
27
+ "isPrimary": true
28
+ }
29
+ ```
30
+ `title` and `url` are required (`url` must be the full PR URL). If the issue runs in an isolated worktree, also pass `"executionWorkspaceId"` from `heartbeat-context`. When the PR later merges, update it with `PATCH /api/work-products/{id}` and `"status": "merged"`.
31
+ 9. **Only if a code-reviewer is present on the team:** Set the originating issue's `executionPolicy` to gate the merge on review, ending with the Code Reviewer as the merge gate. **Set executionPolicy stages before moving the issue to `in_review` (step 10) — changing stages after the issue has already entered review is not supported.** If no code-reviewer is assigned to this company, skip steps 9–11 entirely and go directly to the self-merge path at step 12. Setting up executionPolicy stages without an eligible non-author merge gate will stall the issue permanently (`422 No eligible approval participant`).
16
32
  - One `review` stage with **QA** when a QA agent exists (test adequacy / executed verification).
17
33
  - One `review` stage with the **Security Engineer** only when the change is security-relevant (auth, secrets, input boundaries, crypto, dependencies, infra exposure).
18
- - Additional `review` stages only for domain reviewers that should block this specific change.
19
- - An `approval` stage with the **Product Owner** as participant (always) — the product sign-off.
20
- - A final `approval` stage with the **Code Reviewer** as participant — the **merge gate**. The Code Reviewer is woken *last*, after every reviewer and the Product Owner have cleared, to satisfy the hard verification gate and merge the PR. If the team has no Code Reviewer, use another present non-author agent (e.g. DevOps, the Product Owner, or another engineer) never yourself.
34
+ - Domain reviewers (UI Designer, UX Researcher, DevOps) are advisory — they post PR comments and may flag a concern for QA, the Security Engineer, or the merge gate to act on. They are never themselves a review stage.
35
+ - An `approval` stage with the **Product Owner** when a Product Owner is on the team — the product sign-off. If no Product Owner is present, omit this stage.
36
+ - A final `approval` stage with the **Code Reviewer** as participant — the **merge gate**. The Code Reviewer is woken *last*, after every reviewer and the Product Owner have cleared, to satisfy the hard verification gate and merge the PR. If the team has no Code Reviewer, do not set executionPolicy stages at all use the self-merge path at step 12 instead.
21
37
  - **Never list yourself (the issue's executor) as a participant in any stage.** Paperclip excludes the original executor to prevent self-review; a stage whose only participant is you has no eligible participant and the issue stalls in `in_review` forever (`422 No eligible approval participant is configured for this issue`).
22
38
  - Resolve each role to its agentId first (look up active agents), then set the policy on the issue. Include the PR link in an issue comment so reviewers can find it.
23
- 8. Move the originating issue to `in_review`.
24
- 9. Wait for the issue to clear its review/approval stages. Each reviewer and the Product Owner records `approved` by PATCHing the issue toward `done`, or `changes_requested` by PATCHing it back to `in_progress`; Paperclip stores the reviewer/approver decision metadata on the issue. Verdicts may be mirrored as PR comments. A `changes_requested` routes the issue back to you — address it, push to the same branch, and that stage re-runs.
25
- 10. You do not merge your own PR. The **Code Reviewer** (the non-author merge gate) lands it after every prior stage approves, satisfies the hard verification gate, and records the final `approved` that closes the issue to `done`. Your remaining job is to respond to `changes_requested`: when a stage routes the issue back to you (the `returnAssignee`), address the feedback, push to the same branch, and the routed stage re-runs.
39
+ 10. Move the originating issue to `in_review`.
40
+ 11. Wait for the issue to clear its review/approval stages. Each reviewer and the Product Owner records `approved` by PATCHing the issue toward `done`, or `changes_requested` by PATCHing it back to `in_progress`; Paperclip stores the reviewer/approver decision metadata on the issue. Verdicts may be mirrored as PR comments. A `changes_requested` routes the issue back to you — address it, push to the same branch, and that stage re-runs.
41
+ 12. **Merging the PR two paths:**
42
+ - **Code Reviewer present (PR-Gate mode):** You do not merge your own PR. The Code Reviewer (the non-author merge gate) lands it after every prior stage approves, satisfies the hard verification gate (green CI or pasted test/build output), and records the final `approved` that closes the issue to `done`. Your job is to respond to `changes_requested`: when a stage routes the issue back to you, address the feedback, push to the same branch, and the stage re-runs. If `changes_requested` is due to a merge conflict (the Code Reviewer will say so), see *Resolving merge conflicts* below.
43
+ - **No code-reviewer present (PR Self-Merge Flow):** You already skipped steps 9–11. Before merging, check `gh pr view <N> --json mergeable,mergeStateStatus` — if the PR is `CONFLICTING` or `DIRTY`, resolve the conflict first (see *Resolving merge conflicts* below). Then merge: `gh pr merge <N> --merge` once CI is green (or you have pasted test/build output if no CI). All other review roles (qa, product-owner, security-engineer, ui-designer, ux-researcher, devops) may leave advisory comments on the PR, but none block the merge — there are no executionPolicy stages. Update the Paperclip work product to `"status": "merged"` and archive any isolated worktree.
44
+
45
+ ## Resolving merge conflicts
46
+
47
+ When `gh pr merge` fails or `gh pr view` reports `mergeable: CONFLICTING` / `mergeStateStatus: DIRTY`:
48
+
49
+ 1. `git fetch origin`
50
+ 2. `git checkout <branch-name>`
51
+ 3. `git rebase origin/<base-branch>` where `<base-branch>` is the plain branch name — strip any `origin/` prefix from the configured base ref (e.g., configured `origin/main` → `git rebase origin/main`; configured `main` → `git rebase origin/main`). Resolve all conflicts, then `git rebase --continue`.
52
+ 4. Run the full check suite (lint, typecheck, tests) to confirm nothing broke.
53
+ 5. `git push --force-with-lease origin <branch-name>`
54
+ 6. Confirm the PR is no longer conflicting: `gh pr view <N> --json mergeable` should return `MERGEABLE`.
55
+ 7. Leave an issue comment noting the rebase, then continue with the merge step.
56
+
57
+ Never leave a PR with unresolved conflicts without either resolving them or explicitly routing the issue back (`changes_requested`) with a comment explaining the blocker. A dirty PR sitting in `in_review` stalls the entire chain.
58
+
59
+ If the conflict is too complex to resolve safely (large structural conflict with another in-flight PR), leave an issue comment with the exact conflict description and escalate to the CEO for prioritization.
26
60
 
27
61
  ## Rules
28
62
 
@@ -30,9 +64,10 @@ When this skill is active, you work in feature branches and open PRs instead of
30
64
  - One PR per issue. Keep changes focused.
31
65
  - Always include `Closes [PREFIX-N]` in the PR body.
32
66
  - If a reviewer requests changes, address them, push to the same branch, and re-request review (the stage re-runs).
33
- - The Code Reviewer (the non-author merge gate) is the merge owner. You cannot merge your own PR Paperclip excludes you (the executor) from every review/approval stage. Hand off cleanly by setting the policy correctly, not by merging yourself.
67
+ - When a code-reviewer is present: the Code Reviewer is the merge owner; you cannot merge your own PR (Paperclip excludes the executor). When no code-reviewer is present: you are the merge owner; skip executionPolicy stages and merge via `gh pr merge <N> --merge` yourself.
34
68
  - Before creating a PR, verify the PR base matches the configured project/worktree base. If the base is wrong, retarget the PR before review.
35
- - **The merge gate must be the last stage, and it must be a non-author.** The Product Owner's `approval` is the product sign-off, not the final stage: if it were last, their verdict would auto-close the issue to `done` with the PR still open on GitHub. Append a final merge-gate `approval` stage for the **Code Reviewer** (or another present non-author agent) after the Product Owner's. Never make yourself the merge gate — Paperclip excludes the executor, so that stage stalls with `422 No eligible approval participant`.
69
+ - **The merge gate must be the last stage, and it must be a non-author.** The Product Owner's `approval` is the product sign-off, not the final stage: if it were last, their verdict would auto-close the issue to `done` with the PR still open on GitHub. Append a final merge-gate `approval` stage for the **Code Reviewer** after the Product Owner's. Never make yourself the merge gate — Paperclip excludes the executor, so that stage stalls with `422 No eligible approval participant`. If no Code Reviewer is on the team, do not set executionPolicy stages; use the self-merge path instead.
36
70
  - Do not create separate child review issues and do not use @-mentions to request review; the executionPolicy stages are the governance signal.
37
71
  - Do not wait for GitHub-native approving reviews when all agents share the same GitHub credential; GitHub rejects self-approval. The Paperclip executionPolicy stages are the required signal unless a separate non-author GitHub reviewer credential is explicitly available.
38
72
  - Post-merge cleanup of any isolated execution workspace belongs to the merge-gate agent (they archive it from `heartbeat-context` when landing the PR). You only clean up your own worktree if you abandon a branch or the issue is cancelled before review. If this issue runs in the shared project workspace, do not invent isolated-worktree cleanup.
73
+ - **Never push the base ref as if it were a feature branch.** Before `git push -u origin <branch-name>`, confirm that `git branch --show-current` matches `<branch-name>`. If it prints the base ref name instead, you are on the wrong branch — create or switch to the feature branch first.
@@ -1,6 +1,6 @@
1
1
  # Skill: Product Review
2
2
 
3
- You review PRs for intent alignment, scope discipline, and acceptance criteria. You are the final approveryou are the participant of the `approval` stage on the PR's issue, and your sign-off is the last gate before merge.
3
+ You review PRs for intent alignment, scope discipline, and acceptance criteria. You are the product sign-off — the participant of the `approval` stage on the PR's issue immediately before the Code Reviewer merge gate. Your `approved` is required before the merge gate lands the PR, but you are not the final stage: the Code Reviewer's subsequent merge-gate approval is what closes the issue.
4
4
 
5
5
  ## Review Checklist
6
6
 
@@ -25,4 +25,5 @@ You review PRs for intent alignment, scope discipline, and acceptance criteria.
25
25
  - Every PR should trace back to an issue. If it doesn't, ask why.
26
26
  - Reject scope creep firmly but constructively — suggest filing a separate issue.
27
27
  - If acceptance criteria are ambiguous, clarify them before approving.
28
- - Your approval stage verdict is the final governance signal. Do not block only because GitHub rejects formal review submission from the shared PR-author credential — GitHub-native approval is optional unless a distinct non-author reviewer credential is explicitly available.
28
+ - Your approval stage verdict is the product sign-off; the Code Reviewer's subsequent merge-gate approval is the final governance signal that closes the issue. Do not block only because GitHub rejects formal review submission from the shared PR-author credential — GitHub-native approval is optional unless a distinct non-author reviewer credential is explicitly available.
29
+ - You are not a merge owner. If a Code Reviewer is absent and the team is using the PR Self-Merge Flow, the engineer merges the PR themselves; your role is advisory in that mode — post product concerns as PR comments, do not record a stage verdict.
@@ -14,16 +14,14 @@ You review PRs for visual quality, brand consistency, and accessibility. When a
14
14
 
15
15
  ## How to Review
16
16
 
17
- 1. When you are the active participant of a review stage on an issue with a PR link, review the PR.
17
+ 1. When a PR touches UI components, styles, or user-facing screens, review it for the design concerns below.
18
18
  2. Focus only on visual/design concerns — leave code logic to Code Reviewer and product scope to Product Owner.
19
- 3. Record your verdict through the normal issue update route for your review stage:
20
- - **approved** if visually sound
21
- - **changes_requested** with specific, actionable feedback if not
22
- 4. Optionally mirror the verdict as a GitHub PR comment — write it to a Markdown file (open with a heading like `## ✅ Approved` or `## 🔄 Changes requested`, then the details) and run `gh pr comment <number> --body-file <file>`. Never use inline `--body "..."`: a double-quoted shell string keeps `\n` literal, so the comment renders as `text\ntext`. See `docs/pr-conventions.md` → *Posting PR Bodies & Comments*.
19
+ 3. Post your verdict as an **advisory** GitHub PR comment you are not a blocking review stage, so do not record a stage verdict (no `approved`/`changes_requested` on the issue's executionPolicy). Write the comment to a Markdown file (open with a heading like `## ✅ Approved` or `## 🔄 Changes requested`, then the details) and run `gh pr comment <number> --body-file <file>`. Never use inline `--body "..."`: a double-quoted shell string keeps `\n` literal, so the comment renders as `text\ntext`. See `docs/pr-conventions.md` → *Posting PR Bodies & Comments*.
20
+ 4. If you find a concern that should block the merge (e.g. a critical accessibility regression or a brand-violating change), flag it explicitly in the comment and name who should act on it — QA, the Security Engineer, or the Code Reviewer merge gate — so a blocking reviewer can incorporate it into their verdict. You do not block the merge yourself.
23
21
 
24
22
  ## Rules
25
23
 
26
24
  - Be specific — "the button should use `--color-primary`" beats "wrong color".
27
- - Approve changes that don't touch UI without comment — not every PR needs design review.
25
+ - Comment only on changes that touch UI — not every PR needs design review.
28
26
  - If `docs/BRAND-IDENTITY.md` doesn't exist yet, note it but don't block the PR.
29
27
  - Screenshots or before/after comparisons strengthen feedback when possible.
@@ -14,16 +14,14 @@ You review PRs for usability, user flow integrity, and alignment with user needs
14
14
 
15
15
  ## How to Review
16
16
 
17
- 1. When you are the active participant of a review stage on an issue with a PR link, review the PR.
17
+ 1. When a PR changes user-facing behavior, interactions, or flows, review it for the UX concerns below.
18
18
  2. Focus only on UX and usability concerns — leave code logic to Code Reviewer and visuals to UI Designer.
19
- 3. Record your verdict through the normal issue update route for your review stage:
20
- - **approved** if usability is sound
21
- - **changes_requested** with specific, actionable feedback if not
22
- 4. Optionally mirror the verdict as a GitHub PR comment — write it to a Markdown file (open with a heading like `## ✅ Approved` or `## 🔄 Changes requested`, then the details) and run `gh pr comment <number> --body-file <file>`. Never use inline `--body "..."`: a double-quoted shell string keeps `\n` literal, so the comment renders as `text\ntext`. See `docs/pr-conventions.md` → *Posting PR Bodies & Comments*.
19
+ 3. Post your verdict as an **advisory** GitHub PR comment you are not a blocking review stage, so do not record a stage verdict (no `approved`/`changes_requested` on the issue's executionPolicy). Write the comment to a Markdown file (open with a heading like `## ✅ Approved` or `## 🔄 Changes requested`, then the details) and run `gh pr comment <number> --body-file <file>`. Never use inline `--body "..."`: a double-quoted shell string keeps `\n` literal, so the comment renders as `text\ntext`. See `docs/pr-conventions.md` → *Posting PR Bodies & Comments*.
20
+ 4. If you find a concern that should block the merge (e.g. a flow that traps users in a dead end), flag it explicitly in the comment and name who should act on it — QA, the Security Engineer, or the Code Reviewer merge gate — so a blocking reviewer can incorporate it into their verdict. You do not block the merge yourself.
23
21
 
24
22
  ## Rules
25
23
 
26
24
  - Ground feedback in user impact — "users might miss this because..." beats "I don't like this".
27
25
  - If `docs/USER-TESTING.md` exists, reference its findings where relevant. If it doesn't exist yet, ground feedback in the PR and existing app patterns instead.
28
- - Approve changes that don't affect user-facing behavior without comment.
26
+ - Comment only on changes that affect user-facing behavior.
29
27
  - If the change introduces a new interaction pattern, flag it for consistency tracking.
@@ -68,8 +68,8 @@ Review runs through the issue's native `executionPolicy` (stages), not separate
68
68
  3. **Engineer** sets the originating issue's `executionPolicy` stages, in order:
69
69
  - a `review` stage for **QA** when a QA agent is on the team (test adequacy / running the tests),
70
70
  - a `review` stage for the **Security Engineer** *only when the change is security-relevant* (auth, secrets, input boundaries, crypto, dependencies, infra exposure),
71
- - an `approval` stage for the **Product Owner** (intent, scope, acceptance),
72
- - a final `approval` stage for the **Code Reviewer** as the merge gate (a non-author — Paperclip excludes the issue's executor from every stage).
71
+ - an `approval` stage for the **Product Owner** when one is on the team (intent, scope, acceptance),
72
+ - a final `approval` stage for the **Code Reviewer** as the merge gate (a non-author — Paperclip excludes the issue's executor from every stage). When no Code Reviewer is on the team, do not set executionPolicy stages at all — use the PR Self-Merge Flow (the engineer opens the PR and merges via `gh pr merge <N> --merge`); other review roles may leave advisory comments but do not block.
73
73
  Resolve each role to its agentId. **Never list the issue's executor (the engineer who authored the work) as a participant in any stage** — the runtime excludes the original executor, so such a stage has no eligible participant and the issue stalls (`422 No eligible approval participant`).
74
74
  4. **Engineer** sets the issue to `in_review`.
75
75
  5. **QA** (when present) reviews and records `approved`/`changes_requested` through the normal issue update route with executed evidence (see *Merge Rules*), preserving the issue-level review audit trail.
@@ -82,8 +82,8 @@ Review runs through the issue's native `executionPolicy` (stages), not separate
82
82
 
83
83
  - **QA** (`review` stage, when present): the substantive gate. Test coverage, regression risk, and validation — backed by tests that actually ran.
84
84
  - **Security Engineer** (`review` stage, only when the change is security-relevant): probes the diff for injection, auth, secrets, crypto, dependency, and exposure issues.
85
- - **Product Owner** (`approval` stage): intent alignment, scope discipline, acceptance criteria.
86
- - **Code Reviewer** (`approval` stage, last): the merge gate and hard-gate backstop — a non-author who verifies and lands the PR. See *Merge Rules*.
85
+ - **Product Owner** (`approval` stage, when present): intent alignment, scope discipline, acceptance criteria.
86
+ - **Code Reviewer** (`approval` stage, last, when present): the merge gate and hard-gate backstop — a non-author who verifies and lands the PR. See *Merge Rules*. When no Code Reviewer is present, the engineer self-merges via `gh pr merge <N> --merge` and no executionPolicy stages are set.
87
87
  - **Domain reviewers** (advisory): optional, non-blocking comments on correctness, clarity, design, accessibility, UX. They never gate the merge.
88
88
 
89
89
  ## Merge Rules
@@ -25,7 +25,7 @@
25
25
  "approver": "product-owner",
26
26
  "mergeGate": "code-reviewer"
27
27
  },
28
- "description": "Document and verify the PR workflow via the issue's executionPolicy. The merge gate is executed verification: with CI, builds must be green before merge; without CI, the merge-gate agent runs the test suite/build and pastes the output before merging. Stages: a review stage for QA when present, a review stage for the Security Engineer only on security-relevant changes, an approval stage for the Product Owner, and a final approval stage for the Code Reviewer as the merge gate (a non-author woken last to merge the PR before recording approval, which closes the issue). Never list the issue's executor/author as a participant in any stage — Paperclip excludes the original executor, so a stage whose only participant is the author has no eligible participant and the issue stalls (`422 No eligible approval participant is configured for this issue`); this is why the merge gate is the Code Reviewer (or another non-author), not the engineer. The merge gate must be the last stage so the Product Owner's approval does not auto-close the issue with the PR still open. Other domain reviewers add advisory, non-blocking comments. Optional branch protection may disable direct pushes, but do not require GitHub-native approving reviews unless the project has distinct non-author GitHub reviewer credentials."
28
+ "description": "Document and verify the PR workflow via the issue's executionPolicy. The merge gate is executed verification: with CI, builds must be green before merge; without CI, the merge-gate agent runs the test suite/build and pastes the output before merging. Stages: a review stage for QA when present, a review stage for the Security Engineer only on security-relevant changes, an approval stage for the Product Owner when present, and a final approval stage for the Code Reviewer as the merge gate (a non-author woken last to merge the PR before recording approval, which closes the issue). Never list the issue's executor/author as a participant in any stage — Paperclip excludes the original executor, so a stage whose only participant is the author has no eligible participant and the issue stalls (`422 No eligible approval participant is configured for this issue`); this is why the merge gate is the Code Reviewer (a non-author), not the engineer. The merge gate must be the last stage so the Product Owner's approval does not auto-close the issue with the PR still open. Other domain reviewers add advisory, non-blocking comments. Optional branch protection may disable direct pushes, but do not require GitHub-native approving reviews unless the project has distinct non-author GitHub reviewer credentials. When no code-reviewer role is present in the company, use PR-Self-Merge mode instead: the engineer opens the PR normally but skips executionPolicy stages entirely and merges via `gh pr merge <N> --merge` themselves. Other review roles (qa, product-owner, security-engineer, ui-designer, ux-researcher, devops) may leave advisory comments on the PR but do not block the merge. Never set up executionPolicy stages when there is no eligible non-author merge gate — the issue will stall with `422 No eligible approval participant`."
29
29
  }
30
30
  ]
31
31
  }
@@ -0,0 +1,20 @@
1
+ # Skill: Release Process (CEO Fallback)
2
+
3
+ You are acting as a fallback for this capability because neither a devops agent nor an engineer is currently on the team. **Do not execute releases** — your role is to ensure release conventions are documented and a proper release owner is hired.
4
+
5
+ ## What you should do
6
+
7
+ 1. Check if `docs/RELEASE-PROCESS.md` exists. If not, create it with:
8
+ - Versioning convention (SemVer: `MAJOR.MINOR.PATCH`)
9
+ - Branch and tagging strategy (e.g., tag `vX.Y.Z` on the default branch after each release)
10
+ - Changelog format: Conventional Commits → CHANGELOG.md grouping
11
+ - Note: "This document was created by the CEO as a placeholder. A devops or engineer agent should implement and automate the release pipeline."
12
+ 2. Check if the project has a CHANGELOG.md. If not, create one with a `## Unreleased` section listing the current commits since the last tag (use `git log --oneline`).
13
+ 3. Create a follow-up issue: "Implement automated release pipeline" assigned to `capability:ci-cd` or directly to an engineer, linking to `docs/RELEASE-PROCESS.md`.
14
+ 4. Mark this issue done. **Do not push tags, create GitHub releases, or modify version files** — those actions require a devops or engineer agent.
15
+
16
+ ## Rules
17
+
18
+ - Never execute `git push --tags`, `gh release create`, or version-file bumps without a devops or engineer agent present.
19
+ - Your output is documentation and a follow-up issue — not an executed release.
20
+ - If an urgent release is needed, escalate to the board.
@@ -21,5 +21,14 @@
21
21
  "assignTo": "capability:release-process",
22
22
  "description": "Review the current release workflow. If one exists, document it in docs/RELEASE-PROCESS.md. If not, establish a semver + changelog workflow with tagging conventions."
23
23
  }
24
+ ],
25
+ "routines": [
26
+ {
27
+ "name": "Release readiness check",
28
+ "description": "Check for unreleased changes and cut a release if warranted.",
29
+ "assignTo": "capability:release-process",
30
+ "schedule": "0 9 * * 1",
31
+ "concurrencyPolicy": "forbid"
32
+ }
24
33
  ]
25
34
  }