@starlein/paperclip-plugin-company-wizard 0.4.5-a → 0.4.6
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.
- package/CHANGELOG.md +26 -0
- package/README.md +1 -1
- package/dist/manifest.js +4 -9
- package/dist/manifest.js.map +2 -2
- package/dist/worker.js +198 -43
- package/dist/worker.js.map +2 -2
- package/package.json +1 -1
- package/templates/modules/auto-assign/README.md +9 -7
- package/templates/modules/auto-assign/agents/ceo/heartbeat-section.md +3 -1
- package/templates/modules/auto-assign/agents/ceo/skills/auto-assign.fallback.md +14 -8
- package/templates/modules/auto-assign/agents/product-owner/heartbeat-section.md +3 -1
- package/templates/modules/auto-assign/module.meta.json +3 -3
- package/templates/modules/auto-assign/skills/auto-assign.md +2 -2
- package/templates/modules/backlog/docs/backlog-process.md +7 -7
- package/templates/modules/backlog/docs/backlog-template.md +2 -1
- package/templates/modules/backlog/module.meta.json +2 -2
- package/templates/modules/backlog/skills/backlog-health.bar.md +1 -1
- package/templates/modules/backlog/skills/backlog-health.md +2 -2
- package/templates/modules/github-repo/README.md +3 -3
- package/templates/modules/github-repo/agents/engineer/skills/git-workflow.md +24 -8
- package/templates/modules/github-repo/docs/git-workflow.md +59 -2
- package/templates/modules/github-repo/module.meta.json +1 -1
- package/templates/roles/engineer/AGENTS.md +2 -0
- package/templates/roles/engineer/HEARTBEAT.md +1 -1
- package/templates/roles/product-owner/AGENTS.md +2 -1
- package/templates/roles/product-owner/HEARTBEAT.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starlein/paperclip-plugin-company-wizard",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AI-powered wizard to bootstrap paperclip agent companies from composable templates (for latest paperclip version)",
|
|
6
6
|
"repository": "https://github.com/starlein/paperclip-plugin-company-wizard",
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
# Module: auto-assign
|
|
2
2
|
|
|
3
|
-
Adds
|
|
3
|
+
Adds a low-frequency safety net for issue assignment. Primary dispatch happens at backlog grooming — issues are assigned at creation. This module only catches stragglers.
|
|
4
4
|
|
|
5
5
|
## What it adds
|
|
6
6
|
|
|
7
|
-
- **
|
|
7
|
+
- **Product Owner skill**: Safety-net assignment check — assigns any still-unassigned backlog items to the best-fit available agent.
|
|
8
|
+
- **CEO fallback skill**: Steps in when the PO is absent or stalled.
|
|
8
9
|
|
|
9
10
|
## How it works
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
Primary assignment happens during backlog grooming: the Product Owner creates issues and assigns each to the best-fit agent immediately. The auto-assign routine is a **safety net** that runs every 4 hours to catch anything that slipped through:
|
|
13
|
+
|
|
12
14
|
1. Are there unassigned issues in `todo` status?
|
|
13
|
-
2.
|
|
14
|
-
3. If
|
|
15
|
+
2. Do those issues have enough acceptance criteria and no unresolved blockers?
|
|
16
|
+
3. If yes: assign every suitable straggler to the best-fit available role in one pass — do not drip-feed one issue per routine run.
|
|
15
17
|
|
|
16
18
|
## Best for
|
|
17
19
|
|
|
18
|
-
-
|
|
20
|
+
- Catching assignment misses without relying on manual cleanup
|
|
19
21
|
- Any team size — works with one engineer or many
|
|
20
22
|
|
|
21
23
|
## Example
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
The Product Owner normally assigns issues at creation during backlog grooming. If one slips through unassigned, the safety-net routine assigns it on the next pass and the assignee wakes on the assignment trigger.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
## Auto-Assign Routine Fallback
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Primary assignment happens at backlog grooming — issues are assigned to the best-fit agent as they are created. This routine is a **safety net** that catches stragglers when the Product Owner hasn't acted.
|
|
4
|
+
|
|
5
|
+
Do not scan for unassigned work during a normal heartbeat. If you are assigned a routine-run issue titled like "Auto-assign unassigned issues" and no Product Owner is available, use `skills/auto-assign.md`, then summarize assignments on the routine issue and exit.
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
# Skill: Auto-Assign (Fallback)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Primary assignment happens at backlog grooming — issues are assigned to the best-fit agent as they are created. This routine is a **safety net** behind that primary path. You step in only if the PO is absent, stalled, or agents are critically idle.
|
|
4
4
|
|
|
5
5
|
## Assignment Check (Fallback)
|
|
6
6
|
|
|
7
7
|
On your heartbeat, after handling your own assignments:
|
|
8
8
|
|
|
9
|
-
1.
|
|
10
|
-
2.
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
9
|
+
1. Confirm this is the active routine-run issue and checkout it before mutating the board.
|
|
10
|
+
2. Query unassigned ready issues: `GET /api/companies/{companyId}/issues?status=todo` (filter for unassigned).
|
|
11
|
+
3. If unassigned issues are available AND the Product Owner hasn't acted recently:
|
|
12
|
+
- Assign every suitable still-unassigned issue to its best-fit available agent (an agent may hold a short queue): `PATCH /api/issues/{id}` with `assigneeAgentId` and an assignment comment.
|
|
13
|
+
- Clear stragglers in one pass instead of drip-feeding one issue per run.
|
|
14
|
+
4. If the Product Owner is active, skip this step.
|
|
15
|
+
5. Leave a routine-run comment summarizing assigned issue ids and skipped issue ids.
|
|
16
|
+
6. Mark the routine-run issue done when complete.
|
|
14
17
|
|
|
15
18
|
## Rules
|
|
16
19
|
|
|
17
|
-
- This is a safety net. Let the PO own assignment.
|
|
18
|
-
-
|
|
20
|
+
- This is a safety net behind backlog grooming's direct assignment. Let the PO own assignment.
|
|
21
|
+
- Clear stragglers in one pass instead of drip-feeding one issue per run.
|
|
22
|
+
- Do not run this from normal heartbeats.
|
|
23
|
+
- Do not self-assign random unassigned work.
|
|
24
|
+
- If no suitable match exists, leave the issue unassigned and state the reason in the routine-run comment.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
## Auto-Assign Routine
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Primary assignment happens at backlog grooming — issues are assigned to the best-fit agent as they are created, not through this routine. This routine is a **safety net** that catches stragglers every 4 hours.
|
|
4
|
+
|
|
5
|
+
Do not scan for unassigned work during a normal heartbeat. When you are assigned a routine-run issue titled like "Auto-assign unassigned issues", use `skills/auto-assign.md`, then summarize assignments on the routine issue and exit.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auto-assign",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "Safety net that assigns any still-unowned backlog items to available agents. Primary dispatch happens at backlog grooming (issues are assigned at creation); this low-frequency routine only catches stragglers.",
|
|
4
4
|
"permissions": [
|
|
5
5
|
"tasks:assign"
|
|
6
6
|
],
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"routines": [
|
|
18
18
|
{
|
|
19
19
|
"title": "Auto-assign unassigned issues",
|
|
20
|
-
"description": "
|
|
20
|
+
"description": "Safety-net routine-run checklist (primary assignment happens at backlog grooming, so this usually finds nothing): review any still-unassigned todo issues, assign each actionable item to its best-fit available agent based on role/workload — clear out all stragglers, not one at a time — record evidence and next actions on the routine issue, then exit.",
|
|
21
21
|
"assignTo": "capability:auto-assign",
|
|
22
|
-
"schedule": "0 */
|
|
22
|
+
"schedule": "0 */4 * * *",
|
|
23
23
|
"priority": "medium",
|
|
24
24
|
"concurrencyPolicy": "skip_if_active"
|
|
25
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Skill: Auto-Assign
|
|
2
2
|
|
|
3
|
-
You own issue assignment when you are explicitly assigned an auto-assignment routine run. This is not an every-heartbeat background scan.
|
|
3
|
+
You own issue assignment when you are explicitly assigned an auto-assignment routine run. This is a low-frequency **safety net** behind backlog grooming, which assigns issues at creation — so most runs find nothing to do. This is not an every-heartbeat background scan.
|
|
4
4
|
|
|
5
5
|
## When To Use This Skill
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ Use this only when the current assigned issue/routine is titled like "Auto-assig
|
|
|
13
13
|
3. Query candidate issues using the board's current issue API for unassigned `todo` work, scoped to the relevant project/goal when the routine has one.
|
|
14
14
|
4. Skip issues that are blocked, awaiting approval/review, missing acceptance criteria, or already have active execution state.
|
|
15
15
|
5. Match issue labels, required skills, project context, and priority to agent role/capabilities.
|
|
16
|
-
6. Assign
|
|
16
|
+
6. Assign every suitable still-unassigned issue to its best-fit available agent (an agent may hold a short queue): `PATCH /api/issues/{id}` with `assigneeAgentId` and an assignment comment explaining why. As a safety net, clear out all stragglers in one pass rather than dispatching one at a time.
|
|
17
17
|
7. Leave a routine-run comment summarizing assigned issue ids, skipped issue ids, and gaps needing Product Owner/CEO attention.
|
|
18
18
|
8. Mark the routine-run issue done when complete.
|
|
19
19
|
|
|
@@ -10,9 +10,9 @@ Goal → Roadmap → Issues → Assignment → Execution → Done
|
|
|
10
10
|
|
|
11
11
|
1. **Goal decomposition** — The backlog owner breaks the company goal into milestones, then milestones into actionable issues.
|
|
12
12
|
2. **Issue creation** — New issues enter the backlog via `POST /api/companies/{companyId}/issues` with `title`, `description`, `priority`, `projectId`, `goalId`, and `labelIds`. Top-level backlog issues must always include the active roadmap `projectId`.
|
|
13
|
-
3. **Pipeline health** — The backlog owner monitors
|
|
14
|
-
4. **Assignment** — Issues are
|
|
15
|
-
5. **Execution** — Agents check out assigned issues, work them, and
|
|
13
|
+
3. **Pipeline health** — The backlog owner monitors the ready assigned queue. When fewer than about 8 actionable ready issues remain across the active delivery roles, the next small batch is generated from the roadmap.
|
|
14
|
+
4. **Assignment** — Issues are assigned at creation to the best-fit owner. Engineering-ready issues go directly to the Software Engineer (or matching delivery role) so assignment wakeups start work immediately. Leave an issue unassigned only when no suitable owner exists.
|
|
15
|
+
5. **Execution** — Agents check out assigned issues, work them, and hand off deliberately for review or completion.
|
|
16
16
|
|
|
17
17
|
## Issue Quality
|
|
18
18
|
|
|
@@ -50,10 +50,10 @@ Re-prioritize when milestones shift or new information arrives. Don't let low-pr
|
|
|
50
50
|
|
|
51
51
|
## Backlog Health Indicators
|
|
52
52
|
|
|
53
|
-
- **Healthy**:
|
|
54
|
-
- **Thin**:
|
|
55
|
-
- **Empty**:
|
|
56
|
-
- **Bloated**: 20+
|
|
53
|
+
- **Healthy**: about 8 ready assigned issues across active delivery roles, covering the next logical chunk of work
|
|
54
|
+
- **Thin**: fewer than 4 ready assigned issues — generate and assign more soon
|
|
55
|
+
- **Empty**: no ready assigned issues — engineers will idle. Generate and assign immediately.
|
|
56
|
+
- **Bloated**: 20+ ready issues — stop creating, focus on prioritization and cleanup
|
|
57
57
|
|
|
58
58
|
## Coordination
|
|
59
59
|
|
|
@@ -36,7 +36,8 @@ Add more labels as the project evolves (e.g., `docs`, `design`, `security`). Pic
|
|
|
36
36
|
|
|
37
37
|
_Summary of current backlog health. Update on each heartbeat cycle._
|
|
38
38
|
|
|
39
|
-
- **
|
|
39
|
+
- **Ready assigned issues:** _(count by owner)_
|
|
40
|
+
- **Unassigned todo issues:** _(count; should normally be 0 except items without a suitable owner)_
|
|
40
41
|
- **In-progress issues:** _(count)_
|
|
41
42
|
- **Health:** _(healthy / thin / empty / bloated — see backlog-process.md)_
|
|
42
43
|
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"title": "Create roadmap and generate initial backlog",
|
|
17
17
|
"assignTo": "capability:backlog-health",
|
|
18
18
|
"priority": "high",
|
|
19
|
-
"description": "Review the company goal, create a ROADMAP.md with milestones, then generate an initial backlog of 15-20 actionable issues from it so the team has immediate, parallelizable work. Scope each issue to a single deliverable, set priorities, and link issues to the relevant goal and project. Don't wait for grooming cycles to fill the backlog — seed it now."
|
|
19
|
+
"description": "Review the company goal, create a ROADMAP.md with milestones, then generate an initial backlog of 15-20 actionable issues from it so the team has immediate, parallelizable work. Scope each issue to a single deliverable, set priorities, and link issues to the relevant goal and project. Assign each engineer-actionable issue to the best-fit agent (e.g., the Software Engineer) as you create it so work starts immediately — don't leave the seed backlog unassigned. Don't wait for grooming cycles to fill the backlog — seed it now."
|
|
20
20
|
}
|
|
21
21
|
],
|
|
22
22
|
"routines": [
|
|
23
23
|
{
|
|
24
24
|
"title": "Backlog grooming",
|
|
25
|
-
"description": "Routine-run checklist: inspect roadmap/backlog health, ensure at least 8 actionable ready issues exist, create scoped issues
|
|
25
|
+
"description": "Routine-run checklist: inspect roadmap/backlog health, ensure at least 8 actionable ready issues exist, create scoped issues (around 3-6 per pass) and assign each to its best-fit agent when capacity is low, link artifacts/goals/projects, summarize changes on the routine issue, then exit.",
|
|
26
26
|
"assignTo": "capability:backlog-health",
|
|
27
27
|
"schedule": "0 */4 * * *",
|
|
28
28
|
"priority": "medium",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
A good backlog health pass:
|
|
4
4
|
|
|
5
5
|
- Every issue created is INVEST-shaped: has a clear title, written acceptance criteria in the description, a priority, a label, and is attached to the correct `projectId` and `goalId` — never a top-level issue with `projectId: null`.
|
|
6
|
-
- The
|
|
6
|
+
- The team keeps a healthy queue of ready, **assigned** work (toward the grooming target of ~8 actionable ready issues); when the assigned ready queue runs low, new issues are created **and assigned** from the roadmap so no agent goes idle between grooming cycles, and the action is recorded in daily notes. Issues are assigned at creation — do not stockpile a pool of unassigned issues.
|
|
7
7
|
|
|
8
8
|
Not done:
|
|
9
9
|
|
|
@@ -28,10 +28,10 @@ Add additional labels if the roadmap calls for them (e.g., `docs`, `design`, `se
|
|
|
28
28
|
1. Checkout the assigned backlog/routine issue before mutating the board.
|
|
29
29
|
2. Read the current company goals, roadmap/project context, existing issue documents, and recent decision log entries.
|
|
30
30
|
3. Query existing issues for the relevant project/goal and avoid duplicates.
|
|
31
|
-
4. If the backlog is thin or unclear, create 3-
|
|
31
|
+
4. If the backlog is thin or unclear, create around 3-6 small actionable issues via `POST /api/companies/{companyId}/issues`.
|
|
32
32
|
5. Each issue must include: `title`, acceptance-oriented `description`, `priority`, `projectId`, `goalId` when known, and `labelIds`.
|
|
33
33
|
6. Use `blockedByIssueIds` for real dependencies instead of free-text blockers.
|
|
34
|
-
7.
|
|
34
|
+
7. Assign each issue to the best-fit available agent as you create it — engineer-actionable work with clear acceptance criteria goes to the Software Engineer (or the matching role). Direct push-assignment is the primary dispatch path; the assigned queue is the buffer, so do **not** stockpile a pool of unassigned ready work. Leave an issue unassigned only when no suitable owner exists — the low-frequency auto-assign safety net will catch those.
|
|
35
35
|
8. Record generated issue ids and rationale in the routine issue comment; use issue documents for long plans.
|
|
36
36
|
9. Mark the routine-run issue done when complete.
|
|
37
37
|
|
|
@@ -10,8 +10,8 @@ Enables the Engineer to work in a GitHub repository.
|
|
|
10
10
|
|
|
11
11
|
## Variants
|
|
12
12
|
|
|
13
|
-
- **direct-to-base-ref** (default): Engineer
|
|
14
|
-
- When combined with `pr-review` module: switches to feature-branch workflow
|
|
13
|
+
- **direct-to-base-ref** (default): Engineer works on a feature branch, then merges to the base branch and pushes. No PRs, no code review gate — the engineer merges their own work and hands off to the Product Owner for acceptance review via `in_review` status reassignment. Fast iteration for solo or small teams.
|
|
14
|
+
- When combined with `pr-review` module: switches to feature-branch + PR workflow with executionPolicy review stages and a non-author merge gate.
|
|
15
15
|
|
|
16
16
|
## Best for
|
|
17
17
|
|
|
@@ -21,4 +21,4 @@ Enables the Engineer to work in a GitHub repository.
|
|
|
21
21
|
|
|
22
22
|
## Example
|
|
23
23
|
|
|
24
|
-
A company building a web app with one engineer. The engineer picks up issues, implements them,
|
|
24
|
+
A company building a web app with one engineer. The engineer picks up issues, implements them on feature branches, merges to base, pushes, and reassigns to the Product Owner for acceptance review. CI runs on push.
|
|
@@ -4,15 +4,29 @@ You work in a GitHub repository. Follow the conventions in `docs/git-workflow.md
|
|
|
4
4
|
|
|
5
5
|
## Direct-to-Base-Ref Flow
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
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.
|
|
8
|
+
|
|
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
|
+
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
|
+
3. Pull/update latest from that base:
|
|
9
12
|
- external: `git fetch origin`, then integrate from the configured base ref
|
|
10
13
|
- local: update from the configured local branch
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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.
|
|
26
|
+
|
|
27
|
+
## When PR Review IS Active
|
|
28
|
+
|
|
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.
|
|
16
30
|
|
|
17
31
|
## Rules
|
|
18
32
|
|
|
@@ -20,8 +34,10 @@ You work in a GitHub repository. Follow the conventions in `docs/git-workflow.md
|
|
|
20
34
|
- Keep commits focused — one concern per commit.
|
|
21
35
|
- Never force push to the base branch.
|
|
22
36
|
- 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
|
+
- 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.
|
|
23
38
|
- If you encounter merge conflicts, resolve them carefully. When in doubt, escalate to the CEO.
|
|
24
39
|
- Reference the issue ID in the commit body (e.g., `Closes YES-5`).
|
|
25
|
-
- Never mark an issue as `done` unless at least one new commit was created for that issue's work and pushed.
|
|
40
|
+
- Never mark an issue as `done` unless at least one new commit was created for that issue's work and has been pushed.
|
|
26
41
|
- Before marking `done`, verify there is no uncommitted work (`git status --short` should be clean).
|
|
27
42
|
- 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.
|
|
@@ -33,8 +33,56 @@ directory inside the repository. This must never be committed.
|
|
|
33
33
|
- Committing `.paperclip/` pollutes history and can nest isolated worktrees inside the
|
|
34
34
|
repo, which causes confusing git state for every agent.
|
|
35
35
|
|
|
36
|
+
## GitHub Push Authentication
|
|
37
|
+
|
|
38
|
+
Paperclip injects the project secret `GH_TOKEN` into agent runs when the project env maps
|
|
39
|
+
`GH_TOKEN` to the secret. Git does not use that variable automatically, and some sandboxed
|
|
40
|
+
push subprocesses can drop environment variables exactly when Git asks its credential
|
|
41
|
+
helper for credentials. Every GitHub-backed project must install a repository-local
|
|
42
|
+
credential helper during foundation setup before the first push.
|
|
43
|
+
|
|
44
|
+
Run this from the primary project workspace, never from inside an issue worktree:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git_common_dir="$(git rev-parse --git-common-dir)"
|
|
48
|
+
helper="$git_common_dir/paperclip-gh-credential-helper.sh"
|
|
49
|
+
cache="$git_common_dir/paperclip-gh-token-cache"
|
|
50
|
+
|
|
51
|
+
cat > "$helper" <<'EOF'
|
|
52
|
+
#!/bin/sh
|
|
53
|
+
cache="$(dirname "$0")/paperclip-gh-token-cache"
|
|
54
|
+
if [ -n "$GH_TOKEN" ]; then
|
|
55
|
+
( umask 077; printf '%s' "$GH_TOKEN" > "$cache" ) 2>/dev/null
|
|
56
|
+
fi
|
|
57
|
+
if [ "$1" = "get" ]; then
|
|
58
|
+
token="$GH_TOKEN"
|
|
59
|
+
[ -z "$token" ] && [ -r "$cache" ] && token="$(cat "$cache" 2>/dev/null)"
|
|
60
|
+
[ -n "$token" ] && printf 'username=x-access-token\npassword=%s\n' "$token"
|
|
61
|
+
fi
|
|
62
|
+
exit 0
|
|
63
|
+
EOF
|
|
64
|
+
|
|
65
|
+
chmod 700 "$helper"
|
|
66
|
+
[ -n "$GH_TOKEN" ] && ( umask 077; printf '%s' "$GH_TOKEN" > "$cache" )
|
|
67
|
+
chmod 600 "$cache" 2>/dev/null || true
|
|
68
|
+
git config --local credential.helper "$helper"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Rules:
|
|
72
|
+
- Do not print, commit, or paste the token. The helper cache lives under Git's private
|
|
73
|
+
common directory, not in the worktree.
|
|
74
|
+
- If `GH_TOKEN` is empty during setup, stop and ask the CEO/board to bind a writable
|
|
75
|
+
GitHub token as the project secret before continuing.
|
|
76
|
+
- Re-run the setup after rotating the secret; the cache refreshes whenever `GH_TOKEN`
|
|
77
|
+
is present in a later agent run.
|
|
78
|
+
- Verify the helper without exposing the token: `git config --local --get credential.helper`
|
|
79
|
+
should print the helper path, and `test -s "$(git rev-parse --git-common-dir)/paperclip-gh-token-cache"`
|
|
80
|
+
should succeed after a run where `GH_TOKEN` was injected.
|
|
81
|
+
|
|
36
82
|
## Direct-to-Base-Ref Workflow
|
|
37
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.
|
|
85
|
+
|
|
38
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/*`.
|
|
39
87
|
- External repos: use the project/worktree `repoRef`, `defaultRef`, or `executionWorkspacePolicy.workspaceStrategy.baseRef` exactly as configured.
|
|
40
88
|
- Fresh/local repos: use the configured local branch.
|
|
@@ -43,8 +91,17 @@ directory inside the repository. This must never be committed.
|
|
|
43
91
|
3. Make changes
|
|
44
92
|
4. Run tests/linting locally if available
|
|
45
93
|
5. Commit with conventional commit message
|
|
46
|
-
6. Push
|
|
47
|
-
7.
|
|
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.
|
|
48
105
|
|
|
49
106
|
## Resolving the default branch
|
|
50
107
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"priority": "critical",
|
|
10
10
|
"bootstrapPhase": "foundation",
|
|
11
11
|
"labels": ["chore"],
|
|
12
|
-
"description": "Foundation setup: handle this before normal implementation issues. For a fresh repository, create the GitHub repository, initialize the local workspace with a README or bootstrap commit, add origin, push the default branch (`main` for a fresh repo), and record the repository URL. For an existing repository, verify the workspace has a reachable remote and a starter commit state, then determine the repository's default branch and confirm it is recorded as the project workspace `defaultRef`/`repoRef` so isolated worktrees branch from the correct base. The default branch is whatever `origin/HEAD` points at — name-agnostic (`main`, `master`, `trunk`, etc.); use it exactly as the remote advertises it (`git ls-remote --symref origin HEAD`). Only if the remote advertises no default HEAD, fall back to `main`, then `master`. Never assume `main` for an existing repo. Escalate to CEO if repo setup is missing instead of silently closing the issue. Before the first commit, ensure the repository's `.gitignore` ignores Paperclip's local state — add a `.paperclip/` entry (this is where Paperclip keeps per-issue git worktrees and workspace metadata inside the repo; committing it pollutes history and can nest worktrees inside the repo). Create `.gitignore` if it is missing. Branch protection is tracked separately by the pr-review module when that workflow is enabled."
|
|
12
|
+
"description": "Foundation setup: handle this before normal implementation issues. For a fresh repository, create the GitHub repository, initialize the local workspace with a README or bootstrap commit, add origin, push the default branch (`main` for a fresh repo), and record the repository URL. For an existing repository, verify the workspace has a reachable remote and a starter commit state, then determine the repository's default branch and confirm it is recorded as the project workspace `defaultRef`/`repoRef` so isolated worktrees branch from the correct base. The default branch is whatever `origin/HEAD` points at — name-agnostic (`main`, `master`, `trunk`, etc.); use it exactly as the remote advertises it (`git ls-remote --symref origin HEAD`). Only if the remote advertises no default HEAD, fall back to `main`, then `master`. Never assume `main` for an existing repo. Install the Paperclip GitHub credential helper from `docs/git-workflow.md` before the first push so `git push` uses the injected `GH_TOKEN` project secret even when sandboxed subprocesses strip environment variables at credential-lookup time. Escalate to CEO if repo setup or `GH_TOKEN` is missing instead of silently closing the issue. Before the first commit, ensure the repository's `.gitignore` ignores Paperclip's local state — add a `.paperclip/` entry (this is where Paperclip keeps per-issue git worktrees and workspace metadata inside the repo; committing it pollutes history and can nest worktrees inside the repo). Create `.gitignore` if it is missing. Branch protection is tracked separately by the pr-review module when that workflow is enabled."
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
}
|
|
@@ -11,6 +11,7 @@ You implement coding tasks end-to-end: write and edit code, debug issues, add fo
|
|
|
11
11
|
## Working Rules
|
|
12
12
|
|
|
13
13
|
- Work only on issues assigned to you or explicitly handed to you in comments.
|
|
14
|
+
- If you have no assigned actionable work and there are unassigned `todo` issues that clearly match engineering, claim the highest-priority ready issue yourself, set it `in_progress`, and start in the same heartbeat. This is a fallback behind Product Owner push-assignment, not permission to reshuffle work owned by others.
|
|
14
15
|
- Start actionable work in the same heartbeat; do not stop at a plan unless planning was requested. Leave durable progress with a clear next action. Use child issues for long or parallel delegated work instead of polling. Mark blocked work with owner and action. Respect budget, pause/cancel, approval gates, and company boundaries.
|
|
15
16
|
- Make sure you know the success condition for each task. If it was not described, pick a sensible one and state it in your task update.
|
|
16
17
|
- Run the smallest verification that proves the change. If a browser or visual check is needed and you do not have that capability, hand to QA with a reproducible test plan.
|
|
@@ -19,6 +20,7 @@ You implement coding tasks end-to-end: write and edit code, debug issues, add fo
|
|
|
19
20
|
|
|
20
21
|
## Collaboration and Handoffs
|
|
21
22
|
|
|
23
|
+
- If the PR-review module or an issue `executionPolicy` is active, follow that review/approval flow exactly. Otherwise, when implementation is ready for review, move the issue to `in_review`, assign it to the Product Owner in the same heartbeat, and leave a comment with the change summary, verification, branch/commit details, and any risks. Never leave finished work in `in_review` assigned to yourself.
|
|
22
24
|
- UX-facing changes -> route to the UI/UX designer for visual quality and flow review.
|
|
23
25
|
- Security-sensitive changes (auth, crypto, secrets, permissions, adapter/tool access) -> route to the Security Engineer before merge.
|
|
24
26
|
- Browser validation or user-facing verification -> route to QA with exact steps and expected results.
|
|
@@ -35,7 +35,7 @@ Run this checklist on every heartbeat. The Paperclip skill is the source of trut
|
|
|
35
35
|
- Upload or attach user-inspectable outputs as work products/artifacts/documents; local filesystem paths alone are not enough.
|
|
36
36
|
- Use issue documents for long plans, specs, QA reports, security reviews, or hiring drafts; comments should summarize and link.
|
|
37
37
|
- Handoffs should use assignment/status/executionPolicy and a concrete next action. Do not rely on generic @-mentions.
|
|
38
|
-
- If work awaits review, move the issue to `in_review`
|
|
38
|
+
- If work awaits review, move the issue to `in_review`. When no executionPolicy is active, reassign to the Product Owner for acceptance review — never leave finished work in `in_review` assigned to yourself. When an executionPolicy is active, follow its review/approval stages.
|
|
39
39
|
|
|
40
40
|
## 6. Exit
|
|
41
41
|
|
|
@@ -9,6 +9,7 @@ You own product intent, backlog health, acceptance criteria, prioritization, and
|
|
|
9
9
|
## Working Rules
|
|
10
10
|
|
|
11
11
|
- Work only on issues assigned to you or explicitly handed to you in comments.
|
|
12
|
+
- If an issue is assigned to you in `in_review` and no formal executionPolicy participant is waiting, review it immediately against the acceptance criteria, branch/commit/PR evidence, and recorded verification. If it passes, comment with the acceptance decision and set it `done`; if it does not pass, set it back to `in_progress`, assign it to the Engineer, and list the exact required changes.
|
|
12
13
|
- Start actionable work in the same heartbeat; do not stop at a plan unless planning was requested. Leave durable progress with a clear next action. Use child issues for long or parallel delegated work instead of polling. Mark blocked work with owner and action. Respect budget, pause/cancel, approval gates, and company boundaries.
|
|
13
14
|
- Keep issues small, acceptance-driven, project-scoped, and linked to goals when available.
|
|
14
15
|
- Use first-class blockers (`blockedByIssueIds`) for dependencies instead of free-text "blocked by" notes.
|
|
@@ -18,7 +19,7 @@ You own product intent, backlog health, acceptance criteria, prioritization, and
|
|
|
18
19
|
## Collaboration and Handoffs
|
|
19
20
|
|
|
20
21
|
- Product ambiguity -> clarify options and recommend one.
|
|
21
|
-
- Engineering implementation -> assign the Engineer with acceptance criteria and project/goal context.
|
|
22
|
+
- Engineering implementation -> assign the Engineer directly with acceptance criteria and project/goal context. Do not leave ready engineering work unassigned for a later sweep.
|
|
22
23
|
- UX-visible scope -> involve the UI/UX designer.
|
|
23
24
|
- Security-sensitive scope -> involve the Security Engineer.
|
|
24
25
|
- Browser/user-facing verification -> involve QA.
|
|
@@ -35,7 +35,7 @@ Run this checklist on every heartbeat. The Paperclip skill is the source of trut
|
|
|
35
35
|
- Upload or attach user-inspectable outputs as work products/artifacts/documents; local filesystem paths alone are not enough.
|
|
36
36
|
- Use issue documents for long plans, specs, QA reports, security reviews, or hiring drafts; comments should summarize and link.
|
|
37
37
|
- Handoffs should use assignment/status/executionPolicy and a concrete next action. Do not rely on generic @-mentions.
|
|
38
|
-
- If
|
|
38
|
+
- If an issue is assigned to you in `in_review` and no formal executionPolicy participant is waiting, review it immediately against the acceptance criteria. If it passes, comment with the acceptance decision and set it `done`; if it does not pass, set it back to `in_progress`, assign it to the Engineer, and list the exact required changes.
|
|
39
39
|
|
|
40
40
|
## 6. Exit
|
|
41
41
|
|