@jaybeeuu/agent-cortex 1.37.1 → 1.39.0
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/.agents/skills/style-versioning/SKILL.md +9 -8
- package/.github/workflows/ci.yml +190 -8
- package/AGENTS.md +27 -6
- package/CHANGELOG.md +72 -0
- package/README.md +156 -39
- package/agents/README.md +49 -13
- package/agents/plan/agent.md +51 -0
- package/agents/plan/claude/frontmatter.json +6 -0
- package/agents/plan/copilot/frontmatter.json +6 -0
- package/agents/plan/pi/frontmatter.json +6 -0
- package/agents/plan.agent.md +3 -0
- package/agents/ralph/agent.md +262 -0
- package/agents/ralph/claude/frontmatter.json +6 -0
- package/agents/ralph/claude/polling.md +31 -0
- package/agents/ralph/copilot/frontmatter.json +6 -0
- package/agents/ralph/copilot/polling.md +62 -0
- package/agents/ralph/pi/frontmatter.json +6 -0
- package/agents/ralph/pi/polling.md +74 -0
- package/agents/ralph-plan/agent.md +114 -0
- package/agents/ralph-plan/claude/frontmatter.json +6 -0
- package/agents/ralph-plan/copilot/frontmatter.json +6 -0
- package/agents/ralph-plan/pi/frontmatter.json +6 -0
- package/agents/ralph-plan.agent.md +6 -3
- package/agents/ralph.agent.md +83 -57
- package/agents/strategy/agent.md +104 -0
- package/agents/strategy/claude/frontmatter.json +6 -0
- package/agents/strategy/copilot/frontmatter.json +6 -0
- package/agents/strategy/pi/frontmatter.json +6 -0
- package/agents/strategy.agent.md +3 -0
- package/bin/agent-cortex.mjs +76 -1
- package/bin/installers/claude.mjs +376 -0
- package/bin/installers/copilot.mjs +129 -0
- package/bin/installers/pi.mjs +197 -0
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/agents/plan.md +3 -1
- package/claude/agents/ralph-plan.md +6 -4
- package/claude/agents/strategy.md +3 -1
- package/claude/hooks/scripts/notify.mjs +54 -0
- package/claude/hooks.json +15 -0
- package/docs/claude-hooks.md +115 -0
- package/docs/ideas/auto-model-selection.md +75 -0
- package/docs/ideas/extension-manifests.md +75 -0
- package/docs/ideas/improve-pi-system-prompt.md +34 -0
- package/docs/ideas/model-selector.md +40 -0
- package/docs/ideas/pi-task-memory.md +34 -0
- package/docs/ideas/qa-extension.md +43 -0
- package/docs/ideas/record-ideas-as-beads.md +115 -0
- package/docs/ideas/subagent-visibility.md +72 -0
- package/docs/ideas/task-session-context.md +89 -0
- package/docs/ideas/unified-ci-pipeline.md +28 -0
- package/docs/research/skill-design-research.md +4 -4
- package/docs/research/skill-improvements-analysis.md +1 -1
- package/docs/skills/skill-anatomy.md +47 -2
- package/docs/technical-direction/migration-execution-labels.md +132 -0
- package/extensions/agent-modes/README.md +54 -0
- package/extensions/agent-modes/discover.test.ts +241 -0
- package/extensions/agent-modes/discover.ts +458 -0
- package/extensions/agent-modes/index.ts +13 -224
- package/extensions/agent-modes/node_modules/.bin/pi +21 -0
- package/extensions/agent-modes/node_modules/.bin/tsc +21 -0
- package/extensions/agent-modes/node_modules/.bin/tsserver +21 -0
- package/extensions/agent-modes/node_modules/.bin/tsx +21 -0
- package/extensions/agent-modes/package.json +20 -0
- package/extensions/agent-modes/tsconfig.json +12 -0
- package/extensions/subagent/README.md +19 -0
- package/extensions/subagent/index.ts +131 -45
- package/extensions/subagent/node_modules/.bin/pi +21 -0
- package/extensions/subagent/node_modules/.bin/pi-ai +21 -0
- package/extensions/subagent/node_modules/.bin/tsc +21 -0
- package/extensions/subagent/node_modules/.bin/tsserver +21 -0
- package/extensions/subagent/node_modules/.bin/tsx +21 -0
- package/extensions/subagent/package.json +23 -0
- package/extensions/subagent/tsconfig.json +12 -0
- package/extensions/subagent/wait.test.ts +202 -0
- package/extensions/subagent/wait.ts +118 -0
- package/hooks/claude/hooks.json +38 -0
- package/hooks/claude/scripts/notify.mjs +54 -0
- package/lib/cli.mjs +68 -3
- package/package.json +6 -4
- package/plugin.json +1 -1
- package/pnpm-workspace.yaml +1 -1
- package/scripts/build-copilot-agents.mjs +30 -0
- package/scripts/lib/compose-agent.mjs +241 -0
- package/skills/engineering/design-an-interface/SKILL.md +78 -58
- package/skills/engineering/grill-with-docs/REFERENCE.md +78 -0
- package/skills/engineering/grill-with-docs/SKILL.md +66 -63
- package/skills/engineering/improve-codebase-architecture/SKILL.md +66 -48
- package/skills/engineering/technical-direction/FORMAT.md +38 -0
- package/skills/engineering/technical-direction/SKILL.md +70 -77
- package/skills/planning/classify-bead/SKILL.md +59 -35
- package/skills/planning/create-task/REFERENCE.md +40 -0
- package/skills/planning/create-task/SKILL.md +70 -66
- package/skills/planning/create-task/scripts/create-chores.ts +6 -1
- package/skills/planning/create-task/scripts/node_modules/.bin/tsc +21 -0
- package/skills/planning/create-task/scripts/node_modules/.bin/tsserver +21 -0
- package/skills/planning/create-task/scripts/node_modules/.bin/tsx +21 -0
- package/skills/planning/prd-to-tasks/REFERENCE.md +66 -0
- package/skills/planning/prd-to-tasks/SKILL.md +86 -170
- package/skills/planning/record-idea/FORMAT.md +44 -0
- package/skills/planning/record-idea/SKILL.md +70 -53
- package/skills/planning/request-refactor-plan/FORMAT.md +45 -0
- package/skills/planning/request-refactor-plan/SKILL.md +57 -46
- package/skills/planning/write-a-prd/FORMAT.md +54 -0
- package/skills/planning/write-a-prd/SKILL.md +49 -48
- package/skills/planning/write-a-ticket/SKILL.md +68 -53
- package/skills/productivity/handoff/SKILL.md +12 -0
- package/skills/productivity/init-beads/SKILL.md +48 -40
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsc +21 -0
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsserver +21 -0
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsx +21 -0
- package/skills/productivity/write-a-skill/SKILL.md +2 -1
- package/skills/review/maintain-agent-docs/SKILL.md +71 -51
- package/skills/workflow/hitl-collab/SKILL.md +86 -17
- package/skills/workflow/ralph/REFERENCE.md +24 -19
- package/skills/workflow/ralph/SKILL.md +88 -74
- package/skills/workflow/run-pipeline-stage/REFERENCE.md +22 -0
- package/skills/workflow/run-pipeline-stage/SKILL.md +91 -93
- package/skills/workflow/run-pipeline-stage/scripts/generate-progress.test.ts +6 -107
- package/skills/workflow/run-pipeline-stage/scripts/generate-progress.ts +4 -2
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsc +21 -0
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsserver +21 -0
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsx +21 -0
- package/skills/workflow/using-agent-skills/SKILL.md +122 -0
- package/test/claude-installer.test.mjs +248 -0
- package/test/cli.test.mjs +115 -2
- package/test/copilot-installer.test.mjs +298 -0
- package/test/installer.test.mjs +179 -0
- package/test/notify-hook.test.mjs +63 -0
- package/test/pi-installer.test.mjs +371 -0
- package/token-map.README.md +130 -0
- package/token-map.json +106 -0
- package/.github/workflows/ci.test.ts +0 -217
- package/.github/workflows/release.yml +0 -58
- package/scripts/build-claude-agents.mjs +0 -179
- package/scripts/publish-release.sh +0 -32
|
@@ -5,63 +5,87 @@ description: Classify a bead as AFK or HITL and apply the implementation-type la
|
|
|
5
5
|
|
|
6
6
|
# Classify Bead
|
|
7
7
|
|
|
8
|
-
Determine whether a bead requires human action (HITL) or can be completed autonomously by an agent (AFK), then persist the result as
|
|
8
|
+
Determine whether a bead requires human action (HITL) or can be completed autonomously by an agent (AFK), then persist the result as an `implementation-type` label.
|
|
9
9
|
|
|
10
10
|
## When to use
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
12
|
+
- A bead is missing its `implementation-type` label and you are about to pick it up.
|
|
13
|
+
- A skill has just created a new bead and needs it classified before claiming or scheduling.
|
|
14
|
+
- You are unsure of a bead's classification and want to resolve it deterministically.
|
|
15
|
+
|
|
16
|
+
## When NOT to use
|
|
17
|
+
|
|
18
|
+
- The bead already carries an `implementation-type` label — check `bd label list <id>` before invoking, and never re-classify a labelled bead.
|
|
19
|
+
- You are creating a new task — `create-task` classifies internally; do not spawn this skill separately.
|
|
20
|
+
- The work item is not a bead (e.g. a Jira ticket or plain code task) — use `write-a-ticket` or start the work directly.
|
|
15
21
|
|
|
16
22
|
## Invocation
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
Run this skill as a background subagent via {{TOOL:task}} so bead content never loads into the calling agent's context. Classification is a rubric lookup, not code generation — a small, cheap model is sufficient. Pass the bead ID and the `bd prime` output; the subagent runs the workflow below and reports back the classification plus the `bd tag` command it applied.
|
|
25
|
+
|
|
26
|
+
Only run inline when no task-spawning capability exists in the current environment.
|
|
27
|
+
|
|
28
|
+
**Callers should check `bd label list <id>` themselves first.** If `implementation-type` is already present, skip spawning this skill entirely — spawning a subagent purely to re-read a label that already exists wastes a full agent call.
|
|
29
|
+
|
|
30
|
+
## Workflow
|
|
31
|
+
|
|
32
|
+
1. **Check for an existing label.**
|
|
19
33
|
|
|
20
|
-
|
|
34
|
+
```bash
|
|
35
|
+
bd label list <id>
|
|
36
|
+
```
|
|
21
37
|
|
|
22
|
-
|
|
38
|
+
- `implementation-type:afk` present → classification is **AFK**. Stop here.
|
|
39
|
+
- `implementation-type:hitl` present → classification is **HITL**. Stop here.
|
|
23
40
|
|
|
24
|
-
|
|
41
|
+
2. **Check the `## Type` field (back-compat).**
|
|
25
42
|
|
|
26
|
-
|
|
43
|
+
```bash
|
|
44
|
+
bd show <id>
|
|
45
|
+
```
|
|
27
46
|
|
|
28
|
-
|
|
29
|
-
bd label list <id>
|
|
30
|
-
```
|
|
47
|
+
Locate the `## Type` section in the bead body. `HITL` or `AFK` (case-insensitive) determines the classification; continue to step 4. This field predates the label system, so treat it as authoritative when present.
|
|
31
48
|
|
|
32
|
-
|
|
33
|
-
- If `implementation-type:hitl` is present → classification is **HITL**. Stop here.
|
|
49
|
+
3. **Classify from first principles** — only when neither the label nor the `## Type` field is present. Read the full bead body and apply the rubric:
|
|
34
50
|
|
|
35
|
-
|
|
51
|
+
**HITL** — the bead requires a human if at least one of the following is true:
|
|
52
|
+
- The outcome cannot be verified by an agent (e.g. visual review, stakeholder sign-off, UX judgement call).
|
|
53
|
+
- A manual action only a human can perform is required (e.g. credential setup, secrets management, external service configuration, infrastructure provisioning outside the codebase).
|
|
54
|
+
- A decision must be made that the agent cannot make unilaterally (e.g. architectural choice between equally valid options, regulatory or legal sign-off).
|
|
36
55
|
|
|
37
|
-
|
|
38
|
-
bd show <id>
|
|
39
|
-
```
|
|
56
|
+
**AFK** — the agent can implement, verify, and complete the task autonomously, and all acceptance criteria are machine-checkable.
|
|
40
57
|
|
|
41
|
-
|
|
58
|
+
4. **Apply the label.**
|
|
42
59
|
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
```bash
|
|
61
|
+
bd tag <id> implementation-type:afk # or implementation-type:hitl
|
|
62
|
+
```
|
|
45
63
|
|
|
46
|
-
|
|
64
|
+
5. **Return the classification.** Report `AFK` or `HITL` so the calling skill or agent can act on it.
|
|
47
65
|
|
|
48
|
-
|
|
66
|
+
## Red Flags
|
|
49
67
|
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
- A decision must be made that the agent cannot make unilaterally (e.g. architectural choice between equally valid options, regulatory or legal sign-off).
|
|
68
|
+
- Classifying a bead without the caller-side `bd label list` check — you either overwrite a recorded decision or waste an agent spawn re-reading a label that already exists.
|
|
69
|
+
- Defaulting to HITL for a complex task whose acceptance criteria are machine-checkable — complexity alone is not a criterion.
|
|
70
|
+
- Choosing a class without reading the bead body when neither the label nor `## Type` is present.
|
|
54
71
|
|
|
55
|
-
|
|
72
|
+
## Common Rationalizations
|
|
56
73
|
|
|
57
|
-
|
|
74
|
+
| Rationalization | Rebuttal |
|
|
75
|
+
|---|---|
|
|
76
|
+
| "This task is complex, so it must be HITL" | Complexity is not a criterion. HITL applies only when a human is genuinely required to complete or verify. |
|
|
77
|
+
| "I'll mark it HITL to be safe" | HITL consumes scarce human attention. Prefer AFK — ralph's review gates still catch agent mistakes. |
|
|
78
|
+
| "The label is probably already there, I'll skip the check" | One `bd label list` command settles it. Skipping it either overwrites a decision or spawns an agent to re-read a label. |
|
|
58
79
|
|
|
59
|
-
|
|
80
|
+
## Philosophy / rationale
|
|
60
81
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```
|
|
82
|
+
- Classification gates automation against human attention: AFK beads feed ralph's autonomous pipeline, HITL beads are routed to a person. We prefer AFK because human time is the scarce resource, and later review gates still catch agent mistakes — escalate only when completion or verification genuinely requires a human.
|
|
83
|
+
- The rubric is deterministic, so this skill is a lookup rather than deep reasoning — which is why a cheap subagent suffices and the step 1 early exit exists.
|
|
64
84
|
|
|
65
|
-
|
|
85
|
+
## Verification checklist
|
|
66
86
|
|
|
67
|
-
|
|
87
|
+
- [ ] `bd label list <id>` was checked before any other step.
|
|
88
|
+
- [ ] Classification followed the precedence order: existing label → `## Type` → first-principles rubric.
|
|
89
|
+
- [ ] The full bead body was read before classifying from first principles (step 3).
|
|
90
|
+
- [ ] `bd tag <id> implementation-type:<afk|hitl>` was applied.
|
|
91
|
+
- [ ] The calling skill or agent received the classification in the report.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Create Task — Reference
|
|
2
|
+
|
|
3
|
+
Detail behind `skills/planning/create-task/SKILL.md`. The script (`scripts/create-chores.ts`) is the source of truth for this contract; this document mirrors it for verification.
|
|
4
|
+
|
|
5
|
+
## Script invocation
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
tsx create-chores.ts --parent <bead-id> [--priority <0-4>]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- Reads `<skill>/pipeline.json`; creates each stage chore via `bd create` and wires dependencies via `bd dep add`.
|
|
12
|
+
- Prints a JSON object mapping each stage ID to its chore bead ID, plus `featurePrReview` for the PR gate.
|
|
13
|
+
|
|
14
|
+
## Stage chore beads
|
|
15
|
+
|
|
16
|
+
One per stage in `pipeline.json` (currently `code`, `verify`, `review`, `document`):
|
|
17
|
+
|
|
18
|
+
- **Type**: `chore`
|
|
19
|
+
- **Title**: `[<parent-id>] <stage title>` (e.g. `[abc-123] Code`)
|
|
20
|
+
- **Labels**: `stage:<id>` (e.g. `stage:code`, `stage:verify`)
|
|
21
|
+
- **Dependencies**: `parent-child` to the parent bead; `blocks` between stages per each stage's `dependsOn` (the script requires `dependsOn` targets to appear earlier in `pipeline.json`).
|
|
22
|
+
|
|
23
|
+
## PR gate bead (`featurePrReview`)
|
|
24
|
+
|
|
25
|
+
- **Type**: `task`
|
|
26
|
+
- **Title**: `[<parent-id>] PR Review and Merge`
|
|
27
|
+
- **Labels**: `implementation-type:hitl`, `lifecycle:feature-pr`
|
|
28
|
+
- **Dependencies**: `parent-child` to the parent bead; `blocks` on the final document stage chore (`document`, falling back to the last stage in `pipeline.json`).
|
|
29
|
+
- **Purpose**: human review of the agent PR (agent branch → feature branch) before the feature closes.
|
|
30
|
+
|
|
31
|
+
## Current pipeline stages
|
|
32
|
+
|
|
33
|
+
| id | title | dependsOn |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| code | Code | — |
|
|
36
|
+
| verify | Verify | code |
|
|
37
|
+
| review | Review | verify |
|
|
38
|
+
| document | Document | review |
|
|
39
|
+
|
|
40
|
+
`maxFixRounds: 4` — the maximum fix-retry rounds allowed for a stage's verify loop before the PR gate. Adjust stages only in `pipeline.json`; the script and templates follow it.
|
|
@@ -1,96 +1,100 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-task
|
|
3
|
-
description: Create a bead, classify it, and if AFK expand it into pipeline stage
|
|
3
|
+
description: Create a task bead, classify it as AFK or HITL, and if AFK expand it into pipeline stage chores plus a HITL PR gate. Use when starting tracked work with implementation and review gates — "create a task for this", "track this end-to-end", or "get this into the ralph pipeline".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Create Task
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Turn a piece of work into a tracked bead, classify it for autonomous (AFK) or human-in-the-loop (HITL) execution, and — when AFK — expand it into the standard pipeline: one chore bead per stage plus a HITL PR gate task so a human always reviews the finished branch. Parameters: `title` (required), `description` (required), `priority` (0–3, default 2), `parent` (epic bead ID, optional — sets a `parent-child` dependency).
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## When to use
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
| title | yes | Task title |
|
|
15
|
-
| description | yes | Task description |
|
|
16
|
-
| priority | no | 0–3 (default 2) |
|
|
17
|
-
| parent | no | Parent bead ID for `parent-child` dep |
|
|
12
|
+
- Starting new tracked work that must move through implementation, verification, and review gates — user phrases like "create a task for this", "track this work end-to-end", or "get this into the ralph pipeline".
|
|
13
|
+
- A caller (`prd-to-tasks`, `ralph-plan`) needs one task bead with the full child-chore structure.
|
|
18
14
|
|
|
19
|
-
##
|
|
15
|
+
## When NOT to use
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
- Work that is only a raw idea, not ready to build — use `record-idea`.
|
|
18
|
+
- A feature that needs specification first — use `write-a-prd`, or `prd-to-tasks` to break an approved PRD into epics and tasks (`prd-to-tasks` calls this skill per task itself).
|
|
19
|
+
- A ticket for an external issue tracker aimed at human engineers — use `write-a-ticket`.
|
|
20
|
+
- A refactor that needs an incremental migration plan — use `request-refactor-plan`.
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
bd create "<title>" --description "<description>" --priority <priority>
|
|
25
|
-
```
|
|
22
|
+
## Workflow
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
1. **Create the parent bead.**
|
|
28
25
|
|
|
29
|
-
```bash
|
|
30
|
-
bd
|
|
31
|
-
```
|
|
26
|
+
```bash
|
|
27
|
+
bd create "<title>" --description "<description>" --priority <priority>
|
|
28
|
+
```
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
If a `parent` epic was provided, record the dependency:
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
```bash
|
|
33
|
+
bd dep add <new-id> <parent> --type parent-child
|
|
34
|
+
```
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
2. **Check for an existing classification label.** Run `bd label list <id>`. If `implementation-type` is already present, skip step 3 — re-classifying a labelled bead wastes a subagent call.
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
3. **Classify the bead.** Delegate to the `classify-bead` skill as a subagent via {{TOOL:task}} — do not classify inline. It returns `AFK` or `HITL` and applies the `implementation-type` label.
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
4. **Branch on classification.**
|
|
41
|
+
- **HITL** — stop here. Report the bead ID and classification to the caller. Do not create pipeline chores: a human drives the work, so the chore tree does not apply.
|
|
42
|
+
- **AFK** — continue to step 5.
|
|
42
43
|
|
|
43
|
-
**
|
|
44
|
+
5. **Expand into pipeline stage chores.** Run the `create-chores` script, which reads this skill's `pipeline.json` and deterministically creates all stage chores plus the PR gate bead in one shot:
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
```bash
|
|
47
|
+
# Run from the TARGET project's directory — bd resolves its beads DB from cwd;
|
|
48
|
+
# the skill's own location or `pnpm --prefix <scripts>` would target the wrong tree.
|
|
49
|
+
<skill-scripts>/node_modules/.bin/tsx \
|
|
50
|
+
<skill-scripts>/create-chores.ts \
|
|
51
|
+
--parent <parent-id> [--priority <priority>]
|
|
52
|
+
```
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
stage chores in one shot. They are plain (non-ephemeral) chores — `bd ready` must surface
|
|
49
|
-
them without `--include-ephemeral` for ralph to discover them:
|
|
54
|
+
`<skill-scripts>` is the absolute path to this skill's own `scripts/` directory, resolved from wherever this skill was loaded — it varies by harness and install location, so never hardcode one harness's path.
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
```
|
|
56
|
+
6. **Report.** Return the parent bead ID, the classification (`AFK`), and the created child bead IDs from the script output (including `featurePrReview`).
|
|
57
|
+
|
|
58
|
+
## Red Flags
|
|
59
|
+
|
|
60
|
+
- **Running the script from the wrong directory.** Chores land in whatever `.beads` tree `bd` resolves from cwd — the target project's root is the only safe cwd.
|
|
61
|
+
- **Classifying inline.** The `classify-bead` rubric is a subagent's job (with a label short-circuit); inlining yours means re-reading bead content and drifting from the rubric.
|
|
62
|
+
- **Expanding an HITL bead.** If classification is HITL, stop — creating a chore tree for human-driven work is wrong.
|
|
63
|
+
- **Hardcoding `<skill-scripts>`.** The install path differs per harness (plugin cache, installed-plugins, dev checkout); resolve it at runtime.
|
|
64
|
+
|
|
65
|
+
## Common Rationalizations
|
|
62
66
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
| Rationalization | Rebuttal |
|
|
68
|
+
|---|---|
|
|
69
|
+
| "I know this task is AFK — I'll skip the classify-bead call" | Classification is a rubric check against the full bead body; assumptions masked by familiarity cause mislabelled work to hit the wrong queue. |
|
|
70
|
+
| "I'll create the chores by hand instead of running the script" | The script is the single source of truth for titles, labels, dep chains, and the PR gate. Hand-created chores drift silently. |
|
|
71
|
+
| "The pipeline is overkill for this small task" | If the work is worth tracking at all, the stage chore tree is what lets ralph execute and gate it. Not ready for that? Use `record-idea`. |
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+
## Philosophy / rationale
|
|
74
|
+
|
|
75
|
+
- **The script owns the expansion contract.** Pipeline stages, titles, labels, dependency chains, and the PR gate are deterministic — a one-shot script keeps every chore identical to the contract and reproducible across runs.
|
|
76
|
+
- **The PR gate is a hard human checkpoint.** Every AFK task ends with a `featurePrReview` task that blocks the final document stage, so automated work never merges without a human reviewing the branch.
|
|
77
|
+
|
|
78
|
+
## Cross-skill references
|
|
79
|
+
|
|
80
|
+
- `classify-bead` — classify the new bead via subagent (step 3).
|
|
81
|
+
|
|
82
|
+
## Examples
|
|
83
|
+
|
|
84
|
+
Input: title `Add export API to invoices`, description `…`, priority `2`, parent `epic-456`. Output: the parent bead ID plus the script's JSON mapping stage IDs → chore bead IDs, with `featurePrReview` as the HITL PR gate:
|
|
70
85
|
|
|
71
86
|
```json
|
|
72
|
-
{
|
|
73
|
-
"code": "abc123",
|
|
74
|
-
"verify": "def456",
|
|
75
|
-
"review": "ghi789",
|
|
76
|
-
"document": "jkl012",
|
|
77
|
-
"featurePrReview": "bd-mno345"
|
|
78
|
-
}
|
|
87
|
+
{"code": "abc123", "verify": "def456", "review": "ghi789", "document": "jkl012", "featurePrReview": "bd-mno345"}
|
|
79
88
|
```
|
|
80
89
|
|
|
81
|
-
|
|
82
|
-
- **type**: `chore`
|
|
83
|
-
- **Title pattern**: `[<parent-id>] <stage title>` (e.g. `[abc-123] Code`)
|
|
84
|
-
- **Labels**: `stage:<id>` (e.g. `stage:code`, `stage:verify`)
|
|
85
|
-
- **Dependencies**: `parent-child` to parent bead; `blocks` between stages per `dependsOn`
|
|
86
|
-
|
|
87
|
-
The PR gate bead is created with:
|
|
88
|
-
- **type**: `task`
|
|
89
|
-
- **Title**: `[<parent-id>] PR Review and Merge`
|
|
90
|
-
- **Labels**: `implementation-type:hitl`, `lifecycle:feature-pr`
|
|
91
|
-
- **Dependencies**: `parent-child` to parent bead; `blocks` on the final document stage chore
|
|
92
|
-
- **Purpose**: human review of the agent PR (agent-branch → feature branch)
|
|
90
|
+
The full bead-property contract (titles, labels, dependencies per chore and for the PR gate) is in `REFERENCE.md`.
|
|
93
91
|
|
|
94
|
-
|
|
92
|
+
## Verification checklist
|
|
95
93
|
|
|
96
|
-
|
|
94
|
+
- [ ] Parent bead exists with the correct title, description, and priority.
|
|
95
|
+
- [ ] `parent-child` dependency added when a parent epic was supplied.
|
|
96
|
+
- [ ] `implementation-type` label present on the parent bead (`bd label list <id>`).
|
|
97
|
+
- [ ] HITL path: no pipeline chores created, caller told the classification. AFK path: script ran from the target project's cwd and its JSON contains every stage ID plus `featurePrReview`.
|
|
98
|
+
- [ ] Chore titles/labels/dependencies match the contract (`[<parent-id>] <stage title>`, `stage:<id>`, `parent-child` to parent, `blocks` per `dependsOn`), verified against `REFERENCE.md`.
|
|
99
|
+
- [ ] PR gate task exists with `implementation-type:hitl` + `lifecycle:feature-pr` labels and blocks the final document stage chore.
|
|
100
|
+
- [ ] Report returned the parent bead ID, classification, and all child bead IDs.
|
|
@@ -39,8 +39,13 @@ function parseArgs(args: string[]): { parentId: string; priority: string } {
|
|
|
39
39
|
|
|
40
40
|
// ─── Exec ─────────────────────────────────────────────────────────────────────
|
|
41
41
|
|
|
42
|
+
// BD_PATH env override lets machines where bd is not on PATH pin a location.
|
|
43
|
+
// Defaults to `bd`, resolved via PATH.
|
|
44
|
+
const BD_PATH = process.env.BD_PATH || 'bd';
|
|
45
|
+
|
|
42
46
|
function run(args: string[]): string {
|
|
43
|
-
|
|
47
|
+
const cmd = args[0] === 'bd' ? [BD_PATH, ...args.slice(1)] : args;
|
|
48
|
+
return execSync(cmd.join(' '), { encoding: 'utf-8' }).trim();
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
// ─── Main ─────────────────────────────────────────────────────────────────────
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules/tsx/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules/tsx/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# PRD to Tasks — Reference
|
|
2
|
+
|
|
3
|
+
Body templates used in the Phase 3 and Phase 4 workflow steps of `SKILL.md`.
|
|
4
|
+
|
|
5
|
+
## Epic body template
|
|
6
|
+
|
|
7
|
+
Passed as the `--description` when creating an epic bead:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bd create "<Phase Title>" --type epic --description "<epic body below>"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
## Source
|
|
15
|
+
|
|
16
|
+
PRD: <brief reference>
|
|
17
|
+
|
|
18
|
+
## Summary
|
|
19
|
+
|
|
20
|
+
A concise description of this phase. Scope and goal, not implementation details.
|
|
21
|
+
|
|
22
|
+
## What to build
|
|
23
|
+
|
|
24
|
+
End-to-end behaviour for this phase. What a demo would show.
|
|
25
|
+
|
|
26
|
+
## Acceptance criteria
|
|
27
|
+
|
|
28
|
+
- [ ] Criterion 1
|
|
29
|
+
- [ ] Criterion 2
|
|
30
|
+
|
|
31
|
+
## Blocked by
|
|
32
|
+
|
|
33
|
+
- Blocked by #<epic-id> (if any) — or "None — can start immediately"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Task body template
|
|
37
|
+
|
|
38
|
+
Passed as the `description` to `create-task` for each task bead:
|
|
39
|
+
|
|
40
|
+
```markdown
|
|
41
|
+
## Epic
|
|
42
|
+
|
|
43
|
+
#<epic-id> — <Epic Title>
|
|
44
|
+
|
|
45
|
+
## What to build
|
|
46
|
+
|
|
47
|
+
This vertical slice: end-to-end behaviour, not layer-by-layer implementation.
|
|
48
|
+
|
|
49
|
+
## Acceptance criteria
|
|
50
|
+
|
|
51
|
+
- [ ] Criterion 1
|
|
52
|
+
- [ ] Criterion 2
|
|
53
|
+
|
|
54
|
+
## Blocked by
|
|
55
|
+
|
|
56
|
+
- Blocked by #<task-id> (if any) — or "None — can start immediately"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Aggregate classification tags
|
|
60
|
+
|
|
61
|
+
After all tasks in an epic exist, tag the epic with the aggregate classification:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
bd tag <epic-id> implementation-type:hitl # if any task is HITL
|
|
65
|
+
bd tag <epic-id> implementation-type:afk # if all tasks are AFK
|
|
66
|
+
```
|