@hobeenkim/agmo-opencode-plugin 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # AGMO OpenCode Plugin
2
+
3
+ 목표: OpenCode에서 `/agmo`를 실행하면 몇 가지 값을 입력받고, 워크스페이스 루트에 `AGENTS.md`를 생성/덮어쓰기.
4
+
5
+ 이 레포는 두 가지 방식 모두 지원합니다.
6
+
7
+ 1) 로컬 설정으로 바로 쓰기: `.opencode/`
8
+ 2) npm 패키지로 배포/설치해서 쓰기: `@hobeenkim/agmo-opencode-plugin`
9
+
10
+ ## npm 배포용(이 레포 루트)
11
+
12
+ - 플러그인 엔트리: `src/index.ts` (빌드 결과: `dist/`)
13
+ - 커맨드 템플릿: `templates/commands/agmo.md`
14
+
15
+ ### 설치/사용
16
+
17
+ 1. npm에 배포한 뒤, 프로젝트의 `opencode.json`에 플러그인을 추가합니다.
18
+
19
+ ```json
20
+ {
21
+ "$schema": "https://opencode.ai/config.json",
22
+ "plugin": ["@hobeenkim/agmo-opencode-plugin"]
23
+ }
24
+ ```
25
+
26
+ 2. 커맨드 파일을 프로젝트에 추가합니다.
27
+
28
+ - `templates/commands/agmo.md`를 `.opencode/commands/agmo.md`로 복사
29
+
30
+ 3. OpenCode에서 `/agmo` 실행
31
+
32
+ ## 로컬 설정(개발/테스트용)
33
+
34
+ - `.opencode/plugins/agmo.js`: tool `agmo_generate_agents_md` 등록
35
+ - `.opencode/commands/agmo.md`: `/agmo` 커맨드
36
+ - `.opencode/package.json`: 로컬 플러그인 의존성
37
+
38
+ ## 빌드
39
+
40
+ ```bash
41
+ npm install
42
+ npm run build
43
+ ```
44
+
45
+ ## npm 배포
46
+
47
+ 이 레포는 npm 2FA/토큰 정책 때문에, 퍼블리시용 인증이 필요합니다.
48
+
49
+ 1) 2FA(OTP)로 퍼블리시
50
+
51
+ ```bash
52
+ npm publish --access public --otp=123456
53
+ ```
54
+
55
+ 2) Granular token(2FA bypass)로 퍼블리시
56
+
57
+ ```bash
58
+ export NPM_TOKEN=YOUR_TOKEN
59
+ npm run publish:public
60
+ ```
61
+
62
+ 배포 확인:
63
+
64
+ ```bash
65
+ npm view @hobeenkim/agmo-opencode-plugin version
66
+ ```
@@ -0,0 +1,4 @@
1
+ import type { Plugin } from "@opencode-ai/plugin";
2
+ export declare const AgmoPlugin: Plugin;
3
+ export default AgmoPlugin;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAMlD,eAAO,MAAM,UAAU,EAAE,MA6BxB,CAAC;AAEF,eAAe,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,35 @@
1
+ import { tool } from "@opencode-ai/plugin/tool";
2
+ import fs from "node:fs/promises";
3
+ import path from "node:path";
4
+ import { renderAgentsMd } from "./renderAgentsMd.js";
5
+ export const AgmoPlugin = async () => {
6
+ return {
7
+ tool: {
8
+ agmo_generate_agents_md: tool({
9
+ description: "Generate/overwrite AGENTS.md in the current worktree",
10
+ args: {
11
+ repoType: tool.schema.enum(["backend", "frontend", "custom"]),
12
+ targetFolder: tool.schema.string(),
13
+ language: tool.schema.enum(["ko", "en"]),
14
+ issueFile: tool.schema.string(),
15
+ extraRules: tool.schema.string().optional(),
16
+ },
17
+ async execute(args, context) {
18
+ const root = context.worktree || context.directory;
19
+ const outPath = path.join(root, "AGENTS.md");
20
+ const content = renderAgentsMd({
21
+ repoType: args.repoType,
22
+ targetFolder: args.targetFolder,
23
+ language: args.language,
24
+ issueFile: args.issueFile,
25
+ extraRules: args.extraRules,
26
+ });
27
+ await fs.writeFile(outPath, content, "utf-8");
28
+ return `AGENTS.md created/updated at ${outPath}`;
29
+ },
30
+ }),
31
+ },
32
+ };
33
+ };
34
+ export default AgmoPlugin;
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,UAAU,GAAW,KAAK,IAAI,EAAE;IAC3C,OAAO;QACL,IAAI,EAAE;YACJ,uBAAuB,EAAE,IAAI,CAAC;gBAC5B,WAAW,EAAE,sDAAsD;gBACnE,IAAI,EAAE;oBACJ,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;oBAC7D,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;oBAClC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;oBACxC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;oBAC/B,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;iBAC5C;gBACD,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO;oBACzB,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC;oBACnD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;oBAC7C,MAAM,OAAO,GAAG,cAAc,CAAC;wBAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;wBACvB,YAAY,EAAE,IAAI,CAAC,YAAY;wBAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;wBACvB,SAAS,EAAE,IAAI,CAAC,SAAS;wBACzB,UAAU,EAAE,IAAI,CAAC,UAAU;qBAC5B,CAAC,CAAC;oBAEH,MAAM,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;oBAC9C,OAAO,gCAAgC,OAAO,EAAE,CAAC;gBACnD,CAAC;aACF,CAAC;SACH;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ export type AgmoInputs = {
2
+ repoType: "backend" | "frontend" | "custom";
3
+ targetFolder: string;
4
+ language: "ko" | "en";
5
+ issueFile: string;
6
+ extraRules?: string;
7
+ };
8
+ export declare function renderAgentsMd(v: AgmoInputs): string;
9
+ //# sourceMappingURL=renderAgentsMd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderAgentsMd.d.ts","sourceRoot":"","sources":["../src/renderAgentsMd.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,cAAc,CAAC,CAAC,EAAE,UAAU,UAmC3C"}
@@ -0,0 +1,32 @@
1
+ export function renderAgentsMd(v) {
2
+ const title = v.repoType === "backend"
3
+ ? "sdm-backend"
4
+ : v.repoType === "frontend"
5
+ ? "sdm-frontend"
6
+ : "custom-repo";
7
+ const langLine = v.language === "ko" ? "한국어로 답변한다." : "Answer in English.";
8
+ const extraRules = v.extraRules?.trim() ? v.extraRules.trim() : "- (none)";
9
+ return `# AGENTS.md
10
+
11
+ This repo is **${title}**. This file is the working agreement for humans and automation (CI, bots, AI agents).
12
+
13
+ ## Instructions
14
+ - ${langLine}
15
+ - 작업 중인 GitHub Issue에 대한 실행 과제는 \`${v.issueFile}\`에 적는다.
16
+ - 자동화/에이전트가 생성하는 리소스 기본 경로: \`${v.targetFolder}\`
17
+
18
+ ## 새로운 Issue 시작
19
+ 1. GitHub에서 이슈번호로 Issue를 읽고 \`${v.issueFile}\`에 작성한다. 기존 내용은 무시한다.
20
+ 2. Issue의 type에 따라 필요한 문서/코드 변경을 수행한다.
21
+ 3. 커밋 메시지는 변경 요약 + 이슈 번호를 포함한다.
22
+
23
+ ## 코드 변경 규칙
24
+ - 작은 단위로 커밋한다.
25
+ - 테스트/빌드가 필요한 경우 반드시 수행한다.
26
+ - 문서 변경이 필요한 경우 README/관련 문서를 함께 갱신한다.
27
+
28
+ ## 추가 규칙
29
+ ${extraRules}
30
+ `;
31
+ }
32
+ //# sourceMappingURL=renderAgentsMd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderAgentsMd.js","sourceRoot":"","sources":["../src/renderAgentsMd.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,cAAc,CAAC,CAAa;IAC1C,MAAM,KAAK,GACT,CAAC,CAAC,QAAQ,KAAK,SAAS;QACtB,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,UAAU;YACzB,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,aAAa,CAAC;IAEtB,MAAM,QAAQ,GACZ,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,oBAAoB,CAAC;IAE5D,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;IAE3E,OAAO;;iBAEQ,KAAK;;;IAGlB,QAAQ;oCACwB,CAAC,CAAC,SAAS;gCACf,CAAC,CAAC,YAAY;;;gCAGd,CAAC,CAAC,SAAS;;;;;;;;;;EAUzC,UAAU;CACX,CAAC;AACF,CAAC"}
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@hobeenkim/agmo-opencode-plugin",
3
+ "version": "0.1.0",
4
+ "description": "OpenCode plugin that provides a tool to generate AGENTS.md (used by /agmo command template)",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "templates"
16
+ ],
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "scripts": {
21
+ "build": "tsc -p tsconfig.json",
22
+ "clean": "rm -rf dist",
23
+ "prepack": "npm run clean && npm run build",
24
+ "publish:public": "NPM_CONFIG_USERCONFIG=.npmrc.publish npm publish --access public",
25
+ "verify:registry": "npm view @hobeenkim/agmo-opencode-plugin version"
26
+ },
27
+ "dependencies": {
28
+ "@opencode-ai/plugin": "^1.1.53"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "^22.13.9",
32
+ "typescript": "^5.5.4"
33
+ }
34
+ }
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: Generate AGENTS.md (AGMO)
3
+ agent: build
4
+ ---
5
+
6
+ 워크스페이스 루트에 `AGENTS.md`를 생성/덮어씁니다.
7
+
8
+ 아래 입력값을 질문해서 받습니다. (제가 "default"라고 답하면 기본값 사용)
9
+
10
+ 1) `repoType`: `backend`, `frontend`, `custom` 중 하나 (기본값: `backend`)
11
+ 2) `targetFolder`: 기본값 `.agents`
12
+ 3) `language`: `ko` 또는 `en` (기본값: `ko`)
13
+ 4) `issueFile`: 기본값 `TODO-Issue.md`
14
+ 5) `extraRules`: 옵션, 여러 줄 가능 (기본값: 빈 문자열)
15
+
16
+ 값을 모두 받으면 tool `agmo_generate_agents_md`를 아래 인자로 호출합니다.
17
+
18
+ - repoType
19
+ - targetFolder
20
+ - language
21
+ - issueFile
22
+ - extraRules
23
+
24
+ 마지막에 `AGENTS.md`가 생성/업데이트되었는지 확인 메시지를 출력합니다.