@pennyfarthing/core 9.0.3 → 9.1.2

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 (111) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/packages/core/dist/cli/commands/doctor.d.ts.map +1 -1
  4. package/packages/core/dist/cli/commands/doctor.js +103 -1
  5. package/packages/core/dist/cli/commands/doctor.js.map +1 -1
  6. package/pennyfarthing-dist/commands/setup.md +65 -0
  7. package/pennyfarthing-dist/scripts/hooks/__pycache__/question_reflector_check.cpython-314.pyc +0 -0
  8. package/pennyfarthing-dist/scripts/hooks/sprint-yaml-validation.sh +78 -0
  9. package/pennyfarthing-dist/scripts/misc/generate-skill-docs.sh +13 -2
  10. package/pennyfarthing-dist/scripts/sprint/validate-sprint-yaml.sh +139 -0
  11. package/pennyfarthing-dist/workflows/patch.yaml +2 -3
  12. package/pennyfarthing-dist/workflows/project-setup/steps/step-01-discover.md +157 -0
  13. package/pennyfarthing-dist/workflows/project-setup/steps/step-02-clone-repos.md +217 -0
  14. package/pennyfarthing-dist/workflows/project-setup/steps/step-03-repos-yaml.md +159 -0
  15. package/pennyfarthing-dist/workflows/project-setup/steps/step-04-claude-md.md +186 -0
  16. package/pennyfarthing-dist/workflows/project-setup/steps/step-05-shared-context.md +185 -0
  17. package/pennyfarthing-dist/workflows/project-setup/steps/step-06-task-runner.md +279 -0
  18. package/pennyfarthing-dist/workflows/project-setup/steps/step-07-theme.md +200 -0
  19. package/pennyfarthing-dist/workflows/project-setup/steps/step-08-cyclist.md +245 -0
  20. package/pennyfarthing-dist/workflows/project-setup/steps/step-09-complete.md +203 -0
  21. package/pennyfarthing-dist/workflows/project-setup/workflow.yaml +41 -0
  22. package/pennyfarthing_scripts/__pycache__/__init__.cpython-311.pyc +0 -0
  23. package/pennyfarthing_scripts/__pycache__/__init__.cpython-314.pyc +0 -0
  24. package/pennyfarthing_scripts/__pycache__/cli.cpython-314.pyc +0 -0
  25. package/pennyfarthing_scripts/__pycache__/config.cpython-314.pyc +0 -0
  26. package/pennyfarthing_scripts/__pycache__/hooks.cpython-314.pyc +0 -0
  27. package/pennyfarthing_scripts/__pycache__/jira.cpython-314.pyc +0 -0
  28. package/pennyfarthing_scripts/__pycache__/jira_bidirectional_sync.cpython-314.pyc +0 -0
  29. package/pennyfarthing_scripts/__pycache__/jira_epic_creation.cpython-314.pyc +0 -0
  30. package/pennyfarthing_scripts/__pycache__/jira_sync.cpython-314.pyc +0 -0
  31. package/pennyfarthing_scripts/__pycache__/jira_sync_story.cpython-314.pyc +0 -0
  32. package/pennyfarthing_scripts/__pycache__/output.cpython-314.pyc +0 -0
  33. package/pennyfarthing_scripts/__pycache__/patch_mode.cpython-314.pyc +0 -0
  34. package/pennyfarthing_scripts/__pycache__/schema_validation_hook.cpython-314.pyc +0 -0
  35. package/pennyfarthing_scripts/__pycache__/sprint.cpython-314.pyc +0 -0
  36. package/pennyfarthing_scripts/__pycache__/workflow.cpython-311.pyc +0 -0
  37. package/pennyfarthing_scripts/__pycache__/workflow.cpython-314.pyc +0 -0
  38. package/pennyfarthing_scripts/brownfield/__pycache__/__init__.cpython-314.pyc +0 -0
  39. package/pennyfarthing_scripts/brownfield/__pycache__/__main__.cpython-314.pyc +0 -0
  40. package/pennyfarthing_scripts/brownfield/__pycache__/cli.cpython-314.pyc +0 -0
  41. package/pennyfarthing_scripts/brownfield/__pycache__/discover.cpython-314.pyc +0 -0
  42. package/pennyfarthing_scripts/common/__pycache__/__init__.cpython-314.pyc +0 -0
  43. package/pennyfarthing_scripts/common/__pycache__/config.cpython-314.pyc +0 -0
  44. package/pennyfarthing_scripts/common/__pycache__/output.cpython-314.pyc +0 -0
  45. package/pennyfarthing_scripts/git/__pycache__/__init__.cpython-314.pyc +0 -0
  46. package/pennyfarthing_scripts/git/__pycache__/create_branches.cpython-314.pyc +0 -0
  47. package/pennyfarthing_scripts/git/__pycache__/status_all.cpython-314.pyc +0 -0
  48. package/pennyfarthing_scripts/jira/__pycache__/__init__.cpython-314.pyc +0 -0
  49. package/pennyfarthing_scripts/jira/__pycache__/__main__.cpython-314.pyc +0 -0
  50. package/pennyfarthing_scripts/jira/__pycache__/bidirectional.cpython-314.pyc +0 -0
  51. package/pennyfarthing_scripts/jira/__pycache__/claim.cpython-314.pyc +0 -0
  52. package/pennyfarthing_scripts/jira/__pycache__/cli.cpython-314.pyc +0 -0
  53. package/pennyfarthing_scripts/jira/__pycache__/client.cpython-314.pyc +0 -0
  54. package/pennyfarthing_scripts/jira/__pycache__/compat.cpython-314.pyc +0 -0
  55. package/pennyfarthing_scripts/jira/__pycache__/epic.cpython-314.pyc +0 -0
  56. package/pennyfarthing_scripts/jira/__pycache__/mappings.cpython-314.pyc +0 -0
  57. package/pennyfarthing_scripts/jira/__pycache__/models.cpython-314.pyc +0 -0
  58. package/pennyfarthing_scripts/jira/__pycache__/story.cpython-314.pyc +0 -0
  59. package/pennyfarthing_scripts/jira/__pycache__/sync.cpython-314.pyc +0 -0
  60. package/pennyfarthing_scripts/migration/__pycache__/__init__.cpython-314.pyc +0 -0
  61. package/pennyfarthing_scripts/migration/__pycache__/__main__.cpython-314.pyc +0 -0
  62. package/pennyfarthing_scripts/migration/__pycache__/cli.cpython-314.pyc +0 -0
  63. package/pennyfarthing_scripts/migration/__pycache__/session.cpython-314.pyc +0 -0
  64. package/pennyfarthing_scripts/migration/__pycache__/skill.cpython-314.pyc +0 -0
  65. package/pennyfarthing_scripts/migration/__pycache__/step.cpython-314.pyc +0 -0
  66. package/pennyfarthing_scripts/migration/__pycache__/validate.cpython-314.pyc +0 -0
  67. package/pennyfarthing_scripts/preflight/__pycache__/__init__.cpython-314.pyc +0 -0
  68. package/pennyfarthing_scripts/preflight/__pycache__/__main__.cpython-314.pyc +0 -0
  69. package/pennyfarthing_scripts/preflight/__pycache__/cli.cpython-314.pyc +0 -0
  70. package/pennyfarthing_scripts/preflight/__pycache__/finish.cpython-314.pyc +0 -0
  71. package/pennyfarthing_scripts/prime/__pycache__/__init__.cpython-314.pyc +0 -0
  72. package/pennyfarthing_scripts/prime/__pycache__/__main__.cpython-314.pyc +0 -0
  73. package/pennyfarthing_scripts/prime/__pycache__/cli.cpython-314.pyc +0 -0
  74. package/pennyfarthing_scripts/prime/__pycache__/loader.cpython-314.pyc +0 -0
  75. package/pennyfarthing_scripts/prime/__pycache__/models.cpython-314.pyc +0 -0
  76. package/pennyfarthing_scripts/prime/__pycache__/persona.cpython-314.pyc +0 -0
  77. package/pennyfarthing_scripts/prime/__pycache__/session.cpython-314.pyc +0 -0
  78. package/pennyfarthing_scripts/prime/__pycache__/tiers.cpython-314.pyc +0 -0
  79. package/pennyfarthing_scripts/prime/__pycache__/workflow.cpython-314.pyc +0 -0
  80. package/pennyfarthing_scripts/sprint/__pycache__/__init__.cpython-314.pyc +0 -0
  81. package/pennyfarthing_scripts/sprint/__pycache__/__main__.cpython-314.pyc +0 -0
  82. package/pennyfarthing_scripts/sprint/__pycache__/archive.cpython-314.pyc +0 -0
  83. package/pennyfarthing_scripts/sprint/__pycache__/archive_epic.cpython-314.pyc +0 -0
  84. package/pennyfarthing_scripts/sprint/__pycache__/cli.cpython-314.pyc +0 -0
  85. package/pennyfarthing_scripts/sprint/__pycache__/loader.cpython-314.pyc +0 -0
  86. package/pennyfarthing_scripts/sprint/__pycache__/status.cpython-314.pyc +0 -0
  87. package/pennyfarthing_scripts/sprint/__pycache__/validator.cpython-314.pyc +0 -0
  88. package/pennyfarthing_scripts/sprint/__pycache__/work.cpython-314.pyc +0 -0
  89. package/pennyfarthing_scripts/story/__pycache__/__init__.cpython-314.pyc +0 -0
  90. package/pennyfarthing_scripts/story/__pycache__/__main__.cpython-314.pyc +0 -0
  91. package/pennyfarthing_scripts/story/__pycache__/cli.cpython-314.pyc +0 -0
  92. package/pennyfarthing_scripts/story/__pycache__/create.cpython-314.pyc +0 -0
  93. package/pennyfarthing_scripts/story/__pycache__/size.cpython-314.pyc +0 -0
  94. package/pennyfarthing_scripts/story/__pycache__/template.cpython-314.pyc +0 -0
  95. package/pennyfarthing_scripts/tests/__pycache__/__init__.cpython-314.pyc +0 -0
  96. package/pennyfarthing_scripts/tests/__pycache__/conftest.cpython-314-pytest-9.0.2.pyc +0 -0
  97. package/pennyfarthing_scripts/tests/__pycache__/test_brownfield.cpython-314-pytest-9.0.2.pyc +0 -0
  98. package/pennyfarthing_scripts/tests/__pycache__/test_cli_modules.cpython-314-pytest-9.0.2.pyc +0 -0
  99. package/pennyfarthing_scripts/tests/__pycache__/test_common.cpython-314-pytest-9.0.2.pyc +0 -0
  100. package/pennyfarthing_scripts/tests/__pycache__/test_git_utils.cpython-314-pytest-9.0.2.pyc +0 -0
  101. package/pennyfarthing_scripts/tests/__pycache__/test_jira_package.cpython-314-pytest-9.0.2.pyc +0 -0
  102. package/pennyfarthing_scripts/tests/__pycache__/test_package_structure.cpython-314-pytest-9.0.2.pyc +0 -0
  103. package/pennyfarthing_scripts/tests/__pycache__/test_patch_mode.cpython-314-pytest-9.0.2.pyc +0 -0
  104. package/pennyfarthing_scripts/tests/__pycache__/test_prime.cpython-314-pytest-9.0.2.pyc +0 -0
  105. package/pennyfarthing_scripts/tests/__pycache__/test_sprint_package.cpython-314-pytest-9.0.2.pyc +0 -0
  106. package/pennyfarthing_scripts/tests/__pycache__/test_sprint_validator.cpython-314-pytest-9.0.2.pyc +0 -0
  107. package/pennyfarthing_scripts/tests/__pycache__/test_story_package.cpython-314-pytest-9.0.2.pyc +0 -0
  108. package/pennyfarthing_scripts/tests/__pycache__/test_tiers.cpython-314-pytest-9.0.2.pyc +0 -0
  109. package/pennyfarthing_scripts/tests/__pycache__/test_token_counting.cpython-314-pytest-9.0.2.pyc +0 -0
  110. package/pennyfarthing_scripts/tests/__pycache__/test_workflow_check.cpython-314-pytest-9.0.2.pyc +0 -0
  111. package/pennyfarthing_scripts/tests/__pycache__/test_workflow_cli.cpython-314-pytest-9.0.2.pyc +0 -0
