Repository navigation
Enforce typed linting, declaration documentation, and shared style review - #7
Merged
Merged
Conversation
Remove magic-string enforcement and artificial string indirection. Document source declarations, preserve typed lint defaults, and add authored documentation-scope checks. Audit all 48 style examples and add numbered review findings with a response example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Replace Engineering's automatic edit hooks with a reusable formatting/linting skill and a standalone style guide. Restore the requested lint policy, refactor owned source to satisfy it, and add tests for authored lint behavior. Extend code review to cover style, writing, duplication, and added dead code.
Lint policy and type information
complexityuses its default maximum 20 at warning severity. The exact installed try rule isunicorn/try-complexity, enabled at warning severity with its default maximum 1. Lint rejects warnings.unicorn/no-array-sort,unicorn/max-nested-calls(3),unicorn/consistent-boolean-name,unicorn/no-top-level-side-effects,unicorn/no-unreadable-for-of-expression,unicorn/prefer-simple-condition-first,unicorn/prefer-top-level-await,unicorn/no-nested-ternary,unicorn/prefer-logical-operator-over-ternary,unicorn/no-useless-undefined, andunicorn/prefer-string-replace-all. Restore nested-ternary enforcement after Prettier's compatibility preset.no-use-before-define,no-magic-numbers, andno-shadowoverrides and the corresponding enabled@typescript-eslintreplacements on TypeScript.const/letgroups, between function declarations and class members, and around class declarations. Cover exported forms. Function, method, and constructor overload signatures may stack with their implementation.jdeurt/const-on-topfor bothconstandlet. Require a declaration prefix before executable statements in program/block/static-block scopes. Preserve leading imports/types/functions/variables and loop-header declarations.varstays banned. No automatic initializer hoisting.allowJs, strict null checks, complete source coverage, and explicit generated/dependency exclusions. Preserve JavaScript core correctness checks. Remove declaration stubs that hid actual JavaScript source from the program.Remove the custom magic-string lint rule and its tests. Keep pragmatic naming guidance for paths, messages, and shared domain strings in the standalone guide. Remove the mechanical length threshold. Inline artificial one-use strings and remove naming-only helpers while preserving meaningful reused constants.
Declaration documentation
Add pinned
eslint-plugin-jsdoc@65.3.15because ESLint no longer includes documentation rules. Require useful documentation for top-level functions, all classes, and class methods. Include parameter descriptions and descriptions of actual returned values. Cover exported/default declarations, arrow/function-expression bindings, constructors, accessors, class fields containing functions, abstract methods, CommonJS assignment exports, and TypeScriptexport =functions. Preserve native CommonJS scope for.cjsand.cts.Keep nested local functions and callbacks outside the mandatory declaration scope. Preserve stacked overload groups with shared documentation.
Use
jsdoc/require-jsdoc,jsdoc/require-description,jsdoc/require-param,jsdoc/check-param-names,jsdoc/require-param-description,jsdoc/require-returns, andjsdoc/require-returns-description. Preserve inherited documentation-comment formatting. Document the repository's affected declarations and extract native packaging into a cohesive module to keep files below 350 lines. The guide separates caller contracts from inline rationale and avoids redundant signature narration. Its comment guidance draws from PEP 257, Google's review guidance, and Oracle's documentation guidance.Skills, review, and packaging
Remove Engineering's edit hooks, private hook dependencies, wrappers, asset registration, workflow smoke step, and obsolete hook-only tests. Preserve native/import hook support. Build both client packages with the root ESLint config, Prettier config, and local rules under the new skill's
references/javascript/.The style reference contains 48 language-neutral concepts across nine numbered sections, each with one good and one bad example. Rules have identifiers such as
1Aand2B. It defines complexity and direct limits. It specifies consistent list layout at each nesting depth. It contains no ESLint rule names, source inventories, tooling/enforcement commentary, or rule-implementation details.Independent file-only reviewers, including Astra, review all 48 rules from the beginning. Each rule includes a Why section that explains its requirements. Example-specific assumptions and outcomes appear inside code comments. Astra re-read all 48 revised rules sequentially and returned CLEAR, with no remaining actionable findings. The separate full-guide rationale reviewer and final packaging/cross-skill reviewer also re-reviewed the corrected source and returned CLEAR.
All 48 positive examples match their verified typed contexts. Strings receive names when they clarify meaning or support reuse. Simple local separators remain inline.
Import ASD-STE100 under Writing through an import declaration and marker. Preserve its original description/triggers, body, references, examples, MIT license, and standard-library Python checker. Normalize only an imported top-level string
versionintometadata.version. Reject conflicting/nonstring versions without loosening schemas. Imported content stays in temporary/generated output. Existing import fixtures use a local upstream for repeatable checks.Code Review uses the style guide first. Each style finding reports the file and line, offending code/text, exact rule ID and title, and the reason. A sample review response demonstrates split imports (
2H) and incomplete callable documentation (9B). Coherent Editing covers all changed text, including product copy. ASD-STE100 covers technical/agent-facing text and excludes user-facing product copy. Coherent Editing applies during initial authoring and final turn review, with no intermediate coherence polishing.Register jscpd's stdio MCP server using
npx -y jscpd@5 --mcp .. The skill checks the active project root and refreshes the scan. It handles truncated/unsupported results and compares changed code with other project source for Type 1, 2, and 3 clones. CLI fallback preserves project configuration. Dead-code analysis uses the project context, then filters findings to added code and checks dynamic/public entry points. Remove extra explanatory references outside the review skill. Preserve the imports and required MCP registration.Shorten AGENTS.md while retaining its operational requirements. Add a concise requirement for tests of authored whitespace, casting, and custom lint behavior. Parameter-only changes to existing rules do not require new tests.
Tests and validation
Add 8 authored lint suites, using the actual configuration and a shared assertion helper. Cover JS/TS whitespace, overload behavior, chained assertions, type-aware unsafe narrowing, and declaration scope. Cover authored documentation contexts for TypeScript wrappers, overloads, CommonJS exports, and bodyless return contracts. Keep inherited parameter-only settings outside these tests.
Passed locally:
bun run lint: zero errors/warnings, including explicit checks ofeslint.config.tsandeslint-rules.tsbun run check-typesbun run format:check, plus authored skill/reference Markdown checksbun run imports:check: 8 importsbun run buildandbun run check: 5 plugins, 608 filesbun test: 14 pass, zero failuresbun run publish:marketplace -- --dry-run: no refs changedgit diff --checkAdditional evidence:
Generated output remains ignored. Marketplace publication uses the normal workflow on
main. Distribution snapshots stay outside the source branch.Final source commit:
f42459496c940893860e382b0ff79277d1e88658. Exact-commit CI passed, including native Codex installation. Independent policy, whole-guide, rationale, and packaging reviews are CLEAR. Astra re-read every rule sequentially after the corrections and found no remaining actionable issue.Merged into
mainas6317f47. Post-merge CI and publication passed. All five plugins installed in Codex. Published snapshotdafcf37is parentless. Both published client packages contain byte-identical copies of the three policy files and the guide.