Skip to content

Commit 8e16c35

Browse files
authored
Merge pull request #10 from masseater/feat/cc-plugin-lib
feat: add shared plugin library and auto contradiction check
2 parents 8ff38ad + b34c1e5 commit 8e16c35

43 files changed

Lines changed: 1649 additions & 155 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "master",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"name": "mutils",
99
"source": "./plugins/mutils",
1010
"description": "masseater's utils",
11-
"version": "0.6.6"
11+
"version": "0.6.7"
1212
},
1313
{
1414
"name": "sdd",
1515
"source": "./plugins/sdd",
1616
"description": "Spec Driven Development (SDD) ワークフロー支援コマンド集",
17-
"version": "0.3.4"
17+
"version": "0.3.5"
1818
},
1919
{
2020
"name": "debug",

.github/workflows/ci.yml

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ on:
77
pull_request:
88

99
jobs:
10-
ci-plugins:
10+
ci:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
plugin: [mutils, sdd]
15-
defaults:
16-
run:
17-
working-directory: plugins/${{ matrix.plugin }}
14+
include:
15+
- path: plugins/mutils
16+
- path: plugins/sdd
17+
- path: packages/sdd-webapp
18+
- path: packages/cc-plugin-lib
1819

1920
steps:
2021
- uses: actions/checkout@v4
@@ -24,40 +25,22 @@ jobs:
2425
with:
2526
bun-version: latest
2627

27-
- name: Install dependencies
28+
- name: Install dependencies (root)
2829
run: bun install --frozen-lockfile
2930

30-
- name: Run type check
31-
run: bun run typecheck
32-
33-
- name: Run lint
34-
run: bun run check
35-
36-
ci-packages:
37-
runs-on: ubuntu-latest
38-
strategy:
39-
matrix:
40-
package: [sdd-webapp]
41-
defaults:
42-
run:
43-
working-directory: packages/${{ matrix.package }}
44-
45-
steps:
46-
- uses: actions/checkout@v4
47-
48-
- name: Setup Bun
49-
uses: oven-sh/setup-bun@v2
50-
with:
51-
bun-version: latest
52-
53-
- name: Install dependencies
31+
- name: Install dependencies (package)
32+
working-directory: ${{ matrix.path }}
5433
run: bun install --frozen-lockfile
5534

5635
- name: Run type check
36+
working-directory: ${{ matrix.path }}
5737
run: bun run typecheck
5838

5939
- name: Run lint
40+
working-directory: ${{ matrix.path }}
6041
run: bun run check
6142

62-
- name: Build
43+
- name: Build (packages only)
44+
if: startsWith(matrix.path, 'packages/')
45+
working-directory: ${{ matrix.path }}
6346
run: bun run build
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Bun
17+
uses: oven-sh/setup-bun@v2
18+
with:
19+
bun-version: latest
20+
21+
- name: Install dependencies
22+
run: bun install --frozen-lockfile
23+
24+
- name: Build packages
25+
run: bun run build
26+
27+
- name: Setup Node.js for npm publish
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '24'
31+
registry-url: 'https://registry.npmjs.org'
32+
33+
- name: Create Release Pull Request or Publish
34+
uses: changesets/action@v1
35+
with:
36+
publish: bun run release
37+
version: bun run version
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish-sdd-webapp.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

AGENTS.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,35 @@ plugins/
7777

7878
`.claude-plugin/marketplace.json` で全プラグインを管理。各プラグインのバージョン更新時はここも更新。
7979

80+
### 共通ライブラリ
81+
82+
`@r_masseater/cc-plugin-lib` - プラグイン間で共有するユーティリティ:
83+
84+
- `HookLogger` - ファイルベースのロギング
85+
- `wrapRun` - エラーハンドリングラッパー
86+
87+
```typescript
88+
import { HookLogger, wrapRun } from "@r_masseater/cc-plugin-lib";
89+
90+
using logger = HookLogger.fromFile(import.meta.filename);
91+
```
92+
8093
### Hooks実装パターン
8194

8295
Hooksは TypeScript + Bun + [cc-hooks-ts](https://github.com/sushichan044/cc-hooks-ts) で実装:
8396

8497
```typescript
98+
import { HookLogger, wrapRun } from "@r_masseater/cc-plugin-lib";
8599
import { defineHook, runHook } from "cc-hooks-ts";
86100

101+
using logger = HookLogger.fromFile(import.meta.filename);
102+
87103
const hook = defineHook({
88104
trigger: { SessionStart: true, Stop: true },
89-
run: (context) => {
105+
run: wrapRun(logger, (context) => {
90106
// ロジック
91107
return context.success({});
92-
},
108+
}),
93109
});
94110

95111
if (import.meta.main) {

0 commit comments

Comments
 (0)