Skip to content

Add cspy plugin for Cosmic Python architecture patterns - #5

Merged
sodre merged 11 commits into
mainfrom
feat/cosmic-python
Jan 25, 2026
Merged

sodre merged 11 commits into
mainfrom
feat/cosmic-python

Conversation

@sodre

@sodre sodre commented Jan 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Add new cspy plugin providing skills, agents, and references for Cosmic Python architecture patterns
  • Includes 8 skills: audit, service-layer, uow, domain, events, cqrs, test-strategy, refactor
  • Includes 1 agent: architecture-auditor
  • Includes shared references for patterns-summary and project-structure
  • Skills follow progressive disclosure pattern with reference files for detailed content

Changes

New Plugin Structure:

plugins/cspy/
├── .claude-plugin/plugin.json
├── agents/architecture-auditor.md
├── references/
│   ├── patterns-summary.md
│   └── project-structure.md
└── skills/
    ├── audit/
    ├── cqrs/
    ├── domain/
    ├── events/
    ├── refactor/
    ├── service-layer/
    ├── test-strategy/
    └── uow/

Skills with Reference Files:

Skill Reference File Content
service-layer references/use-case-patterns.md Common patterns
uow references/async-uow.md Async UoW + FastAPI DI
domain references/domain-tests.md Full test examples
events references/messagebus.md Full messagebus implementation
refactor references/refactoring-steps.md Steps 2-6 detailed code

Test plan

  • Verify plugin loads correctly with claude /plugins
  • Test each skill can be invoked
  • Verify reference files are accessible from skills

🤖 Generated with Claude Code

sodre and others added 11 commits January 24, 2026 21:39
Add code scaffolding and auditing for DDD patterns from
"Architecture Patterns with Python" by Percival & Gregory.

Skills:
- audit: analyze codebase for pattern coverage
- domain: design entities, value objects, aggregates
- service-layer: generate service layer functions
- uow: implement Unit of Work pattern
- events: design domain events and commands
- cqrs: analyze and design read models
- test-strategy: recommend test levels (high/low gear TDD)
- refactor: guide incremental pattern adoption

Agent:
- architecture-auditor: proactive Python architecture review

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add "pattern coverage" and "DDD adoption" as trigger phrases
- Condense search pattern sections to be more concise
- Remove redundant code blocks, use inline search patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove "What is a Service Layer?" section (Claude knows this)
- Extract common use case patterns to references/use-case-patterns.md
- Add "orchestration code" trigger phrase
- Keep template + anti-patterns in SKILL.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove "What is Unit of Work?" section (Claude knows this)
- Extract async UoW and FastAPI DI to references/async-uow.md
- Add "atomic operations" and "transaction boundaries" triggers
- Keep sync implementation + fake + tests in SKILL.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove "What is a Domain Model?" section (Claude knows this)
- Add "DDD" and "aggregate design" trigger phrases
- Trim test examples to representative cases
- Extract full test suite to references/domain-tests.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add "event-driven", "CQRS events", "side-effect decoupling" triggers
- Extract full messagebus implementation to references/messagebus.md
- Trim test section to one representative test
- Remove external event consumer (in reference file)
- Keep concepts + command/event definitions in SKILL.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add "(Recommended)" label to Option A (Direct SQL Queries)
- Add "read vs write" and "denormalized views" trigger phrases
- Clarify that Option A is the starting point for most cases

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add "TDD", "unit tests", "integration tests" trigger phrases
- Replace ASCII art test pyramid with concise list
- Keep all practical guidance and examples

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add "migrate to clean architecture" and "legacy modernization" triggers
- Keep philosophy + adoption order diagram in SKILL.md
- Keep Step 1 (Service Layer) as example in SKILL.md
- Extract Steps 2-6 to references/refactoring-steps.md
- Keep migration checklist + common pitfalls in SKILL.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix plugin.json validation errors (move attribution to description, remove unsupported agents field)
- Add scripts/validate-plugins.sh for quick plugin validation
- Add .githooks/pre-commit to validate modified plugins on commit
- Add GitHub Actions workflow for CI validation
- Add SessionStart hook to auto-configure git hooks path

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add fetch-depth: 0 to checkout for PR base comparison
- Add continue-on-error for informational diff step

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sodre
sodre merged commit 7a42fd5 into main Jan 25, 2026
1 check passed
@sodre
sodre deleted the feat/cosmic-python branch January 25, 2026 04:23
sodre added a commit that referenced this pull request Jan 26, 2026
Add template #5 showing a multi-entity single-table design with nested
blocks for attribute header/value pairs, modeled after AWS SocialNetwork8.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
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