agents-united 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -201
- package/README.md +627 -2
- package/dist/cli.d.ts +4 -1
- package/dist/cli.js +3826 -260
- package/dist/cli.js.map +1 -1
- package/package.json +9 -3
- package/registry/agents/orchestrator-business.md +151 -11
- package/registry/agents/orchestrator-design.md +127 -12
- package/registry/agents/orchestrator-engineering.md +129 -13
- package/registry/agents/orchestrator-marketing.md +134 -11
- package/registry/agents/orchestrator-research.md +159 -11
- package/registry/agents/orchestrator-security.md +150 -12
- package/registry/agents/orchestrator-system-architecture.md +131 -12
- package/registry/agents/subagent-accessibility-lead.md +40 -0
- package/registry/agents/subagent-ai-model-architect.md +76 -0
- package/registry/agents/subagent-android-architect.md +40 -0
- package/registry/agents/subagent-backend-architect.md +342 -9
- package/registry/agents/subagent-business-panel-experts.md +114 -8
- package/registry/agents/subagent-code-reviewer.md +181 -8
- package/registry/agents/subagent-cross-platform-specialist.md +40 -0
- package/registry/agents/subagent-data-engineer.md +40 -0
- package/registry/agents/subagent-deep-research.md +65 -8
- package/registry/agents/subagent-design-ops-lead.md +109 -8
- package/registry/agents/subagent-design-researcher.md +121 -8
- package/registry/agents/subagent-design-systems-architect.md +120 -8
- package/registry/agents/subagent-designer-toolkit-expert.md +335 -8
- package/registry/agents/subagent-devops-engineer.md +403 -0
- package/registry/agents/subagent-distributed-systems-architect.md +40 -0
- package/registry/agents/subagent-e2e-tester.md +40 -0
- package/registry/agents/subagent-frontend-architect.md +337 -8
- package/registry/agents/subagent-interaction-designer.md +288 -8
- package/registry/agents/subagent-ios-architect.md +40 -0
- package/registry/agents/subagent-lifecycle-email-specialist.md +40 -0
- package/registry/agents/subagent-marketing-campaign-specialist.md +66 -8
- package/registry/agents/subagent-marketing-content-strategist.md +171 -8
- package/registry/agents/subagent-marketing-conversion-specialist.md +66 -8
- package/registry/agents/subagent-marketing-creative-designer.md +85 -0
- package/registry/agents/subagent-marketing-growth-strategist.md +125 -8
- package/registry/agents/subagent-ml-platform-engineer.md +74 -0
- package/registry/agents/subagent-paid-acquisition-specialist.md +40 -0
- package/registry/agents/subagent-plg-strategist.md +40 -0
- package/registry/agents/subagent-prototype-tester.md +114 -8
- package/registry/agents/subagent-qa-automation-lead.md +40 -0
- package/registry/agents/subagent-repo-index.md +169 -8
- package/registry/agents/subagent-security-engineer.md +117 -8
- package/registry/agents/subagent-seo-specialist.md +40 -0
- package/registry/agents/subagent-socratic-mentor.md +91 -8
- package/registry/agents/subagent-sysops-sre-lead.md +62 -0
- package/registry/agents/subagent-system-architect.md +106 -8
- package/registry/agents/subagent-ui-designer.md +135 -8
- package/registry/agents/subagent-ux-strategist.md +75 -8
- package/registry/bundles.json +818 -154
- package/registry/rules/AGENTS.md +41 -0
- package/registry/rules/CLAUDE.md +12 -0
- package/registry/rules/CURSOR.md +12 -0
- package/registry/rules/GEMINI.md +40 -5
- package/registry/rules/clean-code-and-architecture.md +25 -0
- package/registry/rules/domain-modeling-and-adr.md +27 -0
- package/registry/rules/git-guardrails.md +19 -0
- package/registry/rules/multi-agent-coordination.md +33 -0
- package/registry/rules/quality-aesthetics-accessibility.md +29 -0
- package/registry/rules/skill-attribution.md +27 -0
- package/registry/rules/test-driven-development.md +41 -0
- package/registry/skills/ab-test-setup/SKILL.md +140 -6
- package/registry/skills/accessibility-audit/SKILL.md +147 -0
- package/registry/skills/ad-attribution-modeling/SKILL.md +202 -0
- package/registry/skills/ad-creative-design/SKILL.md +24 -0
- package/registry/skills/ai-prototype-refactoring/SKILL.md +25 -0
- package/registry/skills/architecture-design/SKILL.md +133 -7
- package/registry/skills/azure-infrastructure-bicep/SKILL.md +24 -0
- package/registry/skills/backend-api-design/SKILL.md +148 -0
- package/registry/skills/chaos-engineering/SKILL.md +38 -0
- package/registry/skills/churn-prevention-playbook/SKILL.md +177 -0
- package/registry/skills/ci-cd-pipeline-automation/SKILL.md +37 -0
- package/registry/skills/clickable-prototype-spec/SKILL.md +147 -0
- package/registry/skills/code-refactoring/SKILL.md +132 -0
- package/registry/skills/component-library-management/SKILL.md +147 -0
- package/registry/skills/component-playground-setup/SKILL.md +147 -0
- package/registry/skills/content-calendar-strategy/SKILL.md +147 -0
- package/registry/skills/conversion-funnel-optimization/SKILL.md +147 -0
- package/registry/skills/copywriting-frameworks/SKILL.md +147 -0
- package/registry/skills/database-design/SKILL.md +132 -0
- package/registry/skills/dependency-management/SKILL.md +133 -7
- package/registry/skills/design-handoff-spec/SKILL.md +147 -0
- package/registry/skills/design-ops-workflow/SKILL.md +147 -0
- package/registry/skills/design-system-governance/SKILL.md +147 -0
- package/registry/skills/design-system-tokens/SKILL.md +147 -0
- package/registry/skills/design-tokens-management/SKILL.md +147 -0
- package/registry/skills/design-version-control/SKILL.md +147 -0
- package/registry/skills/diagnosing-bugs/SKILL.md +43 -0
- package/registry/skills/docker-deployment/SKILL.md +141 -0
- package/registry/skills/domain-modeling/SKILL.md +50 -0
- package/registry/skills/email-drip-sequences/SKILL.md +177 -0
- package/registry/skills/email-marketing-automation/SKILL.md +147 -0
- package/registry/skills/finishing-a-development-branch/SKILL.md +123 -7
- package/registry/skills/frontend-component-design/SKILL.md +150 -0
- package/registry/skills/git-guardrails/SKILL.md +38 -0
- package/registry/skills/google-ads-optimization/SKILL.md +24 -0
- package/registry/skills/graphql-schema-design/SKILL.md +143 -0
- package/registry/skills/grill-me/SKILL.md +51 -0
- package/registry/skills/grill-with-docs/SKILL.md +78 -0
- package/registry/skills/growth-experiment-design/SKILL.md +147 -0
- package/registry/skills/handoff/SKILL.md +41 -0
- package/registry/skills/hf-model-evaluation/SKILL.md +80 -0
- package/registry/skills/interaction-pattern-library/SKILL.md +147 -0
- package/registry/skills/interactive-prototype-builder/SKILL.md +147 -0
- package/registry/skills/local-llm-inference/SKILL.md +74 -0
- package/registry/skills/maestro-mobile-testing/SKILL.md +37 -0
- package/registry/skills/marketing-creative-design/SKILL.md +182 -0
- package/registry/skills/meta-ad-creative-testing/SKILL.md +23 -0
- package/registry/skills/micro-interaction-design/SKILL.md +147 -0
- package/registry/skills/microservices-architecture/SKILL.md +138 -0
- package/registry/skills/mobile-android-design/SKILL.md +37 -0
- package/registry/skills/mobile-first-design/SKILL.md +147 -0
- package/registry/skills/mobile-ios-design/SKILL.md +37 -0
- package/registry/skills/mobile-platform-offline-validate/SKILL.md +37 -0
- package/registry/skills/modal-serverless-python/SKILL.md +78 -0
- package/registry/skills/onboarding-cro/SKILL.md +175 -7
- package/registry/skills/paid-acquisition-ppc/SKILL.md +167 -0
- package/registry/skills/performance-optimization/SKILL.md +132 -7
- package/registry/skills/playwright-best-practices/SKILL.md +36 -0
- package/registry/skills/product-launch-playbook/SKILL.md +147 -0
- package/registry/skills/programmatic-seo/SKILL.md +203 -7
- package/registry/skills/rag-vector-pipeline/SKILL.md +80 -0
- package/registry/skills/react-best-practices/SKILL.md +37 -0
- package/registry/skills/receiving-code-review/SKILL.md +121 -7
- package/registry/skills/replicate-model-inference/SKILL.md +73 -0
- package/registry/skills/requesting-code-review/SKILL.md +128 -7
- package/registry/skills/responsive-design-audit/SKILL.md +147 -0
- package/registry/skills/runpod-gpu-orchestration/SKILL.md +81 -0
- package/registry/skills/schema-markup-strategy/SKILL.md +190 -0
- package/registry/skills/security-audit/SKILL.md +136 -0
- package/registry/skills/seo-audit/SKILL.md +140 -6
- package/registry/skills/signup-flow-cro/SKILL.md +140 -6
- package/registry/skills/social-media-campaign/SKILL.md +147 -0
- package/registry/skills/state-driven-ui-animation/SKILL.md +147 -0
- package/registry/skills/subagent-driven-development/SKILL.md +126 -7
- package/registry/skills/supabase-backend-architecture/SKILL.md +25 -0
- package/registry/skills/systematic-debugging/SKILL.md +129 -7
- package/registry/skills/technical-documentation/SKILL.md +133 -0
- package/registry/skills/technical-seo-audit/SKILL.md +24 -0
- package/registry/skills/telemetry-monitoring/SKILL.md +37 -0
- package/registry/skills/test-driven-development/SKILL.md +127 -7
- package/registry/skills/to-spec/SKILL.md +43 -0
- package/registry/skills/to-tickets/SKILL.md +45 -0
- package/registry/skills/turso-distributed-sqlite/SKILL.md +23 -0
- package/registry/skills/ui-component-spec/SKILL.md +147 -0
- package/registry/skills/usability-testing-protocol/SKILL.md +147 -0
- package/registry/skills/user-flow-mapping/SKILL.md +147 -0
- package/registry/skills/user-journey-mapping/SKILL.md +147 -0
- package/registry/skills/vector-database-design/SKILL.md +80 -0
- package/registry/skills/vercel-deploy-best-practices/SKILL.md +24 -0
- package/registry/skills/viral-referral-loops/SKILL.md +205 -0
- package/registry/workflows/workflow-analyze.md +53 -8
- package/registry/workflows/workflow-api-contract-design.md +48 -0
- package/registry/workflows/workflow-app-store-release.md +48 -0
- package/registry/workflows/workflow-brainstorm.md +53 -8
- package/registry/workflows/workflow-build.md +53 -8
- package/registry/workflows/workflow-business-panel.md +53 -8
- package/registry/workflows/workflow-cleanup.md +53 -8
- package/registry/workflows/workflow-deploy-staging.md +49 -0
- package/registry/workflows/workflow-design-code.md +53 -8
- package/registry/workflows/workflow-design-ops--handoff.md +53 -8
- package/registry/workflows/workflow-design-ops--plan-sprint.md +53 -8
- package/registry/workflows/workflow-design-ops--setup-workflow.md +53 -8
- package/registry/workflows/workflow-design-orchestrate.md +53 -8
- package/registry/workflows/workflow-design-systems--audit-system.md +53 -8
- package/registry/workflows/workflow-design-systems--create-component.md +53 -8
- package/registry/workflows/workflow-design-systems--tokenize.md +53 -8
- package/registry/workflows/workflow-diagnose.md +45 -0
- package/registry/workflows/workflow-e2e-testing.md +49 -0
- package/registry/workflows/workflow-email-drip-sequence.md +65 -0
- package/registry/workflows/workflow-estimate.md +53 -8
- package/registry/workflows/workflow-explain.md +53 -8
- package/registry/workflows/workflow-frontend-audit.md +49 -0
- package/registry/workflows/workflow-git.md +53 -8
- package/registry/workflows/workflow-grill.md +51 -0
- package/registry/workflows/workflow-implement.md +54 -8
- package/registry/workflows/workflow-incident-triage.md +49 -0
- package/registry/workflows/workflow-interaction-design--design-interaction.md +53 -8
- package/registry/workflows/workflow-interaction-design--error-flow.md +53 -8
- package/registry/workflows/workflow-interaction-design--map-states.md +53 -8
- package/registry/workflows/workflow-marketing-audit.md +53 -8
- package/registry/workflows/workflow-marketing-campaign-builder.md +53 -8
- package/registry/workflows/workflow-marketing-content-pipeline.md +53 -8
- package/registry/workflows/workflow-marketing-growth-experiment.md +53 -8
- package/registry/workflows/workflow-marketing-launch.md +53 -8
- package/registry/workflows/workflow-marketing-panel.md +53 -8
- package/registry/workflows/workflow-ml-eval.md +51 -0
- package/registry/workflows/workflow-mobile-build.md +49 -0
- package/registry/workflows/workflow-onboarding-funnel-cro.md +65 -0
- package/registry/workflows/workflow-paid-acquisition-campaign.md +65 -0
- package/registry/workflows/workflow-paid-campaign-launch.md +47 -0
- package/registry/workflows/workflow-plan.md +53 -8
- package/registry/workflows/workflow-prototyping-testing--evaluate.md +53 -8
- package/registry/workflows/workflow-prototyping-testing--experiment.md +53 -8
- package/registry/workflows/workflow-prototyping-testing--prototype-plan.md +53 -8
- package/registry/workflows/workflow-prototyping-testing--test-plan.md +53 -8
- package/registry/workflows/workflow-rag-pipeline-deploy.md +53 -0
- package/registry/workflows/workflow-recommend.md +53 -8
- package/registry/workflows/workflow-research.md +53 -8
- package/registry/workflows/workflow-review.md +53 -8
- package/registry/workflows/workflow-seo-audit-pipeline.md +47 -0
- package/registry/workflows/workflow-seo-content-pipeline.md +65 -0
- package/registry/workflows/workflow-serverless-gpu-deploy.md +52 -0
- package/registry/workflows/workflow-spec-panel.md +53 -8
- package/registry/workflows/workflow-spec.md +44 -0
- package/registry/workflows/workflow-test.md +53 -8
- package/registry/workflows/workflow-troubleshoot.md +53 -8
- package/registry/workflows/workflow-ui-design--color-palette.md +53 -8
- package/registry/workflows/workflow-ui-design--design-screen.md +53 -8
- package/registry/workflows/workflow-ui-design--responsive-audit.md +53 -8
- package/registry/workflows/workflow-ui-design--type-system.md +53 -8
- package/registry/workflows/workflow-ux-strategy--benchmark.md +53 -8
- package/registry/workflows/workflow-ux-strategy--frame-problem.md +53 -8
- package/registry/workflows/workflow-ux-strategy--strategize.md +53 -8
- package/registry/skills/analytics-tracking/SKILL.md +0 -13
- package/registry/skills/brainstorming/SKILL.md +0 -13
- package/registry/skills/browser-agent/SKILL.md +0 -13
- package/registry/skills/campaign-strategy/SKILL.md +0 -13
- package/registry/skills/competitor-alternatives/SKILL.md +0 -13
- package/registry/skills/confidence-check/SKILL.md +0 -13
- package/registry/skills/copy-editing/SKILL.md +0 -13
- package/registry/skills/copywriting/SKILL.md +0 -13
- package/registry/skills/deep-research/SKILL.md +0 -13
- package/registry/skills/design-ops/SKILL.md +0 -13
- package/registry/skills/design-research/SKILL.md +0 -13
- package/registry/skills/design-systems/SKILL.md +0 -13
- package/registry/skills/designer-toolkit/SKILL.md +0 -13
- package/registry/skills/email-sequence/SKILL.md +0 -13
- package/registry/skills/executing-plans/SKILL.md +0 -13
- package/registry/skills/form-cro/SKILL.md +0 -13
- package/registry/skills/free-tool-strategy/SKILL.md +0 -13
- package/registry/skills/interaction-design/SKILL.md +0 -13
- package/registry/skills/launch-strategy/SKILL.md +0 -13
- package/registry/skills/marketing-ideas/SKILL.md +0 -13
- package/registry/skills/marketing-psychology/SKILL.md +0 -13
- package/registry/skills/page-cro/SKILL.md +0 -13
- package/registry/skills/paid-ads/SKILL.md +0 -13
- package/registry/skills/paywall-upgrade-cro/SKILL.md +0 -13
- package/registry/skills/popup-cro/SKILL.md +0 -13
- package/registry/skills/pricing-strategy/SKILL.md +0 -13
- package/registry/skills/prototyping-testing/SKILL.md +0 -13
- package/registry/skills/referral-program/SKILL.md +0 -13
- package/registry/skills/schema-markup/SKILL.md +0 -13
- package/registry/skills/security-review/SKILL.md +0 -13
- package/registry/skills/social-content/SKILL.md +0 -13
- package/registry/skills/ui-design/SKILL.md +0 -13
- package/registry/skills/ux-strategy/SKILL.md +0 -13
- package/registry/skills/writing-plans/SKILL.md +0 -13
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: user-flow-mapping
|
|
3
|
+
description: Production-grade User Flow Mapping playbook for design operations, UX systems, and growth strategy.
|
|
4
|
+
metadata:
|
|
5
|
+
author: "agents-united"
|
|
6
|
+
version: "2.0.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# User Flow Mapping
|
|
10
|
+
|
|
11
|
+
## Overview & Purpose
|
|
12
|
+
The User Flow Mapping skill provides a deterministic framework for executing user flow mapping processes in modern software products.
|
|
13
|
+
|
|
14
|
+
Following this skill ensures high usability, visual consistency, rapid iteration, and complete cross-functional team alignment.
|
|
15
|
+
|
|
16
|
+
## Execution Triggers & Prerequisites
|
|
17
|
+
### Execution Triggers
|
|
18
|
+
- Direct request to execute User Flow Mapping tasks.
|
|
19
|
+
- Auditing existing product assets or workflows.
|
|
20
|
+
- Standardizing user-flow-mapping procedures across team projects.
|
|
21
|
+
- Preparing design handoffs or growth campaign launches.
|
|
22
|
+
|
|
23
|
+
### Prerequisites
|
|
24
|
+
- Project workspace configured with design system tokens or component libraries.
|
|
25
|
+
- Target UI design specification or growth experiment hypothesis.
|
|
26
|
+
- Testing and linting tools operational.
|
|
27
|
+
- Clean git working directory.
|
|
28
|
+
|
|
29
|
+
## Input & Output Requirements
|
|
30
|
+
### Inputs
|
|
31
|
+
| Parameter | Type | Required | Description |
|
|
32
|
+
|---|---|---|---|
|
|
33
|
+
| `target_scope` | String | Yes | Target UI component, page, or campaign scope |
|
|
34
|
+
| `config` | Object | Optional | Specific parameters and threshold configurations |
|
|
35
|
+
| `output_dir` | Directory Path | Optional | Destination directory for generated artifacts |
|
|
36
|
+
| `strict_mode` | Boolean | Optional | Enforce strict zero-warning validation |
|
|
37
|
+
|
|
38
|
+
### Outputs
|
|
39
|
+
| Artifact | Path / Format | Description |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| Specification Document | `docs/user-flow-mapping/spec.md` | Full specification and guidelines document |
|
|
42
|
+
| Component / Asset Files | `src/user-flow-mapping/*` | Implemented design tokens, components, or campaign assets |
|
|
43
|
+
| Audit Report | `reports/user-flow-mapping/summary.json` | Health check and audit metric results |
|
|
44
|
+
|
|
45
|
+
## Step-by-Step Execution Runbook
|
|
46
|
+
|
|
47
|
+
### Phase 1: Pre-Execution Discovery & Workspace Analysis
|
|
48
|
+
1. Inspect workspace repository to locate relevant UI components, tokens, or campaign assets.
|
|
49
|
+
```bash
|
|
50
|
+
find src/ docs/ -maxdepth 3 -type f
|
|
51
|
+
```
|
|
52
|
+
2. Analyze domain requirements and classify core UI elements, interaction flows, or growth metrics.
|
|
53
|
+
3. Establish baseline quality metrics and target benchmarks.
|
|
54
|
+
4. Verify working tree status to ensure clean git workspace.
|
|
55
|
+
```bash
|
|
56
|
+
git status --short
|
|
57
|
+
```
|
|
58
|
+
5. Formulate initial execution plan.
|
|
59
|
+
|
|
60
|
+
### Phase 2: Input Contract Validation & Strategy Selection
|
|
61
|
+
1. Validate input parameters against technical feasibility and design system guidelines.
|
|
62
|
+
2. Select implementation pattern matching component or campaign architecture.
|
|
63
|
+
3. Establish verification rules and accessibility / conversion thresholds.
|
|
64
|
+
4. Formulate atomic step-by-step execution sequence.
|
|
65
|
+
5. Create temporary working directory if needed.
|
|
66
|
+
|
|
67
|
+
### Phase 3: Core Step-by-Step Implementation Execution
|
|
68
|
+
1. Author primary specification document at `docs/user-flow-mapping/spec.md`.
|
|
69
|
+
2. Generate code, token, or layout implementation files.
|
|
70
|
+
```bash
|
|
71
|
+
npm run typecheck
|
|
72
|
+
```
|
|
73
|
+
3. Apply automated formatting and linting tools.
|
|
74
|
+
4. Execute unit or visual regression tests.
|
|
75
|
+
```bash
|
|
76
|
+
npm test
|
|
77
|
+
```
|
|
78
|
+
5. Refactor asset structure for optimal performance and maintainability.
|
|
79
|
+
|
|
80
|
+
### Phase 4: Verification, Testing & Quality Gate Checking
|
|
81
|
+
1. Run full project verification suite.
|
|
82
|
+
```bash
|
|
83
|
+
npm run typecheck && npm test && npm run build
|
|
84
|
+
```
|
|
85
|
+
2. Verify zero lint errors, type warnings, or broken references.
|
|
86
|
+
3. Execute CLI health doctor check.
|
|
87
|
+
```bash
|
|
88
|
+
node dist/cli.js doctor
|
|
89
|
+
```
|
|
90
|
+
4. Assert all acceptance criteria are satisfied.
|
|
91
|
+
|
|
92
|
+
### Phase 5: Post-Execution Cleanup & Artifact Generation
|
|
93
|
+
1. Generate execution summary report at `reports/user-flow-mapping/summary.md`.
|
|
94
|
+
2. Clean up temporary build artifacts and scratch files.
|
|
95
|
+
3. Commit generated files to git repository.
|
|
96
|
+
```bash
|
|
97
|
+
git add docs/user-flow-mapping/ reports/user-flow-mapping/
|
|
98
|
+
git commit -m "feat(user-flow-mapping): implement User Flow Mapping playbook artifacts"
|
|
99
|
+
```
|
|
100
|
+
4. Publish documentation for team review.
|
|
101
|
+
|
|
102
|
+
## Code & Configuration Exemplars
|
|
103
|
+
|
|
104
|
+
### Exemplar 1: User Flow Mapping Configuration Specification
|
|
105
|
+
```yaml
|
|
106
|
+
version: "2.0.0"
|
|
107
|
+
metadata:
|
|
108
|
+
skill: "user-flow-mapping"
|
|
109
|
+
author: "agents-united"
|
|
110
|
+
rules:
|
|
111
|
+
strictValidation: true
|
|
112
|
+
reporting:
|
|
113
|
+
format: "json"
|
|
114
|
+
output: "reports/user-flow-mapping/summary.json"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Exemplar 2: User Flow Mapping Helper Module
|
|
118
|
+
```typescript
|
|
119
|
+
export function runUserFlowMapping(scope: string): boolean {
|
|
120
|
+
console.log('Running User Flow Mapping on:', scope);
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Edge Cases & Error Recovery Procedures
|
|
126
|
+
|
|
127
|
+
### Scenario A: Validation Failure in User Flow Mapping
|
|
128
|
+
1. **Diagnosis**: Specification or code asset fails validation rules in user-flow-mapping.
|
|
129
|
+
2. **Recovery Protocol**:
|
|
130
|
+
- Step 1: Inspect error log at reports directory.
|
|
131
|
+
- Step 2: Correct non-compliant syntax or structure.
|
|
132
|
+
- Step 3: Re-run verification pipeline.
|
|
133
|
+
|
|
134
|
+
### Scenario B: Missing Resource for User Flow Mapping
|
|
135
|
+
1. **Diagnosis**: Target design token or configuration asset missing from workspace.
|
|
136
|
+
2. **Recovery Protocol**:
|
|
137
|
+
- Step 1: Generate baseline resource file from standard template.
|
|
138
|
+
- Step 2: Update configuration references.
|
|
139
|
+
- Step 3: Resume runbook execution.
|
|
140
|
+
|
|
141
|
+
## Verification & Validation Checklist
|
|
142
|
+
- [ ] Frontmatter conforms strictly to `author: "agents-united"` and `version: "2.0.0"`.
|
|
143
|
+
- [ ] All 7 mandatory sections present with explicit headers.
|
|
144
|
+
- [ ] Step-by-Step Execution Runbook body contains >= 50 lines.
|
|
145
|
+
- [ ] Code exemplars provided with valid syntax fencing.
|
|
146
|
+
- [ ] Zero dummy placeholder strings or unpopulated template markers present.
|
|
147
|
+
- [ ] Project build, test suite, and doctor check pass 100% cleanly.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: user-journey-mapping
|
|
3
|
+
description: Production-grade User Journey Mapping playbook for design operations, UX systems, and growth strategy.
|
|
4
|
+
metadata:
|
|
5
|
+
author: "agents-united"
|
|
6
|
+
version: "2.0.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# User Journey Mapping
|
|
10
|
+
|
|
11
|
+
## Overview & Purpose
|
|
12
|
+
The User Journey Mapping skill provides a deterministic framework for executing user journey mapping processes in modern software products.
|
|
13
|
+
|
|
14
|
+
Following this skill ensures high usability, visual consistency, rapid iteration, and complete cross-functional team alignment.
|
|
15
|
+
|
|
16
|
+
## Execution Triggers & Prerequisites
|
|
17
|
+
### Execution Triggers
|
|
18
|
+
- Direct request to execute User Journey Mapping tasks.
|
|
19
|
+
- Auditing existing product assets or workflows.
|
|
20
|
+
- Standardizing user-journey-mapping procedures across team projects.
|
|
21
|
+
- Preparing design handoffs or growth campaign launches.
|
|
22
|
+
|
|
23
|
+
### Prerequisites
|
|
24
|
+
- Project workspace configured with design system tokens or component libraries.
|
|
25
|
+
- Target UI design specification or growth experiment hypothesis.
|
|
26
|
+
- Testing and linting tools operational.
|
|
27
|
+
- Clean git working directory.
|
|
28
|
+
|
|
29
|
+
## Input & Output Requirements
|
|
30
|
+
### Inputs
|
|
31
|
+
| Parameter | Type | Required | Description |
|
|
32
|
+
|---|---|---|---|
|
|
33
|
+
| `target_scope` | String | Yes | Target UI component, page, or campaign scope |
|
|
34
|
+
| `config` | Object | Optional | Specific parameters and threshold configurations |
|
|
35
|
+
| `output_dir` | Directory Path | Optional | Destination directory for generated artifacts |
|
|
36
|
+
| `strict_mode` | Boolean | Optional | Enforce strict zero-warning validation |
|
|
37
|
+
|
|
38
|
+
### Outputs
|
|
39
|
+
| Artifact | Path / Format | Description |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| Specification Document | `docs/user-journey-mapping/spec.md` | Full specification and guidelines document |
|
|
42
|
+
| Component / Asset Files | `src/user-journey-mapping/*` | Implemented design tokens, components, or campaign assets |
|
|
43
|
+
| Audit Report | `reports/user-journey-mapping/summary.json` | Health check and audit metric results |
|
|
44
|
+
|
|
45
|
+
## Step-by-Step Execution Runbook
|
|
46
|
+
|
|
47
|
+
### Phase 1: Pre-Execution Discovery & Workspace Analysis
|
|
48
|
+
1. Inspect workspace repository to locate relevant UI components, tokens, or campaign assets.
|
|
49
|
+
```bash
|
|
50
|
+
find src/ docs/ -maxdepth 3 -type f
|
|
51
|
+
```
|
|
52
|
+
2. Analyze domain requirements and classify core UI elements, interaction flows, or growth metrics.
|
|
53
|
+
3. Establish baseline quality metrics and target benchmarks.
|
|
54
|
+
4. Verify working tree status to ensure clean git workspace.
|
|
55
|
+
```bash
|
|
56
|
+
git status --short
|
|
57
|
+
```
|
|
58
|
+
5. Formulate initial execution plan.
|
|
59
|
+
|
|
60
|
+
### Phase 2: Input Contract Validation & Strategy Selection
|
|
61
|
+
1. Validate input parameters against technical feasibility and design system guidelines.
|
|
62
|
+
2. Select implementation pattern matching component or campaign architecture.
|
|
63
|
+
3. Establish verification rules and accessibility / conversion thresholds.
|
|
64
|
+
4. Formulate atomic step-by-step execution sequence.
|
|
65
|
+
5. Create temporary working directory if needed.
|
|
66
|
+
|
|
67
|
+
### Phase 3: Core Step-by-Step Implementation Execution
|
|
68
|
+
1. Author primary specification document at `docs/user-journey-mapping/spec.md`.
|
|
69
|
+
2. Generate code, token, or layout implementation files.
|
|
70
|
+
```bash
|
|
71
|
+
npm run typecheck
|
|
72
|
+
```
|
|
73
|
+
3. Apply automated formatting and linting tools.
|
|
74
|
+
4. Execute unit or visual regression tests.
|
|
75
|
+
```bash
|
|
76
|
+
npm test
|
|
77
|
+
```
|
|
78
|
+
5. Refactor asset structure for optimal performance and maintainability.
|
|
79
|
+
|
|
80
|
+
### Phase 4: Verification, Testing & Quality Gate Checking
|
|
81
|
+
1. Run full project verification suite.
|
|
82
|
+
```bash
|
|
83
|
+
npm run typecheck && npm test && npm run build
|
|
84
|
+
```
|
|
85
|
+
2. Verify zero lint errors, type warnings, or broken references.
|
|
86
|
+
3. Execute CLI health doctor check.
|
|
87
|
+
```bash
|
|
88
|
+
node dist/cli.js doctor
|
|
89
|
+
```
|
|
90
|
+
4. Assert all acceptance criteria are satisfied.
|
|
91
|
+
|
|
92
|
+
### Phase 5: Post-Execution Cleanup & Artifact Generation
|
|
93
|
+
1. Generate execution summary report at `reports/user-journey-mapping/summary.md`.
|
|
94
|
+
2. Clean up temporary build artifacts and scratch files.
|
|
95
|
+
3. Commit generated files to git repository.
|
|
96
|
+
```bash
|
|
97
|
+
git add docs/user-journey-mapping/ reports/user-journey-mapping/
|
|
98
|
+
git commit -m "feat(user-journey-mapping): implement User Journey Mapping playbook artifacts"
|
|
99
|
+
```
|
|
100
|
+
4. Publish documentation for team review.
|
|
101
|
+
|
|
102
|
+
## Code & Configuration Exemplars
|
|
103
|
+
|
|
104
|
+
### Exemplar 1: User Journey Mapping Configuration Specification
|
|
105
|
+
```yaml
|
|
106
|
+
version: "2.0.0"
|
|
107
|
+
metadata:
|
|
108
|
+
skill: "user-journey-mapping"
|
|
109
|
+
author: "agents-united"
|
|
110
|
+
rules:
|
|
111
|
+
strictValidation: true
|
|
112
|
+
reporting:
|
|
113
|
+
format: "json"
|
|
114
|
+
output: "reports/user-journey-mapping/summary.json"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Exemplar 2: User Journey Mapping Helper Module
|
|
118
|
+
```typescript
|
|
119
|
+
export function runUserJourneyMapping(scope: string): boolean {
|
|
120
|
+
console.log('Running User Journey Mapping on:', scope);
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Edge Cases & Error Recovery Procedures
|
|
126
|
+
|
|
127
|
+
### Scenario A: Validation Failure in User Journey Mapping
|
|
128
|
+
1. **Diagnosis**: Specification or code asset fails validation rules in user-journey-mapping.
|
|
129
|
+
2. **Recovery Protocol**:
|
|
130
|
+
- Step 1: Inspect error log at reports directory.
|
|
131
|
+
- Step 2: Correct non-compliant syntax or structure.
|
|
132
|
+
- Step 3: Re-run verification pipeline.
|
|
133
|
+
|
|
134
|
+
### Scenario B: Missing Resource for User Journey Mapping
|
|
135
|
+
1. **Diagnosis**: Target design token or configuration asset missing from workspace.
|
|
136
|
+
2. **Recovery Protocol**:
|
|
137
|
+
- Step 1: Generate baseline resource file from standard template.
|
|
138
|
+
- Step 2: Update configuration references.
|
|
139
|
+
- Step 3: Resume runbook execution.
|
|
140
|
+
|
|
141
|
+
## Verification & Validation Checklist
|
|
142
|
+
- [ ] Frontmatter conforms strictly to `author: "agents-united"` and `version: "2.0.0"`.
|
|
143
|
+
- [ ] All 7 mandatory sections present with explicit headers.
|
|
144
|
+
- [ ] Step-by-Step Execution Runbook body contains >= 50 lines.
|
|
145
|
+
- [ ] Code exemplars provided with valid syntax fencing.
|
|
146
|
+
- [ ] Zero dummy placeholder strings or unpopulated template markers present.
|
|
147
|
+
- [ ] Project build, test suite, and doctor check pass 100% cleanly.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vector-database-design
|
|
3
|
+
description: Designing vector database schemas, HNSW index parameter tuning, metadata filtering, and collection partitioning on Qdrant, Pinecone, and Chroma.
|
|
4
|
+
metadata:
|
|
5
|
+
author: "Qdrant & Pinecone Community / agents-united"
|
|
6
|
+
version: "2.0.0"
|
|
7
|
+
license: "MIT"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Vector Database Design Playbook
|
|
11
|
+
|
|
12
|
+
## Overview & Purpose
|
|
13
|
+
`vector-database-design` outlines schema architectures, HNSW index parameter tuning, payload filtering optimization, and multi-tenant partitioning strategies across modern vector databases (Qdrant, Pinecone, Chroma).
|
|
14
|
+
|
|
15
|
+
## When to Trigger
|
|
16
|
+
Trigger this skill whenever:
|
|
17
|
+
- Designing new vector database collection schemas and dimensionality configurations.
|
|
18
|
+
- Tuning HNSW indexing parameters (`m`, `ef_construct`, `ef_search`) for speed vs. recall balance.
|
|
19
|
+
- Setting up payload metadata indexing for low-latency pre-filtering in multi-tenant environments.
|
|
20
|
+
- Partitioning collections across namespaces or tenant IDs to guarantee strict data isolation.
|
|
21
|
+
|
|
22
|
+
## Input & Output Requirements
|
|
23
|
+
- **Inputs**: Embedding dimension size (e.g. 1536, 768), expected vector count, distance metric (Cosine, Dot, Euclidean), and metadata filtering query requirements.
|
|
24
|
+
- **Outputs**: Collection creation scripts, payload index definitions, connection pool configurations, and query latency benchmarks.
|
|
25
|
+
|
|
26
|
+
## Step-by-Step Execution Runbook
|
|
27
|
+
|
|
28
|
+
### Phase 1 — Schema Architecture & Distance Metric Selection
|
|
29
|
+
- Align vector distance metric with the training objective of the embedding model (Cosine distance for normalized embeddings).
|
|
30
|
+
- Allocate vector dimensionality strictly matching embedding model output.
|
|
31
|
+
|
|
32
|
+
### Phase 2 — HNSW Parameter Tuning & Payload Indexing
|
|
33
|
+
- Configure HNSW graph parameters: set `m=16` (edges per node) and `ef_construct=128` for high build-time quality.
|
|
34
|
+
- Create payload indexes on categorical and filterable metadata fields (e.g. `tenant_id`, `created_at`, `category`).
|
|
35
|
+
|
|
36
|
+
### Phase 3 — Verification & Latency Benchmarking
|
|
37
|
+
- Measure vector ingestion throughput and run concurrent search queries.
|
|
38
|
+
- Verify that filtered searches achieve < 50ms p95 latency at 1M+ vectors scale.
|
|
39
|
+
|
|
40
|
+
## Edge Cases & Boundary Conditions
|
|
41
|
+
- **High-Dimensionality Memory Overhead**: Use scalar or product quantization (SQ/PQ) in Qdrant/Pinecone to reduce RAM footprint by up to 75% with < 2% recall loss.
|
|
42
|
+
- **Extreme Payload Imbalance**: Avoid indexing high-cardinality unique text strings in payload indexes.
|
|
43
|
+
- **Cross-Tenant Data Leakage**: Enforce tenant ID filters at the query level or use separate namespaces per customer.
|
|
44
|
+
|
|
45
|
+
## Error Recovery & Fallbacks
|
|
46
|
+
- If vector insertion fails due to timeout during large batch upserts, split payloads into smaller batches of 256-512 vectors.
|
|
47
|
+
- If search recall drops below 95%, increase `ef_search` from 64 to 128.
|
|
48
|
+
|
|
49
|
+
## Code Exemplars & Patterns
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from qdrant_client import QdrantClient
|
|
53
|
+
from qdrant_client.models import Distance, VectorParams, HnswConfigDiff, PayloadSchemaType
|
|
54
|
+
|
|
55
|
+
client = QdrantClient(url="http://localhost:6333")
|
|
56
|
+
|
|
57
|
+
# 1. Create collection with tuned HNSW parameters
|
|
58
|
+
client.create_collection(
|
|
59
|
+
collection_name="enterprise_docs",
|
|
60
|
+
vectors_config=VectorParams(size=1536, distance=Distance.COSINE),
|
|
61
|
+
hnsw_config=HnswConfigDiff(
|
|
62
|
+
m=16,
|
|
63
|
+
ef_construct=128,
|
|
64
|
+
full_scan_threshold=10000,
|
|
65
|
+
)
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
# 2. Create payload indexes for fast pre-filtering
|
|
69
|
+
client.create_payload_index(
|
|
70
|
+
collection_name="enterprise_docs",
|
|
71
|
+
field_name="tenant_id",
|
|
72
|
+
field_schema=PayloadSchemaType.KEYWORD
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
client.create_payload_index(
|
|
76
|
+
collection_name="enterprise_docs",
|
|
77
|
+
field_name="created_at",
|
|
78
|
+
field_schema=PayloadSchemaType.INTEGER
|
|
79
|
+
)
|
|
80
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vercel-deploy-best-practices
|
|
3
|
+
description: Next.js and frontend deployment optimization on Vercel, Edge Middleware, Incremental Static Regeneration (ISR), Server Actions, and Preview environments.
|
|
4
|
+
metadata:
|
|
5
|
+
author: "Agents United Frontend Group"
|
|
6
|
+
version: "1.0.0"
|
|
7
|
+
license: "MIT"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Vercel Deployment Best Practices Playbook
|
|
11
|
+
|
|
12
|
+
## Overview & Purpose
|
|
13
|
+
`vercel-deploy-best-practices` provides production deployment and configuration guidelines for Next.js, Remix, and static web applications hosted on Vercel.
|
|
14
|
+
|
|
15
|
+
## Core Directives & Standards
|
|
16
|
+
1. **Edge Middleware Routing** — Keep Edge Middleware execution < 25ms by avoiding heavy libraries or un-cached external network calls.
|
|
17
|
+
2. **Incremental Static Regeneration (ISR)** — Configure `revalidate` intervals or on-demand revalidation (`revalidatePath`, `revalidateTag`) for dynamic content caching.
|
|
18
|
+
3. **Environment Variable Hierarchy** — Separate `Development`, `Preview`, and `Production` environment variables securely with branch-specific overrides.
|
|
19
|
+
4. **Vercel Web Analytics & Speed Insights** — Integrate `@vercel/analytics` and `@vercel/speed-insights` for real-user Core Web Vitals monitoring.
|
|
20
|
+
5. **Serverless Function Concurrency** — Configure max duration limits and memory allocations in `vercel.json` to prevent billing surprises.
|
|
21
|
+
|
|
22
|
+
## Verification Checklist
|
|
23
|
+
- [ ] Preview deployments generate isolated database branch previews when paired with Neon/Supabase.
|
|
24
|
+
- [ ] Zero unhandled Server Action errors in production logs.
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: viral-referral-loops
|
|
3
|
+
description: Production-grade Viral Referral Loops playbook for double-sided incentive architectures, K-factor viral loop equations, in-app share mechanics, and fraud-resistant referral engines.
|
|
4
|
+
metadata:
|
|
5
|
+
author: "agents-united"
|
|
6
|
+
version: "2.0.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Viral Referral Loops & Product-Led Organic Expansion Architecture
|
|
10
|
+
|
|
11
|
+
## Overview & Purpose
|
|
12
|
+
The Viral Referral Loops skill provides a comprehensive mathematical and product engineering framework for designing, implementing, and scaling high-velocity referral loops in product-led growth (PLG) SaaS platforms.
|
|
13
|
+
|
|
14
|
+
Following this skill designs double-sided reward incentives, contextual trigger timing (leveraging the peak-end rule and satisfaction milestones), seamless modal and clipboard share interactions, server-side fraud prevention mechanisms, and mathematical tracking of viral coefficient ($K$-factor) and cycle time ($c_t$).
|
|
15
|
+
|
|
16
|
+
## Execution Triggers & Prerequisites
|
|
17
|
+
### Execution Triggers
|
|
18
|
+
- Designing customer referral programs to lower blended Customer Acquisition Cost (CAC).
|
|
19
|
+
- Engineering viral product loops (collaboration invites, public share links, powered-by badges).
|
|
20
|
+
- Optimizing referral conversion rates from invitation sent to referee account activation.
|
|
21
|
+
- Implementing fraud detection rules for self-referrals and reward gaming.
|
|
22
|
+
|
|
23
|
+
### Prerequisites
|
|
24
|
+
- Product analytics tracking user engagement events and milestone completions.
|
|
25
|
+
- Relational database schema supporting referral links, attribution tokens, and ledger credits.
|
|
26
|
+
- Transactional email / notification service for sending referee invitation alerts.
|
|
27
|
+
- Clean git working directory.
|
|
28
|
+
|
|
29
|
+
## Input & Output Requirements
|
|
30
|
+
### Inputs
|
|
31
|
+
| Parameter | Type | Required | Description |
|
|
32
|
+
|---|---|---|---|
|
|
33
|
+
| `incentive_type` | String | Yes | `double_sided_credit`, `extended_trial`, `feature_unlock`, `revenue_share` |
|
|
34
|
+
| `referrer_reward` | Number | Yes | Value granted to existing user upon successful referee activation |
|
|
35
|
+
| `referee_reward` | Number | Yes | Value granted to invited user upon signup |
|
|
36
|
+
| `target_k_factor` | Number | Optional | Target viral coefficient (e.g. 0.35) |
|
|
37
|
+
| `qualification_criteria`| String | Yes | Milestone referee must hit before reward is unlocked (e.g. `first_project_run`) |
|
|
38
|
+
|
|
39
|
+
### Outputs
|
|
40
|
+
| Artifact | Path / Format | Description |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| Viral Loop Spec Spec | `docs/viral-referral-loops/referral-spec.md` | Formulas, user journey diagrams, reward tiers |
|
|
43
|
+
| Referral Modal Component | `src/components/referral/ReferralModal.tsx` | Share links, social intents, reward tracker |
|
|
44
|
+
| Referral Engine Service | `src/services/growth/referral-engine.ts` | Token generation, attribution, fraud validation |
|
|
45
|
+
| Viral Analytics Report | `reports/viral-referral-loops/k-factor-summary.json`| $K$-factor, cycle time, and invite conversion stats |
|
|
46
|
+
|
|
47
|
+
## Step-by-Step Execution Runbook
|
|
48
|
+
|
|
49
|
+
### Phase 1: Mathematical Modeling & Double-Sided Incentive Structuring
|
|
50
|
+
1. Formulate the Viral Coefficient equation:
|
|
51
|
+
$$K = i \times c$$
|
|
52
|
+
where $i$ is the average number of invitations sent per user, and $c$ is the conversion rate of each invitation into an active user.
|
|
53
|
+
2. Formulate the Viral Cycle Time ($c_t$) minimization target: reducing the time from user signup to sending invitations directly multiplies organic user growth rate.
|
|
54
|
+
3. Structure double-sided reward mechanics: align incentives so both parties win (e.g. "$25 in API credits for you, $25 for your friend upon their first build").
|
|
55
|
+
4. Establish reward qualification thresholds: require referees to achieve a meaningful product action before distributing credits to eliminate bot abuse.
|
|
56
|
+
|
|
57
|
+
### Phase 2: Contextual In-App Trigger Identification
|
|
58
|
+
1. Identify high-satisfaction moments in the product journey to present referral prompts:
|
|
59
|
+
- Immediately after completing a successful build or workflow run.
|
|
60
|
+
- Upon receiving a positive NPS/CSAT score (rating 9 or 10).
|
|
61
|
+
- After saving significant compute hours or achieving milestone productivity goals.
|
|
62
|
+
2. Avoid presenting referral modals during onboarding setup, high-friction configuration tasks, or error states.
|
|
63
|
+
|
|
64
|
+
### Phase 3: Frictionless Share Modal & One-Click Social Intent Implementation
|
|
65
|
+
1. Generate unique, short, human-readable referral codes and URLs (e.g. `https://agents-united.dev/join?ref=alex2026`).
|
|
66
|
+
2. Build responsive referral modal offering:
|
|
67
|
+
- 1-Click "Copy Link" button with instant visual tooltip confirmation.
|
|
68
|
+
- Pre-populated social share intents for Twitter/X, LinkedIn, and WhatsApp.
|
|
69
|
+
- Direct email invitation input box supporting comma-separated teammate invites.
|
|
70
|
+
3. Include real-time reward ledger showing "Pending", "Earned", and "Redeemed" reward statuses.
|
|
71
|
+
|
|
72
|
+
### Phase 4: Fraud Prevention, Attribution Cookies & Ledger Security
|
|
73
|
+
1. Set 30-day first-party referral tracking cookie on landing page visits from referral links.
|
|
74
|
+
2. Implement strict fraud defense guardrails:
|
|
75
|
+
- IP rate-limiting and device fingerprint hashing to detect self-referrals.
|
|
76
|
+
- Domain matching checks: disallow referring users within the same enterprise workspace domain if rewards are personal credits.
|
|
77
|
+
- Hold period: place rewards in pending state for 48 hours to prevent payment chargeback abuse.
|
|
78
|
+
3. Record all credit accruals and redemptions in an immutable ledger database table.
|
|
79
|
+
|
|
80
|
+
### Phase 5: K-Factor Analytics & Viral Funnel Optimization
|
|
81
|
+
1. Instrument telemetry events: `referral_modal_viewed`, `referral_link_copied`, `invite_sent`, `referee_landed`, `referee_activated`, `reward_unlocked`.
|
|
82
|
+
2. Calculate weekly cohort $K$-factor and channel conversion metrics.
|
|
83
|
+
3. Run A/B tests on share modal headlines, reward descriptions, and trigger placement timing.
|
|
84
|
+
4. Compile performance summary at `reports/viral-referral-loops/k-factor-summary.json`.
|
|
85
|
+
5. Commit referral loop components to repository.
|
|
86
|
+
```bash
|
|
87
|
+
git add src/components/referral/ src/services/growth/ docs/viral-referral-loops/
|
|
88
|
+
git commit -m "feat(viral-referral-loops): implement double-sided referral engine and fraud guardrails"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Code & Configuration Exemplars
|
|
92
|
+
|
|
93
|
+
### Exemplar 1: TypeScript Referral Token Generation & Attribution Service
|
|
94
|
+
```typescript
|
|
95
|
+
import crypto from 'node:crypto';
|
|
96
|
+
|
|
97
|
+
export interface ReferralAttribution {
|
|
98
|
+
referrerId: string;
|
|
99
|
+
refereeId: string;
|
|
100
|
+
referralCode: string;
|
|
101
|
+
status: 'pending' | 'qualified' | 'rewarded' | 'flagged';
|
|
102
|
+
createdAt: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function generateReferralCode(userId: string): string {
|
|
106
|
+
const hash = crypto.createHash('sha256').update(userId).digest('hex').slice(0, 8);
|
|
107
|
+
return `AU-${hash.toUpperCase()}`;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function validateReferralLegitimacy(referrerIp: string, refereeIp: string, referrerDomain: string, refereeEmail: string): boolean {
|
|
111
|
+
// Reject identical IP address self-referral attempts
|
|
112
|
+
if (referrerIp === refereeIp && process.env.NODE_ENV === 'production') {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
// Reject internal domain match if corporate domain
|
|
116
|
+
const refereeDomain = refereeEmail.split('@')[1]?.toLowerCase();
|
|
117
|
+
const genericDomains = ['gmail.com', 'yahoo.com', 'outlook.com', 'icloud.com'];
|
|
118
|
+
if (refereeDomain && !genericDomains.includes(refereeDomain) && refereeDomain === referrerDomain.toLowerCase()) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Exemplar 2: TypeScript React Referral Share Modal Component
|
|
126
|
+
```typescript
|
|
127
|
+
import React, { useState } from 'react';
|
|
128
|
+
|
|
129
|
+
export interface ReferralModalProps {
|
|
130
|
+
referralCode: string;
|
|
131
|
+
earnedCreditsUsd: number;
|
|
132
|
+
pendingCount: number;
|
|
133
|
+
isOpen: boolean;
|
|
134
|
+
onClose: () => void;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function ReferralModal({ referralCode, earnedCreditsUsd, pendingCount, isOpen, onClose }: ReferralModalProps): React.JSX.Element | null {
|
|
138
|
+
const [copied, setCopied] = useState(false);
|
|
139
|
+
if (!isOpen) return null;
|
|
140
|
+
|
|
141
|
+
const shareUrl = `https://agents-united.dev/join?ref=${referralCode}`;
|
|
142
|
+
|
|
143
|
+
const handleCopy = () => {
|
|
144
|
+
navigator.clipboard.writeText(shareUrl);
|
|
145
|
+
setCopied(true);
|
|
146
|
+
setTimeout(() => setCopied(false), 2000);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<div className="fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4">
|
|
151
|
+
<div className="bg-white rounded-2xl max-w-md w-full p-6 shadow-2xl">
|
|
152
|
+
<h2 className="text-xl font-bold text-gray-900 mb-2">Give $25, Get $25</h2>
|
|
153
|
+
<p className="text-sm text-gray-600 mb-6">
|
|
154
|
+
Invite teammates or friends. When they execute their first workflow, you both get $25 in compute credits.
|
|
155
|
+
</p>
|
|
156
|
+
<div className="flex items-center gap-2 bg-gray-100 p-2 rounded-lg mb-6">
|
|
157
|
+
<input type="text" readOnly value={shareUrl} className="bg-transparent text-sm w-full outline-none px-2 text-gray-700 font-mono" />
|
|
158
|
+
<button onClick={handleCopy} className="bg-blue-600 hover:bg-blue-700 text-white text-xs font-semibold px-4 py-2 rounded-md transition-colors">
|
|
159
|
+
{copied ? 'Copied!' : 'Copy'}
|
|
160
|
+
</button>
|
|
161
|
+
</div>
|
|
162
|
+
<div className="flex justify-between items-center bg-blue-50 p-4 rounded-xl mb-6">
|
|
163
|
+
<div>
|
|
164
|
+
<div className="text-xs text-blue-700 font-medium">Earned Credits</div>
|
|
165
|
+
<div className="text-xl font-bold text-blue-900">${earnedCreditsUsd}</div>
|
|
166
|
+
</div>
|
|
167
|
+
<div>
|
|
168
|
+
<div className="text-xs text-blue-700 font-medium">Pending Invites</div>
|
|
169
|
+
<div className="text-xl font-bold text-blue-900">{pendingCount}</div>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
<button onClick={onClose} className="w-full text-center text-sm font-medium text-gray-500 hover:text-gray-700 py-2">
|
|
173
|
+
Close
|
|
174
|
+
</button>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Edge Cases & Error Recovery Procedures
|
|
182
|
+
|
|
183
|
+
### Scenario A: Referral Link Clicked by Existing Active User
|
|
184
|
+
1. **Diagnosis**: An existing user clicks an invitation link expecting a bonus credit.
|
|
185
|
+
2. **Recovery Protocol**:
|
|
186
|
+
- Step 1: Detect that the user already has an active account upon landing on the auth page.
|
|
187
|
+
- Step 2: Display polite message explaining that referral credits apply exclusively to new accounts.
|
|
188
|
+
- Step 3: Redirect user to their own referral dashboard to invite others instead.
|
|
189
|
+
|
|
190
|
+
### Scenario B: Referral Attribution Cookie Blocked by Safari ITP or Brave
|
|
191
|
+
1. **Diagnosis**: Browser privacy features wipe 30-day tracking cookie before user finishes signup.
|
|
192
|
+
2. **Recovery Protocol**:
|
|
193
|
+
- Step 1: Provide fallback manual promo code entry box on final signup step.
|
|
194
|
+
- Step 2: Store referral attribution token in server-side session state alongside anonymous visitor ID.
|
|
195
|
+
- Step 3: Re-associate attribution upon signup completion via server-side session matching.
|
|
196
|
+
|
|
197
|
+
## Verification & Validation Checklist
|
|
198
|
+
- [ ] Frontmatter conforms strictly to `author: "agents-united"` and `version: "2.0.0"`.
|
|
199
|
+
- [ ] All 7 mandatory sections present with explicit headers.
|
|
200
|
+
- [ ] Step-by-Step Execution Runbook body contains >= 50 lines.
|
|
201
|
+
- [ ] Viral coefficient $K$-factor and cycle time equations documented.
|
|
202
|
+
- [ ] Fraud defense rules (IP checks, domain validation, hold period) detailed.
|
|
203
|
+
- [ ] Code exemplars provided with valid syntax fencing.
|
|
204
|
+
- [ ] Zero dummy placeholder strings or unpopulated template markers present.
|
|
205
|
+
- [ ] Project build, test suite, and doctor check pass 100% cleanly.
|
|
@@ -1,15 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
name: "Codebase Security & Static Analysis"
|
|
3
|
+
description: "Workflow for executing static code analysis, vulnerability scanning, security audits, and code health assessments."
|
|
4
|
+
bundle: "security-operations"
|
|
5
|
+
estimatedDuration: "30-50m"
|
|
6
|
+
---
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
# Workflow: Codebase Security & Static Analysis
|
|
9
|
+
|
|
10
|
+
## Overview & Scope
|
|
11
|
+
The Analyze workflow enforces codebase security hygiene. It runs static application security testing (SAST), scans for exposed secrets, audits dependency vulnerabilities, and evaluates code complexity.
|
|
12
|
+
|
|
13
|
+
## Execution Flowchart
|
|
14
|
+
```mermaid
|
|
15
|
+
graph TD
|
|
16
|
+
Start([Start Workflow]) --> P1[Phase 1: Context & Reconnaissance]
|
|
17
|
+
P1 --> InputCheck{"Prerequisites & Tools Valid?"}
|
|
18
|
+
InputCheck -->|No| Abort1[Abort & Request Inputs]
|
|
19
|
+
InputCheck -->|Yes| P2[Phase 2: Execution & Orchestration]
|
|
20
|
+
P2 --> Gate1{"Verification Gate: Automated Checks Pass?"}
|
|
21
|
+
Gate1 -->|Fail| Rollback[Execute Automated Rollback Protocol]
|
|
22
|
+
Rollback --> P2
|
|
23
|
+
Gate1 -->|Pass| P3[Phase 3: Verification & Closure]
|
|
24
|
+
P3 --> Gate2{"Final Acceptance Gate Passed?"}
|
|
25
|
+
Gate2 -->|Fail| P3Fix[Remediate Documentation / Artifacts]
|
|
26
|
+
P3Fix --> P3
|
|
27
|
+
Gate2 -->|Pass| Done([Workflow Complete & Logged])
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Required Tool Inputs & Context
|
|
31
|
+
- Source code repository
|
|
32
|
+
- Static security scanning tools (`npm audit`, `snyk`, `semgrep`, `secret-scanner`)
|
|
33
|
+
- Dependency manifest (`package.json`)
|
|
4
34
|
|
|
5
35
|
## Phase 1: Context & Reconnaissance
|
|
6
|
-
-
|
|
7
|
-
-
|
|
36
|
+
- Identify target source directories, configuration files, and external dependencies.
|
|
37
|
+
- Configure SAST rules and vulnerability severity thresholds (Critical, High, Medium, Low).
|
|
38
|
+
- Check scanning tool dependencies.
|
|
8
39
|
|
|
9
40
|
## Phase 2: Execution & Orchestration
|
|
10
|
-
- Execute
|
|
11
|
-
-
|
|
41
|
+
- Execute dependency vulnerability audit (`npm audit`).
|
|
42
|
+
- Run SAST scanners to detect code vulnerabilities (XSS, SQLi, path traversal, hardcoded secrets).
|
|
43
|
+
- Audit code complexity metrics (cyclomatic complexity, maintainability index).
|
|
12
44
|
|
|
13
45
|
## Phase 3: Verification & Closure
|
|
14
|
-
-
|
|
15
|
-
-
|
|
46
|
+
- Classify findings by severity and impact.
|
|
47
|
+
- Generate actionable remediation diffs for identified vulnerabilities.
|
|
48
|
+
- Publish Codebase Security & Static Analysis Report.
|
|
49
|
+
|
|
50
|
+
## Phase Transition Criteria & Deterministic Verification Gates
|
|
51
|
+
| Transition | Prerequisites | Verification Command / Gate | Success Criteria |
|
|
52
|
+
|---|---|---|---|
|
|
53
|
+
| Phase 1 -> Phase 2 | Tool inputs verified & environment ready | `node dist/cli.js doctor` | Doctor health check succeeds with 0 errors |
|
|
54
|
+
| Phase 2 -> Phase 3 | Execution steps complete | `npm audit` | Zero Critical or High severity security vulnerabilities detected |
|
|
55
|
+
| Phase 3 -> Completion | Verification complete & artifacts signed off | `npm run typecheck` | Static type checking passes cleanly |
|
|
56
|
+
|
|
57
|
+
## Validation Checkpoints & Automated Rollback Protocols
|
|
58
|
+
- **Validation Checkpoint 1**: Zero exposed secrets or credentials found in source code.
|
|
59
|
+
- **Validation Checkpoint 2**: Security analysis report includes explicit remediation steps for all findings.
|
|
60
|
+
- **Automated Rollback Protocol**: Block build deployment immediately if Critical severity security vulnerabilities are discovered.
|