本文へ移動
cccskills
無料GitHub で公開

subagent-gen

Generate a persistent PROJECT-KNOWLEDGE.md profile for any codebase that gives subagents instant deep domain expertise. Analyzes project structure, architecture, code conventions, tech stack, data flow, and domain concepts. The profile is designed to be loaded into Agent tool prompts so subagents can answer deep codebase questions like an expert teammate. Use when the user asks to profile a project, generate project knowledge, create a codebase profile, build a context pack, analyze a codebase for subagents, or says "profile this project". Trigger phrases include "profile project", "generate project knowledge", "codebase profile", "subagent context", "knowledge profile", "project profile", "profile this codebase", "build project knowledge", "create context pack", "generate codebase knowledge", "index this project", "make subagent", "generate subagent", "deep knowledge", "project expert".

日本語の概要は準備中です。原文の説明を表示しています。

実行スコア 未検証

インストール方法を見る

含まれるファイル(5)

  • SKILL.md14.8 KB
  • agents/subagent-gen.md6.4 KB
  • references/exploration-dimensions.md10.2 KB
  • references/profile-template.md7.0 KB
  • references/prompt-integration-guide.md4.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Subagent Knowledge Profile Generator

Generate a persistent PROJECT-KNOWLEDGE.md that captures deep domain knowledge about a codebase, designed to fit in a subagent prompt context window.

Locating your own reference files

Every references/*.md mention below is relative to this skill's own install location, not to the project being profiled (--project) — your working directory is the target project, so a bare relative path will not resolve. Resolve it once, in one Bash call, at the top of the workflow:

SKILL_HOME=$(ls -d ~/.claude/plugins/cache/hideki-plugins/subagent-gen/*/skills/subagent-gen 2>/dev/null | sort -V | tail -1)
echo "$SKILL_HOME"

Re-derive $SKILL_HOME in the same Bash call as any later read — shell state doesn't persist between separate Bash tool calls. This is also the "skill resource dir" to pass to the synthesis subagent in Phase 3 (its own input contract expects it as an absolute path, not a relative one).

Arguments

Parse these from the user's invocation. All are optional with defaults:

ArgumentDefaultDescription
--projectcwdPath to the project to profile
--name(auto)Profile name — used as filename in ~/.claude/knowledge/. Auto-derived from manifest or directory name
--output~/.claude/knowledge/{name}.mdOverride the canonical output path
--updatefalseRefresh an existing profile incrementally
--depthstandardquick (~2K words), standard (~4K words), deep (~6K words)
--focusallComma-separated subset: structure, architecture, conventions, domain
--listfalseList all available profiles in ~/.claude/knowledge/ and stop

Workflow

Phase 0: List Profiles (if --list)

If --list is passed, list all *.md files in ~/.claude/knowledge/:

