workflow-feature-flag — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited workflow-feature-flag (Agent Skill) and scored it 45/100 (orange). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 1 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
A base64 string of 128+ characters appears in a documentation file. Encoded prompt injection hides the hostile instruction in base64 — invisible to keyword filters — and relies on the agent's ability to decode it at runtime. There is no normal authoring reason to embed a multi-hundred-byte base64 blob in skill docs.
*.sig, SIGNATURES) outside the documentation.Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Shipping code and switching it on are two separate acts. A feature flag lets you deploy on your schedule, enable for specific users or a percentage of traffic, and kill it instantly if anything goes wrong — without a rollback deploy. This skill gives that discipline to any feature.
package.json → launchdarkly-node-server-sdk, @launchdarkly/js-client-sdk,
flagsmith, growthbook, unleash-client, posthog-js
.env.* → LD_SDK_KEY, FLAGSMITH_ENV_KEY, GROWTHBOOK_API_HOST,
POSTHOG_KEY (reference by name only)
src/lib/flags.* → custom feature-flag utility
src/config/flags.* → env-var-based flags| Detected platform | Approach |
|---|---|
| LaunchDarkly | Use LD SDK client; flags managed in LD dashboard |
| PostHog | Use PostHog feature flags API; tied to analytics context |
| GrowthBook | Open-source, self-hosted or cloud; SDK + feature API |
| Flagsmith | Open-source or cloud; REST API + SDK |
| None / custom | Simple env-var or database-backed flag (implement below) |
Before writing any code, define the flag contract:
Flag name: [kebab-case, descriptive, present-tense: "new-checkout-flow"]
Description: [What this flag controls — plain English]
Type: Boolean / String variant / JSON payload
Targeting: [Who sees it first: internal users? 5% of traffic? specific org IDs?]
Rollout plan: 0% → internal only → 5% → 25% → 100%
Kill-switch: If Sentry error rate on [metric] exceeds [threshold], roll back to 0%
Cleanup date: [When to remove the flag — typically 2 weeks after 100% stable]Naming rules:
kebab-case, present-tense action: new-checkout-flow, not checkoutV2 or feature123billing-usage-dashboard, auth-passkey-loginbeta, v2, new-feature — they become permanent accidents// src/lib/flags.ts
export const FLAGS = {
newCheckoutFlow: process.env.NEXT_PUBLIC_FLAG_NEW_CHECKOUT_FLOW === 'true',
billingUsageDashboard: process.env.NEXT_PUBLIC_FLAG_BILLING_USAGE_DASHBOARD === 'true',
} as const;
export type FeatureFlag = keyof typeof FLAGS;Usage:
import { FLAGS } from '@/lib/flags';
if (FLAGS.newCheckoutFlow) {
return <NewCheckoutFlow />;
}
return <LegacyCheckoutFlow />;For server-side percentage rollout without a vendor, use a hash of the user ID:
function isInRollout(userId: string, flagName: string, percentage: number): boolean {
const hash = parseInt(
require('crypto').createHash('md5')
.update(`${userId}:${flagName}`)
.digest('hex').slice(0, 8),
16,
);
return (hash % 100) < percentage;
}import { useFeatureFlagEnabled } from 'posthog-js/react';
function CheckoutPage() {
const useNewFlow = useFeatureFlagEnabled('new-checkout-flow');
if (useNewFlow) return <NewCheckoutFlow />;
return <LegacyCheckoutFlow />;
}Server-side (Next.js Server Component):
import { PostHog } from 'posthog-node';
const client = new PostHog(process.env.POSTHOG_KEY!);
const isEnabled = await client.isFeatureEnabled('new-checkout-flow', userId);import { useFlags } from 'launchdarkly-react-client-sdk';
const { newCheckoutFlow } = useFlags();Set the flag enabled only for internal team accounts / test emails. Verify the feature works end-to-end for the team.
Check for errors in Sentry immediately after enabling:
CallMcpTool(server: "plugin-sentry-sentry", toolName: "search_issues", arguments: {
"organizationSlug": "<ORG>",
"naturalLanguageQuery": "new issues in the last 1 hour",
"projectSlugOrId": "<PROJECT>",
"regionUrl": "<REGION_URL>",
"limit": 10
})Enable for 5% of real users (random cohort). Monitor for 24–48 hours.
Define the health gates before enabling:
Check Supabase logs for unexpected errors:
CallMcpTool(server: "plugin-supabase-supabase", toolName: "get_logs", arguments: {
"project_id": "<PROJECT_ID>",
"service": "api"
})Each step: enable, wait 24 h, check Sentry + Supabase + business metrics. Only proceed when the health gates are green.
If any health gate fails at any stage:
CallMcpTool(server: "plugin-sentry-sentry", toolName: "analyze_issue_with_seer", arguments: {
"organizationSlug": "<ORG>",
"issueId": "<ISSUE_ID>",
"regionUrl": "<REGION_URL>"
})Once the feature is stable at 100% for at least 1 week:
src/lib/flags.ts (for the env-var approach)Why cleanup matters: Stale flags become permanent conditions. Code that says if (FLAGS.newCheckoutFlow) six months later is a landmine nobody dares touch.
CLEANUP CHECKLIST:
- [ ] Flag gate removed from source code
- [ ] Old fallback code deleted
- [ ] Flag deleted from the flag platform
- [ ] Env var removed from .env* and deployment config
- [ ] No more references to the flag name in the codebase## Feature Flag Rollout — [flag-name] — [Date]
### Flag
- Name: [flag-name]
- Description: [what it controlled]
- Targeting: [who saw it, what percentage stages]
### Rollout timeline
| Date | Stage | Duration | Health status |
|------|-------|----------|---------------|
| ... | 0% → Internal | 2 days | ✅ Green |
| ... | Internal → 5% | 2 days | ✅ Green |
| ... | 5% → 100% | 3 days | ✅ Green |
### Health gate checks
- Sentry new issues at each stage: [count]
- P95 response time delta: [ms]
- Error rate delta: [%]
### Outcome
**Promoted to 100% / Rolled back** — [reason]
### Cleanup scheduled
[Date to remove the flag from code]~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.