Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

Commit 950498b

Browse files
twoGiantsclaude
andcommitted
chore: restructure docs and add init.sh
Extract workflow, branching, PRs, and session rules from AGENTS.md into docs/WORKFLOW.md. Move features.json and claude-progress.txt format specs into dedicated reference files. Slim AGENTS.md down to project overview and knowledge base table. Add init.sh to start and stop the dev environment with port readiness checks. Update init-session command to cover startup steps 1-6. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 19ba097 commit 950498b

7 files changed

Lines changed: 211 additions & 99 deletions

File tree

.claude/commands/init-session.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
---
2-
allowed-tools: Bash(git log:*), Read
3-
description: Load recent context and wait for user direction
2+
allowed-tools: Bash(git log:*), Bash(pwd), Bash(./init.sh), Bash(yarn test*), Read
3+
description: Run startup sequence (steps 1-6 from docs/WORKFLOW.md)
44
---
55

66
# Session Onboard
77

8-
Load recent context that isn't in AGENTS.md (which is always in context).
8+
Execute the startup sequence from `docs/WORKFLOW.md`. AGENTS.md is always in context — no need to read it explicitly.
99

1010
## Steps
1111

12-
1. **Read recent progress** — read `docs/claude-progress.txt` (only the last 3 days of entries matter).
12+
1. **Confirm working directory** — run `pwd`.
13+
14+
2. **Orient** — read `docs/claude-progress.txt` (only the last 3 days of entries matter) and run:
1315

14-
2. **Read recent commits** — run:
1516
```bash
1617
git log --oneline --since="3 days ago"
1718
```
1819

19-
3. **Wait** — tell the user you're oriented and ask what they'd like to work on. Do NOT start any work autonomously.
20+
3. **Check struggles** — read `docs/agent-struggles.json`. If unresolved entries exist, present to user.
21+
22+
4. **Pick feature** — read `docs/features.json`, find first `"passes": false` entry.
23+
24+
5. **Start dev env** — run `./init.sh`.
25+
26+
6. **Run tests** — run `yarn test` and verify app is healthy.
27+
28+
7. **Wait** — tell the user you're oriented, report the picked feature, and ask what they'd like to work on. Do NOT start any work autonomously.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ AGENTS.override.md
3333

3434
# Local development configuration
3535
.dev
36+
.dev-logs
3637

