Token导航 LogoToken导航TokenDH.com
开发external-servicegithub未标认证来源可访问许可证需确认审计提醒

style-anchors-collection风格锚集合

Agent Skill

style-anchors-collection 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

214

周安装

9

GitHub Stars

公开资料未说明

下载量

75
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:style-anchors-collection(风格锚集合)
来源仓库:https://github.com/validkeys/sherpy
仓库路径:skills/style-anchors-collection
安装命令:
npx skills add https://github.com/validkeys/sherpy --skill style-anchors-collection
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/validkeys/sherpy --skill style-anchors-collection

简介

style-anchors-collection 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理时使用。
  • 通过 npx skills add 命令从指定仓库安装,具体用法需结合 README 进一步确认。
  • 安装前建议确认权限范围、维护状态及是否涉及联网、命令执行或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Style Anchors Collection

Systematically identifies, documents, and organizes code examples that demonstrate approved patterns from technical requirements. Creates a structured library of style anchors used throughout implementation.

Prerequisites

  • Completed technical-requirements.yaml
  • Optional: Access to existing codebase or reference repositories

Purpose

Style anchors are concrete code examples that serve as templates for implementation. They prevent drift by:

  • Establishing approved patterns before coding begins
  • Providing specific file:line references instead of abstract descriptions
  • Documenting when and how to use each pattern
  • Creating a reusable pattern library for the project

Collection Process

Step 0: Determine Output Directory

If no directory was provided as a parameter, prompt the user:

"Where should I create the style anchors? (This should be the same base directory as your requirements documents)"

Wait for user response. Store the provided path as base_directory.

Step 1: Load Technical Context

  1. Load {base_directory}/requirements/technical-requirements.yaml
  2. Parse for key architecture patterns:

- Architecture pattern (monolithic, microservices, etc.) - Technology stack (language, frameworks, libraries) - Testing strategy (TDD, frameworks) - Data model approach (database, schema patterns) - API patterns (REST, GraphQL, etc.) - Security patterns (auth, validation)

  1. Identify pattern categories to collect anchors for (typical categories):

- Services - Service layer patterns with dependency injection - Testing - Test structure, mocking, TDD patterns - Validation - Input/output validation, schema validation - API - Endpoint handlers, middleware, routing - Data Access - Database queries, ORM patterns, migrations - Error Handling - Error types, error propagation, recovery

Step 2: Present Collection Plan

Display identified categories to the user:

## Style Anchors Collection

Based on your technical requirements, I'll collect code examples for these pattern categories:

1. Services (Effect.Service pattern with dependency injection)
2. Testing (Effect service testing with @effect/vitest)
3. Validation (Schema.Class validation patterns)
4. Error Handling (Tagged errors with Effect)

For each category, I'll ask you to provide:
- File path to exemplar code
- Line range (e.g., 10-50)
- What the pattern demonstrates
- When to use it

You can provide examples from:
- Your current codebase
- A reference repository (will link to it)
- Suggest "none" to skip a category

Ask: "Ready to begin collection?"

Wait for confirmation.

Step 3: Interactive Collection

For each category identified:

3.1. Ask for source file:

## Category: [Category Name]

What file demonstrates your preferred [pattern description]?

Options:
1. Provide file path from current project (e.g., src/services/UserService.ts)
2. Provide URL to reference repository file
3. Type "none" to skip this category
4. Type "help" for guidance on what makes a good style anchor

Your answer:

3.2. Ask for line range:

What line range should I reference?

Format: Start-End (e.g., 10-50)
Or: Single line number (e.g., 25)
Or: "all" for entire file

Your answer:

3.3. If file is accessible, read and display:

## Code Preview

[Display the code from specified lines]

Does this look correct? (yes/no/adjust)

If "adjust", loop back to line range question.

3.4. Ask what pattern demonstrates:

What does this code example demonstrate?

Examples:
- "Service pattern with Effect.Service and dependency injection"
- "TDD test structure using it.effect from @effect/vitest"
- "Schema validation with proper error handling"

Your answer:

3.5. Ask when to use:

When should developers use this pattern?

Examples:
- "When creating any service class in the service layer"
- "When testing Effect-based services"
- "When validating external input data"

Your answer:

3.6. Generate anchor ID:

Create anchor ID from pattern name (kebab-case, e.g., service-pattern, test-effect-services)

