<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _specialize(self, reconfigure=False):
 """ Add variables and specialize contexts """

        # add in the 'root_dir' directories to the context dictionaries
        for manifest in [self.source, self.target]:
            context_dict = {}
            if manifest:
                for s in manifest.formula_sections():
                    context_dict["%s:root_dir" % s] = self.directory.install_directory(s)
                    context_dict['config:root_dir'] = self.directory.root_dir
                    context_dict['config:node'] = system.NODE
                manifest.add_additional_context(context_dict)
        self._validate_manifest()
        for feature in self.features.run_order:
            if not reconfigure:
                self.run_action(feature, 'resolve')
            # if a target doesn't exist, no need to prompt.
            instance = self.features[feature]
            if instance.target:
                self.run_action(feature, 'prompt')