@odarino/haren 1.1.2 → 1.2.0

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.
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: haren-onboard
3
+ description: Onboard a developer to this haren workspace. Analyze each repo, check repo health, and brief the developer on the project state. Use when someone runs /haren-onboard, is new to the project, or asks "is my workspace set up?" or "what is this project?".
4
+ type: utility
5
+ ---
6
+
7
+ # Haren Onboard
8
+
9
+ Run this skill after `haren init` sets up the workspace. This skill reads and reports. It writes only the manifest fields that the user approves. It never clones, pulls, stashes, switches branches or writes code.
10
+
11
+ ## 0. Find the haren folder
12
+
13
+ 1. The haren folder is the folder whose `manifest.yaml` has a top-level `haren:` key. Look in the current folder first, then in its direct child folders.
14
+ 2. If no folder has this key, stop. Tell the user to run `haren init`.
15
+ 3. Read `manifest.yaml`, `progress.json` and the "Repos and Git" section of `skill.md` in the haren folder. Follow that section for all repo paths and git commands.
16
+
17
+ ## 1. Analyze repos
18
+
19
+ Do these steps for each entry in `repos`:
20
+
21
+ 1. Find the repo folder: `<haren folder>/<path>`. If the folder does not exist, skip this repo. Step 2 reports it.
22
+ 2. Read the build files that exist in the repo folder: `package.json` and its lock file, `go.mod`, `pom.xml`, `build.gradle` or `build.gradle.kts`, `pyproject.toml`, `requirements.txt`, `Cargo.toml`, `composer.json`, `Gemfile`, `*.csproj`.
23
+ 3. Decide these values:
24
+ - `stack`: a short kebab-case name, for example `node-express`, `react-vite`, `nextjs`, `go`, `java-spring`, `python-fastapi`.
25
+ - `test_cmd`: the command that runs the tests, from the package scripts or the build tool, for example `bun test`, `pnpm test`, `go test ./...`, `mvn test`, `pytest`. If you are not sure, leave it empty.
26
+ - `default_branch`: run `git -C <repo> symbolic-ref --short refs/remotes/origin/HEAD` and remove the `origin/` prefix. If the command fails, use the current branch (see the detached HEAD rule below). Use "main" only if no branch can be found, and say so in the table.
27
+ - `role`: `frontend` for a UI app (React, Vue, Angular, Svelte, Next.js, Nuxt, a Vite web app). `backend` for an API or a service. `e2e` for a repo that holds mainly end-to-end tests. `other` for all other repos. Keep an existing `role`. If it looks wrong, ask the user.
28
+ - Current branch: run `git -C <repo> branch --show-current`. If it prints nothing, the repo is on a detached HEAD. Report "detached HEAD at <short sha>" and get the sha with `git -C <repo> rev-parse --short HEAD`.
29
+ 4. Show one table to the user: repo, stack, test_cmd, default_branch, role. Mark the values that change.
30
+ 5. Ask: "Write these values into manifest.yaml?"
31
+ 6. Write only after the user agrees. Change only these fields of the `repos` entries. Write them in this order: `path`, `remote`, `default_branch`, `role`, `stack`, `test_cmd`. Keep every other line and every comment in `manifest.yaml`.
32
+
33
+ If `repos` is empty, say so in the table output: "No repos listed in manifest.yaml." Suggest that the user adds repo entries (in the monorepo layout, folders such as `../backend`). `skill.md` "Repos and Git" has a "No repos listed" fallback: in the monorepo layout, the repo that holds the haren folder is the only repo, with the key `default`. Mention it. Then continue with steps 2-4.
34
+
35
+ ## 2. Health check
36
+
37
+ Check each repo in `repos`. In the workspace layout, also check the haren folder, because it is its own repo.
38
+
39
+ | Check | How | Report |
40
+ |---|---|---|
41
+ | Missing | The repo folder does not exist | "missing — run `haren init` to clone it" if the repo has a `remote`. Else "missing, no remote — clone it by hand". |
42
+ | Not a repo | The folder has no `.git` | "not a git repo" |
43
+ | Uncommitted changes | `git -C <repo> status --porcelain` prints lines | "uncommitted changes (N files)" |
44
+ | Branch | Only when `default_branch` is known. `git -C <repo> branch --show-current` is not `default_branch`. On a detached HEAD, report "detached HEAD at <short sha>". | "on `<branch>`, default is `<default_branch>`". If a module in `progress.json` uses this branch (`modules.*.branch`), add "(module `<module>`)" and do not show it as a problem. |
45
+
46
+ The haren folder has no `default_branch`. For the haren folder, report only its current branch. Do not compare it with a default branch.
47
+
48
+ Do not fetch. Do not fix anything. Report only.
49
+
50
+ ## 3. Briefing
51
+
52
+ Read these files if they exist:
53
+
54
+ - `artifacts/00-baseline/concept-brief.md`
55
+ - `artifacts/02-discovery/context-brief.md`
56
+ - `artifacts/03-modules/architecture.md`
57
+ - `artifacts/_registry/artifact-index.md`
58
+ - `progress.json`
59
+
60
+ Write a summary of 15 lines or less:
61
+
62
+ - What the project is, in one or two sentences.
63
+ - The current phase and the status of each module.
64
+ - For each active module: its branch and its repos.
65
+ - The next step. Use the "How to dispatch" section of `skill.md`.
66
+
67
+ ## 4. Empty project
68
+
69
+ If `artifacts/` has no artifacts other than the registry, and `progress.json` has no modules, write only this line in the briefing:
70
+
71
+ "No artifacts yet. Start with `ideate` (you have a raw idea) or `discover` (you know what to build)."
72
+
73
+ ## Output
74
+
75
+ ```markdown
76
+ ## Workspace
77
+ Layout: {monorepo | workspace} · Haren folder: {folder name}
78
+
79
+ | Repo | Stack | Role | Branch | Status |
80
+ |------|-------|------|--------|--------|
81
+
82
+ ## Project
83
+ {briefing}
84
+
85
+ ## Next step
86
+ {one line}
87
+ ```
88
+
89
+ ## Rules
90
+
91
+ - Ask before you write. Ask one question at a time.
92
+ - Never clone, pull, push, stash or switch branches.
93
+ - Never write code.
@@ -12,7 +12,7 @@ Orient yourself at the start of every session or before taking any action.
12
12
 
