一键导入
joycraft-lockdown
Invoked before a constrained implementation session or by the human directly — generate NEVER rules and deny patterns to prevent agent overreach
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Invoked before a constrained implementation session or by the human directly — generate NEVER rules and deny patterns to prevent agent overreach
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Invoked by gather-context or the human after a knowledge gap surfaces — author one long-form reference doc and wire a pointer into AGENTS.md's Context Map
Invoked by session-end or the human after a fact surfaces — route it to the correct context document (production map, dangerous assumptions, decision log, institutional knowledge, troubleshooting)
Invoked at the design bookend by decompose's decision gate or the human directly — turn open questions into a decision dossier; every decision terminates clarified, backlogged, or discarded
Break a feature brief into atomic specs — small, testable, independently executable units
Design discussion before decomposition — produce a ~200-line design artifact for human review, catching wrong assumptions before they propagate into specs
Invoked by tune, optimize, or session-end to convert eligible boundary prose into machine-checked deny patterns — not a user entry point.
| name | joycraft-lockdown |
| description | Invoked before a constrained implementation session or by the human directly — generate NEVER rules and deny patterns to prevent agent overreach |
The user wants to constrain agent behavior for an implementation session. Your job is to interview them about what should be off-limits, then generate AGENTS.md NEVER rules and Codex configuration deny patterns they can review and apply.
Lockdown is most valuable for:
For simple feature work on a well-tested codebase, lockdown is usually overkill. Mention this context to the user so they can decide.
Before starting the interview, search the codebase for test files or directories (look for tests/, test/, __tests__/, spec/, or files matching *.test.*, *.spec.*).
If no tests are found, tell the user:
Lockdown mode is most useful when you already have tests in place -- it prevents the agent from modifying them while constraining behavior to writing code and running tests. Consider running
/skill:joycraft-new-featurefirst to set up a test-driven workflow, then come back to lock it down.
If the user wants to proceed anyway, continue with the interview.
Ask these three questions, one at a time. Wait for the user's response before proceeding to the next question.
What test files or directories should be off-limits for editing? (e.g.,
tests/,__tests__/,spec/, specific test files)I'll generate NEVER rules to prevent editing these.
If the user isn't sure, suggest the test directories you found in Step 1.
What commands should the agent be allowed to run? Defaults:
- Write and edit source code files
- Run the project's smoke test command
- Run the full test suite
Any other commands to explicitly allow? Or should I restrict to just these?
What commands should be denied? Defaults:
- Package installs (
npm install,pip install,cargo add,go get, etc.)- Network tools (
curl,wget,ping,ssh)- Direct log file reading
Any specific commands to add or remove from this list?
Edge case -- user wants to allow some network access: If the user mentions API tests or specific endpoints that need network access, exclude those from the deny list and note the exception in the output.
Edge case -- user wants to lock down file writes: If the user wants to prevent ALL file writes, warn them:
Denying all file writes would prevent the agent from doing any work. I recommend keeping source code writes allowed and only locking down test files, config files, or other sensitive directories.
Based on the interview responses, generate output in this exact format:
## Lockdown boundaries generated
Review these suggestions and add them to your project:
### AGENTS.md -- add to NEVER section:
- Edit any file in `[user's test directories]`
- Run `[denied package manager commands]`
- Use `[denied network tools]`
- Read log files directly -- interact with logs only through test assertions
- [Any additional NEVER rules based on user responses]
### Codex configuration -- suggested deny patterns:
Add these to your Codex sandbox configuration to restrict command execution:
["[command1]", "[command2]", "[command3]"]
---
Copy these into your project manually, or tell me to apply them now (I'll show you the exact changes for approval first).
Adjust the content based on the actual interview responses:
After generating the boundaries above, also recommend a Codex execution configuration. Include this section in your output:
### Recommended Execution Configuration
Codex runs in a sandboxed environment by default. To maximize safety during lockdown:
| Your situation | Configuration | Why |
|---|---|---|
| Autonomous spec execution | Sandbox with deny patterns above | Only pre-approved commands run |
| Long session with some trust | Default sandbox | Network-disabled sandbox prevents external access |
| Interactive development | Default with manual review | Review outputs before applying |
**For lockdown mode, we recommend the default sandboxed execution** combined with the deny patterns above. Codex's sandbox already disables network access by default -- the deny patterns add file-level and command-level restrictions on top.
If you need network access for specific commands (e.g., API tests), configure explicit network allowances in your Codex setup rather than disabling the sandbox entirely.
If the user asks you to apply the changes:
Never auto-apply. Always show the exact changes and wait for explicit approval.