@gh-symphony/cli 0.0.13 → 0.0.15
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/dist/chunk-5NV3LSAJ.js +11 -0
- package/dist/chunk-6HBZC3BE.js +468 -0
- package/dist/chunk-76QPITKI.js +109 -0
- package/dist/chunk-IWR4UQEJ.js +2250 -0
- package/dist/chunk-JO3AXHQI.js +130 -0
- package/dist/chunk-M7OSMUTN.js +874 -0
- package/dist/chunk-MVRF7BES.js +68 -0
- package/dist/chunk-RNWX7DQU.js +4617 -0
- package/dist/chunk-ROGRTUFI.js +108 -0
- package/dist/chunk-TH5QPO3Y.js +67 -0
- package/dist/config-cmd-AZ7POMAA.js +110 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +568 -356
- package/dist/init-EZXQAXZM.js +17 -0
- package/dist/logs-6LNGT2GF.js +188 -0
- package/dist/project-3ELXQ35D.js +678 -0
- package/dist/recover-T6ME6C56.js +130 -0
- package/dist/repo-R3XBIVAX.js +121 -0
- package/dist/run-DYINRZHK.js +107 -0
- package/dist/start-PIFQMIC2.js +15 -0
- package/dist/status-3WK5BWRZ.js +11 -0
- package/dist/stop-AA3AP5M6.js +9 -0
- package/dist/version-VBB62JWI.js +30 -0
- package/package.json +11 -6
- package/dist/ansi.d.ts +0 -15
- package/dist/ansi.js +0 -53
- package/dist/commands/config-cmd.d.ts +0 -3
- package/dist/commands/config-cmd.js +0 -90
- package/dist/commands/help.d.ts +0 -3
- package/dist/commands/help.js +0 -55
- package/dist/commands/init.d.ts +0 -34
- package/dist/commands/init.js +0 -477
- package/dist/commands/logs.d.ts +0 -3
- package/dist/commands/logs.js +0 -184
- package/dist/commands/project.d.ts +0 -3
- package/dist/commands/project.js +0 -649
- package/dist/commands/recover.d.ts +0 -3
- package/dist/commands/recover.js +0 -119
- package/dist/commands/repo.d.ts +0 -3
- package/dist/commands/repo.js +0 -103
- package/dist/commands/run.d.ts +0 -3
- package/dist/commands/run.js +0 -95
- package/dist/commands/start.d.ts +0 -20
- package/dist/commands/start.js +0 -344
- package/dist/commands/status-refresh.d.ts +0 -9
- package/dist/commands/status-refresh.js +0 -27
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.js +0 -237
- package/dist/commands/stop.d.ts +0 -3
- package/dist/commands/stop.js +0 -92
- package/dist/commands/version.d.ts +0 -3
- package/dist/commands/version.js +0 -21
- package/dist/completion.d.ts +0 -1
- package/dist/completion.js +0 -204
- package/dist/config.d.ts +0 -38
- package/dist/config.js +0 -82
- package/dist/context/context-types.d.ts +0 -36
- package/dist/context/context-types.js +0 -1
- package/dist/context/generate-context-yaml.d.ts +0 -15
- package/dist/context/generate-context-yaml.js +0 -129
- package/dist/dashboard/renderer.d.ts +0 -9
- package/dist/dashboard/renderer.js +0 -220
- package/dist/detection/environment-detector.d.ts +0 -11
- package/dist/detection/environment-detector.js +0 -140
- package/dist/github/client.d.ts +0 -71
- package/dist/github/client.js +0 -348
- package/dist/github/gh-auth.d.ts +0 -34
- package/dist/github/gh-auth.js +0 -110
- package/dist/mapping/smart-defaults.d.ts +0 -17
- package/dist/mapping/smart-defaults.js +0 -86
- package/dist/orchestrator-runtime.d.ts +0 -1
- package/dist/orchestrator-runtime.js +0 -4
- package/dist/orchestrator-status-endpoint.d.ts +0 -5
- package/dist/orchestrator-status-endpoint.js +0 -27
- package/dist/project-selection.d.ts +0 -8
- package/dist/project-selection.js +0 -56
- package/dist/skills/skill-writer.d.ts +0 -14
- package/dist/skills/skill-writer.js +0 -62
- package/dist/skills/templates/commit.d.ts +0 -2
- package/dist/skills/templates/commit.js +0 -45
- package/dist/skills/templates/document.d.ts +0 -7
- package/dist/skills/templates/document.js +0 -16
- package/dist/skills/templates/gh-project.d.ts +0 -2
- package/dist/skills/templates/gh-project.js +0 -88
- package/dist/skills/templates/gh-symphony.d.ts +0 -2
- package/dist/skills/templates/gh-symphony.js +0 -125
- package/dist/skills/templates/index.d.ts +0 -8
- package/dist/skills/templates/index.js +0 -28
- package/dist/skills/templates/land.d.ts +0 -2
- package/dist/skills/templates/land.js +0 -59
- package/dist/skills/templates/pull.d.ts +0 -2
- package/dist/skills/templates/pull.js +0 -41
- package/dist/skills/templates/push.d.ts +0 -2
- package/dist/skills/templates/push.js +0 -36
- package/dist/skills/types.d.ts +0 -23
- package/dist/skills/types.js +0 -1
- package/dist/workflow/generate-reference-workflow.d.ts +0 -9
- package/dist/workflow/generate-reference-workflow.js +0 -261
- package/dist/workflow/generate-workflow-md.d.ts +0 -12
- package/dist/workflow/generate-workflow-md.js +0 -134
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { renderSkillDocument } from "./document.js";
|
|
2
|
-
export function generatePushSkill(_ctx) {
|
|
3
|
-
const lines = [];
|
|
4
|
-
lines.push("# /push — Git Push Workflow");
|
|
5
|
-
lines.push("");
|
|
6
|
-
lines.push("## Trigger");
|
|
7
|
-
lines.push("");
|
|
8
|
-
lines.push("Use this skill when publishing local commits to the remote branch.");
|
|
9
|
-
lines.push("");
|
|
10
|
-
lines.push("## Flow");
|
|
11
|
-
lines.push("");
|
|
12
|
-
lines.push("1. Run local tests and lint — ensure they pass before pushing");
|
|
13
|
-
lines.push("2. Push to remote:");
|
|
14
|
-
lines.push(" ```bash");
|
|
15
|
-
lines.push(" git push origin <branch> # subsequent pushes");
|
|
16
|
-
lines.push(" git push -u origin <branch> # first push (sets upstream)");
|
|
17
|
-
lines.push(" ```");
|
|
18
|
-
lines.push("3. If push is rejected (non-fast-forward):");
|
|
19
|
-
lines.push(" - Run `git fetch origin && git merge origin/main`");
|
|
20
|
-
lines.push(" - Resolve any conflicts");
|
|
21
|
-
lines.push(" - Re-run tests");
|
|
22
|
-
lines.push(" - Push again");
|
|
23
|
-
lines.push("4. Record push result in workpad Notes");
|
|
24
|
-
lines.push("");
|
|
25
|
-
lines.push("## Rules");
|
|
26
|
-
lines.push("");
|
|
27
|
-
lines.push("- Never use `--force` (destructive)");
|
|
28
|
-
lines.push("- Only use `--force-with-lease` if absolutely necessary — record the reason in workpad");
|
|
29
|
-
lines.push("- Verify CI starts after push (check GitHub Actions tab)");
|
|
30
|
-
lines.push("- Do not push directly to `main` or `master`");
|
|
31
|
-
return renderSkillDocument({
|
|
32
|
-
name: "push",
|
|
33
|
-
description: "Publish verified local commits to the remote branch without unsafe force pushes.",
|
|
34
|
-
bodyLines: lines,
|
|
35
|
-
});
|
|
36
|
-
}
|
package/dist/skills/types.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export type SkillRuntime = "claude-code" | "codex";
|
|
2
|
-
export type SkillTemplateContext = {
|
|
3
|
-
runtime: SkillRuntime | string;
|
|
4
|
-
projectId: string;
|
|
5
|
-
githubProjectTitle: string;
|
|
6
|
-
repositories: Array<{
|
|
7
|
-
owner: string;
|
|
8
|
-
name: string;
|
|
9
|
-
}>;
|
|
10
|
-
statusColumns: Array<{
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
role: "active" | "wait" | "terminal" | null;
|
|
14
|
-
}>;
|
|
15
|
-
statusFieldId: string;
|
|
16
|
-
contextYamlPath: string;
|
|
17
|
-
referenceWorkflowPath: string;
|
|
18
|
-
};
|
|
19
|
-
export type SkillTemplate = {
|
|
20
|
-
name: string;
|
|
21
|
-
fileName: string;
|
|
22
|
-
generate: (context: SkillTemplateContext) => string;
|
|
23
|
-
};
|
package/dist/skills/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type ReferenceWorkflowInput = {
|
|
2
|
-
runtime: "codex" | "claude-code" | string;
|
|
3
|
-
statusColumns: Array<{
|
|
4
|
-
name: string;
|
|
5
|
-
role: "active" | "wait" | "terminal" | null;
|
|
6
|
-
}>;
|
|
7
|
-
projectId: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function generateReferenceWorkflow(input: ReferenceWorkflowInput): string;
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
export function generateReferenceWorkflow(input) {
|
|
2
|
-
const lines = [];
|
|
3
|
-
lines.push("# Reference WORKFLOW.md — gh-symphony");
|
|
4
|
-
lines.push("# This file is a reference template for authoring WORKFLOW.md.");
|
|
5
|
-
lines.push("# AI agents reference this file (via the /gh-symphony skill) when designing WORKFLOW.md.");
|
|
6
|
-
lines.push("# Do not edit this file directly.");
|
|
7
|
-
lines.push("");
|
|
8
|
-
lines.push("---");
|
|
9
|
-
lines.push("");
|
|
10
|
-
lines.push("# ═══ FRONT MATTER FIELD REFERENCE ═══");
|
|
11
|
-
lines.push("# All front matter fields supported by the gh-symphony parser are listed below.");
|
|
12
|
-
lines.push("");
|
|
13
|
-
lines.push("tracker:");
|
|
14
|
-
lines.push(" kind: github-project");
|
|
15
|
-
lines.push(` project_id: ${input.projectId}`);
|
|
16
|
-
lines.push(" state_field: Status");
|
|
17
|
-
lines.push("");
|
|
18
|
-
const activeColumns = input.statusColumns.filter((c) => c.role === "active");
|
|
19
|
-
const waitColumns = input.statusColumns.filter((c) => c.role === "wait");
|
|
20
|
-
const terminalColumns = input.statusColumns.filter((c) => c.role === "terminal");
|
|
21
|
-
const firstActive = activeColumns[0];
|
|
22
|
-
if (activeColumns.length > 0) {
|
|
23
|
-
lines.push(" active_states:");
|
|
24
|
-
for (const col of activeColumns) {
|
|
25
|
-
lines.push(` - ${col.name}`);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
lines.push(" active_states: [{active column names}]");
|
|
30
|
-
}
|
|
31
|
-
if (terminalColumns.length > 0) {
|
|
32
|
-
lines.push(" terminal_states:");
|
|
33
|
-
for (const col of terminalColumns) {
|
|
34
|
-
lines.push(` - ${col.name}`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
lines.push(" terminal_states: [{terminal column names}]");
|
|
39
|
-
}
|
|
40
|
-
if (firstActive) {
|
|
41
|
-
lines.push(" blocker_check_states:");
|
|
42
|
-
lines.push(` - ${firstActive.name}`);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
lines.push(" blocker_check_states: [{first active state}]");
|
|
46
|
-
}
|
|
47
|
-
lines.push("");
|
|
48
|
-
const agentCommand = resolveAgentCommand(input.runtime);
|
|
49
|
-
const hookComment = resolveHookComment(input.runtime);
|
|
50
|
-
lines.push("polling:");
|
|
51
|
-
lines.push(" interval_ms: 30000");
|
|
52
|
-
lines.push("");
|
|
53
|
-
lines.push("workspace:");
|
|
54
|
-
lines.push(" root: .runtime/symphony-workspaces");
|
|
55
|
-
lines.push("");
|
|
56
|
-
lines.push("hooks:");
|
|
57
|
-
lines.push(` after_create: hooks/after_create.sh # ${hookComment}`);
|
|
58
|
-
lines.push(" before_run: null");
|
|
59
|
-
lines.push(" after_run: null");
|
|
60
|
-
lines.push(" before_remove: null");
|
|
61
|
-
lines.push(" timeout_ms: 60000");
|
|
62
|
-
lines.push("");
|
|
63
|
-
lines.push("agent:");
|
|
64
|
-
lines.push(" max_concurrent_agents: 10");
|
|
65
|
-
lines.push(" max_retry_backoff_ms: 30000");
|
|
66
|
-
lines.push(" retry_base_delay_ms: 10000");
|
|
67
|
-
lines.push(" max_turns: 20");
|
|
68
|
-
lines.push("");
|
|
69
|
-
lines.push("codex:");
|
|
70
|
-
lines.push(` command: ${agentCommand}`);
|
|
71
|
-
lines.push(" read_timeout_ms: 5000");
|
|
72
|
-
lines.push(" turn_timeout_ms: 3600000");
|
|
73
|
-
lines.push(" stall_timeout_ms: 300000");
|
|
74
|
-
lines.push("");
|
|
75
|
-
lines.push("---");
|
|
76
|
-
lines.push("");
|
|
77
|
-
lines.push("# ═══ PROMPT BODY REFERENCE ═══");
|
|
78
|
-
lines.push("# GitHub Project adaptation of the Elixir Symphony reference prompt.");
|
|
79
|
-
lines.push("");
|
|
80
|
-
lines.push("## Status Map");
|
|
81
|
-
lines.push("");
|
|
82
|
-
lines.push("| Status | Role | Agent Action |");
|
|
83
|
-
lines.push("| ------ | ---- | ------------ |");
|
|
84
|
-
for (const col of input.statusColumns) {
|
|
85
|
-
const roleLabel = col.role ?? "unset";
|
|
86
|
-
const action = resolveRoleAction(col.role);
|
|
87
|
-
lines.push(`| ${col.name} | ${roleLabel} | ${action} |`);
|
|
88
|
-
}
|
|
89
|
-
if (waitColumns.length > 0) {
|
|
90
|
-
lines.push("");
|
|
91
|
-
lines.push("**Wait States (awaiting PR review):**");
|
|
92
|
-
for (const col of waitColumns) {
|
|
93
|
-
lines.push(`- **${col.name}**: PR created. Awaiting human review. Agent is idle.`);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
lines.push("");
|
|
97
|
-
lines.push("## Default Posture");
|
|
98
|
-
lines.push("");
|
|
99
|
-
lines.push("1. This is an unattended orchestration session. Do not ask humans for follow-up tasks.");
|
|
100
|
-
lines.push("2. Exit early only for genuine blockers (missing required credentials or secrets).");
|
|
101
|
-
lines.push('3. In your final message, report only completed work and blockers. Do not include "next steps".');
|
|
102
|
-
lines.push("4. Do not modify the issue body for planning or progress-tracking purposes.");
|
|
103
|
-
lines.push("5. If the issue is in a terminal state, do nothing and exit immediately.");
|
|
104
|
-
lines.push("6. If you discover out-of-scope improvements, open a separate issue rather than expanding the current scope.");
|
|
105
|
-
lines.push("7. Keep all commits as logical units and follow conventional commit format.");
|
|
106
|
-
lines.push("8. Do not make commits that break existing tests.");
|
|
107
|
-
lines.push("9. Verify all existing tests pass before creating a PR.");
|
|
108
|
-
lines.push("10. Create a workpad as an issue comment to track progress.");
|
|
109
|
-
lines.push("11. Use the gh-project skill to manage issue status.");
|
|
110
|
-
lines.push("12. When a blocker is found, record it in an issue comment and transition the status appropriately.");
|
|
111
|
-
lines.push("13. Once your work is complete and the PR is merged, transition the issue to the Done state.");
|
|
112
|
-
lines.push("");
|
|
113
|
-
lines.push("## Related Skills");
|
|
114
|
-
lines.push("");
|
|
115
|
-
lines.push("- **gh-project**: Manage GitHub Project v2 issue status and update fields");
|
|
116
|
-
lines.push("- **commit**: Create logical-unit commits (conventional commit format)");
|
|
117
|
-
lines.push("- **push**: Push branch and sync with the remote repository");
|
|
118
|
-
lines.push("- **pull**: Fetch latest changes and resolve conflicts");
|
|
119
|
-
lines.push("- **land**: Create PR, request review, and handle merge");
|
|
120
|
-
lines.push("");
|
|
121
|
-
lines.push("## Step 0: Determine current state and route");
|
|
122
|
-
lines.push("");
|
|
123
|
-
lines.push("Check the current issue state and route to the appropriate step:");
|
|
124
|
-
lines.push("");
|
|
125
|
-
if (terminalColumns.length > 0) {
|
|
126
|
-
const terminalNames = terminalColumns.map((c) => c.name).join(", ");
|
|
127
|
-
lines.push(`- **${terminalNames}** → Exit immediately. Do nothing.`);
|
|
128
|
-
}
|
|
129
|
-
if (waitColumns.length > 0) {
|
|
130
|
-
const waitNames = waitColumns.map((c) => c.name).join(", ");
|
|
131
|
-
lines.push(`- **${waitNames}** → Go to Step 3 (handle awaiting review).`);
|
|
132
|
-
}
|
|
133
|
-
if (activeColumns.length > 0) {
|
|
134
|
-
const activeNames = activeColumns.map((c) => c.name).join(", ");
|
|
135
|
-
lines.push(`- **${activeNames}** → Go to Step 1 (start or continue execution).`);
|
|
136
|
-
}
|
|
137
|
-
lines.push("- **Other states** → Log the unclear state in an issue comment and exit.");
|
|
138
|
-
lines.push("");
|
|
139
|
-
lines.push("## Step 1: Start/continue execution");
|
|
140
|
-
lines.push("");
|
|
141
|
-
lines.push("1. Read the issue body and comments to understand current progress.");
|
|
142
|
-
lines.push("2. If an existing workpad comment is found, continue from it; otherwise create a new workpad.");
|
|
143
|
-
lines.push("3. See the 'Workpad Template' section below for the workpad format.");
|
|
144
|
-
lines.push("4. If no branch exists, create a feature branch based on `{issue.repository}`.");
|
|
145
|
-
lines.push("5. Proceed to Step 2.");
|
|
146
|
-
lines.push("");
|
|
147
|
-
lines.push("## Step 2: Execution phase");
|
|
148
|
-
lines.push("");
|
|
149
|
-
lines.push("1. Implement according to the issue description.");
|
|
150
|
-
lines.push("2. Commit changes in logical units (conventional commit format).");
|
|
151
|
-
lines.push("3. Verify all existing tests pass.");
|
|
152
|
-
lines.push("4. Write tests for new functionality.");
|
|
153
|
-
lines.push("5. Once all Completion Bar criteria are met, create a PR.");
|
|
154
|
-
lines.push("6. After creating the PR, transition the issue status to the Human Review state.");
|
|
155
|
-
lines.push("7. Proceed to Step 3.");
|
|
156
|
-
lines.push("");
|
|
157
|
-
lines.push("## Step 3: Human Review and merge handling");
|
|
158
|
-
lines.push("");
|
|
159
|
-
lines.push("1. If a PR already exists, check for review comments.");
|
|
160
|
-
lines.push("2. If no review comments are present, remain in the waiting state.");
|
|
161
|
-
lines.push("3. If the PR is merged, transition the issue to a terminal state.");
|
|
162
|
-
lines.push("4. If review changes are requested, proceed to Step 4.");
|
|
163
|
-
lines.push("");
|
|
164
|
-
lines.push("## Step 4: Rework handling");
|
|
165
|
-
lines.push("");
|
|
166
|
-
lines.push("1. Read all PR review comments and identify the requested changes.");
|
|
167
|
-
lines.push("2. Process the changes following the PR Feedback Sweep Protocol.");
|
|
168
|
-
lines.push("3. After implementing changes, commit and update the PR.");
|
|
169
|
-
lines.push("4. Transition the issue status back to the Human Review state.");
|
|
170
|
-
lines.push("5. Return to Step 3.");
|
|
171
|
-
lines.push("");
|
|
172
|
-
lines.push("## PR Feedback Sweep Protocol");
|
|
173
|
-
lines.push("");
|
|
174
|
-
lines.push("Order for processing PR review feedback:");
|
|
175
|
-
lines.push("");
|
|
176
|
-
lines.push("1. **Collect all comments**: List all unresolved review comments.");
|
|
177
|
-
lines.push("2. **Triage by priority**: Handle blocking comments before non-blocking ones.");
|
|
178
|
-
lines.push("3. **Implement changes**: Make the code changes corresponding to each comment.");
|
|
179
|
-
lines.push("4. **Reply to comments**: Respond to each review comment with a description of what was done.");
|
|
180
|
-
lines.push("5. **Commit**: Commit changes in `fix: address PR review feedback` format.");
|
|
181
|
-
lines.push("6. **Request re-review**: Ask the reviewer for a re-review.");
|
|
182
|
-
lines.push("");
|
|
183
|
-
lines.push("## Completion Bar");
|
|
184
|
-
lines.push("");
|
|
185
|
-
lines.push("All of the following must be satisfied before creating a PR:");
|
|
186
|
-
lines.push("");
|
|
187
|
-
lines.push("- [ ] All requirements from the issue description are implemented.");
|
|
188
|
-
lines.push("- [ ] All existing tests pass.");
|
|
189
|
-
lines.push("- [ ] Tests are written for new functionality.");
|
|
190
|
-
lines.push("- [ ] Code style follows project conventions.");
|
|
191
|
-
lines.push("- [ ] The PR description clearly explains the changes.");
|
|
192
|
-
lines.push("- [ ] Related documentation is updated (if applicable).");
|
|
193
|
-
lines.push("");
|
|
194
|
-
lines.push("## Guardrails");
|
|
195
|
-
lines.push("");
|
|
196
|
-
lines.push("- **Scope**: Never make changes outside the scope of the issue.");
|
|
197
|
-
lines.push("- **Secrets**: Never hardcode tokens, passwords, or API keys in code.");
|
|
198
|
-
lines.push("- **Breaking changes**: Do not modify existing APIs or interfaces without explicit authorization.");
|
|
199
|
-
lines.push("- **Force push**: Do not force-push to the main/master branch.");
|
|
200
|
-
lines.push("- **Issue body**: Do not modify the issue body for progress tracking.");
|
|
201
|
-
lines.push("- **Infinite loops**: If the same task fails 3 or more consecutive times, log it as a blocker and exit.");
|
|
202
|
-
lines.push("");
|
|
203
|
-
lines.push("## Workpad Template");
|
|
204
|
-
lines.push("");
|
|
205
|
-
lines.push("Workpad format to create as an issue comment:");
|
|
206
|
-
lines.push("");
|
|
207
|
-
lines.push("```markdown");
|
|
208
|
-
lines.push("## Workpad — {issue.identifier}");
|
|
209
|
-
lines.push("");
|
|
210
|
-
lines.push("**Status**: {current phase}");
|
|
211
|
-
lines.push("**Branch**: {branch name}");
|
|
212
|
-
lines.push("**PR**: {PR URL or not created}");
|
|
213
|
-
lines.push("");
|
|
214
|
-
lines.push("### Plan");
|
|
215
|
-
lines.push("");
|
|
216
|
-
lines.push("- [ ] {task 1}");
|
|
217
|
-
lines.push("- [ ] {task 2}");
|
|
218
|
-
lines.push("");
|
|
219
|
-
lines.push("### Progress Log");
|
|
220
|
-
lines.push("");
|
|
221
|
-
lines.push("- {timestamp}: {action taken}");
|
|
222
|
-
lines.push("");
|
|
223
|
-
lines.push("### Blockers");
|
|
224
|
-
lines.push("");
|
|
225
|
-
lines.push("None");
|
|
226
|
-
lines.push("```");
|
|
227
|
-
lines.push("");
|
|
228
|
-
return lines.join("\n");
|
|
229
|
-
}
|
|
230
|
-
function resolveAgentCommand(runtime) {
|
|
231
|
-
switch (runtime) {
|
|
232
|
-
case "codex":
|
|
233
|
-
return "codex app-server";
|
|
234
|
-
case "claude-code":
|
|
235
|
-
return "claude-code";
|
|
236
|
-
default:
|
|
237
|
-
return runtime;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
function resolveHookComment(runtime) {
|
|
241
|
-
switch (runtime) {
|
|
242
|
-
case "codex":
|
|
243
|
-
return "npm/yarn/pnpm install script";
|
|
244
|
-
case "claude-code":
|
|
245
|
-
return "npm/yarn/pnpm install script";
|
|
246
|
-
default:
|
|
247
|
-
return "package-manager-specific script";
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
function resolveRoleAction(role) {
|
|
251
|
-
switch (role) {
|
|
252
|
-
case "active":
|
|
253
|
-
return "Agent starts work immediately. Creates workpad and proceeds with implementation.";
|
|
254
|
-
case "wait":
|
|
255
|
-
return "PR created. Awaiting human review. Agent is idle.";
|
|
256
|
-
case "terminal":
|
|
257
|
-
return "Completed state. Agent exits.";
|
|
258
|
-
case null:
|
|
259
|
-
return "Role unset. Must be explicitly configured in WORKFLOW.md.";
|
|
260
|
-
}
|
|
261
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { WorkflowLifecycleConfig } from "@gh-symphony/core";
|
|
2
|
-
import type { StateMapping } from "../config.js";
|
|
3
|
-
export type GenerateWorkflowInput = {
|
|
4
|
-
projectId: string;
|
|
5
|
-
stateFieldName: string;
|
|
6
|
-
mappings: Record<string, StateMapping>;
|
|
7
|
-
lifecycle: WorkflowLifecycleConfig;
|
|
8
|
-
runtime: string;
|
|
9
|
-
pollIntervalMs?: number;
|
|
10
|
-
concurrency?: number;
|
|
11
|
-
};
|
|
12
|
-
export declare function generateWorkflowMarkdown(input: GenerateWorkflowInput): string;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
export function generateWorkflowMarkdown(input) {
|
|
2
|
-
const frontMatter = buildFrontMatter(input);
|
|
3
|
-
const promptBody = buildPromptBody(input.mappings);
|
|
4
|
-
return `---\n${frontMatter}---\n${promptBody}\n`;
|
|
5
|
-
}
|
|
6
|
-
function buildFrontMatter(input) {
|
|
7
|
-
const lines = [];
|
|
8
|
-
lines.push("tracker:");
|
|
9
|
-
lines.push(" kind: github-project");
|
|
10
|
-
lines.push(` project_id: ${input.projectId}`);
|
|
11
|
-
lines.push(` state_field: ${input.stateFieldName}`);
|
|
12
|
-
if (input.lifecycle.activeStates.length > 0) {
|
|
13
|
-
lines.push(" active_states:");
|
|
14
|
-
for (const state of input.lifecycle.activeStates) {
|
|
15
|
-
lines.push(` - ${state}`);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
if (input.lifecycle.terminalStates.length > 0) {
|
|
19
|
-
lines.push(" terminal_states:");
|
|
20
|
-
for (const state of input.lifecycle.terminalStates) {
|
|
21
|
-
lines.push(` - ${state}`);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
if (input.lifecycle.blockerCheckStates.length > 0) {
|
|
25
|
-
lines.push(" blocker_check_states:");
|
|
26
|
-
for (const state of input.lifecycle.blockerCheckStates) {
|
|
27
|
-
lines.push(` - ${state}`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
const agentCommand = resolveAgentCommand(input.runtime);
|
|
31
|
-
lines.push("polling:");
|
|
32
|
-
lines.push(` interval_ms: ${input.pollIntervalMs ?? 30000}`);
|
|
33
|
-
lines.push("workspace:");
|
|
34
|
-
lines.push(" root: .runtime/symphony-workspaces");
|
|
35
|
-
lines.push("hooks:");
|
|
36
|
-
lines.push(" after_create: hooks/after_create.sh");
|
|
37
|
-
lines.push("agent:");
|
|
38
|
-
lines.push(" max_concurrent_agents: 10");
|
|
39
|
-
lines.push(" max_retry_backoff_ms: 30000");
|
|
40
|
-
lines.push(" retry_base_delay_ms: 10000");
|
|
41
|
-
lines.push("codex:");
|
|
42
|
-
lines.push(` command: ${agentCommand}`);
|
|
43
|
-
lines.push(" read_timeout_ms: 5000");
|
|
44
|
-
lines.push(" turn_timeout_ms: 3600000");
|
|
45
|
-
return lines.join("\n") + "\n";
|
|
46
|
-
}
|
|
47
|
-
function resolveAgentCommand(runtime) {
|
|
48
|
-
switch (runtime) {
|
|
49
|
-
case "codex":
|
|
50
|
-
return "codex app-server";
|
|
51
|
-
case "claude-code":
|
|
52
|
-
return "claude-code";
|
|
53
|
-
default:
|
|
54
|
-
return runtime;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function buildPromptBody(mappings) {
|
|
58
|
-
const statusMap = generateStatusMapWithDescriptions(mappings);
|
|
59
|
-
const template = `${statusMap}
|
|
60
|
-
|
|
61
|
-
## Agent Instructions
|
|
62
|
-
|
|
63
|
-
You are an AI coding agent working on issue {{issue.identifier}}: "{{issue.title}}".
|
|
64
|
-
|
|
65
|
-
**Repository:** {{issue.repository}}
|
|
66
|
-
**Current state:** {{issue.state}}
|
|
67
|
-
|
|
68
|
-
### Task
|
|
69
|
-
|
|
70
|
-
{{issue.description}}
|
|
71
|
-
|
|
72
|
-
### Default Posture
|
|
73
|
-
|
|
74
|
-
1. This is an unattended orchestration session. Do not ask humans for follow-up actions.
|
|
75
|
-
2. Only abort early if there is a genuine blocker (missing required credentials or secrets).
|
|
76
|
-
3. In your final message, report only what was completed and any blockers. Do not include "next steps".
|
|
77
|
-
|
|
78
|
-
### Workflow
|
|
79
|
-
|
|
80
|
-
1. Read the issue description and understand the requirements.
|
|
81
|
-
2. Explore the codebase to understand the relevant code structure.
|
|
82
|
-
3. Implement the changes following the project's coding conventions.
|
|
83
|
-
4. Write or update tests to cover the changes.
|
|
84
|
-
5. Verify that all existing tests pass.
|
|
85
|
-
6. Create a PR with a clear description of the changes.
|
|
86
|
-
|
|
87
|
-
### Guardrails
|
|
88
|
-
|
|
89
|
-
- Do not edit the issue body for planning or progress tracking.
|
|
90
|
-
- If the issue is in a terminal state, do nothing and exit.
|
|
91
|
-
- If you find out-of-scope improvements, open a separate issue rather than expanding the current scope.
|
|
92
|
-
|
|
93
|
-
### Workpad Template
|
|
94
|
-
|
|
95
|
-
Create a workpad comment on the issue with the following structure to track progress:
|
|
96
|
-
|
|
97
|
-
\`\`\`md
|
|
98
|
-
## Workpad
|
|
99
|
-
|
|
100
|
-
### Plan
|
|
101
|
-
|
|
102
|
-
- [ ] 1. Task item
|
|
103
|
-
|
|
104
|
-
### Acceptance Criteria
|
|
105
|
-
|
|
106
|
-
- [ ] Criterion 1
|
|
107
|
-
|
|
108
|
-
### Validation
|
|
109
|
-
|
|
110
|
-
- [ ] Test: \`command\`
|
|
111
|
-
|
|
112
|
-
### Notes
|
|
113
|
-
|
|
114
|
-
- Progress notes
|
|
115
|
-
\`\`\``;
|
|
116
|
-
return template;
|
|
117
|
-
}
|
|
118
|
-
function generateStatusMapWithDescriptions(mappings) {
|
|
119
|
-
const roleDescriptions = {
|
|
120
|
-
active: "Agent starts work immediately",
|
|
121
|
-
wait: "PR created, awaiting human review",
|
|
122
|
-
terminal: "Completed, agent exits",
|
|
123
|
-
};
|
|
124
|
-
const lines = ["## Status Map", ""];
|
|
125
|
-
for (const [columnName, mapping] of Object.entries(mappings)) {
|
|
126
|
-
const rolePart = `[${mapping.role}]`;
|
|
127
|
-
const goalPart = mapping.goal ? ` — ${mapping.goal}` : "";
|
|
128
|
-
const descPart = roleDescriptions[mapping.role]
|
|
129
|
-
? ` *(${roleDescriptions[mapping.role]})*`
|
|
130
|
-
: "";
|
|
131
|
-
lines.push(`- **${columnName}** ${rolePart}${goalPart}${descPart}`);
|
|
132
|
-
}
|
|
133
|
-
return lines.join("\n");
|
|
134
|
-
}
|