Marketing Psychology
nexu-io/open-design
Apply psychological principles and behavioral science to copy and design.
Political psychology, cognitive biases, group dynamics, leadership analysis, decision-making patterns for Swedish political intelligence
$ npx skills add Hack23/cia --skill behavioral-analysis -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Hack23/cia behavioral-analysis --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/behavioral-analysis .claude/skills/behavioral-analysis && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "behavioral-analysis" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/behavioral-analysis into .claude/skills/behavioral-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "behavioral-analysis", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/Hack23/cia/tree/master/.github/skills/behavioral-analysisType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add Hack23/cia --skill behavioral-analysis -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Hack23/cia behavioral-analysis --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.github/skills/behavioral-analysis .agents/skills/behavioral-analysis && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "behavioral-analysis" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/behavioral-analysis into .agents/skills/behavioral-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "behavioral-analysis", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Hack23/cia --skill behavioral-analysis -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Hack23/cia behavioral-analysis --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.github/skills/behavioral-analysis .cursor/skills/behavioral-analysis && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "behavioral-analysis" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/behavioral-analysis into .cursor/skills/behavioral-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "behavioral-analysis", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/Hack23/cia.git --path .github/skills/behavioral-analysis--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add Hack23/cia --skill behavioral-analysis -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Hack23/cia behavioral-analysis --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.github/skills/behavioral-analysis .gemini/skills/behavioral-analysis && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "behavioral-analysis" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/behavioral-analysis into .gemini/skills/behavioral-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "behavioral-analysis", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install Hack23/cia behavioral-analysisInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add Hack23/cia --skill behavioral-analysis -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .github/skills && cp -r skills-src/.github/skills/behavioral-analysis .github/skills/behavioral-analysis && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "behavioral-analysis" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/behavioral-analysis into .github/skills/behavioral-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "behavioral-analysis", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Hack23/cia --skill behavioral-analysis -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install Hack23/cia behavioral-analysis --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.github/skills/behavioral-analysis .opencode/skills/behavioral-analysis && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "behavioral-analysis" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/behavioral-analysis into .opencode/skills/behavioral-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "behavioral-analysis", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
behavioral-analysisPolitical psychology, cognitive biases, group dynamics, leadership analysis, decision-making patterns for Swedish political intelligence
Behavioral Analysis is an agent skill from Hack23/cia. Political psychology, cognitive biases, group dynamics, leadership analysis, decision-making patterns for Swedish political intelligence
Its SKILL.md is about 10k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
The repository describes itself as: Citizen Intelligence Agency. Open-source intelligence platform analyzing Swedish political activities using AI and data visualization. Tracks politicians, government… The licence is Apache-2.0.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit bbed538. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are java, python, mermaid and sql).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Behavioral Analysis loads about 10k tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 962 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from Hack23/cia at commit bbed538, republished under its Apache-2.0 licence (© Hack23). 962 words, ~10,011 tokens.
.claude/skills/behavioral-analysis/SKILL.md (or your agent's skills folder).This skill provides comprehensive behavioral analysis methodologies for understanding political decision-making, cognitive patterns, and psychological dynamics within the Swedish Parliament. It combines political psychology research with OSINT intelligence to identify behavioral indicators, predict policy positions, and assess leadership effectiveness through evidence-based analysis of voting patterns, speech behavior, and collaboration networks.
Apply this skill when:
Do NOT use for:
The CIA platform analyzes five core behavioral dimensions to create comprehensive political profiles:
graph TB
subgraph "Behavioral Intelligence Collection"
A1["🗳️ Voting Behavior<br/>3.5M+ votes analyzed<br/>Deviation tracking"]
A2["👥 Social Networks<br/>Collaboration patterns<br/>Influence metrics"]
A3["📄 Productivity Signals<br/>Document authorship<br/>Committee activity"]
A4["🎤 Communication Style<br/>Speech analysis<br/>Rhetoric patterns"]
A5["⏱️ Temporal Patterns<br/>Attendance trends<br/>Engagement cycles"]
end
subgraph "Psychological Analysis"
A1 --> B1[Decision-Making Analysis]
A2 --> B2[Group Dynamics Assessment]
A3 --> B3[Motivation Evaluation]
A4 --> B4[Leadership Style Profiling]
A5 --> B5[Behavioral Consistency Check]
end
subgraph "Cognitive Bias Detection"
B1 --> C1{Confirmation Bias}
B2 --> C2{Groupthink}
B3 --> C3{Status Quo Bias}
B4 --> C4{Authority Bias}
B5 --> C5{Recency Bias}
end
subgraph "Intelligence Product"
C1 & C2 & C3 & C4 & C5 --> D["🧠 Behavioral Profile"]
D --> E[Predictive Insights]
D --> F[Risk Indicators]
D --> G[Leadership Assessment]
end
style A1 fill:#e1f5ff
style A2 fill:#e1f5ff
style A3 fill:#e1f5ff
style A4 fill:#e1f5ff
style A5 fill:#e1f5ff
style D fill:#ffe6cc
style E fill:#ccffcc
style F fill:#ffcccc
style G fill:#fff9ccPolitical psychologists recognize voting deviation as a key indicator of cognitive dissonance - when a politician's personal beliefs conflict with party expectations. The CIA platform tracks this through multi-dimensional analysis.
Database Views:
view_riksdagen_vote_data_ballot_politician_summary_daily - Daily voting patternsview_riksdagen_politician_ballot_summary - Aggregated voting statisticsview_politician_behavioral_trends - Long-term behavioral trendsview_riksdagen_politician_decision_pattern - Decision pattern classification@Component
public class PartyConformityAnalyzer {
/**
* Analyzes voting deviation patterns to identify cognitive dissonance.
*
* High deviation indicates:
* - Internal conflict with party platform
* - Constituency pressure overriding party discipline
* - Personal ideology asserting independence
* - Strategic positioning for leadership
*/
@Transactional(readOnly = true)
public PartyConformityProfile analyzeConformity(String politicianId, String partyId) {
String sql = """
SELECT
p.person_id,
p.first_name || ' ' || p.last_name as name,
p.party as current_party,
vbs.total_votes,
vbs.won_votes,
vbs.lost_votes,
vbs.rebel_votes,
vbs.avg_vote_win_rate,
vbs.vote_effectiveness_score,
ROUND(100.0 * vbs.rebel_votes / NULLIF(vbs.total_votes, 0), 2) as deviation_rate,
-- Behavioral indicators
CASE
WHEN vbs.rebel_votes::float / NULLIF(vbs.total_votes, 0) < 0.02 THEN 'CONFORMIST'
WHEN vbs.rebel_votes::float / NULLIF(vbs.total_votes, 0) < 0.05 THEN 'MODERATE'
WHEN vbs.rebel_votes::float / NULLIF(vbs.total_votes, 0) < 0.10 THEN 'INDEPENDENT'
ELSE 'MAVERICK'
END as conformity_type,
-- Cognitive dissonance indicators
CASE
WHEN vbs.rebel_votes > 50 AND vbs.rebel_votes::float / vbs.total_votes > 0.10
THEN 'HIGH_DISSONANCE'
WHEN vbs.rebel_votes > 20 AND vbs.rebel_votes::float / vbs.total_votes > 0.05
THEN 'MODERATE_DISSONANCE'
ELSE 'LOW_DISSONANCE'
END as dissonance_level
FROM view_riksdagen_politician p
JOIN view_riksdagen_politician_ballot_summary vbs ON p.person_id = vbs.person_id
WHERE p.person_id = :politicianId
AND p.party = :partyId
""";
return jdbcTemplate.queryForObject(sql, PartyConformityProfile.class,
Map.of("politicianId", politicianId, "partyId", partyId));
}
}| Conformity Type | Deviation Rate | Behavioral Indicators | Strategic Implications |
|---|---|---|---|
| CONFORMIST | < 2% | Strong party loyalty, risk-averse, hierarchical mindset | Safe coalition partner, reliable vote |
| MODERATE | 2-5% | Balanced independence, calculated risks | Negotiable on key issues |
| INDEPENDENT | 5-10% | Constituency-driven, personal ideology | Swing vote potential |
| MAVERICK | > 10% | Highly independent, ideological purity | Unpredictable, high-risk alliance |
Political committees can develop echo chambers where dissenting views are suppressed. The CIA platform identifies these through collaboration pattern analysis.
import pandas as pd
import networkx as nx
from typing import Dict, List, Tuple
class EchoChamberDetector:
"""
Detects echo chambers in parliamentary committees using network analysis.
Indicators of echo chambers:
- High internal connectivity, low external bridges
- Ideological homogeneity exceeding party baseline
- Resistance to cross-party collaboration
- Information isolation from opposing viewpoints
"""
def analyze_committee_network(self, committee_id: str) -> Dict:
"""
Analyzes committee collaboration networks for echo chamber indicators.
Returns metrics:
- Internal density: Collaboration within ideological cluster
- Bridge centrality: Cross-cluster information flow
- Homophily index: Ideological similarity preference
- Polarization score: Cluster separation intensity
"""
query = """
SELECT
c.org_code,
c.committee_name,
-- Network structure metrics
COUNT(DISTINCT cm.person_id) as member_count,
COUNT(DISTINCT cm.party) as party_diversity,
-- Collaboration patterns (co-authorship, co-sponsorship)
(SELECT COUNT(*)
FROM document_person dp1
JOIN document_person dp2 ON dp1.document_id = dp2.document_id
WHERE dp1.person_id IN (SELECT person_id FROM committee_member WHERE org_code = c.org_code)
AND dp2.person_id IN (SELECT person_id FROM committee_member WHERE org_code = c.org_code)
AND dp1.person_id < dp2.person_id
) as internal_collaboration,
-- Cross-party bridge activity
(SELECT COUNT(*)
FROM document_person dp1
JOIN document_person dp2 ON dp1.document_id = dp2.document_id
JOIN person p1 ON dp1.person_id = p1.person_id
JOIN person p2 ON dp2.person_id = p2.person_id
WHERE dp1.person_id IN (SELECT person_id FROM committee_member WHERE org_code = c.org_code)
AND dp2.person_id IN (SELECT person_id FROM committee_member WHERE org_code = c.org_code)
AND p1.party != p2.party
AND dp1.person_id < dp2.person_id
) as cross_party_bridges,
-- Ideological homogeneity (voting similarity)
AVG(
(SELECT AVG(
CASE WHEN v1.vote = v2.vote THEN 1.0 ELSE 0.0 END
) FROM vote v1, vote v2
WHERE v1.person_id IN (SELECT person_id FROM committee_member WHERE org_code = c.org_code)
AND v2.person_id IN (SELECT person_id FROM committee_member WHERE org_code = c.org_code)
AND v1.ballot_id = v2.ballot_id
AND v1.person_id < v2.person_id
)
) as internal_voting_similarity
FROM committee c
JOIN committee_member cm ON c.org_code = cm.org_code
WHERE c.org_code = %s
GROUP BY c.org_code, c.committee_name
"""
df = pd.read_sql(query, self.connection, params=[committee_id])
# Calculate echo chamber indicators
internal_density = df['internal_collaboration'].iloc[0] / (df['member_count'].iloc[0] ** 2)
bridge_ratio = df['cross_party_bridges'].iloc[0] / max(df['internal_collaboration'].iloc[0], 1)
homophily_index = df['internal_voting_similarity'].iloc[0]
# Echo chamber score (0-100, higher = stronger echo chamber)
echo_chamber_score = (
(internal_density * 30) +
((1 - bridge_ratio) * 30) +
(homophily_index * 40)
)
return {
'committee_id': committee_id,
'echo_chamber_score': round(echo_chamber_score, 2),
'internal_density': round(internal_density, 3),
'bridge_ratio': round(bridge_ratio, 3),
'homophily_index': round(homophily_index, 3),
'classification': self._classify_echo_chamber(echo_chamber_score)
}
def _classify_echo_chamber(self, score: float) -> str:
"""Classify echo chamber severity."""
if score >= 75:
return "SEVERE_ECHO_CHAMBER"
elif score >= 60:
return "MODERATE_ECHO_CHAMBER"
elif score >= 40:
return "MILD_POLARIZATION"
else:
return "HEALTHY_DIVERSITY"| Indicator | Measurement | Risk Threshold | Intelligence Assessment |
|---|---|---|---|
| Internal Density | Collaboration frequency within group | > 0.75 | High cohesion, low external input |
| Bridge Ratio | Cross-party collaboration rate | < 0.20 | Limited opposing viewpoints |
| Homophily Index | Voting similarity among members | > 0.85 | Ideological homogeneity |
| Dissent Suppression | Minority opinion frequency | < 5% | Conformity pressure |
| Echo Chamber Score | Composite metric | > 75 | Critical groupthink risk |
Political leadership styles significantly impact party effectiveness and coalition stability. The CIA platform classifies leaders across five dimensions based on behavioral evidence.
@Service
public class LeadershipStyleAnalyzer {
/**
* Analyzes leadership effectiveness through behavioral indicators.
*
* Based on transformational leadership theory (Bass & Riggio, 2006)
* and political leadership research (Burns, 1978).
*/
public LeadershipProfile analyzeLeadership(String politicianId) {
String sql = """
WITH leadership_metrics AS (
SELECT
p.person_id,
p.first_name || ' ' || p.last_name as name,
p.party,
-- Dimension 1: Collaborative vs. Authoritarian
vim.collaboration_score,
vim.network_centrality,
-- Dimension 2: Ideological vs. Pragmatic
vbs.rebel_votes::float / NULLIF(vbs.total_votes, 0) as ideological_purity,
vbs.vote_effectiveness_score as pragmatic_success,
-- Dimension 3: Proactive vs. Reactive
COUNT(DISTINCT d.document_id) as initiated_documents,
vbs.total_votes as participation_votes,
-- Dimension 4: Consensus-builder vs. Confrontational
vim.cross_party_collaboration_score,
vbs.rebel_votes as confrontational_votes,
-- Dimension 5: Visible vs. Behind-scenes
COUNT(DISTINCT CASE WHEN d.document_type = 'motion' THEN d.document_id END) as public_initiatives,
COUNT(DISTINCT CASE WHEN d.document_type = 'interpellation' THEN d.document_id END) as oversight_activity
FROM view_riksdagen_politician p
LEFT JOIN view_riksdagen_politician_ballot_summary vbs ON p.person_id = vbs.person_id
LEFT JOIN view_riksdagen_politician_influence_metrics vim ON p.person_id = vim.person_id
LEFT JOIN view_riksdagen_politician_document d ON p.person_id = d.person_id
WHERE p.person_id = :politicianId
GROUP BY p.person_id, p.first_name, p.last_name, p.party,
vim.collaboration_score, vim.network_centrality,
vbs.rebel_votes, vbs.total_votes, vbs.vote_effectiveness_score
)
SELECT
*,
-- Leadership style classification
CASE
WHEN collaboration_score > 0.7 AND cross_party_collaboration_score > 0.6
THEN 'TRANSFORMATIONAL'
WHEN ideological_purity > 0.15 AND confrontational_votes > 100
THEN 'IDEOLOGICAL_PURIST'
WHEN pragmatic_success > 0.75 AND cross_party_collaboration_score > 0.5
THEN 'PRAGMATIC_DEALMAKER'
WHEN initiated_documents > 50 AND public_initiatives > 30
THEN 'POLICY_ENTREPRENEUR'
WHEN network_centrality > 0.8 AND collaboration_score < 0.4
THEN 'AUTHORITARIAN_BROKER'
ELSE 'BACKBENCHER'
END as leadership_style
FROM leadership_metrics
""";
return jdbcTemplate.queryForObject(sql, LeadershipProfile.class,
Map.of("politicianId", politicianId));
}
}| Style | Behavioral Indicators | Strengths | Weaknesses | Strategic Use |
|---|---|---|---|---|
| TRANSFORMATIONAL | High collaboration, cross-party bridges, inspires change | Coalition-building, reform leadership | Can compromise core values | Coalition negotiations |
| IDEOLOGICAL_PURIST | High deviation, confrontational, principle-driven | Policy consistency, base mobilization | Limited legislative success | Opposition leadership |
| PRAGMATIC_DEALMAKER | Low deviation, high effectiveness, flexible | Legislative productivity, majority-building | Perceived as lacking principles | Government formation |
| POLICY_ENTREPRENEUR | High document initiation, innovation-focused | Agenda-setting, thought leadership | Implementation challenges | Committee chairmanship |
| AUTHORITARIAN_BROKER | High centrality, low collaboration, control-oriented | Discipline enforcement, clarity | Stifles innovation, loyalty issues | Crisis management |
| BACKBENCHER | Low activity across all dimensions | Low-risk, loyal follower | Limited influence | Safe majority vote |
Political decisions are influenced by systematic cognitive biases. The CIA platform identifies these patterns through voting behavior analysis.
from dataclasses import dataclass
from typing import List, Optional
from datetime import datetime, timedelta
@dataclass
class CognitiveBiasIndicators:
"""Indicators of cognitive biases in political decision-making."""
politician_id: str
confirmation_bias_score: float
status_quo_bias_score: float
authority_bias_score: float
recency_bias_score: float
availability_bias_score: float
class CognitiveBiasDetector:
"""
Identifies cognitive biases through voting pattern analysis.
Based on Kahneman & Tversky's cognitive bias research
applied to political decision-making contexts.
"""
def detect_confirmation_bias(self, politician_id: str) -> float:
"""
Detects confirmation bias: Tendency to vote with pre-existing beliefs.
Measured by:
- Consistency with historical positions
- Resistance to policy evolution despite new evidence
- Selective attention to information supporting prior stance
"""
query = """
WITH politician_voting AS (
SELECT
v.person_id,
v.vote,
b.issue_category,
b.vote_date,
LAG(v.vote) OVER (
PARTITION BY v.person_id, b.issue_category
ORDER BY b.vote_date
) as previous_vote,
LAG(b.vote_date) OVER (
PARTITION BY v.person_id, b.issue_category
ORDER BY b.vote_date
) as previous_date
FROM vote v
JOIN ballot b ON v.ballot_id = b.ballot_id
WHERE v.person_id = %s
AND b.vote_date >= NOW() - INTERVAL '4 years'
)
SELECT
person_id,
-- Consistency score: How often votes align with historical position
AVG(CASE WHEN vote = previous_vote THEN 1.0 ELSE 0.0 END) as consistency_rate,
-- Rigidity score: Resistance to policy evolution over time
COUNT(CASE WHEN vote != previous_vote
AND previous_date < vote_date - INTERVAL '1 year'
THEN 1 END)::float / COUNT(*) as evolution_resistance,
COUNT(*) as total_comparable_votes
FROM politician_voting
WHERE previous_vote IS NOT NULL
GROUP BY person_id
"""
result = pd.read_sql(query, self.connection, params=[politician_id])
if result.empty or result['total_comparable_votes'].iloc[0] < 10:
return 0.0
# Confirmation bias score: High consistency + high resistance = stronger bias
consistency_rate = result['consistency_rate'].iloc[0]
evolution_resistance = result['evolution_resistance'].iloc[0]
bias_score = (consistency_rate * 0.6) + (evolution_resistance * 0.4)
return round(bias_score * 100, 2)
def detect_status_quo_bias(self, politician_id: str) -> float:
"""
Detects status quo bias: Preference for maintaining current state.
Measured by:
- Voting against reform proposals
- Supporting incumbent policies
- Resisting change initiatives
"""
query = """
SELECT
v.person_id,
COUNT(CASE WHEN b.is_reform_proposal = TRUE AND v.vote = 'Nej' THEN 1 END)::float /
NULLIF(COUNT(CASE WHEN b.is_reform_proposal = TRUE THEN 1 END), 0) as reform_opposition_rate,
COUNT(CASE WHEN b.is_status_quo_motion = TRUE AND v.vote = 'Ja' THEN 1 END)::float /
NULLIF(COUNT(CASE WHEN b.is_status_quo_motion = TRUE THEN 1 END), 0) as status_quo_support_rate,
COUNT(*) as total_policy_votes
FROM vote v
JOIN ballot b ON v.ballot_id = b.ballot_id
WHERE v.person_id = %s
AND (b.is_reform_proposal = TRUE OR b.is_status_quo_motion = TRUE)
AND b.vote_date >= NOW() - INTERVAL '2 years'
GROUP BY v.person_id
"""
result = pd.read_sql(query, self.connection, params=[politician_id])
if result.empty or result['total_policy_votes'].iloc[0] < 5:
return 0.0
reform_opposition = result['reform_opposition_rate'].iloc[0] or 0.0
status_quo_support = result['status_quo_support_rate'].iloc[0] or 0.0
bias_score = (reform_opposition * 0.5) + (status_quo_support * 0.5)
return round(bias_score * 100, 2)
def detect_authority_bias(self, politician_id: str) -> float:
"""
Detects authority bias: Over-reliance on party leadership guidance.
Measured by:
- Voting alignment with party leadership
- Lack of independent positions
- Deference to authority figures
"""
query = """
WITH party_leader_votes AS (
SELECT
v.ballot_id,
v.vote as leader_vote
FROM vote v
JOIN person p ON v.person_id = p.person_id
WHERE p.is_party_leader = TRUE
AND p.party = (SELECT party FROM person WHERE person_id = %s)
)
SELECT
v.person_id,
COUNT(CASE WHEN v.vote = plv.leader_vote THEN 1 END)::float /
NULLIF(COUNT(*), 0) as leadership_alignment_rate,
COUNT(*) as total_votes_with_leader
FROM vote v
JOIN party_leader_votes plv ON v.ballot_id = plv.ballot_id
WHERE v.person_id = %s
GROUP BY v.person_id
"""
result = pd.read_sql(query, self.connection, params=[politician_id, politician_id])
if result.empty or result['total_votes_with_leader'].iloc[0] < 20:
return 0.0
alignment_rate = result['leadership_alignment_rate'].iloc[0]
# Authority bias score: Very high alignment suggests deference
if alignment_rate > 0.95:
return 100.0
elif alignment_rate > 0.90:
return 75.0
elif alignment_rate > 0.85:
return 50.0
else:
return round((alignment_rate - 0.70) * 200, 2) # Scale 70-85% to 0-30
def detect_recency_bias(self, politician_id: str) -> float:
"""
Detects recency bias: Disproportionate weight on recent information.
Measured by:
- Vote position changes after recent media coverage
- Inconsistency with long-term stance based on recent events
- Rapid policy shifts following public attention
"""
query = """
WITH recent_votes AS (
SELECT
v.person_id,
v.vote,
b.issue_category,
b.vote_date,
CASE WHEN b.vote_date >= NOW() - INTERVAL '90 days' THEN 'recent'
WHEN b.vote_date >= NOW() - INTERVAL '1 year' THEN 'medium_term'
ELSE 'historical' END as time_period
FROM vote v
JOIN ballot b ON v.ballot_id = b.ballot_id
WHERE v.person_id = %s
AND b.vote_date >= NOW() - INTERVAL '3 years'
),
consistency_analysis AS (
SELECT
person_id,
issue_category,
AVG(CASE WHEN time_period = 'recent' AND vote = 'Ja' THEN 1.0 ELSE 0.0 END) as recent_support,
AVG(CASE WHEN time_period = 'historical' AND vote = 'Ja' THEN 1.0 ELSE 0.0 END) as historical_support
FROM recent_votes
GROUP BY person_id, issue_category
HAVING COUNT(CASE WHEN time_period = 'recent' THEN 1 END) >= 3
AND COUNT(CASE WHEN time_period = 'historical' THEN 1 END) >= 5
)
SELECT
person_id,
AVG(ABS(recent_support - historical_support)) as avg_shift_magnitude,
COUNT(*) as analyzed_categories
FROM consistency_analysis
WHERE ABS(recent_support - historical_support) > 0.20 -- Significant shift threshold
GROUP BY person_id
"""
result = pd.read_sql(query, self.connection, params=[politician_id])
if result.empty or result['analyzed_categories'].iloc[0] < 3:
return 0.0
shift_magnitude = result['avg_shift_magnitude'].iloc[0]
# Recency bias score: Larger shifts = stronger bias
bias_score = min(shift_magnitude * 150, 100) # Cap at 100
return round(bias_score, 2)| Bias Type | Detection Method | Risk Threshold | Behavioral Impact | Intelligence Use |
|---|---|---|---|---|
| Confirmation Bias | Historical vote consistency | > 85% | Ignores contradictory evidence | Predict resistance to new information |
| Status Quo Bias | Reform opposition rate | > 70% | Blocks necessary change | Identify reform obstacles |
| Authority Bias | Leadership alignment | > 90% | Lacks independent judgment | Predict via party leadership |
| Recency Bias | Vote shift magnitude after events | > 30% shift | Overreacts to recent news | Exploit timing of proposals |
| Availability Bias | Media-salient issue focus | > 60% media-driven | Ignores non-salient issues | Assess media manipulation vulnerability |
Politicians balance party loyalty with constituency demands. The CIA platform measures this tension through deviation analysis correlated with electoral data.
-- Constituency Influence Scoring
WITH constituency_characteristics AS (
SELECT
er.election_region_id,
er.region_name,
er.population,
er.urban_rural_classification,
er.median_income,
er.education_level,
-- Electoral competitiveness (closer races = more pressure)
er.winning_margin_percentage,
CASE
WHEN er.winning_margin_percentage < 5 THEN 'MARGINAL_SEAT'
WHEN er.winning_margin_percentage < 10 THEN 'COMPETITIVE_SEAT'
ELSE 'SAFE_SEAT'
END as seat_classification,
-- Ideological distance from party median
er.constituency_ideology_score,
p.party_ideology_score,
ABS(er.constituency_ideology_score - p.party_ideology_score) as ideological_distance
FROM election_region er
JOIN party p ON er.winning_party = p.party_id
),
politician_constituency_behavior AS (
SELECT
pol.person_id,
pol.first_name || ' ' || pol.last_name as name,
pol.party,
pol.constituency_id,
cc.seat_classification,
cc.ideological_distance,
-- Voting behavior
vbs.rebel_votes,
vbs.total_votes,
vbs.rebel_votes::float / NULLIF(vbs.total_votes, 0) as deviation_rate,
-- Document activity reflecting constituency concerns
COUNT(DISTINCT pd.document_id) as constituency_documents,
-- Constituency influence score
CASE
WHEN cc.seat_classification = 'MARGINAL_SEAT'
AND cc.ideological_distance > 15
AND vbs.rebel_votes::float / vbs.total_votes > 0.05
THEN 'HIGH_CONSTITUENCY_INFLUENCE'
WHEN cc.seat_classification = 'COMPETITIVE_SEAT'
AND vbs.rebel_votes::float / vbs.total_votes > 0.03
THEN 'MODERATE_CONSTITUENCY_INFLUENCE'
WHEN cc.seat_classification = 'SAFE_SEAT'
AND vbs.rebel_votes::float / vbs.total_votes < 0.02
THEN 'PARTY_DISCIPLINE_DOMINANT'
ELSE 'BALANCED_INFLUENCE'
END as influence_classification
FROM view_riksdagen_politician pol
JOIN constituency_characteristics cc ON pol.constituency_id = cc.election_region_id
JOIN view_riksdagen_politician_ballot_summary vbs ON pol.person_id = vbs.person_id
LEFT JOIN view_riksdagen_politician_document pd ON pol.person_id = pd.person_id
GROUP BY pol.person_id, pol.first_name, pol.last_name, pol.party, pol.constituency_id,
cc.seat_classification, cc.ideological_distance,
vbs.rebel_votes, vbs.total_votes, pd.document_id
)
SELECT
person_id,
name,
party,
seat_classification,
deviation_rate,
influence_classification,
-- Strategic intelligence assessment
CASE
WHEN influence_classification = 'HIGH_CONSTITUENCY_INFLUENCE'
THEN 'Target for constituency-based persuasion campaigns'
WHEN influence_classification = 'PARTY_DISCIPLINE_DOMINANT'
THEN 'Requires party leadership negotiation'
ELSE 'Balanced approach needed'
END as strategic_approach
FROM politician_constituency_behavior
ORDER BY deviation_rate DESC, ideological_distance DESC;The CIA platform integrates behavioral indicators with Drools risk rules to create comprehensive risk profiles. These profiles predict potential accountability failures.
Risk Rules Integration:
@Component
public class BehavioralRiskAssessment {
/**
* Comprehensive behavioral risk assessment integrating multiple indicators.
*
* Risk dimensions:
* 1. Engagement risk (absenteeism, withdrawal)
* 2. Effectiveness risk (minority voting, low productivity)
* 3. Stability risk (high deviation, erratic patterns)
* 4. Collaboration risk (isolation, network periphery)
* 5. Cognitive risk (bias indicators, decision-making quality)
*/
public ComprehensiveRiskProfile assessBehavioralRisks(String politicianId) {
String sql = """
SELECT
p.person_id,
p.first_name || ' ' || p.last_name as name,
p.party,
-- Engagement Risk Indicators
vbs_daily.avg_absent_percentage as daily_absence_rate,
vbs_monthly.avg_absent_percentage as monthly_absence_rate,
vbs_annual.avg_absent_percentage as annual_absence_rate,
-- Effectiveness Risk Indicators
vbs.vote_effectiveness_score,
vbs.avg_vote_win_rate,
vbs.lost_votes::float / NULLIF(vbs.total_votes, 0) as loss_rate,
-- Stability Risk Indicators
vbs.rebel_votes,
vbs.rebel_votes::float / NULLIF(vbs.total_votes, 0) as deviation_rate,
STDDEV(CASE WHEN v.vote != p.party_vote THEN 1 ELSE 0 END) as deviation_volatility,
-- Collaboration Risk Indicators
vim.collaboration_score,
vim.network_centrality,
vim.cross_party_collaboration_score,
-- Productivity Indicators
COUNT(DISTINCT pd.document_id) as total_documents,
-- Overall Risk Score (0-100, higher = higher risk)
(
COALESCE(vbs_annual.avg_absent_percentage, 0) * 0.25 +
COALESCE((1 - vbs.vote_effectiveness_score) * 100, 0) * 0.25 +
COALESCE(vbs.rebel_votes::float / NULLIF(vbs.total_votes, 0) * 100, 0) * 0.20 +
COALESCE((1 - vim.collaboration_score) * 100, 0) * 0.15 +
COALESCE((1 - vim.network_centrality) * 100, 0) * 0.15
) as composite_risk_score,
-- Risk Classification
CASE
WHEN (
COALESCE(vbs_annual.avg_absent_percentage, 0) * 0.25 +
COALESCE((1 - vbs.vote_effectiveness_score) * 100, 0) * 0.25 +
COALESCE(vbs.rebel_votes::float / NULLIF(vbs.total_votes, 0) * 100, 0) * 0.20 +
COALESCE((1 - vim.collaboration_score) * 100, 0) * 0.15 +
COALESCE((1 - vim.network_centrality) * 100, 0) * 0.15
) >= 70 THEN 'CRITICAL_RISK'
WHEN (
COALESCE(vbs_annual.avg_absent_percentage, 0) * 0.25 +
COALESCE((1 - vbs.vote_effectiveness_score) * 100, 0) * 0.25 +
COALESCE(vbs.rebel_votes::float / NULLIF(vbs.total_votes, 0) * 100, 0) * 0.20 +
COALESCE((1 - vim.collaboration_score) * 100, 0) * 0.15 +
COALESCE((1 - vim.network_centrality) * 100, 0) * 0.15
) >= 50 THEN 'HIGH_RISK'
WHEN (
COALESCE(vbs_annual.avg_absent_percentage, 0) * 0.25 +
COALESCE((1 - vbs.vote_effectiveness_score) * 100, 0) * 0.25 +
COALESCE(vbs.rebel_votes::float / NULLIF(vbs.total_votes, 0) * 100, 0) * 0.20 +
COALESCE((1 - vim.collaboration_score) * 100, 0) * 0.15 +
COALESCE((1 - vim.network_centrality) * 100, 0) * 0.15
) >= 30 THEN 'MODERATE_RISK'
ELSE 'LOW_RISK'
END as risk_classification
FROM view_riksdagen_politician p
LEFT JOIN view_riksdagen_politician_ballot_summary vbs ON p.person_id = vbs.person_id
LEFT JOIN view_riksdagen_vote_data_ballot_politician_summary_daily vbs_daily ON p.person_id = vbs_daily.person_id
LEFT JOIN view_riksdagen_vote_data_ballot_politician_summary_monthly vbs_monthly ON p.person_id = vbs_monthly.person_id
LEFT JOIN view_riksdagen_vote_data_ballot_politician_summary_annual vbs_annual ON p.person_id = vbs_annual.person_id
LEFT JOIN view_riksdagen_politician_influence_metrics vim ON p.person_id = vim.person_id
LEFT JOIN view_riksdagen_politician_document pd ON p.person_id = pd.person_id
LEFT JOIN vote v ON p.person_id = v.person_id
WHERE p.person_id = :politicianId
GROUP BY p.person_id, p.first_name, p.last_name, p.party,
vbs_daily.avg_absent_percentage, vbs_monthly.avg_absent_percentage,
vbs_annual.avg_absent_percentage, vbs.vote_effectiveness_score,
vbs.avg_vote_win_rate, vbs.lost_votes, vbs.total_votes,
vbs.rebel_votes, vim.collaboration_score, vim.network_centrality,
vim.cross_party_collaboration_score
""";
return jdbcTemplate.queryForObject(sql, ComprehensiveRiskProfile.class,
Map.of("politicianId", politicianId));
}
}| Control | Behavioral Analysis Application |
|---|---|
| A.5.1 - Policies for information security | Apply behavioral analysis to detect policy violations and non-compliance patterns |
| A.5.15 - Access control | Behavioral profiling for insider threat detection and access privilege monitoring |
| A.8.16 - Monitoring activities | Continuous behavioral monitoring for anomaly detection |
| A.8.23 - Web filtering | Analyze access patterns to identify unauthorized information seeking |
| Function | Behavioral Analysis Integration |
|---|---|
| IDENTIFY (ID.AM) | Behavioral profiling of personnel with access to sensitive political intelligence |
| DETECT (DE.CM) | Continuous monitoring for anomalous behavior patterns |
| RESPOND (RS.AN) | Behavioral analysis to assess incident response effectiveness |
| Control | Application |
|---|---|
| CIS Control 6 - Access Control Management | Apply behavioral risk assessment to access privilege decisions |
| CIS Control 8 - Audit Log Management | Behavioral analysis of audit log patterns |
This skill implements requirements from:
© Hack23, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .github/skills/behavioral-analysis of Hack23/cia.
Open the folder on GitHubat commit bbed538
Behavioral Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Behavioral Analysis this skillHack23/cia | 239 | — | ~10k | Automated safety check: Pass | Apache-2.0 | |
| Marketing Psychologynexu-io/open-design | 100k | — | ~317 | Automated safety check: Pass | Apache-2.0 | |
| Behavioral Finance for TradingHKUDS/Vibe-Trading | 35k | — | ~2.7k | Automated safety check: Pass | MIT | |
| Soc Cognitive Biasasgard-ai-platform/skills | 241 | — | ~1.2k | Automated safety check: Pass | MIT | |
| Dynamic Workflow Modeaffaan-m/ECC | 275k | 1 repos | ~1.3k | Automated safety check: Pass | MIT | |
| Cognitive Patternruvnet/ruflo | 74k | — | ~384 | Automated safety check: Notes | MIT |
nexu-io/open-design
Apply psychological principles and behavioral science to copy and design.
HKUDS/Vibe-Trading
Turns behavioral-finance theory into trading signals and risk rules: overreaction and underreaction, momentum and reversal, sentiment extremes and a cognitive-bias checklist.
asgard-ai-platform/skills
Identify and analyze cognitive biases including confirmation bias, anchoring, availability heuristic, and sunk cost fallacy in decision-making contexts.
affaan-m/ECC
Design task-local harnesses, eval gates, and reusable skill extraction for Claude dynamic workflow mode and other adaptive agent harnesses.
ruvnet/ruflo
Define and manage cognitive patterns for agent reasoning and decision-making
mukul975/Anthropic-Cybersecurity-Skills
Detects and analyzes malicious behavior in mobile applications through behavioral analysis, permission abuse detection, network traffic monitoring, and dynamic instrumentation.
Hack23/cia
WCAG 2.1 AA compliance, ARIA attributes, keyboard navigation, screen reader optimization for accessible political data platforms
Hack23/cia
Advanced chart types, D3.js/Vaadin Charts patterns, political data visualization, time series analysis
Hack23/cia
AI governance, EU AI Act compliance, OWASP LLM security, responsible AI practices for GitHub Copilot agents
Hack23/cia
External API integration patterns, retry logic, circuit breakers, caching, rate limiting for government data APIs
Hack23/cia
AWS CloudWatch metrics, alarms, dashboards, log insights, and application monitoring for the CIA platform
Hack23/cia
AWS security best practices, VPC security, IAM, KMS, CloudTrail, GuardDuty for CIA platform deployment
Political psychology, cognitive biases, group dynamics, leadership analysis, decision-making patterns for Swedish political intelligence. Behavioral Analysis is an agent skill from Hack23/cia.
Run `npx skills add Hack23/cia --skill behavioral-analysis -a claude-code`. Or copy the skill folder (.github/skills/behavioral-analysis in Hack23/cia) into .claude/skills/behavioral-analysis in your project. Claude Code loads it when a task matches its description.
Run `npx skills add Hack23/cia --skill behavioral-analysis -a codex`. Or copy the skill folder (.github/skills/behavioral-analysis in Hack23/cia) into .agents/skills/behavioral-analysis in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Hack23/cia --skill behavioral-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/behavioral-analysis, .gemini/skills/behavioral-analysis, .github/skills/behavioral-analysis and .opencode/skills/behavioral-analysis in your project.
SKILL.md names no scripts, command-line tools or credentials: Behavioral Analysis is instructions for the agent only. Our summary lists: Python 3.
SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Behavioral Analysis is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 10k tokens (SKILL.md is roughly 40k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Behavioral Analysis: Marketing Psychology (nexu-io/open-design, 100k stars), Behavioral Finance for Trading (HKUDS/Vibe-Trading, 35k stars), Soc Cognitive Bias (asgard-ai-platform/skills, 241 stars) and Dynamic Workflow Mode (affaan-m/ECC, 275k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Hack23 (a GitHub organization) maintains it in Hack23/cia, which has 239 GitHub stars. The repository holds 78 skills in this directory. The repository was last updated on October 7, 2026.
Source: Hack23/cia on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.