Repository navigation
Description
Problem
Nothing links code back to the feature it implements. An agent changing a module can't find the spec that governs it. Canonization needs to know which code belongs to a change's feature, and today it has to guess from names and history.
Proposal
Tags in code
A comment tag names the feature: @feature <feature-id>. It goes in the language's documentation comment, at file or symbol level. A file can carry more than one tag. The check recognizes these forms: /** … */ block comments (JavaScript, TypeScript, Java, Kotlin, Swift and similar), Python docstrings, /// and //! doc comments (Rust, Swift), and # comments in shell and YAML. A tag in a string literal or ordinary prose is ignored.
/**
* Sends invitation reminders.
* @feature workspace-invitations
*/A path convention for files without comments
Assets, strict JSON and some configuration files can't hold comments. These map by path instead: a file under a features/<feature-id>/ directory inside a scanned source root belongs to that feature.
Files whose location the tooling fixes, such as lockfiles or framework-mandated entry points, stay unmapped.
Check
The skill ships a check script. It scans the source roots it is given, skipping docs/product/, dot-directories and any directory passed as an exclusion, such as test fixtures or a framework's own features folder. It verifies that every @feature tag and every features/<feature-id>/ path names an existing feature directory under docs/product/features/. When a feature is renamed, split or dropped, the check fails until the code is updated, so tags can't silently go stale. Projects run it in CI.
What stays out of the feature directory
The mapping lives in the code. Feature index.md files list documents only. They never carry generated lists of code files.
Handoff and retrofit
- This issue owns the handoff's tagging instruction: new code for a change carries the change's feature ID. Its PR adds the instruction to the handoff reference that Improve product-development plugin with lifecycle review and handoff workflows #18 (lifecycle review and handoff) creates, so it lands after Improve product-development plugin with lifecycle review and handoff workflows #18.
- Tags are optional evidence for the retrofit guide. An untagged codebase is a supported starting point, and tagging can follow once features are ratified.
Acceptance criteria
- A reference file documents the tag, the path convention, the source roots and exclusions, the unmapped cases and the check, and
SKILL.mdlinks it. - The check script exists in the skill's
scripts/, with bats tests covering a valid tag in each supported comment form, an unknown feature ID, a valid path, an unknown path, a skippeddocs/product/features/directory, an excluded directory, and no false positive from@featureinside a string literal or a Markdown file. - The skill documents how to run the check in CI, with a GitHub Actions example.
- The handoff reference from Improve product-development plugin with lifecycle review and handoff workflows #18 (lifecycle review and handoff) includes the tagging instruction.
Non-goals
- Requiring every file to be tagged.
- Generating code listings inside
docs/product/. - Mapping tests to features. Scenarios already do that.
Activity
fix(product-development): apply feature-tag skips and mapping per sou…
fix(product-development): read shell, YAML and Rust strings and comme…
docs(product-development): state what the feature-tag check proves
feat(product-development): reject implementation code in the product …
fix(product-development): read here-strings, YAML flow quotes and anc…
fix(product-development): make overlapping roots order-independent an…
docs(product-development): state when the check fails and what index …
feat(product-development): link code to features with @feature tags
fix(product-development): apply feature-tag skips and mapping per sou…
fix(product-development): read shell, YAML and Rust strings and comme…
docs(product-development): state what the feature-tag check proves
feat(product-development): reject implementation code in the product …
fix(product-development): read here-strings, YAML flow quotes and anc…
fix(product-development): make overlapping roots order-independent an…
docs(product-development): state when the check fails and what index …
fix(product-development): track nested Rust block comments
fix(product-development): read Go backtick strings as raw
fix(product-development): accept heredoc delimiters that start with a…
fix(product-development): check shebangs on files with unrecognized e…
fix(product-development): report source files that cannot be read
fix(product-development): report unreadable directories and keep tags…
feat(product-development): link code to features with @feature tags (#57
fix(product-development): run scripts from the installed skill path
docs(product-development): list feature tags; say foundation documents
fix(product-development): resolve release review findings (#61)