3.7. Confirm and continue:

✓ Collected anchor: [anchor-name]

Continue to next category? (yes/no/review)

Step 4: Generate Outputs

4.1. Create directory structure:

mkdir -p {base_directory}/artifacts/style-anchors

4.2. Generate index.yaml:

Create {base_directory}/artifacts/style-anchors/index.yaml with:

  • Version and metadata
  • Categories with collected anchors
  • Anchor definitions with source references
  • Usage matrix mapping patterns to task types
  • Total count and collection date

4.3. Generate individual.md files:

For each collected anchor, create {base_directory}/artifacts/style-anchors/[anchor-id].md with:

  • YAML frontmatter (id, name, category, tags, created date)
  • Overview section
  • Source reference
  • Code example (from file if accessible)
  • What it demonstrates
  • When to use
  • Pattern requirements (derived from best practices)
  • Common mistakes to avoid (derived from best practices)
  • Related anchors (cross-references)

4.4. Populate pattern requirements and mistakes:

Use knowledge from implementation-plan-best-practices to add:

  • ✓ Pattern Requirements: 3-7 must-do items specific to the pattern
  • ❌ Common Mistakes: 3-7 anti-patterns to avoid

Step 5: Summary

Display collection summary:

## Style Anchors Collection Complete ✓

**Directory:** {base_directory}/artifacts/style-anchors/

**Collected Anchors:** [count]

📁 Categories:
  - Services: [n] anchors
  - Testing: [n] anchors
  - Validation: [n] anchors
  - Error Handling: [n] anchors

📄 Generated Files:
  ✓ index.yaml (master index with usage matrix)
  ✓ [anchor-1].md
  ✓ [anchor-2].md
  ✓ [anchor-3].md

These anchors will be automatically referenced by implementation-planner
when generating task instructions.

Next Step: Run /implementation-planner to generate milestones and tasks

Output Formats

index.yaml Structure

The master index file includes: version, project, generated, technical_requirements_ref, categories (each with id, name, description, anchors list), anchors (each with id, name, file, category, source reference, applies_to rules, tags), usage_matrix (mapping architecture patterns and task types to recommended anchors), and meta (counts and dates).

Individual Anchor.md Structure

Each anchor file includes: YAML frontmatter (id, name, category, tags, created), and sections for Overview, Source Reference, Code Example, What This Demonstrates, When to Use, Pattern Requirements, Common Mistakes to Avoid, Related Anchors, and Test Coverage.

See references/output-spec.md for the complete specification of both index.yaml and individual anchor files, including all fields, formatting rules, and usage matrix structure.

See references/example.md for a full example anchor document.

Pattern Requirements and Mistakes Generation

For Service Patterns:

Requirements:

  • ✓ All service methods MUST return Effect types
  • ✓ Use Effect.gen for async operations
  • ✓ Fail with tagged errors, not throw
  • ✓ Validate inputs with Schema.decode before processing
  • ✓ Declare all dependencies in dependencies array

Mistakes:

  • ❌ Using async/await instead of Effect.gen
  • ❌ Throwing errors instead of Effect.fail
  • ❌ Direct database access without dependency injection
  • ❌ Skipping input validation
  • ❌ Using any or type assertions on external data

For Test Patterns:

Requirements:

  • ✓ Use it.effect from @effect/vitest for Effect tests
  • ✓ Provide all service dependencies in test setup
  • ✓ Test both success and failure cases
  • ✓ Use descriptive test names that explain behavior
  • ✓ Follow TDD: write test first, then implementation

Mistakes:

  • ❌ Using regular it() for Effect-based code
  • ❌ Not providing required service dependencies
  • ❌ Testing only happy path, ignoring errors
  • ❌ Vague test names like "test 1" or "it works"
  • ❌ Modifying tests to pass broken implementation

For Validation Patterns:

Requirements:

  • ✓ Use Schema.Class for all data validation
  • ✓ Validate at system boundaries (user input, external APIs)
  • ✓ Return validation errors, don't throw
  • ✓ Include helpful error messages
  • ✓ Never use type assertions on external data

Mistakes:

  • ❌ Using type assertions instead of validation
  • ❌ Throwing generic errors instead of validation errors
  • ❌ Validating internal function arguments (trust internal code)
  • ❌ Skipping validation on external input
  • ❌ Using any type for external data

