@nntoan/gstack 0.0.1 → 0.3.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.
package/README.md CHANGED
@@ -1,33 +1,229 @@
1
- # gstack-opencode
1
+ # @nntoan/gstack
2
2
 
3
- Use Garry Tan's exact OpenCode setup: 15 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA
3
+ `@nntoan/gstack` is an OpenCode plugin + CLI that brings a structured multi-agent engineering workflow into your coding sessions.
4
4
 
5
- > A Bun module created from the [bun-module](https://github.com/zenobi-us/bun-module) template
5
+ It ships with:
6
6
 
7
- ## Usage
7
+ - **13 built-in agents** (CEO, Eng Manager, Designer, Builder, Reviewer, Debugger, QA Lead, Release Engineer, Doc Engineer, Retro Lead, Safety Guard, Upgrader, Session Manager)
8
+ - **25 built-in skills** for planning, implementation, QA, release, investigation, and safety checks
9
+ - **Bun-first DX** with reproducible build/test/lint/typecheck scripts
8
10
 
9
- <!-- Example usage code goes here -->
11
+ ## Quick Start
10
12
 
11
- ## Installation
13
+ ### 1) Install
12
14
 
13
- <!-- Installation instructions go here -->
15
+ ```bash
16
+ npm i -g @nntoan/gstack
17
+ ```
18
+
19
+ ### 2) Register plugin and generate project config
20
+
21
+ From your project root:
22
+
23
+ ```bash
24
+ gstack install
25
+ ```
26
+
27
+ This command does two things:
28
+
29
+ 1. Creates project config at `.opencode/gstack.jsonc` (if missing)
30
+ 2. Adds `@nntoan/gstack` to your global OpenCode plugin list at `~/.config/opencode/opencode.json`
31
+
32
+ ### 3) Validate environment
33
+
34
+ ```bash
35
+ gstack doctor
36
+ ```
37
+
38
+ You're ready when doctor reports no blocking configuration/environment issues and your project contains `.opencode/gstack.jsonc`.
39
+
40
+ ## First-Run Troubleshooting
41
+
42
+ If onboarding fails, check these first:
43
+
44
+ 1. **`HOME` is available** (required for `~/.config/opencode/opencode.json` updates)
45
+ 2. **OpenCode global config is writable** (`~/.config/opencode/opencode.json`)
46
+ 3. **Project directory is writable** (for `.opencode/gstack.jsonc`)
47
+
48
+ Then run:
49
+
50
+ ```bash
51
+ gstack doctor
52
+ ```
53
+
54
+ If you still have issues, include doctor output and your Bun/OS environment when opening an issue.
55
+
56
+ ## What Gets Installed
57
+
58
+ ### CLI commands
59
+
60
+ - `gstack install` — bootstrap local config + plugin registration
61
+ - `gstack doctor` — run environment/config health checks
62
+
63
+ ### Plugin runtime flow
64
+
65
+ At runtime, the plugin entry (`src/index.ts`) does:
66
+
67
+ 1. Load plugin config
68
+ 2. Create skills + agents
69
+ 3. Create managers
70
+ 4. Create orchestrator
71
+ 5. Register tools + hooks
72
+ 6. Return plugin interface handlers (`chat.message`, `event`, tool hooks)
73
+
74
+ ## Configuration
75
+
76
+ Your project-level config lives at:
77
+
78
+ ```text
79
+ .opencode/gstack.jsonc
80
+ ```
81
+
82
+ Default template generated by `gstack install`:
83
+
84
+ ```jsonc
85
+ {
86
+ "$schema": "https://raw.githubusercontent.com/nntoan/gstack-opencode/main/schemas/config.schema.json",
87
+ "orchestration_mode": "multi-agent",
88
+ "disabled_agents": [],
89
+ "disabled_skills": [],
90
+ }
91
+ ```
92
+
93
+ Schema file in this repo: [`schemas/config.schema.json`](./schemas/config.schema.json)
94
+
95
+ Important top-level config keys:
96
+
97
+ - `orchestration_mode`: `multi-agent` | `skills-only`
98
+ - `disabled_agents`: string[]
99
+ - `disabled_skills`: string[]
100
+ - `disabled_mcps`: string[]
101
+ - `disabled_hooks`: string[]
102
+ - `agents`: per-agent overrides (`model`, `instructions`, `enabled`)
103
+ - `mcp`: provider and enable/disable controls (`websearch`, `context7`, `contexthub`, `grep_app`, `backlog_md`)
104
+ - `backlog`, `browser`, `telemetry`
105
+
106
+ ## Agent System Overview
107
+
108
+ All built-in agents are registered in [`src/agents/index.ts`](./src/agents/index.ts).
109
+
110
+ | Agent role | Purpose |
111
+ | ------------------ | ----------------------------------------- |
112
+ | `ceo` | Strategic direction and decomposition |
113
+ | `eng-manager` | Planning and execution framing |
114
+ | `designer` | UX and product-design decisions |
115
+ | `builder` | Implementation execution |
116
+ | `reviewer` | Code quality and review |
117
+ | `debugger` | Root-cause analysis and fixes |
118
+ | `qa-lead` | Test strategy and quality assurance |
119
+ | `release-engineer` | Release readiness and publishing flow |
120
+ | `doc-engineer` | Documentation and handoff quality |
121
+ | `retro-lead` | Retrospectives and process improvement |
122
+ | `safety-guard` | Risk/safety policy checks |
123
+ | `upgrader` | Dependency/runtime upgrade guidance |
124
+ | `session-manager` | Session continuity and context management |
125
+
126
+ Built-in skills are exported from [`src/features/builtin-skills/skills/index.ts`](./src/features/builtin-skills/skills/index.ts).
14
127
 
15
128
  ## Development
16
129
 
17
- - `mise run build` - Build the module
18
- - `mise run test` - Run tests
19
- - `mise run lint` - Lint code
20
- - `mise run lint:fix` - Fix linting issues
21
- - `mise run format` - Format code with Prettier
130
+ ### Prerequisites
131
+
132
+ - [Bun](https://bun.sh/) runtime
133
+ - [mise](https://mise.jdx.dev/) (optional but recommended for task aliases)
134
+
135
+ ### Install dependencies
136
+
137
+ ```bash
138
+ bun install
139
+ ```
140
+
141
+ ### Core commands
142
+
143
+ - Build library: `bun run build`
144
+ - Build CLI: `bun run build:cli`
145
+ - Build all: `bun run build:all`
146
+ - Test: `bun run test`
147
+ - Typecheck: `bun run typecheck`
148
+ - Lint: `bun run lint`
149
+ - Lint fix: `bun run lint:fix`
150
+ - Format: `bun run format`
151
+
152
+ Equivalent mise shortcuts:
153
+
154
+ - `mise run build`
155
+ - `mise run test`
156
+ - `mise run lint`
157
+ - `mise run lint:fix`
158
+ - `mise run format`
159
+
160
+ ### Typical local CI loop
161
+
162
+ ```bash
163
+ bun run test && bun run typecheck && bun run lint && bun run build:all
164
+ ```
165
+
166
+ ## For Autonomous Coding Agents
167
+
168
+ If you are an AI coding agent contributing to this repo, read these first:
169
+
170
+ 1. [`AGENTS.md`](./AGENTS.md) — command standards, style rules, test/lint expectations
171
+ 2. [`CLAUDE.md`](./CLAUDE.md) — GitNexus workflow and safety requirements
172
+ 3. [`CONTRIBUTING.md`](./CONTRIBUTING.md) — PR and commit conventions
173
+
174
+ Required workflow guardrails:
175
+
176
+ - Run impact analysis before symbol edits (`gitnexus_impact`)
177
+ - Run change-scope checks before commit (`gitnexus_detect_changes`)
178
+ - Use Conventional Commits
179
+ - Keep `no-console` and strict TypeScript requirements intact
180
+
181
+ Safe local validation loop before proposing changes:
182
+
183
+ ```bash
184
+ bun run test && bun run typecheck && bun run lint && bun run build:all
185
+ ```
186
+
187
+ ## Architecture Map (Where to Start)
188
+
189
+ - CLI definition: [`src/cli/cli-program.ts`](./src/cli/cli-program.ts)
190
+ - Install behavior: [`src/cli/install.ts`](./src/cli/install.ts)
191
+ - Plugin entry: [`src/index.ts`](./src/index.ts)
192
+ - Plugin interface hooks: [`src/plugin-interface.ts`](./src/plugin-interface.ts)
193
+ - Skills + agents composition: [`src/create-skills-and-agents.ts`](./src/create-skills-and-agents.ts)
194
+ - Orchestrator: [`src/features/orchestrator/`](./src/features/orchestrator)
195
+ - MCP integrations: [`src/mcp/`](./src/mcp)
196
+
197
+ If you are new to the codebase, start with `src/cli/install.ts` and `src/index.ts`.
22
198
 
23
199
  ## Release
24
200
 
25
- See the [RELEASE.md](RELEASE.md) file for instructions on how to release a new version of the module.
201
+ Release automation is documented in [`RELEASE.md`](./RELEASE.md).
202
+
203
+ Short version:
204
+
205
+ - Standard releases go through **Release Please** (`.github/workflows/release-please.yml`)
206
+ - Manual fallback publishing exists in `.github/workflows/publish.yml`
26
207
 
27
208
  ## Contributing
28
209
 
29
- Contributions are welcome! Please file issues or submit pull requests on the GitHub repository.
210
+ Please follow [`CONTRIBUTING.md`](./CONTRIBUTING.md).
211
+
212
+ Minimum bar before opening a PR:
213
+
214
+ ```bash
215
+ mise run test
216
+ mise run lint
217
+ ```
218
+
219
+ Use Conventional Commits for commit messages and PR titles.
220
+
221
+ ## Documentation Map
222
+
223
+ - [`AGENTS.md`](./AGENTS.md) — engineering and code quality rules
224
+ - [`CONTRIBUTING.md`](./CONTRIBUTING.md) — PR and contribution process
225
+ - [`RELEASE.md`](./RELEASE.md) — release and publishing workflows
30
226
 
31
227
  ## License
32
228
 
33
- See the [LICENSE](LICENSE) file for details.
229
+ See [LICENSE](./LICENSE).
package/dist/cli.js CHANGED
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
+ var __returnValue = (v) => v;
35
+ function __exportSetter(name, newValue) {
36
+ this[name] = __returnValue.bind(null, newValue);
37
+ }
20
38
  var __export = (target, all) => {
21
39
  for (var name in all)
22
40
  __defProp(target, name, {
23
41
  get: all[name],
24
42
  enumerable: true,
25
43
  configurable: true,
26
- set: (newValue) => all[name] = () => newValue
44
+ set: __exportSetter.bind(all, name)
27
45
  });
28
46
  };
29
47
  var __require = import.meta.require;
@@ -2139,7 +2157,7 @@ var {
2139
2157
  // package.json
2140
2158
  var package_default = {
2141
2159
  name: "@nntoan/gstack",
2142
- version: "0.0.1",
2160
+ version: "0.3.0",
2143
2161
  description: "Use Garry Tan's exact OpenCode setup: 15 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA",
2144
2162
  author: {
2145
2163
  name: "Toan Nguyen",
@@ -2207,16 +2225,15 @@ var package_default = {
2207
2225
  optionalDependencies: {
2208
2226
  "@nntoan/gstack-darwin-arm64": "0.0.1",
2209
2227
  "@nntoan/gstack-darwin-x64": "0.0.1",
2228
+ "@nntoan/gstack-darwin-x64-baseline": "0.0.1",
2210
2229
  "@nntoan/gstack-linux-arm64": "0.0.1",
2211
2230
  "@nntoan/gstack-linux-x64": "0.0.1",
2231
+ "@nntoan/gstack-linux-x64-baseline": "0.0.1",
2212
2232
  "@nntoan/gstack-linux-arm64-musl": "0.0.1",
2213
2233
  "@nntoan/gstack-linux-x64-musl": "0.0.1",
2214
- "@nntoan/gstack-win32-arm64": "0.0.1",
2234
+ "@nntoan/gstack-linux-x64-musl-baseline": "0.0.1",
2215
2235
  "@nntoan/gstack-win32-x64": "0.0.1",
2216
- "@nntoan/gstack-win32-ia32": "0.0.1",
2217
- "@nntoan/gstack-freebsd-x64": "0.0.1",
2218
- "@nntoan/gstack-freebsd-arm64": "0.0.1",
2219
- "@nntoan/gstack-openbsd-x64": "0.0.1"
2236
+ "@nntoan/gstack-win32-x64-baseline": "0.0.1"
2220
2237
  },
2221
2238
  devDependencies: {
2222
2239
  "@eslint/js": "^9.39.1",
@@ -3043,7 +3060,7 @@ var ParseErrorCode;
3043
3060
  })(ParseErrorCode || (ParseErrorCode = {}));
3044
3061
 
3045
3062
  // src/config/schema/constants.ts
3046
- var SCHEMA_URL = "https://raw.githubusercontent.com/nntoan/opencode-gstack/main/schemas/config.schema.json";
3063
+ var SCHEMA_URL = "https://raw.githubusercontent.com/nntoan/gstack-opencode/main/schemas/config.schema.json";
3047
3064
 
3048
3065
  // src/cli/install.ts
3049
3066
  var PROJECT_CONFIG_TEMPLATE = `{
@@ -1 +1 @@
1
- export declare const SCHEMA_URL = "https://raw.githubusercontent.com/nntoan/opencode-gstack/main/schemas/config.schema.json";
1
+ export declare const SCHEMA_URL = "https://raw.githubusercontent.com/nntoan/gstack-opencode/main/schemas/config.schema.json";
package/dist/index.js CHANGED
@@ -4,25 +4,43 @@ var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
7
12
  var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
8
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
9
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
22
  for (let key of __getOwnPropNames(mod))
11
23
  if (!__hasOwnProp.call(to, key))
12
24
  __defProp(to, key, {
13
- get: () => mod[key],
25
+ get: __accessProp.bind(mod, key),
14
26
  enumerable: true
15
27
  });
28
+ if (canCache)
29
+ cache.set(mod, to);
16
30
  return to;
17
31
  };
18
32
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
+ var __returnValue = (v) => v;
34
+ function __exportSetter(name, newValue) {
35
+ this[name] = __returnValue.bind(null, newValue);
36
+ }
19
37
  var __export = (target, all) => {
20
38
  for (var name in all)
21
39
  __defProp(target, name, {
22
40
  get: all[name],
23
41
  enumerable: true,
24
42
  configurable: true,
25
- set: (newValue) => all[name] = () => newValue
43
+ set: __exportSetter.bind(all, name)
26
44
  });
27
45
  };
28
46
  var __require = import.meta.require;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nntoan/gstack",
3
- "version": "0.0.1",
3
+ "version": "0.3.0",
4
4
  "description": "Use Garry Tan's exact OpenCode setup: 15 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA",
5
5
  "author": {
6
6
  "name": "Toan Nguyen",
@@ -68,16 +68,15 @@
68
68
  "optionalDependencies": {
69
69
  "@nntoan/gstack-darwin-arm64": "0.0.1",
70
70
  "@nntoan/gstack-darwin-x64": "0.0.1",
71
+ "@nntoan/gstack-darwin-x64-baseline": "0.0.1",
71
72
  "@nntoan/gstack-linux-arm64": "0.0.1",
72
73
  "@nntoan/gstack-linux-x64": "0.0.1",
74
+ "@nntoan/gstack-linux-x64-baseline": "0.0.1",
73
75
  "@nntoan/gstack-linux-arm64-musl": "0.0.1",
74
76
  "@nntoan/gstack-linux-x64-musl": "0.0.1",
75
- "@nntoan/gstack-win32-arm64": "0.0.1",
77
+ "@nntoan/gstack-linux-x64-musl-baseline": "0.0.1",
76
78
  "@nntoan/gstack-win32-x64": "0.0.1",
77
- "@nntoan/gstack-win32-ia32": "0.0.1",
78
- "@nntoan/gstack-freebsd-x64": "0.0.1",
79
- "@nntoan/gstack-freebsd-arm64": "0.0.1",
80
- "@nntoan/gstack-openbsd-x64": "0.0.1"
79
+ "@nntoan/gstack-win32-x64-baseline": "0.0.1"
81
80
  },
82
81
  "devDependencies": {
83
82
  "@eslint/js": "^9.39.1",
@@ -1,14 +1,11 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://raw.githubusercontent.com/nntoan/opencode-gstack/main/schemas/config.schema.json",
3
+ "$id": "https://raw.githubusercontent.com/nntoan/gstack-opencode/main/schemas/config.schema.json",
4
4
  "type": "object",
5
5
  "properties": {
6
6
  "orchestration_mode": {
7
7
  "type": "string",
8
- "enum": [
9
- "multi-agent",
10
- "skills-only"
11
- ],
8
+ "enum": ["multi-agent", "skills-only"],
12
9
  "default": "multi-agent",
13
10
  "description": "Orchestration mode for agent execution"
14
11
  },
@@ -73,10 +70,7 @@
73
70
  "properties": {
74
71
  "provider": {
75
72
  "type": "string",
76
- "enum": [
77
- "exa",
78
- "tavily"
79
- ],
73
+ "enum": ["exa", "tavily"],
80
74
  "default": "exa"
81
75
  },
82
76
  "api_key": {