13
13
  1. **Read manifest.yaml**
14
14
  - Project name, mode, repos, sources
15
- - Validate repo paths exist (warn if not)
15
+ - Resolve each repo folder as in skill.md "Repos and Git". Warn if a folder is missing, and suggest `haren init` (it clones missing repos)
16
16
 
17
17
  2. **Read progress.json**
18
18
  - List all modules and their current status
@@ -33,10 +33,14 @@ Orient yourself at the start of every session or before taking any action.
33
33
  - If files were added since last session (compare against artifact-index.md):
34
34
  → Flag new documents and ask if the user wants to re-run or update discovery
35
35
 
36
- 5. **Git check** (for each repo in manifest)
37
- - Check for uncommitted changes
38
- - Compare last known commit in progress.json against actual HEAD
39
- - If drift detected: warn user, update progress.json to match git
36
+ 5. **Git check** — for each repo in manifest `repos`, and for the haren folder itself in the workspace layout (see skill.md "Repos and Git")
37
+ - Check for uncommitted changes: `git -C <repo> status --porcelain`
38
+ - Read the current branch: `git -C <repo> branch --show-current`
39
+ - For each module with status `implementing` or `evaluating` that has `lastCommit.<repoKey>` for this repo: if the module branch does not exist in this repo, report "branch `<branch>` not found (merged or deleted?)" and skip the check for this repo. Else check that the recorded SHA is in the history with `git -C <repo> merge-base --is-ancestor <sha> <branch>`, where `<branch>` is the module's recorded `branch` (use `HEAD` only if the module has no `branch`)
40
+ - If it is an ancestor and the branch moved: report "N new commits since last recorded" (`git -C <repo> rev-list --count <sha>..<branch>`). In the monorepo layout, N can include haren-only commits
41
+ - If it is not an ancestor: report drift
42
+ - The key `default` in `lastCommit` means the repo that holds the haren folder (monorepo layout) or the module's first repo (workspace layout)
43
+ - If drift is detected: warn the user. After the user agrees, update `progress.json` via update-tracking skill
40
44
 
41
45
  6. **Produce orientation summary**
42
46
 
@@ -48,7 +52,8 @@ Present to the user:
48
52
  ## Session Context
49
53
  Project: {name} ({mode} mode)
50
54
  Iteration: {N} of {total} ({status}) ← only if iterations enabled
51
- Repos: {list with status}
55
+ Repos: {key: branch, clean | N changed files | missing} for each repo
56
+ Haren repo: {branch, clean | N changed files} ← workspace layout only
52
57
 
53
58
  ## Baseline Documents
54
59
  {list of files in 00-baseline/, or "None"}
@@ -25,10 +25,20 @@ Update module and feature status in progress.json with validated transitions.
25
25
  1. Add feature with "pending" status to the module's features map
26
26
  2. Update progress.json
27
27
 
28
+ ### Record Commit
29
+ 1. Set `lastCommit.<repoKey>` to the new commit SHA for the module. `lastCommit` is a map from repo key to SHA, never a plain string (see skill.md "Repos and Git")
30
+ 2. If the module has no `branch` or `repos` yet, set them: `branch` is `feat/{module-slug}`, `repos` are the `repos:` keys in the module's `module.md`
31
+ 3. Update `lastUpdated`
32
+
28
33
  ### Reconcile with Git
29
- 1. For each repo, compare progress.json lastCommit against git HEAD
30
- 2. If drift detected, warn user and update lastCommit
31
- 3. Flag any ambiguous state changes for human review
34
+ 1. For each module, and for each repo key in its `repos` (or in its `lastCommit` map): resolve the repo folder as in skill.md "Repos and Git"
35
+ 2. Read the tip of the module branch: `git -C <repo> rev-parse <branch>`, where `<branch>` is the module's recorded `branch` (fallback `feat/{module-slug}`, then `HEAD` if the branch does not exist)
36
+ 3. Compare it with `lastCommit.<repoKey>`. Treat the key `default` as described in skill.md "Repos and Git". Check `git -C <repo> merge-base --is-ancestor <recorded sha> <tip>`
37
+ - If it succeeds, there is no drift. Later commits are normal, including haren-only commits in the monorepo layout
38
+ 4. Only if it fails, report drift. After the user agrees, update `lastCommit.<repoKey>` to the latest commit on the branch that changed files outside the haren folder
39
+ - Monorepo layout: `git -C <repo> log -1 --format=%H <tip> -- ':(top,exclude)<haren folder path relative to the repo root>'`
40
+ - Workspace layout: the tip
41
+ 5. Flag any ambiguous state changes for human review
32
42
 
33
43
  ### Transition Iteration (only if iterations enabled)
34
44
  1. Check if all tasks in the current iteration have status "passing"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: {module name}
3
- repos: [{repo keys from manifest}]
3
+ repos: [{repo keys from the manifest `repos` map}]
4
4
  dependencies: [{module names}]
5
5
  complexity: small | medium | large
6
6
  ---