@eric0117/agentforge 0.1.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.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +275 -0
  3. package/dist/add-agent.js +145 -0
  4. package/dist/add-skill.js +185 -0
  5. package/dist/agent-prompt.js +211 -0
  6. package/dist/agentforge-config.js +106 -0
  7. package/dist/agents/claude.js +46 -0
  8. package/dist/agents/codex.js +67 -0
  9. package/dist/agents/cursor.js +54 -0
  10. package/dist/agents/index.js +15 -0
  11. package/dist/agents/io.js +252 -0
  12. package/dist/agents/types.js +1 -0
  13. package/dist/cli.js +374 -0
  14. package/dist/confirm.js +20 -0
  15. package/dist/doctor.js +223 -0
  16. package/dist/enter.js +85 -0
  17. package/dist/init.js +272 -0
  18. package/dist/lang-prompt.js +88 -0
  19. package/dist/list-skills.js +120 -0
  20. package/dist/logo.js +181 -0
  21. package/dist/path-prompt.js +148 -0
  22. package/dist/remove-agent.js +63 -0
  23. package/dist/remove-skill.js +88 -0
  24. package/dist/rename.js +222 -0
  25. package/dist/skill-prompt.js +199 -0
  26. package/dist/skills-data.js +727 -0
  27. package/dist/sync-skills.js +59 -0
  28. package/dist/templates/CLAUDE.md.tpl +141 -0
  29. package/dist/templates/context-handoff.SKILL.md.tpl +222 -0
  30. package/dist/templates/cross-repo-impact.SKILL.md.tpl +241 -0
  31. package/dist/templates/feature-retro.SKILL.md.tpl +312 -0
  32. package/dist/templates/feature-start.SKILL.md.tpl +631 -0
  33. package/dist/templates/history.SKILL.md.tpl +165 -0
  34. package/dist/templates/incident-context.SKILL.md.tpl +260 -0
  35. package/dist/templates/pr-create.SKILL.md.tpl +403 -0
  36. package/dist/templates/pr-review-analyze.SKILL.md.tpl +303 -0
  37. package/dist/templates/pre-deploy-check.SKILL.md.tpl +350 -0
  38. package/dist/templates/project-router.SKILL.md.tpl +55 -0
  39. package/dist/templates/release-coordinate.SKILL.md.tpl +209 -0
  40. package/package.json +54 -0
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: agentforge-project-router
3
+ description: Routes a user's question or request to the right repository in a multi-repo workspace under repos/<name>/. Triggers when the user asks about code, files, or behavior of "the backend", "the admin", a specific repo name, or any other project-scoped query from the workspace root.
4
+ ---
5
+
6
+ # project-router
7
+
8
+ This workspace is a multi-repo layout (several repos live under `repos/<name>/`).
9
+ When the user asks a question about code or project behavior, **first decide which repo
10
+ to look at**, then answer.
11
+
12
+ ## When to apply
13
+
14
+ Apply this skill when any of the following is true:
15
+ - The user asks about code, a function, a file, or how an API behaves.
16
+ - The user wants to understand the structure or behavior of a specific project.
17
+ - The user asks for a fix or change (unless it's clearly starting a new feature — in
18
+ that case, use the `feature-start` skill instead).
19
+
20
+ Apply this only when the user is at the workspace **root** (the directory that contains
21
+ `repos/` and `anvil/`) or somewhere under it. If the user has already opened Claude inside
22
+ a specific `repos/<name>/` or `anvil/<slug>/`, just work there — don't re-route.
23
+
24
+ ## How to do it
25
+
26
+ 1. **List the repos** — run `ls repos/` to see what's available right now. Do not cache
27
+ this; the user may add or remove repos at any time.
28
+ 2. **Extract hints** from the question:
29
+ - Direct folder name mentions (`backend-api`, `admin-web`, ...).
30
+ - Natural-language aliases ("the backend API" → `backend-api`, "the admin" →
31
+ `admin-web`, "the mobile app" → `mobile-app`, "the worker" → `worker-service`, etc.).
32
+ - Domain cues — infer from repo purpose based on what each repo actually contains.
33
+ 3. **Branch on match count**:
34
+ - **Single match**: `cd` into `repos/<name>/` and proceed there.
35
+ - **Multiple / ambiguous**: show the candidate repos and ask the user to pick. Do not
36
+ pick one arbitrarily.
37
+ - **No match**: list all repos under `repos/` and ask "Which project did you mean?"
38
+ 4. **Cross-repo questions**: if the question clearly spans multiple repos (e.g. "where the
39
+ API and admin connect"), look at all relevant repos together instead of routing into
40
+ just one.
41
+
42
+ ## Rules
43
+
44
+ - `repos/<name>/` is **read / explore only**. Do not edit code in `repos/`. If a change is
45
+ needed, suggest using the `feature-start` skill to create a feature worktree first.
46
+ - If the user is already inside `anvil/<slug>/`, stay in that feature's worktree. Do not
47
+ fall back to `repos/`.
48
+ - Repos are discovered via `ls repos/` every time. There is no metadata file to consult.
49
+ - **If a `anvil/<slug>/CLAUDE.md` references a repo whose worktree directory is
50
+ missing**, treat the metadata as stale. Tell the user which repo is listed but
51
+ absent — do not silently route into a non-existent worktree.
52
+
53
+ ## Output language
54
+
55
+ {{OUTPUT_LANGUAGE_INSTRUCTION}}
@@ -0,0 +1,209 @@
1
+ ---
2
+ name: agentforge-release-coordinate
3
+ description: Plans the merge / deploy order for a feature that spans multiple repos. Reads each worktree's diff, identifies cross-repo dependencies (new APIs, exported types, contract files, message-queue schemas), builds a dependency graph, and outputs a step-by-step merge order with per-step preconditions (CI green, prior merge confirmed) and post-merge wait conditions (CI, deploy, downstream healthcheck) — plus a reverse-order rollback playbook. Read-only. Never auto-merges, never pushes. Triggers on "release this feature", "ship this", "which PR to merge first", "merge order", "deploy order", "어느 PR 먼저 머지".
4
+ ---
5
+
6
+ # release-coordinate
7
+
8
+ `pre-deploy-check` answers *"is this ready to ship?"*. This skill answers
9
+ *"once it's ready, in what order do I merge and deploy?"* for a feature that
10
+ spans several repos.
11
+
12
+ The output is an ordered checklist the user executes manually — never
13
+ auto-merges, never pushes, never bypasses CI.
14
+
15
+ ## When to apply
16
+
17
+ Trigger phrases:
18
+ - "Release this feature." / "Ship this."
19
+ - "Which PR to merge first?"
20
+ - "Merge order?" / "Deploy order?"
21
+ - "Coordinate the rollout."
22
+ - "어느 PR 먼저 머지해야 해?"
23
+
24
+ Apply once every PR for the feature is open and ready (or close to ready). Don't
25
+ apply mid-development — the dependency graph is meaningless until the diffs are
26
+ stable.
27
+
28
+ ## Resolve scope
29
+
30
+ Resolve which feature you're coordinating from cwd:
31
+
32
+ - `…/anvil/<slug>/` (or anywhere inside it) → that feature.
33
+ - Workspace root, no obvious context → ask the user for the slug or list active
34
+ features (`ls anvil/`).
35
+
36
+ The slug determines which worktrees and which PRs are in scope:
37
+
38
+ ```bash
39
+ # in-scope repos for this feature
40
+ ls -d anvil/<slug>/*/ | xargs -n1 basename
41
+ ```
42
+
43
+ If the feature's `CLAUDE.md` lists a repo whose worktree directory is missing,
44
+ flag it and ask the user whether to include it (the PR may exist even though the
45
+ worktree is gone — e.g. someone already started teardown).
46
+
47
+ ## Step 1 — Capture each repo's state
48
+
49
+ For each in-scope `anvil/<slug>/<repo>/`:
50
+
51
+ ```bash
52
+ branch=$(git -C anvil/<slug>/<repo> rev-parse --abbrev-ref HEAD)
53
+ base=$(git -C anvil/<slug>/<repo> symbolic-ref --quiet refs/remotes/origin/HEAD \
54
+ | sed 's@^refs/remotes/origin/@@')
55
+ # diff stat — high-signal summary
56
+ git -C anvil/<slug>/<repo> diff --stat "origin/$base"...HEAD
57
+ # changed file list — used for dependency analysis below
58
+ git -C anvil/<slug>/<repo> diff --name-status "origin/$base"...HEAD
59
+ ```
60
+
61
+ Then find the PR (head branch comes from the worktree's HEAD, **not** from the
62
+ slug — branches may differ per repo):
63
+
64
+ ```bash
65
+ gh -R <owner>/<repo> pr list --head "$branch" --state open \
66
+ --json number,url,isDraft,mergeStateStatus,statusCheckRollup,reviews,baseRefName
67
+ ```
68
+
69
+ If no PR exists for a worktree → list it as "PR not opened yet" and continue.
70
+
71
+ Collect into a table:
72
+
73
+ ```
74
+ repo branch PR CI reviews state
75
+ backend-api feature/<TICKET>-<topic> #1234 ✓ green ✓ approved ready
76
+ admin-web feat/<TICKET> #567 ✗ failing · pending blocked
77
+ worker-service <slug> — — — no PR yet
78
+ ```
79
+
80
+ ## Step 2 — Cross-repo dependency analysis
81
+
82
+ For each pair of in-scope repos, determine whether one depends on the other for
83
+ this feature. Look at the diff, not the codebase as a whole — only changes in
84
+ this feature matter for ordering.
85
+
86
+ **Signals that imply "merge A before B":**
87
+
88
+ 1. **Library/package consumer**: repo B's `package.json` / `go.mod` /
89
+ `pyproject.toml` / `Gemfile` adds or bumps a package published by repo A,
90
+ referencing a version that includes A's new code. → merge A, publish, then B.
91
+ 2. **HTTP / RPC contract**: repo B adds a call to an endpoint that repo A's diff
92
+ introduces. Detect by greping B's new code for URL fragments / SDK methods
93
+ that appear new in A's diff. → A must be deployed before B's code runs.
94
+ 3. **Shared type / schema**: repo A modifies an exported type / OpenAPI schema /
95
+ protobuf / GraphQL SDL, and repo B imports that type or generates client code
96
+ from it. → A must be merged + published / regenerated before B's CI passes.
97
+ 4. **Message queue producer/consumer**: repo A adds a topic / event schema that
98
+ repo B subscribes to (or vice versa). → producer first if consumer must
99
+ handle the event; consumer first if backward-compatible.
100
+ 5. **Database schema**: repo A adds a column / table that repo B reads or
101
+ writes. → migration must run before the consumer is deployed.
102
+ 6. **Feature flag**: repos coordinate via a flag that defaults off. → ship in
103
+ any order, flip the flag last.
104
+
105
+ **Signals that imply "safe to parallel":**
106
+
107
+ - Diffs touch disjoint files with no shared imports / endpoints / types /
108
+ schemas.
109
+ - Pure internal refactors with no public surface change.
110
+
111
+ **Ambiguous cases — ASK the user, don't guess.** Output the candidate pairs and
112
+ the evidence you found, and let the user confirm direction.
113
+
114
+ Build a directed graph: edge A → B means "merge A before B." Detect cycles —
115
+ they indicate a genuine coordination problem (e.g. two repos depend on each
116
+ other's new API). Surface cycles to the user; don't try to break them
117
+ automatically.
118
+
119
+ ## Step 3 — Compute order
120
+
121
+ Topological sort of the graph yields groups of nodes that can merge in parallel
122
+ (no dependency between them) and groups that must be sequential.
123
+
124
+ Output as ordered steps:
125
+
126
+ ```
127
+ Step 1 (sequential)
128
+ • backend-api #1234 — adds the new endpoint that admin-web consumes
129
+ preconditions: CI green, ≥1 approval
130
+ post-merge wait: deploy reaches prod; smoke test passes
131
+ Step 2 (parallel)
132
+ • admin-web #567 — calls the new endpoint
133
+ • worker-service #890 — consumes the new event topic
134
+ preconditions: CI green, ≥1 approval
135
+ post-merge wait: deploy reaches prod
136
+ Step 3 (flag flip)
137
+ • toggle feature flag <flag-name> in <config service / dashboard>
138
+ ```
139
+
140
+ Annotate each step with:
141
+ - **why** it's at this position (which dependency edge created the ordering)
142
+ - **preconditions** specific to the user's environment (CI checks, required
143
+ reviewers — read from PR rules if possible, otherwise list the standard set)
144
+ - **post-merge wait** condition before the next step (deploy completion,
145
+ downstream healthcheck, integration test)
146
+ - **estimated wait** when known (e.g. typical deploy duration from past
147
+ features in `artifacts/`)
148
+
149
+ ## Step 4 — Rollback playbook
150
+
151
+ Output a **reverse-order rollback plan**. For each step, list:
152
+
153
+ - **How to revert**: revert PR + redeploy, or feature-flag flip, or DB rollback
154
+ migration if applicable.
155
+ - **Order**: strictly reverse of the merge order — last in, first out.
156
+ - **Caveats**: irreversible operations (e.g. destructive migration, deleted
157
+ column). Highlight these clearly — "this step cannot be cleanly rolled back
158
+ without data loss; ensure you can roll forward instead."
159
+ - **Who to notify**: any downstream that consumed the new API/event/schema
160
+ while the change was live.
161
+
162
+ ## Step 5 — Present and stop
163
+
164
+ Output the plan as a single markdown report:
165
+
166
+ ```markdown
167
+ # Release plan: <slug>
168
+
169
+ Generated <YYYY-MM-DD HH:MM> from <N> worktrees, <M> open PRs.
170
+
171
+ ## Pre-flight
172
+ - <state table from Step 1>
173
+ - <any blockers: failing CI, missing reviews, draft PRs>
174
+
175
+ ## Merge order
176
+ <step-by-step list from Step 3>
177
+
178
+ ## Rollback (reverse order)
179
+ <plan from Step 4>
180
+
181
+ ## Open questions
182
+ - <ambiguous dependencies the user must confirm>
183
+ - <missing PRs / missing CI signals>
184
+ ```
185
+
186
+ **Stop here.** This skill never executes any of the steps. The user reviews and
187
+ runs the plan manually (gh CLI, web UI, internal deploy tools — agentforge does
188
+ not assume which).
189
+
190
+ If the user explicitly asks "go ahead and merge the first one" — refuse and
191
+ remind them: this skill is the plan, not the executor. Direct them to `gh pr
192
+ merge` or their normal merge path.
193
+
194
+ ## Rules
195
+
196
+ - **Read-only**: no `git push`, no `gh pr merge`, no config changes, no flag
197
+ flips. Plan only.
198
+ - **No silent guessing on dependencies**: surface ambiguous edges and ask.
199
+ - **Cycles are problems, not puzzles**: report cycles and stop — the user must
200
+ reshape the work (split a PR, add a compatibility shim, etc.).
201
+ - **Branch names come from worktrees, not the slug** — each repo's branch may
202
+ follow its own naming convention.
203
+ - If a repo has uncommitted changes in its worktree, flag it and ask whether to
204
+ proceed — the plan is meaningless if the diff being analyzed isn't what will
205
+ actually merge.
206
+
207
+ ## Output language
208
+
209
+ {{OUTPUT_LANGUAGE_INSTRUCTION}}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@eric0117/agentforge",
3
+ "version": "0.1.0",
4
+ "description": "Multi-repo + git-worktree workspace bootstrapper for Claude Code, Cursor, and OpenAI Codex CLI",
5
+ "keywords": [
6
+ "claude-code",
7
+ "claude",
8
+ "cursor",
9
+ "codex",
10
+ "agent",
11
+ "ai",
12
+ "monorepo",
13
+ "multi-repo",
14
+ "worktree",
15
+ "workspace",
16
+ "cli",
17
+ "skills"
18
+ ],
19
+ "license": "MIT",
20
+ "author": "Eric0117",
21
+ "homepage": "https://github.com/Eric0117/agentforge#readme",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/Eric0117/agentforge.git"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/Eric0117/agentforge/issues"
28
+ },
29
+ "bin": {
30
+ "agentforge": "dist/cli.js"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "scripts": {
38
+ "build": "tsc && node scripts/copy-templates.mjs && chmod +x dist/cli.js",
39
+ "dev": "tsc --watch",
40
+ "prepublishOnly": "npm run build"
41
+ },
42
+ "type": "module",
43
+ "engines": {
44
+ "node": ">=18"
45
+ },
46
+ "dependencies": {
47
+ "prompts": "^2.4.2"
48
+ },
49
+ "devDependencies": {
50
+ "@types/node": "^20.11.0",
51
+ "@types/prompts": "^2.4.9",
52
+ "typescript": "^5.4.0"
53
+ }
54
+ }