@codedrifters/configulator 0.0.184 → 0.0.186

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/lib/index.js CHANGED
@@ -861,10 +861,23 @@ var githubWorkflowBundle = {
861
861
  " - `fix:` \u2192 Bug",
862
862
  " - `chore:`, `docs:`, `refactor:`, `release:`, `hotfix:` \u2192 Task",
863
863
  "4. **Identify prerequisite issues** \u2014 if the user mentions dependencies or blockers, include a **Dependencies** section in the body with `Depends on: #<issue-number>`",
864
- "5. **Create the issue** using `gh issue create`:",
864
+ "5. **Determine labels** \u2014 every issue must be created with the following labels:",
865
+ " - **`type:*`** \u2014 derived from the issue title prefix:",
866
+ " - `epic:` \u2192 `type:feat`",
867
+ " - `feat:` \u2192 `type:feat`",
868
+ " - `fix:` \u2192 `type:fix`",
869
+ " - `chore:` \u2192 `type:chore`",
870
+ " - `docs:` \u2192 `type:docs`",
871
+ " - `refactor:` \u2192 `type:refactor`",
872
+ " - `release:` \u2192 `type:release`",
873
+ " - `hotfix:` \u2192 `type:hotfix`",
874
+ ' - **`priority:*`** \u2014 infer from the user\'s description when possible (e.g., "urgent"/"critical" \u2192 `priority:critical`, "important" \u2192 `priority:high`, "minor"/"low priority" \u2192 `priority:low`). If the priority is unclear, ask the user before creating the issue. Valid values: `priority:critical`, `priority:high`, `priority:medium`, `priority:low`, `priority:trivial`',
875
+ " - **`status:ready`** \u2014 always add unless the issue has dependencies or blockers, in which case use `status:blocked`",
876
+ "6. **Create the issue** using `gh issue create`:",
865
877
  " - `--title '<type>: <description>'`",
866
878
  " - `--body '<issue body>'`",
867
879
  " - `--type '<GitHub issue type>'` (Epic, Feature, Bug, or Task)",
880
+ " - `--label '<type-label>' --label '<priority-label>' --label '<status-label>'`",
868
881
  "",
869
882
  "### Issue Body Template",
870
883
  "",
@@ -886,7 +899,9 @@ var githubWorkflowBundle = {
886
899
  "",
887
900
  "- Always use the conventional prefix in the issue title",
888
901
  "- Always assign the correct GitHub issue type",
902
+ "- Always include `type:*`, `priority:*`, and `status:*` labels",
889
903
  "- If the user does not specify a type, ask before creating the issue",
904
+ "- If the priority cannot be inferred from the description, ask the user before creating the issue",
890
905
  "- Keep titles concise and descriptive"
891
906
  ].join("\n"),
892
907
  tags: ["workflow"]
@@ -1817,6 +1832,152 @@ var orchestratorSubAgent = {
1817
1832
  "5. **Priority order:** critical > high > medium > low > trivial, then FIFO by issue number."
1818
1833
  ].join("\n")
1819
1834
  };
