dsh-plugin-strict-spec 0.5.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/README.md +13 -13
  2. package/README.zh.md +10 -12
  3. package/dist/cli/strict-spec-cli.js +111 -778
  4. package/dist/skills/strict-roadmap-plan/SKILL.md +49 -139
  5. package/dist/skills/strict-roadmap-recommend/SKILL.md +63 -282
  6. package/dist/skills/strict-roadmap-reorder/SKILL.md +40 -158
  7. package/dist/skills/strict-roadmap-review/SKILL.md +48 -144
  8. package/dist/skills/strict-roadmap-transition/SKILL.md +52 -274
  9. package/dist/skills/strict-scene-edit/SKILL.md +51 -121
  10. package/dist/skills/strict-spec-apply/SKILL.md +63 -173
  11. package/dist/skills/strict-spec-architecture/SKILL.md +39 -97
  12. package/dist/skills/strict-spec-archive/SKILL.md +57 -127
  13. package/dist/skills/strict-spec-auto/SKILL.md +95 -271
  14. package/dist/skills/strict-spec-brainstorm/SKILL.md +73 -176
  15. package/dist/skills/strict-spec-bugfix/SKILL.md +101 -225
  16. package/dist/skills/strict-spec-design/SKILL.md +55 -124
  17. package/dist/skills/strict-spec-design-sync/SKILL.md +55 -123
  18. package/dist/skills/strict-spec-init/SKILL.md +45 -93
  19. package/dist/skills/strict-spec-maintenance/SKILL.md +44 -94
  20. package/dist/skills/strict-spec-modify/SKILL.md +44 -113
  21. package/dist/skills/strict-spec-propose/SKILL.md +180 -495
  22. package/dist/skills/strict-spec-review/SKILL.md +138 -274
  23. package/dist/skills/strict-spec-ship/SKILL.md +25 -60
  24. package/dist/skills/strict-spec-spec-edit/SKILL.md +35 -84
  25. package/dist/skills/strict-spec-sync-specs/SKILL.md +44 -94
  26. package/dist/skills/strict-tech-edit/SKILL.md +43 -124
  27. package/dist/skills/strict-tech-sync/SKILL.md +60 -162
  28. package/package.json +2 -1
  29. package/dist/skills/strict-spec-verify/SKILL.md +0 -79
@@ -11807,6 +11807,7 @@ mutation_surfaces:
11807
11807
  - skills/strict-roadmap-transition/SKILL.md
11808
11808
  - skills/strict-roadmap-reorder/SKILL.md
11809
11809
  - skills/strict-scene-edit/SKILL.md
11810
+ - plugins/dsh-strict-spec/dist/skills/*/SKILL.md
11810
11811
  mechanism: agent-guidance
11811
11812
  classification: remaining-direct-writer
11812
11813
  operations:
@@ -11874,7 +11875,6 @@ mutation_surfaces:
11874
11875
  read-only-skill-guidance:
11875
11876
  path_patterns:
11876
11877
  - skills/strict-spec-ship/SKILL.md
11877
- - skills/strict-spec-verify/SKILL.md
11878
11878
  mechanism: agent-guidance
11879
11879
  classification: read-only
11880
11880
  operations:
@@ -11886,7 +11886,6 @@ mutation_surfaces:
11886
11886
  - change-delta-state
11887
11887
  - roadmap-state
11888
11888
  evidence:
11889
- - skills/strict-spec-verify/SKILL.md
11890
11889
  - skills/strict-spec-ship/SKILL.md
11891
11890
  generated-document-guidance:
11892
11891
  path_patterns:
@@ -34612,9 +34611,6 @@ var GENERATE_NAMED_ARGS_COMMAND = `${COMMAND_PREFIX} generate <change-name> <pro
34612
34611
  var READY_COMMAND = `${COMMAND_PREFIX} ready <change-name>`;
34613
34612
  var NEXT_COMMAND = `${COMMAND_PREFIX} next <change-name>`;
34614
34613
  var CHECK_WORKFLOW_STATE_COMMAND = `${COMMAND_PREFIX} check-workflow-state`;
34615
- var STRICT_WORKFLOW_EXISTENCE_STEP_SNIPPET = `Before any other step, run \`${CHECK_WORKFLOW_STATE_COMMAND}\``;
34616
- var STRICT_WORKFLOW_INIT_GUIDANCE_SNIPPET = "stop immediately and tell the user to run `/strict-spec-init`";
34617
- var STRICT_WORKFLOW_NO_INIT_SNIPPET = "Do not run `init` from this skill.";
34618
34614
  var STRICT_SKILL_NAME_PREFIXES = [
34619
34615
  "strict-spec-",
34620
34616
  "strict-roadmap-",
@@ -34625,86 +34621,7 @@ var STRICT_SKILL_NAME_PREFIX_EXPECTATION = STRICT_SKILL_NAME_PREFIXES.map((prefi
34625
34621
  function hasStrictSkillNamePrefix(name) {
34626
34622
  return STRICT_SKILL_NAME_PREFIXES.some((prefix) => name.startsWith(prefix));
34627
34623
  }
34628
- var ROADMAP_DETAILS_GUIDANCE_SNIPPET = "`details` field";
34629
- var ROADMAP_SPLIT_PLANNED_CHANGE_SNIPPET = "standalone planned-change";
34630
- var ROADMAP_GENERATE_MILESTONE_SNIPPET = "roadmap-generate milestone";
34631
- var ROADMAP_PLANNED_CHANGE_CLI_AUTHORING_SNIPPET = "roadmap-generate planned-change";
34632
- var ROADMAP_CANONICAL_FILENAME_SNIPPET = "<milestone-id>-<planned-change-id>.yaml";
34633
- var ROADMAP_FIX_NAMES_SNIPPET = "roadmap-sync --fix-names";
34634
- var ROADMAP_ACTIVE_CONFLICT_SNIPPET = "active strict change conflicts";
34635
- var ROADMAP_PLAN_EXECUTABLE_DETAIL_SNIPPET = "executable planning context";
34636
- var ROADMAP_REVIEW_INCOMPLETE_SCOPE_SNIPPET = "all milestones whose status is not complete";
34637
- var ROADMAP_REVIEW_DIRECT_FIX_SNIPPET = "use roadmap-generate milestone for milestone YAML shape";
34638
- var ROADMAP_REVIEW_DETAIL_ELABORATION_SNIPPET = "concrete and executable";
34639
- var ROADMAP_REVIEW_INTAKE_ANSWER_SNIPPET = "check milestone intake_questions for answer evidence";
34640
- var ROADMAP_ARCHIVE_DEFAULT_ALL_SNIPPET = "default to all unarchived milestones";
34641
- var ROADMAP_ARCHIVE_COMPLETE_ONLY_SNIPPET = "only milestones whose derived status is complete";
34642
- var ROADMAP_ARCHIVE_PLANNED_CHANGE_SNIPPET = "completed standalone planned-change";
34643
- var ROADMAP_ORDER_SOURCE_SNIPPET = "Use `roadmap-status` or `roadmap-overview` order, never id-prefix order";
34644
- var ROADMAP_REORDER_PLACEMENT_FLAGS_SNIPPET = "Pass exactly one of `--before`, `--after`, or `--order`";
34645
- var ROADMAP_REORDER_RENUMBER_FALLBACK_SNIPPET = "If no integer gap exists between the requested neighbours, run\n`roadmap-renumber` first, then rerun the reorder.";
34646
- var ROADMAP_TRANSITION_EXPLICIT_OPERATION_SNIPPET = "**The operation must be explicit.**";
34647
- var ROADMAP_TRANSITION_STOP_WITHOUT_OPERATION_SNIPPET = "stop and ask the user which of the eight is intended";
34648
- var ROADMAP_TRANSITION_INVERSE_PAIRS_SNIPPET = "`pause` and `resume` undo each other, `defer` and `refine` undo each other";
34649
- var ROADMAP_TRANSITION_ARCHIVED_FROZEN_SNIPPET = "Archived milestones and archived planned changes are frozen history";
34650
- var ROADMAP_REORDER_ARCHIVED_FROZEN_SNIPPET = "Archived milestones are frozen history";
34651
- var ROADMAP_TRANSITION_PAUSE_SKIP_REASON_SNIPPET = "milestone-paused";
34652
- var ROADMAP_TRANSITION_RESUME_CLEARS_PAUSE_SNIPPET = "Resume deletes the `paused` field";
34653
- var ROADMAP_TRANSITION_DEFER_IS_NOT_PAUSE_SNIPPET = "**Deferral is not a pause.**";
34654
- var ROADMAP_TRANSITION_DEFER_SKIP_REASON_SNIPPET = "milestone-awaiting-refinement";
34655
- var ROADMAP_TRANSITION_REFINE_ASKS_THE_HUMAN_SNIPPET = "whether the recorded precondition is now true";
34656
- var ROADMAP_TRANSITION_REOPEN_FROZEN_SNIPPET = "frozenPlannedChanges";
34657
- var ROADMAP_TRANSITION_REOPEN_SEEDS_FOLLOW_UP_SNIPPET = "seededFollowUp";
34658
- var ROADMAP_TRANSITION_SYNC_INVENTS_NOTHING_SNIPPET = "Do not invent planned changes during a sync";
34659
- var ROADMAP_TRANSITION_SINGLE_COMMAND_SNIPPET = "Perform exactly one operation per invocation, through its one owning command";
34660
- var ROADMAP_MOVE_ALLOW_COMPLETE_SNIPPET = "--allow-complete";
34661
- var ROADMAP_MOVE_NO_CHANGE_WRITES_SNIPPET = "never writes under `.strict-spec-driven/changes/`";
34662
- var ROADMAP_PLAN_REVIEW_SNIPPET = "Review the roadmap plan before handoff";
34663
- var ROADMAP_SCRIPTED_RECOMMEND_SNIPPET = "treat the command's selected planned change as authoritative";
34664
- var ROADMAP_RECOMMEND_BEFORE_CONTEXT_SNIPPET = "before reading broad roadmap context";
34665
- var ROADMAP_READY_HANDOFF_SNIPPET = "Use `ready` as the proposal handoff validation";
34666
- var ROADMAP_AUTO_POPULATED_HANDOFF_SNIPPET = "populated change scaffold";
34667
- var ROADMAP_PROPOSAL_ONLY_SNIPPET = "Do not auto-invoke `/strict-spec-auto` during strict-spec-propose";
34668
- var PROPOSE_MILESTONE_SELECTOR_SNIPPET = "Resolve the selector to exactly one milestone id";
34669
- var PROPOSE_MILESTONE_RECOMMEND_SNIPPET = "roadmap-recommend --milestone";
34670
- var PROPOSE_MILESTONE_ROADMAP_LINK_SNIPPET = "--milestone <milestone-id> --planned-change <change-name>";
34671
- var PROPOSE_MILESTONE_CREATE_SNIPPET = "roadmap-recommend --milestone <resolved-milestone-id> --create";
34672
- var ROADMAP_CREATE_SNIPPET = "then run `strict-spec-cli roadmap-recommend --milestone <resolved-milestone-id> --create`. Without a user roadmap hint, run `strict-spec-cli roadmap-recommend --create`";
34673
- var ROADMAP_CREATED_CHANGE_NAME_SNIPPET = "Use `createdChange.name` as `<change-name>` in every later command";
34674
- var ROADMAP_CREATE_IN_RECOMMENDING_CALL_SNIPPET = "The change is created in the same call that recommends it";
34675
- var ROADMAP_SECOND_CREATING_CALL_SNIPPET = "Run the same command as step 1 with `--create` added";
34676
- var ROADMAP_NO_SECOND_CALL_SNIPPET = "do not run `roadmap-recommend` again";
34677
- var PROPOSE_READ_ONLY_SELECTION_SNIPPET = "Then obtain the planned change from the command that owns selection:";
34678
- var CALLER_CHOSEN_ROADMAP_CHANGE_NAME_SNIPPET = "the change name unless the user gave one";
34679
- var PROPOSE_MILESTONE_BLOCKER_SNIPPET = "When no planned change comes back, report the reason and stop.";
34680
- var PROPOSE_MILESTONE_NO_ALLOW_UNREFINED_SNIPPET = "do not add `--allow-unrefined`";
34681
- var AUTO_TARGETED_CONTEXT_RESET_SNIPPET = "Reset context from targeted files";
34682
- var AUTO_RESUME_POPULATED_SCAFFOLD_SNIPPET = "resume the existing populated strict change scaffold without regenerating planning artifacts";
34683
- var AUTO_REUSE_REGRESSION_EVIDENCE_SNIPPET = "exactly matches the configured complete project regression command";
34684
- var PROPOSAL_CHECKPOINT_SNIPPET = "proposal checkpoint";
34685
- var PROPOSAL_CHECKPOINT_DECISION_READY_SNIPPET = "decision-ready detail";
34686
- var PROPOSAL_CHECKPOINT_DETAIL_CRITERIA_SNIPPET = "scope, unchanged behavior, design decisions, task coverage, unresolved-question impact, delta spec scenarios, and delta tech use when applicable";
34687
- var PROPOSAL_CHECKPOINT_DOCUMENTATION_FIX_SNIPPET = "fix safe, in-scope documentation gaps";
34688
- var REVIEW_AUTO_FIX_SNIPPET = "Automatically fix safe in-scope review findings";
34689
- var REVIEW_POST_FIX_REGRESSION_SNIPPET = "rerun strict verification plus the configured complete regression command after review-time changes";
34690
- var CURRENT_CHANGE_TECH_SYNC_SNIPPET = "final current-change tech sync";
34691
- var CURRENT_CHANGE_SCOPE_SNIPPET = "attributable tracked and untracked files";
34692
- var CURRENT_CHANGE_DELTA_TECH_SNIPPET = "current-change delta tech";
34693
- var NO_POST_ARCHIVE_DEFERRAL_SNIPPET = "confirmed as reusable";
34694
- var ARCHIVE_APPLIES_RECOMMENDATION_SNIPPET = "apply the recommendation the bounded evidence supports without pausing for operator confirmation";
34695
- var NOT_REUSABLE_CLASSIFICATION_SNIPPET = "record the classification that the pattern is not reusable";
34696
- var ARCHIVE_DECISION_REPORT_SNIPPET = "report the applied decision in the archive summary";
34697
- var REVIEW_REFLECTION_RECOMMENDATION_SNIPPET = "report the finding with the recommendation you derived";
34698
- var REGRESSION_EVIDENCE_CARVE_OUT_SNIPPET = "a write the configured regression command neither compiles nor reads — currently a change-local" + " delta-tech artifact or a lesson — does not invalidate passing complete project regression evidence";
34699
- var SHARED_SCHEMA_CACHE_ROOT_SNIPPET = "~/.strict-spec-schemas/";
34700
- var SHARED_SCHEMA_FILE_LOOKUP_SNIPPET = "When a YAML artifact already declares `schema_file`, resolve that relative path under the shared cache root";
34701
- var SAMPLE_SHOW_LOOKUP_SNIPPET = "sample-show";
34702
- var LOCAL_EXAMPLES_DIRECTORY_SNIPPET = "do not rely on a local `examples` directory";
34703
- var BUGFIX_KNOWN_BUG_SNIPPET = "known bug";
34704
- var BUGFIX_REPRODUCE_BEFORE_FIXING_SNIPPET = "Reproduce before fixing";
34705
- var BUGFIX_REGRESSION_TEST_SNIPPET = "failing regression";
34706
- var BUGFIX_MINIMAL_FIX_SNIPPET = "minimal fix";
34707
- var BUGFIX_UNCLEAR_ISSUE_HANDOFF_SNIPPET = "strict-spec-brainstorm";
34624
+ var AUTO_GATE_STEP_ANCHORS = ["Review", "Archive"];
34708
34625
  var REQUIREMENT_INTERROGATION_SKILLS = [
34709
34626
  "strict-spec-brainstorm",
34710
34627
  "strict-spec-propose",
@@ -34713,19 +34630,11 @@ var REQUIREMENT_INTERROGATION_SKILLS = [
34713
34630
  ];
34714
34631
  var AUTHORING_PROTOCOL_POINTER_COMMAND = `${COMMAND_PREFIX} yaml-authoring-protocol`;
34715
34632
  var REQUIREMENT_INTERROGATION_HEADING = "## Requirement Interrogation";
34633
+ var CHANGE_INTAKE_GATE_HEADING = "## Change Intake Question Gate";
34716
34634
  var PREFERRED_HUMAN_LANGUAGE_HEADING = "## Preferred Human Language";
34717
- var SKILL_COMMANDS_HEADING = "## This Skill's Commands";
34718
- var PREFERRED_HUMAN_LANGUAGE_SNIPPETS = [
34719
- { snippet: "`.strict-spec-driven/config.yaml`", element: "the config file the language preference is read from" },
34720
- { snippet: "`preferred_human_language`", element: "the config field name" },
34721
- { snippet: "common human language", element: "the field's meaning as the user's common human language" },
34722
- { snippet: "not a programming language", element: "the distinction from a programming language" },
34723
- { snippet: "comply", element: "the requirement to comply with the configured language" },
34724
- { snippet: "the active user message", element: "the active-user-message override" }
34725
- ];
34726
- var STRICT_WORKFLOW_SHARED_ELEMENTS = [
34727
- { snippet: STRICT_WORKFLOW_INIT_GUIDANCE_SNIPPET, element: "the init guidance" },
34728
- { snippet: STRICT_WORKFLOW_NO_INIT_SNIPPET, element: "the do-not-run-init statement" }
34635
+ var PREFERRED_HUMAN_LANGUAGE_IDENTIFIERS = [
34636
+ ".strict-spec-driven/config.yaml",
34637
+ "preferred_human_language"
34729
34638
  ];
34730
34639
  var TASK_GENERATOR_PATTERNS = [
34731
34640
  /generate\s+<change(?:-name)?>\s+tasks/,
@@ -34737,259 +34646,70 @@ function directsTaskListAuthoring(content) {
34737
34646
  return true;
34738
34647
  return content.includes("tasks.yaml") && TASK_SECTION_NAMES_IN_PROSE.every((sectionName) => content.includes(sectionName));
34739
34648
  }
34740
- var TASK_ORDER_APPLY_SKILL = "strict-spec-apply";
34741
- var TASK_ORDER_PLACEMENT_SNIPPETS = [
34742
- {
34743
- snippet: "`--before <task-id>` or `--after <task-id>`",
34744
- element: "the positional arguments that place a task within its section"
34745
- },
34746
- {
34747
- snippet: "task order is the order `apply` walks",
34748
- element: "why task order matters, namely that it is the order apply walks"
34749
- },
34750
- {
34751
- snippet: "must run before existing pending work is anchored rather than appended",
34752
- element: "the rule that work which must run before existing pending tasks is anchored, not appended"
34753
- }
34754
- ];
34755
- var TASK_ORDER_APPLY_SNIPPETS = [
34756
- {
34757
- snippet: "`apply` is positional, not addressed",
34758
- element: "that apply completes whichever task is next in list order rather than one named by id"
34759
- },
34760
- {
34761
- snippet: "--status complete",
34762
- element: "addressing a task by id to record work finished out of list order"
34763
- },
34764
- {
34765
- snippet: "`--before <task-id>` or `--after <task-id>`",
34766
- element: "repositioning the remaining tasks when the list order itself is wrong"
34767
- }
34768
- ];
34769
- var REQUIREMENT_INTERROGATION_SNIPPETS = [
34770
- { snippet: "never answered from repository evidence", element: "the rule that requirement items are never answered from repository evidence" },
34771
- { snippet: "requirement-problem", element: "the canonical requirement id 'requirement-problem'" },
34772
- { snippet: "requirement-outcome", element: "the canonical requirement id 'requirement-outcome'" },
34773
- { snippet: "requirement-trigger", element: "the canonical requirement id 'requirement-trigger'" },
34774
- { snippet: "requirement-non-goals", element: "the canonical requirement id 'requirement-non-goals'" },
34775
- { snippet: "requirement-interpretation", element: "the canonical requirement id 'requirement-interpretation'" },
34776
- { snippet: "one question at a time", element: "the asking-technique rule of one question at a time" },
34777
- { snippet: "concrete guess", element: "the asking-technique rule that a question carries a concrete guess rather than a blank prompt" },
34778
- { snippet: "names a solution", element: "the asking-technique rule that rejects an answer naming a solution instead of a problem" },
34779
- { snippet: "explain why the question matters", element: "the duty to explain a question before posing it" },
34780
- { snippet: "state the reason for the pushback", element: "the duty to state the reason for pushback instead of silently re-asking" }
34781
- ];
34782
34649
  var REVIEW_INDEPENDENCE_SKILLS = [
34783
34650
  "strict-spec-review",
34784
- "strict-spec-auto"
34651
+ "strict-spec-auto",
34652
+ "strict-spec-bugfix"
34785
34653
  ];
34786
34654
  var REVIEW_INDEPENDENCE_HEADING = "## Review Independence";
34787
- var FRESH_CONTEXT_REVIEWER_SNIPPET = "a sub-agent started with a fresh context";
34788
- var FRESH_CONTEXT_REVIEWER_OPTIONAL_SNIPPET = "This is a recommendation, not a requirement";
34789
- var FRESH_CONTEXT_REVIEWER_READ_ONLY_SNIPPET = "edits no file";
34790
- var REVIEW_INDEPENDENCE_SNIPPETS = [
34791
- {
34792
- snippet: "Read only `proposal.yaml`, `design.yaml`, `questions.yaml`, and the delta specs",
34793
- element: "the planning artifacts and delta specs the requirement is reconstructed from"
34794
- },
34795
- {
34796
- snippet: "before any implementation file, diff, or test file is read",
34797
- element: "the rule that requirement reconstruction completes before the implementation is read"
34798
- },
34799
- {
34800
- snippet: "a numbered list of acceptance items",
34801
- element: "the duty to write down a numbered list of acceptance items during reconstruction"
34802
- },
34803
- {
34804
- snippet: "Never derive the requirement from the implementation",
34805
- element: "the prohibition on deriving the requirement from the implementation"
34806
- },
34807
- {
34808
- snippet: "an outside reviewer who did not write them",
34809
- element: "the outside-reviewer stance the changed files are read in"
34810
- },
34811
- {
34812
- snippet: "`satisfied`, `not satisfied`, or `unprovable from evidence`",
34813
- element: "the three verdict values every acceptance item resolves to"
34814
- },
34815
- {
34816
- snippet: "an implementation reference and a test reference",
34817
- element: "the duty to attach an implementation reference and a test reference to each verdict"
34818
- },
34819
- {
34820
- snippet: "is not a substitute for per-item verdicts",
34821
- element: "the rule that a blanket claim of matching the proposal is not a substitute for per-item verdicts"
34822
- },
34823
- {
34824
- snippet: "blocks the archive recommendation",
34825
- element: "the rule that an unprovable verdict on a MUST-strength requirement blocks the archive recommendation"
34826
- },
34827
- {
34828
- snippet: FRESH_CONTEXT_REVIEWER_SNIPPET,
34829
- element: "the recommendation to hand the review to a fresh-context sub-agent where the running harness provides one"
34830
- },
34831
- {
34832
- snippet: FRESH_CONTEXT_REVIEWER_OPTIONAL_SNIPPET,
34833
- element: "the statement that the fresh-context reviewer is a recommendation rather than a requirement"
34834
- },
34835
- {
34836
- snippet: FRESH_CONTEXT_REVIEWER_READ_ONLY_SNIPPET,
34837
- element: "the read-only boundary of the fresh-context reviewer"
34838
- }
34839
- ];
34840
34655
  var SCENE_FIRST_ROUTING_HEADING = "## Scene-First Requirement Routing";
34841
- var SCENE_COVERAGE_DIAGNOSTIC_SNIPPET = "naming neither a covering requirement nor an explicit no-coverage reason";
34842
- var SCENE_COVERAGE_REMEDY_SNIPPET = "diagnostic names the runnable command";
34843
34656
  var SCENE_STATUS_COMMAND = `${COMMAND_PREFIX} scene-status`;
34844
34657
  var SCENE_DELTA_GENERATE_COMMAND = `${COMMAND_PREFIX} generate <change-name> delta-scene --<named-args>`;
34845
- var SCENE_FIRST_ROUTING_SNIPPETS = [
34846
- { snippet: "before any requirement is drafted", element: "that the scene questions come before any requirement" },
34847
- { snippet: "who acts", element: "the actor question" },
34848
- { snippet: "what must already be true", element: "the precondition question" },
34849
- { snippet: "step by ordered step", element: "the ordered main-flow question" },
34850
- { snippet: "what triggers each exception flow", element: "the exception-flow question" },
34851
- { snippet: "Author the scene before the delta spec", element: "the scene-before-requirement authoring order" },
34852
- { snippet: "`scene-state`", element: "the scene artifact kind the routing writes" },
34853
- { snippet: "record why no scene applies", element: "what a purely technical change records instead of a scene" },
34854
- {
34855
- snippet: "triggered by the presence of a scene, never by the presence of a spec",
34856
- element: "that scene checking is triggered by a scene rather than by a spec"
34857
- },
34858
- {
34859
- snippet: "Do not invent an actor flow to fill the artifact",
34860
- element: "the ban on inventing a flow to satisfy the artifact"
34861
- }
34862
- ];
34658
+ var SCENE_FIRST_ROUTING_SKILLS = ["strict-spec-propose", "strict-spec-brainstorm"];
34863
34659
  var DELEGATED_PROCEDURES_HEADING = "## Delegated Procedures";
34864
34660
  var DELEGATION_DECLARATION_PATTERN = new RegExp(String.raw`^[-*]\s*([a-z0-9]+(?:-[a-z0-9]+)*):\s*owned by\s+\`((?:` + STRICT_SKILL_NAME_PREFIXES.join("|") + String.raw`)[a-z0-9]+(?:-[a-z0-9]+)*)\``, "gm");
34865
- var delegationDeclaration = (obligation, owner) => `${obligation}: owned by \`${owner}\``;
34866
34661
  var DELEGABLE_OBLIGATIONS = {
34867
34662
  "requirement-interrogation": {
34868
34663
  element: "the requirement-interrogation guidance",
34869
- ownerHeading: REQUIREMENT_INTERROGATION_HEADING,
34870
- ownerSnippets: REQUIREMENT_INTERROGATION_SNIPPETS,
34871
- waivedSnippets: []
34664
+ anchor: "Requirement Interrogation"
34872
34665
  },
34873
34666
  "scene-first-routing": {
34874
34667
  element: "the scene-first requirement-routing guidance",
34875
- ownerHeading: SCENE_FIRST_ROUTING_HEADING,
34876
- ownerSnippets: SCENE_FIRST_ROUTING_SNIPPETS,
34877
- waivedSnippets: []
34878
- },
34879
- "review-independence": {
34880
- element: "the review-independence contract",
34881
- ownerHeading: REVIEW_INDEPENDENCE_HEADING,
34882
- ownerSnippets: REVIEW_INDEPENDENCE_SNIPPETS,
34883
- waivedSnippets: []
34884
- },
34885
- "archive-tech-sync": {
34886
- element: "the final current-change tech sync performed before archive",
34887
- ownerSnippets: [
34888
- { snippet: CURRENT_CHANGE_TECH_SYNC_SNIPPET, element: "the final current-change tech sync" },
34889
- { snippet: CURRENT_CHANGE_SCOPE_SNIPPET, element: "the scan scope the sync is bounded to" },
34890
- { snippet: CURRENT_CHANGE_DELTA_TECH_SNIPPET, element: "capturing a confirmed convention as current-change delta tech" },
34891
- { snippet: ARCHIVE_APPLIES_RECOMMENDATION_SNIPPET, element: "applying the recommendation instead of pausing for an operator answer" },
34892
- { snippet: NOT_REUSABLE_CLASSIFICATION_SNIPPET, element: "the recorded not-reusable classification that closes a finding" },
34893
- { snippet: ARCHIVE_DECISION_REPORT_SNIPPET, element: "reporting the applied decision in the archive summary" },
34894
- { snippet: NO_POST_ARCHIVE_DEFERRAL_SNIPPET, element: "the ban on deferring a confirmed reusable convention past archive" }
34895
- ],
34896
- waivedSnippets: [
34897
- CURRENT_CHANGE_TECH_SYNC_SNIPPET,
34898
- CURRENT_CHANGE_SCOPE_SNIPPET,
34899
- CURRENT_CHANGE_DELTA_TECH_SNIPPET,
34900
- ARCHIVE_APPLIES_RECOMMENDATION_SNIPPET,
34901
- NOT_REUSABLE_CLASSIFICATION_SNIPPET,
34902
- ARCHIVE_DECISION_REPORT_SNIPPET,
34903
- NO_POST_ARCHIVE_DEFERRAL_SNIPPET
34904
- ]
34905
- },
34906
- "code-review-evidence": {
34907
- element: "the requirement for direct code review evidence before archive",
34908
- ownerSnippets: [
34909
- { snippet: "direct code review evidence", element: "the requirement for direct code review evidence before archive" }
34910
- ],
34911
- waivedSnippets: ["direct code review evidence"]
34668
+ anchor: "Scene-First Requirement Routing"
34912
34669
  },
34913
- "blocking-coverage": {
34914
- element: "the rule that a declared coverage contract is blocking review evidence",
34915
- ownerSnippets: [
34916
- { snippet: "is the coverage gate", element: "that the configured regression command is the coverage gate" },
34917
- { snippet: "never advisory output", element: "that a coverage failure is never advisory output" }
34918
- ],
34919
- waivedSnippets: []
34670
+ "change-intake-gate": {
34671
+ element: "the change-intake question gate",
34672
+ anchor: "Change Intake Question Gate"
34920
34673
  },
34921
34674
  "spec-artifact-routing": {
34922
34675
  element: "the routing that decides whether a change needs a delta spec or delta tech",
34923
- ownerSnippets: [
34924
- { snippet: "A strict change may legitimately have no delta spec", element: "that a change may legitimately have no delta spec" },
34925
- { snippet: "Create `delta-spec` artifacts only when the change modifies user-observable", element: "when a delta spec is created" },
34926
- { snippet: "If a technical-only change alters, adds, or retires an engineering rule", element: "when a technical-only change needs delta tech" }
34927
- ],
34928
- waivedSnippets: []
34929
- },
34930
- "change-intake-gate": {
34931
- element: "the change-intake question gate",
34932
- ownerSnippets: [
34933
- { snippet: "change-intake checklist", element: "the change-intake checklist" },
34934
- { snippet: "Do not ask the human for information already recoverable", element: "the rule against asking for recoverable information" },
34935
- { snippet: "Stop before implementation while `questions.yaml.open` is non-empty", element: "the rule that an open question stops implementation" }
34936
- ],
34937
- waivedSnippets: []
34676
+ anchor: "Spec and Technical Artifact Routing"
34938
34677
  },
34939
34678
  "task-list-authoring": {
34940
34679
  element: "the task-list authoring procedure",
34941
- ownerSnippets: [
34942
- { snippet: "one CLI invocation per task", element: "that each task is authored by its own CLI invocation" },
34943
- { snippet: "upserts by `(section, task-id)` and is idempotent", element: "the upsert-by-section-and-id semantics" },
34944
- { snippet: "`--validation-task <task-id>` and `--unit-test-task <task-id>`", element: "setting the testing gates" }
34945
- ],
34946
- waivedSnippets: []
34680
+ anchor: "Generate `tasks.yaml` with one CLI invocation per task"
34947
34681
  },
34948
34682
  "delta-artifact-authoring": {
34949
34683
  element: "the incremental delta-spec and delta-tech authoring procedure",
34950
- ownerSnippets: [
34951
- { snippet: "One requirement can include multiple scenario groups by repeating `--scenario`", element: "repeating a scenario group under one requirement" },
34952
- { snippet: "Scenarios append on their own, so nothing needs rebuilding or hand-editing to add one", element: "that scenarios append without a rebuild" },
34953
- { snippet: "Drop a single scenario with `--remove-scenario <requirement-id>:<scenario-id>`", element: "removing one scenario without touching its siblings" }
34954
- ],
34955
- waivedSnippets: []
34684
+ anchor: "Generate strict YAML delta specs only when specs change"
34956
34685
  },
34957
- "gitignore-hygiene": {
34958
- element: "the gitignore hygiene pass over generated artifacts",
34959
- ownerSnippets: [
34960
- { snippet: "run `git status --short` to find newly created untracked files", element: "finding newly created untracked files" },
34961
- { snippet: "add matching entries to `.gitignore`", element: "adding the matching ignore entries" },
34962
- { snippet: "do not ignore source code, configuration", element: "the rule that source and configuration are never ignored" }
34963
- ],
34964
- waivedSnippets: []
34686
+ "review-readiness-gate": {
34687
+ element: "the strict verify readiness gate that opens review",
34688
+ anchor: "Pass the readiness gate"
34689
+ },
34690
+ "review-independence": {
34691
+ element: "the review-independence contract",
34692
+ anchor: "Review Independence"
34965
34693
  },
34966
34694
  "implementation-order": {
34967
34695
  element: "the task implementation and completion procedure",
34968
- ownerSnippets: [
34969
- { snippet: "read relevant code before editing", element: "reading the relevant code before editing it" },
34970
- { snippet: "implement the next pending task", element: "implementing tasks in list order" },
34971
- { snippet: "never violate a MUST rule", element: "the ban on violating a MUST rule to finish a task" },
34972
- { snippet: "`apply` is positional, not addressed", element: "that apply completes the next task in list order rather than one named by id" }
34973
- ],
34974
- waivedSnippets: []
34696
+ anchor: "Implement tasks in order"
34697
+ },
34698
+ "gitignore-hygiene": {
34699
+ element: "the gitignore hygiene pass over generated artifacts",
34700
+ anchor: "Gitignore hygiene"
34975
34701
  },
34976
34702
  "lesson-outcome": {
34977
34703
  element: "the required lesson-outcome declaration before archive",
34978
- ownerSnippets: [
34979
- { snippet: "state explicitly either that a lesson was recorded or that none applies", element: "the duty to declare the lesson outcome either way" },
34980
- { snippet: "padded with filler", element: "the reason a manufactured lesson is worse than none" }
34981
- ],
34982
- waivedSnippets: []
34704
+ anchor: "Declare the lesson outcome (required)"
34705
+ },
34706
+ "archive-tech-sync": {
34707
+ element: "the final current-change tech sync performed before archive",
34708
+ anchor: "Run the final current-change tech sync"
34983
34709
  },
34984
34710
  "archive-execution": {
34985
34711
  element: "the archive execution procedure",
34986
- ownerSnippets: [
34987
- {
34988
- snippet: "if it is empty, treat the change as having no delta specs to merge",
34989
- element: "that an empty specs directory is merged as no delta specs rather than blocking"
34990
- }
34991
- ],
34992
- waivedSnippets: []
34712
+ anchor: "Archive the change"
34993
34713
  }
34994
34714
  };
34995
34715
  function parseDelegations(content) {
@@ -35005,17 +34725,25 @@ function parseDelegations(content) {
35005
34725
  function delegatesObligation(content, obligation) {
35006
34726
  return parseDelegations(content).some((entry) => entry.obligation === obligation);
35007
34727
  }
34728
+ function carriesAnchorHeading(content, anchor) {
34729
+ return content.split(`
34730
+ `).some((line) => line.trim() === `## ${anchor}`);
34731
+ }
34732
+ function carriesAnchor(content, anchor) {
34733
+ if (carriesAnchorHeading(content, anchor))
34734
+ return true;
34735
+ return content.split(`
34736
+ `).some((line) => {
34737
+ const label = line.match(/^\s*\d+[a-z]?\.\s+\*\*(.+?)\*\*/);
34738
+ return label?.[1] === anchor;
34739
+ });
34740
+ }
35008
34741
  var CORE_STRICT_SKILL_EXPECTATIONS = {
35009
34742
  "strict-spec-init": {
35010
34743
  requiredCommands: {
35011
34744
  init: `${COMMAND_PREFIX} init`
35012
34745
  },
35013
- requiredHeadings: ["## Steps", "## Rules"],
35014
- requiredSnippets: [
35015
- ".strict-spec-driven/",
35016
- "generate a concise `AGENTS.md`",
35017
- "never overwrite an existing `AGENTS.md`"
35018
- ]
34746
+ requiredHeadings: ["## Steps", "## Rules"]
35019
34747
  },
35020
34748
  "strict-spec-propose": {
35021
34749
  requiredCommands: {
@@ -35027,39 +34755,7 @@ var CORE_STRICT_SKILL_EXPECTATIONS = {
35027
34755
  ready: READY_COMMAND,
35028
34756
  verify: `${COMMAND_PREFIX} verify <change-name>`
35029
34757
  },
35030
- requiredHeadings: ["## Steps", "## Rules", SCENE_FIRST_ROUTING_HEADING],
35031
- requiredSnippets: [
35032
- ".strict-spec-driven/",
35033
- "/strict-spec-auto",
35034
- ...SCENE_FIRST_ROUTING_SNIPPETS.map((expectation) => expectation.snippet),
35035
- ROADMAP_PROPOSAL_ONLY_SNIPPET,
35036
- "strict-roadmap-recommend",
35037
- PROPOSE_MILESTONE_SELECTOR_SNIPPET,
35038
- PROPOSE_MILESTONE_RECOMMEND_SNIPPET,
35039
- ROADMAP_SCRIPTED_RECOMMEND_SNIPPET,
35040
- ROADMAP_RECOMMEND_BEFORE_CONTEXT_SNIPPET,
35041
- PROPOSE_MILESTONE_ROADMAP_LINK_SNIPPET,
35042
- PROPOSE_MILESTONE_CREATE_SNIPPET,
35043
- ROADMAP_CREATE_IN_RECOMMENDING_CALL_SNIPPET,
35044
- ROADMAP_NO_SECOND_CALL_SNIPPET,
35045
- PROPOSE_MILESTONE_BLOCKER_SNIPPET,
35046
- PROPOSE_MILESTONE_NO_ALLOW_UNREFINED_SNIPPET,
35047
- PROPOSAL_CHECKPOINT_SNIPPET,
35048
- PROPOSAL_CHECKPOINT_DECISION_READY_SNIPPET,
35049
- PROPOSAL_CHECKPOINT_DETAIL_CRITERIA_SNIPPET,
35050
- PROPOSAL_CHECKPOINT_DOCUMENTATION_FIX_SNIPPET,
35051
- SHARED_SCHEMA_CACHE_ROOT_SNIPPET,
35052
- SHARED_SCHEMA_FILE_LOOKUP_SNIPPET,
35053
- SAMPLE_SHOW_LOOKUP_SNIPPET,
35054
- LOCAL_EXAMPLES_DIRECTORY_SNIPPET
35055
- ],
35056
- forbiddenSnippets: [
35057
- "Scaffolds proposal.yaml, design.yaml, tasks.yaml, questions.yaml, and strict YAML delta specs under .strict-spec-driven/changes/<name>/.",
35058
- "proposal review",
35059
- "If the user asks to source a change from the roadmap, stop and tell them to use",
35060
- CALLER_CHOSEN_ROADMAP_CHANGE_NAME_SNIPPET,
35061
- PROPOSE_READ_ONLY_SELECTION_SNIPPET
35062
- ]
34758
+ requiredHeadings: ["## Steps", "## Rules", SCENE_FIRST_ROUTING_HEADING]
35063
34759
  },
35064
34760
  "strict-spec-apply": {
35065
34761
  requiredCommands: {
@@ -35068,25 +34764,7 @@ var CORE_STRICT_SKILL_EXPECTATIONS = {
35068
34764
  "scene-status": SCENE_STATUS_COMMAND,
35069
34765
  verify: `${COMMAND_PREFIX} verify <change-name>`
35070
34766
  },
35071
- requiredHeadings: ["## Steps", "## Rules"],
35072
- requiredSnippets: [
35073
- ".strict-spec-driven/",
35074
- SCENE_COVERAGE_DIAGNOSTIC_SNIPPET,
35075
- SCENE_COVERAGE_REMEDY_SNIPPET,
35076
- "never a waiver to invent",
35077
- SHARED_SCHEMA_CACHE_ROOT_SNIPPET,
35078
- SHARED_SCHEMA_FILE_LOOKUP_SNIPPET,
35079
- SAMPLE_SHOW_LOOKUP_SNIPPET,
35080
- LOCAL_EXAMPLES_DIRECTORY_SNIPPET
35081
- ]
35082
- },
35083
- "strict-spec-verify": {
35084
- requiredCommands: {
35085
- modify: `${COMMAND_PREFIX} modify [change-name|archive-dir]`,
35086
- verify: `${COMMAND_PREFIX} verify <change-name>`
35087
- },
35088
- requiredHeadings: ["## Steps", "## Rules"],
35089
- requiredSnippets: [".strict-spec-driven/"]
34767
+ requiredHeadings: ["## Steps", "## Rules"]
35090
34768
  },
35091
34769
  "strict-spec-review": {
35092
34770
  requiredCommands: {
@@ -35094,49 +34772,16 @@ var CORE_STRICT_SKILL_EXPECTATIONS = {
35094
34772
  "scene-status": SCENE_STATUS_COMMAND,
35095
34773
  verify: `${COMMAND_PREFIX} verify <change-name>`
35096
34774
  },
35097
- requiredHeadings: ["## Steps", "## Rules"],
35098
- requiredSnippets: [
35099
- ".strict-spec-driven/",
35100
- "direct code review evidence",
35101
- SCENE_COVERAGE_DIAGNOSTIC_SNIPPET,
35102
- "a way to silence a gap",
35103
- REVIEW_AUTO_FIX_SNIPPET,
35104
- REVIEW_POST_FIX_REGRESSION_SNIPPET,
35105
- CURRENT_CHANGE_TECH_SYNC_SNIPPET,
35106
- CURRENT_CHANGE_DELTA_TECH_SNIPPET,
35107
- NO_POST_ARCHIVE_DEFERRAL_SNIPPET,
35108
- REVIEW_REFLECTION_RECOMMENDATION_SNIPPET,
35109
- REGRESSION_EVIDENCE_CARVE_OUT_SNIPPET,
35110
- `Do not call or rely on a \`${COMMAND_PREFIX} review\` command`
35111
- ],
35112
- forbiddenSnippets: [
35113
- `${COMMAND_PREFIX} review <change-name>`
35114
- ]
34775
+ requiredHeadings: ["## Steps", "## Rules"]
35115
34776
  },
35116
34777
  "strict-spec-archive": {
35117
34778
  requiredCommands: {
35118
34779
  modify: `${COMMAND_PREFIX} modify [change-name|archive-dir]`,
35119
34780
  verify: `${COMMAND_PREFIX} verify <change-name>`,
35120
- archive: `${COMMAND_PREFIX} archive <change-name>`
34781
+ archive: `${COMMAND_PREFIX} archive <change-name>`,
34782
+ "scene-status": SCENE_STATUS_COMMAND
35121
34783
  },
35122
- requiredHeadings: ["## Steps", "## Rules"],
35123
- requiredSnippets: [
35124
- ".strict-spec-driven/",
35125
- CURRENT_CHANGE_TECH_SYNC_SNIPPET,
35126
- CURRENT_CHANGE_SCOPE_SNIPPET,
35127
- CURRENT_CHANGE_DELTA_TECH_SNIPPET,
35128
- ARCHIVE_APPLIES_RECOMMENDATION_SNIPPET,
35129
- NOT_REUSABLE_CLASSIFICATION_SNIPPET,
35130
- ARCHIVE_DECISION_REPORT_SNIPPET,
35131
- NO_POST_ARCHIVE_DEFERRAL_SNIPPET,
35132
- REGRESSION_EVIDENCE_CARVE_OUT_SNIPPET,
35133
- "merge strict YAML delta scenes into",
35134
- "the change merges no scene and the recorded scenes are left untouched"
35135
- ],
35136
- forbiddenSnippets: [
35137
- "any change to roadmap state caused by archive",
35138
- "ask the user to confirm the change truly has no observable"
35139
- ]
34784
+ requiredHeadings: ["## Steps", "## Rules"]
35140
34785
  },
35141
34786
  "strict-spec-auto": {
35142
34787
  requiredCommands: {
@@ -35151,44 +34796,7 @@ var CORE_STRICT_SKILL_EXPECTATIONS = {
35151
34796
  archive: `${COMMAND_PREFIX} archive <change-name>`
35152
34797
  },
35153
34798
  requiredHeadings: ["## Steps", "## Rules"],
35154
- requiredSnippets: [
35155
- ".strict-spec-driven/",
35156
- "/strict-spec-ship <change-name>",
35157
- delegationDeclaration("scene-first-routing", "strict-spec-propose"),
35158
- SCENE_COVERAGE_DIAGNOSTIC_SNIPPET,
35159
- SCENE_COVERAGE_REMEDY_SNIPPET,
35160
- "not a safe blocker fix",
35161
- AUTO_TARGETED_CONTEXT_RESET_SNIPPET,
35162
- AUTO_RESUME_POPULATED_SCAFFOLD_SNIPPET,
35163
- AUTO_REUSE_REGRESSION_EVIDENCE_SNIPPET,
35164
- PROPOSAL_CHECKPOINT_SNIPPET,
35165
- PROPOSAL_CHECKPOINT_DECISION_READY_SNIPPET,
35166
- PROPOSAL_CHECKPOINT_DETAIL_CRITERIA_SNIPPET,
35167
- PROPOSAL_CHECKPOINT_DOCUMENTATION_FIX_SNIPPET,
35168
- "direct code review evidence",
35169
- REVIEW_AUTO_FIX_SNIPPET,
35170
- REVIEW_POST_FIX_REGRESSION_SNIPPET,
35171
- CURRENT_CHANGE_TECH_SYNC_SNIPPET,
35172
- CURRENT_CHANGE_SCOPE_SNIPPET,
35173
- CURRENT_CHANGE_DELTA_TECH_SNIPPET,
35174
- ARCHIVE_APPLIES_RECOMMENDATION_SNIPPET,
35175
- NOT_REUSABLE_CLASSIFICATION_SNIPPET,
35176
- ARCHIVE_DECISION_REPORT_SNIPPET,
35177
- NO_POST_ARCHIVE_DEFERRAL_SNIPPET,
35178
- REVIEW_REFLECTION_RECOMMENDATION_SNIPPET,
35179
- REGRESSION_EVIDENCE_CARVE_OUT_SNIPPET,
35180
- `Do not call or rely on a \`${COMMAND_PREFIX} review\` command`,
35181
- SHARED_SCHEMA_CACHE_ROOT_SNIPPET,
35182
- SHARED_SCHEMA_FILE_LOOKUP_SNIPPET,
35183
- SAMPLE_SHOW_LOOKUP_SNIPPET,
35184
- LOCAL_EXAMPLES_DIRECTORY_SNIPPET
35185
- ],
35186
- forbiddenSnippets: [
35187
- "empty-spec-impact decisions block progress",
35188
- "empty-spec-impact decision has been explicitly confirmed",
35189
- `${COMMAND_PREFIX} review <change-name>`,
35190
- "proposal review"
35191
- ]
34799
+ requiredStepAnchors: [...AUTO_GATE_STEP_ANCHORS]
35192
34800
  },
35193
34801
  "strict-spec-bugfix": {
35194
34802
  requiredCommands: {
@@ -35200,38 +34808,7 @@ var CORE_STRICT_SKILL_EXPECTATIONS = {
35200
34808
  verify: `${COMMAND_PREFIX} verify <change-name>`,
35201
34809
  archive: `${COMMAND_PREFIX} archive <change-name>`
35202
34810
  },
35203
- requiredHeadings: ["## Steps", "## Rules"],
35204
- requiredSnippets: [
35205
- ".strict-spec-driven/",
35206
- BUGFIX_KNOWN_BUG_SNIPPET,
35207
- BUGFIX_REPRODUCE_BEFORE_FIXING_SNIPPET,
35208
- BUGFIX_REGRESSION_TEST_SNIPPET,
35209
- BUGFIX_MINIMAL_FIX_SNIPPET,
35210
- BUGFIX_UNCLEAR_ISSUE_HANDOFF_SNIPPET,
35211
- delegationDeclaration("requirement-interrogation", "strict-spec-propose"),
35212
- delegationDeclaration("change-intake-gate", "strict-spec-propose"),
35213
- delegationDeclaration("spec-artifact-routing", "strict-spec-propose"),
35214
- delegationDeclaration("delta-artifact-authoring", "strict-spec-propose"),
35215
- delegationDeclaration("implementation-order", "strict-spec-apply"),
35216
- delegationDeclaration("lesson-outcome", "strict-spec-review"),
35217
- PROPOSAL_CHECKPOINT_SNIPPET,
35218
- PROPOSAL_CHECKPOINT_DOCUMENTATION_FIX_SNIPPET,
35219
- "direct review",
35220
- FRESH_CONTEXT_REVIEWER_SNIPPET,
35221
- FRESH_CONTEXT_REVIEWER_OPTIONAL_SNIPPET,
35222
- FRESH_CONTEXT_REVIEWER_READ_ONLY_SNIPPET,
35223
- REVIEW_AUTO_FIX_SNIPPET,
35224
- REVIEW_POST_FIX_REGRESSION_SNIPPET,
35225
- REGRESSION_EVIDENCE_CARVE_OUT_SNIPPET,
35226
- SHARED_SCHEMA_CACHE_ROOT_SNIPPET,
35227
- SHARED_SCHEMA_FILE_LOOKUP_SNIPPET,
35228
- SAMPLE_SHOW_LOOKUP_SNIPPET,
35229
- LOCAL_EXAMPLES_DIRECTORY_SNIPPET
35230
- ],
35231
- forbiddenSnippets: [
35232
- `${COMMAND_PREFIX} review <change-name>`,
35233
- "proposal review"
35234
- ]
34811
+ requiredHeadings: ["## Steps", "## Rules"]
35235
34812
  },
35236
34813
  "strict-tech-sync": {
35237
34814
  requiredCommands: {
@@ -35240,51 +34817,27 @@ var CORE_STRICT_SKILL_EXPECTATIONS = {
35240
34817
  "tech-edit": `${COMMAND_PREFIX} tech-edit <standard-id> [--tech-path <path>] --<named-args>`,
35241
34818
  verify: `${COMMAND_PREFIX} verify <change-name>`
35242
34819
  },
35243
- requiredHeadings: ["## Steps", "## Rules"],
35244
- requiredSnippets: [
35245
- ".strict-spec-driven/",
35246
- "active-change sync",
35247
- "selected change's proposal, design, tasks, questions, delta specs, delta tech",
35248
- CURRENT_CHANGE_SCOPE_SNIPPET,
35249
- "explicitly approves both the normative content and its strength",
35250
- "Get operator confirmation, except at archive time",
35251
- "explicitly classified as not reusable",
35252
- "may not be deferred until after its active change is archived",
35253
- "never edit a live main standard directly",
35254
- REGRESSION_EVIDENCE_CARVE_OUT_SNIPPET
35255
- ]
34820
+ requiredHeadings: ["## Steps", "## Rules"]
35256
34821
  },
35257
34822
  "strict-tech-edit": {
35258
34823
  requiredCommands: {
35259
34824
  "tech-edit": `${COMMAND_PREFIX} tech-edit <standard-id> [--tech-path <path>] --<named-args>`,
35260
34825
  "tech-status": `${COMMAND_PREFIX} tech-status`
35261
34826
  },
35262
- requiredHeadings: ["## Steps", "## Rules"],
35263
- requiredSnippets: [
35264
- ".strict-spec-driven/tech/",
35265
- "Never hand-edit main-tech or tech-index YAML"
35266
- ]
34827
+ requiredHeadings: ["## Steps", "## Rules"]
35267
34828
  },
35268
34829
  "strict-spec-modify": {
35269
34830
  requiredCommands: {
35270
34831
  modify: `${COMMAND_PREFIX} modify [change-name|archive-dir]`,
35271
34832
  verify: `${COMMAND_PREFIX} verify <change-name>`
35272
34833
  },
35273
- requiredHeadings: ["## Steps", "## Rules"],
35274
- requiredSnippets: [
35275
- ".strict-spec-driven/",
35276
- SHARED_SCHEMA_CACHE_ROOT_SNIPPET,
35277
- SHARED_SCHEMA_FILE_LOOKUP_SNIPPET,
35278
- SAMPLE_SHOW_LOOKUP_SNIPPET,
35279
- LOCAL_EXAMPLES_DIRECTORY_SNIPPET
35280
- ]
34834
+ requiredHeadings: ["## Steps", "## Rules"]
35281
34835
  },
35282
34836
  "strict-spec-ship": {
35283
34837
  requiredCommands: {
35284
34838
  ship: `${COMMAND_PREFIX} ship <change-name>`
35285
34839
  },
35286
- requiredHeadings: ["## Steps", "## Rules"],
35287
- requiredSnippets: [".strict-spec-driven/"]
34840
+ requiredHeadings: ["## Steps", "## Rules"]
35288
34841
  }
35289
34842
  };
35290
34843
  var ROADMAP_STRICT_SKILL_EXPECTATIONS = {
@@ -35296,16 +34849,7 @@ var ROADMAP_STRICT_SKILL_EXPECTATIONS = {
35296
34849
  "roadmap-status": `${COMMAND_PREFIX} roadmap-status`,
35297
34850
  "roadmap-sync": `${COMMAND_PREFIX} roadmap-sync`
35298
34851
  },
35299
- requiredHeadings: ["## Steps", "## Rules"],
35300
- requiredSnippets: [
35301
- ".strict-spec-driven/roadmap/",
35302
- ROADMAP_GENERATE_MILESTONE_SNIPPET,
35303
- ROADMAP_PLANNED_CHANGE_CLI_AUTHORING_SNIPPET,
35304
- ROADMAP_CANONICAL_FILENAME_SNIPPET,
35305
- ROADMAP_FIX_NAMES_SNIPPET,
35306
- ROADMAP_PLAN_EXECUTABLE_DETAIL_SNIPPET,
35307
- ROADMAP_PLAN_REVIEW_SNIPPET
35308
- ]
34852
+ requiredHeadings: ["## Steps", "## Rules"]
35309
34853
  },
35310
34854
  "strict-roadmap-recommend": {
35311
34855
  requiredCommands: {
@@ -35314,27 +34858,7 @@ var ROADMAP_STRICT_SKILL_EXPECTATIONS = {
35314
34858
  generate: GENERATE_NAMED_ARGS_COMMAND,
35315
34859
  ready: READY_COMMAND
35316
34860
  },
35317
- requiredHeadings: ["## Steps", "## Rules"],
35318
- requiredSnippets: [
35319
- ".strict-spec-driven/roadmap/",
35320
- ROADMAP_CREATE_SNIPPET,
35321
- ROADMAP_CREATED_CHANGE_NAME_SNIPPET,
35322
- ROADMAP_CREATE_IN_RECOMMENDING_CALL_SNIPPET,
35323
- ROADMAP_NO_SECOND_CALL_SNIPPET,
35324
- ROADMAP_DETAILS_GUIDANCE_SNIPPET,
35325
- ROADMAP_SPLIT_PLANNED_CHANGE_SNIPPET,
35326
- ROADMAP_ACTIVE_CONFLICT_SNIPPET,
35327
- ROADMAP_SCRIPTED_RECOMMEND_SNIPPET,
35328
- ROADMAP_RECOMMEND_BEFORE_CONTEXT_SNIPPET,
35329
- ROADMAP_READY_HANDOFF_SNIPPET,
35330
- ROADMAP_AUTO_POPULATED_HANDOFF_SNIPPET,
35331
- PROPOSAL_CHECKPOINT_SNIPPET,
35332
- PROPOSAL_CHECKPOINT_DECISION_READY_SNIPPET,
35333
- PROPOSAL_CHECKPOINT_DETAIL_CRITERIA_SNIPPET,
35334
- PROPOSAL_CHECKPOINT_DOCUMENTATION_FIX_SNIPPET,
35335
- "/strict-spec-auto"
35336
- ],
35337
- forbiddenSnippets: ["proposal review", `${COMMAND_PREFIX} propose <change-name>`, ROADMAP_SECOND_CREATING_CALL_SNIPPET]
34861
+ requiredHeadings: ["## Steps", "## Rules"]
35338
34862
  },
35339
34863
  "strict-roadmap-review": {
35340
34864
  requiredCommands: {
@@ -35343,19 +34867,7 @@ var ROADMAP_STRICT_SKILL_EXPECTATIONS = {
35343
34867
  "roadmap-status": `${COMMAND_PREFIX} roadmap-status`,
35344
34868
  "roadmap-sync": `${COMMAND_PREFIX} roadmap-sync`
35345
34869
  },
35346
- requiredHeadings: ["## Steps", "## Rules"],
35347
- requiredSnippets: [
35348
- ".strict-spec-driven/roadmap/",
35349
- ROADMAP_GENERATE_MILESTONE_SNIPPET,
35350
- ROADMAP_PLANNED_CHANGE_CLI_AUTHORING_SNIPPET,
35351
- ROADMAP_CANONICAL_FILENAME_SNIPPET,
35352
- ROADMAP_FIX_NAMES_SNIPPET,
35353
- ROADMAP_REVIEW_INCOMPLETE_SCOPE_SNIPPET,
35354
- ROADMAP_REVIEW_DIRECT_FIX_SNIPPET,
35355
- ROADMAP_REVIEW_DETAIL_ELABORATION_SNIPPET,
35356
- ROADMAP_REVIEW_INTAKE_ANSWER_SNIPPET,
35357
- "Never infer review order from the milestone id prefix"
35358
- ]
34870
+ requiredHeadings: ["## Steps", "## Rules"]
35359
34871
  },
35360
34872
  "strict-roadmap-transition": {
35361
34873
  requiredCommands: {
@@ -35371,33 +34883,7 @@ var ROADMAP_STRICT_SKILL_EXPECTATIONS = {
35371
34883
  "roadmap-sync": `${COMMAND_PREFIX} roadmap-sync`,
35372
34884
  "roadmap-sync-fix-names": `${COMMAND_PREFIX} roadmap-sync --fix-names`
35373
34885
  },
35374
- requiredHeadings: ["## Steps", "## Rules"],
35375
- requiredSnippets: [
35376
- ".strict-spec-driven/roadmap/",
35377
- ROADMAP_SPLIT_PLANNED_CHANGE_SNIPPET,
35378
- ROADMAP_CANONICAL_FILENAME_SNIPPET,
35379
- ROADMAP_FIX_NAMES_SNIPPET,
35380
- ROADMAP_ORDER_SOURCE_SNIPPET,
35381
- ROADMAP_TRANSITION_EXPLICIT_OPERATION_SNIPPET,
35382
- ROADMAP_TRANSITION_STOP_WITHOUT_OPERATION_SNIPPET,
35383
- ROADMAP_TRANSITION_SINGLE_COMMAND_SNIPPET,
35384
- ROADMAP_TRANSITION_INVERSE_PAIRS_SNIPPET,
35385
- ROADMAP_TRANSITION_ARCHIVED_FROZEN_SNIPPET,
35386
- ROADMAP_TRANSITION_PAUSE_SKIP_REASON_SNIPPET,
35387
- ROADMAP_TRANSITION_RESUME_CLEARS_PAUSE_SNIPPET,
35388
- ROADMAP_TRANSITION_DEFER_IS_NOT_PAUSE_SNIPPET,
35389
- ROADMAP_TRANSITION_DEFER_SKIP_REASON_SNIPPET,
35390
- ROADMAP_TRANSITION_REFINE_ASKS_THE_HUMAN_SNIPPET,
35391
- "dependency-order concern",
35392
- ROADMAP_MOVE_ALLOW_COMPLETE_SNIPPET,
35393
- ROADMAP_MOVE_NO_CHANGE_WRITES_SNIPPET,
35394
- ROADMAP_TRANSITION_REOPEN_FROZEN_SNIPPET,
35395
- ROADMAP_TRANSITION_REOPEN_SEEDS_FOLLOW_UP_SNIPPET,
35396
- ROADMAP_ARCHIVE_DEFAULT_ALL_SNIPPET,
35397
- ROADMAP_ARCHIVE_COMPLETE_ONLY_SNIPPET,
35398
- ROADMAP_ARCHIVE_PLANNED_CHANGE_SNIPPET,
35399
- ROADMAP_TRANSITION_SYNC_INVENTS_NOTHING_SNIPPET
35400
- ]
34886
+ requiredHeadings: ["## Steps", "## Rules"]
35401
34887
  },
35402
34888
  "strict-roadmap-reorder": {
35403
34889
  requiredCommands: {
@@ -35406,19 +34892,7 @@ var ROADMAP_STRICT_SKILL_EXPECTATIONS = {
35406
34892
  "roadmap-reorder": `${COMMAND_PREFIX} roadmap-reorder <milestone-id> (--before <milestone-id> | --after <milestone-id> | --order <integer>)`,
35407
34893
  "roadmap-renumber": `${COMMAND_PREFIX} roadmap-renumber`
35408
34894
  },
35409
- requiredHeadings: ["## Steps", "## Rules"],
35410
- requiredSnippets: [
35411
- ".strict-spec-driven/roadmap/",
35412
- ROADMAP_SPLIT_PLANNED_CHANGE_SNIPPET,
35413
- ROADMAP_CANONICAL_FILENAME_SNIPPET,
35414
- ROADMAP_FIX_NAMES_SNIPPET,
35415
- ROADMAP_ORDER_SOURCE_SNIPPET,
35416
- "optional integer `order` field",
35417
- ROADMAP_REORDER_PLACEMENT_FLAGS_SNIPPET,
35418
- ROADMAP_REORDER_RENUMBER_FALLBACK_SNIPPET,
35419
- "dependency-order concern",
35420
- ROADMAP_REORDER_ARCHIVED_FROZEN_SNIPPET
35421
- ]
34895
+ requiredHeadings: ["## Steps", "## Rules"]
35422
34896
  }
35423
34897
  };
35424
34898
  var PLANNING_STRICT_SKILL_EXPECTATIONS = {
@@ -35431,59 +34905,27 @@ var PLANNING_STRICT_SKILL_EXPECTATIONS = {
35431
34905
  ready: READY_COMMAND,
35432
34906
  verify: `${COMMAND_PREFIX} verify <change-name>`
35433
34907
  },
35434
- requiredHeadings: ["## Steps", "## Rules"],
35435
- requiredSnippets: [
35436
- ".strict-spec-driven/",
35437
- "proposal.yaml",
35438
- "questions.yaml",
35439
- delegationDeclaration("requirement-interrogation", "strict-spec-propose"),
35440
- delegationDeclaration("scene-first-routing", "strict-spec-propose"),
35441
- delegationDeclaration("change-intake-gate", "strict-spec-propose"),
35442
- delegationDeclaration("spec-artifact-routing", "strict-spec-propose"),
35443
- delegationDeclaration("delta-artifact-authoring", "strict-spec-propose"),
35444
- delegationDeclaration("task-list-authoring", "strict-spec-propose"),
35445
- PROPOSAL_CHECKPOINT_SNIPPET,
35446
- PROPOSAL_CHECKPOINT_DECISION_READY_SNIPPET,
35447
- PROPOSAL_CHECKPOINT_DETAIL_CRITERIA_SNIPPET,
35448
- PROPOSAL_CHECKPOINT_DOCUMENTATION_FIX_SNIPPET
35449
- ],
35450
- forbiddenSnippets: ["proposal review"]
34908
+ requiredHeadings: ["## Steps", "## Rules"]
35451
34909
  },
35452
34910
  "strict-spec-spec-edit": {
35453
34911
  requiredCommands: {
35454
34912
  "spec-edit": `${COMMAND_PREFIX} spec-edit <spec-id> [--spec-path <path>] --<named-args>`
35455
34913
  },
35456
- requiredHeadings: ["## Steps", "## Rules"],
35457
- requiredSnippets: [".strict-spec-driven/specs/"]
34914
+ requiredHeadings: ["## Steps", "## Rules"]
35458
34915
  },
35459
34916
  "strict-spec-sync-specs": {
35460
34917
  requiredCommands: {
35461
34918
  "spec-edit": `${COMMAND_PREFIX} spec-edit <spec-id> [--spec-path <path>] --<named-args>`,
35462
34919
  "scene-status": SCENE_STATUS_COMMAND
35463
34920
  },
35464
- requiredHeadings: ["## Steps", "## Rules"],
35465
- requiredSnippets: [
35466
- ".strict-spec-driven/specs/",
35467
- "INDEX.yaml",
35468
- "A step reported as covered names the requirement that is supposed to describe it",
35469
- "A project recording no scene produces nothing here"
35470
- ]
34921
+ requiredHeadings: ["## Steps", "## Rules"]
35471
34922
  },
35472
34923
  "strict-scene-edit": {
35473
34924
  requiredCommands: {
35474
34925
  "scene-edit": `${COMMAND_PREFIX} scene-edit <scene-id>`,
35475
34926
  "scene-status": SCENE_STATUS_COMMAND
35476
34927
  },
35477
- requiredHeadings: ["## Steps", "## Rules"],
35478
- requiredSnippets: [
35479
- ".strict-spec-driven/scenes/",
35480
- "who acts",
35481
- "what must already be true",
35482
- "step by ordered step",
35483
- "what triggers each exception flow",
35484
- "Never invent a covering reference to silence a coverage gap",
35485
- "Never hand-edit scene or scene-index YAML"
35486
- ]
34928
+ requiredHeadings: ["## Steps", "## Rules"]
35487
34929
  }
35488
34930
  };
35489
34931
  function makeDiagnostic5(code, diagPath, message, expected, actual) {
@@ -35491,24 +34933,7 @@ function makeDiagnostic5(code, diagPath, message, expected, actual) {
35491
34933
  }
35492
34934
 
35493
34935
  // src/skills/content.ts
35494
- function snippetsWaivedByDelegation(content) {
35495
- const waived = new Set;
35496
- for (const { obligation } of parseDelegations(content)) {
35497
- for (const snippet of DELEGABLE_OBLIGATIONS[obligation]?.waivedSnippets ?? [])
35498
- waived.add(snippet);
35499
- }
35500
- return waived;
35501
- }
35502
- function restatementSignals(obligation) {
35503
- const declared = DELEGABLE_OBLIGATIONS[obligation];
35504
- if (!declared)
35505
- return [];
35506
- if (declared.ownerHeading)
35507
- return [declared.ownerHeading];
35508
- if (declared.waivedSnippets.length > 0)
35509
- return declared.waivedSnippets;
35510
- return declared.ownerSnippets.map((entry) => entry.snippet);
35511
- }
34936
+ var REGISTERED_COMMANDS = new Set(COMMAND_REGISTRATION_ORDER);
35512
34937
  function validateDelegations(skillName, content, skillContents, skillPath, diagnostics) {
35513
34938
  const delegations = parseDelegations(content);
35514
34939
  if (delegations.length === 0) {
@@ -35523,102 +34948,56 @@ function validateDelegations(skillName, content, skillContents, skillPath, diagn
35523
34948
  diagnostics.push(makeDiagnostic5("skill.delegation.obligation.unknown", skillPath, `'${skillName}' delegates '${obligation}', which is not a delegable obligation; declare it in DELEGABLE_OBLIGATIONS in src/skills/model.ts or use one of the recognized ids`, Object.keys(DELEGABLE_OBLIGATIONS).join(", "), obligation));
35524
34949
  continue;
35525
34950
  }
35526
- for (const signal of restatementSignals(obligation)) {
35527
- if (!normalizeWhitespace3(content).includes(normalizeWhitespace3(signal)))
35528
- continue;
35529
- diagnostics.push(makeDiagnostic5("skill.delegation.restated", skillPath, `'${skillName}' delegates ${declared.element} to '${owner}' and still restates it; delete the restated text from skills/${skillName}/SKILL.md, because the delegation makes '${owner}' the single statement of that procedure`, `no restatement of ${declared.element}`, signal));
34951
+ if (carriesAnchorHeading(content, declared.anchor)) {
34952
+ diagnostics.push(makeDiagnostic5("skill.delegation.restated", skillPath, `'${skillName}' delegates '${obligation}' (${declared.element}) to '${owner}' and still carries its own '## ${declared.anchor}' section; delete that section from skills/${skillName}/SKILL.md, because the delegation makes '${owner}' the single statement of that procedure`, `no '## ${declared.anchor}' section`, `## ${declared.anchor}`));
35530
34953
  }
35531
34954
  const ownerContent = skillContents.get(owner);
35532
34955
  if (ownerContent === undefined) {
35533
- diagnostics.push(makeDiagnostic5("skill.delegation.owner.missing", skillPath, `'${skillName}' delegates ${declared.element} to '${owner}', which has no package under skills/; name a packaged skill that states it, or state the guidance inline in skills/${skillName}/SKILL.md`, "a skill name with a package under skills/", owner));
35534
- continue;
35535
- }
35536
- const normalizedOwner = normalizeWhitespace3(ownerContent);
35537
- if (declared.ownerHeading && !ownerContent.includes(declared.ownerHeading)) {
35538
- diagnostics.push(makeDiagnostic5("skill.delegation.owner.section.missing", skillPath, `'${skillName}' delegates ${declared.element} to '${owner}', which carries no '${declared.ownerHeading}' section; add that section to skills/${owner}/SKILL.md, or state the guidance inline in skills/${skillName}/SKILL.md`, declared.ownerHeading, owner));
34956
+ diagnostics.push(makeDiagnostic5("skill.delegation.owner.missing", skillPath, `'${skillName}' delegates '${obligation}' (${declared.element}) to '${owner}', which has no package under skills/; name a packaged skill that states it, or state the guidance inline in skills/${skillName}/SKILL.md`, "a skill name with a package under skills/", owner));
35539
34957
  continue;
35540
34958
  }
35541
- for (const { snippet, element } of declared.ownerSnippets) {
35542
- if (normalizedOwner.includes(normalizeWhitespace3(snippet)))
35543
- continue;
35544
- diagnostics.push(makeDiagnostic5("skill.delegation.owner.element.missing", skillPath, `'${skillName}' delegates ${declared.element} to '${owner}', which does not state ${element}; add it to skills/${owner}/SKILL.md, or state the guidance inline in skills/${skillName}/SKILL.md`, snippet, owner));
34959
+ if (!carriesAnchor(ownerContent, declared.anchor)) {
34960
+ diagnostics.push(makeDiagnostic5("skill.delegation.owner.anchor.missing", skillPath, `'${skillName}' delegates '${obligation}' (${declared.element}) to '${owner}', which carries no '${declared.anchor}' section heading or step label; add it to skills/${owner}/SKILL.md, or state the guidance inline in skills/${skillName}/SKILL.md`, declared.anchor, owner));
35545
34961
  }
35546
34962
  }
35547
34963
  }
35548
- function validateRequirementInterrogationGuidance(skillName, content, skillPath, diagnostics) {
35549
- if (!REQUIREMENT_INTERROGATION_SKILLS.includes(skillName))
34964
+ function requireSectionOrDelegation(skillName, governed, content, heading, obligation, code, message, skillPath, diagnostics) {
34965
+ if (!governed.includes(skillName))
35550
34966
  return;
35551
- if (delegatesObligation(content, "requirement-interrogation"))
34967
+ if (delegatesObligation(content, obligation))
35552
34968
  return;
35553
- const normalizedContent = content.replace(/\s+/g, " ");
35554
- if (!content.includes(REQUIREMENT_INTERROGATION_HEADING)) {
35555
- diagnostics.push(makeDiagnostic5("skill.requirement_interrogation.heading.missing", skillPath, "proposal-oriented strict skills must carry a requirement-interrogation section that runs before the change-intake checklist", REQUIREMENT_INTERROGATION_HEADING));
35556
- }
35557
- for (const expectation of REQUIREMENT_INTERROGATION_SNIPPETS) {
35558
- if (normalizedContent.includes(expectation.snippet.replace(/\s+/g, " ")))
35559
- continue;
35560
- diagnostics.push(makeDiagnostic5("skill.requirement_interrogation.guidance.missing", skillPath, `proposal-oriented strict skills must document ${expectation.element}`, expectation.snippet));
35561
- }
35562
- }
35563
- function validateReviewIndependenceGuidance(skillName, content, skillPath, diagnostics) {
35564
- if (!REVIEW_INDEPENDENCE_SKILLS.includes(skillName))
35565
- return;
35566
- if (delegatesObligation(content, "review-independence"))
34969
+ if (carriesAnchorHeading(content, heading.replace(/^## /, "")))
35567
34970
  return;
35568
- const section = skillSection(content, REVIEW_INDEPENDENCE_HEADING);
35569
- if (section === undefined) {
35570
- diagnostics.push(makeDiagnostic5("skill.review_independence.heading.missing", skillPath, "a strict skill that reviews a change must carry a review-independence section that separates requirement reconstruction from reading the implementation", REVIEW_INDEPENDENCE_HEADING));
35571
- return;
35572
- }
35573
- const normalizedSection = normalizeWhitespace3(section);
35574
- for (const { snippet, element } of REVIEW_INDEPENDENCE_SNIPPETS) {
35575
- if (normalizedSection.includes(normalizeWhitespace3(snippet)))
35576
- continue;
35577
- diagnostics.push(makeDiagnostic5("skill.review_independence.element.missing", skillPath, `review-independence guidance must state ${element}`, snippet));
35578
- }
34971
+ diagnostics.push(makeDiagnostic5(code, skillPath, message, heading));
35579
34972
  }
35580
- function validateTaskOrderGuidance(skillName, content, skillPath, diagnostics) {
35581
- const normalizedContent = content.replace(/\s+/g, " ");
35582
- if (skillName === TASK_ORDER_APPLY_SKILL) {
35583
- for (const expectation of TASK_ORDER_APPLY_SNIPPETS) {
35584
- if (normalizedContent.includes(expectation.snippet.replace(/\s+/g, " ")))
35585
- continue;
35586
- diagnostics.push(makeDiagnostic5("skill.task_order.apply_guidance.missing", skillPath, `the apply skill must document ${expectation.element}`, expectation.snippet));
35587
- }
35588
- return;
35589
- }
34973
+ function validateJudgmentSections(skillName, content, skillPath, diagnostics) {
34974
+ requireSectionOrDelegation(skillName, REQUIREMENT_INTERROGATION_SKILLS, content, REQUIREMENT_INTERROGATION_HEADING, "requirement-interrogation", "skill.requirement_interrogation.heading.missing", "proposal-oriented strict skills must carry a requirement-interrogation section or delegate requirement-interrogation to the skill that owns it", skillPath, diagnostics);
34975
+ requireSectionOrDelegation(skillName, REQUIREMENT_INTERROGATION_SKILLS, content, CHANGE_INTAKE_GATE_HEADING, "change-intake-gate", "skill.change_intake_gate.heading.missing", "proposal-oriented strict skills must carry the change-intake question gate section or delegate change-intake-gate to the skill that owns it", skillPath, diagnostics);
34976
+ requireSectionOrDelegation(skillName, REVIEW_INDEPENDENCE_SKILLS, content, REVIEW_INDEPENDENCE_HEADING, "review-independence", "skill.review_independence.heading.missing", "a strict skill that reviews a change must carry a review-independence section or delegate review-independence to the skill that owns it", skillPath, diagnostics);
34977
+ requireSectionOrDelegation(skillName, SCENE_FIRST_ROUTING_SKILLS, content, SCENE_FIRST_ROUTING_HEADING, "scene-first-routing", "skill.scene_first_routing.heading.missing", "a strict skill that starts a change must carry the scene-first requirement-routing section or delegate scene-first-routing to the skill that owns it", skillPath, diagnostics);
34978
+ }
34979
+ function validateTaskListAuthoring(content, commands, skillPath, diagnostics) {
35590
34980
  if (!directsTaskListAuthoring(content))
35591
34981
  return;
35592
34982
  if (delegatesObligation(content, "task-list-authoring"))
35593
34983
  return;
35594
- for (const expectation of TASK_ORDER_PLACEMENT_SNIPPETS) {
35595
- if (normalizedContent.includes(expectation.snippet.replace(/\s+/g, " ")))
35596
- continue;
35597
- diagnostics.push(makeDiagnostic5("skill.task_order.placement_guidance.missing", skillPath, `a skill that directs change task-list authoring must document ${expectation.element}`, expectation.snippet));
35598
- }
34984
+ const mapsGenerate = Object.values(commands).some((value) => commandNameOf(value) === "generate");
34985
+ if (mapsGenerate)
34986
+ return;
34987
+ diagnostics.push(makeDiagnostic5("skill.task_order.generate_mapping.missing", `${skillPath}#commands`, "a skill that directs change task-list authoring must map the generate command or delegate task-list-authoring to the skill that owns it", `${COMMAND_PREFIX} generate <change-name> tasks --<named-args>`));
35599
34988
  }
35600
34989
  function requiresExistingStrictWorkflowState(skillName) {
35601
34990
  return hasStrictSkillNamePrefix(skillName) && skillName !== "strict-spec-init";
35602
34991
  }
35603
- function validateStrictWorkflowStateGuidance(skillName, content, commands, skillPath, diagnostics) {
34992
+ function validateStrictWorkflowStateGuidance(skillName, commands, skillPath, diagnostics) {
35604
34993
  if (!requiresExistingStrictWorkflowState(skillName))
35605
34994
  return;
35606
- const normalizedContent = content.replace(/\s+/g, " ");
35607
34995
  const checkWorkflowStateCommand = commands["check-workflow-state"];
35608
34996
  if (!checkWorkflowStateCommand) {
35609
34997
  diagnostics.push(makeDiagnostic5("skill.strict_workflow.check_command.missing", `${skillPath}#commands.check-workflow-state`, "non-init strict skills must expose the scripted strict workflow state check command", CHECK_WORKFLOW_STATE_COMMAND));
35610
34998
  } else if (!checkWorkflowStateCommand.includes(CHECK_WORKFLOW_STATE_COMMAND)) {
35611
34999
  diagnostics.push(makeDiagnostic5("skill.strict_workflow.check_command.invalid", `${skillPath}#commands.check-workflow-state`, "non-init strict skills must run the scripted strict workflow state check command before workflow work", CHECK_WORKFLOW_STATE_COMMAND, checkWorkflowStateCommand));
35612
35000
  }
35613
- for (const snippet of [
35614
- STRICT_WORKFLOW_EXISTENCE_STEP_SNIPPET,
35615
- STRICT_WORKFLOW_INIT_GUIDANCE_SNIPPET,
35616
- STRICT_WORKFLOW_NO_INIT_SNIPPET
35617
- ]) {
35618
- if (normalizedContent.includes(snippet.replace(/\s+/g, " ")))
35619
- continue;
35620
- diagnostics.push(makeDiagnostic5("skill.strict_workflow.precheck.missing", skillPath, "non-init strict skills must check for existing .strict-spec-driven/ state before any other step and stop with init guidance when it is missing", snippet));
35621
- }
35622
35001
  if (commands.init) {
35623
35002
  diagnostics.push(makeDiagnostic5("skill.strict_workflow.init_command.forbidden", `${skillPath}#commands.init`, "non-init strict skills must not declare the bundled init command as a fallback", "no init command entry", commands.init));
35624
35003
  }
@@ -35627,27 +35006,18 @@ function validateSkillContentAgainstExpectation(skillName, content, commands, sk
35627
35006
  const expectation = expectationMap[skillName];
35628
35007
  if (!expectation)
35629
35008
  return;
35630
- const normalizedContent = content.replace(/\s+/g, " ");
35631
35009
  if (content.includes(GENERIC_COMMAND_PLACEHOLDER)) {
35632
35010
  diagnostics.push(makeDiagnostic5(`${diagnosticPrefix}.placeholder_command`, skillPath, `${label} must replace the generic placeholder command mapping with explicit commands`, "explicit command mapping", GENERIC_COMMAND_PLACEHOLDER));
35633
35011
  }
35634
35012
  for (const heading of expectation.requiredHeadings) {
35635
- if (!content.includes(heading)) {
35013
+ if (!carriesAnchorHeading(content, heading.replace(/^## /, ""))) {
35636
35014
  diagnostics.push(makeDiagnostic5(`${diagnosticPrefix}.required_heading.missing`, skillPath, `${label} is missing required section heading '${heading}'`, heading));
35637
35015
  }
35638
35016
  }
35639
- const waived = snippetsWaivedByDelegation(content);
35640
- for (const snippet of expectation.requiredSnippets) {
35641
- if (waived.has(snippet))
35017
+ for (const anchor of expectation.requiredStepAnchors ?? []) {
35018
+ if (carriesAnchor(content, anchor))
35642
35019
  continue;
35643
- if (!normalizedContent.includes(snippet.replace(/\s+/g, " "))) {
35644
- diagnostics.push(makeDiagnostic5(`${diagnosticPrefix}.required_snippet.missing`, skillPath, `${label} must reference '${snippet}'`, snippet));
35645
- }
35646
- }
35647
- for (const snippet of expectation.forbiddenSnippets ?? []) {
35648
- if (normalizedContent.includes(snippet.replace(/\s+/g, " "))) {
35649
- diagnostics.push(makeDiagnostic5(`${diagnosticPrefix}.forbidden_snippet.present`, skillPath, `${label} contains misleading prompt text '${snippet}'`, "prompt text aligned with implemented CLI behavior", snippet));
35650
- }
35020
+ diagnostics.push(makeDiagnostic5(`${diagnosticPrefix}.required_step.missing`, skillPath, `${label} is missing required step '${anchor}'`, `a numbered step labelled **${anchor}**`));
35651
35021
  }
35652
35022
  for (const [commandName, expectedValue] of Object.entries(expectation.requiredCommands)) {
35653
35023
  const actualValue = commands[commandName];
@@ -35695,11 +35065,10 @@ function validatePreferredHumanLanguageGuidance(content, skillPath, diagnostics)
35695
35065
  diagnostics.push(makeDiagnostic5("skill.preferred_human_language.section.missing", skillPath, "every bundled strict skill must carry a preferred human language section", PREFERRED_HUMAN_LANGUAGE_HEADING));
35696
35066
  return;
35697
35067
  }
35698
- const normalizedSection = normalizeWhitespace3(section).toLowerCase();
35699
- for (const { snippet, element } of PREFERRED_HUMAN_LANGUAGE_SNIPPETS) {
35700
- if (normalizedSection.includes(normalizeWhitespace3(snippet).toLowerCase()))
35068
+ for (const identifier of PREFERRED_HUMAN_LANGUAGE_IDENTIFIERS) {
35069
+ if (section.includes(identifier))
35701
35070
  continue;
35702
- diagnostics.push(makeDiagnostic5("skill.preferred_human_language.element.missing", skillPath, `preferred human language guidance must name ${element}`, snippet));
35071
+ diagnostics.push(makeDiagnostic5("skill.preferred_human_language.element.missing", skillPath, `preferred human language guidance must name ${identifier}`, identifier));
35703
35072
  }
35704
35073
  const body = section.slice(PREFERRED_HUMAN_LANGUAGE_HEADING.length);
35705
35074
  const sentenceCount = countProseSentences(body);
@@ -35707,31 +35076,7 @@ function validatePreferredHumanLanguageGuidance(content, skillPath, diagnostics)
35707
35076
  diagnostics.push(makeDiagnostic5("skill.preferred_human_language.not_single_sentence", skillPath, "preferred human language guidance must be stated as a single sentence, not a restated paragraph; fold any skill-specific rider into that sentence", "1 sentence", `${sentenceCount} sentences`));
35708
35077
  }
35709
35078
  }
35710
- function skillSections(content) {
35711
- const sections = [];
35712
- const pattern = /^## .*$/gm;
35713
- const headings = [...content.matchAll(pattern)];
35714
- const preamble = content.slice(0, headings[0]?.index ?? content.length);
35715
- if (preamble.trim().length > 0)
35716
- sections.push({ heading: "the opening prose", body: preamble });
35717
- for (const [index, match] of headings.entries()) {
35718
- const start = match.index;
35719
- const end = index + 1 < headings.length ? headings[index + 1]?.index : content.length;
35720
- sections.push({ heading: match[0].trim(), body: content.slice(start, end) });
35721
- }
35722
- return sections;
35723
- }
35724
- function validateWorkflowStateGuidanceIsNotRestated(content, skillPath, diagnostics) {
35725
- const sections = skillSections(content).filter((section) => section.heading !== SKILL_COMMANDS_HEADING);
35726
- for (const { snippet, element } of STRICT_WORKFLOW_SHARED_ELEMENTS) {
35727
- const normalizedSnippet = normalizeWhitespace3(snippet);
35728
- const statingSections = sections.filter((section) => normalizeWhitespace3(section.body).includes(normalizedSnippet)).map((section) => section.heading);
35729
- if (statingSections.length < 2)
35730
- continue;
35731
- diagnostics.push(makeDiagnostic5("skill.strict_workflow.precondition.restated", skillPath, `${statingSections.join(" and ")} both state ${element}; delete every copy but one rather than shortening it, keeping a Prerequisites section only for a precondition specific to this skill`, `${element} stated once`, statingSections.join(", ")));
35732
- }
35733
- }
35734
- function validateAuthoringProtocolPointer(skillName, content, commands, skillPath, diagnostics) {
35079
+ function validateAuthoringProtocolPointer(content, skillPath, diagnostics) {
35735
35080
  if (!isMutationCapableSkill(content))
35736
35081
  return;
35737
35082
  const section = authoringProtocolSection(content);
@@ -35743,25 +35088,10 @@ function validateAuthoringProtocolPointer(skillName, content, commands, skillPat
35743
35088
  if (!normalized.includes(AUTHORING_PROTOCOL_POINTER_COMMAND)) {
35744
35089
  diagnostics.push(makeDiagnostic5("skill.authoring_protocol.pointer.missing", skillPath, "mutation-capable skill must name the command that renders the live authoring protocol", `${AUTHORING_PROTOCOL_POINTER_COMMAND} <artifact-kind>`));
35745
35090
  }
35746
- const { artifactKinds, validationCommandByKind, mutatingOwnerCommands } = loadPolicyRegistry();
35091
+ const { artifactKinds } = loadPolicyRegistry();
35747
35092
  const namedKinds = [...artifactKinds].filter((kind) => normalized.includes(`\`${kind}\``));
35748
35093
  if (namedKinds.length === 0) {
35749
35094
  diagnostics.push(makeDiagnostic5("skill.authoring_protocol.artifact_kind.missing", skillPath, "mutation-capable skill must name the artifact kinds it writes, so the pointer command can be run for them", "an artifact kind registered in inventory/yaml-mutation-surfaces.yaml"));
35750
- } else {
35751
- const declaredValidationCommands = Object.values(commands).map(commandNameOf).filter((name) => name !== undefined && !mutatingOwnerCommands.has(name));
35752
- const acceptedCommands = new Set(declaredValidationCommands);
35753
- for (const kind of namedKinds) {
35754
- const command = validationCommandByKind.get(kind);
35755
- if (command !== undefined)
35756
- acceptedCommands.add(command);
35757
- }
35758
- const namesAValidationCommand = [...acceptedCommands].some((command) => normalized.includes(`${COMMAND_PREFIX} ${command}`));
35759
- if (!namesAValidationCommand) {
35760
- diagnostics.push(makeDiagnostic5("skill.authoring_protocol.validation_command.missing", skillPath, "mutation-capable skill must name the validation command it runs after writing an artifact kind it names", [...acceptedCommands].map((command) => `${COMMAND_PREFIX} ${command}`).join(" or ")));
35761
- }
35762
- }
35763
- if (!normalized.includes(normalizeWhitespace3(YAML_AUTHORING_PROTOCOL_BOUNDARY.statement))) {
35764
- diagnostics.push(makeDiagnostic5("skill.authoring_protocol.boundary.missing", skillPath, "mutation-capable skill must restate the no-fallback boundary verbatim, because it is the one instruction that must be read before any command runs", YAML_AUTHORING_PROTOCOL_BOUNDARY.statement));
35765
35095
  }
35766
35096
  for (const step of YAML_AUTHORING_PROTOCOL_STEPS) {
35767
35097
  if (!normalized.includes(normalizeWhitespace3(step.title)))
@@ -35852,19 +35182,22 @@ function validateCommandSection(skillName, content, skillPath, diagnostics) {
35852
35182
  const commandSuffix = trimmedValue.slice(COMMAND_PREFIX.length).trim();
35853
35183
  if (commandSuffix.length === 0 || commandSuffix === "<command>" || value.includes(GENERIC_COMMAND_PLACEHOLDER)) {
35854
35184
  diagnostics.push(makeDiagnostic5("skill.commands_section.command.placeholder", `${skillPath}#commands.${name}`, "command entries must replace the generic strict CLI placeholder with an explicit subcommand and parameters", `${COMMAND_PREFIX} <explicit-subcommand>`, value));
35185
+ continue;
35186
+ }
35187
+ const subcommand = commandNameOf(trimmedValue);
35188
+ if (subcommand !== undefined && !REGISTERED_COMMANDS.has(subcommand)) {
35189
+ diagnostics.push(makeDiagnostic5("skill.commands_section.command.unregistered", `${skillPath}#commands.${name}`, `command mapping '${name}' invokes '${subcommand}', which is not a registered strict CLI subcommand`, "a subcommand listed by strict-spec-cli --help", subcommand));
35855
35190
  }
35856
35191
  }
35857
35192
  validateCoreSkillContent(skillName, content, normalizedCommands, skillPath, diagnostics);
35858
35193
  validateRoadmapSkillContent(skillName, content, normalizedCommands, skillPath, diagnostics);
35859
35194
  validatePlanningSkillContent(skillName, content, normalizedCommands, skillPath, diagnostics);
35860
- validateStrictWorkflowStateGuidance(skillName, content, normalizedCommands, skillPath, diagnostics);
35195
+ validateStrictWorkflowStateGuidance(skillName, normalizedCommands, skillPath, diagnostics);
35861
35196
  validatePreferredHumanLanguageGuidance(content, skillPath, diagnostics);
35862
- validateWorkflowStateGuidanceIsNotRestated(content, skillPath, diagnostics);
35863
- validateRequirementInterrogationGuidance(skillName, content, skillPath, diagnostics);
35864
- validateReviewIndependenceGuidance(skillName, content, skillPath, diagnostics);
35865
- validateTaskOrderGuidance(skillName, content, skillPath, diagnostics);
35197
+ validateJudgmentSections(skillName, content, skillPath, diagnostics);
35198
+ validateTaskListAuthoring(content, normalizedCommands, skillPath, diagnostics);
35866
35199
  validateCliOnlyYamlPolicy(skillName, content, normalizedCommands, skillPath, diagnostics);
35867
- validateAuthoringProtocolPointer(skillName, content, normalizedCommands, skillPath, diagnostics);
35200
+ validateAuthoringProtocolPointer(content, skillPath, diagnostics);
35868
35201
  }
35869
35202
  function validateSkillReferences(content, packagedSkillNames, skillPath, diagnostics) {
35870
35203
  for (const { name, line } of findUnpackagedSkillReferences(content, packagedSkillNames)) {