@fiftth/fiftth-cli 1.0.1 → 1.1.1

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 (116) hide show
  1. package/.fiftthnexus/.github/workflows/copilot-orchestrator.yml +78 -0
  2. package/.fiftthnexus/actions/Dockerfile +34 -0
  3. package/.fiftthnexus/actions/copilot-agent.mjs +269 -0
  4. package/.fiftthnexus/actions/package.json +8 -0
  5. package/.fiftthnexus/orchestrator.ts +2304 -0
  6. package/.fiftthnexus/skills/env-implement-prompt.md +65 -0
  7. package/.fiftthnexus/skills/env-plan-prompt.md +33 -0
  8. package/.fiftthnexus/skills/env-review-prompt.md +61 -0
  9. package/.fiftthnexus/skills/grill-me.md +9 -0
  10. package/.fiftthnexus/skills/prd-to-issues.md +150 -0
  11. package/.fiftthnexus/skills/write-prd.md +70 -0
  12. package/README.md +216 -25
  13. package/dist/api/client.d.ts +6 -0
  14. package/dist/api/client.d.ts.map +1 -1
  15. package/dist/api/client.js +13 -2
  16. package/dist/api/client.js.map +1 -1
  17. package/dist/commands/checkout.d.ts +6 -1
  18. package/dist/commands/checkout.d.ts.map +1 -1
  19. package/dist/commands/checkout.js +415 -44
  20. package/dist/commands/checkout.js.map +1 -1
  21. package/dist/commands/login.d.ts +0 -2
  22. package/dist/commands/login.d.ts.map +1 -1
  23. package/dist/commands/login.js +83 -32
  24. package/dist/commands/login.js.map +1 -1
  25. package/dist/commands/model.d.ts +2 -0
  26. package/dist/commands/model.d.ts.map +1 -0
  27. package/dist/commands/model.js +32 -0
  28. package/dist/commands/model.js.map +1 -0
  29. package/dist/commands/planningContext.d.ts +6 -0
  30. package/dist/commands/planningContext.d.ts.map +1 -0
  31. package/dist/commands/planningContext.js +91 -0
  32. package/dist/commands/planningContext.js.map +1 -0
  33. package/dist/commands/repo.d.ts.map +1 -1
  34. package/dist/commands/repo.js +38 -15
  35. package/dist/commands/repo.js.map +1 -1
  36. package/dist/commands/skills.d.ts +2 -0
  37. package/dist/commands/skills.d.ts.map +1 -0
  38. package/dist/commands/skills.js +123 -0
  39. package/dist/commands/skills.js.map +1 -0
  40. package/dist/commands/use.d.ts +1 -5
  41. package/dist/commands/use.d.ts.map +1 -1
  42. package/dist/commands/use.js +63 -48
  43. package/dist/commands/use.js.map +1 -1
  44. package/dist/index.js +86 -27
  45. package/dist/index.js.map +1 -1
  46. package/dist/services/nexusService.d.ts +30 -0
  47. package/dist/services/nexusService.d.ts.map +1 -0
  48. package/dist/services/nexusService.js +188 -0
  49. package/dist/services/nexusService.js.map +1 -0
  50. package/dist/services/prdService.d.ts +12 -0
  51. package/dist/services/prdService.d.ts.map +1 -0
  52. package/dist/services/prdService.js +103 -0
  53. package/dist/services/prdService.js.map +1 -0
  54. package/dist/services/taskSelection.d.ts +10 -0
  55. package/dist/services/taskSelection.d.ts.map +1 -0
  56. package/dist/services/taskSelection.js +112 -0
  57. package/dist/services/taskSelection.js.map +1 -0
  58. package/dist/services/taskService.d.ts +23 -1
  59. package/dist/services/taskService.d.ts.map +1 -1
  60. package/dist/services/taskService.js +118 -12
  61. package/dist/services/taskService.js.map +1 -1
  62. package/dist/utils/config.d.ts +2 -0
  63. package/dist/utils/config.d.ts.map +1 -1
  64. package/dist/utils/config.js +20 -3
  65. package/dist/utils/config.js.map +1 -1
  66. package/dist/utils/dashboard.d.ts +65 -0
  67. package/dist/utils/dashboard.d.ts.map +1 -0
  68. package/dist/utils/dashboard.js +205 -0
  69. package/dist/utils/dashboard.js.map +1 -0
  70. package/dist/utils/models.d.ts +14 -0
  71. package/dist/utils/models.d.ts.map +1 -0
  72. package/dist/utils/models.js +89 -0
  73. package/dist/utils/models.js.map +1 -0
  74. package/dist/utils/ui.d.ts +6 -0
  75. package/dist/utils/ui.d.ts.map +1 -1
  76. package/dist/utils/ui.js +22 -1
  77. package/dist/utils/ui.js.map +1 -1
  78. package/dist/utils/version.d.ts +4 -0
  79. package/dist/utils/version.d.ts.map +1 -0
  80. package/dist/utils/version.js +26 -0
  81. package/dist/utils/version.js.map +1 -0
  82. package/package.json +9 -4
  83. package/.github/workflows/publish-npm.yml +0 -62
  84. package/dist/commands/tasks.d.ts +0 -2
  85. package/dist/commands/tasks.d.ts.map +0 -1
  86. package/dist/commands/tasks.js +0 -69
  87. package/dist/commands/tasks.js.map +0 -1
  88. package/dist/context/runtimeContext.d.ts +0 -14
  89. package/dist/context/runtimeContext.d.ts.map +0 -1
  90. package/dist/context/runtimeContext.js +0 -21
  91. package/dist/context/runtimeContext.js.map +0 -1
  92. package/dist/services/taskContext.d.ts +0 -14
  93. package/dist/services/taskContext.d.ts.map +0 -1
  94. package/dist/services/taskContext.js +0 -15
  95. package/dist/services/taskContext.js.map +0 -1
  96. package/dist/utils/api.d.ts +0 -10
  97. package/dist/utils/api.d.ts.map +0 -1
  98. package/dist/utils/api.js +0 -25
  99. package/dist/utils/api.js.map +0 -1
  100. package/src/api/client.ts +0 -31
  101. package/src/commands/checkout.ts +0 -101
  102. package/src/commands/login.ts +0 -145
  103. package/src/commands/repo.ts +0 -113
  104. package/src/commands/tasks.ts +0 -86
  105. package/src/commands/use.ts +0 -149
  106. package/src/config/configService.ts +0 -56
  107. package/src/context/runtimeContext.ts +0 -42
  108. package/src/git/gitService.ts +0 -29
  109. package/src/index.ts +0 -133
  110. package/src/services/taskContext.ts +0 -32
  111. package/src/services/taskService.ts +0 -53
  112. package/src/utils/api.ts +0 -41
  113. package/src/utils/config.ts +0 -48
  114. package/src/utils/ui.ts +0 -46
  115. package/tsconfig.json +0 -18
  116. package/vitest.config.ts +0 -8
