Skip to content

refactor: declarative cleanup of all primitives-plugin prompts#19

Closed
iamladi wants to merge 5 commits intomainfrom
feat/declarative-cleanup
Closed

refactor: declarative cleanup of all primitives-plugin prompts#19
iamladi wants to merge 5 commits intomainfrom
feat/declarative-cleanup

Conversation

@iamladi
Copy link
Owner

@iamladi iamladi commented Feb 7, 2026

Summary

Rewrite all primitives-plugin prompt files (14 total) to the 5-layer declarative structure (Priorities → Goal → Constraints → Output → References), extract embedded reference material to references/ directories, and add an eval harness for structural validation.

  • 11 of 14 prompt files rewritten to declarative structure (commit.md, start.md, tools.md unchanged per design)
  • 7 reference files extracted from heavy skills (de-slop, avoid-feature-creep, agent-ready-repo-setup, ask-oracle, worktree, check-env-keys, agent-native-architecture)
  • 72% active line reduction: 1,657 → 458 lines (target was ≥40%)
  • Eval harness with 67 structural assertions across all 14 prompts (67/67 passing)
  • Zero IMPORTANT/CRITICAL stacking, zero casual/emotional language
  • Code review by GPT-5.2-Codex (xhigh) and Gemini 3 Pro — all 7 findings addressed

Key Changes

Commands rewritten (4): debug.md (190→26), worktree.md (49→17), install.md (17→15), prime.md (19→17)

Skills rewritten (7): de-slop (445→34), agent-ready-repo-setup (314→27), avoid-feature-creep (308→22), ask-oracle (252→24), worktree (253→23), agent-native-architecture (346→180), check-env-keys (107→29)

Reference files created (7): slop-patterns.md, feature-creep-frameworks.md, repo-setup-patterns.md, oracle-cli-reference.md, worktree-procedure.md, env-check-commands.md, anti-patterns.md

Commits

  1. test: Add eval harness infrastructure for primitives-plugin
  2. chore: Extract reference files from skill SKILL.md files
  3. refactor: Rewrite debug, worktree, install, prime commands to declarative structure
  4. refactor: Rewrite all 7 skill SKILL.md files to declarative structure
  5. fix: Address code review findings from Codex and Gemini

Plan

plans/declarative-cleanup-primitives-plugin.md

Test plan

  • bun run validate passes — plugin structure intact
  • bun run eval passes — 67/67 structural assertions
  • Active line count ≤994 (achieved 458, 72% reduction)
  • Zero IMPORTANT/CRITICAL stacking
  • Zero casual/emotional language
  • Code review by GPT-5.2-Codex and Gemini 3 Pro — all findings resolved
  • Manual smoke test: invoke de-slop, debug, worktree on real repo

Mirror sdlc-plugin eval infrastructure with structural assertions
for 14 prompts across commands and skills.

Files created:
- eval/eval.types.ts - Type definitions
- eval/eval.config.ts - Configuration
- eval/shared-assertions.ts - Common structural assertions
- eval/run-eval.ts - Main runner
- eval/eval.test.ts - Self-test suite
- eval/.gitignore - Ignore results except baseline
- eval/cases/*.eval.ts - 14 eval cases covering all prompts
- eval/results/baseline/structural-baseline.json - Baseline snapshot

Updated package.json:
- Added @anthropic-ai/sdk devDependency
- Added npm scripts: eval, eval:baseline

Baseline results (52/61 assertions pass):
- 9 failures expected (prompts missing priorities sections)
- Will track improvements through rewrites
Phase 1b of declarative cleanup - extract embedded reference material
(>100 lines) from SKILL.md files into separate references/ directories.

Created 7 new reference files:
- skills/de-slop/references/slop-patterns.md (~220 lines)
- skills/avoid-feature-creep/references/feature-creep-frameworks.md (~236 lines)
- skills/agent-ready-repo-setup/references/repo-setup-patterns.md (~263 lines)
- skills/ask-oracle/references/oracle-cli-reference.md (~125 lines)
- skills/check-env-keys/references/env-check-commands.md (~29 lines)
- skills/worktree/references/worktree-procedure.md (~223 lines)
- skills/agent-native-architecture/references/anti-patterns.md (~132 lines)

Note: SKILL.md files remain unchanged. They will be rewritten in Phase 3
to reference these new files.
…tive structure

Reduced debug.md from 190 lines to 28 lines by removing procedural steps and templates.
Reduced worktree.md from 49 lines to 17 lines by removing usage examples and error handling details.
Reduced install.md from 17 lines to 15 lines by adding priorities line.
Reduced prime.md from 19 lines to 17 lines by adding priorities line.

All commands now follow 5-layer declarative structure: description frontmatter, title, priorities, goal, constraints, output.

All eval tests pass (7/7 for debug, 2/2 for install, 2/2 for prime, 1/1 for worktree).
All skills now follow the 5-layer declarative structure: Priorities, Goal, Constraints, Output, References. Reference files with detailed procedures, patterns, and examples have been extracted to skills/*/references/ directories. The structural eval suite passes with 61/61 assertions.
- Restore default branch detection in de-slop (was hardcoded to main/master)
- Tighten check-env-keys eval assertions (no longer short-circuit on "reference")
- Add commonStructural() to install/prime eval cases
- Fix eval .gitignore paths (relative to eval/ directory)
- Remove tracked eval result files
- Add LLM skip counting in eval runner
- Update baseline to post-refactor state (67/67 passing)
@iamladi iamladi closed this Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant