Skip to content

Add new agent skill cellix-tdd#186

Draft
nnoce14 wants to merge 10 commits intomainfrom
nnoce14/issue183
Draft

Add new agent skill cellix-tdd#186
nnoce14 wants to merge 10 commits intomainfrom
nnoce14/issue183

Conversation

@nnoce14
Copy link
Copy Markdown
Member

@nnoce14 nnoce14 commented Apr 2, 2026

Summary by Sourcery

Introduce a new on-demand cellix-tdd agent skill for consumer-first TDD workflows on @cellix/* packages, including evaluator tooling, documentation, fixtures, and supporting scripts.

New Features:

  • Add the cellix-tdd skill with a defined TDD-centric workflow and required summary structure for evolving @cellix/* packages.
  • Provide a rubric-driven evaluator, initializer, and checker CLI for assessing package contract, tests, and documentation against the cellix-tdd workflow.
  • Ship reference docs and templates describing the package documentation model and manifest structure for Cellix packages.
  • Include a suite of skill fixtures that cover healthy and failing scenarios for feature work, refactors, new packages, docs drift, leaky APIs, and internal-helper misuse.

Enhancements:

  • Document the new cellix-tdd skill alongside existing skills and clarify that some skills are discoverable on-demand only via .agents/skills and .github/skills.
  • Add a dedicated runs directory and gitignore for generated cellix-tdd summaries.

Build:

  • Add npm scripts to run the cellix-tdd evaluator test suite and to scaffold/evaluate package summaries via the new checker CLI.

Documentation:

  • Extend skills documentation to describe the purpose, use cases, capabilities, and verification commands for the cellix-tdd skill, plus additional background context docs for its workflow and documentation model.

Tests:

  • Add mixed pass/fail fixture-based tests and expected reports to validate the cellix-tdd evaluator behavior across multiple package scenarios.

nnoce14 added 3 commits April 2, 2026 15:25
…arsing helpers

- Introduced a new package `@cellix/query-params` to provide query-string parsing utilities.
- Implemented `parseBooleanFlag` for boolean flag parsing with explicit error handling.
- Implemented `parseStringList` for splitting and trimming comma-separated strings.
- Added tests for both parsing functions to ensure expected behavior.
- Created a manifest and README to document the package purpose, scope, and usage.

refactor: internal refactor of @cellix/retry-policy package

- Refactored the backoff calculation logic into a separate internal module.
- Maintained the public API and ensured all existing tests passed.
- Updated documentation to reflect internal changes while keeping the public contract stable.

fix: resolve leaky API in @cellix/http-headers package

- Removed unnecessary internal helper export from the package to maintain a clean public API.
- Updated README and manifest to ensure alignment with the intended public contract.

feat: create new @cellix/slugify package for URL-safe slug generation

- Developed a new package `@cellix/slugify` to generate predictable slugs from display text.
- Implemented the `slugify` function with options for separator control.
- Added tests and documentation to support usage and examples.

fix: address internal helper usage in tests for @cellix/command-router package

- Removed direct imports of internal helpers in tests to comply with public contract testing rules.
- Ensured all tests only interact with the public API of the package.
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Apr 2, 2026

Reviewer's Guide

Introduces a new on-demand agent skill cellix-tdd for consumer-first TDD on @cellix/* packages, including workflow docs, rubric, evaluator/initializer/checker scripts, fixtures, and npm scripts to run or validate the skill, plus wiring into the agentskills and GitHub symlink discovery paths.

Sequence diagram for running skill_cellix_tdd_check on a package

sequenceDiagram
  actor Developer
  participant PNPM as pnpm_cli
  participant Check as CheckCellixTddTs
  participant Init as InitCellixTddSummaryTs
  participant Eval as EvaluateCellixTddTs
  participant FS as FileSystem

  Developer->>PNPM: pnpm run skill:cellix-tdd:check -- --package <pkg>
  PNPM->>Check: node --experimental-strip-types check-cellix-tdd.ts --package <pkg>

  Check->>FS: resolve packageRoot and outputPath
  Check->>FS: fileExists(outputPath)
  alt summary missing or forceInit
    Check->>Init: spawn init-cellix-tdd-summary.ts --package <pkg> --output <summary>
    Init->>FS: read summary-template.md
    Init->>FS: read package.json for name
    Init->>FS: mkdir runs/<relative-package-path>
    Init->>FS: write summary.md scaffold
    Init-->>Check: exit status
    Check->>Developer: log Summary scaffold created message
    alt initOnly flag
      Check-->>PNPM: exit 0
      PNPM-->>Developer: command completes after scaffold
    end
  end

  Check->>Eval: spawn evaluate-cellix-tdd.ts --package <pkg> --output <summary> [--json]
  Eval->>FS: read summary.md
  Eval->>FS: resolve package.json and exports
  Eval->>FS: scan package files and tests
  Eval->>FS: read manifest.md, README.md, source files
  Eval-->>Check: EvaluationResult (overallStatus, failedChecks, totalScore)
  Check-->>PNPM: propagate Eval exit code
  PNPM-->>Developer: print formatted evaluation or JSON
Loading

Class diagram for evaluator and checker structure in cellix_tdd skill

classDiagram
  class EvaluateCellixTddModule {
    +requiredOutputSections: string[]
    +requiredManifestSections: string[]
    +checkDefinitions: CheckDefinition[]
    +maxScore: number
    +passingScore: number
    +main(): void
    +parseArgs(argv: string[]): ParsedArgsEvaluate
    +printUsage(): void
    +readText(filePath: string): string
    +readJson(filePath: string): any
    +getDefaultSummaryPath(packageRoot: string): string
    +fileExists(filePath: string): boolean
    +directoryExists(filePath: string): boolean
    +listFiles(root: string): string[]
    +parseMarkdownSections(markdown: string): Map~string,string~
    +hasHeading(markdown: string, heading: string): boolean
    +findDocFile(packageRoot: string, names: string[]): string
    +resolvePackageJson(packageRoot: string): object
    +resolveExports(packageRoot: string, packageJson: object): Map~string,string[]~
    +collectAllowedEntryFiles(packageRoot: string, exportTargets: Map~string,string[]~): Set~string~
    +getPublicDeclarations(allowedEntryFiles: Set~string~): ExportDeclaration[]
    +evaluatePackage(label: string, packageRoot: string, outputPath: string): EvaluationResult
    +evaluateFixture(fixtureDir: string, verifyExpected: boolean): FixtureEvaluation
    +getFixtureDirectories(fixturesRoot: string): string[]
    +compareExpected(result: EvaluationResult, expected: ExpectedReport): ExpectedComparison
    +formatResult(result: EvaluationResult): string
  }

  class CheckCellixTddModule {
    +main(): void
    +parseArgs(argv: string[]): ParsedArgsCheck
    +printUsage(): void
    +fileExists(filePath: string): boolean
    +getDefaultSummaryPath(packageRoot: string): string
    +runScript(scriptPath: string, args: string[]): number
  }

  class InitCellixTddSummaryModule {
    +main(): void
    +parseArgs(argv: string[]): ParsedArgsInit
    +printUsage(): void
    +fileExists(filePath: string): boolean
    +directoryExists(filePath: string): boolean
    +getDefaultSummaryPath(packageRoot: string): string
    +readTemplate(): string
    +readPackageName(packageRoot: string): string
  }

  class ParsedArgsEvaluate {
    +fixtureDir: string
    +fixturesRoot: string
    +packageRoot: string
    +outputPath: string
    +verifyExpected: boolean
    +json: boolean
  }

  class ParsedArgsCheck {
    +packageRoot: string
    +outputPath: string
    +forceInit: boolean
    +initOnly: boolean
    +json: boolean
  }

  class ParsedArgsInit {
    +packageRoot: string
    +outputPath: string
    +force: boolean
  }

  class CheckDefinition {
    +id: CheckId
    +weight: number
    +critical: boolean
    +description: string
  }

  class ExportDeclaration {
    +filePath: string
    +name: string
    +hasDoc: boolean
    +kind: string
  }

  class CheckResult {
    +id: CheckId
    +weight: number
    +critical: boolean
    +description: string
    +passed: boolean
    +details: string[]
  }

  class EvaluationResult {
    +label: string
    +packageRoot: string
    +outputPath: string
    +totalScore: number
    +overallStatus: string
    +failedChecks: CheckId[]
    +checks: CheckResult[]
  }

  class ExpectedReport {
    +overallStatus: string
    +failedChecks: CheckId[]
  }

  class FixtureEvaluation {
    +result: EvaluationResult
    +comparison: ExpectedComparison
  }

  class ExpectedComparison {
    +matches: boolean
    +problems: string[]
  }

  EvaluateCellixTddModule --> ParsedArgsEvaluate
  EvaluateCellixTddModule --> CheckDefinition
  EvaluateCellixTddModule --> ExportDeclaration
  EvaluateCellixTddModule --> CheckResult
  EvaluateCellixTddModule --> EvaluationResult
  EvaluateCellixTddModule --> ExpectedReport
  EvaluateCellixTddModule --> FixtureEvaluation
  EvaluateCellixTddModule --> ExpectedComparison

  CheckCellixTddModule --> ParsedArgsCheck
  CheckCellixTddModule ..> EvaluateCellixTddModule
  CheckCellixTddModule ..> InitCellixTddSummaryModule

  InitCellixTddSummaryModule --> ParsedArgsInit
  InitCellixTddSummaryModule ..> EvaluateCellixTddModule
Loading

File-Level Changes

Change Details Files
Add the Cellix TDD skill documentation and workflow definition for @cellix/* packages.
  • Document the new cellix-tdd skill in the skills README with purpose, use cases, features, references, and CLI commands.
  • Create SKILL.md describing the TDD workflow, required output sections, and how to run the skill on packages.
  • Add rubric and reference docs describing the package documentation model and manifest template, plus temporary implementation context docs.
.agents/skills/README.md
.agents/skills/cellix-tdd/SKILL.md
.agents/skills/cellix-tdd/rubric.md
.agents/skills/cellix-tdd/references/package-docs-model.md
.agents/skills/cellix-tdd/references/package-manifest-template.md
.agents/docs/cellix-tdd/context.md
.agents/docs/cellix-tdd/package-docs-model.md
Implement the Cellix TDD evaluator, initializer, and checker CLI tooling and wire them into package scripts.
  • Add evaluate-cellix-tdd.ts to score a package+summary against a rubric (workflow sections, test imports, docs alignment, TSDoc, contract surface, release notes, validation).
  • Add init-cellix-tdd-summary.ts to scaffold a summary file from a template for a given package root.
  • Add check-cellix-tdd.ts to create or refresh the summary if missing and then run the evaluator, with CLI options for output path, init-only, force-init, and JSON output.
  • Expose pnpm scripts test:skill:cellix-tdd and skill:cellix-tdd:check in package.json to run fixture regression and evaluate real packages.
.agents/skills/cellix-tdd/evaluator/evaluate-cellix-tdd.ts
.agents/skills/cellix-tdd/evaluator/init-cellix-tdd-summary.ts
.agents/skills/cellix-tdd/evaluator/check-cellix-tdd.ts
.agents/skills/cellix-tdd/templates/summary-template.md
package.json
Add fixture suite for Cellix TDD evaluator self-testing, covering passing and failing scenarios.
  • Define multiple fixture scenarios (existing package feature, internal refactor, new package, docs lagging implementation, leaky API, tempting internal helper) each with prompt, package snapshot, and agent output summary.
  • Implement minimal package code, manifests, READMEs, and tests per fixture to exercise rubric checks such as public-only tests, docs alignment, TSDoc coverage, and export surface.
  • Provide fixture README explaining layout, how to run test:skill:cellix-tdd, and expectations for which fixtures should pass/fail.
.agents/skills/cellix-tdd/fixtures/README.md
.agents/skills/cellix-tdd/fixtures/existing-package-add-feature/**
.agents/skills/cellix-tdd/fixtures/existing-package-internal-refactor/**
.agents/skills/cellix-tdd/fixtures/new-package-greenfield/**
.agents/skills/cellix-tdd/fixtures/docs-lagging-implementation/**
.agents/skills/cellix-tdd/fixtures/leaky-overbroad-api/**
.agents/skills/cellix-tdd/fixtures/tempting-internal-helper/**
Wire the new skill into the agentskills discovery structure and GitHub symlinks, and set up run output location.
  • Register the cellix-tdd directory under .agents/skills/ and document its internal structure (SKILL, rubric, references, fixtures, evaluator).
  • Create .github/skills/cellix-tdd symlink pointing to the skill directory so GitHub Copilot can discover it.
  • Add .agents/skills/cellix-tdd/runs/.gitignore to ignore generated summary outputs, keeping run artifacts out of version control.
  • Clarify in skills README that some skills like cellix-tdd are discoverable only via skills directories to stay on-demand.
.agents/skills/README.md
.agents/skills/cellix-tdd/runs/.gitignore
.github/skills/cellix-tdd

Possibly linked issues

  • #Implement cellix-tdd agent skill: The PR implements the requested cellix-tdd skill, including SKILL, rubric, evaluator, fixtures, and discoverability wiring.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

nnoce14 and others added 4 commits April 2, 2026 17:52
- extract shared utilities (fileExists, directoryExists, getDefaultSummaryPath)
  into evaluator/utils.ts to eliminate duplication across all three scripts

- fix findExportDeclarations to handle barrel/re-export patterns:
  named re-exports (export { Name [as Alias] } from './source'),
  star re-exports (export * from './source'), and export default.
  follows one level deep with cycle detection via visited set.
  TSDoc accepted at either re-export site or declaration site.
  getPublicDeclarations now deduplicates by name across entry files.

- fix readmeConsumerFacing heading regex to accept common consumer-facing
  headings: Getting Started, Installation, API, Overview, How to Use, Guide

- expand mentionsSurface regex to accept 'exporting' and 'exported'
  in addition to the existing surface/export keyword set

- fix init-cellix-tdd-summary.ts readTemplate() to resolve the template
  path via import.meta.url instead of process.cwd() so it works
  regardless of working directory

- update leaky-overbroad-api fixture agent-output to have clearly
  incomplete release hardening notes so all three keyword checks fail
  cleanly after the mentionsSurface fix

- add Copilot Agent Notes section to SKILL.md covering: ask_user for
  collaboration step, task/explore agent delegation for discovery
  (including grep command for finding monorepo consumers), and the
  iterative evaluator loop

- add .agents/skills/** and .github/skills/** to knip ignore so
  evaluator scripts and fixture package source files are not treated
  as unused workspace code, and the .github/skills symlink is not
  followed into the skill directory

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- validate that the resolved package root is inside process.cwd() before
  constructing the default summary path; reject out-of-repo paths with a
  clear error so ../.. segments cannot cause the summary to be written
  outside the intended runs/ directory

- change getPublicDeclarations dedup key from export name alone to
  filePath:name composite so that the same symbol name exported from
  different source files across multiple package entrypoints is checked
  independently; true duplicates (same source file re-exported via multiple
  entries) still collapse correctly

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
content has been captured in .agents/skills/cellix-tdd/references/

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…scope, and downstream impact checks

- Add conditional Contract Gate step (step 3) between Consumer Usage Exploration and Public Contract Definition
- Gate triggers on new packages, removed/renamed exports, material behavioral changes, dependent breakage, or uncertainty; skips for clearly additive low-risk changes
- Add two-question export justification requirement to Public Contract Definition
- Clarify semver policy: do not justify breaking changes because pre-1.0; additive changes may still be non-breaking but evaluate conservatively
- Add evaluator scope disclaimer to step 9, Validation Expectations, and Copilot Agent Notes: passing score ≠ contract correctness or publication readiness
- Add downstream dependent discovery (rg) to Discovery First section and verification check to Release Hardening
- Add three new anti-patterns: skipping contract gate when warranted, test-driven export widening, treating evaluator pass as publish approval
- Update evaluator requiredOutputSections, summary template, and all 6 fixture agent-outputs to include contract gate summary
- Fix paragraph formatting in Copilot Agent Notes iterative evaluation section

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nnoce14 nnoce14 linked an issue Apr 3, 2026 that may be closed by this pull request
nnoce14 added 3 commits April 3, 2026 00:29
… comprehensive documentation, improved component APIs, and public contract testing
…nization, and validation processes after first trial usage

- Updated SKILL.md to clarify documentation and testing requirements for public exports.
- Enhanced evaluate-cellix-tdd.ts to ensure tests are grouped by exported member and to improve TSDoc quality checks.
- Added new fixtures for ambiguous flat tests, including README and manifest files for example @cellix/network-endpoint.
- Improved validation summaries across various agent outputs to include package build and existing test confirmations.
- Revised rubric.md to reflect stricter requirements for documentation alignment and public contract testing.
- Updated summary-template.md to guide on documenting test plans and validation steps more comprehensively.
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.

Implement cellix-tdd agent skill

1 participant