Files
Alireza Rezvani e145ac4a1d Dev (#265)
* docs: restructure README.md — 2,539 → 209 lines (#247)

- Cut from 2,539 lines / 73 sections to 209 lines / 18 sections
- Consolidated 4 install methods into one unified section
- Moved all skill details to domain-level READMEs (linked from table)
- Front-loaded value prop and keywords for SEO
- Added POWERFUL tier highlight section
- Added skill-security-auditor showcase section
- Removed stale Q4 2025 roadmap, outdated ROI claims, duplicate content
- Fixed all internal links
- Clean heading hierarchy (H2 for main sections only)

Closes #233

Co-authored-by: Leo <leo@openclaw.ai>

* fix: enhance 5 skills with scripts, references, and Anthropic best practices (#248)

* fix(skill): enhance git-worktree-manager with scripts, references, and Anthropic best practices

* fix(skill): enhance mcp-server-builder with scripts, references, and Anthropic best practices

* fix(skill): enhance changelog-generator with scripts, references, and Anthropic best practices

* fix(skill): enhance ci-cd-pipeline-builder with scripts, references, and Anthropic best practices

* fix(skill): enhance prompt-engineer-toolkit with scripts, references, and Anthropic best practices

* docs: update README, CHANGELOG, and plugin metadata

* fix: correct marketing plugin count, expand thin references

---------

Co-authored-by: Leo <leo@openclaw.ai>

* ci: Add VirusTotal security scan for skills (#252)

* Dev (#231)

* Improve senior-fullstack skill description and workflow validation

- Expand frontmatter description with concrete actions and trigger clauses
- Add validation steps to scaffolding workflow (verify scaffold succeeded)
- Add re-run verification step to audit workflow (confirm P0 fixes)

* chore: sync codex skills symlinks [automated]

* fix(skill): normalize senior-fullstack frontmatter to inline format

Normalize YAML description from block scalar (>) to inline single-line
format matching all other 50+ skills. Align frontmatter trigger phrases
with the body's Trigger Phrases section to eliminate duplication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(ci): add GITHUB_TOKEN to checkout + restore corrupted skill descriptions

- Add token: ${{ secrets.GITHUB_TOKEN }} to actions/checkout@v4 in
  sync-codex-skills.yml so git-auto-commit-action can push back to branch
  (fixes: fatal: could not read Username, exit 128)
- Restore correct description for incident-commander (was: 'Skill from engineering-team')
- Restore correct description for senior-fullstack (was: '>')

* fix(ci): pass PROJECTS_TOKEN to fix automated commits + remove duplicate checkout

Fixes PROJECTS_TOKEN passthrough for git-auto-commit-action and removes duplicate checkout step in pr-issue-auto-close workflow.

* fix(ci): remove stray merge conflict marker in sync-codex-skills.yml (#221)

Co-authored-by: Leo <leo@leo-agent-server>

* fix(ci): fix workflow errors + add OpenClaw support (#222)

* feat: add 20 new practical skills for professional Claude Code users

New skills across 5 categories:

Engineering (12):
- git-worktree-manager: Parallel dev with port isolation & env sync
- ci-cd-pipeline-builder: Generate GitHub Actions/GitLab CI from stack analysis
- mcp-server-builder: Build MCP servers from OpenAPI specs
- changelog-generator: Conventional commits to structured changelogs
- pr-review-expert: Blast radius analysis & security scan for PRs
- api-test-suite-builder: Auto-generate test suites from API routes
- env-secrets-manager: .env management, leak detection, rotation workflows
- database-schema-designer: Requirements to migrations & types
- codebase-onboarding: Auto-generate onboarding docs from codebase
- performance-profiler: Node/Python/Go profiling & optimization
- runbook-generator: Operational runbooks from codebase analysis
- monorepo-navigator: Turborepo/Nx/pnpm workspace management

Engineering Team (2):
- stripe-integration-expert: Subscriptions, webhooks, billing patterns
- email-template-builder: React Email/MJML transactional email systems

Product Team (3):
- saas-scaffolder: Full SaaS project generation from product brief
- landing-page-generator: High-converting landing pages with copy frameworks
- competitive-teardown: Structured competitive product analysis

Business Growth (1):
- contract-and-proposal-writer: Contracts, SOWs, NDAs per jurisdiction

Marketing (1):
- prompt-engineer-toolkit: Systematic prompt development & A/B testing

Designed for daily professional use and commercial distribution.

* chore: sync codex skills symlinks [automated]

* docs: update README with 20 new skills, counts 65→86, new skills section

* docs: add commercial distribution plan (Stan Store + Gumroad)

* docs: rewrite CHANGELOG.md with v2.0.0 release (65 skills, 9 domains) (#226)

* docs: rewrite CHANGELOG.md with v2.0.0 release (65 skills, 9 domains)

- Consolidate 191 commits since v1.0.2 into proper v2.0.0 entry
- Document 12 POWERFUL-tier skills, 37 refactored skills
- Add new domains: business-growth, finance
- Document Codex support and marketplace integration
- Update version history summary table
- Clean up [Unreleased] to only planned work

* docs: add 24 POWERFUL-tier skills to plugin, fix counts to 85 across all docs

- Add engineering-advanced-skills plugin (24 POWERFUL-tier skills) to marketplace.json
- Add 13 missing skills to CHANGELOG v2.0.0 (agent-workflow-designer, api-test-suite-builder,
  changelog-generator, ci-cd-pipeline-builder, codebase-onboarding, database-schema-designer,
  env-secrets-manager, git-worktree-manager, mcp-server-builder, monorepo-navigator,
  performance-profiler, pr-review-expert, runbook-generator)
- Fix skill count: 86→85 (excl sample-skill) across README, CHANGELOG, marketplace.json
- Fix stale 53→85 references in README
- Add engineering-advanced-skills install command to README
- Update marketplace.json version to 2.0.0

---------

Co-authored-by: Leo <leo@openclaw.ai>

* feat: add skill-security-auditor POWERFUL-tier skill (#230)

Security audit and vulnerability scanner for AI agent skills before installation.

Scans for:
- Code execution risks (eval, exec, os.system, subprocess shell injection)
- Data exfiltration (outbound HTTP, credential harvesting, env var extraction)
- Prompt injection in SKILL.md (system override, role hijack, safety bypass)
- Dependency supply chain (typosquatting, unpinned versions, runtime installs)
- File system abuse (boundary violations, binaries, symlinks, hidden files)
- Privilege escalation (sudo, SUID, cron manipulation, shell config writes)
- Obfuscation (base64, hex encoding, chr chains, codecs)

Produces clear PASS/WARN/FAIL verdict with per-finding remediation guidance.
Supports local dirs, git repo URLs, JSON output, strict mode, and CI/CD integration.

Includes:
- scripts/skill_security_auditor.py (1049 lines, zero dependencies)
- references/threat-model.md (complete attack vector documentation)
- SKILL.md with usage guide and report format

Tested against: rag-architect (PASS), agent-designer (PASS), senior-secops (FAIL - correctly flagged eval/exec patterns).

Co-authored-by: Leo <leo@openclaw.ai>

* docs: add skill-security-auditor to marketplace, README, and CHANGELOG

- Add standalone plugin entry for skill-security-auditor in marketplace.json
- Update engineering-advanced-skills plugin description to include it
- Update skill counts: 85→86 across README, CHANGELOG, marketplace
- Add install command to README Quick Install section
- Add to CHANGELOG [Unreleased] section

---------

Co-authored-by: Baptiste Fernandez <fernandez.baptiste1@gmail.com>
Co-authored-by: alirezarezvani <5697919+alirezarezvani@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Leo <leo@leo-agent-server>
Co-authored-by: Leo <leo@openclaw.ai>

* Dev (#249)

* docs: restructure README.md — 2,539 → 209 lines (#247)

- Cut from 2,539 lines / 73 sections to 209 lines / 18 sections
- Consolidated 4 install methods into one unified section
- Moved all skill details to domain-level READMEs (linked from table)
- Front-loaded value prop and keywords for SEO
- Added POWERFUL tier highlight section
- Added skill-security-auditor showcase section
- Removed stale Q4 2025 roadmap, outdated ROI claims, duplicate content
- Fixed all internal links
- Clean heading hierarchy (H2 for main sections only)

Closes #233

Co-authored-by: Leo <leo@openclaw.ai>

* fix: enhance 5 skills with scripts, references, and Anthropic best practices (#248)

* fix(skill): enhance git-worktree-manager with scripts, references, and Anthropic best practices

* fix(skill): enhance mcp-server-builder with scripts, references, and Anthropic best practices

* fix(skill): enhance changelog-generator with scripts, references, and Anthropic best practices

* fix(skill): enhance ci-cd-pipeline-builder with scripts, references, and Anthropic best practices

* fix(skill): enhance prompt-engineer-toolkit with scripts, references, and Anthropic best practices

* docs: update README, CHANGELOG, and plugin metadata

* fix: correct marketing plugin count, expand thin references

---------

Co-authored-by: Leo <leo@openclaw.ai>

---------

Co-authored-by: Leo <leo@openclaw.ai>

* Dev (#250)

* docs: restructure README.md — 2,539 → 209 lines (#247)

- Cut from 2,539 lines / 73 sections to 209 lines / 18 sections
- Consolidated 4 install methods into one unified section
- Moved all skill details to domain-level READMEs (linked from table)
- Front-loaded value prop and keywords for SEO
- Added POWERFUL tier highlight section
- Added skill-security-auditor showcase section
- Removed stale Q4 2025 roadmap, outdated ROI claims, duplicate content
- Fixed all internal links
- Clean heading hierarchy (H2 for main sections only)

Closes #233

Co-authored-by: Leo <leo@openclaw.ai>

* fix: enhance 5 skills with scripts, references, and Anthropic best practices (#248)

* fix(skill): enhance git-worktree-manager with scripts, references, and Anthropic best practices

* fix(skill): enhance mcp-server-builder with scripts, references, and Anthropic best practices

* fix(skill): enhance changelog-generator with scripts, references, and Anthropic best practices

* fix(skill): enhance ci-cd-pipeline-builder with scripts, references, and Anthropic best practices

* fix(skill): enhance prompt-engineer-toolkit with scripts, references, and Anthropic best practices

* docs: update README, CHANGELOG, and plugin metadata

* fix: correct marketing plugin count, expand thin references

---------

Co-authored-by: Leo <leo@openclaw.ai>

---------

Co-authored-by: Leo <leo@openclaw.ai>

* ci: add VirusTotal security scan for skills

- Scans changed skill directories on PRs to dev/main
- Scans all skills on release publish
- Posts scan results as PR comment with analysis links
- Rate-limited to 4 req/min (free tier compatible)
- Appends VirusTotal links to release body on publish

* fix: resolve YAML lint errors in virustotal workflow

- Add document start marker (---)
- Quote 'on' key for truthy lint rule
- Remove trailing spaces
- Break long lines under 160 char limit

---------

Co-authored-by: Baptiste Fernandez <fernandez.baptiste1@gmail.com>
Co-authored-by: alirezarezvani <5697919+alirezarezvani@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Leo <leo@leo-agent-server>
Co-authored-by: Leo <leo@openclaw.ai>

* feat: add playwright-pro plugin — production-grade Playwright testing toolkit (#254)

Complete Claude Code plugin with:
- 9 skills (/pw:init, generate, review, fix, migrate, coverage, testrail, browserstack, report)
- 3 specialized agents (test-architect, test-debugger, migration-planner)
- 55 test case templates across 11 categories (auth, CRUD, checkout, search, forms, dashboard, settings, onboarding, notifications, API, accessibility)
- TestRail MCP server (TypeScript) — 8 tools for bidirectional sync
- BrowserStack MCP server (TypeScript) — 7 tools for cross-browser testing
- Smart hooks (auto-validate tests, auto-detect Playwright projects)
- 6 curated reference docs (golden rules, locators, assertions, fixtures, pitfalls, flaky tests)
- Leverages Claude Code built-ins (/batch, /debug, Explore subagent)
- Zero-config for core features; TestRail/BrowserStack via env vars
- Both TypeScript and JavaScript support throughout

Co-authored-by: Leo <leo@openclaw.ai>

* feat: add playwright-pro to marketplace registry (#256)

- New plugin: playwright-pro (9 skills, 3 agents, 55 templates, 2 MCP servers)
- Install: /plugin install playwright-pro@claude-code-skills
- Total marketplace plugins: 17

Co-authored-by: Leo <leo@openclaw.ai>

* fix: integrate playwright-pro across all platforms (#258)

- Add root SKILL.md for OpenClaw and ClawHub compatibility
- Add to README: Skills Overview table, install section, badge count
- Regenerate .codex/skills-index.json with playwright-pro entry
- Add .codex/skills/playwright-pro symlink for Codex CLI
- Fix YAML frontmatter (single-line description for index parsing)

Platforms verified:
- Claude Code: marketplace.json  (merged in PR #256)
- Codex CLI: symlink + skills-index.json 
- OpenClaw: SKILL.md auto-discovered by install script 
- ClawHub: published as playwright-pro@1.1.0 

Co-authored-by: Leo <leo@openclaw.ai>

* docs: update CLAUDE.md — reflect 87 skills across 9 domains

Sync CLAUDE.md with actual repository state: add Engineering POWERFUL tier
(25 skills), update all skill counts, add plugin registry references, and
replace stale sprint section with v2.0.0 version info.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: mention Claude Code in project description

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add self-improving-agent plugin — auto-memory curation for Claude Code (#260)

New plugin: engineering-team/self-improving-agent/
- 5 skills: /si:review, /si:promote, /si:extract, /si:status, /si:remember
- 2 agents: memory-analyst, skill-extractor
- 1 hook: PostToolUse error capture (zero overhead on success)
- 3 reference docs: memory architecture, promotion rules, rules directory patterns
- 2 templates: rule template, skill template
- 20 files, 1,829 lines

Integrates natively with Claude Code's auto-memory (v2.1.32+).
Reads from ~/.claude/projects/<path>/memory/ — no duplicate storage.
Promotes proven patterns from MEMORY.md to CLAUDE.md or .claude/rules/.

Also:
- Added to marketplace.json (18 plugins total)
- Added to README (Skills Overview + install section)
- Updated badge count to 88+
- Regenerated .codex/skills-index.json + symlink

Co-authored-by: Leo <leo@openclaw.ai>

* feat: C-Suite expansion — 8 new executive advisory roles (2→10) (#264)

* feat: C-Suite expansion — 8 new executive advisory roles

Add COO, CPO, CMO, CFO, CRO, CISO, CHRO advisors and Executive Mentor.
Expands C-level advisory from 2 to 10 roles with 74 total files.

Each role includes:
- SKILL.md (lean, <5KB, ~1200 tokens for context efficiency)
- Reference docs (loaded on demand, not at startup)
- Python analysis scripts (stdlib only, runnable CLI)

Executive Mentor features /em: slash commands (challenge, board-prep,
hard-call, stress-test, postmortem) with devil's advocate agent.

21 Python tools, 24 reference frameworks, 28,379 total lines.
All SKILL.md files combined: ~17K tokens (8.5% of 200K context window).

Badge: 88 → 116 skills

* feat: C-Suite orchestration layer + 18 complementary skills

ORCHESTRATION (new):
- cs-onboard: Founder interview → company-context.md
- chief-of-staff: Routing, synthesis, inter-agent orchestration
- board-meeting: 6-phase multi-agent deliberation protocol
- decision-logger: Two-layer memory (raw transcripts + approved decisions)
- agent-protocol: Inter-agent invocation with loop prevention
- context-engine: Company context loading + anonymization

CROSS-CUTTING CAPABILITIES (new):
- board-deck-builder: Board/investor update assembly
- scenario-war-room: Cascading multi-variable what-if modeling
- competitive-intel: Systematic competitor tracking + battlecards
- org-health-diagnostic: Cross-functional health scoring (8 dimensions)
- ma-playbook: M&A strategy (acquiring + being acquired)
- intl-expansion: International market entry frameworks

CULTURE & COLLABORATION (new):
- culture-architect: Values → behaviors, culture code, health assessment
- company-os: EOS/Scaling Up operating system selection + implementation
- founder-coach: Founder development, delegation, blind spots
- strategic-alignment: Strategy cascade, silo detection, alignment scoring
- change-management: ADKAR-based change rollout framework
- internal-narrative: One story across employees/investors/customers

UPGRADES TO EXISTING ROLES:
- All 10 roles get reasoning technique directives
- All 10 roles get company-context.md integration
- All 10 roles get board meeting isolation rules
- CEO gets stage-adaptive temporal horizons (seed→C)

Key design decisions:
- Two-layer memory prevents hallucinated consensus from rejected ideas
- Phase 2 isolation: agents think independently before cross-examination
- Executive Mentor (The Critic) sees all perspectives, others don't
- 25 Python tools total (stdlib only, no dependencies)

52 new files, 10 modified, 10,862 new lines.
Total C-suite ecosystem: 134 files, 39,131 lines.

* fix: connect all dots — Chief of Staff routes to all 28 skills

- Added complementary skills registry to routing-matrix.md
- Chief of Staff SKILL.md now lists all 28 skills in ecosystem
- Added integration tables to scenario-war-room and competitive-intel
- Badge: 116 → 134 skills
- README: C-Level Advisory count 10 → 28

Quality audit passed:
 All 10 roles: company-context, reasoning, isolation, invocation
 All 6 phases in board meeting
 Two-layer memory with DO_NOT_RESURFACE
 Loop prevention (no self-invoke, max depth 2, no circular)
 All /em: commands present
 All complementary skills cross-reference roles
 Chief of Staff routes to every skill in ecosystem

* refactor: CEO + CTO advisors upgraded to C-suite parity

Both roles now match the structural standard of all new roles:
- CEO: 11.7KB → 6.8KB SKILL.md (heavy content stays in references)
- CTO: 10KB → 7.2KB SKILL.md (heavy content stays in references)

Added to both:
- Integration table (who they work with and when)
- Key diagnostic questions
- Structured metrics dashboard table
- Consistent section ordering (Keywords → Quick Start → Responsibilities → Questions → Metrics → Red Flags → Integration → Reasoning → Context)

CEO additions:
- Stage-adaptive temporal horizons (seed=3m/6m/12m → B+=1y/3y/5y)
- Cross-references to culture-architect and board-deck-builder

CTO additions:
- Key Questions section (7 diagnostic questions)
- Structured metrics table (DORA + debt + team + architecture + cost)
- Cross-references to all peer roles

All 10 roles now pass structural parity:  Keywords  QuickStart  Questions  Metrics  RedFlags  Integration

* feat: add proactive triggers + output artifacts to all 10 roles

Every C-suite role now specifies:
- Proactive Triggers: 'surface these without being asked' — context-driven
  early warnings that make advisors proactive, not reactive
- Output Artifacts: concrete deliverables per request type (what you ask →
  what you get)

CEO: runway alerts, board prep triggers, strategy review nudges
CTO: deploy frequency monitoring, tech debt thresholds, bus factor flags
COO: blocker detection, scaling threshold warnings, cadence gaps
CPO: retention curve monitoring, portfolio dog detection, research gaps
CMO: CAC trend monitoring, positioning gaps, budget staleness
CFO: runway forecasting, burn multiple alerts, scenario planning gaps
CRO: NRR monitoring, pipeline coverage, pricing review triggers
CISO: audit overdue alerts, compliance gaps, vendor risk
CHRO: retention risk, comp band gaps, org scaling thresholds
Executive Mentor: board prep triggers, groupthink detection, hard call surfacing

This transforms the C-suite from reactive advisors into proactive partners.

* feat: User Communication Standard — structured output for all roles

Defines 3 output formats in agent-protocol/SKILL.md:

1. Standard Output: Bottom Line → What → Why → How to Act → Risks → Your Decision
2. Proactive Alert: What I Noticed → Why It Matters → Action → Urgency (🔴🟡)
3. Board Meeting: Decision Required → Perspectives → Agree/Disagree → Critic → Action Items

10 non-negotiable rules:
- Bottom line first, always
- Results and decisions only (no process narration)
- What + Why + How for every finding
- Actions have owners and deadlines ('we should consider' is banned)
- Decisions framed as options with trade-offs
- Founder is the highest authority — roles recommend, founder decides
- Risks are concrete (if X → Y, costs $Z)
- Max 5 bullets per section
- No jargon without explanation
- Silence over fabricated updates

All 10 roles reference this standard.
Chief of Staff enforces it as a quality gate.
Board meeting Phase 4 uses the Board Meeting Output format.

* feat: Internal Quality Loop — verification before delivery

No role presents to the founder without passing verification:

Step 1: Self-Verification (every role, every time)
  - Source attribution: where did each data point come from?
  - Assumption audit: [VERIFIED] vs [ASSUMED] tags on every finding
  - Confidence scoring: 🟢 high / 🟡 medium / 🔴 low per finding
  - Contradiction check against company-context + decision log
  - 'So what?' test: every finding needs a business consequence

Step 2: Peer Verification (cross-functional)
  - Financial claims → CFO validates math
  - Revenue projections → CRO validates pipeline backing
  - Technical feasibility → CTO validates
  - People/hiring impact → CHRO validates
  - Skip for single-domain, low-stakes questions

Step 3: Critic Pre-Screen (high-stakes only)
  - Irreversible decisions, >20% runway impact, strategy changes
  - Executive Mentor finds weakest point before founder sees it
  - Suspicious consensus triggers mandatory pre-screen

Step 4: Course Correction (after founder feedback)
  - Approve → log + assign actions
  - Modify → re-verify changed parts
  - Reject → DO_NOT_RESURFACE + learn why
  - 30/60/90 day post-decision review

Board meeting contributions now require self-verified format with
confidence tags and source attribution on every finding.

* fix: resolve PR review issues 1, 4, and minor observation

Issue 1: c-level-advisor/CLAUDE.md — completely rewritten
  - Was: 2 skills (CEO, CTO only), dated Nov 2025
  - Now: full 28-skill ecosystem map with architecture diagram,
    all roles/orchestration/cross-cutting/culture skills listed,
    design decisions, integration with other domains

Issue 4: Root CLAUDE.md — updated all stale counts
  - 87 → 134 skills across all 3 references
  - C-Level: 2 → 33 (10 roles + 5 mentor commands + 18 complementary)
  - Tool count: 160+ → 185+
  - Reference count: 200+ → 250+

Minor observation: Documented plugin.json convention
  - Explained in c-level-advisor/CLAUDE.md that only executive-mentor
    has plugin.json because only it has slash commands (/em: namespace)
  - Other skills are invoked by name through Chief of Staff or directly

Also fixed: README.md 88+ → 134 in two places (first line + skills section)

* fix: update all plugin/index registrations for 28-skill C-suite

1. c-level-advisor/.claude-plugin/plugin.json — v2.0.0
   - Was: 2 skills, generic description
   - Now: all 28 skills listed with descriptions, all 25 scripts,
     namespace 'cs', full ecosystem description

2. .codex/skills-index.json — added 18 complementary skills
   - Was: 10 roles only
   - Now: 28 total c-level entries (10 roles + 6 orchestration +
     6 cross-cutting + 6 culture)
   - Each with full description for skill discovery

3. .claude-plugin/marketplace.json — updated c-level-skills entry
   - Was: generic 2-skill description
   - Now: v2.0.0, full 28-skill ecosystem description,
     skills_count: 28, scripts_count: 25

* feat: add root SKILL.md for c-level-advisor ClawHub package

---------

Co-authored-by: Leo <leo@openclaw.ai>

* chore: sync codex skills symlinks [automated]

---------

Co-authored-by: Leo <leo@openclaw.ai>
Co-authored-by: Baptiste Fernandez <fernandez.baptiste1@gmail.com>
Co-authored-by: alirezarezvani <5697919+alirezarezvani@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Leo <leo@leo-agent-server>
2026-03-06 01:35:45 +01:00

548 lines
20 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
"""
Stakeholder Mapper — Executive Mentor Tool
Maps stakeholders by influence and alignment.
Identifies: champions, blockers, swing votes, and hidden risks.
Outputs: stakeholder grid with engagement strategy per quadrant.
Usage:
python stakeholder_mapper.py # Run with sample data
python stakeholder_mapper.py --interactive # Interactive mode
python stakeholder_mapper.py --file data.json # Load from JSON file
JSON format:
{
"initiative": "Name of the decision or initiative",
"stakeholders": [
{
"name": "Person/Group Name",
"role": "Their role or title",
"influence": 8, // 110: how much power they have over outcome
"alignment": 3, // 110: how supportive they are (10=champion, 1=blocker)
"interest": 7, // 110: how interested/engaged they are
"notes": "Optional context — what drives them, hidden concerns, relationships"
}
]
}
"""
import json
import sys
import argparse
from typing import List, Dict, Tuple, Optional
# ─────────────────────────────────────────────────────
# Quadrant classification
# ─────────────────────────────────────────────────────
def classify_stakeholder(influence: float, alignment: float) -> Dict:
"""
Classify into strategic quadrant based on influence and alignment.
Quadrants:
- Champions (high influence, high alignment): Your most valuable assets
- Blockers (high influence, low alignment): Your biggest risks
- Supporters (low influence, high alignment): Useful but less critical
- Bystanders (low influence, low alignment): Monitor, low priority
- Swing Votes (medium influence, medium alignment): Key to persuade
"""
mid_influence = 5.5
mid_alignment = 5.5
# Special case: swing votes — medium on both dimensions
if 4 <= influence <= 7 and 4 <= alignment <= 7:
return {
"quadrant": "Swing Vote",
"symbol": "",
"priority": "HIGH",
"strategy": "Persuade — understand concerns, address directly, build relationship"
}
if influence >= mid_influence and alignment >= mid_alignment:
return {
"quadrant": "Champion",
"symbol": "",
"priority": "HIGH",
"strategy": "Leverage — activate them as advocates, give them a role in the initiative"
}
elif influence >= mid_influence and alignment < mid_alignment:
return {
"quadrant": "Blocker",
"symbol": "",
"priority": "CRITICAL",
"strategy": "Address — understand their specific objections, find common ground or neutralize"
}
elif influence < mid_influence and alignment >= mid_alignment:
return {
"quadrant": "Supporter",
"symbol": "",
"priority": "MEDIUM",
"strategy": "Maintain — keep informed and engaged, potentially increase their influence"
}
else:
return {
"quadrant": "Bystander",
"symbol": "·",
"priority": "LOW",
"strategy": "Monitor — minimal investment, keep informed with standard comms"
}
def risk_flags(stakeholder: Dict) -> List[str]:
"""Identify specific risk signals for a stakeholder."""
flags = []
influence = stakeholder["influence"]
alignment = stakeholder["alignment"]
interest = stakeholder.get("interest", 5)
if influence >= 7 and alignment <= 3:
flags.append("🔴 HIGH-POWER BLOCKER — can kill this initiative")
if influence >= 7 and alignment <= 5 and interest >= 7:
flags.append("🟡 ENGAGED SKEPTIC — high influence, paying close attention, not convinced")
if alignment <= 4 and interest >= 8:
flags.append("🟡 ACTIVE OPPOSITION — low alignment but highly engaged — may mobilize others")
if influence >= 6 and alignment >= 7 and interest <= 3:
flags.append("🟡 DISENGAGED CHAMPION — strong supporter but not paying attention — needs activation")
if influence >= 5 and 4 <= alignment <= 6:
flags.append("⚡ PERSUADABLE — medium influence, genuinely undecided — high ROI to engage")
return flags
# ─────────────────────────────────────────────────────
# Analysis
# ─────────────────────────────────────────────────────
def calculate_overall_alignment(stakeholders: List[Dict]) -> Dict:
"""Calculate weighted average alignment (weighted by influence)."""
if not stakeholders:
return {"score": 0, "verdict": "No data"}
total_influence = sum(s["influence"] for s in stakeholders)
if total_influence == 0:
return {"score": 0, "verdict": "No influence"}
weighted_alignment = sum(
s["alignment"] * s["influence"] for s in stakeholders
) / total_influence
if weighted_alignment >= 7:
verdict = "FAVORABLE — strong support among influential stakeholders"
elif weighted_alignment >= 5:
verdict = "MIXED — significant opposition needs to be addressed"
else:
verdict = "UNFAVORABLE — initiative faces significant headwinds"
return {
"score": round(weighted_alignment, 2),
"verdict": verdict
}
def find_critical_path(stakeholders: List[Dict]) -> List[Dict]:
"""
Identify the minimal set of stakeholders whose alignment is critical.
These are high-influence stakeholders — their position determines the outcome.
"""
high_influence = [s for s in stakeholders if s["influence"] >= 7]
return sorted(high_influence, key=lambda x: x["influence"], reverse=True)
def engagement_sequencing(stakeholders: List[Dict]) -> List[Dict]:
"""
Recommend engagement sequence.
Order: Fix blockers → Activate champions → Persuade swing votes → Maintain rest.
"""
classified = []
for s in stakeholders:
cls = classify_stakeholder(s["influence"], s["alignment"])
classified.append({**s, **cls})
# Sort by engagement priority
priority_order = {"CRITICAL": 0, "HIGH": 1, "MEDIUM": 2, "LOW": 3}
classified.sort(key=lambda x: (priority_order[x["priority"]], -x["influence"]))
return classified
# ─────────────────────────────────────────────────────
# ASCII grid visualization
# ─────────────────────────────────────────────────────
def render_grid(stakeholders: List[Dict], width: int = 60) -> str:
"""
Render a 2D influence vs alignment grid with stakeholder positions.
Y-axis: Influence (top = high)
X-axis: Alignment (left = low, right = high)
"""
rows = 10
cols = 20
grid = [[' ' for _ in range(cols)] for _ in range(rows)]
for s in stakeholders:
influence = s["influence"]
alignment = s["alignment"]
# Map scores 110 to grid coordinates
col = int((alignment - 1) / 9 * (cols - 1))
row = rows - 1 - int((influence - 1) / 9 * (rows - 1))
col = max(0, min(cols - 1, col))
row = max(0, min(rows - 1, row))
initial = s["name"][0].upper()
if grid[row][col] == ' ':
grid[row][col] = initial
else:
grid[row][col] = '+' # Overlap
lines = []
lines.append(" STAKEHOLDER MAP (Influence ↑ | Alignment →)")
lines.append("")
lines.append(f" HIGH ┌{''*cols}")
for i, row in enumerate(grid):
if i == rows // 2:
prefix = " INFL "
else:
prefix = " "
lines.append(f"{prefix}{''.join(row)}")
lines.append(f" LOW └{''*cols}")
lines.append(f" {'BLOCKER':<12} {'SWING':<8} CHAMPION")
lines.append(f" Low alignment High alignment")
lines.append("")
# Legend
lines.append(" Legend (initials):")
for s in stakeholders:
cls = classify_stakeholder(s["influence"], s["alignment"])
lines.append(f" {s['name'][0].upper()} = {s['name']} ({cls['symbol']} {cls['quadrant']})")
return "\n".join(lines)
# ─────────────────────────────────────────────────────
# Output formatting
# ─────────────────────────────────────────────────────
def hr(char="", width=65):
return char * width
def print_report(data: Dict):
initiative = data.get("initiative", "Unnamed Initiative")
stakeholders = data["stakeholders"]
# Validate and fill defaults
for s in stakeholders:
s.setdefault("interest", 5)
s.setdefault("notes", "")
s["influence"] = max(1, min(10, float(s["influence"])))
s["alignment"] = max(1, min(10, float(s["alignment"])))
s["interest"] = max(1, min(10, float(s["interest"])))
print()
print(hr(""))
print(f" STAKEHOLDER ANALYSIS")
print(f" {initiative}")
print(hr(""))
# Overall assessment
overall = calculate_overall_alignment(stakeholders)
print()
print("OVERALL ASSESSMENT")
print(hr())
print(f" Weighted alignment score: {overall['score']}/10")
print(f" Verdict: {overall['verdict']}")
# Grid visualization
print()
print(hr())
print(render_grid(stakeholders))
# Stakeholder profiles by quadrant
sequenced = engagement_sequencing(stakeholders)
# Group by quadrant
quadrants = {}
for s in sequenced:
q = s["quadrant"]
if q not in quadrants:
quadrants[q] = []
quadrants[q].append(s)
quadrant_order = ["Blocker", "Swing Vote", "Champion", "Supporter", "Bystander"]
print()
print("STAKEHOLDER PROFILES")
print(hr())
for q_name in quadrant_order:
if q_name not in quadrants:
continue
group = quadrants[q_name]
first = group[0]
print()
print(f" {first['symbol']} {q_name.upper()}S ({len(group)} stakeholder{'s' if len(group)>1 else ''})")
print(f" Strategy: {first['strategy']}")
print()
for s in group:
cls = classify_stakeholder(s["influence"], s["alignment"])
flags = risk_flags(s)
print(f" {s['name']}")
print(f" Role: {s.get('role', 'Not specified')}")
print(f" Influence: {''*int(s['influence']//2)}{''*(5-int(s['influence']//2))} {s['influence']:.0f}/10 "
f"Alignment: {''*int(s['alignment']//2)}{''*(5-int(s['alignment']//2))} {s['alignment']:.0f}/10 "
f"Interest: {''*int(s['interest']//2)}{''*(5-int(s['interest']//2))} {s['interest']:.0f}/10")
if flags:
for flag in flags:
print(f" {flag}")
if s.get("notes"):
print(f" Notes: {s['notes']}")
print()
# Engagement plan
print()
print("ENGAGEMENT PLAN (sequenced by priority)")
print(hr())
print()
print(f" {'#':<3} {'Name':<22} {'Quadrant':<14} {'Priority':<10} {'First Action'}")
print(f" {hr('-', 63)}")
actions = {
"Blocker": "Schedule 1:1 — understand specific objections",
"Swing Vote": "Coffee or informal conversation — listen first",
"Champion": "Brief them on the initiative — give them a role",
"Supporter": "Keep informed — monthly update or email",
"Bystander": "Include in standard comms only"
}
for i, s in enumerate(sequenced, 1):
action = actions.get(s["quadrant"], "Maintain standard communication")
print(f" {i:<3} {s['name']:<22} {s['quadrant']:<14} {s['priority']:<10} {action}")
# Risk summary
print()
print("RISK SUMMARY")
print(hr())
critical_path = find_critical_path(stakeholders)
if critical_path:
print()
print(" High-influence stakeholders (outcome depends on these):")
for s in critical_path:
cls = classify_stakeholder(s["influence"], s["alignment"])
alignment_label = "CHAMPION" if s["alignment"] >= 7 else "BLOCKER" if s["alignment"] <= 4 else "UNDECIDED"
print(f" {cls['symbol']} {s['name']:<25} influence {s['influence']:.0f}/10 → {alignment_label}")
# All risk flags
all_flags = []
for s in stakeholders:
flags = risk_flags(s)
for flag in flags:
all_flags.append((s["name"], flag))
if all_flags:
print()
print(" Risk flags:")
for name, flag in all_flags:
print(f" [{name}] {flag}")
print()
print(hr(""))
print()
# ─────────────────────────────────────────────────────
# Interactive mode
# ─────────────────────────────────────────────────────
def interactive_mode():
print()
print(hr(""))
print(" STAKEHOLDER MAPPER — Interactive Mode")
print(hr(""))
data = {}
data["initiative"] = input("\nWhat initiative or decision are you mapping?\n> ").strip()
print("\nAdd stakeholders one at a time. Empty name to finish.")
print("Scores: 1=low, 10=high")
print()
stakeholders = []
while True:
name = input(f"Stakeholder {len(stakeholders)+1} name (or ENTER to finish): ").strip()
if not name:
if len(stakeholders) < 1:
print(" Need at least 1 stakeholder.")
continue
break
role = input(f" Role/title: ").strip()
def get_score(prompt, default=5):
while True:
s = input(f" {prompt} (110, default {default}): ").strip()
if not s:
return float(default)
try:
v = float(s)
if 1 <= v <= 10:
return v
print(" Must be 110")
except ValueError:
print(" Enter a number")
influence = get_score("Influence (power over this decision)")
alignment = get_score("Alignment (1=opposed, 10=champion)")
interest = get_score("Interest level (how engaged are they)")
notes = input(f" Notes (optional): ").strip()
stakeholders.append({
"name": name,
"role": role,
"influence": influence,
"alignment": alignment,
"interest": interest,
"notes": notes
})
print()
data["stakeholders"] = stakeholders
print_report(data)
# ─────────────────────────────────────────────────────
# Sample data
# ─────────────────────────────────────────────────────
SAMPLE_DATA = {
"initiative": "Migrate from monolith to microservices (18-month program)",
"stakeholders": [
{
"name": "Sarah Chen (CTO)",
"role": "Chief Technology Officer",
"influence": 10,
"alignment": 9,
"interest": 9,
"notes": "Driving force behind the initiative. Will fund and protect the team."
},
{
"name": "Marcus Webb (CFO)",
"role": "Chief Financial Officer",
"influence": 9,
"alignment": 3,
"interest": 6,
"notes": "Concerned about 18-month cost with no visible revenue return. Has budget veto."
},
{
"name": "Priya Agarwal (VP Eng)",
"role": "VP Engineering",
"influence": 8,
"alignment": 7,
"interest": 8,
"notes": "Supportive in principle, worried about team bandwidth alongside feature delivery."
},
{
"name": "Tom Briggs (VP Product)",
"role": "VP Product",
"influence": 7,
"alignment": 4,
"interest": 5,
"notes": "Concerned about roadmap slowdown. Hasn't been in the architecture discussions."
},
{
"name": "Elena Park (CEO)",
"role": "Chief Executive Officer",
"influence": 10,
"alignment": 6,
"interest": 4,
"notes": "Trusts the CTO but will back out if CFO and VP Product both push back hard."
},
{
"name": "Raj Patel (Lead Arch)",
"role": "Lead Architect",
"influence": 6,
"alignment": 10,
"interest": 10,
"notes": "Deep technical champion. Has proposed detailed migration plan."
},
{
"name": "Dev Team Leads (x4)",
"role": "Team Leads",
"influence": 5,
"alignment": 6,
"interest": 7,
"notes": "Mixed. Some excited, some worried about learning curve. Middle ground."
},
{
"name": "Board (investor reps)",
"role": "Board Directors",
"influence": 9,
"alignment": 5,
"interest": 3,
"notes": "Not paying attention unless CFO raises flags. Could become blockers if CFO escalates."
}
]
}
# ─────────────────────────────────────────────────────
# Main
# ─────────────────────────────────────────────────────
def main():
parser = argparse.ArgumentParser(
description="Stakeholder Mapper — influence, alignment, and engagement strategy"
)
parser.add_argument(
"--interactive", "-i",
action="store_true",
help="Interactive mode: enter stakeholder data manually"
)
parser.add_argument(
"--file", "-f",
type=str,
help="Load stakeholder data from JSON file"
)
parser.add_argument(
"--sample",
action="store_true",
help="Print sample JSON structure and exit"
)
args = parser.parse_args()
if args.sample:
print(json.dumps(SAMPLE_DATA, indent=2))
return
if args.interactive:
interactive_mode()
return
if args.file:
try:
with open(args.file) as f:
data = json.load(f)
print_report(data)
except FileNotFoundError:
print(f"Error: File '{args.file}' not found.")
sys.exit(1)
except json.JSONDecodeError as e:
print(f"Error: Invalid JSON in '{args.file}': {e}")
sys.exit(1)
return
# Default: sample data
print()
print("Running with sample data. Use --interactive for custom input or --file for JSON.")
print_report(SAMPLE_DATA)
if __name__ == "__main__":
main()