@@ -0,0 +1,157 @@
1
+ # Step 1: Project Discovery
2
+
3
+ <purpose>
4
+ Discover the project structure, detect repositories, identify tech stack, and gather information needed to configure Pennyfarthing.
5
+ </purpose>
6
+
7
+ <instructions>
8
+ 1. Scan project root for repository structure
9
+ 2. Detect package managers and languages
10
+ 3. Identify monorepo vs single-repo structure
11
+ 4. Find test/build/lint commands
12
+ 5. Present discovery summary for user confirmation
13
+ </instructions>
14
+
15
+ <output>
16
+ - Project structure map
17
+ - Detected repositories with paths
18
+ - Tech stack (languages, frameworks, package managers)
19
+ - Extracted commands (test, build, lint)
20
+ - User-confirmed discovery ready for repos.yaml generation
21
+ </output>
22
+
23
+ ## DISCOVERY TASKS
24
+
25
+ ### 1. Detect Repository Structure
26
+
27
+ Scan for git repositories and orchestrator patterns:
28
+
29
+ ```bash
30
+ # Find all .git directories (indicates repos)
31
+ find . -name ".git" -type d -maxdepth 3 2>/dev/null
32
+
33
+ # Check if this is a monorepo
34
+ ls -la pnpm-workspace.yaml lerna.json turborepo.json package.json 2>/dev/null
35
+
36
+ # Check for orchestrator pattern (sprint/, .session/ directories)
37
+ ls -la sprint/ .session/ 2>/dev/null
38
+
39
+ # Check .gitignore for ignored subrepo patterns
40
+ grep -E "^[a-zA-Z].*-api/?$|^[a-zA-Z].*-ui/?$|^[a-zA-Z]+/$" .gitignore 2>/dev/null
41
+ ```
42
+
43
+ **Classify structure:**
44
+ - **Single repo**: Only `./.git` exists, no sprint/
45
+ - **Monorepo**: Workspace config found (pnpm-workspace.yaml, lerna.json, etc.)
46
+ - **Orchestrator**: Has sprint/ and/or multiple `.git` directories (subrepos)
47
+
48
+ ### 1a. Detect Orchestrator Pattern (Critical)
49
+
50
+ The orchestrator pattern uses gitignored subrepos:
51
+
52
+ ```
53
+ my-project/ # Orchestrator (git repo)
54
+ ├── .gitignore # Contains: my-project-api/, my-project-ui/
55
+ ├── sprint/ # Sprint tracking (key indicator)
56
+ ├── .session/ # Work sessions
57
+ ├── my-project-api/ # Subrepo (separate git, gitignored)
58
+ │ └── .git/
59
+ └── my-project-ui/ # Subrepo (separate git, gitignored)
60
+ └── .git/
61
+ ```
62
+
63
+ **Detection steps:**
64
+ 1. Check for `sprint/` directory → indicates orchestrator
65
+ 2. Parse `.gitignore` for directory patterns (ending in `/`)
66
+ 3. Check if those directories exist AND have their own `.git`
67
+ 4. These are subrepos, not just ignored directories
68
+
69
+ **Example .gitignore patterns to look for:**
70
+ ```gitignore
71
+ # Subrepos (cloned separately)
72
+ conductor-api/
73
+ conductor-ui/
74
+
75
+ # OR with wildcards
76
+ *-api/
77
+ *-ui/
78
+ ```
79
+
80
+ **Important:** Subrepos may not exist yet (not cloned). The .gitignore tells us what SHOULD be there.
81
+
82
+ ### 2. Detect Tech Stack
83
+
84
+ For each repository/directory, check for:
85
+
86
+ | File | Indicates | Extract |
87
+ |------|-----------|---------|
88
+ | `package.json` | Node.js/JavaScript/TypeScript | name, scripts, dependencies |
89
+ | `Cargo.toml` | Rust | name, version |
90
+ | `pyproject.toml` / `requirements.txt` | Python | name, dependencies |
91
+ | `go.mod` | Go | module name |
92
+ | `pom.xml` / `build.gradle` | Java | project info |
93
+ | `tsconfig.json` | TypeScript | compiler options |
94
+
95
+ ### 3. Extract Commands
96
+
97
+ From `package.json` scripts or equivalent:
98
+
99
+ ```yaml
100
+ test_command: npm test | pnpm test | cargo test | pytest
101
+ build_command: npm run build | cargo build | python setup.py build
102
+ lint_command: npm run lint | cargo clippy | ruff check
103
+ dev_command: npm run dev | cargo watch
104
+ ```
105
+
106
+ ### 4. Identify Project Type
107
+
108
+ Based on discovery, classify:
109
+
110
+ | Type | Indicators |
111
+ |------|------------|
112
+ | `api` | Express, FastAPI, Gin, Actix endpoints |
113
+ | `ui` | React, Vue, Svelte, frontend frameworks |
114
+ | `cli` | bin entry in package.json, main.rs with clap |
115
+ | `library` | exports, no bin entry |
116
+ | `orchestrator` | sprint/, .session/, multiple subrepos |
117
+ | `framework` | distributable content, templates |
118
+
119
+ ### 5. Present Discovery Summary
120
+
121
+ ```
122
+ 📁 Project Discovery Summary
123
+ ════════════════════════════
124
+
125
+ Project Name: {detected_name}
126
+ Structure: {single|monorepo|orchestrator}
127
+
128
+ Repositories Found:
129
+ ┌────────────────┬──────────┬────────────┬─────────────────┐
130
+ │ Path │ Type │ Language │ Framework │
131
+ ├────────────────┼──────────┼────────────┼─────────────────┤
132
+ │ . │ {type} │ {lang} │ {framework} │
133
+ │ packages/api │ api │ TypeScript │ Express │
134
+ │ packages/ui │ ui │ TypeScript │ React │
135
+ └────────────────┴──────────┴────────────┴─────────────────┘
136
+
137
+ Detected Commands:
138
+ test: {test_command}
139
+ build: {build_command}
140
+ lint: {lint_command}
141
+
142
+ [C] Confirm and continue to repos.yaml generation
143
+ [E] Edit - let me provide corrections
144
+ [R] Rescan with different parameters
145
+ ```
146
+
147
+ ## SUCCESS CRITERIA
148
+
149
+ ✅ All git repositories detected
150
+ ✅ Tech stack accurately identified
151
+ ✅ Commands extracted from package files
152
+ ✅ Project type classified
153
+ ✅ User confirms discovery is accurate
154
+
155
+ ## NEXT STEP
156
+
157
+ After user confirms with [C], proceed to `step-02-clone-repos.md` to optionally clone subrepos and set up the orchestrator pattern.
@@ -0,0 +1,217 @@
1
+ # Step 2: Clone Subrepos (Optional)
2
+
3
+ <purpose>
4
+ Allow users to clone subrepos to set up or complete an orchestrator pattern. This step enables real-time repo cloning during project setup.
5
+ </purpose>
6
+
7
+ <instructions>
8
+ 1. Analyze discovery results for missing subrepos
9
+ 2. Check .gitignore for expected but missing repos
10
+ 3. Offer to clone missing repos or add new ones
11
+ 4. Update .gitignore with new repo patterns
12
+ 5. Re-scan after cloning to update discovery
13
+ </instructions>
14
+
15
+ <output>
16
+ - Subrepos cloned as needed
17
+ - .gitignore updated with new patterns
18
+ - Discovery data refreshed with new repos
19
+ - User ready to proceed to repos.yaml generation
20
+ </output>
21
+
22
+ ## ORCHESTRATOR PATTERN SETUP
23
+
24
+ ### Detecting Missing Subrepos
25
+
26
+ From step 1, we may have found:
27
+ - Patterns in .gitignore that don't have corresponding directories
28
+ - A sprint/ directory but no subrepos
29
+ - An incomplete orchestrator setup
30
+
31
+ ```
32
+ ⚠️ Orchestrator Pattern Detected - Missing Subrepos
33
+
34
+ Expected (from .gitignore):
35
+ ❌ conductor-api/ (not found)
36
+ ❌ conductor-ui/ (not found)
37
+
38
+ Found:
39
+ ✓ sprint/ (orchestrator confirmed)
40
+ ✓ .pennyfarthing/ (framework installed)
41
+ ```
42
+
43
+ ### Clone Options Menu
44
+
45
+ ```
46
+ 📦 Subrepo Setup
47
+ ════════════════
48
+
49
+ This appears to be an orchestrator project. Would you like to:
50
+
51
+ [C] Clone missing subrepos
52
+ - conductor-api from git@github.com:org/conductor-api.git
53
+ - conductor-ui from git@github.com:org/conductor-ui.git
54
+
55
+ [A] Add a new subrepo
56
+ - Enter repo URL to clone
57
+
58
+ [S] Skip - configure repos.yaml with placeholders
59
+
60
+ [N] Not an orchestrator - this is a standalone project
61
+ ```
62
+
63
+ ### Clone Workflow
64
+
65
+ If user selects [C] or [A]:
66
+
67
+ #### 1. Gather Repository Information
68
+
69
+ ```
70
+ 🔗 Clone Subrepo
71
+ ════════════════
72
+
73
+ Repository URL: {user enters URL}
74
+ Example: git@github.com:org/project-api.git
75
+ Example: https://github.com/org/project-ui.git
76
+
77
+ Local directory name: {auto-detect or user enters}
78
+ Suggested: {project}-api (from URL)
79
+
80
+ Branch to clone: {default: main or develop}
81
+ [Enter] for default, or specify branch
82
+ ```
83
+
84
+ #### 2. Execute Clone
85
+
86
+ ```bash
87
+ # Clone the repository
88
+ git clone {url} {directory_name}
89
+
90
+ # Optionally checkout specific branch
91
+ cd {directory_name} && git checkout {branch}
92
+ ```
93
+
94
+ #### 3. Update .gitignore
95
+
96
+ After successful clone, offer to update .gitignore:
97
+
98
+ ```
99
+ ✓ Cloned {repo_name} to {directory}/
100
+
101
+ Add to .gitignore? [Y/n]
102
+ ```
103
+
104
+ If yes, append:
105
+ ```gitignore
106
+ # Subrepo - clone separately
107
+ {directory_name}/
108
+ ```
109
+
110
+ #### 4. Detect Repo Type
111
+
112
+ After cloning, analyze the new repo:
113
+
114
+ ```
115
+ 📊 Analyzing {directory_name}...
116
+
117
+ Detected:
118
+ Type: api
119
+ Language: TypeScript
120
+ Framework: Express
121
+ Test command: npm test
122
+ Build command: npm run build
123
+
124
+ Is this correct? [Y/n/e]
125
+ ```
126
+
127
+ ### Setting Up New Orchestrator
128
+
129
+ If no orchestrator pattern exists but user wants one:
130
+
131
+ ```
132
+ 🏗️ Create Orchestrator Pattern
133
+ ═══════════════════════════════
134
+
135
+ This will set up your project as an orchestrator:
136
+
137
+ 1. Create sprint/ directory structure
138
+ 2. Create .session/ for work tracking
139
+ 3. Add Pennyfarthing workflow support
140
+
141
+ Subrepos to include:
142
+ [ ] Add API repo
143
+ [ ] Add UI repo
144
+ [ ] Add other repo
145
+
146
+ [P] Proceed with orchestrator setup
147
+ [S] Skip - keep as single repo
148
+ ```
149
+
150
+ ### Common Orchestrator Patterns
151
+
152
+ Offer templates based on project type:
153
+
154
+ ```
155
+ 📋 Orchestrator Templates
156
+ ═════════════════════════
157
+
158
+ [1] API + UI (most common)
159
+ - {project}-api/ (backend)
160
+ - {project}-ui/ (frontend)
161
+
162
+ [2] API + UI + Shared (monorepo-like)
163
+ - {project}-api/
164
+ - {project}-ui/
165
+ - {project}-shared/
166
+
167
+ [3] Microservices
168
+ - {project}-gateway/
169
+ - {project}-service-a/
170
+ - {project}-service-b/
171
+
172
+ [4] Custom - define your own repos
173
+ ```
174
+
175
+ ## RE-SCAN AFTER CHANGES
176
+
177
+ After any cloning or setup:
178
+
179
+ ```bash
180
+ # Re-run discovery
181
+ find . -name ".git" -type d -maxdepth 3
182
+
183
+ # Update tech stack detection
184
+ # (runs same detection as step 1)
185
+ ```
186
+
187
+ Present updated discovery:
188
+
189
+ ```
190
+ 📁 Updated Project Structure
191
+ ════════════════════════════
192
+
193
+ Repositories:
194
+ ┌────────────────┬──────────┬────────────┐
195
+ │ Path │ Type │ Status │
196
+ ├────────────────┼──────────┼────────────┤
197
+ │ . │ orch │ existing │
198
+ │ conductor-api/ │ api │ ✓ cloned │
199
+ │ conductor-ui/ │ ui │ ✓ cloned │
200
+ └────────────────┴──────────┴────────────┘
201
+
202
+ [C] Continue to repos.yaml generation
203
+ [A] Add another repo
204
+ [R] Remove a repo from tracking
205
+ ```
206
+
207
+ ## SUCCESS CRITERIA
208
+
209
+ ✅ All desired subrepos cloned
210
+ ✅ .gitignore properly updated
211
+ ✅ Discovery data refreshed
212
+ ✅ Repo types correctly identified
213
+ ✅ User ready to proceed
214
+
215
+ ## NEXT STEP
216
+
217
+ After repos are cloned and discovery is refreshed, proceed to `step-03-repos-yaml.md` to generate the repos.yaml configuration.
@@ -0,0 +1,159 @@
1
+ # Step 3: Generate repos.yaml
2
+
3
+ <purpose>
4
+ Generate the repos.yaml configuration file based on discovered project structure, with user refinement.
5
+ </purpose>
6
+
7
+ <instructions>
8
+ 1. Transform discovery data into repos.yaml format
9
+ 2. Present draft configuration to user
10
+ 3. Allow user to edit/refine entries
11
+ 4. Write finalized repos.yaml to project root
12
+ </instructions>
13
+
14
+ <output>
15
+ - repos.yaml file created at project root
16
+ - All repositories properly configured
17
+ - Commands and metadata accurate
18
+ - User has approved the configuration
19
+ </output>
20
+
21
+ ## REPOS.YAML STRUCTURE
22
+
23
+ ```yaml
24
+ # Repository Configuration for {project_name}
25
+ # Generated by Pennyfarthing project-setup workflow
26
+
27
+ repos:
28
+ {repo_key}:
29
+ path: {relative_path} # Path from project root
30
+ type: {api|ui|cli|library|orchestrator|framework}
31
+ description: {brief_description}
32
+ language: {typescript|python|rust|go|java}
33
+
34
+ # Commands (optional - omit if not applicable)
35
+ test_command: {command}
36
+ build_command: {command}
37
+ lint_command: {command}
38
+ dev_command: {command}
39
+
40
+ # Additional metadata (optional)
41
+ framework: {express|react|fastapi|etc}
42
+ notes: |
43
+ Any special notes about this repo.
44
+
45
+ # Architecture notes:
46
+ # Add any project-wide architectural notes here
47
+ ```
48
+
49
+ ## GENERATION RULES
50
+
51
+ ### Repo Keys
52
+ - Use lowercase, descriptive names
53
+ - For monorepos: use package names (`api`, `ui`, `shared`)
54
+ - For orchestrators: use `orchestrator` for root, repo names for subrepos
55
+
56
+ ### Path Rules
57
+ - Root repo: use `.`
58
+ - Subrepos: use relative path from project root
59
+ - Monorepo packages: use package path (`packages/api`)
60
+
61
+ ### Type Classification
62
+
63
+ | Type | When to Use |
64
+ |------|-------------|
65
+ | `orchestrator` | Root of multi-repo project with sprint/ |
66
+ | `api` | Backend service, REST/GraphQL endpoints |
67
+ | `ui` | Frontend application |
68
+ | `cli` | Command-line tool |
69
+ | `library` | Shared code, npm package |
70
+ | `framework` | Distributable framework (like pennyfarthing) |
71
+
72
+ ### Command Extraction
73
+
74
+ Extract from discovered package.json scripts:
75
+ ```javascript
76
+ {
77
+ "scripts": {
78
+ "test": "jest", // → test_command: npm test
79
+ "build": "tsc", // → build_command: npm run build
80
+ "lint": "eslint", // → lint_command: npm run lint
81
+ "dev": "nodemon" // → dev_command: npm run dev
82
+ }
83
+ }
84
+ ```
85
+
86
+ ## INTERACTIVE REFINEMENT
87
+
88
+ Present the generated repos.yaml and ask:
89
+
90
+ ```
91
+ 📄 Generated repos.yaml
92
+ ════════════════════════
93
+
94
+ {yaml_content}
95
+
96
+ Options:
97
+ [A] Accept and write to {output_repos}
98
+ [E] Edit a specific repo entry
99
+ [N] Add a new repo entry
100
+ [D] Delete a repo entry
101
+ [P] Preview in different format
102
+ ```
103
+
104
+ ### Edit Flow
105
+ If user selects [E]:
106
+ 1. List repo keys
107
+ 2. Ask which to edit
108
+ 3. Show current values
109
+ 4. Accept new values
110
+ 5. Return to main menu
111
+
112
+ ## EXAMPLE OUTPUT
113
+
114
+ For a typical api+ui project:
115
+
116
+ ```yaml
117
+ # Repository Configuration for my-project
118
+ # Generated by Pennyfarthing project-setup workflow
119
+
120
+ repos:
121
+ orchestrator:
122
+ path: .
123
+ type: orchestrator
124
+ description: Project coordination and sprint management
125
+ language: javascript
126
+
127
+ api:
128
+ path: my-project-api
129
+ type: api
130
+ description: Backend REST API
131
+ language: typescript
132
+ framework: express
133
+ test_command: npm test
134
+ build_command: npm run build
135
+ lint_command: npm run lint
136
+
137
+ ui:
138
+ path: my-project-ui
139
+ type: ui
140
+ description: React frontend application
141
+ language: typescript
142
+ framework: react
143
+ test_command: npm test
144
+ build_command: npm run build
145
+ lint_command: npm run lint
146
+ dev_command: npm run dev
147
+ ```
148
+
149
+ ## SUCCESS CRITERIA
150
+
151
+ ✅ repos.yaml accurately reflects project structure
152
+ ✅ All detected repos included
153
+ ✅ Commands verified and correct
154
+ ✅ User has reviewed and approved
155
+ ✅ File written to project root
156
+
157
+ ## NEXT STEP
158
+
159
+ After repos.yaml is written and approved, proceed to `step-04-claude-md.md` to generate the CLAUDE.md file.
@@ -0,0 +1,186 @@
1
+ # Step 4: Generate CLAUDE.md
2
+
3
+ <purpose>
4
+ Generate the project's CLAUDE.md file - the primary instruction file that Claude Code reads on every session. This file defines project-specific rules, structure, and workflows.
5
+ </purpose>
6
+
7
+ <instructions>
8
+ 1. Analyze repos.yaml and discovered tech stack
9
+ 2. Generate CLAUDE.md with project-specific content
10
+ 3. Include correct commands, structure, and workflows
11
+ 4. Allow user to review and refine
12
+ 5. Write to project root
13
+ </instructions>
14
+
15
+ <output>
16
+ - CLAUDE.md file created at project root
17
+ - Accurate project structure documented
18
+ - Correct build/test/lint commands
19
+ - Appropriate workflow guidance
20
+ - User has approved the content
21
+ </output>
22
+
23
+ ## CLAUDE.MD STRUCTURE
24
+
25
+ ```markdown
26
+ # CLAUDE.md - {Project Name}
27
+
28
+ This file provides guidance to Claude Code when working on this project.
29
+
30
+ ## Project Overview
31
+
32
+ {Brief description of what the project does}
33
+
34
+ **Type:** {orchestrator|api|ui|cli|library|framework}
35
+ **Node:** {version if applicable}
36
+ **Type:** {ES module|CommonJS}
37
+
38
+ ## Repository Structure
39
+
40
+ {if orchestrator}
41
+ ```
42
+ {project_name}/ # Orchestrator
43
+ ├── .claude/ # Claude Code configuration
44
+ ├── .pennyfarthing/ # Pennyfarthing framework
45
+ ├── sprint/ # Sprint tracking
46
+ ├── .session/ # Active work sessions
47
+ ├── {subrepo1}/ # {description}
48
+ └── {subrepo2}/ # {description}
49
+ ```
50
+ {/if}
51
+
52
+ {if monorepo}
53
+ ```
54
+ {project_name}/
55
+ ├── packages/
56
+ │ ├── {package1}/ # {description}
57
+ │ └── {package2}/ # {description}
58
+ ├── .claude/
59
+ └── .pennyfarthing/
60
+ ```
61
+ {/if}
62
+
63
+ {if single_repo}
64
+ ```
65
+ {project_name}/
66
+ ├── src/ # Source code
67
+ ├── tests/ # Tests
68
+ ├── .claude/
69
+ └── .pennyfarthing/
70
+ ```
71
+ {/if}
72
+
73
+ ## Build Commands
74
+
75
+ ```bash
76
+ {build_command} # Build the project
77
+ {test_command} # Run tests
78
+ {lint_command} # Run linter
79
+ {dev_command} # Start development
80
+ ```
81
+
82
+ ## Development Workflow
83
+
84
+ {if has_sprint}
85
+ - `/sm` - Scrum Master (story management)
86
+ - `/tea` - Test Engineer/Architect
87
+ - `/dev` - Developer
88
+ - `/reviewer` - Code Reviewer
89
+ {/if}
90
+
91
+ ## Git Workflow
92
+
93
+ - **Feature branches:** `feat/{story}-{description}`
94
+ - **Bug fixes:** `fix/{issue}-{description}`
95
+ - **PRs target:** `develop` (or `main` if no develop)
96
+
97
+ ## Testing
98
+
99
+ ```bash
100
+ {test_command} # Run all tests
101
+ {test_command} -- --grep "pattern" # Run specific tests
102
+ ```
103
+
104
+ ## Important Notes
105
+
106
+ {Project-specific notes, gotchas, conventions}
107
+ ```
108
+
109
+ ## GENERATION LOGIC
110
+
111
+ ### 1. Extract from repos.yaml
112
+
113
+ Read the repos.yaml created in step 2:
114
+ - Project name from orchestrator/root repo
115
+ - Type from repo classification
116
+ - Commands from each repo
117
+
118
+ ### 2. Detect Additional Context
119
+
120
+ Scan for:
121
+ - `tsconfig.json` → TypeScript config details
122
+ - `jest.config.*` → Test framework config
123
+ - `.eslintrc.*` → Linting config
124
+ - `Dockerfile` → Container info
125
+ - CI config (`.github/workflows/`, `.gitlab-ci.yml`)
126
+
127
+ ### 3. Include Pennyfarthing Integration
128
+
129
+ If sprint/ exists:
130
+ ```markdown
131
+ ## Sprint Management
132
+
133
+ - `/sprint status` - View current sprint
134
+ - `/sprint backlog` - Available stories
135
+ - `/sprint work` - Start a story
136
+ ```
137
+
138
+ ### 4. Add Project-Specific Sections
139
+
140
+ Based on tech stack:
141
+
142
+ **For TypeScript projects:**
143
+ ```markdown
144
+ ## TypeScript
145
+
146
+ - Use `.js` extensions in imports
147
+ - Strict mode enabled
148
+ - ES modules (`"type": "module"`)
149
+ ```
150
+
151
+ **For React projects:**
152
+ ```markdown
153
+ ## React Patterns
154
+
155
+ - Functional components with hooks
156
+ - Component files in `src/components/`
157
+ - Tests co-located with components
158
+ ```
159
+
160
+ ## INTERACTIVE REFINEMENT
161
+
162
+ ```
163
+ 📄 Generated CLAUDE.md
164
+ ═══════════════════════
165
+
166
+ {preview of generated content}
167
+
168
+ Options:
169
+ [A] Accept and write to CLAUDE.md
170
+ [E] Edit a section
171
+ [S] Add a new section
172
+ [R] Regenerate with different focus
173
+ [P] Preview full content
174
+ ```
175
+
176
+ ## SUCCESS CRITERIA
177
+
178
+ ✅ CLAUDE.md accurately describes project
179
+ ✅ Commands are correct and tested
180
+ ✅ Structure matches actual project
181
+ ✅ Workflows appropriate for project type
182
+ ✅ User has reviewed and approved
183
+
184
+ ## NEXT STEP
185
+
186
+ After CLAUDE.md is written, proceed to `step-05-shared-context.md` to populate the shared-context.md file.