eliteforge-sonar-pmd-generator
Transform user-provided coding specification files into a layered governance plan and validated SonarQube plugin workflow. Automatically classify each requirement into L1/L2/L3/L4, implement L1-L2 as PMD rules for supported languages, route L3 to automation tooling, route L4 to human or AI review, package rules into a custom sonar-pmd plugin, and verify with Docker Sonar + real project scans.
What this skill does
# Sonar PMD Generator (Spec-driven, End-to-end) ## Overview This skill converts coding standard documents into enforceable PMD rules and validates them through a real SonarQube server workflow. Completion requires an end-to-end chain: spec parsing, `L1/L2/L3/L4` classification, PMD ruleset generation for `L1-L2`, automation planning for `L3`, review planning for `L4`, custom `sonar-pmd` plugin packaging, Docker Sonar startup, test project scan, and server-side verification. ## Environment Variables - `ELITEFORGE_SKILL_SONAR_PMD_HOST` [optional] SonarQube base URL for reference command snippets; script arguments may override it. - `ELITEFORGE_SKILL_SONAR_PMD_TOKEN` [optional] SonarQube API token for local validation snippets; never print the value. - `ELITEFORGE_SKILL_SONAR_PMD_PROJECT_KEY` [optional] Sonar project key used by API evidence snippets. - `ELITEFORGE_SKILL_SONAR_PMD_PLUGIN_KEY` [optional] Custom Sonar plugin key used by API evidence snippets. - `ELITEFORGE_SKILL_SONAR_PMD_RULE_REPO_KEY` [optional] Custom rule repository key used by API evidence snippets. - `ELITEFORGE_SKILL_SONAR_PMD_PROFILE_KEY` [optional] Quality profile key used by API evidence snippets. ## Progressive Loading - Read [references/workflow-playbook.md](references/workflow-playbook.md) first for the full execution order. - Read [references/plugin-packaging-blueprint.md](references/plugin-packaging-blueprint.md) when implementing or debugging plugin modules. - Read [references/docker-sonar-validation.md](references/docker-sonar-validation.md) when starting Sonar in Docker and running test scans. - Read [references/sonar-api-evidence-checklist.md](references/sonar-api-evidence-checklist.md) when collecting validation evidence. - Use `scripts/verify_sonar_plugin.sh` for quick API-based smoke verification after scan. ## Trigger Conditions Use this skill when the request includes one or more of these intents: - Convert coding specifications into PMD rules. - Auto-classify specification clauses into `L1/L2/L3/L4`. - Build or extend a custom Sonar PMD plugin/profile. - Validate PMD plugin behavior in SonarQube using Docker and real scans. - Prove custom rules are visible and producing issues in Sonar. ## Required Inputs - One or more specification file paths. - Target language(s) for each specification. - Plugin workspace path (or permission to scaffold one). - Test project path (or permission to scaffold one). - Optional output directory for generated artifacts (default: `pmd-governance/`). - Optional profile name (default: `custom-spec-profile`). ## Classification Contract (MUST follow) - `L1`: can be covered by PMD built-in rule(s) for the target language. - `L2`: can be expressed with PMD AST XPath rule(s) for the target language. - `L3`: cannot or should not be expressed in PMD, but can be detected reliably by other automation tools such as formatter, hook, CI job, Checkstyle, Semgrep, ArchUnit, or build plugins. - `L4`: requires human review or AI review because the rule depends on business semantics, architectural intent, or unstable heuristics. - Never force `L3` or `L4` into fragile PMD XPath implementations. For each spec statement, record: - `SPEC-ID` - original statement - target language - level (`L1/L2/L3/L4`) - detection target - trigger condition - exception condition - severity - primary tool - execution stage - implementation plan - reviewer note (mandatory for `L4`) ## End-to-end Workflow (REQUIRED) 1. Parse specification statements and assign IDs (`SPEC-<LANG>-001`, ...). 2. Auto-classify every statement into `L1/L2/L3/L4`. 3. Generate governance artifacts: - `mapping/spec-to-governance.csv` - `rulesets/custom-<lang>-ruleset.xml` - `automation/l3-tooling-plan.md` - `manual-review/l4-review-checklist.md` - `README.md` 4. Build a custom PMD rules module from `L1-L2` only: - include `L1` mapped refs and `L2` custom XPath/Java rules - rule keys/messages must include traceability to `SPEC-ID` 5. Build an automation plan for `L3`: - select the smallest stable tool that can enforce the rule - prefer formatter or build plugin over custom scripts when possible - specify whether it runs in pre-commit, CI, build, or MR check 6. Build a review plan for `L4`: - define human-review checklist entries - define optional AI-review prompt or rubric 7. Build a custom Sonar plugin module: - register PMD rule repository - load custom rules into Sonar - provide default quality profile (`custom-spec-profile` or user-provided name) 8. Package plugin JAR and deploy into Sonar plugin directory (`extensions/plugins`). 9. Start SonarQube Community in Docker with the custom plugin loaded. 10. Wait for Sonar server readiness and initialize token/project binding. 11. Prepare a test project: - use real project if provided, otherwise scaffold a minimal project - include both violating and compliant code samples 12. Trigger real scan with Maven Sonar plugin (`mvn sonar:sonar`). 13. Verify plugin effectiveness via Sonar APIs/UI: - profile exists and is active - custom rules are listed and enabled - issues are produced with rule key + file + line mapping 14. Report scan evidence and unresolved gaps. ## Language Support Gate 1. Check if the target language is supported by PMD and your Sonar integration path. 2. If unsupported by PMD: - classify candidates as `L3` if another automation tool can enforce them - classify remaining items as `L4` - generate both automation and review outputs - recommend alternative analyzer and optional generic external issues import ## Sonar Integration Server-side plugin execution: - Preferred because this skill requires custom plugin validation. - Scan command example: - `mvn -DskipTests sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.token=<token>` ## Docker Validation Baseline Minimum checks after container startup: - Sonar health endpoint reports ready. - Plugin is loaded (visible in marketplace/plugins list or startup logs). - Quality profile from the plugin is available. Minimum checks after scan: - At least one custom-rule issue appears on violating sample. - Compliant sample does not trigger that custom rule. - Issues are mapped to concrete file and line. ## Non-negotiable Rules - Do not handcraft PMD reports; generated findings must come from actual analysis. - `L1-L2` go into PMD rules and the custom sonar-pmd plugin. - `L3` items must be exported into an automation tooling plan instead of being forced into PMD. - `L4` items must be exported into human or AI review workflows. - End-to-end verification is incomplete without Docker Sonar + real scan evidence. - First rollout should stay non-blocking unless user explicitly requests CI gating. ## Delivery Outputs - Governance artifacts (`mapping`, `ruleset`, `L3 tooling plan`, `L4 review checklist`). - Custom plugin source and packaged JAR. - Docker startup commands and runtime evidence. - Test project scan command and result summary. - Verification report listing profile key, rule keys, issue count, and sampled issue locations. ## Troubleshooting Checklist - Plugin not loaded: verify Sonar/plugin API compatibility and restart logs. - Profile missing: verify repository key/profile registration code. - No issues found: confirm profile binding and test code actually violates rule. - False positives spike: narrow XPath scope and add negative samples. - Scan auth errors: validate token and `sonar.host.url` consistency.
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.