Skip to content

Commit 7369613

Browse files
authored
Merge branch 'develop' into security-scanning
2 parents ac240c4 + 5966b13 commit 7369613

493 files changed

Lines changed: 46514 additions & 13467 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@
1313
"Bash(git log *)",
1414
"Bash(cd apps/*)",
1515
"Bash(cd scripts/*)",
16-
"mcp__playwright__browser_press_key"
16+
"mcp__playwright__browser_press_key",
17+
"Bash(npm test:*)",
18+
"Bash(npx jest:*)",
19+
"Bash(npm run:*)",
20+
"Bash(helm lint:*)",
21+
"Bash(helm template:*)",
22+
"Bash(docker compose:*)",
23+
"Bash(kustomize build:*)"
1724
],
1825
"defaultMode": "acceptEdits",
1926
"model": "sonnet"

.claude/skills/requirements-refiner/SKILL.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,38 @@ description: "Requirements Refiner: Iteratively questions the user to clarify va
1010
2. **Iterative Elicitation**:
1111
- Identify gaps, ambiguities, or assumptions.
1212
- Ask a set of numbered clarifying questions.
13+
- For **each question**, provide 2–4 concrete answer options labeled (a), (b), (c), etc., and mark one as **"Recommended"** with a brief rationale. The user can pick an option, combine options, or provide their own answer.
1314
- Wait for the user's response.
1415
- Repeat this step until the requirements are clear and complete.
1516
3. **Consolidate**:
1617
- Once the requirements are fully understood, create a single consolidated document.
1718
- This document should include the initial requirements plus all details gathered during the Q&A process.
1819
- Ensure the output is structured and ready for a User Story writer to consume.
1920
4. **Save to feature-docs**:
20-
- Examine the `feature-docs/` directory to find the highest numbered folder (e.g., `001-graph-workflows`).
21-
- Determine the next increment number (e.g., if `001` exists, use `002`).
21+
- Generate a datetime stamp in the format `YYYYMMDDHHmmss` (same format as Prisma migrations) using the current UTC time.
2222
- Generate a short feature name/slug (kebab-case, e.g., "benchmarking-system").
23-
- Create a new folder: `feature-docs/{NNN}-{feature-slug}/` (e.g., `feature-docs/002-benchmarking-system/`).
23+
- Create a new folder: `feature-docs/{YYYYMMDDHHmmss}-{feature-slug}/` (e.g., `feature-docs/20260313143022-benchmarking-system/`).
2424
- Save the consolidated requirements as `REQUIREMENTS.md` in that folder.
2525

