Skip to main content

IdiomarkD - Idiomark for Developers

IdiomarkD (Idiomark for Developers) is a PEP (Idiomark Extension Protocol) for analyzing developer behavioral patterns from code samples.

v1: Static Behavioral Analysis​

Analyzes developer behavioral patterns from static code samples - no git history required.

What It Analyzes​

DimensionAnalyzesExample
Cognitive StyleLoop patterns, comments, iterationsfor loops vs .map(), TODO/FIXME frequency
Code StructureFunction length, nesting depth, organization3-layer nested = high complexity tolerance
NamingVariable conventions, abbreviationscamelCase vs UPPER_SNAKE
Error Handlingtry/catch patterns, loggingGraceful degradation vs fail-fast
TestingTest-to-code ratio, mock strategyTDD zealot vs exploratory
Code ReviewComments, documentation styleCollaborative vs direct

API Endpoint​

POST /api/v1/analyze​

Analyzes code samples for developer behavioral patterns.

Base URL: http://localhost:4000

Request​

{
"code_samples": [
{
"filePath": "src/components/Button.tsx",
"content": "export function Button() {\n return <button>Click</button>\n}",
"language": "typescript"
},
{
"filePath": "src/utils/helpers.ts",
"content": "export const formatDate = (date: Date) => {...}",
"language": "typescript"
}
]
}

Limits:

  • Max 100 samples per request
  • Max 100KB per sample
  • Rate limited to 100 requests/minute

Response​

{
"behavioral": {
"cognitive_style": {
"problem_solving": "iterative_refinement",
"learning_style": "experimentation",
"documentation_preference": "code_first_comments_selective"
},
"code_structure": {
"functional_preference": 0.65,
"max_function_length": 18,
"complexity_tolerance": "moderate",
"file_organization": "co_located"
},
"naming": {
"philosophy": "descriptive_over_brief",
"conventions": {
"variables": "camelCase",
"types": "PascalCase",
"constants": "UPPER_SNAKE",
"files": "kebab-case"
},
"abbreviations": ["ctx", "fmt", "cfg"],
"anti_patterns": ["data", "temp", "obj"]
},
"error_handling": {
"philosophy": "graceful_degradation",
"fail_fast": false,
"error_context": "always_include_trace",
"logging_level": "info"
},
"testing": {
"temperament": "pragmatic_not_zealous",
"coverage_threshold": 0.72,
"test_external_dependencies": true,
"mock_strategy": "mixed"
},
"code_review": {
"style": "collaborative_not_adversarial",
"focus_areas": ["asynchronous_patterns", "error_handling", "logging"],
"nit_picks": ["console_logs", "magic_numbers"]
}
},
"confidence": {
"overall": 0.82,
"cognitive_style": 0.85,
"code_structure": 0.78,
"naming": 0.88,
"error_handling": 0.75,
"testing": 0.80,
"code_review": 0.76
},
"sampleCount": 42,
"analyzedAt": "2026-02-14T12:00:00.000Z",
"meta": {
"processedAt": "2026-02-14T12:00:05.123Z",
"processingTimeMs": 123,
"apiVersion": "1.0.0"
}
}

CLI Usage​

# Analyze local codebase
npx @idiomark/core analyze-code ./src --format=idiomarkd

# Analyze specific file
npx @idiomark/core analyze-code ./src/components/Button.tsx --format=idiomarkd

# Save to file
npx @idiomark/core analyze-code ./src --format=idiomarkd > my-developer-profile.idiomarkd

v2: Evolution Patterns (Planned)​

Future work - git history and commit pattern analysis.

Planned Features:

  • Commit pattern detection (iterative vs big-bang)
  • Churn analysis (files changed per commit)
  • PR/issue collaboration style
  • Fix turnaround time
  • Code review responsiveness

See: v2 Future Work


Health Check​

GET /health​

curl http://localhost:4000/health
{
"status": "ok",
"service": "idiomarkd-api",
"version": "1.0.0",
"timestamp": "2026-02-14T12:00:00.000Z"
}

Environment Variables​

VariableDescriptionDefault
PORTServer port4000
HOSTServer host0.0.0.0
GITHUB_TOKENGitHub API token (future use)-
RATE_LIMIT_PER_MINRequests per minute100
LOG_LEVELLogging verbosityinfo

TypeScript Types​

import type { CodeSample, BehavioralAnalysisResult } from '@idiomark/core/types-dev'

const samples: CodeSample[] = [
{
filePath: 'src/index.ts',
content: 'export function main() {}',
language: 'typescript',
metadata: {
commitHash: 'abc123',
timestamp: '2026-02-14T12:00:00Z',
author: 'developer'
}
}
]

const result: BehavioralAnalysisResult = await analyzeDeveloperBehavior(samples)

Architecture​

IdiomarkD v1 runs on port 4000 as a separate service:

ServicePortPurpose
Main API3000Idiomark for social media profiles
IdiomarkD API4000Static behavioral analysis for developers

Why separate?

  • IdiomarkD is CPU-intensive (code parsing)
  • GitHub API rate limiting doesn't affect main API
  • Independent deployment/rollback
  • Can scale separately

See Also​