For Error Handling Patterns:

Requirements:

  • ✓ Use tagged errors (Effect.fail with custom error class)
  • ✓ Include context in error objects (IDs, values)
  • ✓ Propagate errors with Effect, don't catch and hide
  • ✓ Define error types near where they're used
  • ✓ Document expected errors in function signatures

Mistakes:

  • ❌ Throwing errors instead of Effect.fail
  • ❌ Using string error messages instead of typed errors
  • ❌ Catching errors and ignoring them
  • ❌ Generic error messages without context
  • ❌ Not documenting what errors a function can produce

Usage Matrix Generation

Map technical requirements to anchor recommendations:

From architecture.pattern:

  • effect-based-services → service-pattern, test-pattern, error-handling
  • schema-validation → validation-schema, api-validation
  • rest-api → api-pattern, validation-schema, error-handling

By task type:

  • code → primary pattern for layer + validation + error-handling
  • test → test-pattern + pattern being tested
  • api → api-pattern + validation-schema + error-handling
  • docs → (no anchors typically needed)
  • config → (no anchors typically needed)

Best Practices

What Makes a Good Style Anchor

  1. Concrete - Real file paths, not abstract descriptions
  2. Specific - Line numbers for precision (20-50 lines ideal)
  3. Complete - Shows full pattern, not just snippet
  4. Current - Reflects current best practices
  5. Exemplary - Demonstrates pattern correctly

Red Flags (When Collecting)

  • Code example has TODOs or FIXMEs
  • File uses deprecated patterns
  • Code doesn't compile/run
  • Example is too trivial (< 10 lines)
  • Example is too complex (> 100 lines)
  • No tests exist for the pattern

Edge Cases

No Existing Codebase

If user has no current codebase:

I notice you don't have an existing codebase. Would you like to:

1. Skip style anchor collection for now (can add later)
2. Reference external examples (Effect documentation, framework examples)
3. Create minimal example files as anchors

Which approach works best for your project?

User Skips All Categories

No style anchors collected. This means:

⚠️  Implementation-planner will generate tasks WITHOUT concrete examples
⚠️  Risk of architectural drift increases
⚠️  Developers will need to infer patterns from requirements

Recommendation: Collect at least 1-2 anchors for critical patterns
(e.g., service pattern, test pattern)

Continue without anchors? (yes/no)

File Not Accessible

If user provides file path that can't be read:

I can't access [file-path]. Would you like to:

1. Provide a different file path
2. Paste the code directly (I'll store it in the anchor)
3. Provide a URL to the file
4. Skip this anchor

Your choice:

Integration with Implementation Planner

When implementation-planner runs:

  1. Load style anchors: Read {base_directory}/artifacts/style-anchors/index.yaml
  2. For each task generated:

- Determine task type and file patterns - Query usage_matrix for recommended anchors - Filter anchors by applies_to rules - Include top 2-3 relevant anchors in task instructions

  1. Task instruction template: ` instructions: | ## Style Anchors Follow these patterns: - [anchor-id] ([file]) - [what it demonstrates] - [anchor-id] ([file]) - [what it demonstrates] See artifacts/style-anchors/[anchor-id].md for detailed examples. ## [rest of task instructions] `

Validation

After generation, validate:

  • index.yaml is valid YAML
  • All anchor IDs are unique
  • All category references resolve
  • All.md files exist for anchors in index
  • All.md frontmatter matches index.yaml
  • Source line ranges are valid format
  • Usage matrix references valid anchors
  • At least 1 anchor per category

Usage

To collect style anchors:

/style-anchors-collection [base-directory]

If no directory is provided, auto-detect by looking for requirements/technical-requirements.yaml in the current directory.

If not found, prompt the user: "Where are your requirements documents located?"

Wait for the user to provide a path before proceeding. Store as base_directory.

The skill will:

  1. Load technical requirements from {base_directory}/requirements/technical-requirements.yaml
  2. Identify pattern categories to collect
  3. Interactively collect anchors for each category
  4. Generate index.yaml in {base_directory}/artifacts/style-anchors/
  5. Generate individual .md files for each anchor
  6. Display collection summary

Examples

See references/example.md for a sample anchor document.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.66%
按下载量换算27

Claude

30.84%
按下载量换算23

Cursor

17.07%
按下载量换算13

Gemini CLI

9.64%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills