feat: teach learn workflow to create deepschemas and deepreview rules#327
Open
feat: teach learn workflow to create deepschemas and deepreview rules#327
Conversation
Rules with strategy all_changed_files or matches_together and a **/* matcher now get git diff main..HEAD pre-fetched and injected into the review instruction file. The diff is sorted by filepath to group files by directory, reducing reviewer turn count. Diff is scoped to the rule's source_dir so subdirectory .deepreview files get narrower diffs. Also streamlines the /review skill to skip the get_configured_reviews call and go straight to get_review_instructions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The learn workflow now evaluates whether deepschemas or deepreview rules could prevent issues encountered during a session, covering both process mistakes and the substance of the work. Adds a "Preventable" classification, a new Step 7 with actionable instructions for creating anonymous/named deepschemas and deepreview rules, and a process requirement ensuring prevention opportunities are always evaluated. Also adds a filesystem-verifiable requirement to the deepschema meta-schema, ensuring all deepschema requirements can be checked from filesystem assets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…quirements - Add .deepwork/schemas/claude_settings/ with deepschema.yml (semantic requirements) and vendored SchemaStore JSON Schema for structural validation - Add no-structural-requirements rule to deepschema standard schema: requirements must not restate what json_schema_path already enforces - Update /deepschema skill with JSON Schema First guidance: maximize structural validation, check SchemaStore for existing schemas, vendor local copies Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…utomation The learn workflow now evaluates prevention opportunities and creates DeepSchemas and DeepReview rules. Updated three sections in architecture.md to document this capability. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Requirements about author understanding (sandbox path semantics, automode defaults replacement, attribution deprecation, sandbox write paths) are not filesystem-verifiable. Moved them to the instructions section and kept only requirements that can be checked by examining file contents. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ements - Add built-in requirements_file deepschema for RFC 2119 spec files - Add JOBS-REQ-012 spec for learn workflow prevention automation - Add DW-REQ-011.10 requirement quality constraints for deepschemas - Add anonymous deepschemas validating JOBS-REQ-012 and DW-REQ-011.10 - Improve requirements_traceability review to prefer anonymous deepschemas for single-file requirements over tests - Fix multi-keyword requirements in DW-REQ-011 (011.6.3, 011.7.3, 011.8.7) - Fix REVIEW-REQ-005.7 sequential ordering - Fix job_schema_instruction_compatibility description accuracy Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n main) The review agent moved section 005.7 to the end for sequential ordering, but this section exists on main already — the reorder was out of scope. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds test_returns_both_named_and_anonymous to TestGetSchemasForFileFast, confirming that when a file matches both a named schema (via glob) and an anonymous schema (via co-located .deepschema file), both are returned. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
nhorton
commented
Apr 2, 2026
Move from .deepwork/schemas/ (project-local) to src/deepwork/standard_schemas/ so it ships with the package and is auto-discovered for all users. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Call out that verification commands serve the same structural enforcement role as json_schema_path for non-JSON files (markdown, shell, etc.). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file's only branch change was reformatting git-diff code that already exists on main — not relevant to this PR. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The git_diff_output feature on ReviewTask (REVIEW-REQ-004.11, REVIEW-REQ-005.7) added complexity without sufficient benefit. Removes the field, helper functions, spec requirements, and tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The e2e test was running claude without the plugin, so the deepschema_write PostToolUse hook never fired. This meant invalid job.yml files got no immediate validation feedback, wasting turns. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
learnworkflow now evaluates whether DeepSchemas or DeepReview rules could prevent issues encountered during a session, and creates them as outputs (deepschemas/deepreviewsstep arguments, new Step 7, "Prevention Opportunities Evaluated" process requirement)claude_settingsDeepSchema: New named schema with vendored JSON Schema for.claude/settings.jsonvalidation — enforces bash wildcard word boundaries, read/edit path prefixes, no secrets in shared settings, etc.json_schema_pathover requirements, with SchemaStore vendoring instructionsrequirements_filebuilt-in schema: New standard schema for RFC 2119 requirement spec files (*REQ-*.md) — enforces keyword usage, sequential numbering, unique IDs, testabilityTest plan
uv run pytestpasses🤖 Generated with Claude Code