2626
## Key Behaviors
2727
- **Iterative Approach**: Do not rush to the final output. Prioritize clarity over speed.
2828
- **Probe Deeply**: Ask about edge cases, error states, and user roles.
29-
- **Auto-increment Folders**: Always check existing feature-docs folders to determine the next number.
30-
- **Output Format**: The final output must be saved as `feature-docs/{NNN}-{feature-slug}/REQUIREMENTS.md`.
29+
- **Suggest, Don't Just Ask**: Every clarifying question must include concrete options with a recommended choice. Base recommendations on the project context, industry best practices, and the elicitation standards. This helps the user make faster decisions and reduces back-and-forth.
30+
- **Datetime-stamped Folders**: Use the current UTC time in `YYYYMMDDHHmmss` format as the folder prefix.
31+
- **Output Format**: The final output must be saved as `feature-docs/{YYYYMMDDHHmmss}-{feature-slug}/REQUIREMENTS.md`.
32+
33+
## Question Format Example
34+
35+
```
36+
1. **Who should be able to trigger this workflow?**
37+
(a) Only admin users
38+
(b) Any authenticated user
39+
(c) Both authenticated users and external API consumers
40+
→ **Recommended: (b)** — Most workflows in this system are user-initiated; restricting to admins adds friction without clear security benefit.
41+
42+
2. **How should the system handle partial failures?**
43+
(a) Fail the entire operation and roll back
44+
(b) Continue processing remaining items and report failures at the end
45+
(c) Retry failed items up to N times, then report
46+
→ **Recommended: (c)** — Retries with a cap balance reliability with predictable completion times.
47+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: split-branch-into-prs
3+
description: "Splits a feature branch into multiple sequential draft PRs targeting develop. Trigger phrases: split branch into PRs, break branch into PRs, create stacked PRs, split into multiple PRs. Do NOT invoke for: creating a single PR, cherry-picking individual commits, or rebasing."
4+
---
5+
6+
# Split Branch Into PRs
7+
8+
Analyzes a feature branch, identifies logical commit groups, creates sequential branches via cherry-pick, and opens draft PRs with a standardized template. Includes merge workflow guidance.
9+
10+
## Always Follow
11+
12+
- Target branch is always `develop`
13+
- PRs are always created as **draft**
14+
- PRs are numbered (e.g., "PR 1/4", "PR 2/4") in the title so merge order is clear
15+
- Each PR branch includes all commits from prior groups (stacked), so that after squash-merge + "Update branch", the diff only shows net-new changes
16+
- Back up any sensitive untracked files (`.env`, tokens, etc.) before branch switching, restore them after
17+
- Never commit sensitive files — verify `.gitignore` coverage
18+
19+
## Workflows
20+
21+
1. **[Analyze & Plan](Workflows/analyze-and-plan.md)** — Identify the commit range, group commits into logical PRs, confirm the plan with the user
22+
2. **[Create Branches & PRs](Workflows/create-branches-and-prs.md)** — Cherry-pick commits, push branches, create draft PRs using the standard template
23+
3. **[Merge Workflow Guide](Workflows/merge-workflow-guide.md)** — Instructions for the squash-merge → update branch → repeat cycle
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Analyze & Plan
2+
3+
Identify which commits need to be split and propose logical groupings.
4+
5+
## Steps
6+
7+
1. **Update develop to latest:**
8+
```bash
9+
git fetch origin develop && git checkout develop && git pull origin develop
10+
```
11+
12+
2. **Identify the commit range:**
13+
- Run `git log --oneline develop..<current-branch>` to see all commits ahead of develop
14+
- Ask the user which commit is the actual first commit on the branch (earlier commits may be from a parent branch that was squash-merged)
15+
- Verify by checking `git diff develop..<branch> -- <path>` for suspected already-merged areas — 0 diff confirms they're in develop
16+
17+
3. **List commits in chronological order:**
18+
```bash
19+
git log --oneline --reverse <first-commit>^..<branch>
20+
```
21+
22+
4. **Identify logical groups** by looking at:
23+
- Commit message prefixes and user story references
24+
- Which files each commit touches (`git log --oneline --name-only`)
25+
- Natural breakpoints between features/workstreams
26+
- Dependencies between groups (what must merge first)
27+
28+
5. **Check for shared files across groups:**
29+
```bash
30+
for f in <shared-files>; do
31+
echo "=== $f ==="
32+
git log --oneline --reverse <first-commit>^..<branch> -- "$f"
33+
done
34+
```
35+
Ensure shared files (package.json, Dockerfiles, app.module.ts, etc.) are grouped with the earliest PR that modifies them, or that modifications are sequential and won't conflict.
36+
37+
6. **Present the plan to the user:**
38+
- List each proposed PR with a title, the commits it includes, and a brief description
39+
- Note any dependencies between groups
40+
- Confirm the grouping before proceeding
41+
42+
## Common Pitfalls
43+
44+
- Don't assume all commits in `git log develop..<branch>` are unique — parent branches may have been squash-merged, leaving ghost commits that produce 0 diff
45+
- Always ask the user to confirm the first real commit rather than guessing
46+
- Watch for commits that touch the same file across groups — these need careful ordering
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Create Branches & PRs
2+
3+
After the plan is confirmed, create stacked branches and draft PRs.
4+
5+
## Prerequisites
6+
7+
- The plan from [Analyze & Plan](analyze-and-plan.md) has been confirmed by the user
8+
- You know: the commit groups, their order, and the first commit hash
9+
10+
## Steps
11+
12+
1. **Protect untracked sensitive files:**
13+
```bash
14+
# Check for untracked files that might conflict with cherry-picks
15+
git status --short
16+
# Back up any sensitive untracked files (.env, tokens, etc.)
17+
mkdir -p /tmp/branch-split-backup
18+
# Copy files as needed, e.g.:
19+
# cp deployments/openshift/config/*.env /tmp/branch-split-backup/
20+
# Remove from working tree so cherry-picks don't conflict
21+
```
22+
23+
2. **Ensure clean working tree on develop:**
24+
```bash
25+
git checkout develop && git pull origin develop
26+
git status --short # must be clean (no untracked conflicts)
27+
```
28+
29+
3. **Create branches — each includes all prior groups (stacked):**
30+
For N groups, create N branches. Each branch cherry-picks all commits from group 1 through group N:
31+
```bash
32+
# PR 1: just group 1
33+
git checkout -b pr/<name-1> develop
34+
git cherry-pick <first-commit-group1>^..<last-commit-group1>
35+
36+
# PR 2: group 1 + group 2
37+
git checkout -b pr/<name-2> develop
38+
git cherry-pick <first-commit-group1>^..<last-commit-group1>
39+
git cherry-pick <first-commit-group2>^..<last-commit-group2>
40+
41+
# PR 3: group 1 + group 2 + group 3
42+
# ... and so on
43+
```
44+
45+
4. **Push all branches:**
46+
```bash
47+
git push -u origin pr/<name-1>
48+
git push -u origin pr/<name-2>
49+
# ... etc.
50+
```
51+
52+
5. **Create draft PRs using the standard template:**
53+
Number each PR in the title (e.g., "PR 1/4: ..."). Include merge order guidance in the body.
54+
55+
```bash
56+
gh pr create --head pr/<name> --base develop --draft \
57+
--title "PR 1/N: <descriptive title>" \
58+
--body "$(cat <<'EOF'
59+
## Summary
60+
61+
[Brief description of what this PR adds]
62+
63+
> **Merge order:** This is PR X of N. Merge in sequence: **1 → 2 → 3 → ...** (use "Update branch" before merging each subsequent PR).
64+
65+
## Changes
66+
67+
- [List of changes]
68+
69+
## Testing
70+
71+
- [How it was tested]
72+
73+
## Checklist
74+
75+
By submitting this pull request, I acknowledge that I have attempted to meet the following:
76+
77+
> - a self-review of my code
78+
> - commented code particularly in hard-to-understand areas
79+
> - corresponding changes to the documentation where required
80+
> - changes tested to the best of my ability
81+
> - no new errors or non-functional code
82+
EOF
83+
)"
84+
```
85+
86+
6. **Restore sensitive files:**
87+
```bash
88+
# Switch to the last PR branch (or whichever the user wants)
89+
git checkout pr/<last-branch>
90+
# Restore backed-up files
91+
cp /tmp/branch-split-backup/* <original-locations>/
92+
# Verify they're gitignored
93+
git status --short
94+
```
95+
96+
7. **Show the user a summary table:**
97+
- PR number, branch name, GitHub URL
98+
- Net-new commits per PR
99+
- Merge order instructions
100+
101+
## Common Pitfalls
102+
103+
- Cherry-pick ranges use `^..` syntax: `git cherry-pick A^..B` picks A through B inclusive
104+
- Untracked files in the working tree can block cherry-picks if a commit creates the same file — always clean them out first and restore after
105+
- If cherry-pick conflicts occur, resolve them and `git cherry-pick --continue`
106+
- Always verify sensitive files are gitignored after restoring them
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Merge Workflow Guide
2+
3+
Instructions to give the user for merging the stacked PRs after creation.
4+
5+
## Present This to the User
6+
7+
After all PRs are created, explain the merge workflow:
8+
9+
### How to Merge (repeat for each PR in order)
10+
11+
1. **Review** the PR diff on GitHub — it should only show that PR's net-new changes
12+
2. **Squash & merge** the PR into develop
13+
3. On the **next PR**, click **"Update branch"** (the merge option, not rebase) — this pulls the newly merged develop into the PR branch
14+
4. The PR diff will automatically update to show only net-new changes
15+
5. Repeat from step 1
16+
17+
### Why This Works
18+
19+
- Each PR branch contains all prior groups' commits (stacked)
20+
- After squash-merging PR N, develop has all of PR N's content
21+
- "Update branch" on PR N+1 merges develop in — git resolves the duplicate content cleanly since the files are identical
22+
- The PR diff only compares the branch tip vs develop, so it shows only net-new changes
23+
- Since you're squash-merging, the duplicate commit history in the branch doesn't matter — only the final diff counts
24+
25+
### Fixing Quality Gate Failures
26+
27+
If a PR fails linting, tests, or other checks:
28+
29+
- **Fix it on the PR where the code was introduced** — not on a later PR
30+
- Push the fix commit to that PR's branch
31+
- The fix will flow forward to later PRs when they do "Update branch" after the fixed PR is merged
32+
33+
### Key Points
34+
35+
- Always use **"Update branch"** (merge), not "Update with rebase" — simpler, no force-push needed
36+
- Always **squash & merge** — this is what makes the stacked approach work
37+
- The commit history on PR branches looks duplicated, but the GitHub diff and squash result are clean
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
name: story-implementer
3+
description: "Implements user stories from a user_stories directory in dependency order using subagents. Reads README.md to find the next unchecked story, spawns Agent tool subagents to implement each one, tracks progress via scenario checkboxes in story files and story checkboxes in README. Trigger phrases: implement stories, implement user stories, story implementer, work on stories, implement next story. Do NOT invoke for: writing user stories (use write-user-stories), general code changes, checklist execution."
4+
---
5+
6+
Implement user stories from: $ARGUMENTS
7+
8+
**Role**: You are an implementation orchestrator. You read a user stories README.md, identify the next unimplemented story, and dispatch subagents to implement them one at a time in dependency order.
9+
10+
## Input
11+
12+
$ARGUMENTS should be a path to either:
13+
- A `user_stories/README.md` file, OR
14+
- A `user_stories/` directory (read README.md inside it), OR
15+
- A feature-docs directory containing a `user_stories/` subfolder
16+
17+
If no argument is provided, look for the most recently modified directory under `feature-docs/` that contains `user_stories/README.md`.
18+
19+
## Orchestration Algorithm
20+
21+
### Step 1: Read README.md and locate context
22+
23+
1. Read the `user_stories/README.md` file
24+
2. Extract the path to the requirements document from the NOTE line at the top
25+
3. Identify the base directory (the parent of `user_stories/`)
26+
27+
### Step 2: Find the next unchecked story
28+
29+
1. Go to the "Suggested Implementation Order" section
30+
2. Find the first line matching `- [ ] **US-XXX**`
31+
3. Extract the story ID (e.g., `US-001`)
32+
4. If no unchecked stories remain, report completion to the user and stop
33+
34+
### Step 3: Read the story file and assess size
35+
36+
1. Find the story file matching the ID in the `user_stories/` directory (e.g., `US-001-*.md`)
37+
2. Read the story file
38+
3. Count the number of `- [ ]` scenario checkboxes in the Acceptance Criteria section
39+
4. Decide the implementation strategy:
40+
- **8 or fewer unchecked scenarios**: Send ALL to a single subagent
41+
- **More than 8 unchecked scenarios**: Split into batches of 4-6 scenarios, send to sequential subagents
42+
43+
### Step 4: Dispatch subagent(s)
44+
45+
Read the workflow template from `.claude/skills/story-implementer/Workflows/implement-story.md` and construct the subagent prompt by substituting the variables.
46+
47+
Use the **Agent tool** to spawn the subagent. Pass the constructed prompt as the `prompt` parameter.
48+
49+
**For a single subagent (all scenarios fit):**
50+
- Pass the full story file content
51+
- Pass the requirements document path
52+
- Pass the list of ALL scenario numbers to implement
53+
- Pass the story file path (so subagent can check off scenarios)
54+
55+
**For batched scenarios:**
56+
- For each batch:
57+
- Pass the full story file content
58+
- Pass the requirements document path
59+
- Pass the specific scenario numbers for THIS batch only (e.g., "Scenarios 1-4")
60+
- Pass the story file path
61+
- Add batch note: "This is batch N of M. Only implement the specified scenarios."
62+
- After each batch subagent completes, re-read the story file to verify the scenarios were checked off
63+
- Then dispatch the next batch
64+
65+
### Step 5: Verify story completion
66+
67+
After the subagent(s) finish:
68+
1. Re-read the story file
69+
2. Verify ALL scenario checkboxes are `[x]`
70+
3. If any scenarios remain unchecked, report which ones to the user and ask whether to retry or skip
71+
72+
### Step 6: Mark story complete and commit
73+
74+
1. In `user_stories/README.md`, change the line `- [ ] **US-XXX**` to `- [x] **US-XXX**`
75+
2. Stage all changes and commit with message: `feat: implement US-XXX - <story title>`
76+
- Include `Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>`
77+
3. Report to the user: which story was completed, summary of what was implemented
78+
79+
### Step 7: Loop
80+
81+
Return to Step 2 to find the next unchecked story. Continue until all stories are implemented or the user interrupts.
82+
83+
## Rules
84+
85+
- Implement stories strictly in the order listed in the README (respect dependency chain)
86+
- Never skip a story without user approval
87+
- Always re-read README.md fresh before each iteration (it may have been modified)
88+
- Each subagent MUST follow all CLAUDE.md rules (tests for backend, proper typing, no placeholders, update docs-md)
89+
- Auto-commit after each STORY (not each scenario)
90+
- If a subagent encounters a question or ambiguity, it should surface it to the user rather than making assumptions
91+
- Do not modify the story file format beyond checking off scenario checkboxes
92+
- The orchestrator never implements code directly — always delegate to subagents via Agent tool
93+
94+
## Workflow Reference
95+
96+
- [Implement a single story](Workflows/implement-story.md) — subagent prompt template for implementing scenarios within a story

0 commit comments

Comments
 (0)