ls -la ~/.claude/knowledge/*.md 2>/dev/null

For each file, parse the header line to extract project name, generation date, depth, and source path. Display as a table:

ProfileGeneratedDepthSource Path
{name}{date}{depth}{path}

Then stop — do not proceed to profiling.

Feedback Check

If feedback/log.md exists and has 5 or more entries, read the last 10 entries. If a pattern is apparent (same issue in 3+ entries, or average rating below 3):

  • Tell the user: "Recurring feedback detected: [brief pattern]. Consider running /skill-improve --skill subagent-gen."
  • Continue with normal execution.

Phase 1: Identify Target Project

  1. Use --project path or current working directory
  2. Verify it contains source files (not empty or config-only)
  3. Derive --name if not provided:
    • Read package.json → use name field
    • Read pyproject.toml → use [project] name
    • Read Cargo.toml → use [package] name
    • Fallback: use the directory basename, lowercased, hyphens for spaces
  4. If --update, check for existing profile at ~/.claude/knowledge/{name}.md first, then fall back to .agent/local/PROJECT-KNOWLEDGE.md
  5. Read .gitignore to understand exclusion patterns

If the directory is empty or has no source files, report "No source files found" and stop.

Phase 2: Reconnaissance (Inline)

Quick inline scan — no subagents needed. Gather metadata for Phase 3.

  1. Read root manifests: Look for package.json, pyproject.toml, Cargo.toml, go.mod, pom.xml, build.gradle, *.sln, *.csproj, Gemfile, composer.json, mix.exs, CMakeLists.txt, Makefile, Dockerfile, docker-compose.yml
  2. Directory tree: Use Glob/Bash to map top 3 levels of the directory tree
  3. File census: Count source files vs test files vs config files by extension
  4. Detect stack: From manifests, identify:
    • Primary language(s) and version(s)
    • Framework(s)
    • Build system / package manager
    • Test runner(s)
    • Whether it's a monorepo (multiple package.json / workspace config)

Produce a metadata block in this format to pass to Phase 3 agents:

PROJECT METADATA
================
Name: {project name from manifest}
Path: {absolute path}
Language(s): {e.g., TypeScript 85%, Python 15%}
Framework(s): {e.g., Next.js 14, FastAPI}
Build: {e.g., pnpm, turborepo}
Test runner: {e.g., vitest, pytest}
Monorepo: {yes/no — packages: ...}
Source dirs: {e.g., src/, api/, packages/}
Test dirs: {e.g., __tests__/, tests/, e2e/}
File count: {e.g., 342 source, 89 test, 45 config}

Phase 3: Parallel Deep Exploration

Read "$SKILL_HOME"/references/exploration-dimensions.md for the full pattern catalog for each dimension.

Spawn Explore-type subagents in parallel. Each agent receives:

  • The project path
  • The metadata block from Phase 2
  • Its specific exploration instructions from the dimension catalog

Agent Configuration by Depth

--depth=quick — 2 agents:

AgentCombined Dimensions
structure-architectureStructure + Architecture: directory layout, entry points, module boundaries, how modules connect, data flow, layering
conventions-domainConventions + Domain: naming patterns, error handling, key abstractions, API surface, config

--depth=standard — 4 agents:

AgentDimension
structure-agentDirectory layout, entry points, module boundaries, build outputs
architecture-agentModule connections, dependency graph, data flow, layering, state management
conventions-agentNaming patterns, error handling, logging, validation, testing patterns
domain-agentBusiness/domain concepts, key abstractions, API surface, configuration

--depth=deep — 4 agents with expanded scope: Same agents as standard, but each samples more files (20-30 instead of 10-15) and traces deeper dependency chains. Architecture agent also maps middleware chains and plugin systems.

Agent Prompt Template

For each agent, construct a prompt like:

You are analyzing a codebase to build a deep knowledge profile.

PROJECT METADATA
================
{paste metadata block from Phase 2}

YOUR DIMENSION: {dimension name}
=================================
{paste the relevant section from "$SKILL_HOME"/references/exploration-dimensions.md}

INSTRUCTIONS:
- Explore the project at {project path}
- Follow the exploration patterns and grep signals listed above
- Sample {10-15 | 20-30} files across different directories
- For every finding, include the concrete file path and specific detail
- Do NOT include vague descriptions — every bullet must have a file path or function name
- Output your findings in the exact markdown format specified in the dimension catalog

Report back your findings as a structured markdown block.

Focus Filtering

If --focus is set to specific dimensions (e.g., --focus=structure,domain), only spawn agents for those dimensions. Skip the others.

Monorepo Handling

If the project is a monorepo with multiple packages:

  1. Ask the user which package(s) to profile, or whether to profile the root structure
  2. If profiling specific packages, scope each agent's exploration to those package directories
  3. If profiling root, focus on workspace config, shared utilities, and cross-package patterns

Large Project Handling (>5000 files)

  1. Warn the user about project size
  2. Suggest using --focus to narrow scope
  3. Instruct agents to use sampling: read representative files from each directory rather than exhaustive scans
  4. Cap the number of files each agent reads to 30

Phase 4: Synthesize Profile (delegated)

Hand the metadata block + all collected agent findings to @agent-subagent-gen:subagent-gen along with:

  • target depth (quick / standard / deep)
  • --focus filter
  • --output path
  • --update flag (if set)
  • the skill resource dir so the subagent can read "$SKILL_HOME"/references/profile-template.md and "$SKILL_HOME"/references/prompt-integration-guide.md

The subagent does the synthesis, quality-checks every bullet (every line must carry a file path / identifier / pattern name / concrete value), enforces word-count targets, preserves <!-- USER: ... --> blocks in update mode, writes the profile to the canonical path, and creates the .agent/local/PROJECT-KNOWLEDGE.md symlink (falling back to copy on Windows without Developer Mode).

The subagent returns:

{
  "profile_path_global": "~/.claude/knowledge/{name}.md",
  "profile_path_local": ".agent/local/PROJECT-KNOWLEDGE.md",
  "word_count": 4123,
  "depth": "standard",
  "sections_preserved_from_user": ["..."],
  "key_findings": ["..."],
  "gitignore_suggestion": ".agent/local/"
}

Phase 5: Present Summary

Use the subagent's return value to show the user:

  • Profile name and word count
  • Global path: ~/.claude/knowledge/{name}.md (accessible from any project)
  • Local path: .agent/local/PROJECT-KNOWLEDGE.md (symlinked for convenience)
  • 3-5 key findings highlights (most interesting / non-obvious)
  • If gitignore_suggestion came back, mention adding .agent/local/ to .gitignore
  • How to use the profile (read "$SKILL_HOME"/references/prompt-integration-guide.md):
    • Same project: Read .agent/local/PROJECT-KNOWLEDGE.md for context, then: <task>
    • Cross-project: Read ~/.claude/knowledge/{name}.md for context, then: <task>
    • List all profiles: /subagent-gen --list

Error Handling

SituationBehavior
Empty directory / no source filesReport and stop
Monorepo detectedAsk user which packages to focus on
Very large project (>5000 files)Warn, suggest --focus, use sampling
--update but no existing profileFall back to fresh generation
Agent exploration fails or times outReport partial results, note incomplete dimensions
Unrecognized language/frameworkProfile what can be inferred from file structure and naming
Symlink creation fails (Windows)Copy the file instead, warn about manual sync
--name conflicts with existing profileAsk user to confirm overwrite or choose a different name
~/.claude/knowledge/ doesn't existCreate it automatically

Retrospective

After completing the workflow, reflect on the entire execution session:

  1. Consider: Were there mid-session corrections? Rejected outputs? Plan changes? Errors?
  2. Ask the user: "Quick feedback on this run? (1-5 rating, note any issues, or press enter to skip)"
  3. If the user provides feedback OR if corrections/issues occurred during this session: a. Create feedback/ directory if it does not exist (header: # Feedback Log + blank line + <!-- Append new entries at the top. Do not edit previous entries. -->) b. Prepend a new entry after the header:
    ## <ISO-8601 timestamp>
    - **Skill Version**: <version from this file's frontmatter>
    - **Task**: <brief description>
    - **Outcome**: success | partial-success | failure | error
    - **Rating**: <N>/5 (or "—" if not provided)
    - **Corrections**: <mid-session corrections, or "none">
    - **Issues**: <specific problems, or "none">
    - **User Note**: <user's verbatim feedback, or "—">
    ---
    
  4. If the user skips AND no corrections or issues occurred, end without recording.

Behavior Scenarios

Scenario: Generate fresh profile for a standard project
  Given the user is in a project directory with source code and no existing profile
  When the user says "profile this project" or "generate project knowledge"
  Then the skill scans the project, launches parallel exploration agents,
  synthesizes findings into PROJECT-KNOWLEDGE.md, saves to .agent/local/,
  and shows how to use the profile in subagent prompts

Scenario: Update an existing profile after codebase changes
  Given a PROJECT-KNOWLEDGE.md already exists in .agent/local/
  When the user says "update project profile" or invokes with --update
  Then the skill reads the existing profile, focuses exploration on changed files,
  preserves user-customized sections (<!-- USER: ... -->), regenerates machine
  sections, and shows what changed

Scenario: Quick profile for a small task
  Given the user needs a lightweight profile fast
  When the user says "quick project profile" or invokes with --depth=quick
  Then the skill runs 2 combined agents, produces a ~2000-word profile,
  and completes faster than standard depth

Scenario: Profile a specific project path (not cwd)
  Given the user wants to profile a project in a different directory
  When the user says "profile project at D:\Projects\my-app"
  Then the skill uses the specified path as the project root for all exploration

Scenario: Very large monorepo project
  Given the project has over 5000 files or is a monorepo with multiple packages
  When the user invokes the skill
  Then the skill warns about size, asks which packages to focus on (if monorepo),
  uses sampling strategies to stay within token budget, and generates a profile
  scoped to the selected packages

Scenario: Use a profile from another project
  Given the user has profiled Project A and is now working in Project B
  When the user spawns a subagent with "Read ~/.claude/knowledge/project-a.md for context"
  Then the subagent has deep knowledge of Project A while working in Project B

Scenario: List all available profiles
  Given the user has generated profiles for multiple projects
  When the user says "list project profiles" or invokes with --list
  Then the skill lists all profiles in ~/.claude/knowledge/ with name, date, and source path

References

  • "$SKILL_HOME"/references/exploration-dimensions.md — Pattern catalog for each exploration dimension (what to look for, grep signals, sampling strategy, output format)
  • "$SKILL_HOME"/references/profile-template.md — Exact PROJECT-KNOWLEDGE.md template with section specs and placeholder examples
  • "$SKILL_HOME"/references/prompt-integration-guide.md — How to load the generated profile into subagent prompts (inclusion patterns, selective loading, examples)

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Run a multi-model adversarial mutual review with facilitator synthesis: 2+ panelists (different model families where possible — use codex-server / codex-cli for the external-family seat) independently answer, adversarially critique each other across rounds, and the main session acts as facilitator, synthesizing agreements, live disagreements, and calibrated confidence into one answer. Use ONLY on high-stakes, hard-to-reverse claims, designs or decisions, and only when the user EXPLICITLY asks to debate or adversarially review with multiple models — "discuss with Opus and Codex", "red-team this", "devil's advocate", 敵対的レビュー, 相互レビュー, 多モデル討論, 議論させて. A full run costs ~6 subagent/CLI dispatches: state the panel size and round count and get a go-ahead before launching. Where the Workflow tool is available, run the panel as a Workflow (judge-panel / adversarial-verify) instead of ad-hoc fan-out. Do NOT self-trigger on a bare "are you sure?" — that is a cue to OFFER the panel, not to run it.

日本語の概要は準備中です。原文の説明を表示しています。

hideki5123/agent-skill-set22026年10月21日 更新

Orchestrate multiple coding-agent sessions (Claude Code, Codex, Gemini) over the mcp_agent_mail MCP server, observe their progress on a recurring auto-loop, and prevent inconsistencies (file/edit conflicts and contradictory decisions) between concurrent tasks. Auto-manages the agent-mail server, derives the shared room key from the git repo, and runs either as the orchestrator/observer or as a participating worker. Handles the operational details (server startup, room key, reservation conventions) so the user does not have to remember them. Use when coordinating several agent sessions on different tasks at once, watching a swarm of sessions for conflicts, or wiring already-running sessions into a shared coordination room. Trigger phrases: "agent-swarm", "/agent-swarm", "orchestrate agents", "orchestrate multiple claude sessions", "coordinate sessions", "watch for conflicts between agents", "observe the swarm", "prevent inconsistency between sessions", "multi-agent observe", "複数セッションを協調", "エージェント協調", "セッション間の不整合監視", "スウォーム監視", "複数のClaudeを束ねて".

日本語の概要は準備中です。原文の説明を表示しています。

hideki5123/agent-skill-set22026年10月21日 更新

Generate AGENTS.md (cross-tool agent context — Codex CLI, Aider, Cursor, etc.) and wire CLAUDE.md as a symlink so Claude Code reads the same file. Delegates content generation to Claude's built-in /init when needed, then renames + symlinks. Idempotent. Triggers — /agents-init, "generate agents.md", "create agents.md", "share claude and codex context", "set up agents file", "init agents", "agents-init", "cross-tool agent context", "wire claude and agents".

日本語の概要は準備中です。原文の説明を表示しています。

hideki5123/agent-skill-set22026年10月21日 更新

Drive an already-running, LOGGED-IN Chromium browser on macOS via AppleScript — navigate, click, fill forms, scroll, and extract page content from the user's REAL session, with the browser left open and NO profile copy and NO restart. Use when the task needs the existing logged-in session (cookies, auth, current tabs) reused as-is. Trigger phrases: "chrome-use", "ブラウザから取得", "ログイン済みの Chromeで", "ブラウザを操作して", "このページ読んで", "Xのスレッド読んで", "ログインしたまま取得", "自分のセッションでスクレイプ", "read this page in my browser", "scrape with my session", "drive my chrome", "execute JS in my (logged-in) browser", "automate my logged-in browser". Chromium family (Chrome default; Brave/Edge/Arc/Vivaldi via --app). NOT for isolated/throwaway automation where login reuse is unneeded — use playwright-cli for that. macOS only.

日本語の概要は準備中です。原文の説明を表示しています。

hideki5123/agent-skill-set22026年10月21日 更新

codex-cli

無料

Run OpenAI Codex CLI from the terminal for batch / one-shot `codex exec` invocations with output captured to an `-o` file. Use for fire-and-forget runs, scripted CI, code review batches (`codex review`), and resuming a specific session by id (`codex exec resume`). Always use this skill instead of `mcp__codex__codex` and `mcp__codex__codex-reply` MCP tools — CLI is faster and more capable. For streaming UX, multi-turn dialogues that need live state, structured (JSON schema) output, attaching images, or programmatic event handling → **use codex-server instead**. codex-server uses the user's ChatGPT subscription via Codex App Server and decoupled async invocation that bypasses the Bash 2-minute timeout entirely. Trigger patterns (batch-only — chat/streaming triggers belong to codex-server): codex-cli / codex CLI / codex exec / codex review / codex resume / codex fork / batch + {codex, gpt} / one-shot + {codex, gpt} / non-interactive + codex / codex {to a file, -o, output file, captured output} / CI + {codex, gpt} / scripted + {codex, gpt} / fork codex session / resume codex session by id

日本語の概要は準備中です。原文の説明を表示しています。

hideki5123/agent-skill-set22026年10月21日 更新

Run OpenAI Codex via the Codex App Server (JSON-RPC-over-stdio) for streaming multi-turn chat sessions with persistent threads, structured output, image input, and rich event streams. Default entry point for ChatGPT/GPT/Codex-like conversations from the terminal. Uses the user's ChatGPT subscription (Plus / Pro / Team) exclusively via `codex login` — never consumes OPENAI_API_KEY billing, by design. Implementation: TypeScript on deno with npm:@openai/codex-sdk; spawns the existing system codex binary. Decoupled async invocation: every turn returns turn-id in <1 s; the actual SDK work runs in a detached worker that streams to per-turn files under ~/.codex-server/turns/<turn-id>/ — Bash's 2-min timeout never applies. Prefer this over codex-cli for streaming UX, multi-turn dialogues that need live state, structured (JSON schema) output, attaching images, or programmatic event handling. Use codex-cli only for one-shot batch invocations that pre-capture to an -o file. For OpenAI Platform API calls specifically (embeddings, image generation, audio, moderation, batches, files) — not open-ended chat — use openai-cli instead; that path bills OPENAI_API_KEY, this one uses the ChatGPT subscription. Trigger patterns (match any variation): codex / codex-server / codex app server / codex app-server / openai / open ai / OpenAI / chatgpt / chat gpt / ChatGPT / GPT / ask gpt / chat with gpt / gpt session / codex session / streaming chat / multi-turn chat / multi turn chat / second opinion / cross-check / cross check / ai pair programming / another AI / external AI / ask another model / get GPT's take / what does openai think / show me what gpt thinks / structured output from gpt / json schema gpt / resume codex thread / continue codex conversation / continue codex session / /codex-server

日本語の概要は準備中です。原文の説明を表示しています。

hideki5123/agent-skill-set22026年10月21日 更新

hideki5123 のスキルをすべて見る

このスキルの問題を報告する