Skip to content

Jier cli from params to user intent#4

Merged
jier merged 15 commits intomainfrom
jier-cli-from-params-to-user-intent
Mar 7, 2026
Merged

Jier cli from params to user intent#4
jier merged 15 commits intomainfrom
jier-cli-from-params-to-user-intent

Conversation

@jier
Copy link
Copy Markdown
Owner

@jier jier commented Mar 7, 2026

Summary

This branch transforms Docsible from a parameter-driven CLI into an intent-based, user-friendly tool. It delivers 5 major UX improvements across the full stack, from CLI surface to output formatting, along with a complete suppression system and a preset/wizard onboarding flow.


What Was Built

1. Severity-Based Output

Recommendations are now grouped and prioritized as CRITICAL, WARNING, or INFO instead of a flat undifferentiated list. Each recommendation includes a remediation step. Low-severity items are hidden by default (--show-info to reveal).

2. Positive Output Framing

Success output leads with what went well before surfacing issues. Missing items are reframed as "enhancement opportunities" with time estimates and difficulty tags. A MessageTransformer converts negative phrasing to constructive language.

3. Progressive Help

docsible role --help now shows a concise brief view (essential options only). --help-full reveals all options. An interactive guide system (docsible guide getting-started) was added for new users.

4. Suppression System

Users can silence known false positives with persistent rules stored in .docsible/suppress.yml:

  • docsible suppress add "pattern" --reason "..." --expires 90
  • docsible suppress list / remove <id> / clean
  • Rules support regex, file glob scoping, expiry dates, and match count tracking.

5. Intent-Based CLI + Presets (Phase 3)

The CLI is restructured around user intent rather than implementation flags:

New Command | Purpose -- | -- docsible init | Interactive 3-step wizard (use case → smart defaults → CI/CD setup for GitHub Actions, GitLab CI, Azure DevOps) docsible document role [--role PATH] [--preset ...] | Generate documentation docsible analyze role | Analysis-only mode with complexity report docsible validate role | Dry-run validation with strict mode

Four built-in presets: personal, team, enterprise, consultant. Preset settings resolve with 3-level priority: preset defaults < .docsible/config.yml overrides < explicit CLI flags.

The legacy docsible role --role PATH still works with a deprecation warning — fully backward compatible.


Quality

  • 990 tests passing, 0 failures
  • 0 mypy errors (all pre-existing and new type errors fixed)
  • README fully updated to reflect the new CLI surface
  • UX_IMPROVEMENTS_ROADMAP.md — all phases marked complete
  • FOLDER_REORGANIZATION_REPORT.md — written as input for the next branch

jier added 15 commits December 25, 2025 17:56
…odebase and to addition of utility error handling and missing type hints.
…dme_for_comparison(), normalize_dry_run_output() to fix errors in test_quick_comparison.py
…on for smart cli detection enabled by default

- Implement tests for DependenciesDecisionRule, GraphDecisionRule, and MinimalModeRule to ensure correct decision-making based on role complexity and dependencies.
- Create CLI integration tests to verify smart defaults behavior for different role types, including user overrides and environment variable impacts.
- Develop integration tests for SmartDefaultsEngine to validate the complete pipeline from role detection to configuration generation, ensuring user overrides are respected.
- Enhance structure detection tests to cover various role structures, including detection of handlers, meta, defaults, templates, and files directories, as well as accurate counting of task files.
- Ensure all tests validate the expected outcomes and decision rationales, contributing to a robust testing framework for the decision-making logic in the application.
…tion

Implements the complete severity-based output system
with CRITICAL/WARNING/INFO levels for prioritized role analysis.

Core Models:
- Add Severity enum with icons, labels, and priority ordering
- Enhance Recommendation model with severity field and location property
- Add confidence scoring and auto-fixable metadata

Recommendation Generators:
- SecurityRecommendationGenerator (CRITICAL): vault encryption, exposed secrets, unsafe permissions
- QualityRecommendationGenerator (WARNING): complex roles, undocumented variables
- EnhancementRecommendationGenerator (INFO): missing examples, missing tests
- Aggregate function sorts by severity priority (critical first)

Output Formatting:
- RecommendationFormatter groups by severity with emoji icons (🔴🟡💡)
- Shows location (file:line) and remediation steps when available
- Sorts within severity by confidence score
- Summary section with counts per severity level

CLI Integration:
- Add --show-info flag to display INFO-level recommendations (hidden by default)
- Add --recommendations-only flag to analyze without generating documentation
- Integrate with RoleOrchestrator for seamless workflow
- Parameters flow through core.py → orchestrated.py → context models

Testing:
- 11 comprehensive formatter tests with realistic pytest fixtures
- 2 end-to-end CLI tests for critical output and INFO filtering
- Fixtures match actual security/quality/enhancement generator outputs
- All 13 tests passing with 100% coverage of severity logic

Fixes:
- Vault encryption check now examines first line only (no false positives)
- Secret detection checks both var and msg fields with detailed output
- Proper type safety with ComplexityCategory enum usage
- Fixed line_number to use None for non-specific locations

Files Modified:
- docsible/models/severity.py (new)
- docsible/models/recommendation.py (enhanced)
- docsible/analyzers/recommendations/{__init__,security,quality,enhancement}.py
- docsible/formatters/recommendation_formatter.py (new)
- docsible/commands/document_role/{__init__,core,core_orchestrated,options/recommendations}.py
- docsible/commands/document_role/models/role_command_context.py
- docsible/commands/document_role/orchestrators/role_orchestrator.py
- tests/formatters/test_recommendation_formatter.py (11 tests)
- tests/end_to_end/test_severity_output.py (2 tests)
…ent branch for now focus on UX improvements. Next step is Progressive help UI implementation.
@jier jier merged commit d26cb46 into main Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant