create-feature-flags

为 PHP 项目生成功能标志实现。包括创建标志服务、配置管理、按百分比发布、基于用户的定向以及与部署管道的集成方案。

仓库最近推送
GitHub Stars
109
Forks
26
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "create-feature-flags":https://skillpi.com/zh/skills/deepskill-4d0aa4cef9d4d752a9dc32f0ba8ee923daed754ff9cddd8ce268fb2c9bd2bb55。安装前核对上游来源和版本:https://github.com/dykyi-roman/awesome-claude-code。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

为 PHP 项目生成功能标志实现。包括创建标志服务、配置管理、按百分比发布、基于用户的定向以及与部署管道的集成方案。

0 下载

介绍来源: third_party · dykyi-roman · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: create-feature-flags
description: Generates feature flag implementations for PHP projects. Creates flag services, configuration, percentage rollouts, user targeting, and integration with deployment pipelines.

Feature Flag Generator

Generates feature flag implementation for progressive deployments.

Feature Flag Service Interface

<?php
// src/Infrastructure/FeatureFlag/FeatureFlagServiceInterface.php

declare(strict_types=1);

namespace App\Infrastructure\FeatureFlag;

interface FeatureFlagServiceInterface
{
    /**
     * Check if a feature is enabled globally.
     */
    public function isEnabled(string $feature): bool;

    /**
     * Check if a feature is enabled for a specific user.
     */
    public function isEnabledForUser(string $feature, string $userId): bool;

    /**
     * Check if a feature is enabled based on percentage rollout.
     */
    public function isEnabledForPercentage(string $feature, string $identifier): bool;

    /**
     * Get the variant for A/B testing.
     */
    public function getVariant(string $feature, string $userId): string;

    /**
     * Get all enabled features for a user.
     */
    public function getEnabledFeatures(string $userId): array;
}

Feature Configuration DTO

<?php
// src/Infrastructure/FeatureFlag/FeatureConfig.php

declare(strict_types=1);

namespace App\Infrastructure\FeatureFlag;

final readonly class FeatureConfig
{
    /**
     * @param string[] $allowedUsers
     * @param string[] $blockedUsers
     * @param string[] $variants
     * @param array<string, mixed> $metadata
     */
    public function __construct(
        public string $name,
        public bool $enabled = false,
        public ?int $percentage = null,
        public array $allowedUsers = [],
        public array $blockedUsers = [],
        public array $variants = [],
        public array $metadata = [],
    ) {}

    /**
     * @param array<string, mixed> $data
     */
    public static function fromArray(array $data): self
    {
        return new self(
            name: $data['name'],
            enabled: $data['enabled'] ?? false,
            percentage: $data['percentage'] ?? null,
            allowedUsers: $data['allowed_users'] ?? [],
            blockedUsers: $data['blocked_users'] ?? [],
            variants: $data['variants'] ?? [],
            metadata: $data['metadata'] ?? [],
        );
    }
}

See references/templates.md for: InMemory implementation, YAML configuration, Config Loader, Attribute, Middleware, Twig Extension, Template usage, CI/CD integration, Redis implementation.

Generation Instructions

  1. Choose storage backend:

    • In-memory (config file)
    • Redis (dynamic updates)
    • Database (audit trail)
    • External service (LaunchDarkly, etc.)
  2. Define flag types:

    • Boolean (on/off)
    • Percentage rollout
    • User targeting
    • A/B variants
  3. Integrate with framework:

    • Middleware for request context
    • Twig extension for templates
    • Service for business logic
  4. Set up CI/CD integration:

    • Environment-based defaults
    • Dynamic update endpoints
    • Rollback capabilities

Usage

Provide:

  • Storage backend preference
  • Framework (Symfony, Laravel, etc.)
  • Flag types needed
  • CI/CD platform

The generator will:

  1. Create interface and implementation
  2. Add configuration loader
  3. Integrate with framework
  4. Set up CI/CD hooks

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

  • 提供 PHP 项目功能标志的完整实现方案,包括服务接口、配置、百分比发布、用户定向和 CI/CD 集成
  • 适用于多种存储后端和框架,具有广泛受众的实用能力
触发精准95/100

亮点

  • description 明确描述了 Skill 的功能和用途,触发词精准完整,覆盖多种变体,边界清晰
结构规范75/100

待提升项

  • 缺少 When to Use/示例章节 原报告严重程度:轻微

    Skill 结构清晰,但缺少 When to Use 和端到端示例

    改进建议:建议添加 When to Use 章节和端到端示例,以帮助用户更好地理解和使用 Skill

亮点

  • Skill 结构清晰,包含接口、配置、生成说明和用法
  • frontmatter 完整,单文件未超过 500 行
执行可靠70/100

待提升项

  • 工具来源和参数未明确说明 原报告严重程度:轻微

    Skill 提供了详细的实现方案和集成说明,但未明确说明工具来源和参数

    改进建议:建议明确说明工具来源和参数,以提高执行可靠性

亮点

  • 提供了详细的实现方案和集成说明
  • 覆盖了多种存储后端和框架的集成
证据可验 (前四项均值)81/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。