Repository navigation
feat(molecules): per-molecule additional_instructions in config (#50) - #51
Merged
Merged
Conversation
Let projects add a few lines of their own workflow habits per molecule in
.lattice/config.yaml under additional_instructions.{molecule}. Too small for
a refiner, too local for the framework, and AGENTS.md/CLAUDE.md would load
them in every session.
- 7 workflow molecules read their key before Step 1, show the lines
verbatim, and apply them with highest priority (gates included).
No runtime policing. lattice-init/refiners-update excluded.
- The section lives once in source/shared/additional-instructions.md;
molecules carry an include marker that tools/install.sh expands
(key = folder name in snake_case). Fails on a missing snippet.
- design-blueprint back-link now uses the requirement_doc path and the
context doc's real filename, so platform-suffixed docs ({feature}-ios)
link correctly, one line per context doc (#46).
- Docs: configuration.md key reference plus guidance on choosing between
additional_instructions, AGENTS.md/CLAUDE.md and standards documents.
- Dev skills taught to read and edit the shared snippet, not inline it.
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.
What does this PR do?
Adds an optional
additional_instructions.{molecule}key to.lattice/config.yaml, so a project can give each workflow molecule a few lines of its own habits. Implements discussion #50 and closes the per-platform back-link gap promised in #46.Type of change
tools/install.shnow expands shared includesBreaking change?
Why
Every setup has small workflow habits that sit outside a molecule's core: "suffix the blueprint with the platform", "read the backend repo in
../apibefore designing", "in the handoff, name the reviews this design needs". Today people either repeat them every session or are tempted to edit the skill. They're too small and local for a refiner, and putting them inAGENTS.md/CLAUDE.mdloads them into every session, molecule or not.Feedback on #50 shaped the design:
AGENTS.md. kkumawat333 asked for clear guidance on when to use which, so the docs carry it.How it works
Before Step 1, the molecule reads its own key (one line or a list), then:
Supported keys:
requirement_forge,design_blueprint,code_forge,refactor_safely,bug_fix,review,architecture_compass. The setup molecules (lattice-init,refiners-update) don't read it.Design decisions
docs/configuration.md→ "Choosing where an instruction goes" covers it:AGENTS.md/CLAUDE.md)? Does it shape the artifact (→ usually a refiner's standards document) or the session (→ here)?all_moleculeskey. A line every workflow needs is cross-cutting and belongs inAGENTS.md/CLAUDE.md. That's the same rule the guidance teaches.One source, no copy-paste:
source/shared/+ include markerThe section is the same in all 7 molecules. Instead of 7 copies, it lives once in
source/shared/additional-instructions.md. Each molecule's source has one line before## Workflow:After copying each skill,
tools/install.sh(whichbuild-skills.shcalls) replaces the marker with the snippet. It fills in__SKILL_KEY__from the folder name (design-blueprint→design_blueprint) and fails loudly if a snippet is missing. The marker itself is the opt-in, so no map of molecules is needed, and atoms and refiners are never touched. Every generated skill inskills/stays complete on its own.Considered and rejected:
framework:additional-instructionsatom. Every run would read one more file. The priority rule would sit in a separate file from the gates it overrides, which weakens it. About 2 lines would still repeat per molecule. The atom would teach no engineering principle, and it would show up as a do-nothing 28th skill in every host. The duplication only costs us when maintaining files, so it's fixed where the copies are generated.knowledge-priming. That atom's scope is different, requirement-forge only loads it when a codebase exists, and it can be triggered on its own.design-blueprint back-link fix (#46)
Step 1.5 used to write the requirement back-link only when the requirement file was named
features/{context-doc-name}.md. A platform-suffixed context doc ({feature}-ios), the main example in the new docs, silently got no link. It now uses therequirement_docpath and the context doc's real filename, with oneDesign:line per context doc, and creates## Linksif it's missing.Related wording change: Step 2 recorded
[Entry]as "the first Decisions Log entry". That's now "in the Decisions Log", since the resume logic finds it by tag, not position.Skill checklist
Modified molecules
## Required Skillsunchanged[Entry]wording above## Workflow, matching the existing precedent ofreview's## Config ResolutionTesting
Tool used: Claude Code
Model: Claude Opus 5.5
Invoked against: build pipeline and validators. No molecule was run live against a project with the key set.
What worked correctly:
skills/generated through the include path matches the previous inline output byte for byte. The one exception isreview/SKILL.md, which now ends with a newline that its source lacked.skills/;source/shared/isn't installed as a skill; still 27 skills.install.shexits 1 naming the missing file and leaves no temp files.bash -n tools/install.shpasses. shellcheck wasn't available locally, so the CI shell-safety job is the first real shellcheck run.skill-validateon design-blueprint: PASS (run before the include refactor).Edge cases to try in review:
.lattice/config.yaml/ no key: should be silent, same behavior as before.{feature}-iosnaming: the back-link should point at the suffixed context doc.Documentation
docs/configuration.md— key reference, rules, "Choosing where an instruction goes"docs/how-it-works.md,docs/practical-guide.md— pointer + Q&Adocs/plugins.md,CONTRIBUTING.md,PROJECT.md—source/shared/+ include build stepskill-validate,skill-forge,skill-review,skill-tighten,skill-enhance) read and edit the shared snippet instead of inlining it;skill-validatereports broken includesAnything else?
Deferred from the #50 thread, each worth its own change:
lattice-initwarning when a config line repeats an agent-file or refiner line.