一键导入
setup
Use when onboarding to a project or creating/updating CLAUDE.md - covers codebase analysis, documentation generation, and policy management
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when onboarding to a project or creating/updating CLAUDE.md - covers codebase analysis, documentation generation, and policy management
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Multi-agent consensus code review with adaptive budgets, complexity-aware agent selection, multiple consensus protocols (Approval/Veto, AAD, CI, Supermajority), cross-agent coverage tracking, context-folding isolation, and progressive summarization. Use when reviewing PRs, directories, or code changes.
Use when creating new repositories, reviewing existing repos for compliance, or enforcing repository naming, structure, documentation, and security standards. Applies to all fyrsmithlabs projects.
Use when releasing a new version of a fyrsmithlabs plugin. Automates version bumping across all manifests (plugin.json, marketplace.json, CLAUDE.md), validates counts match disk, runs plugin-validator, creates git tag and GitHub release. Say "release the plugin", "bump version", "create a release".
This skill should be used when the user asks to "test opa", "opa test", "test rego", "write rego tests", "policy coverage", "conftest verify", "mock opa", or mentions `_test.rego` files. Provides OPA testing framework guidance including unit tests, mocking, coverage, and Conftest patterns.
This skill should be used when the user asks about "opa cli", "opa eval", "opa build", "opa check", "opa fmt", "regal lint", "opa bundle", "opa bench", "opa run", or mentions OPA tooling, CI/CD pipeline integration for OPA, or Rego linting. Provides OPA CLI and ecosystem tooling reference.
This skill should be used when the user asks about "kubernetes policy", "gatekeeper", "constraint template", "terraform policy", "conftest", "terraform compliance", "docker policy", "dockerfile policy", "envoy authz", "envoy authorization", "service mesh policy", "cloud policy", "aws policy rego", "azure policy rego", "gcp policy rego", or mentions writing OPA policies for a specific platform. Provides platform-specific Rego patterns and input schemas.
| name | setup |
| description | Use when onboarding to a project or creating/updating CLAUDE.md - covers codebase analysis, documentation generation, and policy management |
1. Repository structure scan (Glob)
2. Package/dependency analysis (package.json, go.mod, requirements.txt)
3. Configuration files (tsconfig, .eslintrc, Makefile)
4. Existing documentation (README, docs/, CONTRIBUTING)
5. CI/CD configuration (.github/workflows)
| Target | Search Strategy |
|---|---|
| Entry points | main., index., cmd/, src/ |
| Architecture | Directory structure, imports |
| Testing | _test., .spec., jest.config |
| Build commands | Makefile, package.json scripts |
Generate with this structure:
```markdown
Status: Active Development | Maintenance | Legacy Last Updated: YYYY-MM-DD
ALWAYS [most important constraints] NEVER [dangerous actions to avoid]
``` src/ ├── components/ # [purpose] ├── lib/ # [purpose] └── utils/ # [purpose] ```
| Component | Technology | Version |
|---|---|---|
| Runtime | Node.js | 20.x |
| Command | Purpose |
|---|---|
| `npm run dev` | Start development server |
| `npm run test` | Run unit tests |
| Pitfall | Prevention |
|---|---|
| [Issue 1] | [How to avoid] |
| ``` |
ALWAYS:
NEVER:
| Location | Purpose | Scope |
|---|---|---|
| `~/.claude/CLAUDE.md` | User preferences | All projects |
| `./CLAUDE.md` | Project rules | Team (Git) |
| Parent directories | Monorepo root | Inherited |
| Subdirectories | Module overrides | On demand |
All locations load automatically. Most specific wins.
For large projects, split documentation:
```markdown
@docs/architecture.md @docs/api-conventions.md @docs/testing-strategy.md ```
Keep main CLAUDE.md clean. Only core rules inline.
Policies are STRICT constraints that MUST be followed:
```json { "project_id": "global", "title": "POLICY: test-before-fix", "content": "RULE: Always run tests before claiming a fix is complete.\nCATEGORY: verification\nSEVERITY: high", "outcome": "success", "tags": ["type:policy", "category:verification", "severity:high"] } ```
Categories: verification, process, security, quality, communication
Severity: critical, high, medium
```
repository_index(path: ".")
memory_record( project_id: "", title: "Project onboarded with CLAUDE.md", content: "Created CLAUDE.md with architecture, commands, pitfalls...", outcome: "success", tags: ["onboarding", "claude-md"] ) ```
| Mistake | Prevention |
|---|---|
| Asking user "what framework?" | Check package.json, go.mod first |
| Generic architecture description | Run actual discovery commands |
| Missing version numbers | Extract from lockfiles |
| No examples for key patterns | Always show code patterns |
| Too long CLAUDE.md (>500 lines) | Modularize with @imports |
| Step | Action |
|---|---|
| 1 | Scan repo structure |
| 2 | Read package/config files |
| 3 | Extract patterns |
| 4 | Generate CLAUDE.md |
| 5 | Verify commands work |
| 6 | Index repository |
Setup auto-detects and records tech stack metadata:
| File | Detected Stack | Patterns Applied |
|---|---|---|
| `package.json` | Node.js, npm/yarn/pnpm | JS/TS conventions |
| `go.mod` | Go | Go idioms, error handling |
| `Cargo.toml` | Rust | Ownership patterns |
| `pyproject.toml` | Python (modern) | Type hints, async |
| `requirements.txt` | Python (legacy) | Virtual env patterns |
| `Gemfile` | Ruby | Rails conventions if present |
| `pom.xml` | Java/Maven | Spring patterns if present |
| `build.gradle` | Java/Kotlin/Gradle | Android if detected |
Setup creates foundation memories per stack:
```json { "project_id": "contextd", "title": "STACK: Go 1.22 with embedded vectorstore", "content": "Tech: Go 1.22\nDeps: chromem-go, chi router\nPatterns: Registry DI, table-driven tests\nLinting: golangci-lint", "tags": ["type:pattern", "stack:go", "auto-generated"] } ```
| Config File | Database | Applied Patterns |
|---|---|---|
| `.env` with `DATABASE_URL` | PostgreSQL/MySQL | Migration patterns, connection pooling |
| `prisma/schema.prisma` | Prisma ORM | Type-safe queries, migrations |
| `drizzle.config.ts` | Drizzle ORM | Schema-first, migrations |
| `ent/schema/` | Ent (Go) | Code generation, edges |
| `sqlc.yaml` | sqlc (Go) | Generated queries |
Policies are STRICT constraints with enforcement metadata:
```json { "project_id": "global", "title": "POLICY: test-before-fix", "content": "RULE: Always run tests before claiming a fix is complete.", "outcome": "success", "tags": ["type:policy", "category:verification", "severity:high"], "enforcement": { "mode": "strict", "check_hook": "PreToolUse", "check_tool": "Bash", "violation_action": "block" } } ```
| Mode | Behavior | Use Case |
|---|---|---|
| `strict` | Block violating actions | Security, data integrity |
| `warning` | Allow with prominent warning | Best practices |
| `audit` | Log only, no interruption | Monitoring, gradual rollout |
| Category | Examples |
|---|---|
| `verification` | Test before commit, review before merge |
| `process` | TDD, checkpoint before clear |
| `security` | No secrets in code, input validation |
| `quality` | Linting, type safety, documentation |
| `communication` | Commit message format, PR templates |
Setup generates checksums to detect drift:
```json { "setup_checksum": { "claude_md_hash": "sha256:abc123...", "stack_snapshot": "sha256:def456...", "policy_version": "v1.2.0", "generated_at": "2026-01-28T10:00:00Z" } } ```
On session start, compare checksums:
```
| Command | Purpose |
|---|---|
| `/init --verify` | Check for drift without changes |
| `/init --update` | Re-run setup, update checksums |
| `/init --force` | Full re-setup, overwrite |
``` ///
Examples: fyrsmithlabs/platform/contextd/api fyrsmithlabs/platform/contextd/vectorstore fyrsmithlabs/marketplace/fs-dev/skills ```
IMPORTANT: `tenant_id` and `project_id` must be lowercase alphanumeric with underscores:
When deriving IDs from git remotes:
Setup auto-detects namespace from:
```markdown
@namespace fyrsmithlabs/platform
@namespace ../api # Resolves to fyrsmithlabs/platform/api ```
Setup records create audit metadata:
| Field | Description | Auto-set |
|---|---|---|
| `created_by` | Session/agent that ran setup | Yes |
| `created_at` | ISO timestamp | Yes |
| `setup_version` | Setup skill version | Yes |
| `usage_count` | Times CLAUDE.md loaded | Yes |
Use background tasks for large repos:
``` Task( subagent_type: "general-purpose", prompt: "Index all source files in /path/to/repo", run_in_background: true, description: "Repository indexing" )
// Continue with other setup tasks... TaskOutput(task_id, block: false) // Check progress ```
Chain setup phases:
``` phase1 = Task(prompt: "Scan repository structure") phase2 = Task(prompt: "Detect tech stack", addBlockedBy: [phase1.id]) phase3 = Task(prompt: "Generate CLAUDE.md", addBlockedBy: [phase2.id]) phase4 = Task(prompt: "Index repository", addBlockedBy: [phase3.id]) ```
Auto-verify setup before operations:
```json { "hook_type": "PreToolUse", "tool_name": "Read", "condition": "file_path.endsWith('CLAUDE.md')", "prompt": "Check setup checksum for drift before reading CLAUDE.md." } ```
Setup emits events for other skills:
```json { "event": "setup_complete", "payload": { "project_id": "fyrsmithlabs/contextd", "stack": "go", "policies_loaded": 5, "checksum": "sha256:..." }, "notify": ["workflow", "consensus-review"] } ```
Subscribe to setup events: