@gh-symphony/cli 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/chunk-5NV3LSAJ.js +11 -0
  2. package/dist/chunk-6HBZC3BE.js +468 -0
  3. package/dist/chunk-76QPITKI.js +109 -0
  4. package/dist/chunk-EFMFGOWM.js +3575 -0
  5. package/dist/chunk-IWR4UQEJ.js +2250 -0
  6. package/dist/chunk-JO3AXHQI.js +130 -0
  7. package/dist/chunk-MHIWAIVD.js +876 -0
  8. package/dist/chunk-MVRF7BES.js +68 -0
  9. package/dist/chunk-ROGRTUFI.js +108 -0
  10. package/dist/chunk-TF3QNWNC.js +1121 -0
  11. package/dist/chunk-TH5QPO3Y.js +67 -0
  12. package/dist/config-cmd-AZ7POMAA.js +110 -0
  13. package/dist/index.d.ts +5 -4
  14. package/dist/index.js +568 -356
  15. package/dist/init-EZXQAXZM.js +17 -0
  16. package/dist/logs-6LNGT2GF.js +188 -0
  17. package/dist/project-557FE2GD.js +679 -0
  18. package/dist/recover-LVBI2TGH.js +131 -0
  19. package/dist/repo-R3XBIVAX.js +121 -0
  20. package/dist/run-WITYAYFZ.js +108 -0
  21. package/dist/start-JUFKNL3N.js +16 -0
  22. package/dist/status-3WK5BWRZ.js +11 -0
  23. package/dist/stop-AA3AP5M6.js +9 -0
  24. package/dist/version-VBB62JWI.js +30 -0
  25. package/dist/worker-entry.js +1828 -0
  26. package/package.json +9 -4
  27. package/dist/ansi.d.ts +0 -15
  28. package/dist/ansi.js +0 -53
  29. package/dist/commands/config-cmd.d.ts +0 -3
  30. package/dist/commands/config-cmd.js +0 -90
  31. package/dist/commands/help.d.ts +0 -3
  32. package/dist/commands/help.js +0 -55
  33. package/dist/commands/init.d.ts +0 -34
  34. package/dist/commands/init.js +0 -477
  35. package/dist/commands/logs.d.ts +0 -3
  36. package/dist/commands/logs.js +0 -184
  37. package/dist/commands/project.d.ts +0 -3
  38. package/dist/commands/project.js +0 -649
  39. package/dist/commands/recover.d.ts +0 -3
  40. package/dist/commands/recover.js +0 -119
  41. package/dist/commands/repo.d.ts +0 -3
  42. package/dist/commands/repo.js +0 -103
  43. package/dist/commands/run.d.ts +0 -3
  44. package/dist/commands/run.js +0 -95
  45. package/dist/commands/start.d.ts +0 -20
  46. package/dist/commands/start.js +0 -344
  47. package/dist/commands/status-refresh.d.ts +0 -9
  48. package/dist/commands/status-refresh.js +0 -27
  49. package/dist/commands/status.d.ts +0 -3
  50. package/dist/commands/status.js +0 -237
  51. package/dist/commands/stop.d.ts +0 -3
  52. package/dist/commands/stop.js +0 -92
  53. package/dist/commands/version.d.ts +0 -3
  54. package/dist/commands/version.js +0 -21
  55. package/dist/completion.d.ts +0 -1
  56. package/dist/completion.js +0 -204
  57. package/dist/config.d.ts +0 -38
  58. package/dist/config.js +0 -82
  59. package/dist/context/context-types.d.ts +0 -36
  60. package/dist/context/context-types.js +0 -1
  61. package/dist/context/generate-context-yaml.d.ts +0 -15
  62. package/dist/context/generate-context-yaml.js +0 -129
  63. package/dist/dashboard/renderer.d.ts +0 -9
  64. package/dist/dashboard/renderer.js +0 -220
  65. package/dist/detection/environment-detector.d.ts +0 -11
  66. package/dist/detection/environment-detector.js +0 -140
  67. package/dist/github/client.d.ts +0 -71
  68. package/dist/github/client.js +0 -348
  69. package/dist/github/gh-auth.d.ts +0 -34
  70. package/dist/github/gh-auth.js +0 -110
  71. package/dist/mapping/smart-defaults.d.ts +0 -17
  72. package/dist/mapping/smart-defaults.js +0 -86
  73. package/dist/orchestrator-runtime.d.ts +0 -1
  74. package/dist/orchestrator-runtime.js +0 -4
  75. package/dist/orchestrator-status-endpoint.d.ts +0 -5
  76. package/dist/orchestrator-status-endpoint.js +0 -27
  77. package/dist/project-selection.d.ts +0 -8
  78. package/dist/project-selection.js +0 -56
  79. package/dist/skills/skill-writer.d.ts +0 -14
  80. package/dist/skills/skill-writer.js +0 -62
  81. package/dist/skills/templates/commit.d.ts +0 -2
  82. package/dist/skills/templates/commit.js +0 -45
  83. package/dist/skills/templates/document.d.ts +0 -7
  84. package/dist/skills/templates/document.js +0 -16
  85. package/dist/skills/templates/gh-project.d.ts +0 -2
  86. package/dist/skills/templates/gh-project.js +0 -88
  87. package/dist/skills/templates/gh-symphony.d.ts +0 -2
  88. package/dist/skills/templates/gh-symphony.js +0 -125
  89. package/dist/skills/templates/index.d.ts +0 -8
  90. package/dist/skills/templates/index.js +0 -28
  91. package/dist/skills/templates/land.d.ts +0 -2
  92. package/dist/skills/templates/land.js +0 -59
  93. package/dist/skills/templates/pull.d.ts +0 -2
  94. package/dist/skills/templates/pull.js +0 -41
  95. package/dist/skills/templates/push.d.ts +0 -2
  96. package/dist/skills/templates/push.js +0 -36
  97. package/dist/skills/types.d.ts +0 -23
  98. package/dist/skills/types.js +0 -1
  99. package/dist/workflow/generate-reference-workflow.d.ts +0 -9
  100. package/dist/workflow/generate-reference-workflow.js +0 -261
  101. package/dist/workflow/generate-workflow-md.d.ts +0 -12
  102. package/dist/workflow/generate-workflow-md.js +0 -134
