ワンクリックで
learn-project
Scan project code to detect patterns, dependencies, and conventions. Propose domain rules based on what the code actually does.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Scan project code to detect patterns, dependencies, and conventions. Propose domain rules based on what the code actually does.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Audits the Claude Code configuration of a project against the dotforge template. Generates a report with score and gaps.
Sync all GitHub-backed git repos on this machine with origin. Pulls behind repos, pushes ahead repos, reports dirty/non-main/conflict cases for Claude to resolve.
Generate a Claude Code plugin package from the current project's dotforge configuration, ready for marketplace submission.
Fetch official Anthropic/Claude Code docs, detect changes relevant to dotforge, report deltas.
Process the practices inbox, evaluate, incorporate into dotforge, and suggest propagation to projects.
Restore a project's .claude/ directory to the dotforge template from scratch, with backup and rollback option.
| name | learn-project |
| description | Scan project code to detect patterns, dependencies, and conventions. Propose domain rules based on what the code actually does. |
| context | fork |
Scan the current project's source code to detect patterns, classify tooling, and propose domain rules. Unlike /forge domain extract (which reads dotforge's internal memory), this skill reads the CODE directly.
Read whichever exist (skip missing):
package.json — extract dependencies + devDependencies keyspyproject.toml — extract [project.dependencies] and [tool.*] sectionsrequirements.txt — read all linesgo.mod — extract require blockPodfile — read all linesGemfile — read all linespom.xml / build.gradle / build.gradle.kts — extract dependency declarationsCollect a flat list of dependency names.
Find the top 20 most-imported libraries across the codebase:
# Python
grep -rh "^import \|^from " --include="*.py" . 2>/dev/null | sed 's/import //;s/from //;s/ .*//' | sort | uniq -c | sort -rn | head -20
# TypeScript/JavaScript
grep -rh "from ['\"]" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" . 2>/dev/null | sed "s/.*from ['\"]//;s/['\"].*//" | grep -v '^\.' | sort | uniq -c | sort -rn | head -20
# Go
grep -rh "\"" --include="*.go" . 2>/dev/null | grep -E '^\s+"' | sed 's/.*"//;s/".*//' | sort | uniq -c | sort -rn | head -20
# Swift
grep -rh "^import " --include="*.swift" . 2>/dev/null | sed 's/import //' | sort | uniq -c | sort -rn | head -20
# Directory structure (2 levels deep, ignore hidden/vendor)
find . -maxdepth 2 -type d ! -path '*/\.*' ! -path '*/node_modules*' ! -path '*/.venv*' ! -path '*/vendor*' ! -path '*/__pycache__*' | sort
# Config files present
ls -1 .eslintrc* .prettierrc* ruff.toml pyproject.toml tsconfig.json biome.json jest.config* vitest.config* vite.config* webpack.config* Makefile Dockerfile docker-compose* .env.example 2>/dev/null
From Steps 1-3, classify into categories. Only report categories with HIGH CONFIDENCE (direct evidence in code):
ORM/Database:
Auth:
Test framework:
Build system:
API framework:
State management:
Deployment:
ssh /scp /rsync targeting a host — see Step 4b)Extract remote-host deployment info from shell scripts, Makefiles, and CI:
# Find ssh/scp/rsync invocations in project scripts and CI
grep -rEn "(^|[^a-z])(ssh|scp|rsync) [^|&;]*(@|--[a-z-]+=)" \
--include="*.sh" --include="Makefile" --include="*.mk" \
--include="*.yml" --include="*.yaml" --include="*.toml" \
. 2>/dev/null | head -30
# Also check ~/.ssh/config for host aliases that might match the project
test -f ~/.ssh/config && awk '/^Host /{h=$2} /HostName/{print h" -> "$2}' ~/.ssh/config 2>/dev/null
From the matches, extract:
~/.ssh/config or raw user@host)@)~/.ssh/config or -i flag in the command): in scp/rsync, or inside quoted remote command)ssh host '...' runs — deploy, restart, health check, log tail)If any match found, this project needs the vps-ssh stack. Flag it in the proposal and generate .claude/rules/domain/infra.md with the extracted fields. NEVER paste private key content into the rule — only reference the IdentityFile path.
Naming conventions:
# Function naming: snake_case vs camelCase
grep -rh "def [a-z]" --include="*.py" . 2>/dev/null | head -5 # snake_case
grep -rh "function [a-z]" --include="*.ts" --include="*.js" . 2>/dev/null | head -5 # camelCase
Show detected patterns grouped by category. For each, propose a domain rule:
═══ /forge learn — [project-name] ═══
Detected patterns (high confidence only):
1. ORM: SQLAlchemy 2.x (async sessions detected in 8 files)
Proposed rule: .claude/rules/domain/orm-patterns.md
Content: async session lifecycle, model conventions, migration patterns
→ Create? [approve/skip/edit]
2. Auth: Supabase Auth (auth-helpers in 4 files)
Proposed rule: .claude/rules/domain/auth-flow.md
Content: session management, RLS policies, token refresh
→ Create? [approve/skip/edit]
3. Testing: vitest (vitest.config.ts found, 23 test files)
Proposed rule: .claude/rules/domain/testing.md
Content: test patterns, mock conventions, coverage targets
→ Create? [approve/skip/edit]
4. Naming: snake_case (Python), camelCase (TypeScript)
Proposed rule: .claude/rules/domain/naming.md
Content: per-language conventions detected
→ Create? [approve/skip/edit]
Wait for user approval on each before creating files.
For each approved proposal, create a rule file in .claude/rules/domain/:
---
globs: "<relevant file patterns>"
description: "<what this rule covers>"
domain: "<project-name>"
last_verified: "<today YYYY-MM-DD>"
source: "/forge learn"
---
# <Title>
<Factual observations from the scan — imperative mood, concise>
Rules must be:
═══ Learn complete ═══
Scanned: <N> dependency files, <N> imports, <N> config files
Detected: <N> patterns across <N> categories
Created: <N> domain rules in .claude/rules/domain/
Skipped: <N> proposals
Tip: run /forge domain extract to capture session-learned knowledge too.
/forge domain extract for that)