     gulp.src('styles/app.styl')
         .pipe(plugins.stylus({set: ['include css']}))
         .pipe(gulp.dest(dist))
-    run('styles:doc')
 )
 
-gulp.task('styles:doc', ->
+gulp.task('styles:doc', (done) ->
     yms = require('ym-styleguide')
     fs = require('fs')
     yms.build('styles/', (html) ->
-        fs.writeFile('templates/sections/styleguide/compiled.hbs', html)
+        fs.writeFileSync('templates/sections/styleguide/compiled.hbs', html)
+        done()
     )
 )
 
-gulp.task('styles:compress', ->
+gulp.task('styles:compress', ['styles:build'], ->
     gulp.src(dist + 'app.css')
         .pipe(plugins.minifyCss())
         .pipe(gulp.dest(dist))
 )
 
-gulp.task('styles:watch', ->
+gulp.task('styles:watch', ['styles:build'], ->
     gulp.watch(
         ['styles/*.styl', 'styles/**/*.styl']
         ['styles:build']

    run(
        'clean'
        [
            'static:build'
            'styles:build'
            'scripts:build'
        ]
        [
            'static:watch'
            'styles:watch'
            'scripts:watch'

        .pipe(gulp.dest(dist + 'fonts/'))
)

gulp.task('static:watch', ['static:build'], ->
    gulp.watch(
        staticSrc
        ['static:build']
