Django 测试策略,包括 pytest-django、TDD 方法、factory_boy、模拟、覆盖率以及测试 Django REST Framework API。
73
62%
Does it follow best practices?
Impact
96%
1.28xAverage score across 3 eval scenarios
Advisory
Suggest reviewing before use
Optimize this skill with Tessl
npx tessl skill review --optimize ./docs/zh-CN/skills/django-tdd/SKILL.mdQuality
Discovery
82%Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.
This description excels at specificity and distinctiveness by naming concrete tools and methodologies (pytest-django, factory_boy, TDD, DRF API testing). Its main weakness is the absence of an explicit 'Use when...' clause, which would help Claude know exactly when to select this skill. Adding trigger guidance would elevate this from a good to excellent description.
Suggestions
Add an explicit 'Use when...' clause, e.g., 'Use when the user asks about writing Django tests, setting up pytest-django, creating test factories, mocking in Django, or testing DRF endpoints.'
Consider adding file extension or pattern triggers like 'tests.py', 'conftest.py', or 'test_*.py' to help with file-based skill selection.
| Dimension | Reasoning | Score |
|---|---|---|
Specificity | Lists multiple specific concrete actions and tools: pytest-django, TDD methodology, factory_boy, mocking, coverage, and testing Django REST Framework APIs. These are concrete, identifiable capabilities. | 3 / 3 |
Completeness | Clearly answers 'what does this do' (Django testing strategies with specific tools), but lacks an explicit 'Use when...' clause or equivalent trigger guidance. Per rubric guidelines, missing 'Use when' caps completeness at 2. | 2 / 3 |
Trigger Term Quality | Includes strong natural keywords users would say: 'Django', 'pytest-django', 'TDD', 'factory_boy', 'mock/模拟', 'coverage/覆盖率', 'Django REST Framework', 'API', '测试' (test). These cover the major terms a user working with Django testing would naturally use. | 3 / 3 |
Distinctiveness Conflict Risk | Highly specific to Django testing with named tools (pytest-django, factory_boy, DRF). This is a clear niche that would not easily conflict with general Python testing, general Django development, or other framework skills. | 3 / 3 |
Total | 11 / 12 Passed |
Implementation
42%Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.
The skill provides comprehensive, executable Django testing examples covering all major areas (models, views, DRF, mocking, integration), which is its primary strength. However, it is severely over-long and monolithic — it reads more like a tutorial or reference manual than a concise skill file. Much of the content restates patterns Claude already knows, and the lack of any file splitting or progressive disclosure makes it inefficient for context window usage.
Suggestions
Reduce the body to ~100 lines focusing on project-specific conventions, key configuration (pytest.ini, test settings), and the factory pattern setup. Move detailed test examples for models, views, serializers, API, and mocking into separate referenced files.
Remove best practices that restate common knowledge (e.g., 'don't test Django internals', 'use fixtures', 'test edge cases') — Claude already knows these.
Add explicit workflow steps with validation checkpoints, e.g., '1. Write failing test → 2. Run pytest to confirm RED → 3. Implement minimal code → 4. Run pytest to confirm GREEN → 5. Check coverage with --cov → 6. Refactor if coverage gaps exist'.
Split into SKILL.md (overview + config + quick reference) with references to FACTORIES.md, API_TESTING.md, MOCKING.md, and INTEGRATION_TESTING.md for detailed examples.
| Dimension | Reasoning | Score |
|---|---|---|
Conciseness | Extremely verbose at ~500+ lines. Includes extensive boilerplate code that Claude already knows how to write (factory patterns, basic pytest fixtures, standard DRF test patterns). The best practices section restates common knowledge ('don't test Django internals', 'use fixtures'). Much of this could be condensed to patterns and key configurations only. | 1 / 3 |
Actionability | All code examples are concrete, executable, and copy-paste ready. Includes complete pytest.ini configuration, test settings, conftest.py fixtures, factory definitions, and full test examples covering models, views, serializers, and API endpoints. | 3 / 3 |
Workflow Clarity | The TDD Red-Green-Refactor cycle is mentioned but only superficially demonstrated. The integration test shows a clear multi-step flow with assertions at each step. However, there are no explicit validation checkpoints for the overall testing workflow itself (e.g., when to run coverage checks, how to handle failing tests in CI, no feedback loop for coverage gaps). | 2 / 3 |
Progressive Disclosure | Monolithic wall of content with no references to external files. Everything is inlined in a single massive document — factory definitions, configuration, model tests, view tests, API tests, mocking examples, integration tests, best practices, and coverage config. Much of this should be split into separate reference files (e.g., FACTORIES.md, API_TESTING.md, CONFIGURATION.md). | 1 / 3 |
Total | 7 / 12 Passed |
Validation
81%Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.
Validation — 9 / 11 Passed
Validation for skill structure
| Criteria | Description | Result |
|---|---|---|
skill_md_line_count | SKILL.md is long (730 lines); consider splitting into references/ and linking | Warning |
frontmatter_unknown_keys | Unknown frontmatter key(s) found; consider removing or moving to metadata | Warning |
Total | 9 / 11 Passed | |
841beea
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.