@deftai/directive-content 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/deft/SKILL.md +6 -0
- package/.agents/skills/deft-directive-article-review/SKILL.md +11 -0
- package/.agents/skills/deft-directive-build/SKILL.md +10 -0
- package/.agents/skills/deft-directive-cost/SKILL.md +12 -0
- package/.agents/skills/deft-directive-debug/SKILL.md +13 -0
- package/.agents/skills/deft-directive-gh-arch/SKILL.md +11 -0
- package/.agents/skills/deft-directive-gh-slice/SKILL.md +10 -0
- package/.agents/skills/deft-directive-glossary/SKILL.md +10 -0
- package/.agents/skills/deft-directive-interview/SKILL.md +9 -0
- package/.agents/skills/deft-directive-pre-pr/SKILL.md +9 -0
- package/.agents/skills/deft-directive-refinement/SKILL.md +10 -0
- package/.agents/skills/deft-directive-release/SKILL.md +12 -0
- package/.agents/skills/deft-directive-review-cycle/SKILL.md +10 -0
- package/.agents/skills/deft-directive-setup/SKILL.md +10 -0
- package/.agents/skills/deft-directive-swarm/SKILL.md +10 -0
- package/.agents/skills/deft-directive-sync/SKILL.md +9 -0
- package/.agents/skills/deft-directive-triage/SKILL.md +9 -0
- package/.agents/skills/deft-directive-write-skill/SKILL.md +9 -0
- package/LICENSE.md +22 -0
- package/QUICK-START.md +167 -0
- package/UPGRADING.md +517 -0
- package/coding/build-output.md +28 -0
- package/coding/coding.md +235 -0
- package/coding/debugging.md +110 -0
- package/coding/holzmann.md +96 -0
- package/coding/hygiene.md +127 -0
- package/coding/security.md +158 -0
- package/coding/testing.md +162 -0
- package/coding/toolchain.md +44 -0
- package/commands.md +300 -0
- package/context/context.md +57 -0
- package/context/deterministic-split.md +67 -0
- package/context/examples.md +26 -0
- package/context/fractal-summaries.md +69 -0
- package/context/long-horizon.md +46 -0
- package/context/spec-deltas.md +177 -0
- package/context/tool-design.md +34 -0
- package/context/working-memory.md +62 -0
- package/contracts/boundary-maps.md +65 -0
- package/contracts/deterministic-questions.md +59 -0
- package/contracts/hierarchy.md +77 -0
- package/conventions/content-manifest.json +399 -0
- package/conventions/machine-generated-banner.md +130 -0
- package/conventions/references.md +120 -0
- package/conventions/rule-ownership.json +382 -0
- package/conventions/task-caching.md +43 -0
- package/conventions/vbrief-filenames.md +70 -0
- package/deployments/README.md +37 -0
- package/deployments/agentuity/README.md +138 -0
- package/deployments/agentuity/via-cli.md +380 -0
- package/deployments/agentuity/via-cloud.md +425 -0
- package/deployments/agentuity/via-github-actions.md +664 -0
- package/deployments/agentuity/via-gravity-network.md +606 -0
- package/deployments/agentuity/via-vpc.md +607 -0
- package/deployments/aws/README.md +38 -0
- package/deployments/aws/via-app-runner.md +612 -0
- package/deployments/aws/via-ecs-fargate.md +561 -0
- package/deployments/aws/via-elastic-beanstalk.md +628 -0
- package/deployments/aws/via-lambda.md +649 -0
- package/deployments/azure/README.md +37 -0
- package/deployments/azure/via-aks.md +390 -0
- package/deployments/azure/via-app-service.md +564 -0
- package/deployments/azure/via-container-apps.md +599 -0
- package/deployments/azure/via-functions.md +552 -0
- package/deployments/cloud-gov/README.md +63 -0
- package/deployments/cloud-gov/agents/compliance-docs.md +154 -0
- package/deployments/cloud-gov/agents.md +39 -0
- package/deployments/cloud-gov/cicd.md +64 -0
- package/deployments/cloud-gov/deployment.md +150 -0
- package/deployments/cloud-gov/logging.md +43 -0
- package/deployments/cloud-gov/manifest.md +121 -0
- package/deployments/cloud-gov/overview.md +58 -0
- package/deployments/cloud-gov/security.md +46 -0
- package/deployments/cloud-gov/services.md +72 -0
- package/deployments/cloud-gov/upstream/README.md +18 -0
- package/deployments/cloudflare/README.md +33 -0
- package/deployments/cloudflare/via-dashboard.md +83 -0
- package/deployments/cloudflare/via-git.md +90 -0
- package/deployments/cloudflare/via-github-actions.md +185 -0
- package/deployments/cloudflare/via-terraform.md +157 -0
- package/deployments/cloudflare/via-wrangler.md +165 -0
- package/deployments/fly-io/README.md +37 -0
- package/deployments/fly-io/via-dockerfile.md +648 -0
- package/deployments/fly-io/via-flyctl.md +653 -0
- package/deployments/fly-io/via-github-actions.md +695 -0
- package/deployments/fly-io/via-multi-region.md +598 -0
- package/deployments/google/README.md +34 -0
- package/deployments/google/via-app-engine.md +42 -0
- package/deployments/google/via-cloud-functions.md +23 -0
- package/deployments/google/via-cloud-run.md +330 -0
- package/deployments/google/via-gke.md +23 -0
- package/deployments/netlify/README.md +99 -0
- package/deployments/netlify/via-cli.md +17 -0
- package/deployments/netlify/via-functions.md +19 -0
- package/deployments/netlify/via-git.md +25 -0
- package/deployments/vercel/README.md +90 -0
- package/deployments/vercel/via-api.md +16 -0
- package/deployments/vercel/via-cli.md +17 -0
- package/deployments/vercel/via-git.md +24 -0
- package/docs/BROWNFIELD.md +179 -0
- package/docs/getting-started.md +137 -0
- package/docs/good-agents-md.md +137 -0
- package/events/README.md +89 -0
- package/events/event-record.schema.json +26 -0
- package/events/registry.json +166 -0
- package/events/registry.schema.json +71 -0
- package/glossary.md +145 -0
- package/incidents/README.md +81 -0
- package/incidents/_template.md +38 -0
- package/interfaces/cli.md +104 -0
- package/interfaces/rest.md +212 -0
- package/interfaces/tui.md +242 -0
- package/interfaces/web.md +123 -0
- package/languages/6502-DASM.md +132 -0
- package/languages/c.md +235 -0
- package/languages/commands.md +23 -0
- package/languages/cpp.md +132 -0
- package/languages/csharp.md +259 -0
- package/languages/dart.md +183 -0
- package/languages/delphi.md +218 -0
- package/languages/elixir.md +208 -0
- package/languages/go.md +78 -0
- package/languages/java.md +278 -0
- package/languages/javascript.md +163 -0
- package/languages/julia.md +175 -0
- package/languages/kotlin.md +193 -0
- package/languages/markdown.md +168 -0
- package/languages/mermaid.md +146 -0
- package/languages/officejs.md +392 -0
- package/languages/python.md +209 -0
- package/languages/r.md +163 -0
- package/languages/rust.md +216 -0
- package/languages/sql.md +216 -0
- package/languages/swift.md +153 -0
- package/languages/typescript.md +132 -0
- package/languages/vba.md +279 -0
- package/languages/vhdl.md +180 -0
- package/languages/visual-basic.md +151 -0
- package/languages/zig.md +196 -0
- package/meta/SOUL.md +27 -0
- package/meta/code-field.md +44 -0
- package/meta/morals.md +40 -0
- package/meta/philosophy.md +39 -0
- package/meta/project.md +49 -0
- package/meta/ralph.md +223 -0
- package/meta/security.md +80 -0
- package/meta/versioning.md +326 -0
- package/package.json +22 -0
- package/packs/lessons/lessons-pack-0.1.json +553 -0
- package/packs/patterns/patterns-pack-0.1.json +57 -0
- package/packs/rules/rules-pack-0.1.json +4767 -0
- package/packs/skills/skills-pack-0.1.json +262 -0
- package/packs/strategies/strategies-pack-0.1.json +167 -0
- package/packs/swarm-spec/swarm-spec-pack-0.1.json +17 -0
- package/patterns/executor-layer-credentials.md +227 -0
- package/patterns/llm-app.md +156 -0
- package/patterns/multi-agent.md +278 -0
- package/patterns/prompt-assembly-layer-ordering.md +154 -0
- package/patterns/role-as-overlay.md +179 -0
- package/platforms/2600.md +137 -0
- package/platforms/unity.md +329 -0
- package/references/composer-skill-porting.md +152 -0
- package/references/cost-models.md +163 -0
- package/references/ip-risk.md +246 -0
- package/references/plain-english-ux.md +275 -0
- package/resilience/context-pruning.md +67 -0
- package/resilience/continue-here.md +62 -0
- package/scm/changelog.md +276 -0
- package/scm/git.md +139 -0
- package/scm/github.md +265 -0
- package/secrets/.gitkeep +0 -0
- package/skills/deft-build/SKILL.md +20 -0
- package/skills/deft-directive-article-review/SKILL.md +156 -0
- package/skills/deft-directive-build/SKILL.md +302 -0
- package/skills/deft-directive-cost/SKILL.md +201 -0
- package/skills/deft-directive-debug/SKILL.md +140 -0
- package/skills/deft-directive-decompose/SKILL.md +96 -0
- package/skills/deft-directive-gh-arch/SKILL.md +160 -0
- package/skills/deft-directive-gh-slice/SKILL.md +199 -0
- package/skills/deft-directive-glossary/SKILL.md +118 -0
- package/skills/deft-directive-interview/SKILL.md +528 -0
- package/skills/deft-directive-pre-pr/SKILL.md +131 -0
- package/skills/deft-directive-probe/SKILL.md +127 -0
- package/skills/deft-directive-refinement/SKILL.md +403 -0
- package/skills/deft-directive-release/SKILL.md +266 -0
- package/skills/deft-directive-review-cycle/SKILL.md +401 -0
- package/skills/deft-directive-setup/SKILL.md +717 -0
- package/skills/deft-directive-swarm/SKILL.md +989 -0
- package/skills/deft-directive-sync/SKILL.md +288 -0
- package/skills/deft-directive-triage/SKILL.md +137 -0
- package/skills/deft-directive-write-skill/SKILL.md +169 -0
- package/skills/deft-interview/SKILL.md +16 -0
- package/skills/deft-pre-pr/SKILL.md +16 -0
- package/skills/deft-review-cycle/SKILL.md +16 -0
- package/skills/deft-roadmap-refresh/SKILL.md +16 -0
- package/skills/deft-setup/SKILL.md +20 -0
- package/skills/deft-swarm/SKILL.md +16 -0
- package/skills/deft-sync/SKILL.md +16 -0
- package/strategies/README.md +83 -0
- package/strategies/artifact-guards.md +85 -0
- package/strategies/bdd.md +115 -0
- package/strategies/brownfield.md +7 -0
- package/strategies/discuss.md +129 -0
- package/strategies/emit-hints.md +69 -0
- package/strategies/enterprise.md +193 -0
- package/strategies/interview.md +551 -0
- package/strategies/map.md +179 -0
- package/strategies/probe.md +151 -0
- package/strategies/rapid.md +155 -0
- package/strategies/research.md +155 -0
- package/strategies/roadmap.md +9 -0
- package/strategies/speckit.md +437 -0
- package/strategies/v0-20-contract.md +134 -0
- package/strategies/yolo.md +169 -0
- package/swarm/swarm.md +300 -0
- package/templates/COST-ESTIMATE.md +114 -0
- package/templates/PULL_REQUEST_TEMPLATE.md +35 -0
- package/templates/agent-prompt-preamble.md +409 -0
- package/templates/agents-entry.md +211 -0
- package/templates/agents-entry.placeholders.md +75 -0
- package/templates/embed.go +20 -0
- package/templates/embed_test.go +36 -0
- package/templates/make-spec-example.md +9 -0
- package/templates/make-spec.md +246 -0
- package/templates/project.md.template +52 -0
- package/templates/specification.md +1 -0
- package/templates/swarm-greptile-poller-prompt.md +556 -0
- package/templates/user.md.template +31 -0
- package/tools/RWLDL.md +80 -0
- package/tools/greptile.md +141 -0
- package/tools/installer.md +23 -0
- package/tools/taskfile-migration.md +32 -0
- package/tools/taskfile.md +185 -0
- package/tools/telemetry.md +285 -0
- package/vbrief/schemas/cache-meta.schema.json +137 -0
- package/vbrief/schemas/candidates.schema.json +130 -0
- package/vbrief/schemas/codebase-map.schema.json +213 -0
- package/vbrief/schemas/lessons-pack.schema.json +134 -0
- package/vbrief/schemas/patterns-pack.schema.json +84 -0
- package/vbrief/schemas/rules-pack.schema.json +105 -0
- package/vbrief/schemas/skills-pack.schema.json +94 -0
- package/vbrief/schemas/slices.schema.json +87 -0
- package/vbrief/schemas/strategies-pack.schema.json +89 -0
- package/vbrief/schemas/swarm-spec-pack.schema.json +84 -0
- package/vbrief/schemas/vbrief-core.schema.json +1022 -0
- package/vbrief/vbrief.md +684 -0
- package/verification/integration.md +76 -0
- package/verification/plan-checking.md +85 -0
- package/verification/uat.md +60 -0
- package/verification/verification.md +117 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Atari 2600 (VCS) Standards
|
|
2
|
+
|
|
3
|
+
Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
4
|
+
|
|
5
|
+
**⚠️ See also**: [main.md](../../main.md) | [PROJECT.md](../../PROJECT.md)
|
|
6
|
+
|
|
7
|
+
## Hardware Reference
|
|
8
|
+
|
|
9
|
+
- **CPU**: MOS 6507 (6502 variant), ~1.19 MHz (NTSC), ~1.18 MHz (PAL)
|
|
10
|
+
- **RAM**: 128 bytes ($80–$FF) via RIOT (6532)
|
|
11
|
+
- **ROM**: 4 KB standard cartridge (2 KB–32 KB+ via bankswitching)
|
|
12
|
+
- **Video**: TIA (Television Interface Adapter) — no framebuffer
|
|
13
|
+
- **TIA clock**: 3× CPU clock (228 color clocks/scanline, 76 CPU cycles/scanline)
|
|
14
|
+
- **Display**: 160×192 visible pixels (NTSC), 160×242 (PAL)
|
|
15
|
+
- **Sprites**: 2 players (8 px), 2 missiles (1 px), 1 ball (1 px)
|
|
16
|
+
- **Playfield**: 20 bits wide, mirrored or copied to fill 40 bits (160 px)
|
|
17
|
+
- **Audio**: 2 channels, 4-bit volume, 4-bit frequency, 4-bit waveform
|
|
18
|
+
|
|
19
|
+
## Toolchain
|
|
20
|
+
|
|
21
|
+
### Assembler
|
|
22
|
+
- ! Use [DASM](https://dasm-assembler.github.io/) macro assembler
|
|
23
|
+
- ! Include `vcs.h` and `macro.h` in all source files
|
|
24
|
+
- ! Assemble with `-f3` (raw binary, no header)
|
|
25
|
+
- ? Use VS Code with the `dasm-macro-assembler` extension
|
|
26
|
+
|
|
27
|
+
### Emulator
|
|
28
|
+
- ! Use [Stella](https://stella-emu.github.io/) as the primary development emulator
|
|
29
|
+
- ! Enable Stella's developer settings (jitter/roll simulation) during testing
|
|
30
|
+
- ~ Use Stella's built-in debugger for cycle counting and scanline verification
|
|
31
|
+
|
|
32
|
+
### Alternative Languages
|
|
33
|
+
- ? Use [batari Basic](https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html) for rapid prototyping
|
|
34
|
+
- ? Use DPC+ / CDFJ coprocessor via Harmony/UnoCart for advanced projects
|
|
35
|
+
|
|
36
|
+
## Standards
|
|
37
|
+
|
|
38
|
+
### Initialization
|
|
39
|
+
- ! Clear all RAM and TIA registers at startup (use `CLEAN_START` macro from `macro.h`)
|
|
40
|
+
- ! Set the stack pointer explicitly (`LDX #$FF; TXS`)
|
|
41
|
+
- ⊗ Assume any known state of RAM, TIA, or CPU registers at power-on
|
|
42
|
+
|
|
43
|
+
### Frame Structure (NTSC)
|
|
44
|
+
- ! Produce exactly 262 scanlines per frame (3 VSYNC + 37 VBLANK + 192 visible + 30 overscan)
|
|
45
|
+
- ! Begin each frame with 3 scanlines of VSYNC (`STA VSYNC` with bit 1 set)
|
|
46
|
+
- ! Maintain a consistent scanline count across all code paths in every frame
|
|
47
|
+
- ≉ Deviate from 262 lines — variable counts cause visible rolling/jitter on real hardware
|
|
48
|
+
|
|
49
|
+
### Frame Structure (PAL)
|
|
50
|
+
- ! Produce exactly 312 scanlines per frame (3 VSYNC + 45 VBLANK + 242 visible + 22 overscan)
|
|
51
|
+
- ! Always produce an **even** number of total scanlines (odd counts lose color on PAL TVs)
|
|
52
|
+
- ~ Provide separate NTSC and PAL builds with appropriate color palettes
|
|
53
|
+
|
|
54
|
+
### TV Compatibility
|
|
55
|
+
- ! Target 262 scanlines (NTSC) or 312 scanlines (PAL) exactly
|
|
56
|
+
- ~ Keep visible content within the safe area (avoid first/last ~8 scanlines of the picture region)
|
|
57
|
+
- ~ Test with Stella's jitter simulation enabled to catch timing issues before hardware testing
|
|
58
|
+
- ~ Test on real hardware (CRT television) before release
|
|
59
|
+
|
|
60
|
+
### Kernel (Display Loop)
|
|
61
|
+
- ! Account for exactly 76 CPU cycles per scanline in all kernel code
|
|
62
|
+
- ! Use `STA WSYNC` to synchronize to scanline boundaries
|
|
63
|
+
- ! Document cycle counts inline for every instruction in tight kernel sections
|
|
64
|
+
- ~ Use the Y register as the scanline counter (required for indirect indexed addressing `LDA (zp),Y`)
|
|
65
|
+
- ~ Store sprite data bottom-up in ROM for natural kernel scanning order
|
|
66
|
+
- ≉ Perform game logic during the visible kernel — use VBLANK and overscan periods instead
|
|
67
|
+
- ⊗ Exceed 76 cycles between WSYNC strobes without accounting for the extra scanline(s)
|
|
68
|
+
|
|
69
|
+
### Cycle Counting
|
|
70
|
+
- ! Count and annotate CPU cycles in all time-critical code (kernel, positioning routines)
|
|
71
|
+
- ! Account for the extra cycle on page-boundary crossings with `(Indirect),Y` addressing
|
|
72
|
+
- ~ Align data tables to avoid page-boundary penalties in kernel loops
|
|
73
|
+
- ~ Use constant-cycle-count code paths (pad shorter branches with NOPs or `SLEEP` macro)
|
|
74
|
+
|
|
75
|
+
### Horizontal Positioning
|
|
76
|
+
- ! Issue `STA HMOVE` immediately after `STA WSYNC` (within HBLANK)
|
|
77
|
+
- ! Wait at least 24 CPU cycles after HMOVE before modifying any motion registers (HMPx/HMMx/HMBL)
|
|
78
|
+
- ! Clear motion registers with `STA HMCLR` before setting new values
|
|
79
|
+
- ~ Use the divide-by-15 loop technique for coarse positioning with HMOVE fine adjustment
|
|
80
|
+
- ? Use `STA RESP0,X` timing loop for multi-object positioning
|
|
81
|
+
|
|
82
|
+
### Vertical Positioning
|
|
83
|
+
- ~ Use the "skipdraw" technique: compare scanline counter to sprite Y position in kernel
|
|
84
|
+
- ~ Pre-calculate sprite pointers during VBLANK to minimize kernel overhead
|
|
85
|
+
|
|
86
|
+
### Memory Management
|
|
87
|
+
- ! Treat all 128 bytes of RAM as precious — plan allocation carefully
|
|
88
|
+
- ~ Use zero-page addressing ($80–$FF) for all variables (saves 1 byte and 1 cycle vs. absolute)
|
|
89
|
+
- ~ Reuse RAM locations across non-overlapping game states
|
|
90
|
+
- ⊗ Use the stack for deep call chains — the stack shares the 128-byte RAM space
|
|
91
|
+
|
|
92
|
+
### ROM Management
|
|
93
|
+
- ! Place reset vector at $FFFC–$FFFD and interrupt vector at $FFFE–$FFFF
|
|
94
|
+
- ! For ROMs > 4 KB, use well-known bankswitching schemes (F8, F6, F4, etc.)
|
|
95
|
+
- ~ Keep the most time-critical code (kernel) in a single bank to avoid mid-scanline bank switches
|
|
96
|
+
- ~ Place lookup tables in the same bank as the code that references them
|
|
97
|
+
- ? Use Superchip (128 bytes extra RAM) for games needing more working memory
|
|
98
|
+
|
|
99
|
+
### Code Quality
|
|
100
|
+
- ! Comment all TIA register writes with the purpose and expected timing
|
|
101
|
+
- ~ Label all major sections: VSYNC, VBLANK, Kernel, Overscan
|
|
102
|
+
- ~ Use DASM macros and `REPEAT`/`REPEND` to reduce repetitive code
|
|
103
|
+
- ~ Use meaningful labels and constants from `vcs.h` (never write to magic addresses directly)
|
|
104
|
+
- ≉ Use undocumented 6502 opcodes unless targeting specific hardware and documenting the risk
|
|
105
|
+
|
|
106
|
+
### Sound
|
|
107
|
+
- ! Turn off sound by setting `AUDV0`/`AUDV1` to 0 (not `AUDC0`/`AUDC1` — the latter causes artifacts on SECAM)
|
|
108
|
+
- ~ Update audio registers during VBLANK or overscan, not mid-kernel
|
|
109
|
+
- ? Use a music sequencer driver for multi-voice music
|
|
110
|
+
|
|
111
|
+
### Testing & Debugging
|
|
112
|
+
- ! Verify scanline count in Stella (Developer → Video → Frame Stats overlay)
|
|
113
|
+
- ! Test both player difficulty switch positions (A/B)
|
|
114
|
+
- ! Test color/BW switch behavior
|
|
115
|
+
- ~ Test with Stella's phosphor mode for games using sprite flicker
|
|
116
|
+
- ~ Test on real hardware with Harmony/UnoCart cartridge before physical release
|
|
117
|
+
- ~ Disassemble and study classic games for proven techniques (use DiStella)
|
|
118
|
+
- ? Test on multiple TIA revisions if targeting broad hardware compatibility
|
|
119
|
+
|
|
120
|
+
### Anti-Patterns
|
|
121
|
+
- ⊗ Write to TIA registers at unpredictable or variable cycle positions within a scanline
|
|
122
|
+
- ⊗ Assume the electron beam position without explicit WSYNC synchronization
|
|
123
|
+
- ⊗ Ignore HMOVE timing constraints (causes visual corruption / "HMOVE bars")
|
|
124
|
+
- ⊗ Use absolute addressing for variables in the $80–$FF range (wastes ROM and cycles)
|
|
125
|
+
- ⊗ Produce ROMs with sizes that don't match standard cartridge formats (2K, 4K, 8K, 16K, 32K)
|
|
126
|
+
- ⊗ Hard-code color values without considering NTSC/PAL/SECAM palette differences
|
|
127
|
+
|
|
128
|
+
## Resources
|
|
129
|
+
|
|
130
|
+
- [Stella Programmer's Guide](https://alienbill.com/2600/101/docs/stella.html) — official TIA/RIOT register reference
|
|
131
|
+
- [6502.org](http://www.6502.org/) — 6502 instruction set, addressing modes, and tools
|
|
132
|
+
- [AtariAge 2600 Programming Forum](https://forums.atariage.com/forum/50-atari-2600-programming/) — community support
|
|
133
|
+
- [Nick Bensema's Guide to Cycle Counting](https://www.randomterrain.com/atari-2600-memories-guide-to-cycle-counting.html)
|
|
134
|
+
- [Andrew Davie's 2600 Programming for Newbies](https://www.randomterrain.com/atari-2600-memories-tutorial-andrew-davie-01.html)
|
|
135
|
+
- [2600 Advanced Programming Guide](https://www.qotile.net/minidig/docs/2600_advanced_prog_guide.txt) — bankswitching, skipdraw, HMOVE tricks
|
|
136
|
+
- [TIA Color Charts](https://www.randomterrain.com/atari-2600-memories-tia-color-charts.html) — NTSC/PAL/SECAM palettes
|
|
137
|
+
- [Cart Sizes and Bankswitching Methods](https://www.randomterrain.com/atari-2600-memories-tutorial-andrew-davie-25.html) — Kevin Horton's reference
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
# Unity Standards
|
|
2
|
+
|
|
3
|
+
Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
4
|
+
|
|
5
|
+
**⚠️ See also**: [main.md](../../main.md) | [PROJECT.md](../../PROJECT.md) | [csharp.md](../languages/csharp.md)
|
|
6
|
+
|
|
7
|
+
**Stack**: Unity 6+, C# (see [csharp.md](../languages/csharp.md) for general C# rules); Rendering: URP (default) or HDRP; Testing: Unity Test Framework (NUnit); Asset Management: Addressables
|
|
8
|
+
|
|
9
|
+
**Note**: Rules in [csharp.md](../languages/csharp.md) apply to all Unity C# code. This file covers Unity-specific overrides and additions.
|
|
10
|
+
|
|
11
|
+
## Standards
|
|
12
|
+
|
|
13
|
+
### Project Structure
|
|
14
|
+
|
|
15
|
+
- ! Use Assembly Definition files (`.asmdef`) for all script folders — separate Runtime, Editor, and Tests
|
|
16
|
+
- ! Organize by feature or domain (`Player/`, `UI/`, `Audio/`, `Networking/`), not by type (`Scripts/`, `Prefabs/`)
|
|
17
|
+
- ! Place all project assets under a top-level folder named after the project (e.g., `Assets/MyGame/`)
|
|
18
|
+
- ! Match namespaces to folder structure
|
|
19
|
+
- ! One public class per file; filename matches the class name
|
|
20
|
+
- ~ Use a consistent asset naming convention: `Prefix_BaseAssetName_Variant_Suffix`
|
|
21
|
+
- ~ Keep a `_Shared/` or `Common/` folder for cross-feature assets
|
|
22
|
+
- ⊗ Leave loose assets in `Assets/` root
|
|
23
|
+
|
|
24
|
+
### Naming Conventions (Unity-Specific)
|
|
25
|
+
|
|
26
|
+
- ! `PascalCase` for MonoBehaviours, ScriptableObjects, classes, methods, properties, events
|
|
27
|
+
- ! `camelCase` for parameters and local variables
|
|
28
|
+
- ! `_camelCase` for private/protected fields
|
|
29
|
+
- ! `[SerializeField] private` fields instead of `public` for Inspector-exposed values
|
|
30
|
+
- ! Use `[Header("Section")]` and `[Tooltip("Description")]` to document Inspector fields
|
|
31
|
+
- ~ Suffix scripts by role: `*Controller`, `*Manager`, `*System`, `*Data`, `*Settings`, `*Editor`
|
|
32
|
+
- ~ Use `I` prefix for interfaces: `IDamageable`, `IInteractable`
|
|
33
|
+
- ⊗ Hungarian notation or type prefixes (`strName`, `intCount`, `goPlayer`)
|
|
34
|
+
|
|
35
|
+
### MonoBehaviour Guidelines
|
|
36
|
+
|
|
37
|
+
- ! Keep MonoBehaviours thin — glue between data/systems and visuals only
|
|
38
|
+
- ! Cache component references in `Awake()` or `OnEnable()`; ⊗ call `GetComponent<T>()` in `Update()`
|
|
39
|
+
- ! Remove empty Unity lifecycle methods (`Update()`, `Start()`, etc.) — they have overhead even when empty
|
|
40
|
+
- ! Order members: Fields → Properties → Events → Unity Lifecycle → Public Methods → Private Methods
|
|
41
|
+
- ~ Use `[RequireComponent(typeof(T))]` to enforce dependencies
|
|
42
|
+
- ~ Use `[DisallowMultipleComponent]` where only one instance makes sense
|
|
43
|
+
- ≉ Use `Awake()` for cross-object dependencies; use `Start()` or lazy init instead
|
|
44
|
+
- ⊗ Use `SendMessage()`, `BroadcastMessage()`, or `Invoke()` with string method names
|
|
45
|
+
|
|
46
|
+
### ScriptableObjects
|
|
47
|
+
|
|
48
|
+
- ! Use ScriptableObjects for shared configuration, game data, and design-tunable parameters
|
|
49
|
+
- ! Use `[CreateAssetMenu]` attribute for designer-facing ScriptableObjects
|
|
50
|
+
- ~ Use ScriptableObject-based events for decoupled inter-system communication (observer pattern)
|
|
51
|
+
- ~ Use ScriptableObject variables (e.g., `FloatVariable`, `IntVariable`) for shared runtime state
|
|
52
|
+
- ~ Copy runtime values from ScriptableObject data to avoid persisting play-mode changes to disk
|
|
53
|
+
- ~ Favor ScriptableObjects over singletons for global state and cross-scene data
|
|
54
|
+
- ≉ Store mutable per-instance state in ScriptableObjects (they are shared assets)
|
|
55
|
+
|
|
56
|
+
### Architecture & Patterns
|
|
57
|
+
|
|
58
|
+
- ! Favor composition over inheritance for game behaviors
|
|
59
|
+
- ! Apply SOLID principles; keep classes single-responsibility
|
|
60
|
+
- ! Use event-driven communication (C# events, ScriptableObject events, or `UnityEvent`) over direct references
|
|
61
|
+
- ~ Use dependency injection (VContainer or similar) for testable architecture
|
|
62
|
+
- ~ Use interfaces to define contracts between systems
|
|
63
|
+
- ~ Hybrid approach: GameObjects for scene logic + Jobs/Burst for compute-heavy paths
|
|
64
|
+
- ≉ Deep MonoBehaviour inheritance hierarchies (prefer composition)
|
|
65
|
+
- ≉ Global singletons as primary architecture — use ScriptableObjects or DI instead
|
|
66
|
+
- ? Use ECS/DOTS for entity-heavy systems (physics, AI, large simulations)
|
|
67
|
+
|
|
68
|
+
### Performance & Memory
|
|
69
|
+
|
|
70
|
+
- ! Profile first — use Unity Profiler and Project Auditor before optimizing
|
|
71
|
+
- ! Eliminate per-frame heap allocations in hot paths (Update, FixedUpdate, coroutines)
|
|
72
|
+
- ! Use object pooling (`UnityEngine.Pool.ObjectPool<T>`) for frequently spawned/despawned objects
|
|
73
|
+
- ! Cache all expensive lookups: `GetComponent<T>()`, `Camera.main`, `Transform` references
|
|
74
|
+
- ! Cache `WaitForSeconds` and other yield instructions in coroutines
|
|
75
|
+
- ! Use non-allocating Physics APIs: `Physics.RaycastNonAlloc()`, `Physics.OverlapSphereNonAlloc()`
|
|
76
|
+
- ~ Reuse collections (`List<T>`, `StringBuilder`, arrays) instead of allocating new ones
|
|
77
|
+
- ~ Use `Span<T>` and `ReadOnlySpan<T>` for zero-allocation slicing
|
|
78
|
+
- ~ Prefer structs for small data-only types on hot paths
|
|
79
|
+
- ~ Use Jobs + Burst Compiler for heavy math, physics, AI, and procedural generation
|
|
80
|
+
- ~ Use `Awaitable` (Unity 6+, pooled, player-loop aware) over raw `Task` for async
|
|
81
|
+
- ≉ Use LINQ, reflection, or string concatenation in hot paths
|
|
82
|
+
- ⊗ Call `GameObject.Find()`, `FindObjectOfType()`, or `FindObjectsOfType()` at runtime in hot paths
|
|
83
|
+
- ⊗ Use `Resources.Load()` at runtime — use Addressables instead
|
|
84
|
+
|
|
85
|
+
### Asset Management
|
|
86
|
+
|
|
87
|
+
- ! Use Addressables for all runtime asset loading in production projects
|
|
88
|
+
- ! Set up asset groups with sensible packing strategies (by label, scene, feature)
|
|
89
|
+
- ! Release loaded Addressables when no longer needed to free memory
|
|
90
|
+
- ~ Pre-warm object pools during loading screens or scene initialization
|
|
91
|
+
- ~ Use texture compression appropriate to target platform (ASTC for mobile, BC7 for desktop)
|
|
92
|
+
- ~ Enable mipmaps for 3D textures; disable for UI/2D sprites
|
|
93
|
+
- ~ Use Sprite Atlases for 2D/UI to reduce draw calls
|
|
94
|
+
- ≉ Use `Resources/` folder for production assets (non-strippable, increases build size)
|
|
95
|
+
|
|
96
|
+
### Rendering
|
|
97
|
+
|
|
98
|
+
- ! Choose render pipeline at project start: URP (default/mobile) or HDRP (high-fidelity)
|
|
99
|
+
- ! Use SRP Batcher–compatible shaders for draw call optimization
|
|
100
|
+
- ! Implement LOD (Level of Detail) for 3D assets
|
|
101
|
+
- ! Use occlusion culling for complex 3D scenes
|
|
102
|
+
- ~ Enable GPU Instancing for repeated meshes (foliage, debris, crowds)
|
|
103
|
+
- ~ Use static batching for non-moving geometry
|
|
104
|
+
- ~ Use Shader Graph for custom shaders; avoid hand-written shaders unless performance demands it
|
|
105
|
+
- ~ Set per-platform quality levels and resolution scaling
|
|
106
|
+
- ? Use UI Toolkit for new UI work; uGUI for legacy or simple use cases
|
|
107
|
+
|
|
108
|
+
### Unity-Specific C# Gotchas
|
|
109
|
+
|
|
110
|
+
- ! Use `if (myUnityObject == null)` — Unity overrides `==` on `UnityEngine.Object` (fake null)
|
|
111
|
+
- ! Use `Object.Destroy()` at runtime; `DestroyImmediate()` is Editor-only
|
|
112
|
+
- ! All Unity API calls must execute on the main thread
|
|
113
|
+
- ! Guard Editor-only code with `#if UNITY_EDITOR` and separate Assembly Definitions
|
|
114
|
+
- ! Use `CompareTag("Tag")` instead of `gameObject.tag == "Tag"` (avoids allocation)
|
|
115
|
+
- ⊗ Use `ReferenceEquals(obj, null)` or `is null` on UnityEngine.Object types
|
|
116
|
+
- ⊗ Use C# finalizers (`~ClassName()`) in runtime code
|
|
117
|
+
- ⊗ Use `async void` — use `async Awaitable` (Unity 6+) or coroutines
|
|
118
|
+
|
|
119
|
+
### Testing
|
|
120
|
+
|
|
121
|
+
See [testing.md](../coding/testing.md) for universal testing requirements.
|
|
122
|
+
|
|
123
|
+
- ! Use Unity Test Framework (NUnit-based) for all automated tests
|
|
124
|
+
- ! Separate Edit Mode and Play Mode tests into distinct assemblies (`.asmdef`)
|
|
125
|
+
- ! Use `[Test]` for synchronous logic; `[UnityTest]` only when yielding frames or time
|
|
126
|
+
- ! Test assemblies must reference production assemblies via Assembly Definitions
|
|
127
|
+
- ~ Write Edit Mode tests for pure logic, ScriptableObject behavior, and Editor extensions
|
|
128
|
+
- ~ Write Play Mode tests for runtime behaviors, physics, coroutines, and integration
|
|
129
|
+
- ~ Use `LogAssert.Expect()` before log-emitting code under test
|
|
130
|
+
- ~ Run tests in CI via batch mode: `-batchmode -runTests -testPlatform EditMode`
|
|
131
|
+
- ~ Install Code Coverage package (`com.unity.testtools.codecoverage`) for coverage reports
|
|
132
|
+
- ? Run Play Mode tests on target platform builds for platform-specific validation
|
|
133
|
+
|
|
134
|
+
### Coverage
|
|
135
|
+
|
|
136
|
+
- ! ≥75% coverage for runtime logic assemblies
|
|
137
|
+
- ! Exclude Editor scripts, generated code, and third-party plugins from coverage
|
|
138
|
+
- ~ Prioritize coverage on gameplay systems, state machines, and data processing
|
|
139
|
+
|
|
140
|
+
### Editor Workflow
|
|
141
|
+
|
|
142
|
+
- ! Enable "Enter Play Mode Options" (disable Domain Reload) for fast iteration
|
|
143
|
+
- ! Manually reset all static fields when Domain Reload is disabled
|
|
144
|
+
- ~ Use Roslyn analyzers and `.editorconfig` for code style enforcement
|
|
145
|
+
- ~ Use custom Editor tools and PropertyDrawers to improve designer workflows
|
|
146
|
+
- ~ Use `[ContextMenu("...")]` for quick debug actions on components
|
|
147
|
+
- ? Use Presets for standardizing import settings across asset types
|
|
148
|
+
|
|
149
|
+
### Source Control
|
|
150
|
+
|
|
151
|
+
- ! Use a Unity-appropriate `.gitignore` (exclude `Library/`, `Temp/`, `Logs/`, `obj/`)
|
|
152
|
+
- ! Set Asset Serialization to "Force Text" (Project Settings → Editor)
|
|
153
|
+
- ! Enable Visible Meta Files (Project Settings → Editor → Version Control Mode)
|
|
154
|
+
- ! Use `.gitattributes` to mark binary assets (textures, audio, models) with Git LFS
|
|
155
|
+
- ~ Use Smart Merge (UnityYAMLMerge) for scene and prefab conflict resolution
|
|
156
|
+
- ~ Commit `.meta` files alongside their assets — never delete one without the other
|
|
157
|
+
|
|
158
|
+
### Native Plugins (C++/Rust)
|
|
159
|
+
|
|
160
|
+
- ~ Only reach for native plugins when Jobs + Burst is insufficient
|
|
161
|
+
- ! Expose a C-style interface (`extern "C"`) to avoid name mangling
|
|
162
|
+
- ! Use `[DllImport("PluginName")]` in C# (`"__Internal"` for iOS)
|
|
163
|
+
- ! Minimize P/Invoke boundary crossings — batch work inside the native library
|
|
164
|
+
- ! Place platform-specific binaries in correct `Plugins/` subfolders
|
|
165
|
+
- ? Prefer Rust over C++ for new native plugins (memory safety, fewer crashes)
|
|
166
|
+
|
|
167
|
+
### Safety
|
|
168
|
+
|
|
169
|
+
- ⊗ Hardcode secrets, API keys, or credentials in source or ScriptableObjects
|
|
170
|
+
- ! Validate all external input (network data, user input, file I/O)
|
|
171
|
+
- ~ Scan third-party packages for vulnerabilities before importing
|
|
172
|
+
- ~ Use signed packages (Unity 6.3+) and verify trust indicators in Package Manager
|
|
173
|
+
|
|
174
|
+
## Anti-Patterns
|
|
175
|
+
|
|
176
|
+
Items marked ⊗ in Standards above are not repeated here.
|
|
177
|
+
|
|
178
|
+
- ≉ **God MonoBehaviours**: Split large scripts (>300 lines) into focused components
|
|
179
|
+
- ≉ **Deep inheritance**: Favor composition and interfaces over class hierarchies
|
|
180
|
+
- ≉ **String-based identification**: Use enums, ScriptableObject references, or tags — not magic strings
|
|
181
|
+
- ≉ **Scene-dependent singletons**: Use ScriptableObjects or DI for cross-scene state
|
|
182
|
+
- ≉ **Resources folder**: Use Addressables for runtime loading
|
|
183
|
+
- ≉ **Coroutines for everything**: Use `async/Awaitable` (Unity 6+) for non-frame-dependent async
|
|
184
|
+
- ≉ **Manual `new` for poolable objects**: Use `ObjectPool<T>` or Addressables pooling
|
|
185
|
+
|
|
186
|
+
## Patterns
|
|
187
|
+
|
|
188
|
+
### ScriptableObject Variable
|
|
189
|
+
|
|
190
|
+
```csharp
|
|
191
|
+
[CreateAssetMenu(menuName = "Variables/Float")]
|
|
192
|
+
public class FloatVariable : ScriptableObject
|
|
193
|
+
{
|
|
194
|
+
[SerializeField] private float _initialValue;
|
|
195
|
+
|
|
196
|
+
[System.NonSerialized] public float RuntimeValue;
|
|
197
|
+
|
|
198
|
+
private void OnEnable() => RuntimeValue = _initialValue;
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### ScriptableObject Event
|
|
203
|
+
|
|
204
|
+
```csharp
|
|
205
|
+
[CreateAssetMenu(menuName = "Events/Game Event")]
|
|
206
|
+
public class GameEvent : ScriptableObject
|
|
207
|
+
{
|
|
208
|
+
private readonly List<GameEventListener> _listeners = new();
|
|
209
|
+
|
|
210
|
+
public void Raise()
|
|
211
|
+
{
|
|
212
|
+
for (int i = _listeners.Count - 1; i >= 0; i--)
|
|
213
|
+
_listeners[i].OnEventRaised();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
public void Register(GameEventListener listener) => _listeners.Add(listener);
|
|
217
|
+
public void Unregister(GameEventListener listener) => _listeners.Remove(listener);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
public class GameEventListener : MonoBehaviour
|
|
221
|
+
{
|
|
222
|
+
[SerializeField] private GameEvent _event;
|
|
223
|
+
[SerializeField] private UnityEvent _response;
|
|
224
|
+
|
|
225
|
+
private void OnEnable() => _event.Register(this);
|
|
226
|
+
private void OnDisable() => _event.Unregister(this);
|
|
227
|
+
public void OnEventRaised() => _response.Invoke();
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Object Pooling (Unity 2021+)
|
|
232
|
+
|
|
233
|
+
```csharp
|
|
234
|
+
public class ProjectilePool : MonoBehaviour
|
|
235
|
+
{
|
|
236
|
+
[SerializeField] private Projectile _prefab;
|
|
237
|
+
private ObjectPool<Projectile> _pool;
|
|
238
|
+
|
|
239
|
+
private void Awake()
|
|
240
|
+
{
|
|
241
|
+
_pool = new ObjectPool<Projectile>(
|
|
242
|
+
createFunc: () => Instantiate(_prefab),
|
|
243
|
+
actionOnGet: p => p.gameObject.SetActive(true),
|
|
244
|
+
actionOnRelease: p => p.gameObject.SetActive(false),
|
|
245
|
+
actionOnDestroy: p => Destroy(p.gameObject),
|
|
246
|
+
defaultCapacity: 20,
|
|
247
|
+
maxSize: 100
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
public Projectile Get() => _pool.Get();
|
|
252
|
+
public void Release(Projectile p) => _pool.Release(p);
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Cached Component References
|
|
257
|
+
|
|
258
|
+
```csharp
|
|
259
|
+
[RequireComponent(typeof(Rigidbody))]
|
|
260
|
+
public class PlayerMovement : MonoBehaviour
|
|
261
|
+
{
|
|
262
|
+
private Rigidbody _rb;
|
|
263
|
+
private Transform _transform;
|
|
264
|
+
|
|
265
|
+
private void Awake()
|
|
266
|
+
{
|
|
267
|
+
_rb = GetComponent<Rigidbody>();
|
|
268
|
+
_transform = transform; // Cache the property accessor
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
private void FixedUpdate()
|
|
272
|
+
{
|
|
273
|
+
// Use cached references — never GetComponent in Update/FixedUpdate
|
|
274
|
+
_rb.AddForce(_transform.forward * 10f);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Play Mode Test
|
|
280
|
+
|
|
281
|
+
```csharp
|
|
282
|
+
[UnityTest]
|
|
283
|
+
public IEnumerator Rigidbody_WithGravity_FallsOverTime()
|
|
284
|
+
{
|
|
285
|
+
var go = new GameObject("TestObj");
|
|
286
|
+
go.AddComponent<Rigidbody>();
|
|
287
|
+
var startY = go.transform.position.y;
|
|
288
|
+
|
|
289
|
+
yield return new WaitForSeconds(1f);
|
|
290
|
+
|
|
291
|
+
Assert.Less(go.transform.position.y, startY);
|
|
292
|
+
Object.Destroy(go);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
[Test]
|
|
296
|
+
public void FloatVariable_OnEnable_ResetsToInitialValue()
|
|
297
|
+
{
|
|
298
|
+
var variable = ScriptableObject.CreateInstance<FloatVariable>();
|
|
299
|
+
// Test pure logic without frames — use [Test], not [UnityTest]
|
|
300
|
+
Assert.AreEqual(0f, variable.RuntimeValue);
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Compliance Checklist
|
|
305
|
+
|
|
306
|
+
- ! Assembly Definitions for all script folders (Runtime, Editor, Tests)
|
|
307
|
+
- ! `[SerializeField] private` for Inspector fields; no public fields for serialization
|
|
308
|
+
- ! ScriptableObjects for shared data, configuration, and events
|
|
309
|
+
- ! Object pooling for frequently spawned objects
|
|
310
|
+
- ! Addressables for runtime asset loading (not `Resources/`)
|
|
311
|
+
- ! Unity Test Framework with separate Edit Mode and Play Mode assemblies
|
|
312
|
+
- ! Profile with Unity Profiler before and after optimization
|
|
313
|
+
- ! Zero per-frame heap allocations in hot paths
|
|
314
|
+
- ! Force Text serialization + Visible Meta Files for version control
|
|
315
|
+
- ! See [csharp.md](../languages/csharp.md) for general C# compliance
|
|
316
|
+
- ⊗ `GetComponent` in `Update`, `GameObject.Find` at runtime, empty lifecycle methods
|
|
317
|
+
- ! Run `task check` before commit
|
|
318
|
+
|
|
319
|
+
## Resources
|
|
320
|
+
|
|
321
|
+
- [Unity Programming Best Practices Manual](https://docs.unity3d.com/6000.3/Documentation/Manual/best-practice-guides.html)
|
|
322
|
+
- [C# Code Style Guide for Unity 6](https://unity.com/resources/c-sharp-style-guide-unity-6) (2nd ed., 2025)
|
|
323
|
+
- [Create Modular Architecture with ScriptableObjects](https://unity.com/how-to/architect-game-code-scriptable-objects) (e-book + demo)
|
|
324
|
+
- [Level Up Your Code with Game Programming Patterns](https://unity.com/how-to/level-up-your-code-with-game-programming-patterns) (SOLID + design patterns)
|
|
325
|
+
- [Unity Test Framework Documentation](https://docs.unity3d.com/Packages/com.unity.test-framework@2.0/manual/index.html)
|
|
326
|
+
- [Unity Performance Optimization (PC/Console)](https://docs.unity3d.com/6000.3/Documentation/Manual/best-practice-guides.html)
|
|
327
|
+
- [Unity Performance Optimization (Mobile/XR/Web)](https://docs.unity3d.com/6000.3/Documentation/Manual/best-practice-guides.html)
|
|
328
|
+
- [Addressables Documentation](https://docs.unity3d.com/Packages/com.unity.addressables@latest)
|
|
329
|
+
- [Unity 6 Roadmap (Unite 2025)](https://www.youtube.com/watch?v=rEKmARCIkSI)
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Composer Skill Porting — Warp to Composer
|
|
2
|
+
|
|
3
|
+
Reference for skill authors porting Warp-tuned playbooks into Composer-friendly
|
|
4
|
+
skills (Grok Build / Cursor-style single-session agents). Issue:
|
|
5
|
+
[#1518](https://github.com/deftai/directive/issues/1518).
|
|
6
|
+
|
|
7
|
+
Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
8
|
+
|
|
9
|
+
**See also**: [skills/deft-directive-write-skill/SKILL.md](../skills/deft-directive-write-skill/SKILL.md) | [scm/github.md](../scm/github.md)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Why This Document Exists
|
|
14
|
+
|
|
15
|
+
Warp skills often assume multi-agent orchestration: worktrees per task, long
|
|
16
|
+
scorecards pasted into chat, and human-readable tables as the source of truth.
|
|
17
|
+
Composer agents load skills via YAML `description` and trigger phrases, respect a
|
|
18
|
+
strict markdown rule stack (USER.md → AGENTS.md → SKILL.md), and default to
|
|
19
|
+
short chat plus file/issue ceremony.
|
|
20
|
+
|
|
21
|
+
Without adaptation, ported skills fight project `AGENTS.md`, spawn unnecessary
|
|
22
|
+
worktrees, or fire the wrong playbook because triggers overlap. This reference
|
|
23
|
+
captures the reusable authoring rules so Warp intent survives the harness change.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Thin SKILL.md + references/ Split
|
|
28
|
+
|
|
29
|
+
! Keep `SKILL.md` under ~150 lines — ordered steps, hard stops, and pointers only.
|
|
30
|
+
|
|
31
|
+
⊗ Put scorecard templates, 40-line tables, triage playbooks, or output schemas
|
|
32
|
+
inside `SKILL.md`. Move them to `references/*.md` and link from the skill.
|
|
33
|
+
|
|
34
|
+
| Content type | Location |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| Triggers, prerequisites, step order | `SKILL.md` |
|
|
37
|
+
| Canonical output schema, FP appendix rules | `references/canonical-output.md` |
|
|
38
|
+
| Warp parity (what Warp still does that Composer skips) | `references/warp-parity.md` |
|
|
39
|
+
| Long triage or pipeline docs | `references/triage-*.md` |
|
|
40
|
+
|
|
41
|
+
~ Ship one Composer skill plus `references/` docs. Maintain Warp alignment in a
|
|
42
|
+
single parity reference instead of duplicating two full `SKILL.md` files.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Negative Triggers in Description
|
|
47
|
+
|
|
48
|
+
The `description` field is the only surface Composer uses to decide whether to
|
|
49
|
+
load a skill. Near-miss phrases cause wrong-playbook misfires.
|
|
50
|
+
|
|
51
|
+
! Include explicit negative triggers in the `description` paragraph:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
description: >
|
|
55
|
+
Runs the recall loop and posts Block A/B to the tracking issue.
|
|
56
|
+
Use when the user says "run recall" or "recall loop".
|
|
57
|
+
Do NOT trigger on "run tests" alone or generic "check CI".
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
! Name Composer variants distinctly (`…-composer`, `/my-workflow-composer`) when
|
|
61
|
+
a Warp skill with a similar name still exists.
|
|
62
|
+
|
|
63
|
+
⊗ Rely on vague positive triggers alone — overlapping phrases (`run tests` vs
|
|
64
|
+
`recall loop`) need a `Do NOT trigger on …` line.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Fast Path vs Isolation
|
|
69
|
+
|
|
70
|
+
Warp playbooks often assume per-task worktrees and merge choreography. Composer
|
|
71
|
+
defaults to a single checkout.
|
|
72
|
+
|
|
73
|
+
! Lead every ported skill with a **Fast path (default)** table near the top:
|
|
74
|
+
|
|
75
|
+
| When | What |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| Default | Work on the main checkout (or single active branch) |
|
|
78
|
+
| Skip worktree steps | Unless merge lock, parallel fixtures, or user requests isolation |
|
|
79
|
+
| Still mandatory before commit | Script gates with exit codes (tests, ship-check, coupling) |
|
|
80
|
+
|
|
81
|
+
? Document full Warp isolation steps in `references/warp-parity.md` — one page,
|
|
82
|
+
gated as optional (`use when lock busy`, `use when user asks for parallel fixtures`).
|
|
83
|
+
|
|
84
|
+
⊗ Force colleagues to read 200 lines before learning the default is no worktree.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Short Chat Expectations
|
|
89
|
+
|
|
90
|
+
Composer projects commonly enforce operator voice in `AGENTS.md`:
|
|
91
|
+
|
|
92
|
+
- Shortest useful answer; lead with the claim.
|
|
93
|
+
- No multi-line code fences in assistant chat (paths in prose are fine).
|
|
94
|
+
- Long structured output belongs in vBRIEF, issues, or reference docs.
|
|
95
|
+
|
|
96
|
+
### Warp habit → Composer adaptation
|
|
97
|
+
|
|
98
|
+
| Warp habit | Composer markdown |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| Paste full scorecard tables in chat | One-line claim + stable metrics in chat |
|
|
101
|
+
| User skims chat and says "go" | Run status script; attach tables to tracking issue |
|
|
102
|
+
| "Show the user the table below" in a step | "Run `<script>`; post output via `--body-file`" |
|
|
103
|
+
|
|
104
|
+
~ Every milestone step should name a script or file target, not a prose table to
|
|
105
|
+
recall from memory.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Windows-Safe GitHub Body Files
|
|
110
|
+
|
|
111
|
+
Skills that create or comment on GitHub issues MUST NOT use inline multi-line
|
|
112
|
+
`--body` strings — they break on PowerShell 5.1 quoting, nested quotes, and
|
|
113
|
+
newlines.
|
|
114
|
+
|
|
115
|
+
! Prefer `--body-file` for any body longer than one line. Write temp files to the
|
|
116
|
+
OS temp directory, not the worktree. See [scm/github.md](../scm/github.md)
|
|
117
|
+
Standing gh CLI Rules.
|
|
118
|
+
|
|
119
|
+
| Unsafe Warp example | Composer-safe pattern |
|
|
120
|
+
| --- | --- |
|
|
121
|
+
| `gh issue create --body "…nested quotes…"` | Write body to temp `.md`; `gh … --body-file $path` |
|
|
122
|
+
| `cmd1 && cmd2` on PowerShell 5.1 | `cmd1; cmd2` or separate invocations |
|
|
123
|
+
| Inline heredocs in shell | Temp file under `$env:TEMP` or `%TEMP%` |
|
|
124
|
+
|
|
125
|
+
! Add one row to the Fast path table when the skill shells out on Windows:
|
|
126
|
+
`Shell: PowerShell 5.1; gh bodies via --body-file`.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Authorization Wording
|
|
131
|
+
|
|
132
|
+
Warp playbooks sometimes infer implement intent from lifecycle words or partial
|
|
133
|
+
`git status`. Composer + Deft intent gates require explicit action verbs.
|
|
134
|
+
|
|
135
|
+
! Add a short instruction-parsing block or point at project `AGENTS.md`:
|
|
136
|
+
|
|
137
|
+
- Explicit verbs: `implement`, `ship`, `run agents`, `build`.
|
|
138
|
+
- ⊗ Treat checklist presence or broad approval (`sounds good`) as permission to commit.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Migration Checklist
|
|
143
|
+
|
|
144
|
+
Copy when porting a Warp skill to Composer:
|
|
145
|
+
|
|
146
|
+
- [ ] New `name` and `description` with `Do NOT trigger on …` lines
|
|
147
|
+
- [ ] Fast path table (default checkout, shell notes)
|
|
148
|
+
- [ ] Split long content into `references/` (output schema, triage, parity)
|
|
149
|
+
- [ ] Replace "paste scorecard in chat" with script + issue body
|
|
150
|
+
- [ ] Align with project `AGENTS.md` operator voice
|
|
151
|
+
- [ ] `--body-file` for GitHub bodies on Windows-sensitive paths
|
|
152
|
+
- [ ] `references/warp-parity.md` for optional Warp-only steps
|