@@ -1,27 +0,0 @@
1
- import { readFile } from "node:fs/promises";
2
- import { orchestratorPortPath } from "./config.js";
3
- export async function resolveProjectOrchestratorStatusBaseUrl(input) {
4
- const env = input.env ?? process.env;
5
- const explicitBaseUrl = env.ORCHESTRATOR_STATUS_BASE_URL;
6
- if (explicitBaseUrl) {
7
- return explicitBaseUrl;
8
- }
9
- const host = env.ORCHESTRATOR_STATUS_HOST ?? "127.0.0.1";
10
- const port = env.ORCHESTRATOR_STATUS_PORT ??
11
- (await readProjectStatusPort(input.configDir, input.projectId));
12
- if (!port) {
13
- return null;
14
- }
15
- const urlHost = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
16
- return `http://${urlHost}:${port}`;
17
- }
18
- async function readProjectStatusPort(configDir, projectId) {
19
- try {
20
- const raw = await readFile(orchestratorPortPath(configDir, projectId), "utf8");
21
- const port = raw.trim();
22
- return port.length > 0 ? port : null;
23
- }
24
- catch {
25
- return null;
26
- }
27
- }
@@ -1,8 +0,0 @@
1
- import { type CliProjectConfig } from "./config.js";
2
- type ResolveProjectSelectionInput = {
3
- configDir: string;
4
- requestedProjectId?: string;
5
- };
6
- export declare function resolveManagedProjectConfig(input: ResolveProjectSelectionInput): Promise<CliProjectConfig | null>;
7
- export declare function handleMissingManagedProjectConfig(): void;
8
- export {};
@@ -1,56 +0,0 @@
1
- import * as p from "@clack/prompts";
2
- import { loadGlobalConfig, loadProjectConfig, } from "./config.js";
3
- function isInteractiveTerminal() {
4
- return process.stdin.isTTY === true && process.stdout.isTTY === true;
5
- }
6
- function explicitProjectRequiredMessage() {
7
- return "Multiple projects are configured. Re-run with --project-id in non-interactive environments.\n";
8
- }
9
- export async function resolveManagedProjectConfig(input) {
10
- if (input.requestedProjectId) {
11
- return loadProjectConfig(input.configDir, input.requestedProjectId);
12
- }
13
- const global = await loadGlobalConfig(input.configDir);
14
- const projectIds = global?.projects ?? [];
15
- if (projectIds.length === 0) {
16
- return null;
17
- }
18
- if (projectIds.length === 1) {
19
- return loadProjectConfig(input.configDir, projectIds[0]);
20
- }
21
- if (!isInteractiveTerminal()) {
22
- process.stderr.write(explicitProjectRequiredMessage());
23
- process.exitCode = 1;
24
- return null;
25
- }
26
- const projects = await Promise.all(projectIds.map(async (projectId) => ({
27
- projectId,
28
- config: await loadProjectConfig(input.configDir, projectId),
29
- })));
30
- const selected = await p.select({
31
- message: "Select a project:",
32
- options: projects.map(({ projectId, config }) => ({
33
- value: projectId,
34
- label: config?.displayName ?? config?.slug ?? projectId,
35
- hint: projectId === global?.activeProject
36
- ? "current"
37
- : config && config.displayName && config.displayName !== projectId
38
- ? projectId
39
- : undefined,
40
- })),
41
- maxItems: 10,
42
- });
43
- if (p.isCancel(selected)) {
44
- p.cancel("Cancelled.");
45
- process.exitCode = 130;
46
- return null;
47
- }
48
- return loadProjectConfig(input.configDir, selected);
49
- }
50
- export function handleMissingManagedProjectConfig() {
51
- if (process.exitCode) {
52
- return;
53
- }
54
- process.stderr.write("No project configured. Run 'gh-symphony project add' first.\n");
55
- process.exitCode = 1;
56
- }
@@ -1,14 +0,0 @@
1
- import type { SkillTemplate, SkillTemplateContext } from "./types.js";
2
- export declare function resolveSkillsDir(repoRoot: string, runtime: string): string | null;
3
- export declare function writeSkillFile(skillsDir: string, template: SkillTemplate, context: SkillTemplateContext, options?: {
4
- overwrite?: boolean;
5
- }): Promise<{
6
- written: boolean;
7
- path: string;
8
- }>;
9
- export declare function writeAllSkills(repoRoot: string, runtime: string, templates: SkillTemplate[], context: SkillTemplateContext, options?: {
10
- overwrite?: boolean;
11
- }): Promise<{
12
- written: string[];
13
- skipped: string[];
14
- }>;
@@ -1,62 +0,0 @@
1
- import { mkdir, writeFile, readFile } from "node:fs/promises";
2
- import { join } from "node:path";
3
- function normalizeRuntimeForSkills(runtime) {
4
- if (runtime === "claude-code" || runtime.includes("claude-code")) {
5
- return "claude-code";
6
- }
7
- if (runtime === "codex" || runtime.includes("codex")) {
8
- return "codex";
9
- }
10
- return null;
11
- }
12
- export function resolveSkillsDir(repoRoot, runtime) {
13
- const normalizedRuntime = normalizeRuntimeForSkills(runtime);
14
- if (normalizedRuntime === "claude-code") {
15
- return join(repoRoot, ".claude", "skills");
16
- }
17
- if (normalizedRuntime === "codex") {
18
- return join(repoRoot, ".codex", "skills");
19
- }
20
- return null;
21
- }
22
- export async function writeSkillFile(skillsDir, template, context, options) {
23
- const skillDir = join(skillsDir, template.name);
24
- const filePath = join(skillDir, template.fileName);
25
- if (!options?.overwrite) {
26
- try {
27
- await readFile(filePath, "utf8");
28
- return { written: false, path: filePath };
29
- }
30
- catch (error) {
31
- const err = error;
32
- if (err.code !== "ENOENT") {
33
- throw error;
34
- }
35
- }
36
- }
37
- await mkdir(skillDir, { recursive: true });
38
- const content = template.generate(context);
39
- const temporaryPath = `${filePath}.tmp`;
40
- await writeFile(temporaryPath, content, "utf8");
41
- const { rename } = await import("node:fs/promises");
42
- await rename(temporaryPath, filePath);
43
- return { written: true, path: filePath };
44
- }
45
- export async function writeAllSkills(repoRoot, runtime, templates, context, options) {
46
- const skillsDir = resolveSkillsDir(repoRoot, runtime);
47
- if (!skillsDir) {
48
- return { written: [], skipped: [] };
49
- }
50
- const written = [];
51
- const skipped = [];
52
- for (const template of templates) {
53
- const result = await writeSkillFile(skillsDir, template, context, options);
54
- if (result.written) {
55
- written.push(result.path);
56
- }
57
- else {
58
- skipped.push(result.path);
59
- }
60
- }
61
- return { written, skipped };
62
- }
@@ -1,2 +0,0 @@
1
- import type { SkillTemplateContext } from "../types.js";
2
- export declare function generateCommitSkill(_ctx: SkillTemplateContext): string;
@@ -1,45 +0,0 @@
1
- import { renderSkillDocument } from "./document.js";
2
- export function generateCommitSkill(_ctx) {
3
- const lines = [];
4
- lines.push("# /commit — Clean Commit Workflow");
5
- lines.push("");
6
- lines.push("## Trigger");
7
- lines.push("");
8
- lines.push("Use this skill when creating commits during implementation.");
9
- lines.push("");
10
- lines.push("## Rules");
11
- lines.push("");
12
- lines.push("- Commit in logical units — one concern per commit");
13
- lines.push("- Never commit a broken intermediate state (tests must pass)");
14
- lines.push("- Never commit temporary debug code or commented-out blocks");
15
- lines.push("- Run tests before every commit");
16
- lines.push("");
17
- lines.push("## Format");
18
- lines.push("");
19
- lines.push("Use Conventional Commit format:");
20
- lines.push("");
21
- lines.push("```");
22
- lines.push("<type>(<scope>): <description>");
23
- lines.push("");
24
- lines.push("[optional body — explain WHY, not WHAT, 72 chars/line]");
25
- lines.push("");
26
- lines.push("[optional footer: Closes #N]");
27
- lines.push("```");
28
- lines.push("");
29
- lines.push("**Types**: `feat`, `fix`, `refactor`, `test`, `docs`, `chore`");
30
- lines.push("");
31
- lines.push("**Description**: imperative mood, 50 chars max, no period at end");
32
- lines.push("");
33
- lines.push("## Examples");
34
- lines.push("");
35
- lines.push("```");
36
- lines.push("feat(auth): add OAuth2 token refresh");
37
- lines.push("fix(api): handle null response from upstream");
38
- lines.push("test(worker): add retry exhaustion coverage");
39
- lines.push("```");
40
- return renderSkillDocument({
41
- name: "commit",
42
- description: "Create clean, logically scoped commits that keep the repository in a shippable state.",
43
- bodyLines: lines,
44
- });
45
- }
@@ -1,7 +0,0 @@
1
- type SkillDocumentOptions = {
2
- name: string;
3
- description: string;
4
- bodyLines: string[];
5
- };
6
- export declare function renderSkillDocument(options: SkillDocumentOptions): string;
7
- export {};
@@ -1,16 +0,0 @@
1
- export function renderSkillDocument(options) {
2
- const { name, description, bodyLines } = options;
3
- return [
4
- "---",
5
- `name: ${name}`,
6
- `description: ${description}`,
7
- "license: MIT",
8
- "metadata:",
9
- " author: gh-symphony",
10
- ' version: "1.0"',
11
- ' generatedBy: "gh-symphony"',
12
- "---",
13
- "",
14
- ...bodyLines,
15
- ].join("\n");
16
- }
@@ -1,2 +0,0 @@
1
- import type { SkillTemplateContext } from "../types.js";
2
- export declare function generateGhProjectSkill(ctx: SkillTemplateContext): string;
@@ -1,88 +0,0 @@
1
- import { renderSkillDocument } from "./document.js";
2
- export function generateGhProjectSkill(ctx) {
3
- const lines = [];
4
- lines.push("# /gh-project — GitHub Project v2 Status Management");
5
- lines.push("");
6
- lines.push("## Purpose");
7
- lines.push("");
8
- lines.push("Interact with the GitHub Project v2 board to manage issue status,");
9
- lines.push("create workpad comments, and handle follow-up issues.");
10
- lines.push("");
11
- lines.push("## Prerequisites");
12
- lines.push("");
13
- lines.push("- `gh` CLI is authenticated (`gh auth status`)");
14
- lines.push(`- \`${ctx.contextYamlPath}\` exists with field IDs and option IDs`);
15
- lines.push("");
16
- lines.push("## Column ID Quick Reference");
17
- lines.push("");
18
- lines.push(`Status Field ID: \`${ctx.statusFieldId}\``);
19
- lines.push("");
20
- lines.push("| Column Name | Role | Option ID |");
21
- lines.push("|-------------|------|-----------|");
22
- for (const col of ctx.statusColumns) {
23
- const role = col.role ?? "unknown";
24
- lines.push(`| ${col.name} | ${role} | \`${col.id}\` |`);
25
- }
26
- lines.push("");
27
- lines.push("## Operations");
28
- lines.push("");
29
- lines.push("### Change Issue Status");
30
- lines.push("");
31
- lines.push("Use `gh project item-edit` with the field ID and option ID from the table above:");
32
- lines.push("");
33
- lines.push("```bash");
34
- lines.push("# Get the project item ID for an issue");
35
- lines.push("gh project item-list <project-number> --owner <owner> --format json \\");
36
- lines.push(" | jq '.items[] | select(.content.number == <issue-number>) | .id'");
37
- lines.push("");
38
- lines.push("# Update the status field");
39
- lines.push(`gh project item-edit \\`);
40
- lines.push(` --project-id ${ctx.projectId} \\`);
41
- lines.push(` --id <item-id> \\`);
42
- lines.push(` --field-id ${ctx.statusFieldId} \\`);
43
- lines.push(` --single-select-option-id <option-id-from-table-above>`);
44
- lines.push("```");
45
- lines.push("");
46
- lines.push("### Create Workpad Comment");
47
- lines.push("");
48
- lines.push("```bash");
49
- lines.push('gh issue comment <issue-number> --repo <owner>/<repo> --body "## Workpad\\n\\n### Plan\\n- [ ] Task 1"');
50
- lines.push("```");
51
- lines.push("");
52
- lines.push("### Update Existing Comment");
53
- lines.push("");
54
- lines.push("```bash");
55
- lines.push("gh api -X PATCH /repos/<owner>/<repo>/issues/comments/<comment-id> \\");
56
- lines.push(' -f body="## Workpad\\n\\n### Plan\\n- [x] Task 1 (done)"');
57
- lines.push("```");
58
- lines.push("");
59
- lines.push("### Create Follow-up Issue");
60
- lines.push("");
61
- lines.push("```bash");
62
- lines.push("gh issue create --repo <owner>/<repo> \\");
63
- lines.push(' --title "Follow-up: <title>" \\');
64
- lines.push(' --body "<description>" \\');
65
- lines.push(' --label "backlog"');
66
- lines.push("```");
67
- lines.push("");
68
- lines.push("### Add Label");
69
- lines.push("");
70
- lines.push("```bash");
71
- lines.push('gh issue edit <issue-number> --repo <owner>/<repo> --add-label "<label>"');
72
- lines.push("```");
73
- lines.push("");
74
- lines.push("## Rules");
75
- lines.push("");
76
- lines.push("- Always follow the WORKFLOW.md status map flow for state transitions");
77
- lines.push("- Before transitioning to a terminal state, verify the Completion Bar is satisfied:");
78
- lines.push(" - All acceptance criteria checked");
79
- lines.push(" - All tests passing");
80
- lines.push(" - PR merged (if applicable)");
81
- lines.push("- Use the Column ID Quick Reference table above for all status transitions");
82
- lines.push("- Do not transition issues to terminal states without explicit completion verification");
83
- return renderSkillDocument({
84
- name: "gh-project",
85
- description: "Manage GitHub Project v2 issue states, workpad comments, and related follow-up actions.",
86
- bodyLines: lines,
87
- });
88
- }
@@ -1,2 +0,0 @@
1
- import type { SkillTemplateContext } from "../types.js";
2
- export declare function generateGhSymphonySkill(ctx: SkillTemplateContext): string;
@@ -1,125 +0,0 @@
1
- import { renderSkillDocument } from "./document.js";
2
- export function generateGhSymphonySkill(ctx) {
3
- const lines = [];
4
- lines.push("# /gh-symphony — WORKFLOW.md Design & Refinement");
5
- lines.push("");
6
- lines.push("## Trigger");
7
- lines.push("");
8
- lines.push("Use this skill when you want to:");
9
- lines.push("- Create a new WORKFLOW.md for a GitHub Symphony project");
10
- lines.push("- Refine or improve an existing WORKFLOW.md");
11
- lines.push("- Validate that a WORKFLOW.md is correctly structured");
12
- lines.push("");
13
- lines.push("## Prerequisites");
14
- lines.push("");
15
- lines.push(`- \`${ctx.contextYamlPath}\` must exist (contains GitHub Project metadata)`);
16
- lines.push(`- \`${ctx.referenceWorkflowPath}\` must exist (annotated reference template)`);
17
- lines.push("- `gh` CLI must be authenticated");
18
- lines.push("");
19
- lines.push("## Mode Detection");
20
- lines.push("");
21
- lines.push("Check if `WORKFLOW.md` exists in the current directory:");
22
- lines.push("- **Not found** → enter **Design Mode** (create from scratch)");
23
- lines.push("- **Found** → ask user: refine existing or validate only?");
24
- lines.push(" - Refine → enter **Refine Mode**");
25
- lines.push(" - Validate → enter **Validate Mode**");
26
- lines.push("");
27
- lines.push("## Design Mode");
28
- lines.push("");
29
- lines.push(`1. Read \`${ctx.contextYamlPath}\` to understand the project structure`);
30
- lines.push(`2. Read \`${ctx.referenceWorkflowPath}\` as the annotated reference`);
31
- lines.push("3. Ask the user these key questions:");
32
- lines.push(" - Which status columns should be **active** (agent works)?");
33
- lines.push(" - Which should be **wait** (agent pauses for human)?");
34
- lines.push(" - Which should be **terminal** (agent stops)?");
35
- lines.push(" - What runtime is being used? (codex / claude-code / custom)");
36
- lines.push(" - Any custom hooks needed? (after_create, before_run, etc.)");
37
- lines.push("4. Generate WORKFLOW.md using the reference as a structural guide");
38
- lines.push("5. Validate the generated file (see Validate Mode)");
39
- lines.push("");
40
- lines.push("## Refine Mode");
41
- lines.push("");
42
- lines.push("1. Read the current `WORKFLOW.md`");
43
- lines.push(`2. Read \`${ctx.referenceWorkflowPath}\` for comparison`);
44
- lines.push("3. Identify missing or incomplete sections:");
45
- lines.push(" - Status Map with role annotations");
46
- lines.push(" - Default Posture / Agent Instructions");
47
- lines.push(" - Guardrails section");
48
- lines.push(" - Workpad Template");
49
- lines.push(" - Step 0 routing logic");
50
- lines.push("4. Propose improvements and apply with user confirmation");
51
- lines.push("5. Validate the refined file");
52
- lines.push("");
53
- lines.push("## Validate Mode");
54
- lines.push("");
55
- lines.push("Check the WORKFLOW.md for:");
56
- lines.push("- Front matter is valid YAML");
57
- lines.push("- Required fields are present (see Supported Front Matter Fields)");
58
- lines.push("- Template variables use only supported names (see Supported Template Variables)");
59
- lines.push("- Status Map matches the lifecycle configuration");
60
- lines.push("- No unsupported double-brace variable patterns (only the 8 listed below are valid)");
61
- lines.push("");
62
- lines.push("## Supported Front Matter Fields");
63
- lines.push("");
64
- lines.push("```yaml");
65
- lines.push("tracker:");
66
- lines.push(" kind: github-project");
67
- lines.push(" project_id: PVT_xxx");
68
- lines.push(" state_field: Status");
69
- lines.push(" active_states: [Todo, In Progress]");
70
- lines.push(" terminal_states: [Done, Cancelled]");
71
- lines.push(" blocker_check_states: [Blocked]");
72
- lines.push("polling:");
73
- lines.push(" interval_ms: 30000");
74
- lines.push("workspace:");
75
- lines.push(" root: .runtime/symphony-workspaces");
76
- lines.push("hooks:");
77
- lines.push(" after_create: |");
78
- lines.push(" git clone --depth 1 https://github.com/owner/repo .");
79
- lines.push(" before_run: null");
80
- lines.push(" after_run: null");
81
- lines.push(" before_remove: null");
82
- lines.push(" timeout_ms: 60000");
83
- lines.push("agent:");
84
- lines.push(" max_concurrent_agents: 10");
85
- lines.push(" max_retry_backoff_ms: 30000");
86
- lines.push(" retry_base_delay_ms: 10000");
87
- lines.push(" max_turns: 20");
88
- lines.push("codex:");
89
- lines.push(" command: codex app-server");
90
- lines.push(" read_timeout_ms: 5000");
91
- lines.push(" turn_timeout_ms: 3600000");
92
- lines.push(" stall_timeout_ms: 300000");
93
- lines.push("```");
94
- lines.push("");
95
- lines.push("## Supported Template Variables");
96
- lines.push("");
97
- lines.push("Use these in the WORKFLOW.md prompt body (double-brace syntax):");
98
- lines.push("");
99
- lines.push("| Variable | Description |");
100
- lines.push("|----------|-------------|");
101
- lines.push("| `issue.identifier` | e.g. `acme/platform#42` |");
102
- lines.push("| `issue.title` | Issue title |");
103
- lines.push("| `issue.state` | Current tracker state |");
104
- lines.push("| `issue.description` | Issue body |");
105
- lines.push("| `issue.url` | Issue URL |");
106
- lines.push("| `issue.repository` | `owner/name` |");
107
- lines.push("| `issue.number` | Issue number |");
108
- lines.push("| `attempt` | Retry attempt number (null on first run) |");
109
- lines.push("");
110
- lines.push("**Important**: Only these 8 variables are supported. Using any other variable");
111
- lines.push("will cause a runtime error (strict mode validation).");
112
- lines.push("");
113
- lines.push("## Related Skills");
114
- lines.push("");
115
- lines.push("- `/gh-project` — interact with GitHub Project v2 board (status transitions, workpad comments)");
116
- lines.push("- `/commit` — produce clean, logical commits during implementation");
117
- lines.push("- `/push` — keep remote branch current and publish updates");
118
- lines.push("- `/pull` — sync branch with latest origin/main before handoff");
119
- lines.push("- `/land` — merge approved PR and transition issue to Done");
120
- return renderSkillDocument({
121
- name: "gh-symphony",
122
- description: "Design, refine, and validate repository WORKFLOW.md files for GitHub Symphony projects.",
123
- bodyLines: lines,
124
- });
125
- }
@@ -1,8 +0,0 @@
1
- export { generateGhSymphonySkill } from "./gh-symphony.js";
2
- export { generateGhProjectSkill } from "./gh-project.js";
3
- export { generateCommitSkill } from "./commit.js";
4
- export { generatePushSkill } from "./push.js";
5
- export { generatePullSkill } from "./pull.js";
6
- export { generateLandSkill } from "./land.js";
7
- import type { SkillTemplate } from "../types.js";
8
- export declare const ALL_SKILL_TEMPLATES: SkillTemplate[];
@@ -1,28 +0,0 @@
1
- export { generateGhSymphonySkill } from "./gh-symphony.js";
2
- export { generateGhProjectSkill } from "./gh-project.js";
3
- export { generateCommitSkill } from "./commit.js";
4
- export { generatePushSkill } from "./push.js";
5
- export { generatePullSkill } from "./pull.js";
6
- export { generateLandSkill } from "./land.js";
7
- import { generateGhSymphonySkill } from "./gh-symphony.js";
8
- import { generateGhProjectSkill } from "./gh-project.js";
9
- import { generateCommitSkill } from "./commit.js";
10
- import { generatePushSkill } from "./push.js";
11
- import { generatePullSkill } from "./pull.js";
12
- import { generateLandSkill } from "./land.js";
13
- export const ALL_SKILL_TEMPLATES = [
14
- {
15
- name: "gh-symphony",
16
- fileName: "SKILL.md",
17
- generate: generateGhSymphonySkill,
18
- },
19
- {
20
- name: "gh-project",
21
- fileName: "SKILL.md",
22
- generate: generateGhProjectSkill,
23
- },
24
- { name: "commit", fileName: "SKILL.md", generate: generateCommitSkill },
25
- { name: "push", fileName: "SKILL.md", generate: generatePushSkill },
26
- { name: "pull", fileName: "SKILL.md", generate: generatePullSkill },
27
- { name: "land", fileName: "SKILL.md", generate: generateLandSkill },
28
- ];
@@ -1,2 +0,0 @@
1
- import type { SkillTemplateContext } from "../types.js";
2
- export declare function generateLandSkill(_ctx: SkillTemplateContext): string;
@@ -1,59 +0,0 @@
1
- import { renderSkillDocument } from "./document.js";
2
- export function generateLandSkill(_ctx) {
3
- const lines = [];
4
- lines.push("# /land — PR Merge Workflow");
5
- lines.push("");
6
- lines.push("## Trigger");
7
- lines.push("");
8
- lines.push("Use this skill when the issue is in the Merging state (PR approved by human).");
9
- lines.push("Do NOT call `gh pr merge` directly — always go through this flow.");
10
- lines.push("");
11
- lines.push("## Pre-flight Checks");
12
- lines.push("");
13
- lines.push("Before merging, verify ALL of the following:");
14
- lines.push("");
15
- lines.push("1. **PR is approved**:");
16
- lines.push(" ```bash");
17
- lines.push(" gh pr view --json reviews --jq '.reviews[] | select(.state == \"APPROVED\")'");
18
- lines.push(" ```");
19
- lines.push("2. **All CI checks are green**:");
20
- lines.push(" ```bash");
21
- lines.push(" gh pr checks");
22
- lines.push(" ```");
23
- lines.push("3. **Branch is up-to-date with base**:");
24
- lines.push(" ```bash");
25
- lines.push(" git fetch origin && git merge-base --is-ancestor origin/main HEAD");
26
- lines.push(" ```");
27
- lines.push(" If not up-to-date, run the `/pull` skill first.");
28
- lines.push("");
29
- lines.push("## Flow");
30
- lines.push("");
31
- lines.push("1. Run all pre-flight checks above");
32
- lines.push("2. If all checks pass, merge the PR:");
33
- lines.push(" ```bash");
34
- lines.push(" gh pr merge --squash # squash merge (default)");
35
- lines.push(" # or: gh pr merge --merge # merge commit");
36
- lines.push(" # or: gh pr merge --rebase # rebase merge");
37
- lines.push(" ```");
38
- lines.push(" Choose the merge strategy per project policy.");
39
- lines.push("3. On merge success:");
40
- lines.push(" - Use the **gh-project skill** to transition the issue status to Done");
41
- lines.push(" - Do NOT call status APIs directly — delegate to gh-project");
42
- lines.push("4. On merge failure:");
43
- lines.push(" - Record the failure reason in workpad Notes");
44
- lines.push(" - Resolve the blocking issue (re-run pre-flight checks)");
45
- lines.push(" - Retry the merge");
46
- lines.push("5. Loop until merged or blocked by an unresolvable issue");
47
- lines.push("");
48
- lines.push("## Rules");
49
- lines.push("");
50
- lines.push("- Never call `gh pr merge` without completing pre-flight checks");
51
- lines.push("- Status transition to Done MUST go through the gh-project skill");
52
- lines.push("- If any pre-flight check fails, do not merge — fix the issue first");
53
- lines.push("- Record all merge attempts and outcomes in the workpad");
54
- return renderSkillDocument({
55
- name: "land",
56
- description: "Merge approved pull requests safely after verifying approvals, CI, and branch freshness.",
57
- bodyLines: lines,
58
- });
59
- }
@@ -1,2 +0,0 @@
1
- import type { SkillTemplateContext } from "../types.js";
2
- export declare function generatePullSkill(_ctx: SkillTemplateContext): string;
@@ -1,41 +0,0 @@
1
- import { renderSkillDocument } from "./document.js";
2
- export function generatePullSkill(_ctx) {
3
- const lines = [];
4
- lines.push("# /pull — Git Pull / Sync Workflow");
5
- lines.push("");
6
- lines.push("## Trigger");
7
- lines.push("");
8
- lines.push("Use this skill to sync the current branch with the latest `origin/main`");
9
- lines.push("before starting work or before creating a PR.");
10
- lines.push("");
11
- lines.push("## Flow");
12
- lines.push("");
13
- lines.push("1. Fetch latest from remote:");
14
- lines.push(" ```bash");
15
- lines.push(" git fetch origin");
16
- lines.push(" ```");
17
- lines.push("2. Merge into current branch:");
18
- lines.push(" ```bash");
19
- lines.push(" git merge origin/main");
20
- lines.push(" ```");
21
- lines.push("3. If conflicts arise:");
22
- lines.push(" - Resolve each conflict file");
23
- lines.push(" - Run tests to confirm nothing broke");
24
- lines.push(" - Commit the merge: `git commit` (merge commit message is auto-generated)");
25
- lines.push("4. Re-run tests after merge to confirm the integrated state is clean");
26
- lines.push("5. Record pull skill evidence in workpad Notes:");
27
- lines.push(" - merge source (e.g. `origin/main`)");
28
- lines.push(" - result: `clean` or `conflicts resolved`");
29
- lines.push(" - resulting HEAD short SHA: `git rev-parse --short HEAD`");
30
- lines.push("");
31
- lines.push("## Rules");
32
- lines.push("");
33
- lines.push("- Always pull before creating a PR");
34
- lines.push("- Always pull at the start of a new work session");
35
- lines.push("- Record the pull evidence in the workpad before proceeding");
36
- return renderSkillDocument({
37
- name: "pull",
38
- description: "Sync the current branch with the latest remote base before implementation or review handoff.",
39
- bodyLines: lines,
40
- });
41
- }
@@ -1,2 +0,0 @@
1
- import type { SkillTemplateContext } from "../types.js";
2
- export declare function generatePushSkill(_ctx: SkillTemplateContext): string;