{"id":"83663094-b5f3-4f71-bc11-6fd895ef649b","slug":"obov-contents-genesis","kind":"skill","name":"contents-genesis","summary":"Pluggable content-production workspace: record store, builtin modules, production pipelines, shared agent skills and the cg CLI","owner":"obov","repoUrl":"https://github.com/obov/contents-genesis","license":"MIT","licenseTier":"permissive","trust":"community","stars":0,"match":null,"fewStars":true,"format":"skill","createdAt":"2026-09-30T22:28:31.000Z","addedAt":"2026-10-14T11:36:55.317Z","logoUrl":"https://avatars.githubusercontent.com/u/59566239?u=cc02daa597b7a5d9aa3c51e1f811ec311da21006&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["writing"],"tags":[],"runtime":"node","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-14T21:31:28.583Z","sample":false,"url":"https://conduits.dev/tools/obov-contents-genesis","language":"TypeScript","transports":["stdio"],"install":{"npm":"contents-genesis"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# contents-genesis\n\n콘텐츠 제작 프로젝트용 공통 기반. core 레코드 저장소, 기본 모듈 7개, 공유 스킬, `cg` CLI 제공.\n\n## 빠른 시작\n\n```bash\nnpx contents-genesis init my-channel          # 기본 모듈 7개 + renderer + workspace\ncd my-channel\nnpx cg module list\n```\n\nBun(>=1.3) 필요. `npx`는 Node shim(`bin/cg.js`)이 bun으로 위임.\n프로젝트 안에서는 로컬 설치 버전 우선 실행.\n\n## 모듈\n\n`project.json`의 `modules` 배열이 로드 대상. 표기 3종:\n\n| 표기 | 종류 | 위치 |\n|---|---|---|\n| `@cg/production` | 기본 모듈 | 이 패키지의 `modules/` |\n| `./modules/scenes` | 로컬 모듈 | 프로젝트 안 |\n| `cg-naver-blog` | 외부 모듈 패키지 | `node_modules/` |\n\n```bash\ncg module add experiments                  # 기본 모듈 (누락 의존성 자동 추가)\ncg module add adsense                      # opt-in 기본 모듈 (init 기본값 제외). AdSense 신청 상태 · 점검 · 수익 기록\ncg module add ./modules/scenes             # 로컬 모듈\ncg module add github:owner/cg-naver-blog   # 외부 패키지 (bun add 후 등록, 실패 시 롤백)\ncg module remove analytics [--cascade]     # 의존 모듈 있으면 거부, --cascade로 함께 제거\ncg module new scenes                       # ./modules/scenes 골격\ncg module eject production                 # 기본 모듈을 ./modules/production으로 복사해 커스텀\ncg run production render <ID>              # 모듈 run.ts 실행 (cwd = 프로젝트)\n```\n\n- 모든 변경은 Registry 검증 통과 시에만 `project.json`에 기록\n- 제거된 모듈의 workspace 기록은 보존. 재추가 시 검증 복구\n- 커스텀 우선순위: 로컬 모듈로 확장 → 불가 시 eject (`EJECTED.json`에 원본 버전 기록)\n\n### 모듈 패키지 작성\n\n패키지 루트에 `module.json` + `schemas/`. 코드에서 core 사용:\n\n```ts\nimport { Catalog, draft, relationDraft } from \"contents-genesis/core\";\nconst catalog = new Catalog(process.env.CG_PROJECT_ROOT ?? process.cwd());\n```\n\n## Production pipeline\n\nproduction 모듈은 형식과 무관합니다. 기록, adoption, 실행 journal, 산출물 커밋만 담당하고, 실제 제작 방식은 pipeline이 맡습니다.\n영상, 음성, 블로그 등 새 형식을 추가할 때 core나 모듈을 수정할 필요가 없습니다.\n\n```json\n\"production\": {\n  \"default_pipeline\": \"remotion\",\n  \"pipelines\": {\n    \"remotion\": { \"use\": \"@cg/remotion\", \"renderer\": \"renderer\" },\n    \"voice\":    { \"use\": \"./pipelines/voice\" },\n    \"blog\":     { \"use\": \"@cg/command\", \"operations\": { \"build\": {\n                  \"run\": [\"bun\", \"tools/post.mjs\", \"{out}/post.html\", \"{item.title}\"],\n                  \"outputs\": [{ \"path\": \"post.html\", \"kind\": \"post\" }] } } }\n  }\n}\n```\n\nitem(`workspace/stores/production/inputs/projects.json`)은 `\"pipeline\": \"<name>\"` 필드로 자기 pipeline을 선택합니다.\n\n| pipeline | 용도 |\n|---|---|\n| `@cg/remotion` | 영상 제작. 연산: list, check, still, render, package, voice |\n| `@cg/command` | 설정만으로 외부 명령 실행. 선언한 outputs를 산출물로 기록 |\n| `./pipelines/<name>` | 로컬 TS pipeline (`cg pipeline new <name>`로 골격 생성) |\n| `<패키지>` | 외부 pipeline 패키지 |\n\n```bash\ncg pipeline list | add <name> <spec> | new <name> | remove <name> | default <name>\ncg run production adopt ITEM [--from-run RUN]    # 입력 고정(pin) / 이전 실행이 만든 파일 채택\ncg run production <op> ITEM [args]               # item의 pipeline으로 실행\ncg run production <op> --pipeline NAME           # item 없는 연산\n```\n\n### pipeline 작성\n\n```ts\nimport { definePipeline } from \"contents-genesis/production\";\nexport default definePipeline({\n  id: \"tts\", version: \"0.1.0\",\n  inputs: ({ inputs, item }) => ({ text: \"...\", files: [\"...\"] }),  // 선택: adopt 대상\n  prepare(ctx) {},                                                    // 선택: stage 구성\n  operations: {\n    generate: {\n      relation: \"generated_from\",\n      async run(ctx) {                  // ctx: item, stage, runDir, adopted, exec(), env\n        return { artifacts: [{ file, kind: \"audio\", media_type: \"audio/mpeg\" }],\n                 adoptable: [\"audio/x.mp3\"] };   // adopt --from-run으로 inputs에 복사\n      },\n    },\n  },\n});\n```\n\n- `inputs`가 있으면 item 연산은 adopt가 끝난 뒤에만 실행되고, 산출물은 script에 대한 관계(`rendered_from` / `generated_from`)로 연결됩니다.\n- `artifact_kind`는 자유 문자열입니다(`production.artifact@1.1.0`). 기존 v1 기록은 그대로 유지됩니다.\n- 레거시 설정 `production.renderer`는 `@cg/remotion`으로 해석되고, `cg pipeline add/new`를 실행하면 명시적인 설정으로 전환됩니다.\n\n## 스킬\n\n`skills/`의 공유 스킬을 프로젝트 `.agents/skills/<name>`에 symlink. `.claude/skills → ../.agents/skills`.\nClaude Code·Codex 공통 인식. `postinstall`의 `cg skill link`가 clone 후 링크 복구.\n\n```bash\ncg skill list | add <name> | remove <name> | link\n```\n\nClaude Code 플러그인으로도 사용 가능 (`.claude-plugin/marketplace.json`).\n\n## 구성 추적과 에이전트 context\n\ncg를 실행할 때마다 프로젝트 구성(모듈, pipeline, 기본 pipeline, 공유·프로젝트 스킬, 로컬 파일 hash)을 `.cg/state.json`과 비교합니다.\n변경 사항은 `.cg/history.jsonl`에 기록되고, `.cg/`는 Git으로 관리합니다.\n\n| source | 의미 |\n|---|---|\n| `baseline` | 추적을 시작한 시점의 구성 |\n| `cg` | cg 명령으로 바꾼 변경. `command`와 `actor`(human / agent:claude-code / agent:codex / `CG_ACTOR`)를 함께 기록 |\n| `external` | 파일을 직접 고친 변경. 다음 cg 실행 때 감지되며 `observed_by`를 기록 |\n\n```bash\ncg context --brief                 # 한 화면 요약 (세션 시작 hook이 주입하는 내용)\ncg context                         # 모듈 표, 커스텀, pipeline 연산, 스킬, 최근 실행, 변경 이력, 경고\ncg context module <id>             # 타입 필수 필드, 관계, 의존성, eject drift, 해당 모듈 이력\ncg context pipeline <name>         # 연산, adoption 필요 여부, 최근 실행, 이력\ncg context history [--limit N]\ncg context --json                  # 구조화 데이터\ncg context hook                    # Claude Code SessionStart hook 설치 (init은 기본으로 설치, --no-hook으로 생략)\n```\n\n- eject한 모듈은 원본 파일 hash를 저장해 두고, 로컬에서 수정·추가·삭제한 파일과 이후 upstream 변경 여부를 보고합니다.\n- 에이전트에 전달하는 경로: SessionStart hook(자동 주입), 공유 스킬 `cg-context`(init 때 기본 링크, cg 조회·갱신·배포 분기), AGENTS.md 규칙\n\n## 워크스페이스 명령\n\n```bash\ncg doctor | check | verify | usage | reindex | export\ncg write FILE | show ID [REV] | alias NS VALUE | links ID | search TEXT [TYPE] | followup ID\n```\n\n## 프로젝트 설정 (`project.json`)\n\n```json\n{\n  \"format_version\": \"1.0.0\",\n  \"id\": \"my-channel\",\n  \"modules\": [\"@cg/sources\", \"@cg/research\", \"@cg/production\", \"./modules/scenes\"],\n  \"stores\": { \"records\": \"workspace/records\", \"objects\": \"workspace/objects\", \"stores\": \"workspace/stores\",\n              \"indexes\": \"workspace/indexes\", \"runs\": \"workspace/runs\", \"work\": \"workspace/work\" },\n  \"skills\": [\"kit-browser-automation\"],\n  \"production\": { \"renderer\": \"renderer\" }\n}\n```\n\n- `id`: 레코드 alias namespace 접두사 (`<id>:production`)\n- `production.renderer`: production 모듈이 사용할 Remotion 렌더러 경로\n\n## 개발\n\n```bash\nbun install\nbun run check        # tsc + 개별 버전 검사 + 계약 테스트 + CLI 테스트\n```\n\n개별 버전: 모듈 `modules/<id>/module.json`의 `version`, 스킬 `skills/<name>/SKILL.md` frontmatter `metadata.version`.\n`bun run check:versions`: 직전 릴리스 태그 대비 파일이 바뀐 모듈·스킬의 버전 미증가 시 실패. 패키지 버전과 독립.\n\n로컬 checkout에서 `init` 시 의존성은 `file:<checkout>` (복사 설치).\ncheckout 수정 즉시 반영 필요 시: 이 디렉터리에서 `bun link` → 프로젝트 의존성 `\"contents-genesis\": \"link:contents-genesis\"`.\n\n## 배포\n\n- CI: `main` push / PR → `bun run check`\n- 릴리스: `npm version <patch|minor>` → `git push --follow-tags` → `publish` workflow가 check 후 `npm publish --provenance`\n- npm trusted publishing(OIDC) 사용. 토큰 secret 불필요\n\n## License\n\nMIT\n"}