3738
# Yarn v4 (Berry)
3839
.yarn/*
@@ -42,3 +43,6 @@ install-state.gz
4243
!.yarn/releases
4344
!.yarn/sdks
4445
!.yarn/versions
46+
47+
# MCP
48+
.playwright-mcp

AGENTS.md

Lines changed: 8 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -11,100 +11,15 @@ See `docs/design/` for full design specs.
1111

1212
| File | Purpose |
1313
|------|---------|
14-
| `docs/design/` | Design specs — "what to build" |
15-
| `docs/plans/active/` | Implementation plans in progress |
16-
| `docs/plans/completed/` | Finished plans |
17-
| `docs/references/` | LLM-friendly reference material |
14+
| `docs/WORKFLOW.md` | Startup sequence, feature dev sequence, branching, PRs, session rules |
1815
| `docs/ARCHITECTURE.md` | Layered architecture, dependency rules |
1916
| `docs/STYLEGUIDE.md` | Code style, naming conventions |
2017
| `docs/TESTING.md` | Testing strategy, tools, conventions, mock patterns |
21-
| `docs/features.json` | Inviolable feature list — ground truth |
22-
| `docs/claude-progress.txt` | Session handoff log |
18+
| `docs/design/` | Design specs — "what to build" |
19+
| `docs/plans/active/` | Implementation plans in progress |
20+
| `docs/plans/completed/` | Finished plans |
21+
| `docs/features.json` | Inviolable feature list — see [`references/features-json-readme.md`](docs/references/features-json-readme.md) |
22+
| `docs/claude-progress.txt` | Session handoff log — see [`references/claude-progress-readme.md`](docs/references/claude-progress-readme.md) |
23+
| `docs/agent-struggles.json` | Struggle log — see [`references/agent-struggles-readme.md`](docs/references/agent-struggles-readme.md) |
2324
| `docs/references/ocp-plugin-guide.md` | OCP dynamic plugin mechanics, i18n, extension points |
24-
| `docs/agent-struggles.json` | Struggle log — see `docs/references/agent-struggles-readme.md` |
25-
26-
## Startup Sequence
27-
28-
Every session, before doing any work:
29-
30-
1. `pwd` — confirm working directory
31-
2. Read `docs/claude-progress.txt` + `git log --oneline -10` — orient
32-
3. Read `docs/agent-struggles.json` — if unresolved entries exist, present to user
33-
4. Read `docs/features.json` — pick first `"passes": false` entry
34-
5. Run `./init.sh` — start dev env
35-
6. Run tests — verify app is healthy
36-
7. If broken → fix first. If clean → start [Feature Development Sequence](#feature-development-sequence).
37-
38-
## Branching
39-
40-
Create a feature branch per plan: `<NNN>-<type>-<short-name>` where `<NNN>` matches the plan number and `<type>` the
41-
conventional commit type as per our [Git Commit Guide](/docs/references/commit-message-agent-readme.md#conventional-commits). Example: `001-feat-function-list-empty-state`.
42-
43-
## Feature Development Sequence
44-
45-
After [Startup Sequence](#startup-sequence), work through the picked feature:
46-
47-
1. **Plan** — read `docs/ARCHITECTURE.md` + `docs/STYLEGUIDE.md` + `docs/TESTING.md`, then create implementation plan → `docs/plans/active/<incremented-number>-feature-<short-name>.md`
48-
2. **Branch** — create feature branch per [Branching](#branching) convention
49-
3. **Implement** — using `/executing-plans` skill
50-
4. **Review** — code review using `/requesting-code-review` skill, fix found issues
51-
5. **Manual Test** — use browser automation and validate it works in the browser
52-
6. **Complete** — flip `passes` to `true` in `docs/features.json`, update `docs/claude-progress.txt`, commit
53-
7. **PR** — push branch, open PR via `gh pr create` using `.github/pull_request_template.md`
54-
8. Move plan to `docs/plans/completed/`
55-
9. Stop, wait for user command
56-
57-
## Session Rules
58-
59-
- One feature at a time
60-
- Clean state at end (code suitable for merging to main)
61-
- Update `docs/claude-progress.txt` before session ends
62-
- Commit work to git before ending — follow `docs/references/commit-message-agent-readme.md` strictly
63-
64-
## features.json
65-
66-
Inviolable. The categories are `functional` or `technical`. You may only change the `passes` field to `true` — and only after:
67-
68-
1. The corresponding e2e test passes
69-
2. You have validated the feature in a real browser via browser automation
70-
71-
Never remove, reorder, or edit feature entries. Work on the first entry where `passes` is `false`.
72-
73-
Format:
74-
75-
```json
76-
{
77-
"category": "functional",
78-
"description": "...",
79-
"steps": ["..."],
80-
"passes": false
81-
}
82-
```
83-
84-
## claude-progress.txt
85-
86-
Append-only, newest-first. Add your entry at the top after the header. Format:
87-
88-
```txt
89-
---
90-
## YYYY-MM-DD | Session: <brief title>
91-
Worked on: <what you did>
92-
Completed:
93-
- <item>
94-
Left off: <what remains>
95-
Blockers: <any blockers or None>
96-
```
97-
98-
## Continuous Improvement
99-
100-
When you struggle, don't silently work around it. Log it to `docs/agent-struggles.json`:
101-
102-
```json
103-
{
104-
"date": "YYYY-MM-DD",
105-
"description": "...",
106-
"cause": "...",
107-
"suggestion": "...",
108-
"resolved": false
109-
}
110-
```
25+
| `docs/references/commit-message-agent-readme.md` | Git commit conventions |

docs/WORKFLOW.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Workflow — func-console
2+
3+
## Startup Sequence
4+
5+
Every session, before doing any work:
6+
7+
1. `pwd` — confirm working directory
8+
2. Read `docs/claude-progress.txt` + `git log --oneline -10` — orient
9+
3. Read `docs/agent-struggles.json` — if unresolved entries exist, present to user
10+
4. Read `docs/features.json` — pick first `"passes": false` entry
11+
5. Run `./init.sh` — start dev env
12+
6. Run tests — verify app is healthy
13+
7. If broken → fix first. If clean → start [Feature Development Sequence](#feature-development-sequence).
14+
15+
## Feature Development Sequence
16+
17+
After [Startup Sequence](#startup-sequence), work through the picked feature:
18+
19+
1. **Plan** — read `docs/ARCHITECTURE.md` + `docs/STYLEGUIDE.md` + `docs/TESTING.md`, then create implementation plan → `docs/plans/active/<incremented-number>-feature-<short-name>.md`
20+
2. **Branch** — create feature branch per [Branching](#branching) convention
21+
3. **Implement** — using `/executing-plans` skill
22+
4. **Review** — code review using `/requesting-code-review` skill, fix found issues
23+
5. **Manual Test** — use browser automation and validate it works in the browser
24+
6. **Complete** — flip `passes` to `true` in [`docs/features.json`](references/features-json-readme.md), update [`docs/claude-progress.txt`](references/claude-progress-readme.md), commit
25+
7. **PR** — push branch, open PR per [Pull Requests](#pull-requests) convention
26+
8. Move plan to `docs/plans/completed/`
27+
9. Stop, wait for user command
28+
29+
## Branching
30+
31+
Create a feature branch per plan: `<NNN>-<type>-<short-name>` where `<NNN>` matches the plan number and `<type>` the conventional commit type as per our [Git Commit Guide](references/commit-message-agent-readme.md#conventional-commits). Example: `001-feat-function-list-empty-state`.
32+
33+
## Pull Requests
34+
35+
Open PRs via `gh pr create` using the template at `.github/pull_request_template.md`.
36+
37+
**Title format:** `<Type>: <Sentence ending with a period.>` — capitalize the type and the first word, end with a period. Example: `Feat: Add function list page with empty state.`
38+
39+
Types are the same as [conventional commits](references/commit-message-agent-readme.md#conventional-commits) but capitalized.
40+
41+
## Session Rules
42+
43+
- One feature at a time
44+
- Clean state at end (code suitable for merging to main)
45+
- Update [`docs/claude-progress.txt`](references/claude-progress-readme.md) before session ends
46+
- Commit work to git before ending — follow [`docs/references/commit-message-agent-readme.md`](references/commit-message-agent-readme.md) strictly
47+
48+
## Continuous Improvement
49+
50+
When you struggle, don't silently work around it. Log it to `docs/agent-struggles.json` — see [`docs/references/agent-struggles-readme.md`](references/agent-struggles-readme.md) for format.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# claude-progress.txt
2+
3+
Append-only, newest-first. Add your entry at the top after the header.
4+
5+
## Format
6+
7+
```txt
8+
---
9+
## YYYY-MM-DD | Session: <brief title>
10+
Worked on: <what you did>
11+
Completed:
12+
- <item>
13+
Left off: <what remains>
14+
Blockers: <any blockers or None>
15+
```
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# features.json
2+
3+
Inviolable. The categories are `functional` or `technical`. You may only change the `passes` field to `true` — and only after:
4+
5+
1. The corresponding e2e test passes
6+
2. You have validated the feature in a real browser via browser automation
7+
8+
Never remove, reorder, or edit feature entries. Work on the first entry where `passes` is `false`.
9+
10+
## Format
11+
12+
```json
13+
{
14+
"category": "functional",
15+
"description": "...",
16+
"steps": ["..."],
17+
"passes": false
18+
}
19+
```

init.sh

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
LOG_DIR=".dev-logs"
6+
CONSOLE_IMAGE="${CONSOLE_IMAGE:="quay.io/openshift/origin-console:latest"}"
7+
PLUGIN_PORT=9001
8+
CONSOLE_PORT=9000
9+
TIMEOUT=60
10+
11+
wait_for_port() {
12+
local port=$1
13+
local label=$2
14+
local elapsed=0
15+
16+
while ! bash -c "echo >/dev/tcp/localhost/$port" 2>/dev/null; do
17+
if [ $elapsed -ge $TIMEOUT ]; then
18+
echo "Error: $label did not start within ${TIMEOUT}s. Check $LOG_DIR/ for details."
19+
exit 1
20+
fi
21+
echo "Waiting for $label (port $port)... ${elapsed}s"
22+
sleep 1
23+
elapsed=$((elapsed + 1))
24+
done
25+
}
26+
27+
stop_plugin() {
28+
if pgrep -f "webpack serve" >/dev/null 2>&1; then
29+
pkill -f "webpack serve" && echo "Stopped plugin dev server."
30+
fi
31+
}
32+
33+
stop_console() {
34+
local container
35+
container=$(podman ps -q --filter ancestor="$CONSOLE_IMAGE" 2>/dev/null || true)
36+
if [ -n "$container" ]; then
37+
podman stop "$container" >/dev/null && echo "Stopped OpenShift console."
38+
fi
39+
}
40+
41+
stop_dev() {
42+
stop_plugin
43+
stop_console
44+
}
45+
46+
check_prerequisites() {
47+
if ! command -v oc &>/dev/null; then
48+
echo "Error: oc CLI not found. Install from https://console.redhat.com/openshift/downloads"
49+
exit 1
50+
fi
51+
52+
if ! oc whoami &>/dev/null; then
53+
echo "Error: not logged in to OpenShift. Run 'oc login' first."
54+
exit 1
55+
fi
56+
}
57+
58+
install_dependencies() {
59+
if [ ! -d "node_modules" ]; then
60+
echo "Installing dependencies..."
61+
yarn install
62+
fi
63+
}
64+
65+
start_plugin() {
66+
echo "Starting plugin dev server..."
67+
yarn start >"$LOG_DIR/webpack.log" 2>&1 &
68+
}
69+
70+
start_console() {
71+
echo "Starting OpenShift console..."
72+
yarn start-console >"$LOG_DIR/console.log" 2>&1 &
73+
}
74+
75+
print_status() {
76+
echo ""
77+
echo "Dev environment started:"
78+
echo " Console: http://localhost:9000"
79+
echo " Logs: $LOG_DIR/"
80+
echo ""
81+
echo "To stop: ./init.sh --stop"
82+
}
83+
84+
main() {
85+
mkdir -p "$LOG_DIR"
86+
check_prerequisites
87+
install_dependencies
88+
stop_dev
89+
start_plugin
90+
wait_for_port "$PLUGIN_PORT" "Plugin dev server"
91+
start_console
92+
wait_for_port "$CONSOLE_PORT" "OpenShift console"
93+
print_status
94+
}
95+
96+
if [ "${1:-}" = "--stop" ]; then
97+
stop_dev
98+
else
99+
main
100+
fi

0 commit comments

Comments
 (0)