@@ -0,0 +1,65 @@
1
+ # TASK
2
+
3
+ Fix issue #{{ISSUE_NUMBER}}: {{ISSUE_TITLE}}
4
+
5
+ <issue>
6
+
7
+ !`gh issue view {{ISSUE_NUMBER}}`
8
+
9
+ </issue>
10
+
11
+ Only work on the issue specified.
12
+
13
+ Work on branch {{BRANCH}}. Make commits, run tests, and close the issue when done.
14
+
15
+ # CONTEXT
16
+
17
+ Here are the last 2 commits:
18
+
19
+ <recent-commits>
20
+
21
+ !`git log -n 2 --format="%H%n%ad%n%B---" --date=short`
22
+
23
+ </recent-commits>
24
+
25
+ # EXPLORATION
26
+
27
+ Explore the repo and fill your context window with relevant information that will allow you to complete the task.
28
+
29
+ Pay extra attention to test files that touch the relevant parts of the code.
30
+
31
+ # EXECUTION
32
+
33
+ If applicable, use RGR to complete the task.
34
+
35
+ ## Scope Discipline
36
+
37
+ - Change only the files directly required to complete the issue.
38
+ - Before editing a file, confirm it is required by the issue.
39
+
40
+ 1. RED: write one test
41
+ 2. GREEN: write the implementation to pass that test
42
+ 3. REPEAT until done
43
+ 4. REFACTOR the code
44
+
45
+ # COMMIT
46
+
47
+ Make a git commit. The commit message must:
48
+
49
+ 1. Start with `RALPH:` prefix
50
+ 2. Include task completed + PRD reference
51
+ 3. Key decisions made
52
+ 4. Files changed
53
+ 5. Blockers or notes for next iteration
54
+
55
+ Keep it concise.
56
+
57
+ # THE ISSUE
58
+ Do not close the issue - this will be done later.
59
+
60
+ Once complete, output <promise>COMPLETE</promise>.
61
+
62
+ # FINAL RULES
63
+
64
+ ONLY WORK ON A SINGLE TASK.
65
+ DO NOT MODIFY UNRELATED FILES.
@@ -0,0 +1,33 @@
1
+ # ISSUES
2
+
3
+ Here are the open issues in the repo:
4
+
5
+ <issues-json>
6
+
7
+ !`gh issue list --state open --label ai-running-orchestrator --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'`
8
+
9
+ </issues-json>
10
+
11
+ # TASK
12
+
13
+ Analyze the open issues and build a dependency graph. For each issue, determine whether it **blocks** or **is blocked by** any other open issue.
14
+
15
+ An issue B is **blocked by** issue A if:
16
+
17
+ - B requires code or infrastructure that A introduces
18
+ - B and A modify overlapping files or modules, making concurrent work likely to produce merge conflicts
19
+ - B's requirements depend on a decision or API shape that A will establish
20
+
21
+ An issue is **unblocked** if it has zero blocking dependencies on other open issues.
22
+
23
+ For each unblocked issue, assign a branch name using the format `fiftth/PRD-{parent-prd-number}`. If there is no parent PRD number available, use `fiftth/PRD-{number}` as a fallback.
24
+
25
+ # OUTPUT
26
+
27
+ Output your plan as a JSON object wrapped in `<plan>` tags:
28
+
29
+ <plan>
30
+ {"issues": [{"number": 42, "title": "Fix auth bug", "branch": "fiftth/PRD-42"}]}
31
+ </plan>
32
+
33
+ Include only unblocked issues. If every issue is blocked, include the single highest-priority candidate (the one with the fewest or weakest dependencies).
@@ -0,0 +1,61 @@
1
+ # TASK
2
+
3
+ Review the code changes on branch {{BRANCH}} for issue #{{ISSUE_NUMBER}}: {{ISSUE_TITLE}}
4
+
5
+ You are doing a lightweight final review pass on an implementation that already happened.
6
+ Your job is to catch a concrete blocker quickly, not to reopen the whole task.
7
+
8
+ # CONTEXT
9
+
10
+ <issue>
11
+
12
+ !`gh issue view {{ISSUE_NUMBER}}`
13
+
14
+ </issue>
15
+
16
+
17
+ # SCOPE GUARDRAILS
18
+
19
+ - Review only the files already present in the diff, plus tests that are directly needed to validate those changes.
20
+ - Do not perform opportunistic cleanup, formatting, renames, broad refactors, or second-pass feature work.
21
+ - Prefer a fast stop over exhaustive analysis when the diff already looks sound.
22
+
23
+ # REVIEW PROCESS
24
+
25
+ ## 1. Inspect only the changed code paths
26
+
27
+ Read the diff carefully. Focus on concrete correctness risks in the changed paths: fragile logic, unchecked assumptions, missing guards, incorrect conditionals, or missing test coverage that can be demonstrated quickly.
28
+
29
+ ## 2. Run targeted validation
30
+
31
+ Run only the smallest validation needed for confidence in the changed paths. Prefer targeted tests or a focused build command over broad exploratory work.
32
+
33
+ ## 3. Fix only concrete blockers
34
+
35
+ If you can show a concrete bug, missing guard, or missing focused test, fix it.
36
+ If you cannot demonstrate a real problem quickly, do not widen the scope.
37
+
38
+ ## 4. Keep the pass small
39
+
40
+ This review stage is not a second implementation stage.
41
+ Avoid exhaustive audits, broad maintainability rewrites, or speculative edge-case hunts.
42
+
43
+ ## 5. Apply project standards
44
+
45
+ Follow the established coding standards in the project.
46
+
47
+ ## 6. Preserve functionality
48
+
49
+ Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact.
50
+ Never widen the scope of the branch by editing unrelated modules.
51
+
52
+ # EXECUTION
53
+
54
+ 1. Inspect the diff and the surrounding code needed to understand it.
55
+ 2. Run targeted validation for the risky changed paths.
56
+ 3. If you make a follow-up fix, keep it small and commit once with a message starting with `RALPH: Review -`.
57
+ 4. If no concrete blocker is found, stop without making extra edits.
58
+
59
+ If the code is already sound, do nothing.
60
+
61
+ Once complete, output <promise>COMPLETE</promise>.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: grill-me
3
+ description: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
4
+ ---
5
+
6
+ Interview me relentlessly about every aspect of this plan until we reach a shared understanding.
7
+ Walk down each branch of the design tree resolving dependencies between decisions one by one.
8
+ If a question can be answered by exploring the codebase, explore the codebase instead.
9
+ For each question, provide your recommended answer. Only implement after user request.
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: prd-to-issues
3
+ description: Break a PRD into independently-grabbable GitHub issues with priority labels and dependency metadata, ready for the Copilot orchestrator. Use when user wants to convert a PRD to issues, create implementation tickets, or break down a PRD into work items.
4
+ ---
5
+
6
+ # PRD to Issues
7
+
8
+ Break a PRD into independently-grabbable GitHub issues using vertical slices (tracer bullets).
9
+ Issues are created **ready for the orchestrator** — with priority labels, dependency metadata, and the ai-running-orchestrator label.
10
+
11
+ This workflow is repository-scoped. If a task spans multiple repositories, run it once per repository against that repository's PRD.
12
+ This workflow must not create child issues in a repository that does not match the task and repository metadata of the selected PRD.
13
+
14
+ ## Process
15
+
16
+ ### 1. Locate the PRD
17
+
18
+ Ask the user for the PRD GitHub issue number (or URL).
19
+ If the PRD is not already in your context window, fetch it with gh issue view <number> (with comments).
20
+
21
+ ### 1.5 Validate repository scope
22
+
23
+ Extract the `task-id` and `repository` metadata from the PRD body.
24
+ Run `fiftth planning-context <TASK_ID> --json` from the current repository.
25
+ If the command reports `repositoryMatch: false`, or if `currentRepository` does not equal the PRD `repository` metadata, stop immediately and tell the user to switch to the correct repository before creating child issues.
26
+
27
+ ### 2. Explore the codebase (optional)
28
+
29
+ If you have not already explored the codebase, do so to understand the current state of the code.
30
+
31
+ ### 3. Draft vertical slices
32
+
33
+ Break the PRD into **tracer bullet** issues.
34
+ Each issue is a thin vertical slice that cuts through ALL integration layers end-to-end, NOT a horizontal slice of one layer.
35
+
36
+ Slices may be 'HITL' or 'AFK'. HITL slices require human interaction, such as an architectural decision or a design review.
37
+ AFK slices can be implemented and merged without human interaction. Prefer AFK over HITL where possible.
38
+
39
+ <vertical-slice-rules>
40
+ - Each slice delivers a narrow but COMPLETE path through every layer (schema, API, UI, tests)
41
+ - A completed slice is demoable or verifiable on its own
42
+ - Prefer many thin slices over few thick ones
43
+ </vertical-slice-rules>
44
+
45
+ ### 4. Assign priority to each slice
46
+
47
+ Assign a priority to each slice based on execution order and criticality:
48
+
49
+ <priority-rules>
50
+ - **P0-critical**: Foundation slices that everything else depends on (schema changes, core API). These MUST be done first.
51
+ - **P1-high**: Core feature slices that deliver the primary value. Depend on P0 but can run in parallel with each other.
52
+ - **P2-medium**: Enhancement slices that improve the feature but aren't essential for the first pass.
53
+ - **P3-low**: Polish, edge cases, nice-to-haves. Can be done last or deferred.
54
+ </priority-rules>
55
+
56
+ The priority assignment must reflect the **natural execution order**: if slice B depends on slice A, then A must have equal or higher priority than B.
57
+
58
+ ### 5. Quiz the user
59
+
60
+ Present the proposed breakdown as a numbered list. For each slice, show:
61
+ - **Title**: short descriptive name
62
+ - **Type**: HITL / AFK
63
+ - **Priority**: P0 / P1 / P2 / P3
64
+ - **Blocked by**: which other slices (if any) must complete first
65
+ - **User stories covered**: which user stories from the PRD this addresses
66
+
67
+ Ask the user:
68
+ - Does the granularity feel right? (too coarse / too fine)
69
+ - Are the dependency relationships correct?
70
+ - Are the priorities correct? (Do they reflect the right execution order?)
71
+ - Should any slices be merged or split further?
72
+ - Are the correct slices marked as HITL and AFK?
73
+
74
+ Iterate until the user approves the breakdown.
75
+
76
+ ### 6. Create the GitHub issues
77
+
78
+ For each approved slice, create a GitHub issue using gh issue create.
79
+ **Create issues in dependency order** (blockers first) so you can reference real issue numbers in the "Blocked by" field.
80
+
81
+ For each issue, use the following command format:
82
+
83
+ ```bash
84
+ gh issue create \
85
+ --title "<title>" \
86
+ --label "ai-running-orchestrator" \
87
+ --label "<priority-label>" \
88
+ --body "<body>"
89
+ ```
90
+
91
+ Where <priority-label> is one of: P0-critical, P1-high, P2-medium, P3-low.
92
+ Use the issue body template below.
93
+
94
+ <issue-template>
95
+ ## Parent PRD
96
+ #<prd-issue-number>
97
+
98
+ ## Task Metadata
99
+ task-id: <TASK_ID>
100
+ repository: <OWNER/REPO>
101
+
102
+ ## What to build
103
+ A concise description of this vertical slice. Describe the end-to-end behavior, not layer-by-layer implementation.
104
+ Reference specific sections of the parent PRD rather than duplicating content.
105
+
106
+ ## Acceptance criteria
107
+ - [ ] Criterion 1
108
+ - [ ] Criterion 2
109
+ - [ ] Criterion 3
110
+
111
+ ## Dependencies
112
+ depends-on: #<issue-number>
113
+ depends-on: #<issue-number>
114
+
115
+ Or "None — can start immediately" if no blockers.
116
+
117
+ ## User stories addressed
118
+ Reference by number from the parent PRD:
119
+ - User story 3
120
+ - User story 7
121
+
122
+ ## Type
123
+ AFK / HITL
124
+ </issue-template>
125
+
126
+ ### Important rules for issue creation
127
+
128
+ 1. Every issue MUST have the ai-running-orchestrator label — this is how the orchestrator finds them.
129
+ 2. Every issue MUST have exactly ONE priority label (P0-critical, P1-high, P2-medium, or P3-low).
130
+ 3. Dependencies MUST use the exact format depends-on: #<number> — this is what the orchestrator parses.
131
+ 4. Every child issue MUST include the same task metadata as the parent PRD in the issue body.
132
+ 5. Create issues in dependency order so you can reference real issue numbers.
133
+ 6. Do NOT close or modify the parent PRD issue.
134
+ 7. HITL issues should NOT get the ai-running-orchestrator label — the orchestrator only assigns AFK work to Copilot. Instead, label HITL issues with just the priority label so they are tracked but not auto-assigned.
135
+
136
+ ### After creation
137
+
138
+ Once all issues are created, print a summary table:
139
+
140
+ | # | Title | Priority | Blocked By | Type |
141
+ |---|-------|----------|------------|------|
142
+ | #42 | Add user schema | P0-critical | None | AFK |
143
+ | #43 | Create API endpoint | P1-high | #42 | AFK |
144
+ | #44 | Build UI form | P1-high | #42 | AFK |
145
+ | #45 | Design review | P1-high | None | HITL |
146
+
147
+ Tell the user:
148
+ - "All AFK issues have been labeled with ai-running-orchestrator and are ready for the orchestrator."
149
+ - "Run the orchestrator to start: npx tsx custom-agents/actions/orchestrator.ts"
150
+ - "Or trigger it from GitHub Actions: Actions → Copilot Parallel Orchestrator → Run workflow"
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: write-a-prd
3
+ description: Create a PRD through user interview, codebase exploration, and module design, then submit as a GitHub issue. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.
4
+ ---
5
+
6
+ This skill will be invoked when the user wants to create a PRD. You may skip steps if you don't consider them necessary.
7
+
8
+ This workflow is repository-scoped. If a task spans multiple repositories, create one PRD per repository in the repository currently being analyzed.
9
+ This workflow must never create a PRD in a repository that is not linked to the selected Fiftth task.
10
+ When you create the PRD issue, add the `dev-report` label.
11
+
12
+ 1. Ask the user for a long, detailed description of the problem they want to solve and any potential ideas for solutions.
13
+ 2. Ask which Fiftth task the user wants to work on. If they do not provide a task id directly, ask them to choose the task first.
14
+ 3. Before exploring or drafting the PRD, run `fiftth planning-context <TASK_ID> --json` from the current repository.
15
+ 4. Read the command output and verify that `repositoryMatch` is `true`.
16
+ 5. If `repositoryMatch` is `false`, stop immediately. Tell the user that the current repository does not belong to the selected task, list the repositories returned by the command, and do not create a PRD issue in the current repository.
17
+ 6. If `repositoryMatch` is `true`, use the `currentRepository` returned by the command as the repository metadata for the PRD and continue.
18
+ 7. Explore the repo to verify thir assertions and understand the current state of the codebase.
19
+ 8. Interview the user relentlessly about every aspect of this plan until you reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one.
20
+ 9. Sketch out the major modules you will need to build or modify to complete the implementation. Actively look for opportunities to extract deep modules that can be tested in isolation. A deep module (as opposed to a shallow module) is one which encapsulates a lot of functionality in a simple, testable interface which rarely changes. Check with the user that these modules match their expectations. Check with the user which modules they want tests written for.
21
+ 10. Once you have a complete understanding of the problem and solution, use the template below to write the PRD. The PRD should be submitted as a GitHub issue.
22
+
23
+ <prd-title-issue>PRD[<TASK_ID>]: <RESUMED_DESCRIPTION></prd-title-issue>
24
+
25
+ <prd-template>
26
+ ## Task Metadata
27
+ task-id: <TASK_ID>
28
+ repository: <OWNER/REPO>
29
+
30
+ ## Problem Statement
31
+ The problem that the user is facing, from the user's perspective.
32
+
33
+ ## Solution
34
+ The solution to the problem, from the user's perspective.
35
+
36
+ ## User Stories
37
+ A LONG, numbered list of user stories. Each user story should be in the format of:
38
+
39
+ 1. As an <actor>, I want a <feature>, so that <benefit>
40
+
41
+ <user-story-example>
42
+ 1. As a mobile bank customer, I want to see balance on my accounts, so that I can make better informed decisions about my spending
43
+ </user-story-example>
44
+
45
+ This list of user stories should be extremely extensive and cover all aspects of the feature.
46
+
47
+ ## Implementation Decisions
48
+ A list of implementation decisions that were made. This can include:
49
+ - The modules that will be built/modified
50
+ - The interfaces of those modules that will be modified
51
+ - Technical clarifications from the developer
52
+ - Architectural decisions
53
+ - Schema changes
54
+ - API contracts
55
+ - Specific interactions
56
+
57
+ Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
58
+
59
+ ## Testing Decisions
60
+ A list of testing decisions that were made. Include:
61
+ - A description of what makes a good test (only test external behavior, not implementation details)
62
+ - Which modules will be tested
63
+ - Prior art for the tests (i.e. similar types of tests in the codebase)
64
+
65
+ ## Out of Scope
66
+ A description of the things that are out of scope for this PRD.
67
+
68
+ ## Further Notes
69
+ Any further notes about the feature.
70
+ </prd-template>