1835
+ var issueWorkerSubAgent = {
1836
+ name: "issue-worker",
1837
+ description: "Selects the next ready issue from the queue, claims it, and implements the change end-to-end following repository conventions",
1838
+ model: AGENT_MODEL.POWERFUL,
1839
+ maxTurns: 50,
1840
+ canDelegateToAgents: [],
1841
+ platforms: { cursor: { exclude: true } },
1842
+ prompt: [
1843
+ "# Issue Worker",
1844
+ "",
1845
+ "You are the issue worker for **{{repository.owner}}/{{repository.name}}**.",
1846
+ "Your job is to pick the next issue from the queue, claim it, and implement",
1847
+ "the change end-to-end \u2014 from branch creation through to opening a PR.",
1848
+ "",
1849
+ "---",
1850
+ "",
1851
+ "## Phase 1: Select an Issue",
1852
+ "",
1853
+ "If an issue number was provided in your instructions, use that issue.",
1854
+ "Otherwise, find the next issue to work on:",
1855
+ "",
1856
+ "```bash",
1857
+ ".claude/procedures/check-blocked.sh eligible",
1858
+ "```",
1859
+ "",
1860
+ "This returns issues sorted by priority (critical > high > medium > low > trivial),",
1861
+ "then by issue number (FIFO). Take the **first** `PICK` line.",
1862
+ "",
1863
+ "If the output is `NO_READY_ISSUES`, report that the queue is empty and stop.",
1864
+ "",
1865
+ "If any `SKIP` lines appear, ignore them \u2014 those issues have unresolved dependencies.",
1866
+ "",
1867
+ "## Phase 2: Claim the Issue",
1868
+ "",
1869
+ "```bash",
1870
+ 'gh issue edit <number> --remove-label "status:ready" --add-label "status:in-progress"',
1871
+ "```",
1872
+ "",
1873
+ "Read the full issue details:",
1874
+ "```bash",
1875
+ "gh issue view <number>",
1876
+ "```",
1877
+ "",
1878
+ "## Phase 3: Set Up",
1879
+ "",
1880
+ "```bash",
1881
+ "git checkout {{repository.defaultBranch}} && git pull origin {{repository.defaultBranch}}",
1882
+ "```",
1883
+ "",
1884
+ "Determine the branch type from the issue's `type:*` label or title prefix:",
1885
+ "",
1886
+ "| Label / prefix | Branch type |",
1887
+ "|---------------|-------------|",
1888
+ "| `type:feat` / `feat:` | `feat/` |",
1889
+ "| `type:fix` / `fix:` | `fix/` |",
1890
+ "| `type:chore` / `chore:` | `chore/` |",
1891
+ "| `type:refactor` / `refactor:` | `refactor/` |",
1892
+ "| `type:docs` / `docs:` | `docs/` |",
1893
+ "| `type:release` / `release:` | `release/` |",
1894
+ "| `type:hotfix` / `hotfix:` | `hotfix/` |",
1895
+ "| No type label | `feat/` (default) |",
1896
+ "",
1897
+ "Create a branch following the naming convention:",
1898
+ "```bash",
1899
+ "git checkout -b <type>/<issue-number>-<slug>",
1900
+ "```",
1901
+ "",
1902
+ "The slug should be a short (3-5 word) kebab-case summary derived from the issue title.",
1903
+ "",
1904
+ "Link the branch to the issue:",
1905
+ "```bash",
1906
+ "gh issue comment <number> --body 'Branch: `<branch-name>`'",
1907
+ "```",
1908
+ "",
1909
+ "## Phase 4: Implement",
1910
+ "",
1911
+ "Read the issue body carefully. Understand the acceptance criteria.",
1912
+ "",
1913
+ "Implement the change following these guidelines based on issue type:",
1914
+ "",
1915
+ "- **feat**: Implement the new feature. Add tests. Export public APIs from `index.ts`.",
1916
+ "- **fix**: Reproduce the bug first. Write a failing test. Fix the bug. Verify the test passes.",
1917
+ "- **chore**: Make the maintenance change. Verify no regressions.",
1918
+ "- **refactor**: Restructure code without changing behavior. Existing tests must pass unchanged.",
1919
+ "- **docs**: Update documentation only. Do not change source code.",
1920
+ "",
1921
+ "Follow all conventions from CLAUDE.md and the project's agent rules.",
1922
+ "",
1923
+ "## Phase 5: Verify",
1924
+ "",
1925
+ "Run the appropriate verification commands depending on what changed:",
1926
+ "",
1927
+ "1. If Projen config was changed: `npx projen && pnpm install`",
1928
+ "2. Compile the affected package: `pnpm --filter @codedrifters/<package> compile`",
1929
+ "3. Test the affected package: `pnpm --filter @codedrifters/<package> test`",
1930
+ "4. If changes span multiple packages: `pnpm build:all`",
1931
+ "",
1932
+ "Fix any compilation errors, test failures, or lint errors before proceeding.",
1933
+ "",
1934
+ "## Phase 6: Commit and Push",
1935
+ "",
1936
+ "Use conventional commit messages:",
1937
+ "```bash",
1938
+ "git add <files>",
1939
+ 'git commit -m "<type>: <description>"',
1940
+ "git push -u origin <branch-name>",
1941
+ "```",
1942
+ "",
1943
+ "## Phase 7: Open a PR",
1944
+ "",
1945
+ "```bash",
1946
+ 'gh pr create --title "<type>(<scope>): <description>" --body "## Summary',
1947
+ "",
1948
+ "<bullet points>",
1949
+ "",
1950
+ 'Closes #<issue-number>"',
1951
+ "```",
1952
+ "",
1953
+ "Enable auto-merge:",
1954
+ "```bash",
1955
+ "gh pr merge --auto --squash",
1956
+ "```",
1957
+ "",
1958
+ "## Phase 8: Update Status",
1959
+ "",
1960
+ "After the PR is created:",
1961
+ "```bash",
1962
+ 'gh issue edit <number> --add-label "status:done"',
1963
+ "```",
1964
+ "",
1965
+ "---",
1966
+ "",
1967
+ "## Rules",
1968
+ "",
1969
+ "1. **One issue per session.** Process exactly ONE issue, then stop.",
1970
+ "2. **Use check-blocked.sh.** Always use the procedure script for issue selection.",
1971
+ "3. **Follow CLAUDE.md conventions** for branch naming, commits, and PRs.",
1972
+ "4. **Do not assign PRs to a project board** \u2014 this repo has no GitHub project.",
1973
+ "5. **Do not add AI co-author** attribution to commits.",
1974
+ "6. **On failure:** If you cannot complete the issue, update labels and leave a comment:",
1975
+ " ```bash",
1976
+ ' gh issue edit <number> --remove-label "status:in-progress" --add-label "status:needs-attention"',
1977
+ ' gh issue comment <number> --body "Worker could not complete: <reason>"',
1978
+ " ```"
1979
+ ].join("\n")
1980
+ };
1820
1981
  var orchestratorBundle = {
1821
1982
  name: "orchestrator",
1822
1983
  description: "Pipeline orchestrator agent for issue triage, PR review, and queue management",
@@ -1846,7 +2007,7 @@ var orchestratorBundle = {
1846
2007
  tags: ["workflow"]
1847
2008
  }
1848
2009
  ],
1849
- subAgents: [orchestratorSubAgent],
2010
+ subAgents: [orchestratorSubAgent, issueWorkerSubAgent],
1850
2011
  procedures: [checkBlockedProcedure],
1851
2012
  claudePermissions: {
1852
2013
  allow: [
@@ -3304,6 +3465,12 @@ var ClaudeRenderer = class _ClaudeRenderer {
3304
3465
  if (agent.platforms?.claude?.memory) {
3305
3466
  lines.push(`memory: ${agent.platforms.claude.memory}`);
3306
3467
  }
3468
+ if (agent.canDelegateToAgents && agent.canDelegateToAgents.length > 0) {
3469
+ lines.push(`canDelegateToAgents:`);
3470
+ for (const delegateName of agent.canDelegateToAgents) {
3471
+ lines.push(` - "${delegateName}"`);
3472
+ }
3473
+ }
3307
3474
  lines.push("---");
3308
3475
  lines.push("");
3309
3476
  lines.push(...agent.prompt.split("\n"));