# Spell writing handbook

## Introduction

This is a technical reference document.

The first part describes all of the files that are checked for in a spell, their purpose, and documented attributes.
The second part describes the standards we use in the grimoire.

## Spell files

These are the files used during a cast, in their execution order:

• PREPARE – Useful for those rare times when the DETAILS file needs to be modified or the spell or package needs to be configured before the DETAILS file is executed.
• DETAILS – Informational file, required for all spells.
• CONFIGURE – Used to select and modify a package's compile time options.
• DEPENDS – Lists all other spells that are required or optionally required to be cast.
• UP_TRIGGERS – Provides the opportunity to use runtime registration of on_cast triggers.
• SUB_DEPENDS – Used to make a spell depend on another spell with certain features enabled.
• PRE_SUB_DEPENDS – Tells Sorcery whether or not the sub-dependee is providing the given sub-depends.
• TRIGGER_CHECK – Used to inspect each trigger in a spell.

(…Processing of the depended on spells…)

(…DETAILS is run again…)

Build API begin —

— Build API end —

(…The triggered spells are cast now…)

These are the files used during the download, in their execution order:

These are the files used during a dispel, in their execution order:

These are the files used during a resurrect, in their execution order:

These files are processed during a scribe update, cleanse --tablet, or cleanse --tablet_spell, in their execution order:

These files are known as spell filters:

• excluded
• protected
• volatiles
• configs

These are the other files:

• HISTORY
• PROVIDES
• EXPORTS
• SOLO
• services
• init.d directory
• pam.d directory
• xinetd.d directory
• desktop directory