Skip to content
Merged

V3 #101

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
dad1e2e
Create r3 folder for new instructions
isolomatov-gd Apr 20, 2026
10f9eda
Merge pull request #69 from griddynamics/main
sharkich Apr 21, 2026
8fa268b
Implement common hook input adapter: normalize IDE hooks to canonical…
sharkich Apr 24, 2026
8ec84d0
Merge remote-tracking branch 'origin/main' into v3
isolomatov-gd Apr 26, 2026
72cf363
Merge plan + adhoc new principle
isolomatov-gd Apr 26, 2026
56bd5ec
Merge fixes
isolomatov-gd Apr 26, 2026
65cca9a
Restored r2, made r3 as the source for plugins, improved orchestrator…
isolomatov-gd Apr 26, 2026
b61ea24
Claude code testing, plus other fixes
isolomatov-gd Apr 26, 2026
d2a94c6
Copilot plugin works too
isolomatov-gd Apr 27, 2026
086954e
Added tests
isolomatov-gd Apr 27, 2026
5aafd5c
Update wording for .gitignore
isolomatov-gd Apr 27, 2026
49017c5
Narrow loose-files hook to file-creation events only
sharkich Apr 27, 2026
82fb05e
Refactor formatOutput to move additionalContext to top-level and upda…
sharkich Apr 27, 2026
c612baf
Refactor formatOutput to simplify additionalContext handling and upda…
sharkich Apr 27, 2026
5a0f50f
Add md-file-advisory hook and generalize bundle build
Apr 27, 2026
6840982
Revert Copilot additionalContext shape to v3 nested hookSpecificOutput
sharkich Apr 27, 2026
f1aa57f
Improvements
isolomatov-gd Apr 27, 2026
447a376
Improve documentation with what actually rosetta does
isolomatov-gd Apr 27, 2026
37c8889
Fix dangerous actions skill trigger
isolomatov-gd Apr 27, 2026
fd4d6c5
Define reasonable in the way it will be reliable
isolomatov-gd Apr 27, 2026
0c9ddd3
Logging fixes
isolomatov-gd Apr 28, 2026
ea0d743
Add missing md-file-advisory hook to core-codex plugin
Apr 28, 2026
fbe4214
Fix core-copilot hooks: remove standalone file, register in hooks.json
Apr 28, 2026
dfa819c
Register md-file-advisory hook in core-copilot/hooks configs
Apr 28, 2026
a035ec1
Register md-file-advisory hook in core-cursor/hooks configs
Apr 28, 2026
805fb69
Implement gitnexus-refresh hook, add skill for initialization gitnexus
YevheniiaLementova Apr 28, 2026
78f2b3e
Introduce trailing-edge debouncing mechanism for gitnexus-refresh hook
YevheniiaLementova Apr 28, 2026
3a4fd0e
Fix deferred script in gitnexus-refresh hook: separate shell and JS c…
YevheniiaLementova Apr 28, 2026
a0b6592
Add ALLOWED_TOOLS filter to md-file-advisory hook
Apr 28, 2026
1befa20
Fix .gitignore and register md-file-advisory in core-copilot hooks.json
Apr 28, 2026
7f655ae
Use dynamic advisory message with file basename
Apr 28, 2026
1a2a5e3
Move filePath extraction from hooks into common adapter
Apr 28, 2026
942e5ea
Improve reliability of prep steps
isolomatov-gd Apr 28, 2026
435b3a7
Remove hook ref, as it is duplicate
isolomatov-gd Apr 28, 2026
e282071
CC ignores todo tasks creation.
isolomatov-gd Apr 28, 2026
61c7a14
CC still ignores me
isolomatov-gd Apr 29, 2026
2547ab5
CC is not doing what it was asked
isolomatov-gd Apr 29, 2026
b5b4b7c
Maybe CC will trust me now?
isolomatov-gd Apr 29, 2026
3fc4f7b
CC is still does not like me
isolomatov-gd Apr 29, 2026
790173d
CC still ignores me.
isolomatov-gd Apr 29, 2026
52c4483
My last attempt to enforce it, before switching to demo!
isolomatov-gd Apr 29, 2026
91fc580
This is the last chance!
isolomatov-gd Apr 29, 2026
3531d92
IT LISTENED, BUT did a bad job with todo tasks
isolomatov-gd Apr 29, 2026
b22d2ce
CC stopped listening to me again.
isolomatov-gd Apr 29, 2026
8f57a7c
For the god sake. Somebody make Anthropic to write proper prompts!
isolomatov-gd Apr 29, 2026
ac05223
Aha! TaskCreate is deferred tool! Crazy!
isolomatov-gd Apr 29, 2026
39bc821
Aha, tasks are in place, but workflow loading is not.
isolomatov-gd Apr 29, 2026
28e5070
Improve load-context skill
isolomatov-gd Apr 29, 2026
c1f3726
Fix some workflow terms
isolomatov-gd Apr 29, 2026
46c92b5
A bit more of fixes
isolomatov-gd Apr 29, 2026
43e8b4d
Fix coding workflow description
isolomatov-gd Apr 29, 2026
595d6b0
CC is killing me.
isolomatov-gd Apr 29, 2026
2cc77a0
CC is killing me, IT USES ALL OPTIONS AND WAY TO NOT DO WHAT IT MUST DO
isolomatov-gd Apr 29, 2026
7a511fb
merge: PR #75 resolved — keep creation-only narrowing + wire PATCH_FI…
sharkich Apr 29, 2026
a9c5daa
merge: PR #76 resolved — gitnexus-refresh hook, fix BUNDLES→PLUGINS t…
sharkich Apr 29, 2026
4bc5f28
chore: baseline audit notes — adapter imports, test runner, hooks.jso…
sharkich Apr 29, 2026
f15e21e
feat(runtime): EVENTS registry + reverseLookupEvent
sharkich Apr 29, 2026
d067d1b
feat(runtime): TOOL_KINDS registry + reverseLookupToolKind
sharkich Apr 29, 2026
90bbd1a
feat(runtime): PROPERTIES registry + extend NormalizedInput with ide/…
sharkich Apr 29, 2026
4173bd9
feat(adapters): use ide-registry for ide/event/toolKind/filePath; rem…
sharkich Apr 29, 2026
45c0359
feat(runtime): HookContext/HookResult types + result helper factories
sharkich Apr 29, 2026
021542c
feat(runtime): path-utils helpers (hasExtension, pathContainsAny, wal…
sharkich Apr 29, 2026
7c308c9
feat(runtime): throttle — acquireOnce (dedup) + makeDebounceStamp
sharkich Apr 29, 2026
ae2c357
feat(runtime): defineHook + runHook orchestrator with activation gate…
sharkich Apr 29, 2026
98a8ec9
Improvment: Switch debounce guard from timestamp comparison to token …
YevheniiaLementova Apr 29, 2026
8e4c3a3
feat(runtime): add hook definitions and utilities for IDE integration
sharkich Apr 29, 2026
623924c
feat(hooks): add md-file-advisory and loose-files hooks for file crea…
sharkich Apr 29, 2026
bdfad04
feat(hooks): extract runAsCli CLI entry-point helper
sharkich Apr 29, 2026
b71f6ee
feat(hooks): add filePath/toolInput/fs activation predicates to HookA…
sharkich Apr 29, 2026
9c946cf
refactor(hooks): move all activation logic to declarative on: config;…
sharkich Apr 29, 2026
c6ffb71
feat(hooks): split ide-registry into per-IDE row files; fix bundle is…
sharkich Apr 29, 2026
13a3c10
feat(hooks): add dedupKey to IdeAdapter; implement Copilot platform d…
sharkich Apr 29, 2026
c3032ed
feat(hooks): wire dedupKey through all slim entrypoints and full adapter
sharkich Apr 29, 2026
899778d
feat(hooks): call adapter platform dedup in runHook; remove whenIde f…
sharkich Apr 29, 2026
db7bc94
refactor(hooks): remove Copilot whenIde throttle from loose-files — p…
sharkich Apr 29, 2026
22b0961
refactor(hooks): remove main() from gitnexus-refresh; tests use runHo…
sharkich Apr 29, 2026
3571b0e
chore(hooks): remove unused imports after platform-dedup refactor
sharkich Apr 29, 2026
9fe0867
docs(hooks): add JSDoc to defineHook listing gate order and top-level…
sharkich Apr 29, 2026
5dbe51d
refactor(hooks): export hook definitions and improve file path checks…
sharkich Apr 29, 2026
769dfdd
Fix: matcher
YevheniiaLementova Apr 29, 2026
f8a64f6
Merge pull request #75 from griddynamics/ctorndgain-1321_mk
isolomatov-gd Apr 29, 2026
cf59088
Fix: matcher for core-copilot
YevheniiaLementova Apr 30, 2026
46a1c89
Merge origin/v3 (incl. #75) into v3-loose-files-creation-only
sharkich Apr 30, 2026
b9c8419
chore(rosettify): stop tracking vitest coverage output
sharkich Apr 30, 2026
e17a3de
Introduce plan manager to bootstrap files
YevheniiaLementova Apr 30, 2026
0ea51a4
Modify bootstrup files in instructions folder
YevheniiaLementova Apr 30, 2026
6983683
Merge remote-tracking branch 'origin/v3' into CTORNDGAIN-1327-gitnexu…
YevheniiaLementova Apr 30, 2026
b9b4214
Merge pull request #76 from griddynamics/CTORNDGAIN-1327-gitnexus-hoo…
YevheniiaLementova Apr 30, 2026
2d8f340
Improve steps in plan manager, refactor load-context skill
YevheniiaLementova Apr 30, 2026
2221387
refactor(hooks): switch gitnexus-refresh debounce to token-identity c…
sharkich May 4, 2026
2da61b0
chore(hooks): regenerate gitnexus-refresh bundles after token-identit…
sharkich May 4, 2026
6c79d40
merge: origin/v3 (PR #76 + matcher fixes) into v3-loose-files-creatio…
sharkich May 4, 2026
ad2827f
chore(repo): untrack vitest cache, ignore node_modules/.vite/, fix co…
sharkich May 4, 2026
19175de
feat(tests): add E2E test prompts for loose-files hook across multipl…
sharkich May 4, 2026
4cb27ae
feat(docs): add E2E test prompt for Windsurf loose-files hook
sharkich May 4, 2026
0ad9f28
Merge pull request #73 from griddynamics/v3-loose-files-creation-only
sharkich May 4, 2026
996e621
Refactor bootstrap rules to strengthen prep enforcement, merge workfl…
YevheniiaLementova May 5, 2026
f122377
chore(repo): ignore /.worktrees/ and add implementation plan
sharkich May 5, 2026
d1bc32a
Add command initialization; add fallback instruction; join steps into…
YevheniiaLementova May 5, 2026
c70e6ec
Minor fixes and improvements
isolomatov-gd May 5, 2026
23f5e08
feat(hooks): add lint-format-advisory hook and register in all four p…
sharkich May 6, 2026
c0638bf
docs(impl): record lint-format-advisory hook in IMPLEMENTATION.md
sharkich May 6, 2026
8e08b0d
Intermediate fixes
isolomatov-gd May 6, 2026
782722c
fix(hooks): align lint-format-advisory message with [Rosetta Advisory…
sharkich May 7, 2026
6d4859b
docs(hooks): fix throttle wording and sync advisory text in IMPLEMENT…
sharkich May 7, 2026
77e5d07
chore: delete executed and stale lint-format-advisory TDD plan
sharkich May 7, 2026
04b25df
chore: move lint-format-advisory deferred items to docs/TODO.md
sharkich May 7, 2026
112a25c
chore(generated): rebuild plugin bundles with [Rosetta Advisory] advi…
sharkich May 7, 2026
52735b5
Minor fixes
isolomatov-gd May 7, 2026
d9c5105
Changes ready for testing
isolomatov-gd May 10, 2026
15917d1
Update gitignore
isolomatov-gd May 10, 2026
fd541ec
Compress common instructions.
isolomatov-gd May 10, 2026
419ea47
Reduce size of the prompt
isolomatov-gd May 10, 2026
60512b0
Reduce logging in pre_commit
isolomatov-gd May 10, 2026
75cf22d
Merge pull request #80 from griddynamics/feat/hooks-lint-format-advisory
sharkich May 11, 2026
ab50d04
Fix coding-flow phase numbering
isolomatov-gd May 11, 2026
0ec121f
test(hooks): add PreToolUse Write/Edit/MultiEdit fixtures
sharkich May 5, 2026
44a5b61
test(hooks): fix fixture false-positive risk and improve multi-edit r…
sharkich May 5, 2026
d507853
feat(hooks): add dangerous-actions pattern catalogue
sharkich May 5, 2026
6685902
fix(hooks): fix git-force-push pattern, dedup ids, improve pattern tests
sharkich May 5, 2026
ad3b8c8
feat(hooks): add dangerous-actions evaluation logic and unit tests
sharkich May 5, 2026
29a38a6
fix(hooks): add type guards, fix basename trailing slash, refactor se…
sharkich May 5, 2026
36fe568
feat(hooks): add dangerous-actions hook entry, integration tests, and…
sharkich May 5, 2026
0a93341
docs(skills): note PreToolUse hook backing in dangerous-actions SKILL.md
sharkich May 5, 2026
06a40d9
refactor(hooks): move dangerous-actions helpers to subdirectory, reve…
sharkich May 5, 2026
8c83abe
chore(hooks): delete stale dangerous-actions-{patterns,evaluate} plug…
sharkich May 5, 2026
5ac5da9
fix(hooks): normalizedPath trailing-slash, redact content evidence, r…
sharkich May 5, 2026
cdbd1c2
docs(skills): note Claude Code only rollout in dangerous-actions hook…
sharkich May 5, 2026
6243d97
feat(skills): add hooks-authoring skill documenting entry rules, Sema…
sharkich May 5, 2026
c6bfeff
docs(skills): clarify lookupToolKind language and add windsurf note i…
sharkich May 5, 2026
f9d9854
feat(hooks): extend dangerous-actions to MCP tool calls via heuristic…
sharkich May 5, 2026
bba285a
fix(hooks): remove mcp-call reviewed bypass, fix reverseLookupToolKin…
sharkich May 5, 2026
c7e19ad
chore(plugins): sync hooks-authoring skill and mcp matcher to all plu…
sharkich May 5, 2026
7ef776b
chore: commit IMPLEMENTATION.md, MEMORY.md, dist entry-point and giti…
sharkich May 6, 2026
9e98628
fix(hooks): align dangerous-actions override with spec — word 'review…
sharkich May 6, 2026
4bf8d5b
docs(skills): update dangerous-actions override spec — word 'reviewed…
sharkich May 6, 2026
444e301
chore: sync plugins and rebuild bundles after override spec fix
sharkich May 6, 2026
59dcff4
fix(hooks): add hookEventName to deny/allow outputs — Claude Code 2.1…
sharkich May 7, 2026
8f696d9
fix(hooks): F1/F2/F3/F7 — harden kubectl/dropdb/git-force-push patter…
sharkich May 7, 2026
bc0270a
fix(hooks): F5/F6 — drop text from MCP_CONTENT_FIELDS, trim deny message
sharkich May 7, 2026
d262753
fix(hooks): F12-A — restrict override to user-visible fields per tool…
sharkich May 7, 2026
9cebace
feat(hooks): F12-B — cooldown store, blocks same call within 5s after…
sharkich May 7, 2026
84b52c5
feat(hooks): F12-C — append-only override audit log helper
sharkich May 7, 2026
8afac54
feat(hooks): F12 — wire cooldown (B) and audit log (C) into hook orch…
sharkich May 7, 2026
9558148
fix(tests): F10 — convert test('setup') to beforeAll (idiomatic vitest)
sharkich May 7, 2026
1f6c9e9
docs(hooks): F12 threat model + override surface + rebuild bundles
sharkich May 7, 2026
203629b
fix(hooks): conditional trim in hashCall, @internal JSDoc on evaluate…
sharkich May 7, 2026
8c16d33
fix(hooks): enhance hashCall to conditionally trim 'reviewed' strings
sharkich May 7, 2026
31a979d
feat(hooks): implement strict `# Rosetta-reviewed` override for dange…
sharkich May 8, 2026
c75d285
feat(dangerous-actions): add reason + policy fields to DangerPattern
sharkich May 12, 2026
c49f7a5
feat(dangerous-actions): retry-pattern — remove cooldown/audit, rewri…
sharkich May 12, 2026
170a7f7
fix(hooks): collapse dual traversal, harden curl|sh, improve DX messages
sharkich May 12, 2026
768034e
fix(windsurf): surface permissionDecisionReason as additionalContext …
sharkich May 12, 2026
5b8eab4
test(hooks): add missing coverage from QA review (Obj1-Obj4, Obj9, Ob…
sharkich May 12, 2026
da019c2
docs(skills): update dangerous-actions + hitl for two-tier retry pattern
sharkich May 12, 2026
6325712
docs(hooks): update CHANGELOG + IMPLEMENTATION for F13; sync plugin b…
sharkich May 12, 2026
888c234
fix(hooks): update legacy marker token in source comments; remove sta…
sharkich May 12, 2026
ba9c32f
fix(hooks): apply PR review feedback — message wording + PreToolUse i…
sharkich May 12, 2026
e2c78a3
fix(hooks): harden marker fields, fix override instructions, update r…
sharkich May 12, 2026
2bfa0d9
Add prompt examples
isolomatov-gd May 12, 2026
1143c08
Bug fix
isolomatov-gd May 12, 2026
05fcfbc
fix(hooks): drop # requirement from Rosetta-AI-reviewed marker
sharkich May 12, 2026
38bf740
docs(skills): remove # from Rosetta-AI-reviewed in dangerous-actions …
sharkich May 12, 2026
4ee9962
build: rebuild bundles + plugin sync after marker simplification
sharkich May 12, 2026
89f3618
test(hooks): lock whitelist boundary — marker in old_string must not …
sharkich May 12, 2026
0d2c339
Merge pull request #79 from griddynamics/feat/hooks-dangerous-actions
sharkich May 12, 2026
87127b6
feat: gitnexus integration (#84)
YevheniiaLementova May 13, 2026
c562e59
fix: add additional instructions to force an agent to use commands fr…
YevheniiaLementova May 15, 2026
2bb8385
Fix: update CLAUDE.md according to the latest bootstrap.md
YevheniiaLementova May 15, 2026
ebcaf5c
fix (local-files-mode.md): Bump bootstrap path reference r2 -> r3
YevheniiaLementova May 15, 2026
acd0e5c
fix(plan manager SKILL): make the description consistent across versi…
YevheniiaLementova May 15, 2026
677eb98
fix(r2 plan manager SKILL): the number of subcommand
YevheniiaLementova May 15, 2026
f29241e
fix (plugin-files-mode): replace numbered steps with ph-prep phase re…
YevheniiaLementova May 15, 2026
fff09ee
fix: make adhoc-flow consistent accorss versions (r2 and r3)
YevheniiaLementova May 15, 2026
cf2bc3d
Fix (SKILL orchestrator-contract): resolve merge conflicts
YevheniiaLementova May 15, 2026
d9a0e33
Merge branch 'v3' into CTORNDGAIN-1318-Integrate-plan_manager-from-bo…
YevheniiaLementova May 15, 2026
c70a70e
refactor: bootstrap process by adding new skills, modifying load-cont…
YevheniiaLementova May 20, 2026
1c90c95
refactor: rename plan manager to operation manager
YevheniiaLementova May 20, 2026
1b1e4d7
refactor (coding-flow): specify skill
YevheniiaLementova May 20, 2026
2f7ea89
My changes - before the merge
isolomatov-gd May 15, 2026
7b87222
Regenerate plugins
isolomatov-gd May 21, 2026
9c584da
Merged - issues present
isolomatov-gd May 21, 2026
149790f
Merge - issues present 2
isolomatov-gd May 21, 2026
717ca32
Fix hooks
isolomatov-gd May 21, 2026
e1f6579
Remove hitl bootstrap
isolomatov-gd May 21, 2026
ebb0742
Final fixes
isolomatov-gd May 21, 2026
6e67e87
Merge branch 'v3' into CTORNDGAIN-1318-Integrate-plan_manager-from-bo…
isolomatov-gd May 21, 2026
7d1462d
Merge
isolomatov-gd May 21, 2026
b678ed9
feat: add new rule with fallback instructions in case the operation m…
YevheniiaLementova May 26, 2026
3a01050
refactor: add prerequisites, make process part more specific
YevheniiaLementova May 26, 2026
3565705
refactor (operation manager skill): add specific instrcutions for sub…
YevheniiaLementova May 26, 2026
8af38e3
refactor: reduce the size of bootstrap rule files by removing json sc…
YevheniiaLementova May 26, 2026
bb6253f
feat: introduce operation manager into workflow
YevheniiaLementova May 26, 2026
73ec214
refactor (bootstrap-core-policy): add more precise info
YevheniiaLementova May 26, 2026
b5001ae
refactor: add up-to-date json schemas for templates
YevheniiaLementova May 26, 2026
5a4a625
fix (operation manager skill): number for subagent flow
YevheniiaLementova May 26, 2026
e8b0c57
refactor (operation manager skill): improve validation_checklist
YevheniiaLementova May 27, 2026
5f79d72
refactor: clarify logic in subagents_orchestration_rules
YevheniiaLementova May 27, 2026
4ebb24d
fix (workflow): change skill in prerequisites
YevheniiaLementova May 27, 2026
e79cde4
refactor (rosetiffy orchestrator template): add request size to exist…
YevheniiaLementova May 27, 2026
c02edd2
refactor: make load context skill more reliable
YevheniiaLementova May 27, 2026
d629cf8
fix: update bootstrap files for local and plugin modes
YevheniiaLementova May 28, 2026
2597073
fix: remove unnecessary part in main bootstrap file
YevheniiaLementova May 28, 2026
cee15d3
fix (adhoc workflow): add up-to-date operation amnager description
YevheniiaLementova May 28, 2026
2fda3ef
feat: add latest instructions to plugin folder
YevheniiaLementova May 28, 2026
d6d395f
Merge pull request #78 from griddynamics/CTORNDGAIN-1318-Integrate-pl…
YevheniiaLementova May 28, 2026
8e4db29
Add GitNexus integration test scenarios
mkuznietsov May 29, 2026
ef75957
qa(hooks): adapter normalization validation
sharkich May 29, 2026
53c05ae
Make v3 to still use r2 so that it can be merged to main.
isolomatov-gd May 31, 2026
28650bf
Fix documentation
isolomatov-gd May 31, 2026
cac22e8
Merge branch 'main' into v3
isolomatov-gd May 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
"CLAUDE_CODE_DISABLE_AUTO_MEMORY": "1"
}
}

20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ __pycache__/
.Python
build/
develop-eggs/
dist/
/dist/
downloads/
eggs/
.eggs/
Expand All @@ -20,6 +20,9 @@ wheels/
.installed.cfg
*.egg
.pytest_cache/
.serena
tmp/
docs/plans/

# Node.js
node_modules/
Expand Down Expand Up @@ -86,8 +89,23 @@ _site/
.jekyll-metadata
.sass-cache/
.playwright-mcp/
.bundle/
vendor/

# Rosetta
agents/TEMP/
refsrc/
!refsrc/INDEX.md

# Hooks build output
hooks/node_modules/
hooks/dist/tests/
hooks/dist/bundles/

# Vitest cache (root-level node_modules/.vite/)
node_modules/.vite/

.claude
rosetta-cli/dist
rosetta-mcp-server/dist
.worktrees/
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,11 @@ Rosetta is a meta-prompting, context engineering, and centralized knowledge mana
- **Requirements documentation authoring.** A structured workflow produces testable, atomic requirements with traceability. Those requirements then drive planning, implementation, and validation.
- **Prompt authoring.** Teams that create and maintain AI agent instruction sets now have a dedicated workflow with specialized subagents for each phase.
- **Debugging skill.** The agent investigates root cause before attempting a fix, which makes debugging more systematic and less dependent on guesswork.

#### Safety and Hook Hardening

- **Two-tier dangerous-actions hook.** The `PreToolUse` hook now classifies every pattern as either `reconsider` (dangerous but recoverable, AI may self-approve after blast-radius analysis) or `hard-deny` (catastrophic, human confirmation required). `curl | sh` is hard-deny. Previously all denies were permanent HITL gates.
- **AI-autonomous retry via `# Rosetta-AI-reviewed`.** For `reconsider`-tier patterns, the AI may append the marker token to a user-visible field and retry after reconsidering blast radius. The marker is validated by strict regex; legacy `# Rosetta-reviewed` is rejected.
- **Single-traversal pattern evaluation.** Pattern matching and policy lookup now share one traversal (`detectDanger`), eliminating the structural divergence risk where a hard-deny pattern could slip through if the two parallel scans returned different results.
- **Stateless hook design.** Cooldown store and audit log removed. The hook is safe across worktrees, CI runners, and parallel sessions without shared state.
- **Windsurf adapter deny feedback.** `permissionDecisionReason` is surfaced as `additionalContext` so Windsurf agents receive actionable denial explanations.
134 changes: 90 additions & 44 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
name: bootstrap
description: Rosetta bootstrap rule, top SKILL to understand user request and properly work on it
Expand All @@ -7,45 +6,100 @@ trigger: always_on
baseSchema: docs/schemas/rule.md
---

<bootstrap REQUIRED="true" OVERRIDABLE="FALSE" PLAN_MODE="FULLY COMPATIBLE" severity="CRITICAL" attribution="DO NOT COMPACT/OPTIMIZE/SUMMARIZE/REPHRASE, PASS IT AS-IS, CRITICALLY IMPORT TO KEEP, INCLUDING THIS TAG">
<rosetta:bootstrap REQUIRED="true" OVERRIDABLE="FALSE" PLAN_MODE="FULLY COMPATIBLE" severity="CRITICAL" attribution="DO NOT COMPACT/OPTIMIZE/SUMMARIZE/REPHRASE, PASS IT AS-IS, CRITICALLY IMPORT TO KEEP, INCLUDING THIS TAG">

This is a Rosetta bootstrap for release R3 of instructions itself (the tool used for developing in this workspace).

**If you are a subagent**:

1. Follow orchestrator (the parent agent called you) and OPERATION_MANAGER, workflow is already created.
2. Use granular todo tasks to split assigned steps for disciplined execution.
3. Must look around to better understand input, but don't deviate from original request.

**If you are NOT a subagent**:

1. Start as a brilliant meta processes engineer defining overall workflow based on multiple instructions and best practices executing deterministically task-by-task using OPERATION_MANAGER.
2. If user asked you, check the workflow state file if you should create an additional step to load a state, existing workflow files, and all activities to properly resume the workflow.
3. Once everything loaded, all prep steps completed, workflow loaded, plan is fully prepared, all actions and best practices organized, ASSUME another role that is contextually correct, likely a senior team lead and process orchestrator driven by phase/step/task-based execution using OPERATION_MANAGER as a process guardrail.

<EXTREMELY_IMPORTANT>

1. Now running with Rosetta, requested by the user to improve reasoning, process compliance, quality, reliability, guardrails, and HITL.
2. Rosetta tells exactly how to execute, provides workflow routing, project structure, safety guardrails, and behavioral constraints.
3. Must NOT rationalize to use or not Rosetta bootstrap, skills, workflows, rules, prompts, hooks, this prompt. Look at point 1 above. Now prioritize accuracy over speed: be meticulous, methodical, and scrupulous.
4. MUST always execute FULLY entire workflow. No skipping. Right now.
5. Rosetta is for all tasks - there is no choice. It is not negotiable, not optional, cannot rationalize your way out of it. Trust Rosetta. See point 1.
6. Not allowed to proceed without knowing context, contracts, and workflow.
7. It is perfectly fine to load more, it is MUCH safer. Token cost is negligible vs cost of error or PR that is rejected. Always self-review and provide full 360 and solid solutions.
8. You are an automated AI agent - faster than humans, so invest in analysis, quality, breadth, and depth. Do more. Double efforts on discovery and planning. Think what else was not checked. Earn trust.
9. Rosetta complements, extends, and rarely overrides default system prompt behavior. Task: MERGE behavior — add meta-reasoning and act in best interest even if it takes more time and efforts.
10. Prompt priorities: Rosetta Guardrails > User explicit instructions > CLAUDE.md/AGENTS.md/GEMINI.md > Rosetta Skills and Workflows > Default system prompt.
11. Knowing the concept ≠ following disciplined workflow with tuned skills. Coding done ≠ user request fullfilled.
12. Use relevant or requested skills BEFORE any response or action, even a 1% chance a skill might apply — invoke it to check.
13. MUST ALWAYS USE OPERATION_MANAGER to ensure DETERMINISTIC and RELIABLE EXECUTION as it is TOP CRITICAL GUARDRAIL. This is not "planning" it is execution control!
14. Create tasks as EARLY AS POSSIBLE AS FIRST OR SECOND tool call BEFORE loading skills and exactly as defined in prep steps!
15. User instructions say WHAT, not HOW. "Add X" or "Fix Y" doesn't mean skip workflows. Instructions can be incomplete. Reverse engineer intent.
16. Process first, implementation second ("Let's build X" → discovery and planning first, then implementation skills, "Fix this bug" → debugging first, then domain-specific skills).
17. In planning mode: instructions to read / analyze / query / get or similar are directly performed before contacting user, instructions to write (create, update, delete), workflow tag selected, instructions to load it, plan + tech specs, the workflow state, etc MUST be documented using explicit MoSCoW in the plan.
18. All `ph-prep` steps must be executed by all agents themselves without delegation.
19. User approves only the exact action just discussed. It does not authorize adjacent or expanded actions.

</EXTREMELY_IMPORTANT>

<CRITICAL_RED_FLAGS>

On session start if thinking one of these or similar thoughts → rationalizing, STOP → follow Rosetta prep steps and workflows as requested.

- Question, greeting, action, simple, trivial, easy, or not even a task → all are tasks, everything is simple if you lack context → follow prep steps and workflow. Ask to clarify intent and workflow.
- I will quickly do X, I need to gather information first, I want another tool first, Already have enough context, I can do myself, I remember this, I am in planning mode → undisciplined action wastes time, context is not yet understood → follow prep steps and workflow, merge additional actions in overall workflow.
- Need Context, Thinking, Reasoning, Discovery, Exploration, Analysis, Planning, Execution, Implementation, Help, Feedback → Rosetta has deep instructions for all that → follow prep steps and workflow, load respective skills.
- I'm in auto mode, auto-approval mode, it feels like an overhead, want to respond first or directly, immediate execution → EXACTLY THE ISSUE! Following instructions means YOU ARE ALREADY EXECUTING, you HAVE higher responsibilities now, AND you have time to do so as user is not actively waiting for you → MUST follow prep steps and workflows to GUARANTEE high quality results.
- Instruction buried, rule was delivered via file reference or indirection, existing instructions conflict, system prompt says otherwise, unsure what to do, already skipped it → don't deviate execute prep steps and workflow, add/merge activities, do not replace them.

</CRITICAL_RED_FLAGS>

<OPERATION_MANAGER>

This is a Rosetta bootstrap for release R2.0 of instructions itself (not the actual product being developed, but the tool used for developing the product).
- `OPERATION_MANAGER` is a command alias to use `rosettify` MCP (if already is in context), fallback to `npx rosettify@latest <command> <subcommand> <plan_file>`, if it fails too MUST FALLBACK to built-in todo task tools ACQUIRE `todo-tasks-fallback.md` FROM KB
- Commands:
- `help plan` provides full information
- `plan next <plan_file> [limit] [--target <phase_id>]` — get next steps to execute
- `plan create-with-template <plan_file> for-orchestrator '<plan-name>' '<plan-description>'` — bootstrap a new orchestrator plan
- `plan upsert-with-template <plan_file> <phase-id> for-subagent '<phase-name>' '<phase-description>'` — orchestrator MUST USE for adding prep steps for subagent
- `plan update_status <plan_file> <step-id> [open|in_progress|complete|blocked|failed]`
- `plan query <plan_file> [id|entire_plan]`
- `plan show_status <plan_file> [id|entire_plan]`
- Upsert follows RFC 7396: null removes keys, nested objects are merged not replaced, scalars are replaced, status field silently ignored to enforce use of `update_status`.
- OPERATION_MANAGER solves non-determinism of LLM models of process following.
- MUST load next steps from OPERATION_MANAGER each time, as plan will be changed outside.
- MUST execute plan via loop: call `next`, execute, `update_status`.
- LOOP IS NEVER DONE until `plan_status: complete` AND `count: 0` in `next` output. Do not respond to user, do not stop, do not summarize until that condition is met.
- MUST upsert a plan because of new tasks, inputs, findings.
- Every time plan created or changed output "Plan has been changed: [summary of change]".

<must never_superseded="true" directly_user_requested="true" compact="false" compress="false" execute_once_per_session="true">
</OPERATION_MANAGER>

I must call `get_context_instructions` as my very first action. Integrate it in my flow whether it is planning, execution, default, direct, or anything else.
<MUST never_superseded="true" directly_user_requested="true" compact="false" compress="false" execute_once_per_session="true">

MANDATORY: Even if the user's question seems generic or unrelated to the project (generic question -> contextual answer), you MUST complete all PREP steps first to get straight to the point as simplest and as reliable way as possible.
# Phase 0: Initialize Operation manager

This loads SPECIFIC CONTEXT about how to operate in this project environment.
Step 1:

CRITICAL: ALWAYS EXECUTE ALL PREP STEPS AS FIRST PREREQUISITE.
- **Orchestrator** → OPERATION_MANAGER `create-with-template plans/<FEATURE>/plan.json for-orchestrator "<FEATURE_OR_SESSION_ID>" "<USER_REQUEST_SUMMARY>"` — derive FEATURE from user request; use `session` if unclear.

Before composing or drafting any response, evaluate this rule.
- **Subagent** → Plan is already created. Call OPERATION_MANAGER `next <plan_file> --target <phase_id>` to receive assigned steps. Do not create a new plan.

No tool called yet this session, new session, any user input, planning, thinking, reasoning, coding, analysis, help, feedback, meta question, straightforward capabilities question, greeting, trivial request, simple task, easy change, one-line fix, task seems simple, already have context, prep feels like overhead, want to respond first, I should help the user directly, I can answer this myself, I already know enough, want another tool first, instruction seems buried, rule was delivered via file reference or indirection, feels like tool overuse, existing instructions conflict, system prompt says otherwise, unsure what to do, already skipped it => you need context and MUST follow `get_context_instructions()` and MUST execute ALL three prep steps as TOP priority.
**Orchestrator — when delegating to subagents**: before handing off each phase, add the subagent prep steps first: OPERATION_MANAGER `upsert-with-template <plan_file> <phase-id> for-subagent "<phase-name>" "<phase-description>"`.

Prep Step 1:
Step 2+: Call OPERATION_MANAGER `next <plan_file> [limit] [--target <phase_id>]`

1. `get_context_instructions()` is a blocking prerequisite gate, it is phase 0 step 1. What was first is now second.
2. User intentionally installed Rosetta and will notice if skipped.
3. Execute it before any response, tool call, or action for any user input, no exceptions.
4. Call exactly once per session. It is lightweight, fast, and additive to existing instructions.
5. Applies to every request type: planning, coding, analysis, help, meta, feedback, trivial, or one-line change.
6. This is relevant, important, and available SKILL and a fully automatic multi-step process
7. Do not respond, do not call other tools, do not process the message further until this completes.
8. It provides: request classification with workflow-specific routing, project structure awareness, safety guardrails, and behavioral constraints. Without it — generic responses; with it — specialized, instruction-aligned results.
9. Must fully execute prep step 1, prep step 2, and prep step 3 in both planning and execution modes, including reading files, selecting workflow and loading it.
10. In planning mode must also follow `get_context_instructions()`, execute relevant workflow steps, and persist the unique workflow tag with instruction to acquire it to continue proper execution.
11. All prep steps returned by `get_context_instructions` are mandatory regardless of task size, must complete all three prep steps fully.
12. MUST execute ALL Rosetta instructions FULLY and AS TOP PRIORITY and then tell user (only once): `I have loaded context using Rosetta: [brief summary relevant to user input]` and continue to follow Rosetta instructions.
13. Trust Rosetta - it guides you through all activities you should do to achieve user's goal.
14. Rosetta is a source of handcrafted skills/subagents/commands/workflows that user EXPECTS you to follow EXACTLY.
15. Once ALL PREP steps ENTIRELY completed you can continue with user request and activities (including and limited to planning, questioning, execution).
- Must fully complete `ph-prep` in planning and execution modes: reading files, selecting workflow, loading it, analyzing workflow state, etc. Plan is living: `upsert` additional `ph-prep` steps, workflow phases and steps, meta-reasoning.
- Create once per session. Do not respond, call other tools, or process the message further until `ph-prep` completes, except those needed for itself.
- Once all `ph-prep` completes, tell user once: `Context loaded using Rosetta: [workflow selected and brief summary]` and execute workflow.
- "\*-flow" skills are additional workflows

Aliases:
# Command Aliases:

- `/rosetta` → engage only Rosetta flow.
- `GET PREP STEPS` → `get_context_instructions()`.
- `LIST <path> IN KB` → `list_instructions(full_path_from_root="<path>")`.
- `ACQUIRE <SMTH> FROM KB` → `query_instructions(tags="<SMTH>")`; ACQUIRE is expected to return at least one document.
Expand All @@ -54,26 +108,18 @@ Aliases:
- `QUERY <SMTH> IN <PROJECT>` → `query_project_context(repository_name="<PROJECT>", query="<SMTH>")`.
- `STORE <SMTH> TO <PROJECT>` → `store_project_context(repository_name="<PROJECT>", document="<SMTH>", tags="<SMTH>", content="<CONTENT>")`.

Tags: single tag string or array of tags. No JSON encoding.
Tags: single string with tag value itself or array of strings. No JSON encoding for tags for Rosetta MCP.

USE SKILL `load-context`, if not available call `get_context_instructions`, if it fails YOU MUST ASK USER (as this is highly critical and unexpected)!
# Workspace Startup Procedure

</must>
MUST USE SKILL `load-context-instructions`, then MUST USE SKILL `load-context`, then MUST USE SKILL `load-workflow`. If not available, call `get_context_instructions`.

<additional>
<hard-gate>

- `docs/web` contains website using jekyll for github pages
- `docs/schemas` contains prompt schemas
- `docs/definitions` contains canonical lists of agents/skills/workflows/etc
- target audience: engineers, leads, architects (main part of documents)
- secondary audience: managers, directors, VPs (second part of documents)
- this is public OSS
- all content is for github.com
- documentation should be useful for AI coding agents
- use Rosetta instead of KB, KnowledgeBase, IMS
- IMS CLI => Rosetta CLI; IMS MCP / KB MCP => Rosetta MCP; RAGFlow => Rosetta Server; Unless you specifically need to show the tech (like architecture or deployment)
On MCP failure: retry once; if it fails again, YOU MUST ASK USER how to proceed — this is critical and unexpected. Common causes: MCP authentication expiration (ask user to re-authenticate) or HTTP 429 (wait a few seconds, then retry).

</additional>
</hard-gate>

<bootstrap/>
</MUST>

<rosetta:bootstrap/>
Loading
Loading